renamed setCursorHotspot2 to setCursorHotspot; fixed (with a hack) cursor in Loom

svn-id: r7132
This commit is contained in:
Max Horn 2003-04-26 13:28:34 +00:00
parent 5626e42f5b
commit 2d8fa42f44
6 changed files with 15 additions and 11 deletions

View File

@ -3218,7 +3218,7 @@ void Scumm::setCursor(int cursor) {
warning("setCursor(%d)", cursor);
}
void Scumm::setCursorHotspot2(int x, int y) {
void Scumm::setCursorHotspot(int x, int y) {
_cursor.hotspotX = x;
_cursor.hotspotY = y;
// FIXME this hacks around offset cursor in the humongous games
@ -3230,7 +3230,7 @@ void Scumm::setCursorHotspot2(int x, int y) {
void Scumm::updateCursor() {
_system->set_mouse_cursor(_grabbedCursor, _cursor.width, _cursor.height,
_cursor.hotspotX, _cursor.hotspotY);
_cursor.hotspotX, _cursor.hotspotY);
}
void Scumm::animateCursor() {
@ -3272,14 +3272,18 @@ void Scumm::decompressDefaultCursor(int idx) {
// FIXME: None of the stock cursors are right for Loom. Why is that?
if ((_gameId == GID_LOOM256) || (_gameId == GID_LOOM)) {
int w;
int w = 0;
_cursor.width = 8;
_cursor.height = 8;
_cursor.hotspotX = 0;
_cursor.hotspotY = 0;
// FIXME - this corrects the cursor hotspot in Loom (EGA)
if (_gameId == GID_LOOM)
_cursor.hotspotY = 15;
for (i = 0, w = 0; i < 8; i++) {
for (i = 0; i < 8; i++) {
w += (i >= 6) ? -2 : 1;
for (j = 0; j < w; j++)
_grabbedCursor[i * 8 + j] = color;

View File

@ -1250,17 +1250,17 @@ void Scumm::setCursorImg(uint img, uint room, uint imgindex) {
findObjectInRoom(&foir, foCodeHeader | foImageHeader | foCheckAlreadyLoaded, img, room);
if (_features & GF_AFTER_V8) {
setCursorHotspot2(READ_LE_UINT32(&foir.imhd->v8.hotspot[0].x),
setCursorHotspot(READ_LE_UINT32(&foir.imhd->v8.hotspot[0].x),
READ_LE_UINT32(&foir.imhd->v8.hotspot[0].y));
w = READ_LE_UINT32(&foir.imhd->v8.width) >> 3;
h = READ_LE_UINT32(&foir.imhd->v8.height) >> 3;
} else if (_features & GF_AFTER_V7) {
setCursorHotspot2(READ_LE_UINT16(&foir.imhd->v7.hotspot[0].x),
setCursorHotspot(READ_LE_UINT16(&foir.imhd->v7.hotspot[0].x),
READ_LE_UINT16(&foir.imhd->v7.hotspot[0].y));
w = READ_LE_UINT16(&foir.imhd->v7.width) >> 3;
h = READ_LE_UINT16(&foir.imhd->v7.height) >> 3;
} else {
setCursorHotspot2(READ_LE_UINT16(&foir.imhd->old.hotspot[0].x),
setCursorHotspot(READ_LE_UINT16(&foir.imhd->old.hotspot[0].x),
READ_LE_UINT16(&foir.imhd->old.hotspot[0].y));
w = READ_LE_UINT16(&foir.cdhd->v6.w) >> 3;
h = READ_LE_UINT16(&foir.cdhd->v6.h) >> 3;

View File

@ -633,7 +633,7 @@ void Scumm_v5::o5_cursorCommand() {
i = getVarOrDirectByte(0x80);
j = getVarOrDirectByte(0x40);
k = getVarOrDirectByte(0x20);
setCursorHotspot2(j, k);
setCursorHotspot(j, k);
break;
case 12: /* init cursor */
setCursor(getVarOrDirectByte(0x80));

View File

@ -820,7 +820,7 @@ void Scumm_v6::o6_cursorCommand() {
}
case 0x9A:
a = pop();
setCursorHotspot2(pop(), a);
setCursorHotspot(pop(), a);
break;
case 0x9C: /* init charset */
initCharset(pop());

View File

@ -829,7 +829,7 @@ void Scumm_v8::o8_cursorCommand() {
break;
case 0xE5: // SO_CURSOR_HOTSPOT Set cursor hotspot
a = pop();
setCursorHotspot2(pop(), a);
setCursorHotspot(pop(), a);
break;
case 0xE6: // SO_CURSOR_TRANSPARENT Set cursor transparent color
makeCursorColorTransparent(pop());

View File

@ -815,7 +815,7 @@ public:
void setCursor(int cursor);
void setCursorImg(uint img, uint room, uint imgindex);
void setCursorHotspot2(int x, int y);
void setCursorHotspot(int x, int y);
void grabCursor(int x, int y, int w, int h);
void grabCursor(byte *ptr, int width, int height);
void makeCursorColorTransparent(int a);