diff options
Diffstat (limited to 'saga')
-rw-r--r-- | saga/gfx.cpp | 44 | ||||
-rw-r--r-- | saga/gfx.h | 4 |
2 files changed, 12 insertions, 36 deletions
diff --git a/saga/gfx.cpp b/saga/gfx.cpp index b6a5b55652..cbf5cccc5f 100644 --- a/saga/gfx.cpp +++ b/saga/gfx.cpp @@ -63,7 +63,7 @@ Gfx::Gfx(OSystem *system, int width, int height, GameDetector &detector) : _syst _black_index = -1; // For now, always show the mouse cursor. - setCursor(1); + setCursor(); _system->showMouse(true); } @@ -828,13 +828,6 @@ int Gfx::setPalette(SURFACE *surface, PALENTRY *pal) { } } - // When the palette changes, make sure the cursor colours are still - // correct. We may have to reconsider this code later, but for now - // there is only one cursor image. - if (_white_index != best_windex) { - setCursor(best_windex); - } - // Set whitest and blackest color indices _white_index = best_windex; _black_index = best_bindex; @@ -974,13 +967,6 @@ int Gfx::blackToPal(SURFACE *surface, PALENTRY *src_pal, double percent) { } } - // When the palette changes, make sure the cursor colours are still - // correct. We may have to reconsider this code later, but for now - // there is only one cursor image. - if (_white_index != best_windex) { - setCursor(best_windex); - } - _system->setPalette(_cur_pal, 0, PAL_ENTRIES); return SUCCESS; @@ -991,29 +977,19 @@ void Gfx::showCursor(bool state) { g_system->showMouse(state); } -void Gfx::setCursor(int best_white) { - int i; - byte keycolor = (best_white == 0) ? 1 : 0; - +void Gfx::setCursor() { // Set up the mouse cursor byte cursor_img[CURSOR_W * CURSOR_H] = { - 0, 0, 0, 255, 0, 0, 0, - 0, 0, 0, 255, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, - 255, 255, 0, 0, 0, 255, 255, - 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 255, 0, 0, 0, - 0, 0, 0, 255, 0, 0, 0, + 0, 0, 0, 4, 0, 0, 0, + 0, 0, 0, 4, 0, 0, 0, + 0, 0, 0, 4, 0, 0, 0, + 4, 4, 4, 2, 4, 4, 4, + 0, 0, 0, 4, 0, 0, 0, + 0, 0, 0, 4, 0, 0, 0, + 0, 0, 0, 4, 0, 0, 0, }; - for (i = 0; i < CURSOR_W * CURSOR_H; i++) { - if (cursor_img[i] != 0) - cursor_img[i] = best_white; - else - cursor_img[i] = keycolor; - } - - _system->setMouseCursor(cursor_img, CURSOR_W, CURSOR_H, 4, 4, keycolor); + _system->setMouseCursor(cursor_img, CURSOR_W, CURSOR_H, 3, 3, 0); } bool hitTestPoly(const Point *points, unsigned int npoints, const Point& test_point) { diff --git a/saga/gfx.h b/saga/gfx.h index 61cc760c89..c7ff643dd4 100644 --- a/saga/gfx.h +++ b/saga/gfx.h @@ -107,11 +107,11 @@ public: int getCurrentPal(PALENTRY *src_pal); int palToBlack(SURFACE *surface, PALENTRY *src_pal, double percent); int blackToPal(SURFACE *surface, PALENTRY *src_pal, double percent); - void updateCursor() { setCursor(getWhite()); } + void updateCursor() { setCursor(); } void showCursor(bool state); private: - void setCursor(int best_white); + void setCursor(); int _init; SURFACE _back_buf; int _white_index; |