diff options
-rw-r--r-- | dc/dc.h | 2 | ||||
-rw-r--r-- | dc/dcmain.cpp | 2 | ||||
-rw-r--r-- | main.cpp | 7 | ||||
-rw-r--r-- | morphos/morphos.cpp | 8 | ||||
-rw-r--r-- | morphos/morphos.h | 2 | ||||
-rw-r--r-- | scummvm.cpp | 8 | ||||
-rw-r--r-- | sdl.cpp | 24 | ||||
-rw-r--r-- | simon/simon.cpp | 5 | ||||
-rw-r--r-- | sound.cpp | 1 | ||||
-rw-r--r-- | system.h | 10 | ||||
-rw-r--r-- | wince/pocketpc.cpp | 4 | ||||
-rw-r--r-- | x11.cpp | 6 |
12 files changed, 48 insertions, 31 deletions
@@ -64,7 +64,7 @@ class OSystem_Dreamcast : public OSystem { void quit(); // Set a parameter - uint32 property(int param, uint32 value); + uint32 property(int param, Property *value); static OSystem *create(); diff --git a/dc/dcmain.cpp b/dc/dcmain.cpp index a8451f71d3..0f98f4ecfc 100644 --- a/dc/dcmain.cpp +++ b/dc/dcmain.cpp @@ -96,7 +96,7 @@ void OSystem_Dreamcast::update_cdrom() // Dummy. The CD drive takes care of itself. } -uint32 OSystem_Dreamcast::property(int param, uint32 value) +uint32 OSystem_Dreamcast::property(int param, Property *value) { switch(param) { @@ -81,7 +81,7 @@ static void do_memory_test(void) { signal(SIGBUS, handle_errors); signal(SIGABRT, handle_errors); signal(SIGSEGV, handle_errors); - if (*((int *) ((char *) test + 1)) != value) { + if (*((unsigned int *) ((char *) test + 1)) != value) { error("Your system does not support unaligned memory accesses. Please rebuild with SCUMM_NEED_ALIGNMENT "); } signal(SIGBUS, SIG_DFL); @@ -148,7 +148,10 @@ int main(int argc, char *argv[]) { char *s = detector.getGameName(); - system->property(OSystem::PROP_SET_WINDOW_CAPTION, (long)s); + OSystem::Property prop; + + prop.caption = s; + system->property(OSystem::PROP_SET_WINDOW_CAPTION, &prop); free(s); } diff --git a/morphos/morphos.cpp b/morphos/morphos.cpp index e818864d82..f32b6c0b09 100644 --- a/morphos/morphos.cpp +++ b/morphos/morphos.cpp @@ -232,7 +232,7 @@ void *OSystem_MorphOS::create_thread(ThreadProc *proc, void *param) return ScummMusicThread; } -uint32 OSystem_MorphOS::property(int param, uint32 value) +uint32 OSystem_MorphOS::property(int param, Property *value) { switch( param ) { @@ -241,7 +241,7 @@ uint32 OSystem_MorphOS::property(int param, uint32 value) return 1; case PROP_SET_WINDOW_CAPTION: - sprintf( ScummWndTitle, "ScummVM MorphOS - %s", (char *)value ); + sprintf( ScummWndTitle, "ScummVM MorphOS - %s", value->caption ); if( ScummWindow ) SetWindowTitles( ScummWindow, ScummWndTitle, ScummWndTitle ); return 1; @@ -276,11 +276,11 @@ uint32 OSystem_MorphOS::property(int param, uint32 value) break; case PROP_SHOW_DEFAULT_CURSOR: - if( value ) + if( value->show_cursor ) ClearPointer( ScummWindow ); else SetPointer( ScummWindow, ScummNoCursor, 1, 1, 0, 0 ); - ScummOrigMouse = ScummDefaultMouse = value; + ScummOrigMouse = ScummDefaultMouse = value->show_cursor; break; case PROP_GET_SAMPLE_RATE: diff --git a/morphos/morphos.h b/morphos/morphos.h index e4e6d154db..36ce91aaf5 100644 --- a/morphos/morphos.h +++ b/morphos/morphos.h @@ -75,7 +75,7 @@ class OSystem_MorphOS : public OSystem virtual bool set_sound_proc(void *param, SoundProc *proc, byte format); void fill_sound (byte * stream, int len); - virtual uint32 property(int param, uint32 value); + virtual uint32 property(int param, Property *value); // Poll cdrom status // Returns true if cd audio is playing diff --git a/scummvm.cpp b/scummvm.cpp index 701d1da602..fb2ca8cf61 100644 --- a/scummvm.cpp +++ b/scummvm.cpp @@ -1300,8 +1300,8 @@ void Scumm::launch() else OF_OWNER_ROOM = 0x0F; -// if (_gameId==GID_MONKEY2 && _bootParam == 0) -// _bootParam = 10001; + // if (_gameId==GID_MONKEY2 && _bootParam == 0) + // _bootParam = 10001; if (_gameId == GID_INDY4 && _bootParam == 0) { _bootParam = -7873; @@ -1336,6 +1336,7 @@ void Scumm::launch() Scumm *Scumm::createFromDetector(GameDetector *detector, OSystem *syst) { Scumm *scumm; + OSystem::Property prop; if (detector->_features & GF_OLD256) scumm = new Scumm_v3; @@ -1352,7 +1353,8 @@ Scumm *Scumm::createFromDetector(GameDetector *detector, OSystem *syst) /* This initializes SDL */ syst->init_size(320,200); - syst->property(OSystem::PROP_OPEN_CD, detector->_cdrom); + prop.cd_num = detector->_cdrom; + syst->property(OSystem::PROP_OPEN_CD, &prop); /* bind the mixer to the system => mixer will be invoked * automatically when samples need to be generated */ @@ -94,7 +94,7 @@ public: void quit(); // Set a parameter - uint32 property(int param, uint32 value); + uint32 property(int param, Property *value); static OSystem *create(int gfx_mode, bool full_screen); @@ -733,7 +733,7 @@ bool OSystem_SDL::poll_event(Event *event) { /* internal keypress? */ if (b == KBD_ALT && ev.key.keysym.sym==SDLK_RETURN) { - property(PROP_TOGGLE_FULLSCREEN, 0); + property(PROP_TOGGLE_FULLSCREEN, NULL); break; } @@ -743,8 +743,10 @@ bool OSystem_SDL::poll_event(Event *event) { } if (b == (KBD_CTRL|KBD_ALT) && - ev.key.keysym.sym>='1' && ev.key.keysym.sym<='7') { - property(PROP_SET_GFX_MODE, ev.key.keysym.sym - '1'); + (ev.key.keysym.sym>='1') && (ev.key.keysym.sym<='7')) { + Property prop; + prop.gfx_mode = ev.key.keysym.sym - '1'; + property(PROP_SET_GFX_MODE, &prop); break; } @@ -855,7 +857,7 @@ void OSystem_SDL::hotswap_gfx_mode() { OSystem_SDL::update_screen(); } -uint32 OSystem_SDL::property(int param, uint32 value) { +uint32 OSystem_SDL::property(int param, Property *value) { switch(param) { case PROP_TOGGLE_FULLSCREEN: @@ -869,14 +871,14 @@ uint32 OSystem_SDL::property(int param, uint32 value) { return 1; case PROP_SET_WINDOW_CAPTION: - SDL_WM_SetCaption((char*)value, (char*)value); + SDL_WM_SetCaption(value->caption, value->caption); return 1; case PROP_OPEN_CD: if (SDL_InitSubSystem(SDL_INIT_CDROM) == -1) cdrom = NULL; else { - cdrom = SDL_CDOpen(value); + cdrom = SDL_CDOpen(value->cd_num); /* Did if open? Check if cdrom is NULL */ if (!cdrom) { warning("Couldn't open drive: %s\n", SDL_GetError()); @@ -885,16 +887,16 @@ uint32 OSystem_SDL::property(int param, uint32 value) { break; case PROP_SET_GFX_MODE: - if (value >= 7) + if (value->gfx_mode >= 7) return 0; - _mode = value; + _mode = value->gfx_mode; hotswap_gfx_mode(); return 1; case PROP_SHOW_DEFAULT_CURSOR: - SDL_ShowCursor(value ? SDL_ENABLE : SDL_DISABLE); + SDL_ShowCursor(value->show_cursor ? SDL_ENABLE : SDL_DISABLE); break; case PROP_GET_SAMPLE_RATE: @@ -1116,7 +1118,7 @@ public: bool poll_event(Event *event) { return false; } bool set_sound_proc(void *param, SoundProc *proc, byte sound) {} void quit() { exit(1); } - uint32 property(int param, uint32 value) { return 0; } + uint32 property(int param, Property *value) { return 0; } static OSystem *create(int gfx_mode, bool full_screen); private: diff --git a/simon/simon.cpp b/simon/simon.cpp index c8056c5907..15691dc84c 100644 --- a/simon/simon.cpp +++ b/simon/simon.cpp @@ -7884,6 +7884,8 @@ void SimonState::realizePalette() { void SimonState::go() { + OSystem::Property prop; + if (!_dump_file) _dump_file = stdout; @@ -7915,7 +7917,8 @@ void SimonState::go() { _vga_base_delay = 1; _vk_t_toggle = true; - _system->property(OSystem::PROP_SHOW_DEFAULT_CURSOR, 1); + prop.show_cursor = true; + _system->property(OSystem::PROP_SHOW_DEFAULT_CURSOR, &prop); while(1) { hitarea_stuff(); @@ -748,6 +748,7 @@ void Scumm::decompressBundleSound(int index) { default: printf("Unknown codec %d!\n", table[i].codec); + outputSize = 0; break; } @@ -63,7 +63,13 @@ public: PROP_SHOW_DEFAULT_CURSOR = 5, PROP_GET_SAMPLE_RATE = 6, }; - + union Property { + char *caption; + int cd_num; + int gfx_mode; + bool show_cursor; + }; + enum { SOUND_8BIT = 0, SOUND_16BIT = 1, @@ -114,7 +120,7 @@ public: virtual bool set_sound_proc(void *param, SoundProc *proc, byte format) = 0; // Get or set a property - virtual uint32 property(int param, uint32 value) = 0; + virtual uint32 property(int param, Property *value) = 0; // Poll cdrom status // Returns true if cd audio is playing diff --git a/wince/pocketpc.cpp b/wince/pocketpc.cpp index 324285f338..a93cb4b5c6 100644 --- a/wince/pocketpc.cpp +++ b/wince/pocketpc.cpp @@ -118,7 +118,7 @@ public: void quit(); // Set a parameter - uint32 property(int param, uint32 value); + uint32 property(int param, Property *value); static OSystem *create(int gfx_mode, bool full_screen); @@ -1196,7 +1196,7 @@ bool OSystem_WINCE3::set_sound_proc(void *param, SoundProc *proc, byte format) { /* Hotswap graphics modes */ void OSystem_WINCE3::get_320x200_image(byte *buf) {;} void OSystem_WINCE3::hotswap_gfx_mode() {;} -uint32 OSystem_WINCE3::property(int param, uint32 value) { +uint32 OSystem_WINCE3::property(int param, Property *value) { switch(param) { case PROP_TOGGLE_FULLSCREEN: @@ -111,7 +111,7 @@ public: void quit(); // Set a parameter - uint32 property(int param, uint32 value); + uint32 property(int param, Property *value); static OSystem *create(int gfx_mode, bool full_screen); @@ -703,13 +703,13 @@ void *OSystem_X11::create_thread(ThreadProc *proc, void *param) { return thread; } -uint32 OSystem_X11::property(int param, uint32 value) { +uint32 OSystem_X11::property(int param, Property *value) { switch (param) { case PROP_GET_SAMPLE_RATE: return 22050; } - warning("Property not implemented yet (%d, 0x%08X) ", param, value); + warning("Property not implemented yet (%d) ", param); return 0; } |