[Scummvm-cvs-logs] CVS: scummvm gameDetector.cpp,1.11,1.12 sdl.cpp,1.89,1.90 system.h,1.4,1.5
Ludvig Strigeus
strigeus at users.sourceforge.net
Sat Apr 13 14:35:28 CEST 2002
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv10855
Modified Files:
gameDetector.cpp sdl.cpp system.h
Log Message:
added null graphics driver (USE_NULL_DRIVER)
will make it nicer later.
Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gameDetector.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** gameDetector.cpp 13 Apr 2002 19:06:10 -0000 1.11
--- gameDetector.cpp 13 Apr 2002 21:06:46 -0000 1.12
***************
*** 342,345 ****
--- 342,351 ----
_gfx_mode = GFX_DOUBLESIZE;
+ _gfx_driver = GD_AUTO;
+
+ #ifdef USE_NULL_DRIVER
+ _gfx_driver = GD_NULL;
+ #endif
+
_gameDataPath = NULL;
_gameTempo = 0;
***************
*** 393,396 ****
--- 399,405 ----
/* not implemented yet */
break;
+
+ case GD_NULL:
+ return OSystem_NULL_create();
}
Index: sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sdl.cpp,v
retrieving revision 1.89
retrieving revision 1.90
diff -C2 -d -r1.89 -r1.90
*** sdl.cpp 13 Apr 2002 18:31:44 -0000 1.89
--- sdl.cpp 13 Apr 2002 21:06:46 -0000 1.90
***************
*** 1021,1024 ****
--- 1021,1098 ----
}
+
+ #ifdef USE_NULL_DRIVER
+
+ /* NULL video driver */
+ class OSystem_NULL : public OSystem {
+ public:
+ void set_palette(const byte *colors, uint start, uint num) {}
+ void init_size(uint w, uint h, byte sound);
+ void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) {}
+ void update_screen() {}
+ bool show_mouse(bool visible) { return false; }
+ void set_mouse_pos(int x, int y) {}
+ void set_mouse_cursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y) {}
+ void set_shake_pos(int shake_pos) {}
+ uint32 get_msecs();
+ void delay_msecs(uint msecs);
+ void *create_thread(ThreadProc *proc, void *param) { return NULL; }
+ bool poll_event(Event *event) { return false; }
+ void set_sound_proc(void *param, SoundProc *proc) {}
+ void quit() { exit(1); }
+ uint32 set_param(int param, uint32 value) { return 0; }
+ static OSystem *create(int gfx_mode, bool full_screen);
+ private:
+
+ uint msec_start;
+
+ uint32 get_ticks();
+ };
+
+ void OSystem_NULL::init_size(uint w, uint h, byte sound) {
+ msec_start = get_ticks();
+ }
+
+ uint32 OSystem_NULL::get_ticks() {
+ uint a = 0;
+ #ifdef WIN32
+ a = GetTickCount();
+ #endif
+
+ #ifdef UNIX
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ a = tv.tv_sec * 1000 + tv.tv_usec/1000;
+ #endif
+
+ return a;
+ }
+
+ void OSystem_NULL::delay_msecs(uint msecs) {
+ #ifdef WIN32
+ Sleep(msecs);
+ #endif
+ #ifdef UNIX
+ usleep(msecs*1000);
+ #endif
+ }
+
+ uint32 OSystem_NULL::get_msecs() {
+ return get_ticks() - msec_start;
+ }
+
+ OSystem *OSystem_NULL_create() {
+ return new OSystem_NULL();
+ }
+ #else /* USE_NULL_DRIVER */
+
+ OSystem *OSystem_NULL_create() {
+ return NULL;
+ }
+
+ #endif
+
+
+
void cd_stop() {
}
Index: system.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/system.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** system.h 13 Apr 2002 18:31:44 -0000 1.4
--- system.h 13 Apr 2002 21:06:47 -0000 1.5
***************
*** 103,106 ****
--- 103,107 ----
/* OSystem_SDL */
OSystem *OSystem_SDL_create(int gfx_driver, bool full_screen);
+ OSystem *OSystem_NULL_create();
enum {
***************
*** 120,123 ****
--- 121,125 ----
GD_WIN32 = 2,
GD_X = 3,
+ GD_NULL = 4,
};
More information about the Scummvm-git-logs
mailing list