diff options
author | Iru Cai <mytbk920423@gmail.com> | 2018-11-15 21:47:21 +0800 |
---|---|---|
committer | Iru Cai <mytbk920423@gmail.com> | 2018-11-15 21:47:21 +0800 |
commit | 7368fe7a82532fcfa29159fe9b87edd46ce34fc4 (patch) | |
tree | 8a4940f32c1f769e43353b6c611ab4aae0438b14 /csrc | |
parent | ac2ff357f67b4c7fae69fdfaea4daf1c579e2440 (diff) | |
download | rich4-7368fe7a82532fcfa29159fe9b87edd46ce34fc4.tar.xz |
fcn_004190cf
Diffstat (limited to 'csrc')
-rw-r--r-- | csrc/drawing.c | 8 | ||||
-rw-r--r-- | csrc/loadsave.c | 7 | ||||
-rw-r--r-- | csrc/main.c | 37 |
3 files changed, 45 insertions, 7 deletions
diff --git a/csrc/drawing.c b/csrc/drawing.c index e122baa..0c4addd 100644 --- a/csrc/drawing.c +++ b/csrc/drawing.c @@ -300,7 +300,7 @@ void player_say(int p, int t, const char *s) IDirectDrawSurface_Lock(pddrawsf2, NULL, &sfdesc1, 1, 0); st_46caec.f8 = sfdesc1.lpSurface; struct graph_st * edi = crop_graph(&st_46caec, NULL, 0, 40, 440, 220); - fullscreen_overlay(sfdesc1.lpSurface, dw_48bad8+0x54, 220, 130); + fullscreen_overlay(sfdesc1.lpSurface, data_0205->chunk_tab[6], 220, 130); ecx = dword [p * 0x34 + 0x498eb0]; edx = t + 1; eax = edx * 12; @@ -316,10 +316,8 @@ void player_say(int p, int t, const char *s) } const char *s2 = s + esi; if (s2[0] == '@') { - eax = (s2[1] - '0') * 10 + (s2[2] - '0'); - edx = (eax - 1) * 12; - eax = dw_48bad4 + 12 + edx; - fullscreen_overlay(sfdesc1.lpSurface, eax, 240, 130); + int nn = (s2[1] - '0') * 10 + (s2[2] - '0'); + fullscreen_overlay(sfdesc1.lpSurface, data_0207->chunk_tab[nn - 1], 240, 130); if (esi == 5) { eax = (s[1] - '0') * 1000 + (s[2] - '0') * 100 + (s[3] - '0') * 10 + (s[4] - '0'); fcn.0045441a(eax); diff --git a/csrc/loadsave.c b/csrc/loadsave.c index 26f35cb..583078d 100644 --- a/csrc/loadsave.c +++ b/csrc/loadsave.c @@ -93,6 +93,9 @@ label_40e082: return ebx + 1; } +struct spr_smp *data_0205; // @ 0x48bad8 +struct spr_smp *data_0207; // @ 0x48bad4 + void fcn_00407ad2() { fcn_004080f5(); @@ -252,8 +255,8 @@ void fcn_00407ad2() *(int16_t*)0x48bae0 = (int16_t)ebx; } fcn_00428caf(); - dw_48bad8 = read_mkf(mkf_data, 0x205, NULL, NULL); - dw_48bad4 = read_mkf(mkf_data, 0x207, NULL, NULL); + data_0205 = read_mkf(mkf_data, 0x205, NULL, NULL); + data_0207 = read_mkf(mkf_data, 0x207, NULL, NULL); for (int i = 0; i < 20; i++) { dw_496930[i] = read_mkf(mkf_data, 396 + i, NULL, NULL); } diff --git a/csrc/main.c b/csrc/main.c index aa31d7c..6a3a272 100644 --- a/csrc/main.c +++ b/csrc/main.c @@ -269,6 +269,43 @@ static void start_game_loop(int a0) } } +char *panel_0; // @ 0x48be0c +char *panel_1; // @ 0x475118 +char *panel_2; // @ 0x48be10 +char *panel_3; // @ 0x48be14 +char *panel_7; // @ 0x48be04 +char *panel_8; // @ 0x48be08 +char *panel_456[3]; // @ 0x48bdf8 + +struct graph_st *gst_48bdcc; +struct graph_st *gst_48bde0; +RECT rect_48bdb8; + +static void fcn_004190cf() +{ + if (panel_1 != NULL) + return; + + panel_0 = read_mkf(mkf_panel, 0, NULL, NULL); + panel_1 = read_mkf(mkf_panel, 1, NULL, NULL); + panel_2 = read_mkf(mkf_panel, 2, NULL, NULL); + panel_3 = read_mkf(mkf_panel, 3, NULL, NULL); + panel_7 = read_mkf(mkf_panel, 7, NULL, NULL); + panel_8 = read_mkf(mkf_panel, 8, NULL, NULL); + + for (int i = 0; i < 3; i++) { + panel_456[i] = read_mkf(mkf_panel, i + 4, NULL, NULL); + } + + gst_48bdcc = allocate_graph_st(200, 200, 0, 0); + gst_48bde0 = allocate_graph_st(data_0205->chunk_tab[0].width, + data_0205->chunk_tab[0].height, 0, 0); + rect_48bdb8.left = 220 - data_0205->chunk_tab[5].x; + rect_48bdb8.top = 140 - data_0205->chunk_tab[5].y; + rect_48bdb8.right = rect_48bdb8.left + data_0205->chunk_tab[5].width; + rect_48bdb8.bottom = rect_48bdb8.top + data_0205->chunk_tab[5].height; +} + int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, |