Trying a different set_cursor interface to make multiple os support easier

This commit is contained in:
Duncan Frost 2014-07-24 22:08:15 +01:00
parent 6f8cefac21
commit 2fd87342af
3 changed files with 40 additions and 4 deletions

View File

@ -404,7 +404,7 @@ static void game_get_next_input(int *x, int *y, int *state)
edx = RCT2_GLOBAL(0x9DE51C, uint8);
RCT2_GLOBAL(0x14241BC, uint32) = 2;
osinterface_set_cursor(RCT2_ADDRESS(0x1423598, int)[edx]);
osinterface_set_cursor(edx);
RCT2_GLOBAL(0x14241BC, uint32) = 0;
//int eax, ebx, ecx, edx, esi, edi, ebp;
//RCT2_CALLFUNC_X(0x006E83C7, &eax, &ebx, &ecx, &edx, &esi, &edi, &ebp);

View File

@ -59,7 +59,13 @@ void osinterface_init()
// RCT2_CALLPROC(0x00404584); // dinput_init()
}
void osinterface_set_cursor(int hCurs){
/**
* This is not quite the same as the below function as we don't want to
* derfererence the cursor before the function.
* rct2: 0x0407956
*/
void osinterface_set_cursor(char cursor){
HCURSOR hCurs = RCT2_ADDRESS(RCT2_ADDRESS_HCURSOR_START, HCURSOR)[cursor];
SetCursor((HCURSOR)hCurs);
}
/**
@ -95,7 +101,7 @@ static void osinterface_load_cursors(){
RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_ENTRANCE_DOWN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0x9F));
RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_HAND_OPEN, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0xA6));
RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_HAND_CLOSED, HCURSOR) = LoadCursor(hInst, MAKEINTRESOURCE(0xA5));
SetCursor(RCT2_GLOBAL(RCT2_ADDRESS_HCURSOR_ARROW, HCURSOR));
osinterface_set_cursor(CURSOR_ARROW);
RCT2_GLOBAL(0x14241BC, uint32) = 0;
}

View File

@ -29,6 +29,36 @@ enum {
CURSOR_PRESSED = CURSOR_DOWN | CURSOR_CHANGED,
};
enum{
CURSOR_ARROW,
CURSOR_BLANK,
CURSOR_UP_ARROW,
CURSOR_UP_DOWN_ARROW,
CURSOR_HAND_POINT,
CURSOR_ZZZ,
CURSOR_DIAGONAL_ARROWS,
CURSOR_PICKER,
CURSOR_TREE_DOWN,
CURSOR_FOUNTAIN_DOWN,
CURSOR_STATUE_DOWN,
CURSOR_BENCH_DOWN,
CURSOR_CROSS_HAIR,
CURSOR_BIN_DOWN,
CURSOR_LAMPPOST_DOWN,
CURSOR_FENCE_DOWN,
CURSOR_FLOWER_DOWN,
CURSOR_PATH_DOWN,
CURSOR_DIG_DOWN,
CURSOR_WATER_DOWN,
CURSOR_HOUSE_DOWN,
CURSOR_VOLCANO_DOWN,
CURSOR_WALK_DOWN,
CURSOR_PAINT_DOWN,
CURSOR_ENTRANCE_DOWN,
CURSOR_HAND_OPEN,
CURSOR_HAND_CLOSED
};
typedef struct {
int x, y;
unsigned char left, middle, right, any;
@ -47,7 +77,7 @@ void osinterface_draw();
void osinterface_free();
void osinterface_update_palette(char* colours, int start_index, int num_colours);
void osinterface_set_cursor(int hCurs);
void osinterface_set_cursor(char cursor);
int osinterface_open_common_file_dialog(int type, char *title, char *filename, char *filterPattern, char *filterName);
void osinterface_show_messagebox(char* message);