aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--saga/gfx.cpp67
-rw-r--r--saga/gfx.h7
2 files changed, 57 insertions, 17 deletions
diff --git a/saga/gfx.cpp b/saga/gfx.cpp
index cdad674972..c1e76daba9 100644
--- a/saga/gfx.cpp
+++ b/saga/gfx.cpp
@@ -396,22 +396,57 @@ void Gfx::showCursor(bool state) {
g_system->showMouse(state);
}
-void Gfx::setCursor() {
- // Set up the mouse cursor
- const byte A = kITEColorLightGrey;
- const byte B = kITEColorWhite;
-
- const byte cursor_img[CURSOR_W * CURSOR_H] = {
- 0, 0, 0, A, 0, 0, 0,
- 0, 0, 0, A, 0, 0, 0,
- 0, 0, 0, A, 0, 0, 0,
- A, A, A, B, A, A, A,
- 0, 0, 0, A, 0, 0, 0,
- 0, 0, 0, A, 0, 0, 0,
- 0, 0, 0, A, 0, 0, 0,
- };
-
- _system->setMouseCursor(cursor_img, CURSOR_W, CURSOR_H, 3, 3, 0);
+void Gfx::setCursor(CursorType cursorType) {
+ if (_vm->getGameType() == GType_ITE) {
+ // Set up the mouse cursor
+ const byte A = kITEColorLightGrey;
+ const byte B = kITEColorWhite;
+
+ const byte cursor_img[CURSOR_W * CURSOR_H] = {
+ 0, 0, 0, A, 0, 0, 0,
+ 0, 0, 0, A, 0, 0, 0,
+ 0, 0, 0, A, 0, 0, 0,
+ A, A, A, B, A, A, A,
+ 0, 0, 0, A, 0, 0, 0,
+ 0, 0, 0, A, 0, 0, 0,
+ 0, 0, 0, A, 0, 0, 0,
+ };
+
+ _system->setMouseCursor(cursor_img, CURSOR_W, CURSOR_H, 3, 3, 0);
+ } else {
+ uint32 resourceId;
+
+ switch (cursorType) {
+ case kCursorBusy:
+ resourceId = RID_IHNM_HOURGLASS_CURSOR;
+ break;
+ default:
+ // Assume normal cursor
+ // TODO: Find the correct resource for it
+ resourceId = RID_IHNM_HOURGLASS_CURSOR;
+ break;
+ }
+
+ ResourceContext *context = _vm->_resource->getContext(GAME_RESOURCEFILE);
+
+ byte *resource;
+ size_t resourceLength;
+
+ _vm->_resource->loadResource(context, resourceId, resource, resourceLength);
+
+ byte *image;
+ size_t imageLength;
+ int width, height;
+
+ _vm->decodeBGImage(resource, resourceLength, &image, &imageLength, &width, &height);
+
+ // TODO: Hotspot?
+
+ _system->setMouseCursor(image, width, height, 0, 0, 0);
+
+ free(image);
+ free(resource);
+ }
}
bool hitTestPoly(const Point *points, unsigned int npoints, const Point& test_point) {
diff --git a/saga/gfx.h b/saga/gfx.h
index 0a836da1a1..147def0eb3 100644
--- a/saga/gfx.h
+++ b/saga/gfx.h
@@ -33,6 +33,11 @@ namespace Saga {
using Common::Point;
using Common::Rect;
+enum CursorType {
+ kCursorNormal,
+ kCursorBusy
+};
+
struct ClipData {
// input members
Rect sourceRect;
@@ -144,7 +149,7 @@ public:
void showCursor(bool state);
private:
- void setCursor();
+ void setCursor(CursorType cursorType = kCursorNormal);
int _init;
Surface _backBuffer;
byte _currentPal[PAL_ENTRIES * 4];