[Scummvm-cvs-logs] SF.net SVN: scummvm: [29897] scummvm/trunk/engines/cruise
yazoo at users.sourceforge.net
yazoo at users.sourceforge.net
Mon Dec 17 23:40:58 CET 2007
Revision: 29897
http://scummvm.svn.sourceforge.net/scummvm/?rev=29897&view=rev
Author: yazoo
Date: 2007-12-17 14:40:58 -0800 (Mon, 17 Dec 2007)
Log Message:
-----------
Fix dangling pointer
Fix low color background
Fix input
Modified Paths:
--------------
scummvm/trunk/engines/cruise/cruise_main.cpp
scummvm/trunk/engines/cruise/function.cpp
scummvm/trunk/engines/cruise/gfxModule.cpp
scummvm/trunk/engines/cruise/script.cpp
Modified: scummvm/trunk/engines/cruise/cruise_main.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.cpp 2007-12-17 22:36:16 UTC (rev 29896)
+++ scummvm/trunk/engines/cruise/cruise_main.cpp 2007-12-17 22:40:58 UTC (rev 29897)
@@ -1047,7 +1047,16 @@
if ( (!first) && ((testState==-1) || (testState==objectState))) {
if (!strlen(verbe_name))
- attacheNewScriptToTail(&relHead, j, ptrHead->id, 30, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_REL);
+ {
+ if(currentScriptPtr)
+ {
+ attacheNewScriptToTail(&relHead, j, ptrHead->id, 30, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_REL);
+ }
+ else
+ {
+ attacheNewScriptToTail(&relHead, j, ptrHead->id, 30, 0, 0, scriptType_REL);
+ }
+ }
else if (ovl2->nameVerbGlob) {
found = true;
ptr = getObjectName(ptrHead->verbNumber, ovl2->nameVerbGlob);
@@ -1120,39 +1129,46 @@
if ((pHeader->obj2OldState == -1) || (params.scale == pHeader->obj2OldState)) {
if (pHeader->type == 30) { // REL
- attacheNewScriptToTail(&relHead, ovlIdx, pHeader->id, 30, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_REL);
+ if(currentScriptPtr)
+ {
+ attacheNewScriptToTail(&relHead, ovlIdx, pHeader->id, 30, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_REL);
+ }
+ else
+ {
+ attacheNewScriptToTail(&relHead, ovlIdx, pHeader->id, 30, 0, 0, scriptType_REL);
+ }
- if ((narratorOvl > 0) && (pHeader->trackX != -1) && (pHeader->trackY != -1)) {
- actorStruct* pTrack = findActor(&actorHead, narratorOvl, narratorIdx, 0);
+ if ((narratorOvl > 0) && (pHeader->trackX != -1) && (pHeader->trackY != -1)) {
+ actorStruct* pTrack = findActor(&actorHead, narratorOvl, narratorIdx, 0);
- if (pTrack) {
- animationStart = false;
+ if (pTrack) {
+ animationStart = false;
- if (pHeader->trackDirection == 9999) {
- objectParamsQuery naratorParams;
- getMultipleObjectParam(narratorOvl, narratorIdx, &naratorParams);
- pTrack->x_dest = naratorParams.X;
- pTrack->y_dest = naratorParams.Y;
- pTrack->endDirection = direction(naratorParams.X, naratorParams.Y, pTrack->x_dest, pTrack->y_dest, 0, 0);
- } else if ((pHeader->trackX == 9999) && (pHeader->trackY == 9999)) {
- objectParamsQuery naratorParams;
- getMultipleObjectParam(narratorOvl, narratorIdx, &naratorParams);
- pTrack->x_dest = naratorParams.X;
- pTrack->y_dest = naratorParams.Y;
- pTrack->endDirection = pHeader->trackDirection;
- } else {
- pTrack->x_dest = pHeader->trackX;
- pTrack->y_dest = pHeader->trackY;
- pTrack->endDirection = pHeader->trackDirection;
- }
+ if (pHeader->trackDirection == 9999) {
+ objectParamsQuery naratorParams;
+ getMultipleObjectParam(narratorOvl, narratorIdx, &naratorParams);
+ pTrack->x_dest = naratorParams.X;
+ pTrack->y_dest = naratorParams.Y;
+ pTrack->endDirection = direction(naratorParams.X, naratorParams.Y, pTrack->x_dest, pTrack->y_dest, 0, 0);
+ } else if ((pHeader->trackX == 9999) && (pHeader->trackY == 9999)) {
+ objectParamsQuery naratorParams;
+ getMultipleObjectParam(narratorOvl, narratorIdx, &naratorParams);
+ pTrack->x_dest = naratorParams.X;
+ pTrack->y_dest = naratorParams.Y;
+ pTrack->endDirection = pHeader->trackDirection;
+ } else {
+ pTrack->x_dest = pHeader->trackX;
+ pTrack->y_dest = pHeader->trackY;
+ pTrack->endDirection = pHeader->trackDirection;
+ }
- pTrack->flag = 1;
+ pTrack->flag = 1;
- autoTrack = true;
- userEnabled = 0;
- changeScriptParamInList(ovlIdx, pHeader->id, &relHead, 0, 9998);
+ autoTrack = true;
+ userEnabled = 0;
+ changeScriptParamInList(ovlIdx, pHeader->id, &relHead, 0, 9998);
+ }
}
- }
} else if (pHeader->type == 50) {
ASSERT(0);
}
@@ -1183,7 +1199,14 @@
if (pHeader->obj2Number == nObj2) {
// REL
if (pHeader->type == 30) {
- attacheNewScriptToTail(&relHead, ovlIdx, pHeader->id, 30, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_REL);
+ if(currentScriptPtr)
+ {
+ attacheNewScriptToTail(&relHead, ovlIdx, pHeader->id, 30, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_REL);
+ }
+ else
+ {
+ attacheNewScriptToTail(&relHead, ovlIdx, pHeader->id, 30, 0, 0, scriptType_REL);
+ }
if ((narratorOvl > 0) && (pHeader->trackX != -1) && (pHeader->trackY != -1)) {
actorStruct* pTrack = findActor(&actorHead, narratorOvl, narratorIdx, 0);
@@ -1247,7 +1270,14 @@
}
}
- createTextObject(&cellHead, ovlIdx, pHeader->id, x, y, 200, findHighColor(), currentActiveBackgroundPlane, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber);
+ if(currentScriptPtr)
+ {
+ createTextObject(&cellHead, ovlIdx, pHeader->id, x, y, 200, findHighColor(), currentActiveBackgroundPlane, currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber);
+ }
+ else
+ {
+ createTextObject(&cellHead, ovlIdx, pHeader->id, x, y, 200, findHighColor(), currentActiveBackgroundPlane, 0, 0);
+ }
userWait = 1;
autoOvl = ovlIdx;
Modified: scummvm/trunk/engines/cruise/function.cpp
===================================================================
--- scummvm/trunk/engines/cruise/function.cpp 2007-12-17 22:36:16 UTC (rev 29896)
+++ scummvm/trunk/engines/cruise/function.cpp 2007-12-17 22:40:58 UTC (rev 29897)
@@ -1550,6 +1550,30 @@
return 0;
}
+int16 Op_UserDelay(void)
+{
+ int delay = popVar();
+
+ if(delay >= 0)
+ {
+ userDelay = delay;
+ }
+
+ return userDelay;
+}
+
+int16 Op_UserWait(void)
+{
+ userWait = 1;
+ if (currentScriptPtr->type == scriptType_PROC) {
+ changeScriptParamInList(currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber, &procHead, -1, 9999);
+ } else if (currentScriptPtr->type == scriptType_REL) {
+ changeScriptParamInList(currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber, &relHead, -1, 9999);
+ }
+
+ return 0;
+}
+
void setupOpcodeTable(void) {
int i;
@@ -1577,7 +1601,7 @@
opcodeTablePtr[0x12] = NULL; // used to be exec debug
opcodeTablePtr[0x13] = Op_AddMessage;
opcodeTablePtr[0x14] = Op_RemoveMessage;
- opcodeTablePtr[0x15] = NULL; // user wait
+ opcodeTablePtr[0x15] = Op_UserWait;
opcodeTablePtr[0x16] = Op_FreezeCell;
opcodeTablePtr[0x17] = Op_LoadCt;
opcodeTablePtr[0x18] = Op_AddAnimation;
@@ -1604,6 +1628,7 @@
opcodeTablePtr[0x32] = Op_freeBackgroundInscrustList;
opcodeTablePtr[0x33] = Op_DialogOn;
opcodeTablePtr[0x34] = Op_DialogOff;
+ opcodeTablePtr[0x35] = Op_UserDelay;
opcodeTablePtr[0x37] = Op_37;
opcodeTablePtr[0x38] = Op_removeBackground;
opcodeTablePtr[0x39] = Op_SetActiveBackgroundPlane;
Modified: scummvm/trunk/engines/cruise/gfxModule.cpp
===================================================================
--- scummvm/trunk/engines/cruise/gfxModule.cpp 2007-12-17 22:36:16 UTC (rev 29896)
+++ scummvm/trunk/engines/cruise/gfxModule.cpp 2007-12-17 22:40:58 UTC (rev 29897)
@@ -62,11 +62,10 @@
*(buffer + (8000 * bitPlaneNumber)) = data;
}
-void gfxModuleData_field_60(char *sourcePtr, int width, int height,
- char *destPtr, int x_, int y_) {
+void gfxModuleData_field_60(char *sourcePtr, int width, int height, char *destPtr, int x_, int y_) {
for (int y = 0; y < height; ++y) {
- for (int x = 0; x < width / 8; ++x) {
+ for (int x = 0; x < width; ++x) {
for (int bit = 0; bit < 16; ++bit) {
uint8 color = 0;
for (int p = 0; p < 4; ++p) {
Modified: scummvm/trunk/engines/cruise/script.cpp
===================================================================
--- scummvm/trunk/engines/cruise/script.cpp 2007-12-17 22:36:16 UTC (rev 29896)
+++ scummvm/trunk/engines/cruise/script.cpp 2007-12-17 22:40:58 UTC (rev 29897)
@@ -738,6 +738,8 @@
}
} while (!opcodeTypeTable[(opcodeType & 0xFB) >> 3] ());
+ currentScriptPtr = NULL;
+
return (0);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list