diff options
| -rw-r--r-- | gfx.cpp | 10 | ||||
| -rw-r--r-- | sdl.cpp | 24 |
2 files changed, 29 insertions, 5 deletions
@@ -455,6 +455,9 @@ void Scumm::cyclePalette() { if (valueToAdd < _vars[VAR_TIMER_NEXT]) valueToAdd = _vars[VAR_TIMER_NEXT]; + if (!_colorCycle) // FIXME + return; + for (i=0,cycl=_colorCycle; i<16; i++,cycl++) { if (cycl->delay && (cycl->counter+=valueToAdd) >= cycl->delay) { @@ -499,7 +502,12 @@ void Scumm::moveMemInPalRes(int start, int end, byte direction) { endptr2 = getResourceAddress(rtTemp, 5) + end * 6; num = end - start; - + + if (!endptr) { + warning("moveMemInPalRes(%d,%d): Bad end pointer\n", start, end); + return; + } + if (!direction) { memmove(tmp, endptr, 6); memmove(startptr+6, startptr, num*6); @@ -918,8 +918,10 @@ int main(int argc, char* argv[]) { #endif + long i; + detecter.detectMain(argc, argv); if( detecter._features & GF_AFTER_V7 ) // not final implementation. This is just a test @@ -927,11 +929,12 @@ int main(int argc, char* argv[]) { else if( detecter._features & GF_OLD256 ) scumm = new Scumm_v3; + else scumm = new Scumm; -/* All those stuff should be moved to the constructor.... */ +/* All those stuff should be moved to the constructor.... */ for (i=0;i<17;i++) { scumm->res.address[i]=0; @@ -972,13 +975,12 @@ int main(int argc, char* argv[]) { scumm->vm.cutSceneScriptIndex=0; scumm->vm.cutSceneStackPointer=0; - + scumm->_scummStackPos=0; scumm->_verbMouseOver=0; scumm->_palDirtyMax=0; scumm->_palDirtyMin=0; - scumm->_debugger=0; scumm->camera._cur.x=0; scumm->camera._cur.y=0; @@ -998,7 +1000,6 @@ int main(int argc, char* argv[]) { scumm->mouse.y=0; scumm->delta=0; - scumm->_soundEngine=0; scumm->_gui=0; @@ -1015,9 +1016,24 @@ int main(int argc, char* argv[]) { scumm->_talk_sound_mode=0; + scumm->_curActor = 0; + scumm->_curExecScript = 0; + scumm->_curPalIndex = 0; + scumm->_curVerb = 0; + scumm->_curVerbSlot = 0; + scumm->_currentScript = 0; + scumm->_currentRoom = 0; + + scumm->_soundQuePos = 0; + scumm->_soundQue2Pos = 0; + + scumm->_screenEffectFlag = 0; + memset(scumm->_colorCycle, 0, sizeof(scumm->_colorCycle)); /* */ + + scumm->_fullScreen = detecter._fullScreen; scumm->_debugMode = detecter._debugMode; scumm->_bootParam = detecter._bootParam; |
