World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
Arcomage.h
См. документацию.
1 #pragma once
2 
3 #include "Engine/Point.h"
4 #include "Engine/Rect.h"
5 
8 
9 struct ArcomageCard {
10  char pCardName[32];
11  int slot;
12  char card_resource_type; // 1- brick, 2-gems, 3-beasts
21  char field_30; // play again
50  char field_4D; // play again 2
79  char field_6A; // unused??
80  char field_6B; // unused??
81 };
82 
84  int uCardId = 0;
85  int discarded = 0;
89 };
90 
92  char pPlayerName[32];
93  int IsHisTurn = 0; // doesnt appear to be used correctly - always player 0 turn
98  int zoo_level;
102  int cards_at_hand[10];
104 };
105 
107  int am_input_type; // 1 - other key down, 3 - l mouse up, 4 - r mouse up, 7 - lmouse, 8 - r mouse
108  int field_4;
109  int am_input_key; // waht other key
110 };
111 
112 class GUIFont;
113 
114 struct ArcomageGame {
116 
117  // static bool LoadBackground();
118  static bool LoadSprites();
119  static bool MsgLoop(int a1, ArcomageGame_InputMSG *a2);
120  static void PlaySound(unsigned int event_id);
121  static void OnMouseClick(char right_left, bool bDown);
122  static void OnMouseMove(int x, int y);
123  static void GetCardRect(unsigned int uCardID, Rect *pCardRect);
124  static void PrepareArcomage();
125  // static void DoBlt_Copy(uint16_t *pPixels); // idb
126 
127  static void Loop();
128 
129  char field_0 = 0; // msg??
130  char field_1 = 0; // msg??
131  char field_2 = 0; // msg??
132  char field_3 = 0; // msg??
133  int field_4 = 0; // msg??
135 
136  int mouse_x = 0;
137  int mouse_y = 0;
138  char mouse_left = 0;
139  char field_39 = 0;
140  char mouse_right = 0;
141  char field_3B = 0;
142  // uint16_t *pBackgroundPixels = nullptr;
145  GUIFont *pfntComic = nullptr; // ptr_48;
146  GUIFont *pfntArrus = nullptr; // ptr_4C;
147  int field_50 = 0;
148  int field_54 = 0; // blend mode ??
150  Texture *pSprites = nullptr;
152  int uGameWinner = 0;
153  int Victory_type = 0;
154  char pPlayer1Name[32] = "";
155  char pPlayer2Name[32] = "";
156  char force_am_exit = 0;
157  char GameOver = 0;
158  char force_redraw_1 = 0;
159  char prev_mouse_left = 0;
161  char check_exit = 0;
162  char bGameInProgress = 0;
163 };
164 
166 extern ArcomageCard pCards[87];
167 extern void set_stru1_field_8_InArcomage(int inValue);
168 
176 };
177 
183  float gravity_acc;
191 };
192 
194  static explosion_effect_struct *New();
195 
196  int Free();
198  int Clear(char stop_init, char wipe);
199  int UpdateEffect();
200  int IsEffectActive();
201 
228 };
229 
230 #define DECK_SIZE 108
231 
232 struct ArcomageDeck {
233  char name[32];
234  char cardsInUse[DECK_SIZE];
235  int cards_IDs[DECK_SIZE];
236 };
237 
239  char have_effect = 0;
240  char effect_sign = 0;
241  char _pad_2 = 0;
242  char _pad_3 = 0;
246 };
uint16_t
unsigned __int16 uint16_t
Definition: SDL_config.h:37
AcromageCardOnTable
Definition: Arcomage.h:83
ArcomageGame::pSprites
Texture * pSprites
Definition: Arcomage.h:150
ArcomageGame::mouse_y
int mouse_y
Definition: Arcomage.h:137
ArcomageGame::field_3
char field_3
Definition: Arcomage.h:132
explosion_effect_struct::unused_acc_2
int unused_acc_2
Definition: Arcomage.h:216
ArcomageCard::to_enemy_bricks2
char to_enemy_bricks2
Definition: Arcomage.h:64
ArcomageCard::to_pl_enm_magic_lvl
char to_pl_enm_magic_lvl
Definition: Arcomage.h:42
ArcomageCard::compare_param
int compare_param
Definition: Arcomage.h:20
explosion_effect_struct::num_init_per_cycle
float num_init_per_cycle
Definition: Arcomage.h:213
effect_params_struct::create_per_frame
float create_per_frame
Definition: Arcomage.h:185
explosion_effect_struct::gravity_unshift
float gravity_unshift
Definition: Arcomage.h:212
ArcomagePlayer::pPlayerName
char pPlayerName[32]
Definition: Arcomage.h:92
ArcomageCard::to_pl_enm_quarry_lvl2
char to_pl_enm_quarry_lvl2
Definition: Arcomage.h:70
explosion_effect_struct::unused_param_9
char unused_param_9
Definition: Arcomage.h:227
ArcomageCard::to_pl_enm_tower
char to_pl_enm_tower
Definition: Arcomage.h:49
GUIFont
Definition: GUIFont.h:8
ArcomageGame::force_am_exit
char force_am_exit
Definition: Arcomage.h:156
ArcomageCard::to_pl_enm_wall2
char to_pl_enm_wall2
Definition: Arcomage.h:77
effect_params_struct::unused_param_3
int unused_param_3
Definition: Arcomage.h:182
ArcomageGame::OnMouseClick
static void OnMouseClick(char right_left, bool bDown)
Definition: Arcomage.cpp:196
ArcomageCard::to_pl_enm_magic_lvl2
char to_pl_enm_magic_lvl2
Definition: Arcomage.h:71
ArcomageGame::ArcomageGame
ArcomageGame()
Definition: Arcomage.h:115
ArcomageCard::to_enemy_gems
char to_enemy_gems
Definition: Arcomage.h:36
ArcomageCard::to_player_buildings
char to_player_buildings
Definition: Arcomage.h:29
ArcomageCard::to_enemy_zoo_lvl2
char to_enemy_zoo_lvl2
Definition: Arcomage.h:63
ArcomageCard::to_player_quarry_lvl2
char to_player_quarry_lvl2
Definition: Arcomage.h:52
ArcomageCard::to_pl_enm_bricks
char to_pl_enm_bricks
Definition: Arcomage.h:44
ArcomageGame::pBlit_Copy_pixels
uint16_t * pBlit_Copy_pixels
Definition: Arcomage.h:144
ArcomageCard::to_enemy_gems2
char to_enemy_gems2
Definition: Arcomage.h:65
ArcomageGame::mouse_left
char mouse_left
Definition: Arcomage.h:138
ArcomageCard::to_enemy_beasts2
char to_enemy_beasts2
Definition: Arcomage.h:66
Point.h
spark_point_struct::spark_position
Point spark_position
Definition: Arcomage.h:171
ArcomagePlayer::zoo_level
int zoo_level
Definition: Arcomage.h:98
ArcomageCard
Definition: Arcomage.h:9
ArcomageCard::to_pl_enm_buildings
char to_pl_enm_buildings
Definition: Arcomage.h:47
ArcomageCard::needed_quarry_level
char needed_quarry_level
Definition: Arcomage.h:13
Texture
Definition: Texture.h:4
ArcomagePlayer::wall_height
int wall_height
Definition: Arcomage.h:95
ArcomageCard::needed_magic_level
char needed_magic_level
Definition: Arcomage.h:14
explosion_effect_struct::max_lifespan
int max_lifespan
Definition: Arcomage.h:218
params
const GLfloat * params
Definition: SDL_opengl_glext.h:374
ArcomageCard::to_player_wall
char to_player_wall
Definition: Arcomage.h:30
explosion_effect_struct::unused_param_3
int unused_param_3
Definition: Arcomage.h:211
ArcomageGame::pPlayer2Name
char pPlayer2Name[32]
Definition: Arcomage.h:155
ArcomageCard::to_player_beasts2
char to_player_beasts2
Definition: Arcomage.h:57
ArcomageCard::to_player_tower
char to_player_tower
Definition: Arcomage.h:31
ArcomagePlayer::tower_height
int tower_height
Definition: Arcomage.h:94
sPoint
Definition: Point.h:11
effect_params_struct::unused_param_1
int unused_param_1
Definition: Arcomage.h:180
ArcomageCard::needed_bricks
char needed_bricks
Definition: Arcomage.h:16
ArcomageCard::to_pl_enm_beasts2
char to_pl_enm_beasts2
Definition: Arcomage.h:75
effect_params_struct
Definition: Arcomage.h:178
ArcomageCard::needed_beasts
char needed_beasts
Definition: Arcomage.h:18
ArcomageCard::to_player_wall2
char to_player_wall2
Definition: Arcomage.h:59
ArcomageCard::to_pl_enm_quarry_lvl
char to_pl_enm_quarry_lvl
Definition: Arcomage.h:41
ArcomageGame::Loop
static void Loop()
Definition: Arcomage.cpp:896
ArcomageCard::field_6B
char field_6B
Definition: Arcomage.h:80
pArcomageGame
ArcomageGame * pArcomageGame
Definition: Arcomage.cpp:97
ArcomageGame::Victory_type
int Victory_type
Definition: Arcomage.h:153
explosion_effect_struct::unused_param_6
int unused_param_6
Definition: Arcomage.h:221
ArcomageCard::to_enemy_tower2
char to_enemy_tower2
Definition: Arcomage.h:69
spark_point_struct::spark_y_unshift
int spark_y_unshift
Definition: Arcomage.h:173
ArcomageCard::to_enemy_quarry_lvl2
char to_enemy_quarry_lvl2
Definition: Arcomage.h:61
ArcomageCard::to_pl_enm_zoo_lvl
char to_pl_enm_zoo_lvl
Definition: Arcomage.h:43
Image.h
effect_params_struct::unused_acc_1
float unused_acc_1
Definition: Arcomage.h:186
ArcomageGame::pfntComic
GUIFont * pfntComic
Definition: Arcomage.h:145
ArcomageGame::field_1
char field_1
Definition: Arcomage.h:130
ArcomageGame::pGameBackground
Texture * pGameBackground
Definition: Arcomage.h:149
ArcomageCard::to_player_buildings2
char to_player_buildings2
Definition: Arcomage.h:58
spark_point_struct::spark_remaining_life
int spark_remaining_life
Definition: Arcomage.h:170
explosion_effect_struct::New
static explosion_effect_struct * New()
Definition: Arcomage.cpp:208
ArcomageCard::to_enemy_beasts
char to_enemy_beasts
Definition: Arcomage.h:37
y
EGLSurface EGLint EGLint y
Definition: SDL_egl.h:1596
ArcomageCard::to_enemy_wall
char to_enemy_wall
Definition: Arcomage.h:39
ArcomageGame::PlaySound
static void PlaySound(unsigned int event_id)
Definition: Arcomage.cpp:493
am_effects_struct
Definition: Arcomage.h:238
ArcomageDeck::cardsInUse
char cardsInUse[DECK_SIZE]
Definition: Arcomage.h:234
am_effects_struct::have_effect
char have_effect
Definition: Arcomage.h:239
ArcomageGame::GameOver
char GameOver
Definition: Arcomage.h:157
ArcomageCard::to_player_magic_lvl
char to_player_magic_lvl
Definition: Arcomage.h:24
ArcomagePlayer::cards_at_hand
int cards_at_hand[10]
Definition: Arcomage.h:102
ArcomageCard::to_player_zoo_lvl2
char to_player_zoo_lvl2
Definition: Arcomage.h:54
ArcomageGame::MsgLoop
static bool MsgLoop(int a1, ArcomageGame_InputMSG *a2)
Definition: Arcomage.cpp:570
effect_params_struct::spark_array_size
int spark_array_size
Definition: Arcomage.h:184
ArcomageCard::needed_gems
char needed_gems
Definition: Arcomage.h:17
am_effects_struct::eff_params
effect_params_struct eff_params
Definition: Arcomage.h:243
ArcomageGame::pfntArrus
GUIFont * pfntArrus
Definition: Arcomage.h:146
ArcomageGame::field_39
char field_39
Definition: Arcomage.h:139
ArcomageGame::field_54
int field_54
Definition: Arcomage.h:148
ArcomageGame_InputMSG::field_4
int field_4
Definition: Arcomage.h:108
ArcomageCard::to_pl_enm_gems
char to_pl_enm_gems
Definition: Arcomage.h:45
x
EGLSurface EGLint x
Definition: SDL_egl.h:1596
ArcomageGame::field_3B
char field_3B
Definition: Arcomage.h:141
AcromageCardOnTable::table_pos
Point table_pos
Definition: Arcomage.h:86
ArcomageGame::prev_mouse_left
char prev_mouse_left
Definition: Arcomage.h:159
ArcomageGame::field_50
int field_50
Definition: Arcomage.h:147
ArcomageCard::to_enemy_quarry_lvl
char to_enemy_quarry_lvl
Definition: Arcomage.h:32
ArcomageCard::to_enemy_magic_lvl
char to_enemy_magic_lvl
Definition: Arcomage.h:33
effect_params_struct::max_lifespan
int max_lifespan
Definition: Arcomage.h:189
ArcomageCard::to_enemy_buildings2
char to_enemy_buildings2
Definition: Arcomage.h:67
explosion_effect_struct::start_x_min
int start_x_min
Definition: Arcomage.h:205
ArcomageGame::uGameWinner
int uGameWinner
Definition: Arcomage.h:152
ArcomageCard::to_pl_enm_gems2
char to_pl_enm_gems2
Definition: Arcomage.h:74
ArcomagePlayer::IsHisTurn
int IsHisTurn
Definition: Arcomage.h:93
ArcomageCard::to_player_tower2
char to_player_tower2
Definition: Arcomage.h:60
explosion_effect_struct::unused_param_7
int unused_param_7
Definition: Arcomage.h:222
ArcomageCard::to_enemy_wall2
char to_enemy_wall2
Definition: Arcomage.h:68
ArcomageGame::mouse_right
char mouse_right
Definition: Arcomage.h:140
ArcomageGame::stru1
ArcomageGame_InputMSG stru1
Definition: Arcomage.h:134
explosion_effect_struct::min_lifespan
int min_lifespan
Definition: Arcomage.h:217
explosion_effect_struct::StartFill
int StartFill(effect_params_struct *params)
Definition: Arcomage.cpp:233
ArcomageGame::LoadSprites
static bool LoadSprites()
Definition: Arcomage.cpp:581
ArcomageCard::slot
int slot
Definition: Arcomage.h:11
ArcomageCard::to_player_zoo_lvl
char to_player_zoo_lvl
Definition: Arcomage.h:25
ArcomageCard::field_30
char field_30
Definition: Arcomage.h:21
explosion_effect_struct::Free
int Free()
Definition: Arcomage.cpp:223
effect_params_struct::gravity_acc
float gravity_acc
Definition: Arcomage.h:183
ArcomageGame::event_timer_time
int event_timer_time
Definition: Arcomage.h:151
ArcomageCard::to_pl_enm_wall
char to_pl_enm_wall
Definition: Arcomage.h:48
ArcomageGame::prev_mouse_right
char prev_mouse_right
Definition: Arcomage.h:160
ArcomageCard::to_pl_enm_beasts
char to_pl_enm_beasts
Definition: Arcomage.h:46
ArcomagePlayer::quarry_level
int quarry_level
Definition: Arcomage.h:96
ArcomageCard::to_player_magic_lvl2
char to_player_magic_lvl2
Definition: Arcomage.h:53
effect_params_struct::min_lifespan
int min_lifespan
Definition: Arcomage.h:188
ArcomageCard::to_pl_enm_bricks2
char to_pl_enm_bricks2
Definition: Arcomage.h:73
Rect
Definition: Rect.h:3
ArcomageCard::to_player_bricks
char to_player_bricks
Definition: Arcomage.h:26
explosion_effect_struct::unused_param_2
int unused_param_2
Definition: Arcomage.h:210
explosion_effect_struct::start_x_max
int start_x_max
Definition: Arcomage.h:207
ArcomagePlayer::resource_beasts
int resource_beasts
Definition: Arcomage.h:101
ArcomageCard::to_player_gems2
char to_player_gems2
Definition: Arcomage.h:56
ArcomageCard::to_enemy_magic_lvl2
char to_enemy_magic_lvl2
Definition: Arcomage.h:62
ArcomageCard::to_enemy_tower
char to_enemy_tower
Definition: Arcomage.h:40
ArcomageGame::OnMouseMove
static void OnMouseMove(int x, int y)
Definition: Arcomage.cpp:203
AcromageCardOnTable::discarded
int discarded
Definition: Arcomage.h:85
ArcomagePlayer::card_shift
sPoint card_shift[10]
Definition: Arcomage.h:103
explosion_effect_struct::start_y_min
int start_y_min
Definition: Arcomage.h:208
ArcomageGame::GetCardRect
static void GetCardRect(unsigned int uCardID, Rect *pCardRect)
Definition: Arcomage.cpp:2077
explosion_effect_struct::unused_param_1
int unused_param_1
Definition: Arcomage.h:209
ArcomageCard::field_6A
char field_6A
Definition: Arcomage.h:79
am_effects_struct::explosion_eff
explosion_effect_struct * explosion_eff
Definition: Arcomage.h:244
ArcomageCard::to_pl_enm_buildings2
char to_pl_enm_buildings2
Definition: Arcomage.h:76
ArcomageGame::field_4
int field_4
Definition: Arcomage.h:133
ArcomageCard::can_be_discarded
bool can_be_discarded
Definition: Arcomage.h:19
am_effects_struct::effect_sparks
spark_point_struct effect_sparks[150]
Definition: Arcomage.h:245
explosion_effect_struct::params_filled
char params_filled
Definition: Arcomage.h:225
am_effects_struct::effect_sign
char effect_sign
Definition: Arcomage.h:240
ArcomageCard::to_player_gems
char to_player_gems
Definition: Arcomage.h:27
spark_point_struct::spark_x_unshift
int spark_x_unshift
Definition: Arcomage.h:172
ArcomageGame::pSpritesPixels
uint16_t * pSpritesPixels
Definition: Arcomage.h:143
explosion_effect_struct::UpdateEffect
int UpdateEffect()
Definition: Arcomage.cpp:274
explosion_effect_struct::unused_param_8
char unused_param_8
Definition: Arcomage.h:226
ArcomageGame::check_exit
char check_exit
Definition: Arcomage.h:161
ArcomageCard::to_player_quarry_lvl
char to_player_quarry_lvl
Definition: Arcomage.h:23
explosion_effect_struct::mem_signature
int mem_signature
Definition: Arcomage.h:202
ArcomageGame_InputMSG::am_input_type
int am_input_type
Definition: Arcomage.h:107
Rect.h
spark_point_struct
Definition: Arcomage.h:169
ArcomageCard::to_player_bricks2
char to_player_bricks2
Definition: Arcomage.h:55
explosion_effect_struct::effect_active
char effect_active
Definition: Arcomage.h:224
ArcomageGame_InputMSG
Definition: Arcomage.h:106
ArcomageCard::to_enemy_buildings
char to_enemy_buildings
Definition: Arcomage.h:38
spark_point_struct::spark_x_speed
int spark_x_speed
Definition: Arcomage.h:174
name
EGLImageKHR EGLint * name
Definition: SDL_egl.h:1497
ArcomageCard::needed_zoo_level
char needed_zoo_level
Definition: Arcomage.h:15
explosion_effect_struct::start_y_max
int start_y_max
Definition: Arcomage.h:206
Texture.h
ArcomageCard::to_enemy_zoo_lvl
char to_enemy_zoo_lvl
Definition: Arcomage.h:34
ArcomagePlayer::resource_bricks
int resource_bricks
Definition: Arcomage.h:99
ArcomageDeck
Definition: Arcomage.h:232
am_effects_struct::_pad_3
char _pad_3
Definition: Arcomage.h:242
ArcomageCard::to_pl_enm_zoo_lvl2
char to_pl_enm_zoo_lvl2
Definition: Arcomage.h:72
explosion_effect_struct::unused_acc_1
int unused_acc_1
Definition: Arcomage.h:215
ArcomageGame::mouse_x
int mouse_x
Definition: Arcomage.h:136
ArcomageGame::field_0
char field_0
Definition: Arcomage.h:129
ArcomagePlayer::magic_level
int magic_level
Definition: Arcomage.h:97
spark_point_struct::spark_y_speed
int spark_y_speed
Definition: Arcomage.h:175
ArcomageCard::field_4D
char field_4D
Definition: Arcomage.h:50
explosion_effect_struct::prev_init_overflow
float prev_init_overflow
Definition: Arcomage.h:214
ArcomageDeck::cards_IDs
int cards_IDs[DECK_SIZE]
Definition: Arcomage.h:235
explosion_effect_struct::unused_param_4
int unused_param_4
Definition: Arcomage.h:219
pCards
ArcomageCard pCards[87]
Definition: ArcomageCards.cpp:3
explosion_effect_struct::spark_array_ptr
spark_point_struct * spark_array_ptr
Definition: Arcomage.h:223
ArcomageCard::pCardName
char pCardName[32]
Definition: Arcomage.h:10
explosion_effect_struct
Definition: Arcomage.h:193
effect_params_struct::unused_param_2
int unused_param_2
Definition: Arcomage.h:181
ArcomageGame::PrepareArcomage
static void PrepareArcomage()
Definition: Arcomage.cpp:2982
Point
Definition: Point.h:3
ArcomageCard::card_resource_type
char card_resource_type
Definition: Arcomage.h:12
ArcomageCard::draw_extra_card_count
char draw_extra_card_count
Definition: Arcomage.h:22
set_stru1_field_8_InArcomage
void set_stru1_field_8_InArcomage(int inValue)
Definition: Arcomage.cpp:3081
ArcomageGame::bGameInProgress
char bGameInProgress
Definition: Arcomage.h:162
ArcomageCard::to_enemy_bricks
char to_enemy_bricks
Definition: Arcomage.h:35
ArcomageCard::to_player_beasts
char to_player_beasts
Definition: Arcomage.h:28
ArcomageGame::field_2
char field_2
Definition: Arcomage.h:131
am_effects_struct::_pad_2
char _pad_2
Definition: Arcomage.h:241
effect_params_struct::unused_acc_2
float unused_acc_2
Definition: Arcomage.h:187
ArcomageGame
Definition: Arcomage.h:114
explosion_effect_struct::remaining_sparks_to_init
int remaining_sparks_to_init
Definition: Arcomage.h:204
ArcomagePlayer
Definition: Arcomage.h:91
effect_params_struct::sparks_array
spark_point_struct * sparks_array
Definition: Arcomage.h:190
ArcomageGame_InputMSG::am_input_key
int am_input_key
Definition: Arcomage.h:109
explosion_effect_struct::unused_param_5
int unused_param_5
Definition: Arcomage.h:220
explosion_effect_struct::IsEffectActive
int IsEffectActive()
Definition: Arcomage.cpp:333
AcromageCardOnTable::hide_anim_pos
Point hide_anim_pos
Definition: Arcomage.h:88
AcromageCardOnTable::uCardId
int uCardId
Definition: Arcomage.h:84
ArcomageCard::to_pl_enm_tower2
char to_pl_enm_tower2
Definition: Arcomage.h:78
ArcomageGame::force_redraw_1
char force_redraw_1
Definition: Arcomage.h:158
effect_params_struct::effect_area
Rect effect_area
Definition: Arcomage.h:179
ArcomagePlayer::resource_gems
int resource_gems
Definition: Arcomage.h:100
AcromageCardOnTable::hide_anim_spd
sPoint hide_anim_spd
Definition: Arcomage.h:87
ArcomageCard::can_draw_extra_card2
char can_draw_extra_card2
Definition: Arcomage.h:51
ArcomageGame::pPlayer1Name
char pPlayer1Name[32]
Definition: Arcomage.h:154
explosion_effect_struct::Clear
int Clear(char stop_init, char wipe)
Definition: Arcomage.cpp:258
explosion_effect_struct::spark_array_size
int spark_array_size
Definition: Arcomage.h:203