void DrawGlobalAnimations(int drawing_target, int drawing_stage)
{
+ int last_cursor_mode_override = gfx.cursor_mode_override;
+
if (drawing_stage == DRAW_GLOBAL_ANIM_STAGE_1)
+ {
ResetGlobalAnim_Clickable();
+ gfx.cursor_mode_override = CURSOR_UNDEFINED;
+ }
+
DrawGlobalAnimationsExt(drawing_target, drawing_stage);
if (drawing_stage == DRAW_GLOBAL_ANIM_STAGE_2)
+ {
ResetGlobalAnim_Clicked();
+ }
+
+ if (gfx.cursor_mode_override != last_cursor_mode_override)
+ SetMouseCursor(gfx.cursor_mode);
}
static boolean SetGlobalAnimPart_Viewport(struct GlobalAnimPartControlInfo *part)
viewport_height = part->graphic_info.height;
part->drawing_stage = DRAW_GLOBAL_ANIM_STAGE_2;
+
+ gfx.cursor_mode_override = CURSOR_NONE;
}
else if (part->control_info.class == get_hash_from_key("door_1"))
{
void InitGfxOtherSettings(void)
{
gfx.cursor_mode = CURSOR_DEFAULT;
+ gfx.cursor_mode_override = CURSOR_UNDEFINED;
+ gfx.cursor_mode_final = gfx.cursor_mode;
+
gfx.mouse_x = 0;
gfx.mouse_y = 0;
}
static struct MouseCursorInfo *cursor_none = NULL;
static struct MouseCursorInfo *cursor_playfield = NULL;
struct MouseCursorInfo *cursor_new;
+ int mode_final = mode;
if (cursor_none == NULL)
cursor_none = get_cursor_from_image(cursor_image_none);
if (cursor_playfield == NULL)
cursor_playfield = get_cursor_from_image(cursor_image_playfield);
- cursor_new = (mode == CURSOR_DEFAULT ? NULL :
- mode == CURSOR_NONE ? cursor_none :
- mode == CURSOR_PLAYFIELD ? cursor_playfield : NULL);
+ if (gfx.cursor_mode_override != CURSOR_UNDEFINED)
+ mode_final = gfx.cursor_mode_override;
+
+ cursor_new = (mode_final == CURSOR_DEFAULT ? NULL :
+ mode_final == CURSOR_NONE ? cursor_none :
+ mode_final == CURSOR_PLAYFIELD ? cursor_playfield : NULL);
SDLSetMouseCursor(cursor_new);
gfx.cursor_mode = mode;
+ gfx.cursor_mode_final = mode_final;
}
y >= gfx.ey && y < gfx.ey + gfx.eysize)
// values for mouse cursor
+#define CURSOR_UNDEFINED -1
#define CURSOR_DEFAULT 0
#define CURSOR_NONE 1
#define CURSOR_PLAYFIELD 2
void (*draw_tile_cursor_function)(int);
int cursor_mode;
+ int cursor_mode_override;
+ int cursor_mode_final;
int mouse_x, mouse_y;
};