[Scummvm-cvs-logs] CVS: residual engine.cpp,1.20,1.21 engine.h,1.7,1.8 lua.cpp,1.43,1.44 main.cpp,1.20,1.21 smush.cpp,1.31,1.32 smush.h,1.15,1.16
Pawel Kolodziejski
aquadran at users.sourceforge.net
Fri Mar 19 22:15:35 CET 2004
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.241,1.242 script_v6.cpp,1.322,1.323 script_v6he.cpp,2.39,2.40 script_v8.cpp,2.239,2.240 scumm.h,1.385,1.386 string.cpp,1.204,1.205
- Next message: [Scummvm-cvs-logs] CVS: residual README,1.13,1.14 TODO,1.28,1.29
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1324
Modified Files:
engine.cpp engine.h lua.cpp main.cpp smush.cpp smush.h
Log Message:
added engine states, separate fullscreen smush playback depend on engine mode
Index: engine.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/engine.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- engine.cpp 3 Mar 2004 21:43:34 -0000 1.20
+++ engine.cpp 20 Mar 2004 05:47:21 -0000 1.21
@@ -84,61 +84,75 @@
// Run asynchronous tasks
lua_runtasks();
- if (SCREENBLOCKS_GLOBAL == 1)
- screenBlocksReset();
+ if (_mode == ENGINE_MODE_SMUSH) {
+ 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();
+ }
+ g_driver->drawSmushFrame(g_smush->getX(), g_smush->getY());
+ }
+ // Draw text
+ for (text_list_type::iterator i = textObjects_.begin(); i != textObjects_.end(); i++) {
+ (*i)->draw();
+ }
+ g_driver->flipBuffer();
+ } else if (_mode == ENGINE_MODE_NORMAL) {
+ if (SCREENBLOCKS_GLOBAL == 1)
+ screenBlocksReset();
- // Update actor costumes
- for (actor_list_type::iterator i = actors_.begin(); i != actors_.end(); i++) {
- Actor *a = *i;
- assert(currScene_);
- if (a->inSet(currScene_->name()) && a->visible())
- a->update();
- }
+ // Update actor costumes
+ for (actor_list_type::iterator i = actors_.begin(); i != actors_.end(); i++) {
+ Actor *a = *i;
+ assert(currScene_);
+ if (a->inSet(currScene_->name()) && a->visible())
+ a->update();
+ }
- g_driver->clearScreen();
+ g_driver->clearScreen();
- if (SCREENBLOCKS_GLOBAL == 1)
- screenBlocksBlitDirtyBlocks();
+ if (SCREENBLOCKS_GLOBAL == 1)
+ screenBlocksBlitDirtyBlocks();
- if (!g_smush->isPlaying() || (g_smush->isPlaying() && !g_smush->isFullSize())) {
Bitmap::prepareDraw();
if (currScene_ != NULL)
currScene_->drawBackground();
- }
- 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();
+ 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();
+ }
+ g_driver->drawSmushFrame(g_smush->getX(), g_smush->getY());
}
- g_driver->drawSmushFrame(g_smush->getX(), g_smush->getY());
- }
- glMatrixMode(GL_MODELVIEW);
+ glMatrixMode(GL_MODELVIEW);
- glEnable(GL_DEPTH_TEST);
- if (currScene_ != NULL)
- currScene_->setupCamera();
+ glEnable(GL_DEPTH_TEST);
+ if (currScene_ != NULL)
+ currScene_->setupCamera();
- // Draw actors
- if (!g_smush->isPlaying() || (g_smush->isPlaying() && !g_smush->isFullSize())) {
- glEnable(GL_TEXTURE_2D);
- for (actor_list_type::iterator i = actors_.begin(); i != actors_.end(); i++) {
- Actor *a = *i;
- if (a->inSet(currScene_->name()) && a->visible())
- a->draw();
+ // Draw actors
+ if (!g_smush->isPlaying()) {
+ glEnable(GL_TEXTURE_2D);
+ for (actor_list_type::iterator i = actors_.begin(); i != actors_.end(); i++) {
+ Actor *a = *i;
+ if (a->inSet(currScene_->name()) && a->visible())
+ a->draw();
+ }
+ glDisable(GL_TEXTURE_2D);
+ //screenBlocksDrawDebug();
}
- glDisable(GL_TEXTURE_2D);
- //screenBlocksDrawDebug();
- }
- // Draw text
- for (text_list_type::iterator i = textObjects_.begin(); i != textObjects_.end(); i++) {
- (*i)->draw();
- }
+ // Draw text
+ for (text_list_type::iterator i = textObjects_.begin(); i != textObjects_.end(); i++) {
+ (*i)->draw();
+ }
- g_driver->flipBuffer();
+ g_driver->flipBuffer();
+ }
// don't kill CPU
SDL_Delay(1);
Index: engine.h
===================================================================
RCS file: /cvsroot/scummvm/residual/engine.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- engine.h 3 Mar 2004 21:43:34 -0000 1.7
+++ engine.h 20 Mar 2004 05:47:21 -0000 1.8
@@ -26,6 +26,12 @@
class Actor;
+#define ENGINE_MODE_IDLE 0
+#define ENGINE_MODE_PAUSE 1
+#define ENGINE_MODE_NORMAL 2
+#define ENGINE_MODE_SMUSH 3
+#define ENGINE_MODE_DRAW 4
+
// Fake SDLK_* values for joystick and mouse events
enum {
SDLK_JOY1_B1 = SDLK_LAST,
@@ -86,6 +92,8 @@
return instance_;
}
+ void setMode(int mode) { _mode = mode; }
+
void mainLoop();
unsigned frameStart() const { return frameStart_; }
unsigned frameTime() const { return frameTime_; }
@@ -137,6 +145,7 @@
~Engine() { }
Scene *currScene_;
+ int _mode;
unsigned frameStart_, frameTime_, movieTime_;
Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- lua.cpp 19 Mar 2004 12:33:09 -0000 1.43
+++ lua.cpp 20 Mar 2004 05:47:21 -0000 1.44
@@ -1028,6 +1028,7 @@
static void StartFullscreenMovie() {
bool mode = getbool(2);
+ Engine::instance()->setMode(ENGINE_MODE_SMUSH);
pushbool(g_smush->play(luaL_check_string(1), 0, 0));
}
@@ -1035,6 +1036,7 @@
bool mode = getbool(2);
int x = lua_getparam(3);
int y = lua_getparam(4);
+ Engine::instance()->setMode(ENGINE_MODE_NORMAL);
pushbool(g_smush->play(luaL_check_string(1), x, y));
}
Index: main.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/main.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- main.cpp 24 Feb 2004 21:09:53 -0000 1.20
+++ main.cpp 20 Mar 2004 05:47:21 -0000 1.21
@@ -121,6 +121,7 @@
lua_call("BOOT");
lua_endblock();
+ Engine::instance()->setMode(ENGINE_MODE_NORMAL);
Engine::instance()->mainLoop();
delete g_smush;
Index: smush.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/smush.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- smush.cpp 19 Mar 2004 22:39:44 -0000 1.31
+++ smush.cpp 20 Mar 2004 05:47:21 -0000 1.32
@@ -25,6 +25,7 @@
#include "mixer/mixer.h"
#include "driver_gl.h"
#include "resource.h"
+#include "engine.h"
Smush *g_smush;
@@ -217,6 +218,11 @@
return true;
}
+void Smush::stop() {
+ deinit();
+ Engine::instance()->setMode(ENGINE_MODE_NORMAL);
+}
+
bool Smush::play(const char *filename, int x, int y) {
deinit();
Index: smush.h
===================================================================
RCS file: /cvsroot/scummvm/residual/smush.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- smush.h 19 Mar 2004 22:39:44 -0000 1.15
+++ smush.h 20 Mar 2004 05:47:21 -0000 1.16
@@ -74,7 +74,7 @@
~Smush();
bool play(const char *filename, int x, int y);
- void stop() { deinit(); }
+ void stop();
void pause(bool pause) { _videoPause = pause; }
bool isPlaying() { return !_videoFinished; }
bool isUpdateNeeded() { return _updateNeeded; }
@@ -84,7 +84,6 @@
int getWidth() {return _width; }
int getHeight() { return _height; }
void clearUpdateNeeded() { _updateNeeded = false; }
- bool isFullSize() { return ( _width == 640 && _height == 480); }
int32 getMovieTime() { return _movieTime; }
private:
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.241,1.242 script_v6.cpp,1.322,1.323 script_v6he.cpp,2.39,2.40 script_v8.cpp,2.239,2.240 scumm.h,1.385,1.386 string.cpp,1.204,1.205
- Next message: [Scummvm-cvs-logs] CVS: residual README,1.13,1.14 TODO,1.28,1.29
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list