- SQ5 floppy starts now

- Added a new console command, "room", which shows the current room

svn-id: r40943
This commit is contained in:
Filippos Karapetis 2009-05-27 16:45:42 +00:00
parent 9fd5611fe4
commit c75bdbc8e9
4 changed files with 17 additions and 2 deletions

View File

@ -88,6 +88,7 @@ Console::Console(SciEngine *vm) : GUI::Debugger() {
DCmd_Register("man", WRAP_METHOD(Console, cmdMan));
DCmd_Register("hexdump", WRAP_METHOD(Console, cmdHexDump));
DCmd_Register("dissect_script", WRAP_METHOD(Console, cmdDissectScript));
DCmd_Register("room", WRAP_METHOD(Console, cmdRoomNumber));
}
Console::~Console() {
@ -323,4 +324,10 @@ bool Console::cmdDissectScript(int argc, const char **argv) {
return true;
}
bool Console::cmdRoomNumber(int argc, const char **argv) {
DebugPrintf("Current room number is %d\n", g_EngineState->currentRoomNumber());
return true;
}
} // End of namespace Sci

View File

@ -53,6 +53,7 @@ private:
bool cmdMan(int argc, const char **argv);
bool cmdHexDump(int argc, const char **argv);
bool cmdDissectScript(int argc, const char **argv);
bool cmdRoomNumber(int argc, const char **argv);
private:
SciEngine *_vm;

View File

@ -1076,6 +1076,7 @@ reg_t kDoSync(EngineState *s, int funct_nr, int argc, reg_t *argv) {
PUT_SEL32V(argv[1], syncCue, -1);
}
} else if (argc == 7) { // SQ4CD or newer
// TODO
warning("kDoSync: Start called with new semantics - 6 parameters: %d %d %d %d %d %d", UKPV(1), UKPV(2), UKPV(3), UKPV(4), UKPV(5), UKPV(6));
} else { // Hopefully, this should never happen
warning("kDoSync: Start called with an unknown number of parameters (%d)", argc);

View File

@ -264,7 +264,8 @@ static uint8 *create_cursor(gfx_driver_t *drv, gfx_pixmap_t *pointer, int mode)
for (int xc = 0; xc < pointer->index_width; xc++) {
uint8 color = *src;
// FIXME: The palette size check is a workaround for cursors using non-palette colour GFX_CURSOR_TRANSPARENT
if (color < pointer->palette->size())
// Note that some cursors don't have a palette in SQ5
if (pointer->palette && color < pointer->palette->size())
color = pointer->palette->getColor(color).parent_index;
for (int scalectr = 0; scalectr < drv->mode->xfact; scalectr++) {
*pos++ = color;
@ -287,9 +288,14 @@ static int scummvm_set_pointer(gfx_driver_t *drv, gfx_pixmap_t *pointer, Common:
S->pointer_data = create_cursor(drv, pointer, 1);
// FIXME: The palette size check is a workaround for cursors using non-palette colour GFX_CURSOR_TRANSPARENT
// Note that some cursors don't have a palette in SQ5
uint8 color_key = GFX_CURSOR_TRANSPARENT;
if ((pointer->color_key != GFX_PIXMAP_COLOR_KEY_NONE) && ((unsigned int)pointer->color_key < pointer->palette->size()))
if ((pointer->color_key != GFX_PIXMAP_COLOR_KEY_NONE) && (pointer->palette && (unsigned int)pointer->color_key < pointer->palette->size()))
color_key = pointer->palette->getColor(pointer->color_key).parent_index;
// Some cursors in SQ5 don't have a palette. The cursor palette seems to use 64 colors, so setting the color key to 63 works
// TODO: Is this correct?
if (!pointer->palette)
color_key = 63;
g_system->setMouseCursor(S->pointer_data, pointer->width, pointer->height, hotspot->x, hotspot->y, color_key);
g_system->showMouse(true);