diff options
| -rw-r--r-- | backends/morphos/morphos.cpp | 2 | ||||
| -rw-r--r-- | backends/sdl/sdl-common.cpp | 6 | ||||
| -rw-r--r-- | backends/sdl/sdl-common.h | 6 | ||||
| -rw-r--r-- | common/system.h | 6 | ||||
| -rw-r--r-- | gui/newgui.cpp | 16 |
5 files changed, 18 insertions, 18 deletions
diff --git a/backends/morphos/morphos.cpp b/backends/morphos/morphos.cpp index 36515463f5..065b4e1021 100644 --- a/backends/morphos/morphos.cpp +++ b/backends/morphos/morphos.cpp @@ -1543,7 +1543,7 @@ void OSystem_MorphOS::copy_rect_overlay(const int16 *ovl, int pitch, int x, int int16 col; col = *ovl++; - colorToRBG(col, r, g, b); + colorToRGB(col, r, g, b); *dest++ = r; *dest++ = g; *dest++ = b; diff --git a/backends/sdl/sdl-common.cpp b/backends/sdl/sdl-common.cpp index bb7cce2027..b9f1816c1c 100644 --- a/backends/sdl/sdl-common.cpp +++ b/backends/sdl/sdl-common.cpp @@ -925,7 +925,7 @@ void OSystem_SDL_Common::draw_mouse() { *bak++ = *dst; color = *src++; if (color != 0xFF) // 0xFF = transparent, don't draw - *dst = RBGToColor(_currentPalette[color].r, _currentPalette[color].g, _currentPalette[color].b); + *dst = RGBToColor(_currentPalette[color].r, _currentPalette[color].g, _currentPalette[color].b); dst++; width--; } @@ -1230,10 +1230,10 @@ void OSystem_SDL_Common::copy_rect_overlay(const int16 *buf, int pitch, int x, i SDL_UnlockSurface(_tmpscreen); } -int16 OSystem_SDL_Common::RBGToColor(uint8 r, uint8 g, uint8 b) { +int16 OSystem_SDL_Common::RGBToColor(uint8 r, uint8 g, uint8 b) { return SDL_MapRGB(_tmpscreen->format, r, g, b); } -void OSystem_SDL_Common::colorToRBG(int16 color, uint8 &r, uint8 &g, uint8 &b) { +void OSystem_SDL_Common::colorToRGB(int16 color, uint8 &r, uint8 &g, uint8 &b) { SDL_GetRGB(color, _tmpscreen->format, &r, &g, &b); } diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h index ab37cda31e..e8d54ea3e3 100644 --- a/backends/sdl/sdl-common.h +++ b/backends/sdl/sdl-common.h @@ -117,9 +117,9 @@ public: virtual int16 get_height(); virtual int16 get_width(); - // Methods that convert RBG to/from colors suitable for the overlay. - virtual int16 RBGToColor(uint8 r, uint8 g, uint8 b); - virtual void colorToRBG(int16 color, uint8 &r, uint8 &g, uint8 &b); + // Methods that convert RGB to/from colors suitable for the overlay. + virtual int16 RGBToColor(uint8 r, uint8 g, uint8 b); + virtual void colorToRGB(int16 color, uint8 &r, uint8 &g, uint8 &b); static OSystem *create(int gfx_mode, bool full_screen); diff --git a/common/system.h b/common/system.h index dc51d288e3..0eb5a0dce0 100644 --- a/common/system.h +++ b/common/system.h @@ -180,12 +180,12 @@ public: virtual int16 get_height() {return 200;} virtual int16 get_width() {return 320;} - // Methods that convert RBG to/from colors suitable for the overlay. + // Methods that convert RGB to/from colors suitable for the overlay. // Default implementation assumes 565 mode. - virtual int16 RBGToColor(uint8 r, uint8 g, uint8 b) { + virtual int16 RGBToColor(uint8 r, uint8 g, uint8 b) { return ((((r >> 3) & 0x1F) << 11) | (((g >> 2) & 0x3F) << 5) | ((b >> 3) & 0x1F)); } - virtual void colorToRBG(int16 color, uint8 &r, uint8 &g, uint8 &b) { + virtual void colorToRGB(int16 color, uint8 &r, uint8 &g, uint8 &b) { r = (((color >> 11) & 0x1F) << 3); g = (((color >> 5) & 0x3F) << 2); b = ((color&0x1F) << 3); diff --git a/gui/newgui.cpp b/gui/newgui.cpp index ca18e6cf0f..97f2182f6e 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -102,11 +102,11 @@ void NewGui::runLoop() { // different color modes (555 vs 565) might be used depending on the resolution // (e.g. that's the case on my system), so we still end up with wrong colors in those // sitauations. At least now the user can fix it by closing and reopening the GUI. - _bgcolor = _system->RBGToColor(0, 0, 0); - _color = _system->RBGToColor(96, 96, 96); - _shadowcolor = _system->RBGToColor(64, 64, 64); - _textcolor = _system->RBGToColor(32, 160, 32); - _textcolorhi = _system->RBGToColor(0, 255, 0); + _bgcolor = _system->RGBToColor(0, 0, 0); + _color = _system->RGBToColor(96, 96, 96); + _shadowcolor = _system->RGBToColor(64, 64, 64); + _textcolor = _system->RGBToColor(32, 160, 32); + _textcolorhi = _system->RGBToColor(0, 255, 0); if (!_stateIsSaved) { saveState(); @@ -305,7 +305,7 @@ void NewGui::line(int x, int y, int x2, int y2, int16 color) { void NewGui::blendRect(int x, int y, int w, int h, int16 color, int level) { int r, g, b; uint8 ar, ag, ab; - _system->colorToRBG(color, ar, ag, ab); + _system->colorToRGB(color, ar, ag, ab); r = ar * level; g = ag * level; b = ab * level; @@ -314,8 +314,8 @@ void NewGui::blendRect(int x, int y, int w, int h, int16 color, int level) { while (h--) { for (int i = 0; i < w; i++) { - _system->colorToRBG(ptr[i], ar, ag, ab); - ptr[i] = _system->RBGToColor((ar+r)/(level+1), + _system->colorToRGB(ptr[i], ar, ag, ab); + ptr[i] = _system->RGBToColor((ar+r)/(level+1), (ag+g)/(level+1), (ab+b)/(level+1)); } |
