summaryrefslogtreecommitdiff
path: root/csrc/player_action.c
blob: f2fb2bee8b3d4994dda4e8105ead9c50c6124ca0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "player_info.h"

void WINAPI some_game_loop_func(HWND hWnd, int, int, int);

void player_action_1(int a0)
{
	/* push 4 registers */
	some_game_loop_func(gwindowHandle, 0xf, 0, 0);
	if (a0 == 0)
		return;

	GetCursorPos_35d(NULL); /* fcn_4021f8.c */
	IDirectDrawSurface_BltFast(pddrawsf1, g_rect.left, g_rect.top, pddrawsf2, &g_rect, 0x10);
	GetCursorPos_250(NULL); /* fcn_4021f8.c */
	dw_475110 = 0;
}

/* still don't know what this means,
 * assume it's special players */
typedef struct
{
	uint16_t f0;
	uint16_t f2;
	uint16_t f4;
	uint16_t f6;
	uint8_t f8[8];
} special_player_info;

special_player_info special_players[10]; // 0x498de8

void player_action_2(int a0, int a1, int a2)
{
	int t0, t1;
	/* push ebp */
	if ((byte)a2 != 1) {
		fcn.0040829d(-1, 0); /* TODO: a very long function */
		dw_475110 |= 2;
	} else {
		if (current_player < 4) {
			t0 = players[current_player].f8;
			t1 = players[current_player].f10;
		} else {
			t0 = special_players[current_player].f0;
			t1 = special_players[current_player].f2;
		}
		if (t0 == a0 && t1 == a1) {
			dw_48be18 = 0;
		} else {
			dw_48be18 = 1;
			dw_48be1c = a0;
			dw_48be20 = a2;
		}
		fcn.00416e6d(0); /* TODO: a long function */
		fcn.00415e70(0);
	}
	if (a2 & 2) {
		fcn.00415d31(0);
	}
	if (a2 & 4) {
		some_game_loop_func(gwindowHandle, 15, 0, 0);
	}
	fcn.004192f7();
}

void fcn_41d546()
{
	dw_48be18 = 0;
	player_action_1(1);
}