aboutsummaryrefslogtreecommitdiff
path: root/sword2/sync.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-01-28 16:33:14 +0000
committerTorbjörn Andersson2005-01-28 16:33:14 +0000
commitc0a3816e1790182b7b4b3854846f01247b00ebbe (patch)
tree65e6fd93a7dcff1bb2111c802f283ff511b8b027 /sword2/sync.cpp
parent6feb7ae90f38c11b85868c54fb5b328d50844856 (diff)
downloadscummvm-rg350-c0a3816e1790182b7b4b3854846f01247b00ebbe.tar.gz
scummvm-rg350-c0a3816e1790182b7b4b3854846f01247b00ebbe.tar.bz2
scummvm-rg350-c0a3816e1790182b7b4b3854846f01247b00ebbe.zip
Began what I hope is the final major restructuring of the BS2 engine.
In this first step, I have moved all opcode functions into functions.cpp, instead of having them scattered all over the place. To get things to compile again, I had to rewrite the overly complicated sound effects handling. It's much simpler now. The next step will be to move any non-trivial code out of the opcode functions and into the appropriate object. This, I hope, will make it easier to create well-separated objects, instead of the current mess. I also want to tear down the artificial boundary between the main directory and the "driver" directory. We already have a cross-platform layer; there's no need to have yet another one. (Actually, the rewriting of the sound effects code took one first step in this direction.) At the final stage, I'd like to get rid of the "drivers" directory completely, but I'll probably need some help with that if I want to preserve the CVS history of the code. Things will probably be a bit bumpy along the way, but I seem to have reached a point of relative stability again, which is why I'm commiting this now. svn-id: r16668
Diffstat (limited to 'sword2/sync.cpp')
-rw-r--r--sword2/sync.cpp54
1 files changed, 0 insertions, 54 deletions
diff --git a/sword2/sync.cpp b/sword2/sync.cpp
index bfb5aa7edd..473bc93217 100644
--- a/sword2/sync.cpp
+++ b/sword2/sync.cpp
@@ -26,26 +26,6 @@
namespace Sword2 {
-int32 Logic::fnSendSync(int32 *params) {
- // params: 0 sync's recipient
- // 1 sync value
-
- for (int i = 0; i < MAX_syncs; i++) {
- if (_syncList[i].id == 0) {
- debug(5, "%d sends sync %d to %d", _scriptVars[ID], params[1], params[0]);
- _syncList[i].id = params[0];
- _syncList[i].sync = params[1];
- return IR_CONT;
- }
- }
-
- // The original code didn't even check for this condition, so maybe
- // it should be a fatal error?
-
- warning("No free sync slot");
- return IR_CONT;
-}
-
/**
* Clear any syncs registered for this id. Call this just after the id has been
* processed. Theoretically there could be more than one sync waiting for us,
@@ -75,38 +55,4 @@ int Logic::getSync(void) {
return -1;
}
-/**
- * Like getSync(), but called from scripts. Sets the RESULT variable to
- * the sync value, or 0 if none is found.
- */
-
-int32 Logic::fnGetSync(int32 *params) {
- // params: none
-
- int slot = getSync();
-
- _scriptVars[RESULT] = (slot != -1) ? _syncList[slot].sync : 0;
- return IR_CONT;
-}
-
-/**
- * Wait for sync to happen. Sets the RESULT variable to the sync value, once
- * it has been found.
- */
-
-int32 Logic::fnWaitSync(int32 *params) {
- // params: none
-
- debug(6, "fnWaitSync: %d waits", _scriptVars[ID]);
-
- int slot = getSync();
-
- if (slot == -1)
- return IR_REPEAT;
-
- debug(5, "fnWaitSync: %d got sync %d", _scriptVars[ID], _syncList[slot].sync);
- _scriptVars[RESULT] = _syncList[slot].sync;
- return IR_CONT;
-}
-
} // End of namespace Sword2