aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2011-07-03 20:20:01 +1000
committerPaul Gilbert2011-07-03 20:21:37 +1000
commitecad39e246475603b7ee55f7df73a77c32b60ba6 (patch)
tree5003096e1479b9cfc87a8cfd05039f24ad6cfdb0
parent4116189395a87959f1981ca7ebae0604aa4ca9a4 (diff)
downloadscummvm-rg350-ecad39e246475603b7ee55f7df73a77c32b60ba6.tar.gz
scummvm-rg350-ecad39e246475603b7ee55f7df73a77c32b60ba6.tar.bz2
scummvm-rg350-ecad39e246475603b7ee55f7df73a77c32b60ba6.zip
CGE: Implemented code for game tick
-rw-r--r--engines/cge/cge.h1
-rw-r--r--engines/cge/cge_main.cpp13
2 files changed, 14 insertions, 0 deletions
diff --git a/engines/cge/cge.h b/engines/cge/cge.h
index e4bb260bcc..ba6326726a 100644
--- a/engines/cge/cge.h
+++ b/engines/cge/cge.h
@@ -45,6 +45,7 @@ enum {
class CGEEngine : public Engine {
private:
uint32 _lastFrame;
+ void tick();
public:
CGEEngine(OSystem *syst, const ADGameDescription *gameDescription);
~CGEEngine();
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index 33abf7917d..4bb954eaed 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -1537,8 +1537,21 @@ void CGEEngine::mainLoop() {
millis = g_system->getMillis();
}
_lastFrame = millis;
+
+ // Dispatch the tick to any active objects
+ tick();
}
+void CGEEngine::tick() {
+ for (Sprite *spr = Vga->ShowQ->First(); spr; spr = spr->_next) {
+ if (spr->_time) {
+ if (!spr->_flags._hide) {
+ if (--spr->_time == 0)
+ spr->tick();
+ }
+ }
+ }
+}
void CGEEngine::loadUser() {
// set scene