aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Brown2002-03-24 16:35:17 +0000
committerJames Brown2002-03-24 16:35:17 +0000
commit7b93625b1759388807c7fc2eba3c16be19198b54 (patch)
tree53fa6db940c77ef9c41f2a515a83d6c6bedf4219
parentad70aad4ca161d74fb5b115f4bf137aaed795b8b (diff)
downloadscummvm-rg350-7b93625b1759388807c7fc2eba3c16be19198b54.tar.gz
scummvm-rg350-7b93625b1759388807c7fc2eba3c16be19198b54.tar.bz2
scummvm-rg350-7b93625b1759388807c7fc2eba3c16be19198b54.zip
Add a few more uninited variables. Not done yet.
svn-id: r3812
-rw-r--r--gfx.cpp10
-rw-r--r--sdl.cpp24
2 files changed, 29 insertions, 5 deletions
diff --git a/gfx.cpp b/gfx.cpp
index 56785d286d..15d3c9a6fb 100644
--- a/gfx.cpp
+++ b/gfx.cpp
@@ -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);
diff --git a/sdl.cpp b/sdl.cpp
index 05386c71d8..8c86127918 100644
--- a/sdl.cpp
+++ b/sdl.cpp
@@ -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;