[Scummvm-cvs-logs] CVS: residual engine.cpp,1.19,1.20 engine.h,1.6,1.7 lua.cpp,1.41,1.42 lua.h,1.2,1.3 smush.cpp,1.27,1.28 smush.h,1.12,1.13
Pawel Kolodziejski
aquadran at users.sourceforge.net
Wed Mar 3 14:05:00 CET 2004
Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29161
Modified Files:
engine.cpp engine.h lua.cpp lua.h smush.cpp smush.h
Log Message:
added movieTime stuff, now it try handle subtitles for smush
Index: engine.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/engine.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- engine.cpp 3 Mar 2004 20:52:58 -0000 1.19
+++ engine.cpp 3 Mar 2004 21:43:34 -0000 1.20
@@ -38,6 +38,7 @@
}
void Engine::mainLoop() {
+ movieTime_ = 0;
frameTime_ = 0;
frameStart_ = SDL_GetTicks();
@@ -106,6 +107,7 @@
}
if (g_smush->isPlaying()) {
+ movieTime_ = g_smush->getMovieTime();
if (g_smush->isUpdateNeeded()) {
g_driver->prepareSmushFrame(g_smush->getWidth(), g_smush->getHeight(), g_smush->getDstPtr());
g_smush->clearUpdateNeeded();
@@ -149,6 +151,10 @@
lua_beginblock();
set_frameTime(frameTime_);
lua_endblock();
+
+ lua_beginblock();
+ set_movieTime(movieTime_);
+ lua_endblock();
}
}
Index: engine.h
===================================================================
RCS file: /cvsroot/scummvm/residual/engine.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- engine.h 24 Feb 2004 21:09:53 -0000 1.6
+++ engine.h 3 Mar 2004 21:43:34 -0000 1.7
@@ -138,7 +138,7 @@
Scene *currScene_;
- unsigned frameStart_, frameTime_;
+ unsigned frameStart_, frameTime_, movieTime_;
bool controlsEnabled_[SDLK_EXTRA_LAST];
Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- lua.cpp 24 Feb 2004 21:09:53 -0000 1.41
+++ lua.cpp 3 Mar 2004 21:43:34 -0000 1.42
@@ -844,6 +844,13 @@
lua_settable();
}
+void set_movieTime(float movieTime) {
+ lua_pushobject(lua_getglobal("system"));
+ lua_pushstring("movieTime");
+ lua_pushnumber(movieTime);
+ lua_settable();
+}
+
void PerSecond() {
float rate = luaL_check_number(1);
lua_pushnumber(Engine::instance()->perSecond(rate));
Index: lua.h
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- lua.h 24 Feb 2004 21:09:53 -0000 1.2
+++ lua.h 3 Mar 2004 21:43:34 -0000 1.3
@@ -34,6 +34,9 @@
// Set system.frameTime
void set_frameTime(float frameTime);
+// Set smush.movieTime
+void set_movieTime(float movieTime);
+
// Get the event handler function with the given name, pushing the handler
// object if appropriate
lua_Object getEventHandler(const char *name);
Index: smush.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/smush.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- smush.cpp 29 Feb 2004 18:38:26 -0000 1.27
+++ smush.cpp 3 Mar 2004 21:43:34 -0000 1.28
@@ -43,6 +43,7 @@
_freq = 22050;
_videoFinished = false;
_videoPause = true;
+ _movieTime = 0;
}
Smush::~Smush() {
@@ -51,6 +52,7 @@
void Smush::init() {
_frame = 0;
+ _movieTime = 0;
_videoFinished = false;
_videoPause = false;
g_timer->installTimerProc(&timerCallback, _speed, NULL);
@@ -137,6 +139,8 @@
if (_frame == _nbframes) {
_videoFinished = true;
}
+
+ _movieTime += _speed / 1000;
}
void Smush::handleFramesHeader() {
Index: smush.h
===================================================================
RCS file: /cvsroot/scummvm/residual/smush.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- smush.h 29 Feb 2004 18:38:26 -0000 1.12
+++ smush.h 3 Mar 2004 21:43:34 -0000 1.13
@@ -107,6 +107,7 @@
int32 _frame;
bool _updateNeeded;
int32 _speed;
+ int32 _movieTime;
int _channels;
int _freq;
bool _videoFinished;
@@ -131,7 +132,8 @@
int getWidth() {return _width; }
int getHeight() { return _height; }
void clearUpdateNeeded() { _updateNeeded = false; }
- bool isFullSize() { return (_width == 640 && _height == 480); }
+ bool isFullSize() { return ( _width == 640 && _height == 480); }
+ int32 getMovieTime() { return _movieTime; }
private:
static void timerCallback(void *ptr);
More information about the Scummvm-git-logs
mailing list