parent
bb0b18515b
commit
103cbac40a
3 changed files with 19 additions and 3 deletions
|
@ -64,7 +64,7 @@ static uint16 default_cursor_images[5][16] = {
|
||||||
0x1004, 0x2002, 0x0000, 0x0080, 0x01c0, 0x02a0, 0x0080, 0x0000 },
|
0x1004, 0x2002, 0x0000, 0x0080, 0x01c0, 0x02a0, 0x0080, 0x0000 },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const byte default_cursor_hotspots[10] = {
|
static byte default_cursor_hotspots[10] = {
|
||||||
8, 7, 8, 7, 1, 1, 5, 0,
|
8, 7, 8, 7, 1, 1, 5, 0,
|
||||||
8, 7, //zak256
|
8, 7, //zak256
|
||||||
};
|
};
|
||||||
|
@ -255,13 +255,14 @@ void ScummEngine_v6::useBompCursor(const byte *im, int width, int height) {
|
||||||
|
|
||||||
void ScummEngine::redefineBuiltinCursorFromChar(int index, int chr) {
|
void ScummEngine::redefineBuiltinCursorFromChar(int index, int chr) {
|
||||||
// Cursor image in both Looms are based on images from charset.
|
// Cursor image in both Looms are based on images from charset.
|
||||||
// For now we don't handle them.
|
|
||||||
if (_gameId != GID_LOOM && _gameId != GID_LOOM256) {
|
if (_gameId != GID_LOOM && _gameId != GID_LOOM256) {
|
||||||
// FIXME: Actually: is this opcode ever called by a non-Loom game?
|
// FIXME: Actually: is this opcode ever called by a non-Loom game?
|
||||||
// Which V3-V5 game besides Loom makes use of custom cursors, ever?
|
// Which V3-V5 game besides Loom makes use of custom cursors, ever?
|
||||||
warning("V3--V5 SO_CURSOR_IMAGE(%d,%d) called - tell Fingolfin where you saw this!", index, chr);
|
warning("V3--V5 SO_CURSOR_IMAGE(%d,%d) called - tell Fingolfin where you saw this!", index, chr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(index >= 0 && index < 5);
|
||||||
|
|
||||||
// const int oldID = _charset->getCurID();
|
// const int oldID = _charset->getCurID();
|
||||||
|
|
||||||
if (_version == 3) {
|
if (_version == 3) {
|
||||||
|
@ -295,6 +296,20 @@ void ScummEngine::redefineBuiltinCursorFromChar(int index, int chr) {
|
||||||
// _charset->setCurID(oldID);
|
// _charset->setCurID(oldID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScummEngine::redefineBuiltinCursorHotspot(int index, int x, int y) {
|
||||||
|
// Cursor image in both Looms are based on images from charset.
|
||||||
|
if (_gameId != GID_LOOM && _gameId != GID_LOOM256) {
|
||||||
|
// FIXME: Actually: is this opcode ever called by a non-Loom game?
|
||||||
|
// Which V3-V5 game besides Loom makes use of custom cursors, ever?
|
||||||
|
warning("V3--V5 SO_CURSOR_HOTSPOT(%d,%d,%d) called - tell Fingolfin where you saw this!", index, x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(index >= 0 && index < 5);
|
||||||
|
|
||||||
|
default_cursor_hotspots[index * 2] = x;
|
||||||
|
default_cursor_hotspots[index * 2 + 1] = y;
|
||||||
|
}
|
||||||
|
|
||||||
void ScummEngine::setBuiltinCursor(int idx) {
|
void ScummEngine::setBuiltinCursor(int idx) {
|
||||||
int i, j;
|
int i, j;
|
||||||
byte color;
|
byte color;
|
||||||
|
|
|
@ -683,7 +683,7 @@ void ScummEngine_v5::o5_cursorCommand() {
|
||||||
i = getVarOrDirectByte(PARAM_1);
|
i = getVarOrDirectByte(PARAM_1);
|
||||||
j = getVarOrDirectByte(PARAM_2);
|
j = getVarOrDirectByte(PARAM_2);
|
||||||
k = getVarOrDirectByte(PARAM_3);
|
k = getVarOrDirectByte(PARAM_3);
|
||||||
setCursorHotspot(j, k);
|
redefineBuiltinCursorHotspot(i, j, k);
|
||||||
break;
|
break;
|
||||||
case 12: // SO_CURSOR_SET
|
case 12: // SO_CURSOR_SET
|
||||||
i = getVarOrDirectByte(PARAM_1);
|
i = getVarOrDirectByte(PARAM_1);
|
||||||
|
|
|
@ -943,6 +943,7 @@ protected:
|
||||||
|
|
||||||
void setBuiltinCursor(int index);
|
void setBuiltinCursor(int index);
|
||||||
void redefineBuiltinCursorFromChar(int index, int chr);
|
void redefineBuiltinCursorFromChar(int index, int chr);
|
||||||
|
void redefineBuiltinCursorHotspot(int index, int x, int y);
|
||||||
void grabCursor(int x, int y, int w, int h);
|
void grabCursor(int x, int y, int w, int h);
|
||||||
void setCursorFromBuffer(byte *ptr, int width, int height, int pitch);
|
void setCursorFromBuffer(byte *ptr, int width, int height, int pitch);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue