diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/scummsys.h | 4 | ||||
-rw-r--r-- | common/system.h | 82 | ||||
-rw-r--r-- | common/timer.cpp | 4 | ||||
-rw-r--r-- | common/util.cpp | 4 |
4 files changed, 51 insertions, 43 deletions
diff --git a/common/scummsys.h b/common/scummsys.h index 3cf1e942c9..7eb1fb639b 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -420,10 +420,10 @@ FORCEINLINE uint16 SWAP_BYTES_16(uint16 a) { #if defined(NEWGUI_256) // 256 color only on PalmOS - typedef byte NewGuiColor; + typedef byte OverlayColor; #else // 15/16 bit color mode everywhere else... - typedef int16 NewGuiColor; + typedef int16 OverlayColor; #endif /* diff --git a/common/system.h b/common/system.h index 288a92eb18..e0c5a08505 100644 --- a/common/system.h +++ b/common/system.h @@ -153,28 +153,32 @@ public: virtual int16 get_width() = 0; /** Set colors of the palette. */ - virtual void set_palette(const byte *colors, uint start, uint num) = 0; + virtual void setPalette(const byte *colors, uint start, uint num) = 0; /** * Draw a bitmap to screen. * The screen will not be updated to reflect the new bitmap, you have - * to call update_screen to do that. - * @see update_screen + * to call updateScreen to do that. + * @see updateScreen */ virtual void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) = 0; + /** Update the dirty areas of the screen. */ + virtual void updateScreen() = 0; + /** * Moves the screen content by the offset specified via dx/dy. * Only the region from x=0 till x=height-1 is affected. * @param dx the horizontal offset. * @param dy the vertical offset. * @param height the number of lines which in which the move will be done. + * + * @todo This is a rather special screen effect, only used by the SCUMM + * frontend - we should consider removing it from the backend API + * and instead implement the functionality in the frontend. */ virtual void move_screen(int dx, int dy, int height) = 0; - /** Update the dirty areas of the screen. */ - virtual void update_screen() = 0; - /** * Set current shake position, a feature needed for some SCUMM screen effects. * The effect causes the displayed graphics to be shifted upwards by the specified @@ -183,31 +187,13 @@ public: * be lost - that is, to restore the original view, the game engine only has to * call this method again with a 0 offset. No calls to copy_rect are necessary. * @param shakeOffset the shake offset + * + * @todo This is a rather special screen effect, only used by the SCUMM + * frontend - we should consider removing it from the backend API + * and instead implement the functionality in the frontend. */ virtual void set_shake_pos(int shakeOffset) = 0; - /** Convert the given RGB triplet into a NewGuiColor. A NewGuiColor can be - * 8bit, 16bit or 32bit, depending on the target system. The default - * implementation generates a 16 bit color value, in the 565 format - * (that is, 5 bits red, 6 bits green, 5 bits blue). - * @see colorToRGB - */ - virtual NewGuiColor RGBToColor(uint8 r, uint8 g, uint8 b) { - return ((((r >> 3) & 0x1F) << 11) | (((g >> 2) & 0x3F) << 5) | ((b >> 3) & 0x1F)); - } - - /** Convert the given NewGuiColor into a RGB triplet. A NewGuiColor can be - * 8bit, 16bit or 32bit, depending on the target system. The default - * implementation takes a 16 bit color value and assumes it to be in 565 format - * (that is, 5 bits red, 6 bits green, 5 bits blue). - * @see RGBToColor - */ - virtual void colorToRGB(NewGuiColor color, uint8 &r, uint8 &g, uint8 &b) { - r = (((color >> 11) & 0x1F) << 3); - g = (((color >> 5) & 0x3F) << 2); - b = ((color&0x1F) << 3); - } - //@} @@ -361,7 +347,7 @@ public: */ virtual void update_cdrom() = 0; - //@} + //@} @@ -374,19 +360,19 @@ public: * Create a new mutex. * @return the newly created mutex, or 0 if an error occured. */ - virtual MutexRef create_mutex(void) = 0; + virtual MutexRef createMutex(void) = 0; /** * Lock the given mutex. * @param mutex the mutex to lock. */ - virtual void lock_mutex(MutexRef mutex) = 0; + virtual void lockMutex(MutexRef mutex) = 0; /** * Unlock the given mutex. * @param mutex the mutex to unlock. */ - virtual void unlock_mutex(MutexRef mutex) = 0; + virtual void unlockMutex(MutexRef mutex) = 0; /** * Delete the given mutex. Make sure the mutex is unlocked before you delete it. @@ -394,8 +380,8 @@ public: * program may crash. * @param mutex the mutex to delete. */ - virtual void delete_mutex(MutexRef mutex) = 0; - //@} + virtual void deleteMutex(MutexRef mutex) = 0; + //@} @@ -404,11 +390,33 @@ public: virtual void show_overlay() = 0; virtual void hide_overlay() = 0; virtual void clear_overlay() = 0; - virtual void grab_overlay(NewGuiColor *buf, int pitch) = 0; - virtual void copy_rect_overlay(const NewGuiColor *buf, int pitch, int x, int y, int w, int h) = 0; + virtual void grab_overlay(OverlayColor *buf, int pitch) = 0; + virtual void copy_rect_overlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) = 0; virtual int16 get_overlay_height() { return get_height(); } virtual int16 get_overlay_width() { return get_width(); } - //@} + + /** Convert the given RGB triplet into a OverlayColor. A OverlayColor can be + * 8bit, 16bit or 32bit, depending on the target system. The default + * implementation generates a 16 bit color value, in the 565 format + * (that is, 5 bits red, 6 bits green, 5 bits blue). + * @see colorToRGB + */ + virtual OverlayColor RGBToColor(uint8 r, uint8 g, uint8 b) { + return ((((r >> 3) & 0x1F) << 11) | (((g >> 2) & 0x3F) << 5) | ((b >> 3) & 0x1F)); + } + + /** Convert the given OverlayColor into a RGB triplet. A OverlayColor can be + * 8bit, 16bit or 32bit, depending on the target system. The default + * implementation takes a 16 bit color value and assumes it to be in 565 format + * (that is, 5 bits red, 6 bits green, 5 bits blue). + * @see RGBToColor + */ + virtual void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) { + r = (((color >> 11) & 0x1F) << 3); + g = (((color >> 5) & 0x3F) << 2); + b = ((color&0x1F) << 3); + } + //@} diff --git a/common/timer.cpp b/common/timer.cpp index 4a4115f789..06f3b6af90 100644 --- a/common/timer.cpp +++ b/common/timer.cpp @@ -33,7 +33,7 @@ Timer::Timer(OSystem *system) : _timerHandler(0), _lastTime(0) { - _mutex = _system->create_mutex(); + _mutex = _system->createMutex(); g_timer = this; @@ -71,7 +71,7 @@ Timer::~Timer() { // it is still waiting for the _mutex. So, again depending on the backend, // we might end up unlocking the mutex then immediately deleting it, while // the timer thread is about to lock it. - _system->delete_mutex(_mutex); + _system->deleteMutex(_mutex); } int Timer::timer_handler(int t) { diff --git a/common/util.cpp b/common/util.cpp index ae307faff5..85a4810e43 100644 --- a/common/util.cpp +++ b/common/util.cpp @@ -119,7 +119,7 @@ void StackLock::lock() { if (_mutexName != NULL) debug(6, "Locking mutex %s", _mutexName); - _syst->lock_mutex(_mutex); + _syst->lockMutex(_mutex); } void StackLock::unlock() { @@ -127,7 +127,7 @@ void StackLock::unlock() { if (_mutexName != NULL) debug(6, "Unlocking mutex %s", _mutexName); - _syst->unlock_mutex(_mutex); + _syst->unlockMutex(_mutex); } |