[Scummvm-cvs-logs] SF.net SVN: scummvm:[48118] scummvm/trunk/engines/sci

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Tue Feb 23 23:45:04 CET 2010


Revision: 48118
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48118&view=rev
Author:   fingolfin
Date:     2010-02-23 22:44:46 +0000 (Tue, 23 Feb 2010)

Log Message:
-----------
SCI: Move SciGui::wait to EngineState::wait

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kernel.cpp
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/state.cpp
    scummvm/trunk/engines/sci/engine/state.h
    scummvm/trunk/engines/sci/graphics/gui.cpp
    scummvm/trunk/engines/sci/graphics/gui32.cpp

Modified: scummvm/trunk/engines/sci/engine/kernel.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.cpp	2010-02-23 22:41:20 UTC (rev 48117)
+++ scummvm/trunk/engines/sci/engine/kernel.cpp	2010-02-23 22:44:46 UTC (rev 48118)
@@ -721,7 +721,7 @@
 	return false;
 }
 
-void kernel_sleep(SciEvent *event, uint32 msecs ) {
+void kernel_sleep(SciEvent *event, uint32 msecs) {
 	uint32 time;
 	const uint32 wakeup_time = g_system->getMillis() + msecs;
 

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-02-23 22:41:20 UTC (rev 48117)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-02-23 22:44:46 UTC (rev 48118)
@@ -351,22 +351,9 @@
 
 reg_t kWait(EngineState *s, int argc, reg_t *argv) {
 	int sleep_time = argv[0].toUint16();
-#if 0
-	uint32 time;
 
-	time = g_system->getMillis();
-	s->r_acc = make_reg(0, ((long)time - (long)s->last_wait_time) * 60 / 1000);
-	s->last_wait_time = time;
+	s->wait(sleep_time);
 
-	sleep_time *= g_debug_sleeptime_factor;
-	gfxop_sleep(s->gfx_state, sleep_time * 1000 / 60);
-
-#endif
-
-	// FIXME: we should not be asking from the GUI to wait. The kernel sounds
-	// like a better place
-	g_sci->_gui->wait(sleep_time);
-
 	return s->r_acc;
 }
 

Modified: scummvm/trunk/engines/sci/engine/state.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/state.cpp	2010-02-23 22:41:20 UTC (rev 48117)
+++ scummvm/trunk/engines/sci/engine/state.cpp	2010-02-23 22:44:46 UTC (rev 48118)
@@ -23,7 +23,11 @@
  *
  */
 
+#include "common/system.h"
+
 #include "sci/sci.h"	// for INCLUDE_OLDGFX
+#include "sci/debug.h"	// for g_debug_sleeptime_factor
+#include "sci/event.h"	// for kernel_sleep
 
 #include "sci/engine/state.h"
 #include "sci/engine/selector.h"
@@ -81,6 +85,17 @@
 	delete _msgState;
 }
 
+void EngineState::wait(int16 ticks) {
+	uint32 time;
+
+	time = g_system->getMillis();
+	r_acc = make_reg(0, ((long)time - (long)last_wait_time) * 60 / 1000);
+	last_wait_time = time;
+
+	ticks *= g_debug_sleeptime_factor;
+	kernel_sleep(_event, ticks * 1000 / 60);
+}
+
 uint16 EngineState::currentRoomNumber() const {
 	return script_000->_localsBlock->_locals[13].toUint16();
 }

Modified: scummvm/trunk/engines/sci/engine/state.h
===================================================================
--- scummvm/trunk/engines/sci/engine/state.h	2010-02-23 22:41:20 UTC (rev 48117)
+++ scummvm/trunk/engines/sci/engine/state.h	2010-02-23 22:44:46 UTC (rev 48118)
@@ -121,6 +121,8 @@
 	uint32 game_start_time; /**< The time at which the interpreter was started */
 	uint32 last_wait_time; /**< The last time the game invoked Wait() */
 
+	void wait(int16 ticks);
+
 	uint32 _throttleCounter; /**< total times kAnimate was invoked */
 	uint32 _throttleLastTime; /**< last time kAnimate was invoked */
 	bool _throttleTrigger;

Modified: scummvm/trunk/engines/sci/graphics/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.cpp	2010-02-23 22:41:20 UTC (rev 48117)
+++ scummvm/trunk/engines/sci/graphics/gui.cpp	2010-02-23 22:44:46 UTC (rev 48118)
@@ -97,14 +97,7 @@
 }
 
 void SciGui::wait(int16 ticks) {
-	uint32 time;
-
-	time = g_system->getMillis();
-	_s->r_acc = make_reg(0, ((long)time - (long)_s->last_wait_time) * 60 / 1000);
-	_s->last_wait_time = time;
-
-	ticks *= g_debug_sleeptime_factor;
-	kernel_sleep(_s->_event, ticks * 1000 / 60);
+	_s->wait(ticks);
 }
 
 void SciGui::textSize(const char *text, int16 font, int16 maxWidth, int16 *textWidth, int16 *textHeight) {

Modified: scummvm/trunk/engines/sci/graphics/gui32.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui32.cpp	2010-02-23 22:41:20 UTC (rev 48117)
+++ scummvm/trunk/engines/sci/graphics/gui32.cpp	2010-02-23 22:44:46 UTC (rev 48118)
@@ -27,7 +27,6 @@
 #include "common/util.h"
 
 #include "sci/sci.h"
-#include "sci/debug.h"	// for g_debug_sleeptime_factor
 #include "sci/event.h"
 #include "sci/engine/state.h"
 #include "sci/engine/selector.h"


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list