mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-17 03:53:07 +01:00
Integrate gCurrentCursor
This commit is contained in:
@@ -119,7 +119,6 @@
|
||||
#define RCT2_ADDRESS_DRAW_SCROLL_NEXT_ID 0x009D7A80
|
||||
|
||||
#define RCT2_ADDRESS_INPUT_FLAGS 0x009DE518
|
||||
#define RCT2_ADDRESS_CURENT_CURSOR 0x009DE51C
|
||||
#define RCT2_ADDRESS_INPUT_STATE 0x009DE51D
|
||||
#define RCT2_ADDRESS_CURSOR_DOWN_WINDOWCLASS 0x009DE51F
|
||||
#define RCT2_ADDRESS_CURSOR_DOWN_WINDOWNUMBER 0x009DE520
|
||||
@@ -386,6 +385,7 @@
|
||||
#define RCT2_ADDRESS_EDITOR_OBJECT_FLAGS_LIST 0x009ADAEC
|
||||
#define RCT2_ADDRESS_TOTAL_NO_IMAGES 0x009ADAF0
|
||||
|
||||
#define RCT2_ADDRESS_CURENT_CURSOR 0x009DE51C
|
||||
#define RCT2_ADDRESS_TOOL_WINDOWNUMBER 0x009DE542
|
||||
#define RCT2_ADDRESS_TOOL_WINDOWCLASS 0x009DE544
|
||||
#define RCT2_ADDRESS_CURRENT_TOOL 0x009DE545
|
||||
|
||||
18
src/input.c
18
src/input.c
@@ -74,6 +74,7 @@ widget_ref gTooltipWidget;
|
||||
sint32 gTooltipCursorX;
|
||||
sint32 gTooltipCursorY;
|
||||
|
||||
uint8 gCurrentCursor;
|
||||
uint8 gCurrentToolId;
|
||||
widget_ref gCurrentToolWidget;
|
||||
|
||||
@@ -1557,18 +1558,15 @@ int get_next_key()
|
||||
*
|
||||
* rct2: 0x006ED990
|
||||
*/
|
||||
void sub_6ED990(uint8 cursor_id){
|
||||
if (gInputState == INPUT_STATE_RESIZING)
|
||||
{
|
||||
cursor_id = CURSOR_DIAGONAL_ARROWS; //resize icon
|
||||
void sub_6ED990(uint8 cursor_id)
|
||||
{
|
||||
if (gInputState == INPUT_STATE_RESIZING) {
|
||||
cursor_id = CURSOR_DIAGONAL_ARROWS;
|
||||
}
|
||||
|
||||
if (cursor_id == RCT2_GLOBAL(RCT2_ADDRESS_CURENT_CURSOR, uint8))
|
||||
{
|
||||
return;
|
||||
if (cursor_id != gCurrentCursor) {
|
||||
gCurrentCursor = cursor_id;
|
||||
platform_set_cursor(cursor_id);
|
||||
}
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURENT_CURSOR, uint8) = cursor_id;
|
||||
platform_set_cursor(cursor_id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@ extern widget_ref gTooltipWidget;
|
||||
extern sint32 gTooltipCursorX;
|
||||
extern sint32 gTooltipCursorY;
|
||||
|
||||
extern uint8 gCurrentCursor;
|
||||
extern uint8 gCurrentToolId;
|
||||
extern widget_ref gCurrentToolWidget;
|
||||
|
||||
|
||||
@@ -723,7 +723,7 @@ void platform_toggle_windowed_mode()
|
||||
*/
|
||||
void platform_set_cursor(uint8 cursor)
|
||||
{
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_CURENT_CURSOR, uint8) = cursor;
|
||||
gCurrentCursor = cursor;
|
||||
SDL_SetCursor(_cursors[cursor]);
|
||||
}
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user