summaryrefslogtreecommitdiff
path: root/csrc/cards_ui.c
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2018-09-25 07:43:02 +0800
committerIru Cai <mytbk920423@gmail.com>2018-09-25 07:45:07 +0800
commitf38b1e589c9a8000911ce14642f496c4267b71d6 (patch)
treec861aa7556e744cf5d3cce3ce37b3cad098f412e /csrc/cards_ui.c
parent0248e480c58e8e1de8f64d258999634b1db06cd0 (diff)
downloadrich4-f38b1e589c9a8000911ce14642f496c4267b71d6.tar.xz
name fcn_4018e7 as register_wait_callback, and move it to window_util
Diffstat (limited to 'csrc/cards_ui.c')
-rw-r--r--csrc/cards_ui.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/csrc/cards_ui.c b/csrc/cards_ui.c
index 77b65ac..d284f10 100644
--- a/csrc/cards_ui.c
+++ b/csrc/cards_ui.c
@@ -6,6 +6,7 @@
#include "player_info.h"
#include "global.h"
#include "sound_struct.h"
+#include "window_util.h"
uint8_t player_cards[60]; // 0x499120
int selected_card; // 0x48c544
@@ -54,29 +55,6 @@ rich4_card cards_table[] = {
{ "\xaf\x51\xc0\x74\xa5\x64", 3, 70, 0, 0 }, /* 乌龟卡 */
};
-int fcn_4018e7(wProc a1, int a2)
-{
- dw_46cad8++;
- windowCallbacks[dw_46cad8] = a1;
- PostMessageA(gwindowHandle, 0x401, 0, a2);
- while (1) {
- MSG msg;
- if (PeekMessageA(&msg, 0, 0, 0, 1) == 0)
- continue;
- if (msg.message == 0x402) {
- dw_46cad8--;
- return msg.lParam;
- }
- TranslateMessage(&msg);
- DispatchMessageA(&msg);
- }
-}
-
-void Post_0402_Message(LPARAM lp)
-{
- PostMessageA(gwindowHandle, 0x402, 0, lp);
-}
-
sound_struct snd0 = {1, NULL}; // 0x00482322
sound_struct snd1 = {3, NULL}; // 0x0048233a
sound_struct snd2; // 0x0048cae0
@@ -196,7 +174,7 @@ void cards_ui()
IDirectDrawSurface_Lock(pddrawsf2, NULL, &sfdesc1, 1, 0);
fcn_004563f5(sfdesc1.lpSurface, edi+12, 14, 130);
IDirectDrawSurface_Unlock(pddrawsf2, NULL);
- ebx = fcn_4018e7(cardProc, 0);
+ ebx = register_wait_callback(cardProc, 0);
fcn_00451edb(ebp, 0, 0x8028);
if (ebx != 0) {
edx = cards_table[ebx].name_ptr; /* cards_table has 8 bytes per item */