altEngine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
quake3.h
Go to the documentation of this file.
1 #include "include.h"
2 
3 #ifndef QUAKE3_H
4 #define QUAKE3_H
5 
6 
7 #define MODEL_WEAPON_GAUNTLET 19
8 #define MODEL_WEAPON_MACHINEGUN 20
9 #define MODEL_WEAPON_SHOTGUN 21
10 #define MODEL_WEAPON_GRENADE 22
11 #define MODEL_WEAPON_ROCKET 23
12 #define MODEL_WEAPON_LIGHTNING 24
13 #define MODEL_WEAPON_RAILGUN 25
14 #define MODEL_WEAPON_PLASMA 26
15 
16 class Quake3 : public BaseGame
17 {
18 public:
19  Quake3();
20 
21  void init(Engine *engine);
22  void step(int frame_step);
23  void destroy();
24 
25 
26  void check_triggers(Player *player, Entity *ent, int self, vector<Entity *> &entity_list);
27  void check_projectiles(Player *player, Entity *ent, Entity *owner, int self, int proj_id, vector<Entity *> &entity_list);
28  void check_func(Player *player, Entity *ent, int self, vector<Entity *> &entity_list);
29 
30  void render_hud(double last_frametime);
31  void draw_name(Entity *entity, Menu &menu, matrix4 &real_projection, int ent_num);
32  void draw_line(Entity *a, Entity *b, Menu &menu, vec3 &color);
33  void transform_3d_2d(vec3 &position, vec3 &pos2d, matrix4 &projection);
34 
35  void handle_weapons(Player &player, input_t &input, int self, bool client);
36 
37  void handle_gauntlet(Player &player, int self, bool client);
38  void handle_plasma(Player &player, int self, bool client);
39  void handle_rocketlauncher(Player &player, int self, bool client);
40  void handle_grenade(Player &player, int self, bool client);
41  void handle_lightning(Player &player, int self, bool client);
42  void handle_railgun(Player &player, int self, bool client);
43  void handle_machinegun(Player &player, int self, bool client);
44  void handle_shotgun(Player &player, int self, bool client);
45  void handle_gibs(Player &player);
46  void create_crosshair();
47  void draw_crosshair();
48  void draw_flash(Player &player);
49  void add_decal(vec3 &start, Frame &camera_frame, net_ent_t nettype, Model &decal_model, float offset, bool explode, int explode_timer);
50 
51  void create_icon();
52  void draw_icon(float scale, int index, float x = 0.0f, float y = 0.0f, float z = 0.0f);
53  void load_icon();
54  void map_model(Entity &ent);
55  void load_sounds(Audio &audio, vector<wave_t> &snd_wave);
56  void handle_model_trigger(vector<Entity *> &entity_list, Entity *ent, int self);
57  void check_target(vector<Entity *> &entity_list, Entity *ent, Entity *target, int self);
58 
59  void make_dynamic_ent(net_ent_t item, int ent_id);
60  void handle_player(int index, input_t &input);
61  void handle_frags_left(Player &player);
62  void player_died(int index);
63  void drop_weapon(int index);
64  void drop_powerup(vec3 &position, char *model, char *action);
65  team_t get_team();
66 
67  int bot_get_path(int item, int self, int *nav_array, path_t &path);
68  int bot_follow(path_t &path, int *nav_array, Entity *entity, float speed_scale);
69 
70  void load(gametype_t gametype);
71  void load_models(Graphics &gfx);
72  void load_q1_models(Graphics &gfx);
73  void setup_func(vector<Entity *> &entity_list, Bsp &q3map);
74  void unload();
75  void add_player(vector<Entity *> &entity_list, playertype_t type, int &ent_id, char *player_name);
76  void console(int self, char *cmd, Menu &menu, vector<Entity *> &entity_list);
77  void endgame(char *winner);
78  void get_state(serverdata_t *data);
79  void set_state(serverdata_t *data);
80 
81  void handle_func_platform(Entity *ent);
82  void handle_func_bobbing(Entity *ent);
83  void handle_func_train(Entity *ent);
84  int add_train_path(Entity *original, Entity *ref, Entity *target);
85 
86  unsigned int weapon_switch_timer;
87 
88  ~Quake3();
89 
90 private:
92  bool blink;
95 
96  int crosshair_tex[10];
100 
101  unsigned int icon_vbo;
102  bool warmup;
103  bool hold_fire;
104  bool faceicon;
105 
106 
107 // unsigned int timelimit;
108  unsigned int round_time;
109  unsigned int warmup_time;
111 
112  unsigned int snd_table[512];
113 
114 
115  unsigned int win_timer;
116  char win_msg[128];
117 
118  unsigned int num_player;
119  unsigned int num_player_blue;
120  unsigned int num_player_red;
121  unsigned int spectator_timer;
122 
123 
129 };
130 
131 #endif
132