[Scummvm-cvs-logs] CVS: residual driver.h,1.20,1.21 driver_sdl.h,1.3,1.4 driver_sdl.cpp,1.4,1.5 lua.cpp,1.168,1.169
Marcus Comstedt
marcus_c at users.sourceforge.net
Sun Feb 5 12:58:06 CET 2006
Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19001
Modified Files:
driver.h driver_sdl.h driver_sdl.cpp lua.cpp
Log Message:
Factored out the remaining SDL dependencies.
Index: driver.h
===================================================================
RCS file: /cvsroot/scummvm/residual/driver.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- driver.h 5 Feb 2006 20:40:16 -0000 1.20
+++ driver.h 5 Feb 2006 20:57:38 -0000 1.21
@@ -102,6 +102,7 @@
virtual void prepareSmushFrame(int width, int height, byte *bitmap) = 0;
virtual void drawSmushFrame(int offsetX, int offsetY) = 0;
+ virtual char *getVideoDeviceName() = 0;
/** @name Events and Time */
//@{
@@ -263,6 +264,12 @@
//@}
+ /** @name Miscellaneous */
+ //@{
+ /** Quit (exit) the application. */
+ virtual void quit() = 0;
+ //@}
+
protected:
int _screenWidth, _screenHeight, _screenBPP;
bool _isFullscreen;
Index: driver_sdl.h
===================================================================
RCS file: /cvsroot/scummvm/residual/driver_sdl.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- driver_sdl.h 5 Feb 2006 20:40:16 -0000 1.3
+++ driver_sdl.h 5 Feb 2006 20:57:38 -0000 1.4
@@ -36,6 +36,8 @@
DriverSDL() : _samplesPerSec(22050) { ; }
virtual ~DriverSDL() { ; }
+ char *getVideoDeviceName();
+
const ControlDescriptor *listControls();
int getNumControls();
bool controlIsAxis(int num);
@@ -50,6 +52,8 @@
void clearSoundCallback();
int getOutputSampleRate() const;
+ void quit();
+
private:
int _samplesPerSec;
};
Index: driver_sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/driver_sdl.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- driver_sdl.cpp 5 Feb 2006 20:41:17 -0000 1.4
+++ driver_sdl.cpp 5 Feb 2006 20:57:38 -0000 1.5
@@ -265,6 +265,10 @@
return b;
}
+char *DriverSDL::getVideoDeviceName() {
+ return "SDL Video Device";
+}
+
const Driver::ControlDescriptor *DriverSDL::listControls() {
return controls;
}
@@ -380,3 +384,13 @@
return _samplesPerSec;
}
+/* This function sends the SDL signal to
+ * go ahead and exit the game
+ */
+void DriverSDL::quit() {
+ SDL_Event event;
+
+ event.type = SDL_QUIT;
+ if (SDL_PushEvent(&event) != 0)
+ error("Unable to push exit event!");
+}
Index: lua.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/lua.cpp,v
retrieving revision 1.168
retrieving revision 1.169
diff -u -d -r1.168 -r1.169
--- lua.cpp 5 Feb 2006 20:40:16 -0000 1.168
+++ lua.cpp 5 Feb 2006 20:57:38 -0000 1.169
@@ -37,7 +37,6 @@
#include <cstdio>
#include <cmath>
-#include <SDL.h>
#include <zlib.h>
extern Imuse *g_imuse;
@@ -752,7 +751,7 @@
DEBUG_FUNCTION();
lua_pushobject(result);
lua_pushnumber(0.0); // id of device
- lua_pushstring("SDL Video Device"); // name of device
+ lua_pushstring(g_driver->getVideoDeviceName()); // name of device
lua_settable();
lua_pushobject(result);
}
@@ -2266,16 +2265,9 @@
g_driver->copyStoredToDisplay();
}
-/* This function sends the SDL signal to
- * go ahead and exit the game
- */
static void Exit() {
- SDL_Event event;
-
DEBUG_FUNCTION();
- event.type = SDL_QUIT;
- if (SDL_PushEvent(&event) != 0)
- error("Unable to push exit event!");
+ g_driver->quit();
}
/* Check for an existing object by a certain name
More information about the Scummvm-git-logs
mailing list