mirror of
https://github.com/Cesarus85/ringfall-mjolnir-vr.git
synced 2026-10-23 06:00:25 +02:00
281 lines
5.4 KiB
C
281 lines
5.4 KiB
C
/*
|
|
GAME_ENGINE.H
|
|
|
|
header included in hcex build.
|
|
*/
|
|
|
|
#ifndef __GAME_ENGINE_H
|
|
#define __GAME_ENGINE_H
|
|
#pragma once
|
|
|
|
/* ---------- constants */
|
|
|
|
enum
|
|
{
|
|
_game_engine_allow_dynamic_lighting_bit = 0,
|
|
_game_engine_allow_integrated_lights_bit,
|
|
_game_engine_disable_infinite_grenades_bit,
|
|
};
|
|
|
|
enum
|
|
{
|
|
_game_variant_draw_object_in_motion_sensor_bit = 0,
|
|
_game_variant_infinite_grenades_bit = 2,
|
|
_game_variant_no_shields_bit,
|
|
_game_variant_always_invisible_bit,
|
|
};
|
|
|
|
/* ---------- macros */
|
|
|
|
/* ---------- structures */
|
|
|
|
struct game_globals;
|
|
union real_argb_color;
|
|
|
|
struct game_variant
|
|
{
|
|
short variant_index;
|
|
byte unused0[0x16];
|
|
long engine_type;
|
|
boolean has_teams;
|
|
byte unused1[3];
|
|
unsigned long flags;
|
|
byte unused24[0x14];
|
|
long maximum_lives;
|
|
byte unused3C[0x2C];
|
|
};
|
|
|
|
typedef char verify_game_variant_size[sizeof(struct game_variant) == 0x68 ? 1 : -1];
|
|
|
|
struct game_engine
|
|
{
|
|
char const *name;
|
|
long type;
|
|
void (*dispose)(void);
|
|
boolean (*initialize_for_new_map)(void);
|
|
void (*dispose_from_old_map)(void);
|
|
void (*player_added)(long player_index);
|
|
void (*game_ending)(void);
|
|
void (*game_starting)(void);
|
|
void (*statistics_append)(void);
|
|
void (*handle_client_message)(void);
|
|
void (*handle_server_message)(void);
|
|
void (*unknown2C)(void);
|
|
void (*post_rasterize_objects)(void);
|
|
void (*unknown34[5])(void);
|
|
long (*get_player_score)(
|
|
long player_index,
|
|
boolean team_score);
|
|
void (*unknown4C[3])(void);
|
|
boolean (*allow_pick_up)(
|
|
long unit_index,
|
|
long weapon_index);
|
|
void (*player_damaged_player)(
|
|
long damaging_player_index,
|
|
long dead_player_index,
|
|
long damage_type);
|
|
void (*unknown60[3])(void);
|
|
void (*prespawn_player_update)(
|
|
long player_index);
|
|
void (*unknown70)(void);
|
|
void (*team_index_override)(void);
|
|
void (*unknown78)(void);
|
|
boolean (*test_flag)(
|
|
long flag);
|
|
boolean (*test_trait)(
|
|
long trait,
|
|
long value);
|
|
long (*did_player_win)(
|
|
long player_index);
|
|
};
|
|
|
|
typedef char verify_game_engine_size[sizeof(struct game_engine) == 0x88 ? 1 : -1];
|
|
|
|
/* ---------- prototypes/GAME_ENGINE.C */
|
|
|
|
void game_engine_playlist_initialize(
|
|
void);
|
|
|
|
long game_globals_get_weapon(
|
|
struct game_globals *game_globals,
|
|
long weapon_list_index);
|
|
|
|
void game_engine_playlist_begin(
|
|
void);
|
|
|
|
boolean game_engine_get_current_stage(
|
|
struct game_variant *variant,
|
|
char *map_name);
|
|
|
|
long list_index_to_weapon_definition_index(
|
|
long weapon_list_index);
|
|
|
|
void game_engine_state_message(
|
|
long player_index,
|
|
long state_message,
|
|
long state_message_player_index);
|
|
|
|
void game_engine_player_depower_active_camo(
|
|
long player_index);
|
|
|
|
long game_engine_get_team_score(
|
|
long team_index);
|
|
|
|
long players_in_game(
|
|
void);
|
|
|
|
float get_blink_alpha(
|
|
void);
|
|
|
|
long game_engine_player_get_team_index(
|
|
long player_index);
|
|
|
|
void game_engine_update_player_always_invis(
|
|
long player_index);
|
|
|
|
boolean game_engine_player_has_flag(
|
|
long player_index);
|
|
|
|
void game_show_score(
|
|
long player_index,
|
|
long score);
|
|
|
|
void get_postgame_hilite_colors(
|
|
union real_argb_color *winner_color,
|
|
union real_argb_color *normal_color,
|
|
union real_argb_color *hilite_color);
|
|
|
|
boolean game_engine_running(
|
|
void);
|
|
|
|
boolean game_engine_force_single_screen(
|
|
void);
|
|
|
|
void game_engine_dispose(
|
|
void);
|
|
|
|
void game_engine_dispose_from_old_map(
|
|
void);
|
|
|
|
void game_engine_game_ending(
|
|
void);
|
|
|
|
void game_engine_game_starting(
|
|
void);
|
|
|
|
void game_engine_post_rasterize_objects(
|
|
void);
|
|
|
|
boolean game_engine_can_score(
|
|
void);
|
|
|
|
boolean game_engine_allow_pick_up(
|
|
long unit_index,
|
|
long weapon_index);
|
|
|
|
boolean game_engine_test_flag(
|
|
long flag);
|
|
|
|
boolean game_engine_test_trait(
|
|
long trait,
|
|
long value);
|
|
|
|
void game_engine_prespawn_player_update(
|
|
long player_index);
|
|
|
|
long game_engine_did_player_win(
|
|
long player_index);
|
|
|
|
struct game_variant *game_engine_get_variant(
|
|
void);
|
|
|
|
boolean game_engine_get_goal_in_use(
|
|
short goal_index);
|
|
|
|
boolean game_engine_has_teams(
|
|
void);
|
|
|
|
boolean game_engine_allow_pause(
|
|
void);
|
|
|
|
boolean game_engine_allow_dynamic_lighting(
|
|
long object_index);
|
|
|
|
boolean game_engine_infinite_grenades(
|
|
long player_index);
|
|
|
|
boolean game_engine_has_shield(
|
|
long player_index);
|
|
|
|
boolean game_engine_draw_object_in_motion_sensor(
|
|
void);
|
|
|
|
boolean game_engine_should_end_game(
|
|
void);
|
|
|
|
void game_engine_clear_goal_position(
|
|
short goal_index);
|
|
|
|
long get_flag_definition_index(
|
|
void);
|
|
|
|
long get_ball_definition_index(
|
|
void);
|
|
|
|
void game_engine_override_map_name(
|
|
char const *map_name);
|
|
|
|
void game_engine_override_game_variant(
|
|
struct game_variant const *variant);
|
|
|
|
void game_engine_switch_to_postgame(
|
|
void);
|
|
|
|
void game_engine_load_stage(
|
|
char const *map_name);
|
|
|
|
void game_engine_end_game(
|
|
void);
|
|
|
|
void game_engine_player_damaged_player(
|
|
long damaging_player_index,
|
|
long dead_player_index,
|
|
long damage_type);
|
|
|
|
boolean game_engine_player_is_out_of_lives(
|
|
long player_index);
|
|
|
|
boolean game_engine_hud_draw_messages(
|
|
long player_index);
|
|
|
|
boolean game_engine_force_autopickup(
|
|
long unit_index,
|
|
long weapon_index);
|
|
|
|
void game_engine_play_multiplayer_sound(
|
|
long sound_index);
|
|
|
|
long game_engine_remap_object_definition(long definition_index);
|
|
|
|
long game_engine_remap_vehicle(long vehicle_definition_index);
|
|
long game_engine_remap_equipment(long equipment_definition_index);
|
|
long game_engine_remap_weapon(long weapon_definition_index);
|
|
|
|
|
|
boolean game_engine_allow_integrated_lights(
|
|
long object_index);
|
|
|
|
void game_engine_player_killed(
|
|
long killing_player_index,
|
|
long damage_type,
|
|
long dead_player_index,
|
|
boolean friendly_fire);
|
|
|
|
/* ---------- globals */
|
|
|
|
extern struct game_engine *game_engine;
|
|
|
|
/* ---------- public code */
|
|
|
|
#endif // __GAME_ENGINE_H
|