GROOVIE: fix compiler errors and warnings

This commit is contained in:
Die4Ever 2021-09-11 02:14:50 -05:00 committed by Filippos Karapetis
parent cfd928f296
commit 02ade73150
2 changed files with 11 additions and 16 deletions

View File

@ -69,7 +69,7 @@ const byte t7gMidiInitScript[] = {
Script::Script(GroovieEngine *vm, EngineVersion version) :
_code(NULL), _savedCode(NULL), _stacktop(0), _debugger(NULL), _vm(vm),
_videoFile(NULL), _videoRef(UINT32_MAX), _staufsMove(NULL), _lastCursor(0xff),
_videoFile(NULL), _videoRef(UINT_MAX), _staufsMove(NULL), _lastCursor(0xff),
_version(version), _random("GroovieScripts"), _tlcGame(0), _t11hGame(0) {
// Initialize the opcode set depending on the engine version
@ -696,7 +696,7 @@ bool Script::playvideofromref(uint32 fileref, bool loopUntilAudioDone) {
// Close the previous video file
if (_videoFile) {
_videoRef = UINT32_MAX;
_videoRef = UINT_MAX;
delete _videoFile;
}
@ -755,7 +755,7 @@ bool Script::playvideofromref(uint32 fileref, bool loopUntilAudioDone) {
// Close the file
delete _videoFile;
_videoFile = NULL;
_videoRef = UINT32_MAX;
_videoRef = UINT_MAX;
// Clear the input events while playing the video
_eventMouseClicked = 0;
@ -780,7 +780,7 @@ bool Script::playvideofromref(uint32 fileref, bool loopUntilAudioDone) {
}
bool Script::playBackgroundSound(uint32 fileref, uint32 loops) {
if (fileref == -1) {
if (fileref == UINT_MAX) {
return false;
}
@ -861,7 +861,7 @@ void Script::o_hotspot_rect() {
// TLC: The regions for many questions are in an extra database
if (_version == kGroovieTLC && left == 0 && top == 0 && right == 0 && bottom == 0 && _tlcGame != NULL) {
if (_tlcGame->getRegionNext(left, top, right, bottom) < 0) {
debugC(5, kDebugScript, "Groovie::Script: HOTSPOT-RECT(x,x,x,x) @0x%04X cursor=%d SKIPPED", left, top, right, bottom, address, cursor);
debugC(5, kDebugScript, "Groovie::Script: HOTSPOT-RECT(%d,%d,%d,%d) @0x%04X cursor=%d SKIPPED", left, top, right, bottom, address, cursor);
return;
}
}
@ -1695,7 +1695,6 @@ void Script::o_setvideoorigin() {
_bitflags |= 1 << 7;
debugC(1, kDebugScript, "Groovie::Script: SetVideoOrigin(0x%04X,0x%04X) (%d, %d)", origX, origY, origX, origY);
debugC(1, kDebugVideo, "Groovie::Script: SetVideoOrigin(0x % 04X, 0x % 04X) (%d, %d)", origX, origY, origX, origY);
_vm->_videoPlayer->setOrigin(origX, origY);
}

View File

@ -671,7 +671,7 @@ void TlcGame::opFlags() {
_tatFlags[x][y] = 0;
}
}
debugC(1, kDebugTlcGame, "Tlc:TatFlags: Initialized fields", x, y);
debugC(1, kDebugTlcGame, "Tlc:TatFlags: Initialized fields (%d, %d)", x, y);
break;
// Get and set flags
@ -709,18 +709,14 @@ void TlcGame::opFlags() {
}
void TlcGame::debugTatFlags(int y, int y2) {
Common::String s = "Tlc:TatFlags: ";
void TlcGame::debugTatFlags(int y1, int y2) {
Common::String s1, s2;
for (int x = 0; x < 14; x++) {
s += int(_tatFlags[x][y]);
}
y = y2;
s += " ";
for (int x = 0; x < 14; x++) {
s += int(_tatFlags[x][y]);
s1 += int(_tatFlags[x][y1]);
s2 += int(_tatFlags[x][y2]);
}
debugC(5, kDebugTlcGame, s.c_str());
debugC(5, kDebugTlcGame, "Tlc:TatFlags: %s %s", s1.c_str(), s2.c_str());
}