aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-01-15 13:41:57 +0000
committerTorbjörn Andersson2005-01-15 13:41:57 +0000
commit139f57a29d27a1c148563a7c8f729f7c3b3e4f3e (patch)
tree6e383b7bc35ba3d446af9e6e7c3dddb7cbbcfaa9 /saga
parent96d5a1c88d3a8efb82b810f9dfba11f43adf1a0d (diff)
downloadscummvm-rg350-139f57a29d27a1c148563a7c8f729f7c3b3e4f3e.tar.gz
scummvm-rg350-139f57a29d27a1c148563a7c8f729f7c3b3e4f3e.tar.bz2
scummvm-rg350-139f57a29d27a1c148563a7c8f729f7c3b3e4f3e.zip
Use the same hard-coded cursor image and colours as the original ITE
interpreter. Supposedly these colours will stay fairly constant throughout the game, in which case we no longer need to repaint it with the "best white" colour every time the palette changes. svn-id: r16561
Diffstat (limited to 'saga')
-rw-r--r--saga/gfx.cpp44
-rw-r--r--saga/gfx.h4
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;