diff options
author | Max Horn | 2004-02-28 12:58:13 +0000 |
---|---|---|
committer | Max Horn | 2004-02-28 12:58:13 +0000 |
commit | c6752cccf5186fb04c97e2bb4a64c52fc9447073 (patch) | |
tree | 91f3f0264b1542a839cc3504b52603a8034547cb /backends | |
parent | 56102a1d02925abbe9fc0504751de1a270a34ff3 (diff) | |
download | scummvm-rg350-c6752cccf5186fb04c97e2bb4a64c52fc9447073.tar.gz scummvm-rg350-c6752cccf5186fb04c97e2bb4a64c52fc9447073.tar.bz2 scummvm-rg350-c6752cccf5186fb04c97e2bb4a64c52fc9447073.zip |
renamed more OSystem methods to follow our naming scheme; renamed NewGuiColor to OverlayColor; fixed some calls to error() in the SDL backend
svn-id: r13087
Diffstat (limited to 'backends')
-rw-r--r-- | backends/PalmOS/Src/palm.cpp | 34 | ||||
-rw-r--r-- | backends/PalmOS/Src/palm.h | 24 | ||||
-rw-r--r-- | backends/dc/dc.h | 12 | ||||
-rw-r--r-- | backends/dc/dcmain.cpp | 8 | ||||
-rw-r--r-- | backends/dc/display.cpp | 4 | ||||
-rw-r--r-- | backends/dc/icon.cpp | 2 | ||||
-rw-r--r-- | backends/dc/icon.h | 2 | ||||
-rw-r--r-- | backends/dc/selector.cpp | 2 | ||||
-rw-r--r-- | backends/gp32/gp32.cpp | 14 | ||||
-rw-r--r-- | backends/gp32/gp32.h | 14 | ||||
-rw-r--r-- | backends/morphos/morphos.cpp | 12 | ||||
-rw-r--r-- | backends/morphos/morphos.h | 12 | ||||
-rw-r--r-- | backends/null/null.cpp | 4 | ||||
-rw-r--r-- | backends/sdl/sdl-common.cpp | 83 | ||||
-rw-r--r-- | backends/sdl/sdl-common.h | 22 | ||||
-rw-r--r-- | backends/sdl/sdl.cpp | 6 | ||||
-rw-r--r-- | backends/wince/wince-sdl.cpp | 10 | ||||
-rw-r--r-- | backends/wince/wince-sdl.h | 2 | ||||
-rw-r--r-- | backends/x11/x11.cpp | 32 |
19 files changed, 150 insertions, 149 deletions
diff --git a/backends/PalmOS/Src/palm.cpp b/backends/PalmOS/Src/palm.cpp index 05ebe67520..d61c7d6dee 100644 --- a/backends/PalmOS/Src/palm.cpp +++ b/backends/PalmOS/Src/palm.cpp @@ -64,7 +64,7 @@ void OSystem_PALMOS::init_intern(UInt16 gfx_mode) { _adjustAspectRatio = ConfMan.getBool("aspect_ratio"); } -void OSystem_PALMOS::set_palette(const byte *colors, uint start, uint num) { +void OSystem_PALMOS::setPalette(const byte *colors, uint start, uint num) { if (_quitCount) return; @@ -134,7 +134,7 @@ void OSystem_PALMOS::load_gfx_mode() { _screenP = _offScreenP; _offScreenH = WinGetDisplayWindow(); _screenH = _offScreenH; - _renderer_proc = &OSystem_PALMOS::update_screen__flipping; + _renderer_proc = &OSystem_PALMOS::updateScreen__flipping; break; case GFX_WIDE: case GFX_BUFFERED: @@ -153,13 +153,13 @@ void OSystem_PALMOS::load_gfx_mode() { gVars->screenLocked = true; _screenP = WinScreenLock(winLockErase) + _screenOffset.addr; _renderer_proc = (OPTIONS_TST(kOptModeLandscape)) ? - &OSystem_PALMOS::update_screen__wide_landscape : - &OSystem_PALMOS::update_screen__wide_portrait; + &OSystem_PALMOS::updateScreen__wide_landscape : + &OSystem_PALMOS::updateScreen__wide_portrait; } } else { _screenP = (byte *)(BmpGetBits(WinGetBitmap(_screenH))) + _screenOffset.addr; - _renderer_proc = &OSystem_PALMOS::update_screen__buffered; + _renderer_proc = &OSystem_PALMOS::updateScreen__buffered; } _offScreenPitch = _screenWidth; break; @@ -170,7 +170,7 @@ void OSystem_PALMOS::load_gfx_mode() { _screenH = _offScreenH; _offScreenP = (byte *)(BmpGetBits(WinGetBitmap(_offScreenH))) + _screenOffset.addr; _screenP = _offScreenP; - _renderer_proc = &OSystem_PALMOS::update_screen__direct; + _renderer_proc = &OSystem_PALMOS::updateScreen__direct; break; } @@ -178,7 +178,7 @@ void OSystem_PALMOS::load_gfx_mode() { WinSetCoordinateSystem(kCoordinatesNative); // palette for preload dialog - set_palette(startupPalette,0,16); + setPalette(startupPalette,0,16); // try to allocate on storage heap FtrPtrNew(appFileCreator, ftrOverlayPtr, _screenWidth * _screenHeight, (void **)&_tmpScreenP); @@ -389,7 +389,7 @@ void OSystem_PALMOS::copy_rect(const byte *buf, int pitch, int x, int y, int w, // Tapwave code will come here #endif -void OSystem_PALMOS::update_screen__wide_portrait() { +void OSystem_PALMOS::updateScreen__wide_portrait() { UInt8 *dst = _screenP + _screenOffset.y; UInt8 *src1 = _offScreenP + WIDE_PITCH - 1; @@ -437,7 +437,7 @@ void OSystem_PALMOS::update_screen__wide_portrait() { _screenP = WinScreenLock(winLockCopy) + _screenOffset.addr; } -void OSystem_PALMOS::update_screen__wide_landscape() { +void OSystem_PALMOS::updateScreen__wide_landscape() { UInt8 *dst = _screenP; UInt8 *src = _offScreenP; @@ -475,7 +475,7 @@ void OSystem_PALMOS::update_screen__wide_landscape() { _screenP = WinScreenLock(winLockCopy) + _screenOffset.addr; } -void OSystem_PALMOS::update_screen__flipping() { +void OSystem_PALMOS::updateScreen__flipping() { RectangleType r, dummy; Boolean shaked = false; @@ -511,7 +511,7 @@ void OSystem_PALMOS::update_screen__flipping() { } -void OSystem_PALMOS::update_screen__buffered() { +void OSystem_PALMOS::updateScreen__buffered() { UInt32 move = 0; UInt32 size = _screenWidth * _screenHeight; @@ -557,7 +557,7 @@ void OSystem_PALMOS::update_screen__buffered() { } -void OSystem_PALMOS::update_screen__direct() { +void OSystem_PALMOS::updateScreen__direct() { if (_current_shake_pos != _new_shake_pos) { if (_vibrate) { Boolean active = (_new_shake_pos >= 3); @@ -624,7 +624,7 @@ void OSystem_PALMOS::draw1BitGfx(UInt16 id, UInt32 x, UInt32 y, Boolean show) { } } -void OSystem_PALMOS::update_screen() { +void OSystem_PALMOS::updateScreen() { if(_quitCount) return; @@ -751,10 +751,10 @@ void OSystem_PALMOS::set_timer(TimerProc callback, int timer) { } /* Mutex handling */ -OSystem::MutexRef OSystem_PALMOS::create_mutex() {return NULL;} -void OSystem_PALMOS::lock_mutex(MutexRef mutex) {} -void OSystem_PALMOS::unlock_mutex(MutexRef mutex) {} -void OSystem_PALMOS::delete_mutex(MutexRef mutex) {} +OSystem::MutexRef OSystem_PALMOS::createMutex() {return NULL;} +void OSystem_PALMOS::lockMutex(MutexRef mutex) {} +void OSystem_PALMOS::unlockMutex(MutexRef mutex) {} +void OSystem_PALMOS::deleteMutex(MutexRef mutex) {} void OSystem_PALMOS::SimulateArrowKeys(Event *event, Int8 iHoriz, Int8 iVert, Boolean repeat) { Int16 x = _mouseCurState.x; diff --git a/backends/PalmOS/Src/palm.h b/backends/PalmOS/Src/palm.h index cd87daf12c..baee772065 100644 --- a/backends/PalmOS/Src/palm.h +++ b/backends/PalmOS/Src/palm.h @@ -46,7 +46,7 @@ typedef struct { class OSystem_PALMOS : public OSystem { public: // Set colors of the palette - void set_palette(const byte *colors, uint start, uint num); + void setPalette(const byte *colors, uint start, uint num); // Set the size of the video bitmap. // Typically, 320x200 @@ -61,7 +61,7 @@ public: void move_screen(int dx, int dy, int height); // Update the dirty areas of the screen - void update_screen(); + void updateScreen(); // Either show or hide the mouse cursor bool show_mouse(bool visible); @@ -129,10 +129,10 @@ public: void set_timer(TimerProc callback, int timer); // Mutex handling - MutexRef create_mutex(); - void lock_mutex(MutexRef mutex); - void unlock_mutex(MutexRef mutex); - void delete_mutex(MutexRef mutex); + MutexRef createMutex(); + void lockMutex(MutexRef mutex); + void unlockMutex(MutexRef mutex); + void deleteMutex(MutexRef mutex); // Quit void quit(); @@ -170,12 +170,12 @@ private: typedef void (OSystem_PALMOS::*RendererProc)(); RendererProc _renderer_proc; - void update_screen__flipping(); - void update_screen__buffered(); - void update_screen__direct(); - void update_screen__wide_portrait(); - void update_screen__wide_landscape(); - void update_screen__wide_zodiac(); + void updateScreen__flipping(); + void updateScreen__buffered(); + void updateScreen__direct(); + void updateScreen__wide_portrait(); + void updateScreen__wide_landscape(); + void updateScreen__wide_zodiac(); void *ptrP[5]; // various ptr diff --git a/backends/dc/dc.h b/backends/dc/dc.h index b39d442856..a72ecc252b 100644 --- a/backends/dc/dc.h +++ b/backends/dc/dc.h @@ -31,7 +31,7 @@ class OSystem_Dreamcast : public OSystem { OSystem_Dreamcast(); // Set colors of the palette - void set_palette(const byte *colors, uint start, uint num); + void setPalette(const byte *colors, uint start, uint num); // Set the size of the video bitmap. // Typically, 320x200 @@ -45,7 +45,7 @@ class OSystem_Dreamcast : public OSystem { void move_screen(int dx, int dy, int height); // Update the dirty areas of the screen - void update_screen(); + void updateScreen(); // Either show or hide the mouse cursor bool show_mouse(bool visible); @@ -104,10 +104,10 @@ class OSystem_Dreamcast : public OSystem { virtual void set_timer(TimerProc callback, int timer); // Mutex handling - virtual MutexRef create_mutex(); - virtual void lock_mutex(MutexRef mutex); - virtual void unlock_mutex(MutexRef mutex); - virtual void delete_mutex(MutexRef mutex); + virtual MutexRef createMutex(); + virtual void lockMutex(MutexRef mutex); + virtual void unlockMutex(MutexRef mutex); + virtual void deleteMutex(MutexRef mutex); // Savefile handling virtual SaveFileManager *get_savefile_manager(); diff --git a/backends/dc/dcmain.cpp b/backends/dc/dcmain.cpp index 999f8906f7..10970122b3 100644 --- a/backends/dc/dcmain.cpp +++ b/backends/dc/dcmain.cpp @@ -130,20 +130,20 @@ void OSystem_Dreamcast::quit() { } /* Mutex handling */ -OSystem::MutexRef OSystem_Dreamcast::create_mutex() +OSystem::MutexRef OSystem_Dreamcast::createMutex() { return NULL; } -void OSystem_Dreamcast::lock_mutex(MutexRef mutex) +void OSystem_Dreamcast::lockMutex(MutexRef mutex) { } -void OSystem_Dreamcast::unlock_mutex(MutexRef mutex) +void OSystem_Dreamcast::unlockMutex(MutexRef mutex) { } -void OSystem_Dreamcast::delete_mutex(MutexRef mutex) +void OSystem_Dreamcast::deleteMutex(MutexRef mutex) { } diff --git a/backends/dc/display.cpp b/backends/dc/display.cpp index 13d23d6eb1..840454d51b 100644 --- a/backends/dc/display.cpp +++ b/backends/dc/display.cpp @@ -128,7 +128,7 @@ void commit_dummy_transpoly() } -void OSystem_Dreamcast::set_palette(const byte *colors, uint start, uint num) +void OSystem_Dreamcast::setPalette(const byte *colors, uint start, uint num) { unsigned short *dst = palette + start; if(num>0) @@ -270,7 +270,7 @@ void OSystem_Dreamcast::set_shake_pos(int shake_pos) _current_shake_pos = shake_pos; } -void OSystem_Dreamcast::update_screen(void) +void OSystem_Dreamcast::updateScreen(void) { struct polygon_list mypoly; struct packed_colour_vertex_list myvertex; diff --git a/backends/dc/icon.cpp b/backends/dc/icon.cpp index 2aca27c601..95176763e6 100644 --- a/backends/dc/icon.cpp +++ b/backends/dc/icon.cpp @@ -61,7 +61,7 @@ void Icon::create_texture() texture = tex; } -void Icon::set_palette(int pal) +void Icon::setPalette(int pal) { unsigned int (*hwpal)[64][16] = (unsigned int (*)[64][16])0xa05f9000; for(int n = 0; n<16; n++) diff --git a/backends/dc/icon.h b/backends/dc/icon.h index b5a3b14fbe..dea8d0e7a5 100644 --- a/backends/dc/icon.h +++ b/backends/dc/icon.h @@ -35,7 +35,7 @@ class Icon bool load(const void *data, int len, int offs = 0); bool load(const char *filename); void create_texture(); - void set_palette(int pal); + void setPalette(int pal); void draw(float x1, float y1, float x2, float y2, int pal, unsigned argb = 0xffffffff); void create_vmicon(void *buffer); diff --git a/backends/dc/selector.cpp b/backends/dc/selector.cpp index 38f7ebf024..05af35d1c8 100644 --- a/backends/dc/selector.cpp +++ b/backends/dc/selector.cpp @@ -426,7 +426,7 @@ int gameMenu(Game *games, int num_games) draw_trans_quad(100.0, y, 590.0, y+32.0, 0x7000ff00, 0x7000ff00, 0x7000ff00, 0x7000ff00); - games[i].icon.set_palette(pal); + games[i].icon.setPalette(pal); drawGameLabel(games[i], pal, 50.0, y, (cnt == selector_pos? 0xffff00 : 0xffffff)); y += 40.0; diff --git a/backends/gp32/gp32.cpp b/backends/gp32/gp32.cpp index 1d529e25bd..c8662beca6 100644 --- a/backends/gp32/gp32.cpp +++ b/backends/gp32/gp32.cpp @@ -36,7 +36,7 @@ char currsurface; FILE *fstderr, *fstdout, *fstdin; // Set colors of the palette -void OSystem_GP32::set_palette(const byte *colors, uint start, uint num) { +void OSystem_GP32::setPalette(const byte *colors, uint start, uint num) { const byte *b = colors; uint i; SDL_Color *base = _currentPalette + start; @@ -692,7 +692,7 @@ char * SDL_GetError() { } // Update the dirty areas of the screen -void OSystem_GP32::update_screen() { +void OSystem_GP32::updateScreen() { assert(sdl_hwscreen != NULL); // If the shake position changed, fill the dirty area with blackness @@ -1017,7 +1017,7 @@ void OSystem_GP32::hotswap_gfx_mode() { copy_rect(bak_mem, _screenWidth, 0, 0, _screenWidth, _screenHeight); free(bak_mem); - update_screen(); + updateScreen(); } // Get or set a property @@ -1072,12 +1072,12 @@ void OSystem_GP32::update_cdrom() { } void OSystem_GP32::set_timer(TimerProc callback, int timer) { } // Mutex handling -OSystem::MutexRef OSystem_GP32::create_mutex() { +OSystem::MutexRef OSystem_GP32::createMutex() { return NULL; } -void OSystem_GP32::lock_mutex(MutexRef mutex) { } -void OSystem_GP32::unlock_mutex(MutexRef mutex) { } -void OSystem_GP32::delete_mutex(MutexRef mutex) { } +void OSystem_GP32::lockMutex(MutexRef mutex) { } +void OSystem_GP32::unlockMutex(MutexRef mutex) { } +void OSystem_GP32::deleteMutex(MutexRef mutex) { } // Quit void gphalt(int); diff --git a/backends/gp32/gp32.h b/backends/gp32/gp32.h index 2b692f0493..435072626d 100644 --- a/backends/gp32/gp32.h +++ b/backends/gp32/gp32.h @@ -35,7 +35,7 @@ class OSystem_GP32 : public OSystem { public: // Set colors of the palette - void set_palette(const byte *colors, uint start, uint num); + void setPalette(const byte *colors, uint start, uint num); // Set the size of the video bitmap. // Typically, 320x200 @@ -52,7 +52,7 @@ public: void move_screen(int dx, int dy, int height); // Update the dirty areas of the screen - void update_screen(); + void updateScreen(); // Either show or hide the mouse cursor bool show_mouse(bool visible); @@ -103,10 +103,10 @@ public: void set_timer(TimerProc callback, int timer); // Mutex handling - OSystem::MutexRef create_mutex(); - void lock_mutex(MutexRef mutex); - void unlock_mutex(MutexRef mutex); - void delete_mutex(MutexRef mutex); + OSystem::MutexRef createMutex(); + void lockMutex(MutexRef mutex); + void unlockMutex(MutexRef mutex); + void deleteMutex(MutexRef mutex); // Quit void quit(); @@ -149,7 +149,7 @@ private: DF_UPDATE_EXPAND_1_PIXEL = 1 << 3 }; - bool _forceFull; // Force full redraw on next update_screen + bool _forceFull; // Force full redraw on next updateScreen int _scaleFactor; int _mode; bool _full_screen; diff --git a/backends/morphos/morphos.cpp b/backends/morphos/morphos.cpp index d36965538d..8b48e542dc 100644 --- a/backends/morphos/morphos.cpp +++ b/backends/morphos/morphos.cpp @@ -327,7 +327,7 @@ void OSystem_MorphOS::set_timer(TimerProc callback, int timer) warning("set_timer() unexpectedly called"); } -OSystem::MutexRef OSystem_MorphOS::create_mutex() +OSystem::MutexRef OSystem_MorphOS::createMutex() { SignalSemaphore *sem = (SignalSemaphore *) AllocVec(sizeof (SignalSemaphore), MEMF_PUBLIC); @@ -337,17 +337,17 @@ OSystem::MutexRef OSystem_MorphOS::create_mutex() return (MutexRef)sem; } -void OSystem_MorphOS::lock_mutex(MutexRef mutex) +void OSystem_MorphOS::lockMutex(MutexRef mutex) { ObtainSemaphore((SignalSemaphore *) mutex); } -void OSystem_MorphOS::unlock_mutex(MutexRef mutex) +void OSystem_MorphOS::unlockMutex(MutexRef mutex) { ReleaseSemaphore((SignalSemaphore *)mutex); } -void OSystem_MorphOS::delete_mutex(MutexRef mutex) +void OSystem_MorphOS::deleteMutex(MutexRef mutex) { FreeVec(mutex); } @@ -519,7 +519,7 @@ void OSystem_MorphOS::quit() #define CVT8TO32(col) ((col<<24) | (col<<16) | (col<<8) | col) -void OSystem_MorphOS::set_palette(const byte *colors, uint start, uint num) +void OSystem_MorphOS::setPalette(const byte *colors, uint start, uint num) { const byte *data = colors; UWORD changed_colors[256]; @@ -1170,7 +1170,7 @@ bool OSystem_MorphOS::AddUpdateRect(WORD x, WORD y, WORD w, WORD h) return true; } -void OSystem_MorphOS::update_screen() +void OSystem_MorphOS::updateScreen() { AUTO_LOCK diff --git a/backends/morphos/morphos.h b/backends/morphos/morphos.h index 49ea1a654a..6ce4413641 100644 --- a/backends/morphos/morphos.h +++ b/backends/morphos/morphos.h @@ -43,7 +43,7 @@ class OSystem_MorphOS : public OSystem bool Initialise(); // Set colors of the palette - virtual void set_palette(const byte *colors, uint start, uint num); + virtual void setPalette(const byte *colors, uint start, uint num); // Set the size of the video bitmap. // Typically, 320x200 @@ -55,7 +55,7 @@ class OSystem_MorphOS : public OSystem void move_screen(int dx, int dy, int height); // Update the dirty areas of the screen - virtual void update_screen(); + virtual void updateScreen(); // Either show or hide the mouse cursor virtual bool show_mouse(bool visible); @@ -88,10 +88,10 @@ class OSystem_MorphOS : public OSystem virtual void set_timer(TimerProc callback, int timer); // Mutex handling - virtual MutexRef create_mutex(); - virtual void lock_mutex(MutexRef mutex); - virtual void unlock_mutex(MutexRef mutex); - virtual void delete_mutex(MutexRef mutex); + virtual MutexRef createMutex(); + virtual void lockMutex(MutexRef mutex); + virtual void unlockMutex(MutexRef mutex); + virtual void deleteMutex(MutexRef mutex); // Get the next event. // Returns true if an event was retrieved. diff --git a/backends/null/null.cpp b/backends/null/null.cpp index 6e60044b2c..f78754d813 100644 --- a/backends/null/null.cpp +++ b/backends/null/null.cpp @@ -29,11 +29,11 @@ /* NULL video driver */ class OSystem_NULL : public OSystem { public: - void set_palette(const byte *colors, uint start, uint num) {} + void setPalette(const byte *colors, uint start, uint num) {} void initSize(uint w, uint h); void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) {} void move_screen(int dx, int dy) {} - void update_screen() {} + void updateScreen() {} 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) {} diff --git a/backends/sdl/sdl-common.cpp b/backends/sdl/sdl-common.cpp index dbf7f2de9f..3fc8e7c2ec 100644 --- a/backends/sdl/sdl-common.cpp +++ b/backends/sdl/sdl-common.cpp @@ -95,11 +95,11 @@ void OSystem_SDL_Common::init_intern() { if (joystick_num > -1) sdlFlags |= SDL_INIT_JOYSTICK; - if (SDL_Init(sdlFlags) ==-1) { - error("Could not initialize SDL: %s.\n", SDL_GetError()); + if (SDL_Init(sdlFlags) == -1) { + error("Could not initialize SDL: %s", SDL_GetError()); } - _graphicsMutex = create_mutex(); + _graphicsMutex = createMutex(); SDL_ShowCursor(SDL_DISABLE); @@ -156,7 +156,7 @@ OSystem_SDL_Common::~OSystem_SDL_Common() { free(_dirty_checksums); free(_currentPalette); free(_mouseBackup); - delete_mutex(_graphicsMutex); + deleteMutex(_graphicsMutex); SDL_ShowCursor(SDL_ENABLE); SDL_Quit(); @@ -229,7 +229,7 @@ void OSystem_SDL_Common::copy_rect(const byte *src, int pitch, int x, int y, int // Try to lock the screen surface if (SDL_LockSurface(_screen) == -1) - error("SDL_LockSurface failed: %s.\n", SDL_GetError()); + error("SDL_LockSurface failed: %s", SDL_GetError()); byte *dst = (byte *)_screen->pixels + y * _screenWidth + x; @@ -268,7 +268,7 @@ void OSystem_SDL_Common::move_screen(int dx, int dy, int height) { // Try to lock the screen surface if (SDL_LockSurface(_screen) == -1) - error("SDL_LockSurface failed: %s.\n", SDL_GetError()); + error("SDL_LockSurface failed: %s", SDL_GetError()); // vertical movement if (dy > 0) { @@ -535,7 +535,7 @@ void OSystem_SDL_Common::set_mouse_pos(int x, int y) { _mouseCurState.x = x; _mouseCurState.y = y; undraw_mouse(); - update_screen(); + updateScreen(); } } @@ -1050,14 +1050,18 @@ void OSystem_SDL_Common::clearSoundCallback() { SDL_CloseAudio(); } +int OSystem_SDL_Common::getOutputSampleRate() const { + return SAMPLES_PER_SEC; +} + const OSystem::GraphicsMode *OSystem_SDL_Common::getSupportedGraphicsModes() const { return s_supportedGraphicsModes; } -void OSystem_SDL_Common::update_screen() { +void OSystem_SDL_Common::updateScreen() { Common::StackLock lock(_graphicsMutex, this); // Lock the mutex until this function ends - intern_update_screen(); + internUpdateScreen(); } bool OSystem_SDL_Common::setGraphicsMode(int mode) { @@ -1131,7 +1135,7 @@ bool OSystem_SDL_Common::setGraphicsMode(int mode) { _forceFull = true; // Blit everything to the screen - intern_update_screen(); + internUpdateScreen(); // Make sure that an EVENT_SCREEN_CHANGED gets sent later _modeChanged = true; @@ -1149,29 +1153,6 @@ void OSystem_SDL_Common::setWindowCaption(const char *caption) { SDL_WM_SetCaption(caption, caption); } -bool OSystem_SDL_Common::openCD(int drive) { - if (SDL_InitSubSystem(SDL_INIT_CDROM) == -1) - _cdrom = NULL; - else { - _cdrom = SDL_CDOpen(drive); - // Did it open? Check if _cdrom is NULL - if (!_cdrom) { - warning("Couldn't open drive: %s", SDL_GetError()); - } else { - cd_num_loops = 0; - cd_stop_time = 0; - cd_end_time = 0; - } - } - - return (_cdrom != NULL); -} - -int OSystem_SDL_Common::getOutputSampleRate() const { - return SAMPLES_PER_SEC; -} - - bool OSystem_SDL_Common::hasFeature(Feature f) { return (f == kFeatureFullscreenMode) || @@ -1278,7 +1259,7 @@ void OSystem_SDL_Common::draw_mouse() { // Draw the mouse cursor; backup the covered area in "bak" if (SDL_LockSurface(_overlayVisible ? _tmpscreen : _screen) == -1) - error("SDL_LockSurface failed: %s.\n", SDL_GetError()); + error("SDL_LockSurface failed: %s", SDL_GetError()); // Mark as dirty add_dirty_rect(x, y, w, h); @@ -1338,7 +1319,7 @@ void OSystem_SDL_Common::undraw_mouse() { _mouseDrawn = false; if (SDL_LockSurface(_overlayVisible ? _tmpscreen : _screen) == -1) - error("SDL_LockSurface failed: %s.\n", SDL_GetError()); + error("SDL_LockSurface failed: %s", SDL_GetError()); const int old_mouse_x = _mouseOldState.x; const int old_mouse_y = _mouseOldState.y; @@ -1375,6 +1356,24 @@ void OSystem_SDL_Common::undraw_mouse() { SDL_UnlockSurface(_overlayVisible ? _tmpscreen : _screen); } +bool OSystem_SDL_Common::openCD(int drive) { + if (SDL_InitSubSystem(SDL_INIT_CDROM) == -1) + _cdrom = NULL; + else { + _cdrom = SDL_CDOpen(drive); + // Did it open? Check if _cdrom is NULL + if (!_cdrom) { + warning("Couldn't open drive: %s", SDL_GetError()); + } else { + cd_num_loops = 0; + cd_stop_time = 0; + cd_end_time = 0; + } + } + + return (_cdrom != NULL); +} + void OSystem_SDL_Common::stop_cdrom() { /* Stop CD Audio in 1/10th of a second */ cd_stop_time = SDL_GetTicks() + 100; cd_num_loops = 0; @@ -1488,19 +1487,19 @@ void OSystem_SDL_Common::setup_icon() { SDL_FreeSurface(sdl_surf); } -OSystem::MutexRef OSystem_SDL_Common::create_mutex(void) { +OSystem::MutexRef OSystem_SDL_Common::createMutex(void) { return (MutexRef) SDL_CreateMutex(); } -void OSystem_SDL_Common::lock_mutex(MutexRef mutex) { +void OSystem_SDL_Common::lockMutex(MutexRef mutex) { SDL_mutexP((SDL_mutex *) mutex); } -void OSystem_SDL_Common::unlock_mutex(MutexRef mutex) { +void OSystem_SDL_Common::unlockMutex(MutexRef mutex) { SDL_mutexV((SDL_mutex *) mutex); } -void OSystem_SDL_Common::delete_mutex(MutexRef mutex) { +void OSystem_SDL_Common::deleteMutex(MutexRef mutex) { SDL_DestroyMutex((SDL_mutex *) mutex); } @@ -1560,7 +1559,7 @@ void OSystem_SDL_Common::grab_overlay(int16 *buf, int pitch) { undraw_mouse(); if (SDL_LockSurface(_tmpscreen) == -1) - error("SDL_LockSurface failed: %s.\n", SDL_GetError()); + error("SDL_LockSurface failed: %s", SDL_GetError()); int16 *src = (int16 *)_tmpscreen->pixels + _tmpScreenWidth + 1; int h = _screenHeight; @@ -1611,7 +1610,7 @@ void OSystem_SDL_Common::copy_rect_overlay(const int16 *buf, int pitch, int x, i undraw_mouse(); if (SDL_LockSurface(_tmpscreen) == -1) - error("SDL_LockSurface failed: %s.\n", SDL_GetError()); + error("SDL_LockSurface failed: %s", SDL_GetError()); int16 *dst = (int16 *)_tmpscreen->pixels + (y + 1) * _tmpScreenWidth + (x + 1); do { @@ -1623,7 +1622,7 @@ void OSystem_SDL_Common::copy_rect_overlay(const int16 *buf, int pitch, int x, i SDL_UnlockSurface(_tmpscreen); } -void OSystem_SDL_Common::set_palette(const byte *colors, uint start, uint num) { +void OSystem_SDL_Common::setPalette(const byte *colors, uint start, uint num) { const byte *b = colors; uint i; SDL_Color *base = _currentPalette + start; diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h index 9a612d80b3..d007bf91ce 100644 --- a/backends/sdl/sdl-common.h +++ b/backends/sdl/sdl-common.h @@ -37,7 +37,7 @@ public: void initSize(uint w, uint h); // Set colors of the palette - void set_palette(const byte *colors, uint start, uint num); + void setPalette(const byte *colors, uint start, uint num); // Draw a bitmap to screen. // The screen will not be updated to reflect the new bitmap @@ -46,7 +46,7 @@ public: void move_screen(int dx, int dy, int height); // Update the dirty areas of the screen - void update_screen(); + void updateScreen(); // Either show or hide the mouse cursor bool show_mouse(bool visible); @@ -98,10 +98,10 @@ public: void set_timer(TimerProc callback, int timer); // Mutex handling - MutexRef create_mutex(); - void lock_mutex(MutexRef mutex); - void unlock_mutex(MutexRef mutex); - void delete_mutex(MutexRef mutex); + MutexRef createMutex(); + void lockMutex(MutexRef mutex); + void unlockMutex(MutexRef mutex); + void deleteMutex(MutexRef mutex); // Overlay virtual void show_overlay(); @@ -159,7 +159,7 @@ protected: DF_UPDATE_EXPAND_1_PIXEL = 1 << 1 }; - bool _forceFull; // Force full redraw on next update_screen + bool _forceFull; // Force full redraw on next updateScreen ScalerProc *_scaler_proc; int _scaleFactor; int _mode; @@ -217,8 +217,10 @@ protected: SDL_Color *_currentPalette; uint _paletteDirtyStart, _paletteDirtyEnd; - // Mutex that prevents multiple threads interferring with each other - // when accessing the screen. + /** + * Mutex which prevents multiple threads from interfering with each other + * when accessing the screen. + */ MutexRef _graphicsMutex; @@ -235,7 +237,7 @@ protected: void toggleMouseGrab(); - virtual void intern_update_screen() = 0; + virtual void internUpdateScreen() = 0; virtual void load_gfx_mode() = 0; virtual void unload_gfx_mode() = 0; diff --git a/backends/sdl/sdl.cpp b/backends/sdl/sdl.cpp index 7b28f75552..5e231e07a6 100644 --- a/backends/sdl/sdl.cpp +++ b/backends/sdl/sdl.cpp @@ -28,7 +28,7 @@ public: OSystem_SDL(); // Update the dirty areas of the screen - void intern_update_screen(); + void internUpdateScreen(); protected: SDL_Surface *_hwscreen; // hardware screen @@ -222,13 +222,13 @@ void OSystem_SDL::hotswap_gfx_mode() { SDL_FreeSurface(old_tmpscreen); // Blit everything to the screen - intern_update_screen(); + internUpdateScreen(); // Make sure that an EVENT_SCREEN_CHANGED gets sent later _modeChanged = true; } -void OSystem_SDL::intern_update_screen() { +void OSystem_SDL::internUpdateScreen() { assert(_hwscreen != NULL); // If the shake position changed, fill the dirty area with blackness diff --git a/backends/wince/wince-sdl.cpp b/backends/wince/wince-sdl.cpp index 6fb88a4948..1789c56c3c 100644 --- a/backends/wince/wince-sdl.cpp +++ b/backends/wince/wince-sdl.cpp @@ -126,7 +126,7 @@ void OSystem_WINCE3::swap_panel_visibility() { else add_dirty_rect(0, 200, 320, 40); - update_screen(); + updateScreen(); } } @@ -606,7 +606,7 @@ void OSystem_WINCE3::hotswap_gfx_mode() { SDL_FreeSurface(old_tmpscreen); // Blit everything to the screen - update_screen(); + updateScreen(); // Make sure that an EVENT_SCREEN_CHANGED gets sent later _modeChanged = true; @@ -623,7 +623,7 @@ void OSystem_WINCE3::update_keyboard() { } } -void OSystem_WINCE3::update_screen() { +void OSystem_WINCE3::updateScreen() { assert(_hwscreen != NULL); Common::StackLock lock(_graphicsMutex, this); // Lock the mutex until this function ends @@ -1254,7 +1254,7 @@ bool OSystem_WINCE3::poll_event(Event *event) { if (_toolbarHandler.action(temp_event.mouse.x, temp_event.mouse.y, true)) { if (!_toolbarHandler.drawn()) - update_screen(); + updateScreen(); if (_newOrientation != _orientationLandscape) { _orientationLandscape = _newOrientation; ConfMan.set("CE_landscape", _orientationLandscape); @@ -1281,7 +1281,7 @@ bool OSystem_WINCE3::poll_event(Event *event) { if (_toolbarHandler.action(temp_event.mouse.x, temp_event.mouse.y, false)) { if (!_toolbarHandler.drawn()) - update_screen(); + updateScreen(); } else { if (!_freeLook) diff --git a/backends/wince/wince-sdl.h b/backends/wince/wince-sdl.h index a8e131f5cd..c11761e582 100644 --- a/backends/wince/wince-sdl.h +++ b/backends/wince/wince-sdl.h @@ -41,7 +41,7 @@ public: OSystem_WINCE3(); // Update the dirty areas of the screen - void update_screen(); + void updateScreen(); // Set a parameter uint32 property(int param, Property *value); diff --git a/backends/x11/x11.cpp b/backends/x11/x11.cpp index 3ce815a728..73b0e2cce8 100644 --- a/backends/x11/x11.cpp +++ b/backends/x11/x11.cpp @@ -56,7 +56,7 @@ class OSystem_X11:public OSystem { public: // Set colors of the palette - void set_palette(const byte *colors, uint start, uint num); + void setPalette(const byte *colors, uint start, uint num); // Set the size of the video bitmap. // Typically, 320x200 @@ -69,7 +69,7 @@ public: void move_screen(int dx, int dy, int height); // Update the dirty areas of the screen - void update_screen(); + void updateScreen(); // Either show or hide the mouse cursor bool show_mouse(bool visible); @@ -126,10 +126,10 @@ public: void set_timer(TimerProc callback, int interval); // Mutex handling - MutexRef create_mutex(); - void lock_mutex(MutexRef mutex); - void unlock_mutex(MutexRef mutex); - void delete_mutex(MutexRef mutex); + MutexRef createMutex(); + void lockMutex(MutexRef mutex); + void unlockMutex(MutexRef mutex); + void deleteMutex(MutexRef mutex); // Overlay handling for the new menu system void show_overlay(); @@ -153,7 +153,7 @@ private: void create_empty_cursor(); void draw_mouse(dirty_square *dout); void undraw_mouse(); - void update_screen_helper(const dirty_square * d, dirty_square * dout); + void updateScreen_helper(const dirty_square * d, dirty_square * dout); void blit_convert(const dirty_square * d, uint16 *dst, int pitch); uint8 *local_fb; @@ -477,7 +477,7 @@ void OSystem_X11::clearSoundCallback() { } -void OSystem_X11::set_palette(const byte *colors, uint start, uint num) +void OSystem_X11::setPalette(const byte *colors, uint start, uint num) { const byte *data = colors; uint16 *pal = &(palette[start]); @@ -578,7 +578,7 @@ void OSystem_X11::blit_convert(const dirty_square * d, uint16 *dst, int pitch) } } -void OSystem_X11::update_screen_helper(const dirty_square * d, dirty_square * dout) +void OSystem_X11::updateScreen_helper(const dirty_square * d, dirty_square * dout) { if (_overlay_visible == false) { blit_convert(d, (uint16 *) image->data, fb_width); @@ -603,7 +603,7 @@ void OSystem_X11::update_screen_helper(const dirty_square * d, dirty_square * do dout->h = d->y + d->h; } -void OSystem_X11::update_screen() +void OSystem_X11::updateScreen() { bool full_redraw = false; bool need_redraw = false; @@ -620,13 +620,13 @@ void OSystem_X11::update_screen() } if (full_redraw) { - update_screen_helper(&ds_full, &dout); + updateScreen_helper(&ds_full, &dout); need_redraw = true; } else if ((num_of_dirty_square > 0) || (_mouse_state_changed == true)) { need_redraw = true; while (num_of_dirty_square > 0) { num_of_dirty_square--; - update_screen_helper(&(ds[num_of_dirty_square]), &dout); + updateScreen_helper(&(ds[num_of_dirty_square]), &dout); } } @@ -1045,24 +1045,24 @@ void OSystem_X11::set_timer(TimerProc callback, int interval) } } -OSystem::MutexRef OSystem_X11::create_mutex(void) +OSystem::MutexRef OSystem_X11::createMutex(void) { pthread_mutex_t *mutex = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t)); pthread_mutex_init(mutex, NULL); return (MutexRef)mutex; } -void OSystem_X11::lock_mutex(MutexRef mutex) +void OSystem_X11::lockMutex(MutexRef mutex) { pthread_mutex_lock((pthread_mutex_t *) mutex); } -void OSystem_X11::unlock_mutex(MutexRef mutex) +void OSystem_X11::unlockMutex(MutexRef mutex) { pthread_mutex_unlock((pthread_mutex_t *) mutex); } -void OSystem_X11::delete_mutex(MutexRef mutex) +void OSystem_X11::deleteMutex(MutexRef mutex) { pthread_mutex_destroy((pthread_mutex_t *) mutex); free(mutex); |