aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/timer_lol.cpp
diff options
context:
space:
mode:
authorFlorian Kagerer2009-02-21 23:20:14 +0000
committerFlorian Kagerer2009-02-21 23:20:14 +0000
commitb5b4cb66a173bfea3792058e160f6b9a0b30e2ff (patch)
tree4d2627ad3245dbe95ad70571e2dcdbebe835145a /engines/kyra/timer_lol.cpp
parentb18ccb755a1fd7b39618d3f64f997d7123f81c26 (diff)
downloadscummvm-rg350-b5b4cb66a173bfea3792058e160f6b9a0b30e2ff.tar.gz
scummvm-rg350-b5b4cb66a173bfea3792058e160f6b9a0b30e2ff.tar.bz2
scummvm-rg350-b5b4cb66a173bfea3792058e160f6b9a0b30e2ff.zip
LOL: implemented timers (only text fading for now)
svn-id: r38766
Diffstat (limited to 'engines/kyra/timer_lol.cpp')
-rw-r--r--engines/kyra/timer_lol.cpp95
1 files changed, 95 insertions, 0 deletions
diff --git a/engines/kyra/timer_lol.cpp b/engines/kyra/timer_lol.cpp
new file mode 100644
index 0000000000..594aa1733e
--- /dev/null
+++ b/engines/kyra/timer_lol.cpp
@@ -0,0 +1,95 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "kyra/lol.h"
+#include "kyra/screen_lol.h"
+#include "kyra/timer.h"
+
+namespace Kyra {
+
+#define TimerV2(x) new Common::Functor1Mem<int, void, LoLEngine>(this, &LoLEngine::x)
+
+void LoLEngine::setupTimers() {
+ debugC(9, kDebugLevelMain | kDebugLevelTimer, "LoLEngine::setupTimers()");
+
+ _timer->addTimer(0, TimerV2(timerSub1), 15, true);
+ _timer->addTimer(0x10, TimerV2(timerSub2), 6, true);
+ _timer->addTimer(0x11, TimerV2(timerSub2), 6, true);
+ _timer->setNextRun(0x11, 3);
+ _timer->addTimer(3, TimerV2(timerSub3), 15, true);
+ _timer->addTimer(4, TimerV2(timerSub4), 1, true);
+ _timer->addTimer(0x50, TimerV2(timerSub5), 0, false);
+ _timer->addTimer(0x51, TimerV2(timerSub5), 0, false);
+ _timer->addTimer(0x52, TimerV2(timerSub5), 0, false);
+ _timer->addTimer(8, TimerV2(timerSub6), 1200, true);
+ _timer->addTimer(9, TimerV2(timerSub7), 10, true);
+ _timer->addTimer(10, TimerV2(timerUpdateLampState), 360, true);
+ _timer->addTimer(11, TimerV2(timerFadeMessageText), 360, false);
+}
+
+void LoLEngine::enableTimer(int id) {
+ _timer->enable(id);
+ _timer->setNextRun(id, _system->getMillis() + _timer->getDelay(id) * _tickLength);
+}
+
+void LoLEngine::timerSub1(int timerNum) {
+
+}
+
+void LoLEngine::timerSub2(int timerNum) {
+
+}
+
+void LoLEngine::timerSub3(int timerNum) {
+
+}
+
+void LoLEngine::timerSub4(int timerNum) {
+
+}
+
+void LoLEngine::timerSub5(int timerNum) {
+ runLevelScript(0x401 + (timerNum & 0x0f), -1);
+}
+
+void LoLEngine::timerSub6(int timerNum) {
+
+}
+
+void LoLEngine::timerSub7(int timerNum) {
+
+}
+
+void LoLEngine::timerUpdateLampState(int timerNum) {
+ if ((_screen->_drawGuiFlag & 0x800) && (_screen->_drawGuiFlag & 0x400) && _lampStatusUnk)
+ _lampStatusUnk--;
+}
+
+void LoLEngine::timerFadeMessageText(int timerNum) {
+ _timer->disable(timerNum);
+ initTextFading(0, 0);
+}
+
+} // end of namespace Kyra