summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-10-04 17:20:19 +0800
committerIru Cai <mytbk920423@gmail.com>2018-10-04 17:20:19 +0800
commit287472628b86043c3fffef88b02b6002c5e6d8a5 (patch)
treebd01a44374ab4d91f0b4a3fae36bde6968b4d932
parent14a900f2088b3b8b073ebee910f4c2ad7872e209 (diff)
downloadrich4-287472628b86043c3fffef88b02b6002c5e6d8a5.tar.xz
set_cursor_icon
-rw-r--r--csrc/cards.c8
-rw-r--r--csrc/fcn_4021f8.c11
-rw-r--r--csrc/media_init.c2
3 files changed, 12 insertions, 9 deletions
diff --git a/csrc/cards.c b/csrc/cards.c
index d8b868c..bb5a650 100644
--- a/csrc/cards.c
+++ b/csrc/cards.c
@@ -1265,9 +1265,9 @@ int red_card()
consume_a_card(current_player, 24);
return 1;
} else {
- fcn.004021f8(12, 15, 10);
+ set_cursor_icon(12, 15, 10);
int selected_stock = stock_ui(1);
- fcn.004021f8(41, 1, 0);
+ set_cursor_icon(41, 1, 0);
player_action_1(1);
if (selected_stock == 0)
return 0;
@@ -1292,9 +1292,9 @@ int black_card()
t[i] = stocks[i].f20;
if (players[current_player].who_plays == 1) {
- fcn.004021f8(12, 15, 10);
+ set_cursor_icon(12, 15, 10);
sel = stock_ui(2);
- fcn.004021f8(41, 1, 0);
+ set_cursor_icon(41, 1, 0);
player_action_1(1);
} else {
sel = fcn.0041e6f2(0);
diff --git a/csrc/fcn_4021f8.c b/csrc/fcn_4021f8.c
index 9ffcc95..f5b81bf 100644
--- a/csrc/fcn_4021f8.c
+++ b/csrc/fcn_4021f8.c
@@ -4,10 +4,13 @@
*/
#include <windows.h>
+#include "mkf/mkf.h"
-void fcn_004021f8(int a1, int a2, int a3)
+struct graph_st *current_cursors; // 0x48a0f4
+
+void set_cursor_icon(int data0_idx, int a2, int a3)
{
- dw_48a0f4 = &data0->chunk_tab[a1];
+ current_cursors = &data0->chunk_tab[data0_idx];
w_48a170 = a2;
w_48a174 = a3;
w_48a172 = w_48a176 = 0;
@@ -46,7 +49,7 @@ void GetCursorPos_35d(RECT *rect)
GetCursorPos(&p);
if (rect != NULL) {
- eax = w_48a172 * 12 + dw_48a0f4;
+ eax = &current_cursors[w_48a172];
edx = *(int16_t*)(eax + 4); /* sign extend */
edx = p.x - edx;
eax = *(int16_t*)(eax + 6);
@@ -93,7 +96,7 @@ void GetCursorPos_250(RECT *rect)
GetCursorPos(&p);
if (rect != NULL) {
- eax = w_48a172 * 12 + dw_48a0f4;
+ eax = &current_cursors[w_48a172];
edx = *(int16_t*)(eax + 4); /* sign extend */
edx = p.x - edx;
eax = *(int16_t*)(eax + 6);
diff --git a/csrc/media_init.c b/csrc/media_init.c
index 87f7158..56367fb 100644
--- a/csrc/media_init.c
+++ b/csrc/media_init.c
@@ -679,7 +679,7 @@ bool initialize()
ghook = SetWindowsHookExA(WH_KEYBOARD, kbdProc, ghInstance, 0);
init_data_and_timer();
mciSendStringA_5ba(); /* 0x4545ba */
- fcn_004021f8(0x29, 1, 0);
+ set_cursor_icon(41, 1, 0);
b_46caf8 = 0;
b_46caf9 = 0;
b_46cafd = 0;