aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise/function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cruise/function.cpp')
-rw-r--r--engines/cruise/function.cpp56
1 files changed, 35 insertions, 21 deletions
diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp
index dc4303c286..3f794c4e70 100644
--- a/engines/cruise/function.cpp
+++ b/engines/cruise/function.cpp
@@ -196,13 +196,22 @@ int16 Op_Random() {
int16 Op_PlayFX() {
int volume = popVar();
+
+#if 0
int speed = popVar();
- /*int channelNum = */popVar();
+ int channelNum = popVar();
+#else
+ popVar();
+ popVar();
+#endif
+
int sampleNum = popVar();
if ((sampleNum >= 0) && (sampleNum < NUM_FILE_ENTRIES) && (filesDatabase[sampleNum].subData.ptr)) {
+#if 0
if (speed == -1)
speed = filesDatabase[sampleNum].subData.transparency;
+#endif
_vm->sound().playSound(filesDatabase[sampleNum].subData.ptr,
filesDatabase[sampleNum].width, volume);
@@ -213,13 +222,23 @@ int16 Op_PlayFX() {
int16 Op_LoopFX() {
int volume = popVar();
+
+#if 0
int speed = popVar();
- /*int channelNum = */popVar();
+ int channelNum = popVar();
+#else
+ popVar();
+ popVar();
+#endif
+
int sampleNum = popVar();
if ((sampleNum >= 0) && (sampleNum < NUM_FILE_ENTRIES) && (filesDatabase[sampleNum].subData.ptr)) {
+
+#if 0
if (speed == -1)
speed = filesDatabase[sampleNum].subData.transparency;
+#endif
_vm->sound().playSound(filesDatabase[sampleNum].subData.ptr,
filesDatabase[sampleNum].width, volume);
@@ -552,15 +571,13 @@ int16 Op_LoadFrame() {
}
int16 Op_LoadAbs() {
- int slot;
- char name[36] = "";
- char *ptr;
int result = 0;
- ptr = (char *) popPtr();
- slot = popVar();
+ char *ptr = (char *) popPtr();
+ int slot = popVar();
if ((slot >= 0) && (slot < NUM_FILE_ENTRIES)) {
+ char name[36] = "";
Common::strlcpy(name, ptr, sizeof(name));
strToUpper(name);
@@ -627,7 +644,7 @@ int16 Op_FadeOut() {
flip();
fadeFlag = 1;
- PCFadeFlag = 1;
+ PCFadeFlag = true;
return 0;
}
@@ -1082,11 +1099,6 @@ actorStruct *addAnimation(actorStruct * pHead, int overlay, int objIdx, int para
pCurrent = pPrevious->next;
}
- if (pCurrent && (pCurrent->overlayNumber == overlay)
- && (pCurrent->idx == objIdx) && (pCurrent->type == param2)) {
- return NULL;
- }
-
actorStruct *pNewElement = (actorStruct *) MemAlloc(sizeof(actorStruct));
if (!pNewElement)
return NULL;
@@ -1365,12 +1377,11 @@ int16 Op_RestoreSong() {
}
int16 Op_SongSize() {
- int size, oldSize;
-
+ int oldSize;
if (_vm->sound().songLoaded()) {
oldSize = _vm->sound().numOrders();
- size = popVar();
+ int size = popVar();
if ((size >= 1) && (size < 128))
_vm->sound().setNumOrders(size);
} else
@@ -1500,8 +1511,9 @@ int16 Op_Itoa() {
int nbp = popVar();
int param[160];
char txt[40];
- char format[30];
- char nbf[20];
+
+ for (int i = 0; i < 160; ++i)
+ param[i] = 0;
for (int i = nbp - 1; i >= 0; i--)
param[i] = popVar();
@@ -1512,6 +1524,8 @@ int16 Op_Itoa() {
if (!nbp)
sprintf(txt, "%d", val);
else {
+ char format[30];
+ char nbf[20];
strcpy(format, "%");
sprintf(nbf, "%d", param[0]);
strcat(format, nbf);
@@ -1597,7 +1611,7 @@ int16 Op_GetNodeX() {
int result = getNode(nodeInfo, node);
- ASSERT(result == 0);
+ assert(result == 0);
return nodeInfo[0];
}
@@ -1609,7 +1623,7 @@ int16 Op_GetNodeY() {
int result = getNode(nodeInfo, node);
- ASSERT(result == 0);
+ assert(result == 0);
return nodeInfo[1];
}
@@ -1818,7 +1832,7 @@ int16 Op_ThemeReset() {
}
int16 Op_UserWait() {
- userWait = 1;
+ userWait = true;
if (currentScriptPtr->type == scriptType_PROC) {
changeScriptParamInList(currentScriptPtr->overlayNumber, currentScriptPtr->scriptNumber, &procHead, -1, 9999);
} else if (currentScriptPtr->type == scriptType_REL) {