aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-01-09 14:52:39 +0000
committerTorbjörn Andersson2004-01-09 14:52:39 +0000
commitb9c3b7b008a0deb80d30f3ac622c50535be5a52a (patch)
treeb4b7ef329dd1bba93b1fde4a2511abde5d0f17df /sword2
parentb85248aa135671e6e84db2299cd44f4a5a704398 (diff)
downloadscummvm-rg350-b9c3b7b008a0deb80d30f3ac622c50535be5a52a.tar.gz
scummvm-rg350-b9c3b7b008a0deb80d30f3ac622c50535be5a52a.tar.bz2
scummvm-rg350-b9c3b7b008a0deb80d30f3ac622c50535be5a52a.zip
Removed redundant comments.
svn-id: r12279
Diffstat (limited to 'sword2')
-rw-r--r--sword2/anims.cpp48
-rw-r--r--sword2/events.cpp7
-rw-r--r--sword2/function.cpp8
-rw-r--r--sword2/icons.cpp2
-rw-r--r--sword2/interpreter.h10
-rw-r--r--sword2/logic.cpp8
-rw-r--r--sword2/speech.cpp21
-rw-r--r--sword2/sync.cpp1
-rw-r--r--sword2/walker.cpp2
9 files changed, 11 insertions, 96 deletions
diff --git a/sword2/anims.cpp b/sword2/anims.cpp
index b184157c27..9cc9dcff90 100644
--- a/sword2/anims.cpp
+++ b/sword2/anims.cpp
@@ -303,8 +303,6 @@ int32 Logic::fnNoSprite(int32 *params) {
// remove previous status (but don't affect the shading upper-word)
ob_graphic->type &= 0xffff0000;
ob_graphic->type |= NO_SPRITE;
-
- // continue script
return IR_CONT;
}
@@ -316,8 +314,6 @@ int32 Logic::fnBackPar0Sprite(int32 *params) {
// remove previous status (but don't affect the shading upper-word)
ob_graphic->type &= 0xffff0000;
ob_graphic->type |= BGP0_SPRITE;
-
- // continue script
return IR_CONT;
}
@@ -329,8 +325,6 @@ int32 Logic::fnBackPar1Sprite(int32 *params) {
// remove previous status (but don't affect the shading upper-word)
ob_graphic->type &= 0xffff0000;
ob_graphic->type |= BGP1_SPRITE;
-
- // continue script
return IR_CONT;
}
@@ -342,8 +336,6 @@ int32 Logic::fnBackSprite(int32 *params) {
// remove previous status (but don't affect the shading upper-word)
ob_graphic->type &= 0xffff0000;
ob_graphic->type |= BACK_SPRITE;
-
- // continue script
return IR_CONT;
}
@@ -355,8 +347,6 @@ int32 Logic::fnSortSprite(int32 *params) {
// remove previous status (but don't affect the shading upper-word)
ob_graphic->type &= 0xffff0000;
ob_graphic->type |= SORT_SPRITE;
-
- // continue script
return IR_CONT;
}
@@ -368,8 +358,6 @@ int32 Logic::fnForeSprite(int32 *params) {
// remove previous status (but don't affect the shading upper-word)
ob_graphic->type &= 0xffff0000;
ob_graphic->type |= FORE_SPRITE;
-
- // continue script
return IR_CONT;
}
@@ -381,8 +369,6 @@ int32 Logic::fnForePar0Sprite(int32 *params) {
// remove previous status (but don't affect the shading upper-word)
ob_graphic->type &= 0xffff0000;
ob_graphic->type |= FGP0_SPRITE;
-
- // continue script
return IR_CONT;
}
@@ -394,8 +380,6 @@ int32 Logic::fnForePar1Sprite(int32 *params) {
// remove previous status (but don't affect the shading upper-word)
ob_graphic->type &= 0xffff0000;
ob_graphic->type |= FGP1_SPRITE;
-
- // continue script
return IR_CONT;
}
@@ -405,13 +389,10 @@ int32 Logic::fnShadedSprite(int32 *params) {
ObjectGraphic *ob_graphic = (ObjectGraphic *) _vm->_memory->intToPtr(params[0]);
// remove previous status (but don't affect the shading upper-word)
- ob_graphic->type &= 0x0000ffff;
- ob_graphic->type |= SHADED_SPRITE;
-
// note that drivers may still shade mega frames automatically, even
// when not sent 'RDSPR_SHADOW'
-
- // continue script
+ ob_graphic->type &= 0x0000ffff;
+ ob_graphic->type |= SHADED_SPRITE;
return IR_CONT;
}
@@ -423,26 +404,9 @@ int32 Logic::fnUnshadedSprite(int32 *params) {
// remove previous status (but don't affect the shading upper-word)
ob_graphic->type &= 0x0000ffff;
ob_graphic->type |= UNSHADED_SPRITE;
-
- // continue script
return IR_CONT;
}
-// Notes on PlaySmacker()
-
-// 1st param is filename of sequence file
-// 2nd param is a pointer to a null-terminated array of pointers to
-// MovieTextObject structures
-
-//int32 PlaySmacker(char *filename, MovieTextObject *textObjects[]);
-
-// struct MovieTextObject {
-// uint16 startFrame;
-// uint16 endFrame;
-// SpriteInfo *textSprite;
-// _wavHeader *speech;
-// };
-
int32 Logic::fnAddSequenceText(int32 *params) {
// params: 0 text number
// 1 frame number to start the text displaying
@@ -454,8 +418,6 @@ int32 Logic::fnAddSequenceText(int32 *params) {
_sequenceTextList[_sequenceTextLines].startFrame = params[1];
_sequenceTextList[_sequenceTextLines].endFrame = (uint16) params[2];
_sequenceTextLines++;
-
- // continue script
return IR_CONT;
}
@@ -637,8 +599,6 @@ int32 Logic::fnSmackerLeadIn(int32 *params) {
// fade out any music that is currently playing
fnStopMusic(NULL);
-
- // continue script
return IR_CONT;
}
@@ -647,8 +607,6 @@ int32 Logic::fnSmackerLeadOut(int32 *params) {
// ready for use in fnPlaySequence
_smackerLeadOut = params[0];
-
- // continue script
return IR_CONT;
}
@@ -751,8 +709,6 @@ int32 Logic::fnPlaySequence(int32 *params) {
_vm->_graphics->setPalette(0, 256, (uint8 *) pal, RDPAL_INSTANT);
debug(5, "fnPlaySequence FINISHED");
-
- // continue script
return IR_CONT;
}
diff --git a/sword2/events.cpp b/sword2/events.cpp
index 57dd180590..5a55851337 100644
--- a/sword2/events.cpp
+++ b/sword2/events.cpp
@@ -199,7 +199,6 @@ int32 Logic::fnPauseForEvent(int32 *params) {
// start the pause
if (ob_logic->looping == 0) {
ob_logic->looping = 1;
- // no. of game cycles
ob_logic->pause = params[1];
}
@@ -207,14 +206,10 @@ int32 Logic::fnPauseForEvent(int32 *params) {
if (ob_logic->pause) {
// decrement the pause count
ob_logic->pause--;
-
- // drop out of script, but call this again next cycle
return IR_REPEAT;
} else {
- // pause count is zerp
+ // pause count is zero
ob_logic->looping = 0;
-
- // continue script
return IR_CONT;
}
}
diff --git a/sword2/function.cpp b/sword2/function.cpp
index 5166f23ad8..fbde8e44d3 100644
--- a/sword2/function.cpp
+++ b/sword2/function.cpp
@@ -56,8 +56,6 @@ int32 Logic::fnNewScript(int32 *params) {
PLAYER_ACTION = 0;
logicReplace(params[0]);
-
- // drop out no pc save - and around again
return IR_TERMINATE;
}
@@ -153,13 +151,9 @@ int32 Logic::fnPause(int32 *params) {
if (ob_logic->pause) {
// decrement the pause count
ob_logic->pause--;
-
- // drop out of script, but call this again next cycle
return IR_REPEAT;
} else {
ob_logic->looping = 0;
-
- // continue script
return IR_CONT;
}
}
@@ -227,8 +221,6 @@ int32 Logic::fnSetValue(int32 *params) {
ObjectMega *ob_mega = (ObjectMega *) _vm->_memory->intToPtr(params[0]);
ob_mega->megaset_res = params[1];
-
- // continue script
return IR_CONT;
}
diff --git a/sword2/icons.cpp b/sword2/icons.cpp
index adeaa7d07a..1bcb316fe9 100644
--- a/sword2/icons.cpp
+++ b/sword2/icons.cpp
@@ -33,7 +33,6 @@ int32 Logic::fnAddMenuObject(int32 *params) {
memcpy(&_vm->_tempList[_vm->_totalTemp], _vm->_memory->intToPtr(params[0]), sizeof(MenuObject));
_vm->_totalTemp++;
- // script continue
return IR_CONT;
}
@@ -54,7 +53,6 @@ int32 Logic::fnRefreshInventory(int32 *params) {
_vm->buildMenu();
_vm->_examiningMenuIcon = false;
- // script continue
return IR_CONT;
}
diff --git a/sword2/interpreter.h b/sword2/interpreter.h
index 60e65f27ae..47d151723f 100644
--- a/sword2/interpreter.h
+++ b/sword2/interpreter.h
@@ -25,11 +25,11 @@ namespace Sword2 {
// Interpreter return codes
enum {
- IR_STOP = 0,
- IR_CONT = 1,
- IR_TERMINATE = 2,
- IR_REPEAT = 3,
- IR_GOSUB = 4
+ IR_STOP = 0, // Quit for a cycle
+ IR_CONT = 1, // Continue as normal
+ IR_TERMINATE = 2, // Return without updating the offset
+ IR_REPEAT = 3, // Return; offset at start of function call
+ IR_GOSUB = 4 // Return with updated offset
};
// Get parameter fix so that the playstation version can handle words not on
diff --git a/sword2/logic.cpp b/sword2/logic.cpp
index f6c2d9b7db..3f67dfaa69 100644
--- a/sword2/logic.cpp
+++ b/sword2/logic.cpp
@@ -365,8 +365,6 @@ int32 Logic::fnTotalRestart(int32 *params) {
// params: none
totalRestart();
-
- // drop out without saving pc and go around again
return IR_TERMINATE;
}
@@ -397,11 +395,8 @@ int32 Logic::fnAddToKillList(int32 *params) {
// (otherwise finish)
if (entry == _kills) {
-#ifdef _SWORD2_DEBUG
// no room at the inn
- if (_kills == OBJECT_KILL_LIST_SIZE)
- error("List full in fnAddToKillList(%u)", ID);
-#endif
+ assert(_kills < OBJECT_KILL_LIST_SIZE);
// add this 'ID' to the kill list
_objectKillList[_kills] = ID;
@@ -417,7 +412,6 @@ int32 Logic::fnAddToKillList(int32 *params) {
}
}
- // continue script
return IR_CONT;
}
diff --git a/sword2/speech.cpp b/sword2/speech.cpp
index e81ac266cb..f053b6550d 100644
--- a/sword2/speech.cpp
+++ b/sword2/speech.cpp
@@ -173,8 +173,6 @@ int32 Logic::fnChoose(int32 *params) {
_vm->setMouse(NORMAL_MOUSE_ID);
_choosing = true;
-
- // again next cycle
return IR_REPEAT;
}
@@ -272,7 +270,6 @@ int32 Logic::fnEndConversation(int32 *params) {
// restart george's base script
// totalRestart();
- //drop out without saving pc and go around again
return IR_CONT;
}
@@ -420,8 +417,6 @@ int32 Logic::fnTheyDoWeWait(int32 *params) {
// debug flag to indicate who we're waiting for - see debug.cpp
_speechScriptWaiting = target;
-
- // see ya next cycle
return IR_REPEAT;
}
@@ -595,7 +590,6 @@ int32 Logic::fnSpeechProcess(int32 *params) {
ob_speech->wait_state = 1;
}
- // come back again next cycle
return IR_REPEAT;
case INS_turn:
pars[0] = params[2]; // ob_logic
@@ -612,7 +606,6 @@ int32 Logic::fnSpeechProcess(int32 *params) {
ob_speech->wait_state = 1;
}
- // come back again next cycle
return IR_REPEAT;
case INS_face:
pars[0] = params[2]; // ob_logic
@@ -629,7 +622,6 @@ int32 Logic::fnSpeechProcess(int32 *params) {
ob_speech->wait_state = 1;
}
- // come back again next cycle
return IR_REPEAT;
case INS_anim:
pars[0] = params[2]; // ob_logic
@@ -644,7 +636,6 @@ int32 Logic::fnSpeechProcess(int32 *params) {
ob_speech->wait_state = 1;
}
- // come back again next cycle
return IR_REPEAT;
case INS_reverse_anim:
pars[0] = params[2]; // ob_logic
@@ -659,7 +650,6 @@ int32 Logic::fnSpeechProcess(int32 *params) {
ob_speech->wait_state = 1;
}
- // come back again next cycle
return IR_REPEAT;
case INS_table_anim:
pars[0] = params[2]; // ob_logic
@@ -675,7 +665,6 @@ int32 Logic::fnSpeechProcess(int32 *params) {
ob_speech->wait_state = 1;
}
- // come back again next cycle
return IR_REPEAT;
case INS_reverse_table_anim:
pars[0] = params[2]; // ob_logic
@@ -691,7 +680,6 @@ int32 Logic::fnSpeechProcess(int32 *params) {
ob_speech->wait_state = 1;
}
- // come back again next cycle
return IR_REPEAT;
case INS_no_sprite:
fnNoSprite(params); // ob_graphic
@@ -732,7 +720,6 @@ int32 Logic::fnSpeechProcess(int32 *params) {
ob_speech->wait_state = 1;
}
- // come back again next cycle
return IR_REPEAT;
case INS_walk_to_anim:
pars[0] = params[2]; // ob_logic
@@ -751,7 +738,6 @@ int32 Logic::fnSpeechProcess(int32 *params) {
ob_speech->wait_state = 1;
}
- // come back again next cycle
return IR_REPEAT;
case INS_stand_after_anim:
pars[0] = params[0]; // ob_graphic
@@ -760,7 +746,7 @@ int32 Logic::fnSpeechProcess(int32 *params) {
fnStandAfterAnim(pars);
ob_speech->command = 0; // command finished
ob_speech->wait_state = 1; // waiting for command
- return IR_REPEAT; // come back again next cycle
+ return IR_REPEAT;
case INS_set_frame:
pars[0] = params[0]; // ob_graphic
pars[1] = ob_speech->ins1; // anim_resource
@@ -768,7 +754,7 @@ int32 Logic::fnSpeechProcess(int32 *params) {
fnSetFrame(pars);
ob_speech->command = 0; // command finished
ob_speech->wait_state = 1; // waiting for command
- return IR_REPEAT; // come back again next cycle
+ return IR_REPEAT;
case INS_quit:
debug(5, "speech-process - quit");
@@ -814,8 +800,6 @@ int32 Logic::fnSpeechProcess(int32 *params) {
// now free
ob_speech->wait_state = 1;
-
- // come back again next cycle
return IR_REPEAT;
}
}
@@ -1273,7 +1257,6 @@ int32 Logic::fnISpeak(int32 *params) {
if (_rightClickDelay)
_rightClickDelay--;
- // back again next cycle
return IR_REPEAT;
}
diff --git a/sword2/sync.cpp b/sword2/sync.cpp
index 38fd156bd6..c67dd77e79 100644
--- a/sword2/sync.cpp
+++ b/sword2/sync.cpp
@@ -109,7 +109,6 @@ int32 Logic::fnWaitSync(int32 *params) {
}
}
- // back again next cycle
return IR_REPEAT;
}
diff --git a/sword2/walker.cpp b/sword2/walker.cpp
index 7b938b0574..cb5c966236 100644
--- a/sword2/walker.cpp
+++ b/sword2/walker.cpp
@@ -227,8 +227,6 @@ int32 Logic::fnWalk(int32 *params) {
// allow _walkData array to float about memory again
_router->floatRouteMem();
-
- // stop the script, but repeat this call next cycle
return IR_REPEAT;
}