Difference between revisions of "SCI/Specifications/Graphics/Cursor resource"

From ScummVM :: Wiki
Jump to navigation Jump to search
(Merging of the SCI documentation)
(No difference)

Revision as of 11:59, 6 January 2009

The Cursor resource

This resource stores a simple bitmap describing the shape and texture of the mouse pointer. All infor­mation stored herein is little endian in byte order.

  • 0x00 - 0x01 X coordinate of the mouse cursor hot spot as a 16 bit integer. This variable is not used in SCI0.
  • 0x02 - 0x03 Y coordinate of the mouse cursor hot spot as a 16 bit integer. Only 0x03 is used in SCI0; here, if set, the hot spot is at (8,8), if not set, it is located at (0,0).
  • 0x04 - 0x23 This is a list of 16 unsigned 16 bit integers constituting bitmasks for the mouse cursor’s transparency map, with the MSB representing the leftmost pixel.
  • 0x24 - 0x43 This is another list of 16 unsigned 16 bit integers. Each of them represents another bitmask, determining whether the mouse cursor pixel should be drawn in black (not set) or white (set).

To determine whether or not to draw a pixel, and, if it is to be drawn, in which color it should be drawn in, the corresponding bits of both bitmask lists mentioned above have to be examined. In the table below, A represents a bit from the first list, and B the corresponding bit from the lower list.

Color mapping for the SCI0 mouse pointer

AB Result
00 Transparent
01 Transparent
10 0x00 (Black)
11 0x0f (White)


Color mapping for the SCI1 mouse pointer

Since this method of doing things wastes one combination, the table was changed for SCI01 and SCI1:

AB Result
00 Transparent
01 0x0f (White)
10 0x00 (Black)
11 0x07 (Light Gray)