source: golgotha/src/golg/resources.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 12 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 5.0 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#ifndef G1_RESOURCES_HH
10#define G1_RESOURCES_HH
11
12#include "math/num_type.hh"
13#include "math/point.hh"
14
15
16class i4_image_class;
17class i4_cursor_class;
18class i4_string_manager_class;
19class i4_str;
20class i4_const_str;
21
22enum {
23  G1_DEFAULT_CURSOR,
24  G1_SELECT_CURSOR,
25  G1_MOVE_CURSOR,
26  G1_TARGET_CURSOR,
27  G1_FOLLOW_MODE_CURSOR,
28  G1_X_CURSOR,
29  G1_TOTAL_CURSORS 
30};
31
32
33class g1_resource_class    // these are all defined in constants.res
34{
35public:
36  struct rect
37  {
38    sw16 x1,y1,x2,y2;
39  };
40private:
41  i4_string_manager_class *use;
42
43  void g_float(i4_float &f, char *res_name);
44  void g_cursor(i4_cursor_class *&c, char *res_name, int big, int color);
45  void g_point(i4_3d_point_class &p, char *res_name);
46  void g_w32(w32 &x, char *res_name);
47  void g_sw32(sw32 &x, char *res_name);
48  void g_w16(w16 &x, char *res_name);
49  void g_sw16(sw16 &x, char *res_name);
50  void g_rect(rect &r, char *res_name);
51public:
52
53
54  enum { IMAGE_MONEY_0,
55         IMAGE_MONEY_9=9,
56         IMAGE_MONEY_DOLLAR,
57         IMAGE_MONEY_COMMA,
58         
59         OPTIONS_OPEN,
60         OPTIONS_VIS_LOW,
61         OPTIONS_VIS_MEDIUM,
62         OPTIONS_VIS_HIGH,
63         OPTIONS_SOUND,
64         OPTIONS_SOUND_3D,
65         OPTIONS_SHADOWS_OFF,
66         OPTIONS_SHADOWS_ON,
67         OPTIONS_INTERLACE,
68         OPTIONS_DOUBLEPIXEL,
69         OPTIONS_PIXEL_NORMAL,
70         OPTIONS_GAME_SPEED
71       };
72
73  int t_build_context_helps;
74  i4_const_str *build_context_help;     // fetched from res/g1.res
75
76  int t_images;
77  i4_image_class **images;
78
79
80  enum dflags {
81    DRAW_BUILDINGS=1,
82    DRAW_GROUND=2,
83    DRAW_OBJECTS=4,
84    DRAW_SPRITES=8,
85    DRAW_CLEAR=16
86  } ;
87  enum { DRAW_ALL =
88         DRAW_BUILDINGS |
89         DRAW_GROUND  |
90         DRAW_OBJECTS |
91         DRAW_SPRITES };
92
93  w8 draw_flags;
94  w8 render_window_expand_mode;
95
96
97  i4_str *username;  // for net games
98
99
100  i4_cursor_class *big_cursors[G1_TOTAL_CURSORS];
101  i4_cursor_class *small_cursors[G1_TOTAL_CURSORS];
102
103  i4_float recoil_factor,
104    recoil_gravity;
105
106  i4_float sink_rate;
107  sw16 water_damage;
108
109  i4_float player_turn_speed,
110    strafe_turn_speed,
111    player_accel,
112    player_strafe_accel,
113    player_max_speed,
114    player_max_strafe_speed,
115    player_stop_friction,
116    player_roll_speed,
117    player_roll_max,
118    player_turret_radius,
119    player_fire_slop_angle,
120    bullet_speed;
121
122
123  rect health_window, chain_gun_window,
124    main_gun_window, missile_window, options_window, lives,
125    mouse_scroll, balance,
126    build_buttons;
127 
128
129  i4_float camera_dist,
130    camera_angle,
131    startegy_camera_angle,
132    startegy_camera_dist,
133    strategy_camera_turn_angle,
134    follow_camera_dist,
135    follow_camera_height,
136    follow_camera_rotation;
137
138  float lod_switch_dist,
139        lod_disappear_dist,
140         skimpy_details_dist;
141   
142
143  i4_3d_point_class player_top_attach;
144  i4_3d_point_class rocket_tank_top_attach;
145  i4_3d_point_class turret_muzzle_attach, turret_top_attach;
146  i4_3d_point_class supergun_muzzle_attach;
147  i4_3d_point_class repairer_tip_attach;
148
149  i4_float repairer_boom_offset;
150
151  i4_float gravity,
152    damping_friction,
153    damping_fraction,
154    ln_damping_friction;
155
156  enum radius_mode_type { VIEW_LOW, VIEW_MEDIUM, VIEW_FAR } radius_mode;
157  i4_float view_radii[3];  // contains the three fields, near, medium, and far
158  i4_float visual_radius() { return view_radii[radius_mode]; }
159
160
161  w16 net_hostname_x, net_hostname_y,
162    net_username_x, net_username_y,
163    net_found_x1, net_found_x2, net_found_y,
164    net_start_x, net_start_y;
165 
166  w16 net_find_port, net_udp_port;
167
168  w16 small_health_added, large_health_added;
169  w16 small_bullets_added, large_bullets_added;
170  w16 small_missiles_added, large_missiles_added;
171  w16 small_money_added, large_money_added;
172  w16 small_chain_added, large_chain_added;
173
174   
175  sw16 compass_x, compass_y;
176
177  w16 stat_pad_size_x, stat_pad_size_y;
178  sw16 stat_pad_start_x, stat_pad_start_y,
179    stat_pad_step_x, stat_pad_step_y;
180   
181
182  // temporary vehicle values
183  w32 supertank_machine_gun_damage,
184      supertank_turret_damage,
185      supertank_guided_missile_damage;
186   
187
188
189  w32 disable_a3d;
190  w32 disable_sound;
191  w32 action_strategy_ticks_to_switch;
192
193  w32 lock_cheat;
194  i4_bool paused;      // if the game is paused
195
196  void load();
197  void cleanup();
198};
199
200extern g1_resource_class g1_resources;
201
202
203inline i4_float g1_near_z_range() { return 0.01f; }
204inline i4_float g1_far_z_range() { return 100.0; }
205
206#endif
Note: See TracBrowser for help on using the repository browser.