1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 21:13:05 +01:00

integrate variable: gInputState

This commit is contained in:
IntelOrca
2016-01-04 22:45:51 +00:00
parent 6f4cf119e7
commit b5069d3809
9 changed files with 55 additions and 49 deletions

View File

@@ -22,6 +22,7 @@
#include "../config.h"
#include "../drawing/drawing.h"
#include "../drawing/supports.h"
#include "../input.h"
#include "../localisation/localisation.h"
#include "../ride/ride_data.h"
#include "../ride/track_data.h"
@@ -102,7 +103,7 @@ void viewport_init_all()
// ?
RCT2_GLOBAL(RCT2_ADDRESS_INPUT_FLAGS, uint32) = 0;
RCT2_GLOBAL(RCT2_ADDRESS_INPUT_STATE, sint8) = INPUT_STATE_RESET;
gInputState = INPUT_STATE_RESET;
RCT2_GLOBAL(RCT2_ADDRESS_CURSOR_DOWN_WINDOWCLASS, rct_windowclass) = -1;
RCT2_GLOBAL(RCT2_ADDRESS_PICKEDUP_PEEP_IMAGE, sint32) = -1;
RCT2_GLOBAL(RCT2_ADDRESS_TOOLTIP_NOT_SHOWN_TICKS, sint16) = -1;

View File

@@ -978,7 +978,7 @@ int widget_is_disabled(rct_window *w, int widgetIndex)
int widget_is_pressed(rct_window *w, int widgetIndex)
{
int inputState = RCT2_GLOBAL(RCT2_ADDRESS_INPUT_STATE, uint8);
int inputState = gInputState;
if (w->pressed_widgets & (1LL << widgetIndex))
return 1;

View File

@@ -386,19 +386,6 @@ enum {
SCROLL_PART_VSCROLLBAR_THUMB = 10,
};
enum {
INPUT_STATE_RESET = 0,
INPUT_STATE_NORMAL = 1,
INPUT_STATE_WIDGET_PRESSED = 2,
INPUT_STATE_POSITIONING_WINDOW = 3,
INPUT_STATE_VIEWPORT_RIGHT = 4,
INPUT_STATE_DROPDOWN_ACTIVE = 5,
INPUT_STATE_VIEWPORT_LEFT = 6,
INPUT_STATE_SCROLL_LEFT = 7,
INPUT_STATE_RESIZING = 8,
INPUT_STATE_SCROLL_RIGHT = 9
};
enum {
WC_MAIN_WINDOW = 0,
WC_TOP_TOOLBAR = 1,