aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2004-02-28 12:58:13 +0000
committerMax Horn2004-02-28 12:58:13 +0000
commitc6752cccf5186fb04c97e2bb4a64c52fc9447073 (patch)
tree91f3f0264b1542a839cc3504b52603a8034547cb
parent56102a1d02925abbe9fc0504751de1a270a34ff3 (diff)
downloadscummvm-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
-rw-r--r--backends/PalmOS/Src/palm.cpp34
-rw-r--r--backends/PalmOS/Src/palm.h24
-rw-r--r--backends/dc/dc.h12
-rw-r--r--backends/dc/dcmain.cpp8
-rw-r--r--backends/dc/display.cpp4
-rw-r--r--backends/dc/icon.cpp2
-rw-r--r--backends/dc/icon.h2
-rw-r--r--backends/dc/selector.cpp2
-rw-r--r--backends/gp32/gp32.cpp14
-rw-r--r--backends/gp32/gp32.h14
-rw-r--r--backends/morphos/morphos.cpp12
-rw-r--r--backends/morphos/morphos.h12
-rw-r--r--backends/null/null.cpp4
-rw-r--r--backends/sdl/sdl-common.cpp83
-rw-r--r--backends/sdl/sdl-common.h22
-rw-r--r--backends/sdl/sdl.cpp6
-rw-r--r--backends/wince/wince-sdl.cpp10
-rw-r--r--backends/wince/wince-sdl.h2
-rw-r--r--backends/x11/x11.cpp32
-rw-r--r--base/main.cpp2
-rw-r--r--common/scummsys.h4
-rw-r--r--common/system.h82
-rw-r--r--common/timer.cpp4
-rw-r--r--common/util.cpp4
-rw-r--r--gui/ScrollBarWidget.cpp2
-rw-r--r--gui/TabWidget.cpp2
-rw-r--r--gui/newgui.cpp46
-rw-r--r--gui/newgui.h30
-rw-r--r--gui/widget.cpp4
-rw-r--r--queen/display.cpp12
-rw-r--r--scumm/debugger.cpp2
-rw-r--r--scumm/gfx.cpp14
-rw-r--r--scumm/imuse.cpp8
-rw-r--r--scumm/imuse_digi/dimuse.cpp4
-rw-r--r--scumm/palette.cpp2
-rw-r--r--scumm/player_v2.cpp4
-rw-r--r--scumm/player_v2.h4
-rw-r--r--scumm/scummvm.cpp2
-rw-r--r--scumm/smush/smush_player.cpp6
-rw-r--r--simon/midi.cpp80
-rw-r--r--simon/simon.cpp12
-rw-r--r--simon/vga.cpp4
-rw-r--r--sky/control.cpp26
-rw-r--r--sky/intro.cpp2
-rw-r--r--sky/music/musicbase.cpp10
-rw-r--r--sky/screen.cpp28
-rw-r--r--sound/mixer.cpp4
-rw-r--r--sword1/animation.cpp16
-rw-r--r--sword1/animation.h6
-rw-r--r--sword1/control.cpp12
-rw-r--r--sword1/music.cpp4
-rw-r--r--sword1/screen.cpp14
-rw-r--r--sword2/driver/animation.cpp18
-rw-r--r--sword2/driver/animation.h6
-rw-r--r--sword2/driver/d_sound.cpp4
-rw-r--r--sword2/driver/palette.cpp8
-rw-r--r--sword2/driver/rdwin.cpp2
57 files changed, 401 insertions, 392 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);
diff --git a/base/main.cpp b/base/main.cpp
index a8356fddae..ab131efbe4 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -211,7 +211,7 @@ static int launcherDialog(GameDetector &detector, OSystem *system) {
255, 255, 255, 0,
};
- system->set_palette(dummy_palette, 0, 16);
+ system->setPalette(dummy_palette, 0, 16);
#ifndef _WIN32_WCE
GUI::LauncherDialog dlg(detector);
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);
}
diff --git a/gui/ScrollBarWidget.cpp b/gui/ScrollBarWidget.cpp
index 6e77087959..cf86aac0ed 100644
--- a/gui/ScrollBarWidget.cpp
+++ b/gui/ScrollBarWidget.cpp
@@ -241,7 +241,7 @@ void ScrollBarWidget::drawWidget(bool hilite) {
(hilite && _part == kSliderPart) ? gui->_textcolorhi : gui->_textcolor);
gui->frameRect(_x, _y + _sliderPos, _w, _sliderHeight, gui->_color);
int y = _y + _sliderPos + _sliderHeight / 2;
- NewGuiColor color = (hilite && _part == kSliderPart) ? gui->_color : gui->_shadowcolor;
+ OverlayColor color = (hilite && _part == kSliderPart) ? gui->_color : gui->_shadowcolor;
gui->hLine(_x + 2, y - 2, _x + _w - 3, color);
gui->hLine(_x + 2, y, _x + _w - 3, color);
gui->hLine(_x + 2, y + 2, _x + _w-3, color);
diff --git a/gui/TabWidget.cpp b/gui/TabWidget.cpp
index c914515adf..c15e2d1a60 100644
--- a/gui/TabWidget.cpp
+++ b/gui/TabWidget.cpp
@@ -127,7 +127,7 @@ void TabWidget::drawWidget(bool hilite) {
// Iterate over all tabs and draw them
int i, x = _x + kTabLeftOffset;
for (i = 0; i < (int)_tabs.size(); ++i) {
- NewGuiColor color = (i == _activeTab) ? gui->_color : gui->_shadowcolor;
+ OverlayColor color = (i == _activeTab) ? gui->_color : gui->_shadowcolor;
int yOffset = (i == _activeTab) ? 0 : 2;
gui->box(x, _y + yOffset, _tabWidth, kTabHeight - yOffset, color, color);
gui->drawString(_tabs[i].title, x + kTabPadding, _y + yOffset / 2 + (kTabHeight - kLineHeight - 1), _tabWidth - 2 * kTabPadding, gui->_textcolor, kTextAlignCenter);
diff --git a/gui/newgui.cpp b/gui/newgui.cpp
index df8c16a2d3..37ebdc9b4b 100644
--- a/gui/newgui.cpp
+++ b/gui/newgui.cpp
@@ -146,7 +146,7 @@ void NewGui::runLoop() {
}
animateCursor();
- _system->update_screen();
+ _system->updateScreen();
OSystem::Event event;
uint32 time = _system->get_msecs();
@@ -239,7 +239,7 @@ void NewGui::saveState() {
// whatever is visible on the screen rught now.
int sys_height = _system->get_overlay_height();
int sys_width = _system->get_overlay_width();
- _screen = (NewGuiColor*)calloc(sys_width * sys_height, sizeof(NewGuiColor));
+ _screen = (OverlayColor*)calloc(sys_width * sys_height, sizeof(OverlayColor));
_screenPitch = sys_width;
_system->grab_overlay(_screen, _screenPitch);
@@ -260,7 +260,7 @@ void NewGui::restoreState() {
_screen = 0;
}
- _system->update_screen();
+ _system->updateScreen();
_stateIsSaved = false;
}
@@ -282,11 +282,11 @@ void NewGui::closeTopDialog() {
#pragma mark -
-NewGuiColor *NewGui::getBasePtr(int x, int y) {
+OverlayColor *NewGui::getBasePtr(int x, int y) {
return _screen + x + y * _screenPitch;
}
-void NewGui::box(int x, int y, int width, int height, NewGuiColor colorA, NewGuiColor colorB) {
+void NewGui::box(int x, int y, int width, int height, OverlayColor colorA, OverlayColor colorB) {
hLine(x + 1, y, x + width - 2, colorA);
hLine(x, y + 1, x + width - 1, colorA);
vLine(x, y + 1, y + height - 2, colorA);
@@ -298,8 +298,8 @@ void NewGui::box(int x, int y, int width, int height, NewGuiColor colorA, NewGui
vLine(x + width - 2, y + 1, y + height - 1, colorB);
}
-void NewGui::line(int x, int y, int x2, int y2, NewGuiColor color) {
- NewGuiColor *ptr;
+void NewGui::line(int x, int y, int x2, int y2, OverlayColor color) {
+ OverlayColor *ptr;
if (x2 < x)
SWAP(x2, x);
@@ -323,7 +323,7 @@ void NewGui::line(int x, int y, int x2, int y2, NewGuiColor color) {
}
}
-void NewGui::blendRect(int x, int y, int w, int h, NewGuiColor color, int level) {
+void NewGui::blendRect(int x, int y, int w, int h, OverlayColor color, int level) {
#ifdef NEWGUI_256
fillRect(x, y, w, h, color);
#else
@@ -334,7 +334,7 @@ void NewGui::blendRect(int x, int y, int w, int h, NewGuiColor color, int level)
g = ag * level;
b = ab * level;
- NewGuiColor *ptr = getBasePtr(x, y);
+ OverlayColor *ptr = getBasePtr(x, y);
while (h--) {
for (int i = 0; i < w; i++) {
@@ -348,9 +348,9 @@ void NewGui::blendRect(int x, int y, int w, int h, NewGuiColor color, int level)
#endif
}
-void NewGui::fillRect(int x, int y, int w, int h, NewGuiColor color) {
+void NewGui::fillRect(int x, int y, int w, int h, OverlayColor color) {
int i;
- NewGuiColor *ptr = getBasePtr(x, y);
+ OverlayColor *ptr = getBasePtr(x, y);
while (h--) {
for (i = 0; i < w; i++) {
@@ -360,9 +360,9 @@ void NewGui::fillRect(int x, int y, int w, int h, NewGuiColor color) {
}
}
-void NewGui::checkerRect(int x, int y, int w, int h, NewGuiColor color) {
+void NewGui::checkerRect(int x, int y, int w, int h, OverlayColor color) {
int i;
- NewGuiColor *ptr = getBasePtr(x, y);
+ OverlayColor *ptr = getBasePtr(x, y);
while (h--) {
for (i = 0; i < w; i++) {
@@ -373,9 +373,9 @@ void NewGui::checkerRect(int x, int y, int w, int h, NewGuiColor color) {
}
}
-void NewGui::frameRect(int x, int y, int w, int h, NewGuiColor color) {
+void NewGui::frameRect(int x, int y, int w, int h, OverlayColor color) {
int i;
- NewGuiColor *ptr, *basePtr = getBasePtr(x, y);
+ OverlayColor *ptr, *basePtr = getBasePtr(x, y);
if (basePtr == NULL)
return;
@@ -397,12 +397,12 @@ void NewGui::addDirtyRect(int x, int y, int w, int h) {
// For now we don't keep yet another list of dirty rects but simply
// blit the affected area directly to the overlay. At least for our current
// GUI/widget/dialog code that is just fine.
- NewGuiColor *buf = getBasePtr(x, y);
+ OverlayColor *buf = getBasePtr(x, y);
_system->copy_rect_overlay(buf, _screenPitch, x, y, w, h);
}
-void NewGui::drawChar(byte chr, int xx, int yy, NewGuiColor color) {
- NewGuiColor *ptr = getBasePtr(xx, yy);
+void NewGui::drawChar(byte chr, int xx, int yy, OverlayColor color) {
+ OverlayColor *ptr = getBasePtr(xx, yy);
uint x, y;
#ifdef NEW_FONT_CODE
@@ -480,7 +480,7 @@ int NewGui::getCharWidth(byte c) {
#endif
}
-void NewGui::drawString(const String &s, int x, int y, int w, NewGuiColor color, int align, int deltax, bool useEllipsis) {
+void NewGui::drawString(const String &s, int x, int y, int w, OverlayColor color, int align, int deltax, bool useEllipsis) {
const int leftX = x, rightX = x + w;
uint i;
int width = getStringWidth(s);
@@ -553,7 +553,7 @@ void NewGui::drawString(const String &s, int x, int y, int w, NewGuiColor color,
// Blit from a buffer to the display
//
void NewGui::blitFromBuffer(int x, int y, int w, int h, const byte *buf, int pitch) {
- NewGuiColor *ptr = getBasePtr(x, y);
+ OverlayColor *ptr = getBasePtr(x, y);
assert(buf);
while (h--) {
@@ -567,7 +567,7 @@ void NewGui::blitFromBuffer(int x, int y, int w, int h, const byte *buf, int pit
// Blit from the display to a buffer
//
void NewGui::blitToBuffer(int x, int y, int w, int h, byte *buf, int pitch) {
- NewGuiColor *ptr = getBasePtr(x, y);
+ OverlayColor *ptr = getBasePtr(x, y);
assert(buf);
while (h--) {
@@ -580,8 +580,8 @@ void NewGui::blitToBuffer(int x, int y, int w, int h, byte *buf, int pitch) {
//
// Draw an 8x8 bitmap at location (x,y)
//
-void NewGui::drawBitmap(uint32 *bitmap, int x, int y, NewGuiColor color, int h) {
- NewGuiColor *ptr = getBasePtr(x, y);
+void NewGui::drawBitmap(uint32 *bitmap, int x, int y, OverlayColor color, int h) {
+ OverlayColor *ptr = getBasePtr(x, y);
for (y = 0; y < h; y++) {
uint32 mask = 0xF0000000;
diff --git a/gui/newgui.h b/gui/newgui.h
index 419e31aec3..1866845fa5 100644
--- a/gui/newgui.h
+++ b/gui/newgui.h
@@ -92,7 +92,7 @@ public:
protected:
OSystem *_system;
- NewGuiColor *_screen;
+ OverlayColor *_screen;
int _screenPitch;
bool _needRedraw;
@@ -134,28 +134,28 @@ protected:
public:
// Theme colors
- NewGuiColor _color, _shadowcolor;
- NewGuiColor _bgcolor;
- NewGuiColor _textcolor;
- NewGuiColor _textcolorhi;
+ OverlayColor _color, _shadowcolor;
+ OverlayColor _bgcolor;
+ OverlayColor _textcolor;
+ OverlayColor _textcolorhi;
// Drawing primitives
- NewGuiColor *getBasePtr(int x, int y);
- void box(int x, int y, int width, int height, NewGuiColor colorA, NewGuiColor colorB);
- void line(int x, int y, int x2, int y2, NewGuiColor color);
- void blendRect(int x, int y, int w, int h, NewGuiColor color, int level = 3);
- void fillRect(int x, int y, int w, int h, NewGuiColor color);
- void checkerRect(int x, int y, int w, int h, NewGuiColor color);
- void frameRect(int x, int y, int w, int h, NewGuiColor color);
- void drawChar(byte c, int x, int y, NewGuiColor color);
+ OverlayColor *getBasePtr(int x, int y);
+ void box(int x, int y, int width, int height, OverlayColor colorA, OverlayColor colorB);
+ void line(int x, int y, int x2, int y2, OverlayColor color);
+ void blendRect(int x, int y, int w, int h, OverlayColor color, int level = 3);
+ void fillRect(int x, int y, int w, int h, OverlayColor color);
+ void checkerRect(int x, int y, int w, int h, OverlayColor color);
+ void frameRect(int x, int y, int w, int h, OverlayColor color);
+ void drawChar(byte c, int x, int y, OverlayColor color);
int getStringWidth(const String &str);
int getCharWidth(byte c);
- void drawString(const String &str, int x, int y, int w, NewGuiColor color, int align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true);
+ void drawString(const String &str, int x, int y, int w, OverlayColor color, int align = kTextAlignLeft, int deltax = 0, bool useEllipsis = true);
void blitFromBuffer(int x, int y, int w, int h, const byte *buf, int pitch);
void blitToBuffer(int x, int y, int w, int h, byte *buf, int pitch);
- void drawBitmap(uint32 *bitmap, int x, int y, NewGuiColor color, int h = 8);
+ void drawBitmap(uint32 *bitmap, int x, int y, OverlayColor color, int h = 8);
void addDirtyRect(int x, int y, int w, int h);
};
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 6c7f2f91f6..3285ac14af 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -57,8 +57,8 @@ void Widget::draw() {
// Draw border
if (_flags & WIDGET_BORDER) {
- NewGuiColor colorA = gui->_color;
- NewGuiColor colorB = gui->_shadowcolor;
+ OverlayColor colorA = gui->_color;
+ OverlayColor colorB = gui->_shadowcolor;
if ((_flags & WIDGET_INV_BORDER) == WIDGET_INV_BORDER)
SWAP(colorA, colorB);
gui->box(_x, _y, _w, _h, colorA, colorB);
diff --git a/queen/display.cpp b/queen/display.cpp
index 3795c2f998..b002573d8d 100644
--- a/queen/display.cpp
+++ b/queen/display.cpp
@@ -156,9 +156,9 @@ void Display::palSet(const uint8 *pal, int start, int end, bool updateScreen) {
debug(9, "Display::palSet(%d, %d)", start, end);
uint8 tempPal[256 * 4];
palConvert(tempPal, pal, start, end);
- _system->set_palette(tempPal + start * 4, start, end - start + 1);
+ _system->setPalette(tempPal + start * 4, start, end - start + 1);
if (updateScreen) {
- _system->update_screen();
+ _system->updateScreen();
_vm->input()->delay(20);
}
}
@@ -617,7 +617,7 @@ void Display::update(bool dynalum, int16 dynaX, int16 dynaY) {
}
debug(7, "Display::update() - Dirtyblocks blit (%d)", count);
}
- _system->update_screen();
+ _system->updateScreen();
}
void Display::setupPanel() {
@@ -958,7 +958,7 @@ void Display::blankScreenEffect1() {
++y;
}
_system->copy_rect(buf, 32, x, y, 32, 32);
- _system->update_screen();
+ _system->updateScreen();
_vm->input()->delay(10);
}
}
@@ -991,7 +991,7 @@ void Display::blankScreenEffect2() {
p += SCREEN_W;
}
_system->copy_rect(buf, SCREEN_W, x, y, 2, 2);
- _system->update_screen();
+ _system->updateScreen();
_vm->input()->delay(10);
}
}
@@ -1020,7 +1020,7 @@ void Display::blankScreenEffect3() {
++i;
_system->copy_rect(buf, SCREEN_W, x, y, 2, 2);
}
- _system->update_screen();
+ _system->updateScreen();
_vm->input()->delay(10);
}
}
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp
index fb2e567c0d..3966683602 100644
--- a/scumm/debugger.cpp
+++ b/scumm/debugger.cpp
@@ -786,7 +786,7 @@ void ScummDebugger::drawBox(int box) {
if (vs != NULL)
_vm->markRectAsDirty(vs->number, 0, vs->width, 0, vs->height);
_vm->drawDirtyScreenParts();
- _vm->_system->update_screen();
+ _vm->_system->updateScreen();
}
bool ScummDebugger::Cmd_PrintDraft(int argc, const char **argv) {
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 2bdbbb7b86..8d4295e9e2 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -2446,7 +2446,7 @@ void ScummEngine::transitionEffect(int a) {
// Draw the current state to the screen and wait half a sec so the user
// can watch the effect taking place.
- _system->update_screen();
+ _system->updateScreen();
waitForTimer(30);
}
}
@@ -2552,7 +2552,7 @@ void ScummEngine::dissolveEffect(int width, int height) {
if (++blits >= blits_before_refresh) {
blits = 0;
- _system->update_screen();
+ _system->updateScreen();
waitForTimer(30);
}
}
@@ -2560,7 +2560,7 @@ void ScummEngine::dissolveEffect(int width, int height) {
free(offsets);
if (blits != 0) {
- _system->update_screen();
+ _system->updateScreen();
waitForTimer(30);
}
}
@@ -2588,7 +2588,7 @@ void ScummEngine::scrollEffect(int dir) {
vs->width,
0, vs->height - step,
vs->width, step);
- _system->update_screen();
+ _system->updateScreen();
waitForTimer(kPictureDelay);
y += step;
@@ -2603,7 +2603,7 @@ void ScummEngine::scrollEffect(int dir) {
vs->width,
0, 0,
vs->width, step);
- _system->update_screen();
+ _system->updateScreen();
waitForTimer(kPictureDelay);
y += step;
@@ -2618,7 +2618,7 @@ void ScummEngine::scrollEffect(int dir) {
vs->width,
vs->width - step, 0,
step, vs->height);
- _system->update_screen();
+ _system->updateScreen();
waitForTimer(kPictureDelay);
x += step;
@@ -2633,7 +2633,7 @@ void ScummEngine::scrollEffect(int dir) {
vs->width,
0, 0,
step, vs->height);
- _system->update_screen();
+ _system->updateScreen();
waitForTimer(kPictureDelay);
x += step;
diff --git a/scumm/imuse.cpp b/scumm/imuse.cpp
index e26078f55f..69a2f127f2 100644
--- a/scumm/imuse.cpp
+++ b/scumm/imuse.cpp
@@ -1760,10 +1760,10 @@ void IMuseInternal::copyGlobalAdlibInstrument(byte slot, Instrument *dest) {
//
////////////////////////////////////////////////////////////
-IMuse::IMuse(OSystem *system, IMuseInternal *target) : _system(system), _target(target) { _mutex = system->create_mutex(); }
-IMuse::~IMuse() { if (_mutex) _system->delete_mutex(_mutex); if (_target) delete _target; }
-inline void IMuse::in() const { _system->lock_mutex(_mutex); }
-inline void IMuse::out() const { _system->unlock_mutex(_mutex); }
+IMuse::IMuse(OSystem *system, IMuseInternal *target) : _system(system), _target(target) { _mutex = system->createMutex(); }
+IMuse::~IMuse() { if (_mutex) _system->deleteMutex(_mutex); if (_target) delete _target; }
+inline void IMuse::in() const { _system->lockMutex(_mutex); }
+inline void IMuse::out() const { _system->unlockMutex(_mutex); }
void IMuse::on_timer(MidiDriver *midi) { in(); _target->on_timer(midi); out(); }
void IMuse::pause(bool paused) { in(); _target->pause(paused); out(); }
diff --git a/scumm/imuse_digi/dimuse.cpp b/scumm/imuse_digi/dimuse.cpp
index 95ed94c433..5cdab989c6 100644
--- a/scumm/imuse_digi/dimuse.cpp
+++ b/scumm/imuse_digi/dimuse.cpp
@@ -43,7 +43,7 @@ void IMuseDigital::timer_handler(void *refCon) {
IMuseDigital::IMuseDigital(ScummEngine *scumm)
: _vm(scumm) {
- _mutex = g_system->create_mutex();
+ _mutex = g_system->createMutex();
_pause = false;
_sound = new ImuseDigiSndMgr(_vm);
_vm->_timer->installTimerProc(timer_handler, 1000000 / 25, this);
@@ -61,7 +61,7 @@ IMuseDigital::~IMuseDigital() {
stopAllSounds(true);
_vm->_timer->removeTimerProc(timer_handler);
delete _sound;
- g_system->delete_mutex(_mutex);
+ g_system->deleteMutex(_mutex);
}
void IMuseDigital::callback() {
diff --git a/scumm/palette.cpp b/scumm/palette.cpp
index 2c4236f1ec..07f4da1170 100644
--- a/scumm/palette.cpp
+++ b/scumm/palette.cpp
@@ -911,7 +911,7 @@ void ScummEngine::updatePalette() {
}
}
- _system->set_palette(palette_colors, first, num);
+ _system->setPalette(palette_colors, first, num);
_palDirtyMax = -1;
_palDirtyMin = 256;
diff --git a/scumm/player_v2.cpp b/scumm/player_v2.cpp
index 53d9b88cee..4099a33383 100644
--- a/scumm/player_v2.cpp
+++ b/scumm/player_v2.cpp
@@ -349,7 +349,7 @@ Player_V2::Player_V2(ScummEngine *scumm, bool pcjr) {
_system = scumm->_system;
_mixer = scumm->_mixer;
_sample_rate = _system->getOutputSampleRate();
- _mutex = _system->create_mutex();
+ _mutex = _system->createMutex();
_header_len = (scumm->_features & GF_OLD_BUNDLE) ? 4 : 6;
@@ -384,7 +384,7 @@ Player_V2::~Player_V2() {
// Detach the premix callback handler
_mixer->setupPremix(0, 0);
mutex_down();
- _system->delete_mutex (_mutex);
+ _system->deleteMutex (_mutex);
}
void Player_V2::set_pcjr(bool pcjr) {
diff --git a/scumm/player_v2.h b/scumm/player_v2.h
index 98cf424c52..cb5e72dcc2 100644
--- a/scumm/player_v2.h
+++ b/scumm/player_v2.h
@@ -127,8 +127,8 @@ private:
ChannelInfo _channels[5];
protected:
- void mutex_up() { _system->lock_mutex (_mutex); }
- void mutex_down() { _system->unlock_mutex (_mutex); }
+ void mutex_up() { _system->lockMutex (_mutex); }
+ void mutex_down() { _system->unlockMutex (_mutex); }
virtual void nextTick();
virtual void clear_channel(int i);
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index 721004b1f9..4eeba5780b 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -1223,7 +1223,7 @@ void ScummEngine::mainRun() {
while (!_quit) {
updatePalette();
- _system->update_screen();
+ _system->updateScreen();
diff -= _system->get_msecs();
waitForTimer(delta * 15 + diff);
diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp
index a0dd10433d..56c8dc43a5 100644
--- a/scumm/smush/smush_player.cpp
+++ b/scumm/smush/smush_player.cpp
@@ -902,7 +902,7 @@ void SmushPlayer::setPalette(const byte *palette) {
*p++ = 0;
}
- _vm->_system->set_palette(palette_colors, 0, 256);
+ _vm->_system->setPalette(palette_colors, 0, 256);
}
void SmushPlayer::setPaletteValue(int n, byte r, byte g, byte b) {
@@ -910,7 +910,7 @@ void SmushPlayer::setPaletteValue(int n, byte r, byte g, byte b) {
_pal[n * 3 + 1] = g;
_pal[n * 3 + 2] = b;
- _vm->_system->set_palette(_pal, n, 1);
+ _vm->_system->setPalette(_pal, n, 1);
}
void SmushPlayer::updateScreen() {
@@ -1046,7 +1046,7 @@ void SmushPlayer::play(const char *filename, const char *directory, int32 offset
uint32 end_time, start_time;
start_time = _vm->_system->get_msecs();
- _vm->_system->update_screen();
+ _vm->_system->updateScreen();
_updateNeeded = false;
if (_insanity)
diff --git a/simon/midi.cpp b/simon/midi.cpp
index b658bd1f54..a9d04d411d 100644
--- a/simon/midi.cpp
+++ b/simon/midi.cpp
@@ -56,7 +56,7 @@ MidiPlayer::MidiPlayer(OSystem *system) {
// this is where we'll initialize stuff that must persist
// between songs.
_system = system;
- _mutex = system->create_mutex();
+ _mutex = system->createMutex();
_driver = 0;
_map_mt32_to_gm = false;
@@ -74,10 +74,10 @@ MidiPlayer::MidiPlayer(OSystem *system) {
}
MidiPlayer::~MidiPlayer() {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
close();
- _system->unlock_mutex(_mutex);
- _system->delete_mutex(_mutex);
+ _system->unlockMutex(_mutex);
+ _system->deleteMutex(_mutex);
}
int MidiPlayer::open() {
@@ -94,12 +94,12 @@ int MidiPlayer::open() {
void MidiPlayer::close() {
stop();
-// _system->lock_mutex (_mutex);
+// _system->lockMutex (_mutex);
if (_driver)
_driver->close();
_driver = NULL;
clearConstructs();
-// _system->unlock_mutex (_mutex);
+// _system->unlockMutex (_mutex);
}
void MidiPlayer::send(uint32 b) {
@@ -150,9 +150,9 @@ void MidiPlayer::metaEvent (byte type, byte *data, uint16 length) {
// Have to unlock it before calling jump()
// (which locks it itself), and then relock it
// upon returning.
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
startTrack (destination);
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
} else {
stop();
}
@@ -160,7 +160,7 @@ void MidiPlayer::metaEvent (byte type, byte *data, uint16 length) {
void MidiPlayer::onTimer (void *data) {
MidiPlayer *p = (MidiPlayer *) data;
- p->_system->lock_mutex(p->_mutex);
+ p->_system->lockMutex(p->_mutex);
if (!p->_paused) {
if (p->_music.parser && p->_currentTrack != 255) {
p->_current = &p->_music;
@@ -172,7 +172,7 @@ void MidiPlayer::onTimer (void *data) {
p->_sfx.parser->onTimer();
}
p->_current = 0;
- p->_system->unlock_mutex(p->_mutex);
+ p->_system->unlockMutex(p->_mutex);
}
void MidiPlayer::startTrack (int track) {
@@ -183,7 +183,7 @@ void MidiPlayer::startTrack (int track) {
if (track >= _music.num_songs)
return;
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
if (_music.parser) {
_current = &_music;
@@ -205,9 +205,9 @@ void MidiPlayer::startTrack (int track) {
_currentTrack = (byte) track;
_music.parser = parser; // That plugs the power cord into the wall
} else if (_music.parser) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
if (!_music.parser->setTrack(track)) {
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
return;
}
_currentTrack = (byte) track;
@@ -216,18 +216,18 @@ void MidiPlayer::startTrack (int track) {
_current = 0;
}
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::stop() {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
if (_music.parser) {
_current = &_music;
_music.parser->jumpToTick(0);
}
_current = 0;
_currentTrack = 255;
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::pause (bool b) {
@@ -235,14 +235,14 @@ void MidiPlayer::pause (bool b) {
return;
_paused = b;
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
for (int i = 0; i < 16; ++i) {
if (_music.channel[i])
_music.channel[i]->volume (_paused ? 0 : (_music.volume[i] * _masterVolume / 255));
if (_sfx.channel[i])
_sfx.channel[i]->volume (_paused ? 0 : (_sfx.volume[i] * _masterVolume / 255));
}
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::set_volume (int volume) {
@@ -256,7 +256,7 @@ void MidiPlayer::set_volume (int volume) {
_masterVolume = volume;
// Now tell all the channels this.
- _system->lock_mutex (_mutex);
+ _system->lockMutex (_mutex);
if (_driver && !_paused) {
for (int i = 0; i < 16; ++i) {
if (_music.channel[i])
@@ -265,7 +265,7 @@ void MidiPlayer::set_volume (int volume) {
_sfx.channel[i]->volume(_sfx.volume[i] * _masterVolume / 255);
}
}
- _system->unlock_mutex (_mutex);
+ _system->unlockMutex (_mutex);
}
void MidiPlayer::set_driver(MidiDriver *md) {
@@ -276,27 +276,27 @@ void MidiPlayer::set_driver(MidiDriver *md) {
}
void MidiPlayer::mapMT32toGM (bool map) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
_map_mt32_to_gm = map;
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::setLoop (bool loop) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
_loopTrack = loop;
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::queueTrack (int track, bool loop) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
if (_currentTrack == 255) {
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
setLoop(loop);
startTrack(track);
} else {
_queuedTrack = track;
_loopQueuedTrack = loop;
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
}
@@ -351,7 +351,7 @@ static int simon1_gmf_size[] = {
};
void MidiPlayer::loadSMF (File *in, int song, bool sfx) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
MusicInfo *p = sfx ? &_sfx : &_music;
clearConstructs (*p);
@@ -418,7 +418,7 @@ void MidiPlayer::loadSMF (File *in, int song, bool sfx) {
resetVolumeTable();
}
p->parser = parser; // That plugs the power cord into the wall
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::loadMultipleSMF (File *in, bool sfx) {
@@ -431,14 +431,14 @@ void MidiPlayer::loadMultipleSMF (File *in, bool sfx) {
// We need to load ALL the songs and then
// treat them as separate tracks -- for the
// purpose of jumps, anyway.
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
MusicInfo *p = sfx ? &_sfx : &_music;
clearConstructs(*p);
p->num_songs = in->readByte();
if (p->num_songs > 16) {
printf ("playMultipleSMF: %d is too many songs to keep track of!\n", (int) p->num_songs);
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
return;
}
@@ -451,7 +451,7 @@ void MidiPlayer::loadMultipleSMF (File *in, bool sfx) {
in->read(buf, 4);
if (memcmp (buf, "MThd", 4)) {
printf ("Expected MThd but found '%c%c%c%c' instead!\n", buf[0], buf[1], buf[2], buf[3]);
- _system->unlock_mutex (_mutex);
+ _system->unlockMutex (_mutex);
return;
}
in->seek(in->readUint32BE() + in->pos(), SEEK_SET);
@@ -476,11 +476,11 @@ void MidiPlayer::loadMultipleSMF (File *in, bool sfx) {
_currentTrack = 255;
resetVolumeTable();
}
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::loadXMIDI(File *in, bool sfx) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
MusicInfo *p = sfx ? &_sfx : &_music;
clearConstructs(*p);
@@ -499,7 +499,7 @@ void MidiPlayer::loadXMIDI(File *in, bool sfx) {
}
if (memcmp(buf, "CAT ", 4)) {
warning("Could not find 'CAT ' tag to determine resource size!");
- _system->unlock_mutex (_mutex);
+ _system->unlockMutex (_mutex);
return;
}
size += 4 + in->readUint32BE();
@@ -508,7 +508,7 @@ void MidiPlayer::loadXMIDI(File *in, bool sfx) {
in->read(p->data, size);
} else {
warning("Expected 'FORM' tag but found '%c%c%c%c' instead!", buf[0], buf[1], buf[2], buf[3]);
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
return;
}
@@ -526,18 +526,18 @@ void MidiPlayer::loadXMIDI(File *in, bool sfx) {
resetVolumeTable();
}
p->parser = parser; // That plugs the power cord into the wall
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
void MidiPlayer::loadS1D (File *in, bool sfx) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
MusicInfo *p = sfx ? &_sfx : &_music;
clearConstructs(*p);
uint16 size = in->readUint16LE();
if (size != in->size() - 2) {
warning("Size mismatch in simon1demo MUS file (%ld versus reported %d)", (long) in->size() - 2, (int) size);
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
return;
}
@@ -558,7 +558,7 @@ void MidiPlayer::loadS1D (File *in, bool sfx) {
resetVolumeTable();
}
p->parser = parser; // That plugs the power cord into the wall
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
} // End of namespace Simon
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 364ef19043..982e9ae8ff 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -2477,9 +2477,9 @@ void SimonEngine::o_fade_to_black() {
palette_fadeout((uint32 *)_video_buf_1 + 32 + 16, 144);
palette_fadeout((uint32 *)_video_buf_1 + 32 + 16 + 144 + 16, 48);
- _system->set_palette(_video_buf_1, 0, 256);
+ _system->setPalette(_video_buf_1, 0, 256);
if (_fade)
- _system->update_screen();
+ _system->updateScreen();
delay(5);
} while (--i);
@@ -4666,12 +4666,12 @@ void SimonEngine::dx_update_screen_and_palette() {
_video_var_9 = 0;
if (memcmp(_palette, _palette_backup, 256 * 4) != 0) {
memcpy(_palette_backup, _palette, 256 * 4);
- _system->set_palette(_palette, 0, 256);
+ _system->setPalette(_palette, 0, 256);
}
}
_system->copy_rect(_sdl_buf_attached, 320, 0, 0, 320, 200);
- _system->update_screen();
+ _system->updateScreen();
memcpy(_sdl_buf_attached, _sdl_buf, 320 * 200);
@@ -4691,7 +4691,7 @@ void SimonEngine::realizePalette() {
if (_palette_color_count & 0x8000) {
fadeUpPalette();
} else {
- _system->set_palette(_palette, 0, _palette_color_count);
+ _system->setPalette(_palette, 0, _palette_color_count);
}
_palette_color_count = 0;
@@ -4750,7 +4750,7 @@ void SimonEngine::fadeUpPalette() {
src += 4;
}
- _system->set_palette(_video_buf_1, 0, _video_num_pal_colors);
+ _system->setPalette(_video_buf_1, 0, _video_num_pal_colors);
delay(5);
} while (!done);
}
diff --git a/simon/vga.cpp b/simon/vga.cpp
index 43468373d1..b1a1bece94 100644
--- a/simon/vga.cpp
+++ b/simon/vga.cpp
@@ -1727,9 +1727,9 @@ void SimonEngine::vc_62_palette_thing() {
memcpy(_video_buf_1, _palette_backup, _video_num_pal_colors * sizeof(uint32));
for (i = NUM_PALETTE_FADEOUT; i != 0; --i) {
palette_fadeout((uint32 *)_video_buf_1, _video_num_pal_colors);
- _system->set_palette(_video_buf_1, 0, _video_num_pal_colors);
+ _system->setPalette(_video_buf_1, 0, _video_num_pal_colors);
if (_fade)
- _system->update_screen();
+ _system->updateScreen();
delay(5);
}
diff --git a/sky/control.cpp b/sky/control.cpp
index 61def9a1ce..afd4c96162 100644
--- a/sky/control.cpp
+++ b/sky/control.cpp
@@ -378,13 +378,13 @@ void Control::animClick(ConResource *pButton) {
_text->flushForRedraw();
pButton->drawToScreen(NO_MASK);
_text->drawToScreen(WITH_MASK);
- _system->update_screen();
+ _system->updateScreen();
delay(150);
pButton->_curSprite--;
_text->flushForRedraw();
pButton->drawToScreen(NO_MASK);
_text->drawToScreen(WITH_MASK);
- _system->update_screen();
+ _system->updateScreen();
}
}
@@ -431,7 +431,7 @@ void Control::doLoadSavePanel(void) {
memset(_screenBuf, 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
_system->copy_rect(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
- _system->update_screen();
+ _system->updateScreen();
_skyScreen->forceRefresh();
_skyScreen->setPaletteEndian((uint8 *)SkyEngine::fetchCompact(SkyEngine::_systemVars.currentPalette));
removePanel();
@@ -468,7 +468,7 @@ void Control::doControlPanel(void) {
while (!quitPanel) {
_text->drawToScreen(WITH_MASK);
- _system->update_screen();
+ _system->updateScreen();
_mouseClicked = false;
delay(50);
if (_keyPressed == 27) { // escape pressed
@@ -497,7 +497,7 @@ void Control::doControlPanel(void) {
}
memset(_screenBuf, 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
_system->copy_rect(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
- _system->update_screen();
+ _system->updateScreen();
_skyScreen->forceRefresh();
_skyScreen->setPaletteEndian((uint8 *)SkyEngine::fetchCompact(SkyEngine::_systemVars.currentPalette));
removePanel();
@@ -609,7 +609,7 @@ bool Control::getYesNo(char *text) {
mouseType = wantMouse;
_skyMouse->spriteMouse(mouseType, 0, 0);
}
- _system->update_screen();
+ _system->updateScreen();
delay(50);
if ((_mouseY >= 83) && (_mouseY <= 110)) {
if ((_mouseX >= 77) && (_mouseX <= 114)) { // over 'yes'
@@ -657,7 +657,7 @@ uint16 Control::doMusicSlide(void) {
}
buttonControl(_slide2);
_text->drawToScreen(WITH_MASK);
- _system->update_screen();
+ _system->updateScreen();
}
return 0;
}
@@ -685,7 +685,7 @@ uint16 Control::doSpeedSlide(void) {
}
buttonControl(_slide);
_text->drawToScreen(WITH_MASK);
- _system->update_screen();
+ _system->updateScreen();
}
SkyEngine::_systemVars.gameSpeed = speedDelay;
return SPEED_CHANGED;
@@ -705,7 +705,7 @@ uint16 Control::toggleFx(ConResource *pButton) {
}
pButton->drawToScreen(WITH_MASK);
buttonControl(pButton);
- _system->update_screen();
+ _system->updateScreen();
return TOGGLED;
}
@@ -729,7 +729,7 @@ uint16 Control::toggleText(void) {
drawTextCross(flags);
- _system->update_screen();
+ _system->updateScreen();
return TOGGLED;
}
@@ -848,7 +848,7 @@ uint16 Control::saveRestorePanel(bool allowSave) {
}
_text->drawToScreen(WITH_MASK);
- _system->update_screen();
+ _system->updateScreen();
_mouseClicked = false;
delay(50);
if (_keyPressed == 27) { // escape pressed
@@ -1547,7 +1547,7 @@ uint16 Control::quickXRestore(uint16 slot) {
_skyText->fnSetFont(0);
_system->copy_rect(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, FULL_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
- _system->update_screen();
+ _system->updateScreen();
if (SkyEngine::_systemVars.gameVersion < 331)
_skyScreen->setPalette(60509);
@@ -1571,7 +1571,7 @@ uint16 Control::quickXRestore(uint16 slot) {
} else {
memset(_screenBuf, 0, FULL_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
_system->copy_rect(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT);
- _system->update_screen();
+ _system->updateScreen();
_skyScreen->showScreen(_skyScreen->giveCurrent());
_skyScreen->setPalette(60111);
}
diff --git a/sky/intro.cpp b/sky/intro.cpp
index 267348360b..75b37c639c 100644
--- a/sky/intro.cpp
+++ b/sky/intro.cpp
@@ -793,7 +793,7 @@ bool Intro::floppyScrollFlirt(void) {
} while (nrToDo == 255);
}
_system->copy_rect(scrollPos, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT);
- _system->update_screen();
+ _system->updateScreen();
if (!escDelay(40))
doContinue = false;
}
diff --git a/sky/music/musicbase.cpp b/sky/music/musicbase.cpp
index 636a97bf64..da94653e88 100644
--- a/sky/music/musicbase.cpp
+++ b/sky/music/musicbase.cpp
@@ -34,7 +34,7 @@ MusicBase::MusicBase(Disk *pDisk, OSystem *system) {
_musicVolume = 127;
_system = system;
_numberOfChannels = _currentMusic = 0;
- _mutex = _system->create_mutex();
+ _mutex = _system->createMutex();
}
MusicBase::~MusicBase(void) {
@@ -45,7 +45,7 @@ MusicBase::~MusicBase(void) {
void MusicBase::loadSection(uint8 pSection) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
if (_currentMusic)
stopMusic();
if (_musicData)
@@ -62,7 +62,7 @@ void MusicBase::loadSection(uint8 pSection) {
_numberOfChannels = _currentMusic = 0;
setupPointers();
startDriver();
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
}
bool MusicBase::musicIsPlaying(void) {
@@ -165,7 +165,7 @@ void MusicBase::loadNewMusic(void) {
void MusicBase::pollMusic(void) {
- _system->lock_mutex(_mutex);
+ _system->lockMutex(_mutex);
uint8 newTempo;
if (_onNextPoll.doReInit) startDriver();
if (_onNextPoll.doStopMusic) stopMusic();
@@ -181,7 +181,7 @@ void MusicBase::pollMusic(void) {
updateTempo();
}
}
- _system->unlock_mutex(_mutex);
+ _system->unlockMutex(_mutex);
_aktTime &= 0xFFFF;
}
diff --git a/sky/screen.cpp b/sky/screen.cpp
index b471bbed28..3a873dac0f 100644
--- a/sky/screen.cpp
+++ b/sky/screen.cpp
@@ -76,7 +76,7 @@ Screen::Screen(OSystem *pSystem, Disk *pDisk) {
}
//set the palette
- _system->set_palette(tmpPal, 0, VGA_COLOURS);
+ _system->setPalette(tmpPal, 0, VGA_COLOURS);
_currentPalette = 0;
_seqInfo.framesLeft = 0;
@@ -94,15 +94,15 @@ void Screen::clearScreen(void) {
memset(_currentScreen, 0, FULL_SCREEN_WIDTH * FULL_SCREEN_HEIGHT);
_system->copy_rect(_currentScreen, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT);
- _system->update_screen();
+ _system->updateScreen();
}
//set a new palette, pal is a pointer to dos vga rgb components 0..63
void Screen::setPalette(uint8 *pal) {
convertPalette(pal, _palette);
- _system->set_palette(_palette, 0, GAME_COLOURS);
- _system->update_screen();
+ _system->setPalette(_palette, 0, GAME_COLOURS);
+ _system->updateScreen();
}
void Screen::setPaletteEndian(uint8 *pal) {
@@ -115,8 +115,8 @@ void Screen::setPaletteEndian(uint8 *pal) {
#else
convertPalette(pal, _palette);
#endif
- _system->set_palette(_palette, 0, GAME_COLOURS);
- _system->update_screen();
+ _system->setPalette(_palette, 0, GAME_COLOURS);
+ _system->updateScreen();
}
void Screen::halvePalette(void) {
@@ -128,7 +128,7 @@ void Screen::halvePalette(void) {
halfPalette[(cnt << 2) | 2] = _palette[(cnt << 2) | 2] >> 1;
halfPalette[(cnt << 2) | 3] = 0;
}
- _system->set_palette(halfPalette, 0, GAME_COLOURS);
+ _system->setPalette(halfPalette, 0, GAME_COLOURS);
}
void Screen::setPalette(uint16 fileNum) {
@@ -152,7 +152,7 @@ void Screen::showScreen(uint16 fileNum) {
void Screen::showScreen(uint8 *pScreen) {
_system->copy_rect(pScreen, 320, 0, 0, GAME_SCREEN_WIDTH, GAME_SCREEN_HEIGHT);
- _system->update_screen();
+ _system->updateScreen();
}
void Screen::convertPalette(uint8 *inPal, uint8* outPal) { //convert 3 byte 0..63 rgb to 4byte 0..255 rgbx
@@ -221,7 +221,7 @@ void Screen::flip(bool doUpdate) {
}
}
if (doUpdate)
- _system->update_screen();
+ _system->updateScreen();
}
void Screen::fnDrawScreen(uint32 palette, uint32 scroll) {
@@ -247,8 +247,8 @@ void Screen::fnFadeDown(uint32 scroll) {
} else {
for (uint8 cnt = 0; cnt < 32; cnt++) {
palette_fadedown_helper((uint32 *)_palette, GAME_COLOURS);
- _system->set_palette(_palette, 0, GAME_COLOURS);
- _system->update_screen();
+ _system->setPalette(_palette, 0, GAME_COLOURS);
+ _system->updateScreen();
_system->delay_msecs(20);
}
}
@@ -295,8 +295,8 @@ void Screen::paletteFadeUp(uint8 *pal) {
_palette[(colCnt << 2) | 1] = (tmpPal[(colCnt << 2) | 1] * cnt) >> 5;
_palette[(colCnt << 2) | 2] = (tmpPal[(colCnt << 2) | 2] * cnt) >> 5;
}
- _system->set_palette(_palette, 0, GAME_COLOURS);
- _system->update_screen();
+ _system->setPalette(_palette, 0, GAME_COLOURS);
+ _system->updateScreen();
_system->delay_msecs(20);
}
}
@@ -482,7 +482,7 @@ void Screen::processSequence(void) {
}
scrPtr += 15 * GAME_SCREEN_WIDTH;
}
- _system->update_screen();
+ _system->updateScreen();
_seqInfo.framesLeft--;
}
if (_seqInfo.framesLeft == 0) {
diff --git a/sound/mixer.cpp b/sound/mixer.cpp
index afe31813f4..b67b0c782b 100644
--- a/sound/mixer.cpp
+++ b/sound/mixer.cpp
@@ -105,7 +105,7 @@ public:
SoundMixer::SoundMixer() {
_syst = OSystem::instance();
- _mutex = _syst->create_mutex();
+ _mutex = _syst->createMutex();
_premixParam = 0;
_premixProc = 0;
@@ -130,7 +130,7 @@ SoundMixer::SoundMixer() {
SoundMixer::~SoundMixer() {
_syst->clearSoundCallback();
stopAll();
- _syst->delete_mutex(_mutex);
+ _syst->deleteMutex(_mutex);
}
void SoundMixer::setupPremix(PremixProc *proc, void *param) {
diff --git a/sword1/animation.cpp b/sword1/animation.cpp
index 9212656762..f3bb1c61c6 100644
--- a/sword1/animation.cpp
+++ b/sword1/animation.cpp
@@ -104,7 +104,7 @@ bool AnimationState::init(const char *name) {
palnum = 0;
maxPalnum = p;
- _sys->set_palette(palettes[palnum].pal, 0, 256);
+ _sys->setPalette(palettes[palnum].pal, 0, 256);
lut = lut2 = lookup[0];
curpal = -1;
cr = 0;
@@ -113,7 +113,7 @@ bool AnimationState::init(const char *name) {
lutcalcnum = (BITDEPTH + palettes[palnum].end + 2) / (palettes[palnum].end + 2);
#else
buildLookup();
- overlay = (NewGuiColor*)calloc(MOVIE_WIDTH * MOVIE_HEIGHT, sizeof(NewGuiColor));
+ overlay = (OverlayColor*)calloc(MOVIE_WIDTH * MOVIE_HEIGHT, sizeof(OverlayColor));
_sys->show_overlay();
#endif
@@ -208,7 +208,7 @@ bool AnimationState::checkPaletteSwitch() {
if (framenum == palettes[palnum].end) {
unsigned char *l = lut2;
palnum++;
- _sys->set_palette(palettes[palnum].pal, 0, 256);
+ _sys->setPalette(palettes[palnum].pal, 0, 256);
lutcalcnum = (BITDEPTH + palettes[palnum].end - (framenum + 1) + 2) / (palettes[palnum].end - (framenum + 1) + 2);
lut2 = lut;
lut = l;
@@ -220,13 +220,13 @@ bool AnimationState::checkPaletteSwitch() {
#else
-NewGuiColor *AnimationState::lookup = 0;
+OverlayColor *AnimationState::lookup = 0;
void AnimationState::buildLookup() {
if (lookup)
return;
- lookup = (NewGuiColor *)calloc(BITDEPTH * BITDEPTH * 256, sizeof(NewGuiColor));
+ lookup = (OverlayColor *)calloc(BITDEPTH * BITDEPTH * 256, sizeof(OverlayColor));
int y, cb, cr;
int r, g, b;
@@ -252,9 +252,9 @@ void AnimationState::buildLookup() {
}
}
-void AnimationState::plotYUV(NewGuiColor *lut, int width, int height, byte *const *dat) {
+void AnimationState::plotYUV(OverlayColor *lut, int width, int height, byte *const *dat) {
- NewGuiColor *ptr = overlay + (MOVIE_HEIGHT - height) / 2 * MOVIE_WIDTH + (MOVIE_WIDTH - width) / 2;
+ OverlayColor *ptr = overlay + (MOVIE_HEIGHT - height) / 2 * MOVIE_WIDTH + (MOVIE_WIDTH - width) / 2;
int x, y;
@@ -377,7 +377,7 @@ void MoviePlayer::play(const char *filename) {
if (anim->init(filename)) {
while (anim->decodeFrame()) {
#ifndef BACKEND_8BIT
- _sys->update_screen();
+ _sys->updateScreen();
#endif
// FIXME: check for ESC and abbort animation be just returning from the function
OSystem::Event event;
diff --git a/sword1/animation.h b/sword1/animation.h
index fdb78cd99a..0e0bea0694 100644
--- a/sword1/animation.h
+++ b/sword1/animation.h
@@ -111,8 +111,8 @@ private:
byte pal[4 * 256];
} palettes[50];
#else
- static NewGuiColor *lookup;
- NewGuiColor * overlay;
+ static OverlayColor *lookup;
+ OverlayColor * overlay;
#endif
public:
@@ -130,7 +130,7 @@ private:
bool checkPaletteSwitch();
#else
void buildLookup(void);
- void plotYUV(NewGuiColor *lut, int width, int height, byte *const *dat);
+ void plotYUV(OverlayColor *lut, int width, int height, byte *const *dat);
#endif
};
diff --git a/sword1/control.cpp b/sword1/control.cpp
index 9297435c19..b28e3ab62c 100644
--- a/sword1/control.cpp
+++ b/sword1/control.cpp
@@ -179,7 +179,7 @@ void Control::askForCd(void) {
}
palOut[0] = palOut[1] = palOut[2] = palOut[3] = 0;
_resMan->resClose(SR_PALETTE);
- _system->set_palette(palOut, 0, 256);
+ _system->setPalette(palOut, 0, 256);
free(palOut);
File test;
@@ -195,7 +195,7 @@ void Control::askForCd(void) {
renderText(textA, 320, 220, TEXT_CENTER);
renderText(_lStrings[STR_INSERT_CD_B], 320, 240, TEXT_CENTER);
_system->copy_rect(_screenBuf, 640, 0, 0, 640, 480);
- _system->update_screen();
+ _system->updateScreen();
}
delay(300);
if (_keyPressed) {
@@ -204,7 +204,7 @@ void Control::askForCd(void) {
memset(_screenBuf, 0, 640 * 480);
renderText(_lStrings[STR_INCORRECT_CD], 320, 230, TEXT_CENTER);
_system->copy_rect(_screenBuf, 640, 0, 0, 640, 480);
- _system->update_screen();
+ _system->updateScreen();
delay(2000);
refreshText = true;
} else {
@@ -240,7 +240,7 @@ uint8 Control::runPanel(void) {
}
palOut[0] = palOut[1] = palOut[2] = palOut[3] = 0;
_resMan->resClose(SR_PALETTE);
- _system->set_palette(palOut, 0, 256);
+ _system->setPalette(palOut, 0, 256);
free(palOut);
uint8 mode = 0, newMode = BUTTON_MAIN_PANEL;
bool fullRefresh = false;
@@ -281,7 +281,7 @@ uint8 Control::runPanel(void) {
fullRefresh = false;
_system->copy_rect(_screenBuf, SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, 480);
}
- _system->update_screen();
+ _system->updateScreen();
delay(1000 / 12);
newMode = getClicks(mode, &retVal);
} while ((newMode != 1) && (retVal == 0));
@@ -568,7 +568,7 @@ bool Control::getConfirm(const uint8 *title) {
do {
buttons[0]->draw();
buttons[1]->draw();
- _system->update_screen();
+ _system->updateScreen();
delay(1000 / 12);
if (_mouseState & BS1L_BUTTON_DOWN) {
if (buttons[0]->wasClicked(_mouseX, _mouseY))
diff --git a/sword1/music.cpp b/sword1/music.cpp
index 946b7b19b1..ae0a9c0794 100644
--- a/sword1/music.cpp
+++ b/sword1/music.cpp
@@ -114,7 +114,7 @@ Music::Music(OSystem *system, SoundMixer *pMixer) {
_system = system;
_mixer = pMixer;
_mixer->setupPremix(passMixerFunc, this);
- _mutex = _system->create_mutex();
+ _mutex = _system->createMutex();
_converter[0] = NULL;
_converter[1] = NULL;
_volumeL = _volumeR = 192;
@@ -125,7 +125,7 @@ Music::~Music() {
delete _converter[0];
delete _converter[1];
if (_mutex)
- _system->delete_mutex(_mutex);
+ _system->deleteMutex(_mutex);
}
void Music::passMixerFunc(void *param, int16 *buf, uint len) {
diff --git a/sword1/screen.cpp b/sword1/screen.cpp
index 3f3e0f3e3b..faac076d3d 100644
--- a/sword1/screen.cpp
+++ b/sword1/screen.cpp
@@ -108,14 +108,14 @@ void Screen::fnSetPalette(uint8 start, uint16 length, uint32 id, bool fadeUp) {
_fadingStep = 1;
_fadingDirection = FADE_UP;
memset(_currentPalette, 0, 256 * 4);
- _system->set_palette(_currentPalette, 0, 256);
+ _system->setPalette(_currentPalette, 0, 256);
} else
- _system->set_palette(_targetPalette + 4 * start, start, length);
+ _system->setPalette(_targetPalette + 4 * start, start, length);
}
void Screen::fullRefresh(void) {
_fullRefresh = true;
- _system->set_palette(_targetPalette, 0, 256);
+ _system->setPalette(_targetPalette, 0, 256);
}
bool Screen::stillFading(void) {
@@ -133,7 +133,7 @@ bool Screen::showScrollFrame(void) {
uint16 avgScrlY = (uint16)(_oldScrollY + Logic::_scriptVars[SCROLL_OFFSET_Y]) / 2;
_system->copy_rect(_screenBuf + avgScrlY * _scrnSizeX + avgScrlX, _scrnSizeX, 0, 40, SCREEN_WIDTH, SCREEN_DEPTH);
- _system->update_screen();
+ _system->updateScreen();
return true;
}
@@ -147,7 +147,7 @@ void Screen::updateScreen(void) {
}
if (_fadingStep) {
fadePalette();
- _system->set_palette(_currentPalette, 0, 256);
+ _system->setPalette(_currentPalette, 0, 256);
}
uint16 scrlX = (uint16)Logic::_scriptVars[SCROLL_OFFSET_X];
@@ -241,7 +241,7 @@ void Screen::updateScreen(void) {
scrnBuf += _scrnSizeX * SCRNGRID_Y;
}
}
- _system->update_screen();
+ _system->updateScreen();
}
void Screen::newScreen(uint32 screen) {
@@ -956,7 +956,7 @@ void Screen::plotYUV(byte *lut, int width, int height, byte *const *dat) {
}
_system->copy_rect(buf, width, (640-width)/2, (480-height)/2, width, height);
- _system->update_screen();
+ _system->updateScreen();
free(buf);
diff --git a/sword2/driver/animation.cpp b/sword2/driver/animation.cpp
index 4b915c913c..df5a3ad10a 100644
--- a/sword2/driver/animation.cpp
+++ b/sword2/driver/animation.cpp
@@ -121,7 +121,7 @@ bool AnimationState::init(const char *name) {
lutcalcnum = (BITDEPTH + palettes[palnum].end + 2) / (palettes[palnum].end + 2);
#else
buildLookup();
- overlay = (NewGuiColor*)calloc(MOVIE_WIDTH * MOVIE_HEIGHT, sizeof(NewGuiColor));
+ overlay = (OverlayColor*)calloc(MOVIE_WIDTH * MOVIE_HEIGHT, sizeof(OverlayColor));
_vm->_system->show_overlay();
#endif
@@ -229,13 +229,13 @@ bool AnimationState::checkPaletteSwitch() {
#else
-NewGuiColor *AnimationState::lookup = 0;
+OverlayColor *AnimationState::lookup = 0;
void AnimationState::buildLookup() {
if (lookup)
return;
- lookup = (NewGuiColor *)calloc(BITDEPTH * BITDEPTH * 256, sizeof(NewGuiColor));
+ lookup = (OverlayColor *)calloc(BITDEPTH * BITDEPTH * 256, sizeof(OverlayColor));
int y, cb, cr;
int r, g, b;
@@ -262,9 +262,9 @@ void AnimationState::buildLookup() {
}
-void AnimationState::plotYUV(NewGuiColor *lut, int width, int height, byte *const *dat) {
+void AnimationState::plotYUV(OverlayColor *lut, int width, int height, byte *const *dat) {
- NewGuiColor *ptr = overlay + (MOVIE_HEIGHT - height) / 2 * MOVIE_WIDTH + (MOVIE_WIDTH - width) / 2;
+ OverlayColor *ptr = overlay + (MOVIE_HEIGHT - height) / 2 * MOVIE_WIDTH + (MOVIE_WIDTH - width) / 2;
int x, y;
@@ -289,12 +289,12 @@ void AnimationState::plotYUV(NewGuiColor *lut, int width, int height, byte *cons
}
void AnimationState::drawTextObject(SpriteInfo *s, uint8 *src) {
- NewGuiColor *dst = overlay + RENDERWIDE * (s->y) + s->x;
+ OverlayColor *dst = overlay + RENDERWIDE * (s->y) + s->x;
// FIXME: These aren't the "right" colours, but look good to me.
- NewGuiColor pen = _vm->_system->RGBToColor(255, 255, 255);
- NewGuiColor border = _vm->_system->RGBToColor(0, 0, 0);
+ OverlayColor pen = _vm->_system->RGBToColor(255, 255, 255);
+ OverlayColor border = _vm->_system->RGBToColor(0, 0, 0);
for (int y = 0; y < s->h; y++) {
for (int x = 0; x < s->w; x++) {
@@ -315,7 +315,7 @@ void AnimationState::drawTextObject(SpriteInfo *s, uint8 *src) {
}
void AnimationState::clearDisplay(void) {
- NewGuiColor black = _vm->_system->RGBToColor(0, 0, 0);
+ OverlayColor black = _vm->_system->RGBToColor(0, 0, 0);
for (int i = 0; i < MOVIE_WIDTH * MOVIE_HEIGHT; i++)
overlay[i] = black;
diff --git a/sword2/driver/animation.h b/sword2/driver/animation.h
index 25c4284f4c..117aadd094 100644
--- a/sword2/driver/animation.h
+++ b/sword2/driver/animation.h
@@ -105,8 +105,8 @@ private:
byte pal[4 * 256];
} palettes[50];
#else
- static NewGuiColor *lookup;
- NewGuiColor *overlay;
+ static OverlayColor *lookup;
+ OverlayColor *overlay;
#endif
public:
@@ -130,7 +130,7 @@ private:
bool checkPaletteSwitch();
#else
void buildLookup(void);
- void plotYUV(NewGuiColor *lut, int width, int height, byte *const *dat);
+ void plotYUV(OverlayColor *lut, int width, int height, byte *const *dat);
#endif
};
diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp
index 0d16c72969..2305bc619e 100644
--- a/sword2/driver/d_sound.cpp
+++ b/sword2/driver/d_sound.cpp
@@ -54,7 +54,7 @@ static void premix_proc(void *param, int16 *data, uint len) {
Sound::Sound(Sword2Engine *vm) {
_vm = vm;
- _mutex = _vm->_system->create_mutex();
+ _mutex = _vm->_system->createMutex();
memset(_fx, 0, sizeof(_fx));
@@ -83,7 +83,7 @@ Sound::~Sound() {
for (int i = 0; i < MAXFX; i++)
stopFxHandle(i);
if (_mutex)
- _vm->_system->delete_mutex(_mutex);
+ _vm->_system->deleteMutex(_mutex);
}
void Sound::fxServer(int16 *data, uint len) {
diff --git a/sword2/driver/palette.cpp b/sword2/driver/palette.cpp
index 2d28d517eb..c9433c3ef1 100644
--- a/sword2/driver/palette.cpp
+++ b/sword2/driver/palette.cpp
@@ -113,11 +113,11 @@ void Graphics::setPalette(int16 startEntry, int16 noEntries, uint8 *colourTable,
if (noEntries) {
memcpy(&_palCopy[startEntry][0], colourTable, noEntries * 4);
if (fadeNow == RDPAL_INSTANT) {
- _vm->_system->set_palette((const byte *) _palCopy, startEntry, noEntries);
+ _vm->_system->setPalette((const byte *) _palCopy, startEntry, noEntries);
setNeedFullRedraw();
}
} else {
- _vm->_system->set_palette((const byte *) _palCopy, 0, 256);
+ _vm->_system->setPalette((const byte *) _palCopy, 0, 256);
setNeedFullRedraw();
}
}
@@ -128,7 +128,7 @@ void Graphics::dimPalette(void) {
for (int i = 0; i < 256 * 4; i++)
p[i] /= 2;
- _vm->_system->set_palette(p, 0, 256);
+ _vm->_system->setPalette(p, 0, 256);
setNeedFullRedraw();
}
@@ -230,7 +230,7 @@ void Graphics::fadeServer(void) {
}
}
- _vm->_system->set_palette(newPalette, 0, 256);
+ _vm->_system->setPalette(newPalette, 0, 256);
setNeedFullRedraw();
}
diff --git a/sword2/driver/rdwin.cpp b/sword2/driver/rdwin.cpp
index cf7f5f0ff9..bc0ec79319 100644
--- a/sword2/driver/rdwin.cpp
+++ b/sword2/driver/rdwin.cpp
@@ -139,7 +139,7 @@ void Graphics::updateDisplay(bool redrawScene) {
}
// We always need to update because of fades, menu animations, etc.
- _vm->_system->update_screen();
+ _vm->_system->updateScreen();
}
/**