resources.hh 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. #ifndef G1_RESOURCES_HH
  9. #define G1_RESOURCES_HH
  10. #include "math/num_type.hh"
  11. #include "math/point.hh"
  12. class i4_image_class;
  13. class i4_cursor_class;
  14. class i4_string_manager_class;
  15. class i4_str;
  16. class i4_const_str;
  17. enum {
  18. G1_DEFAULT_CURSOR,
  19. G1_SELECT_CURSOR,
  20. G1_MOVE_CURSOR,
  21. G1_TARGET_CURSOR,
  22. G1_FOLLOW_MODE_CURSOR,
  23. G1_X_CURSOR,
  24. G1_TOTAL_CURSORS
  25. };
  26. class g1_resource_class // these are all defined in constants.res
  27. {
  28. public:
  29. struct rect
  30. {
  31. sw16 x1,y1,x2,y2;
  32. };
  33. private:
  34. i4_string_manager_class *use;
  35. void g_float(i4_float &f, char *res_name);
  36. void g_cursor(i4_cursor_class *&c, char *res_name, int big, int color);
  37. void g_point(i4_3d_point_class &p, char *res_name);
  38. void g_w32(w32 &x, char *res_name);
  39. void g_sw32(sw32 &x, char *res_name);
  40. void g_w16(w16 &x, char *res_name);
  41. void g_sw16(sw16 &x, char *res_name);
  42. void g_rect(rect &r, char *res_name);
  43. public:
  44. enum { IMAGE_MONEY_0,
  45. IMAGE_MONEY_9=9,
  46. IMAGE_MONEY_DOLLAR,
  47. IMAGE_MONEY_COMMA,
  48. OPTIONS_OPEN,
  49. OPTIONS_VIS_LOW,
  50. OPTIONS_VIS_MEDIUM,
  51. OPTIONS_VIS_HIGH,
  52. OPTIONS_SOUND,
  53. OPTIONS_SOUND_3D,
  54. OPTIONS_SHADOWS_OFF,
  55. OPTIONS_SHADOWS_ON,
  56. OPTIONS_INTERLACE,
  57. OPTIONS_DOUBLEPIXEL,
  58. OPTIONS_PIXEL_NORMAL,
  59. OPTIONS_GAME_SPEED
  60. };
  61. int t_build_context_helps;
  62. i4_const_str *build_context_help; // fetched from res/g1.res
  63. int t_images;
  64. i4_image_class **images;
  65. enum dflags {
  66. DRAW_BUILDINGS=1,
  67. DRAW_GROUND=2,
  68. DRAW_OBJECTS=4,
  69. DRAW_SPRITES=8,
  70. DRAW_CLEAR=16
  71. } ;
  72. enum { DRAW_ALL =
  73. DRAW_BUILDINGS |
  74. DRAW_GROUND |
  75. DRAW_OBJECTS |
  76. DRAW_SPRITES };
  77. w8 draw_flags;
  78. w8 render_window_expand_mode;
  79. i4_str *username; // for net games
  80. i4_cursor_class *big_cursors[G1_TOTAL_CURSORS];
  81. i4_cursor_class *small_cursors[G1_TOTAL_CURSORS];
  82. i4_float recoil_factor,
  83. recoil_gravity;
  84. i4_float sink_rate;
  85. sw16 water_damage;
  86. i4_float player_turn_speed,
  87. strafe_turn_speed,
  88. player_accel,
  89. player_strafe_accel,
  90. player_max_speed,
  91. player_max_strafe_speed,
  92. player_stop_friction,
  93. player_roll_speed,
  94. player_roll_max,
  95. player_turret_radius,
  96. player_fire_slop_angle,
  97. bullet_speed;
  98. rect health_window, chain_gun_window,
  99. main_gun_window, missile_window, options_window, lives,
  100. mouse_scroll, balance,
  101. build_buttons;
  102. i4_float camera_dist,
  103. camera_angle,
  104. startegy_camera_angle,
  105. startegy_camera_dist,
  106. strategy_camera_turn_angle,
  107. follow_camera_dist,
  108. follow_camera_height,
  109. follow_camera_rotation;
  110. float lod_switch_dist,
  111. lod_disappear_dist,
  112. skimpy_details_dist;
  113. i4_3d_point_class player_top_attach;
  114. i4_3d_point_class rocket_tank_top_attach;
  115. i4_3d_point_class turret_muzzle_attach, turret_top_attach;
  116. i4_3d_point_class supergun_muzzle_attach;
  117. i4_3d_point_class repairer_tip_attach;
  118. i4_float repairer_boom_offset;
  119. i4_float gravity,
  120. damping_friction,
  121. damping_fraction,
  122. ln_damping_friction;
  123. enum radius_mode_type { VIEW_LOW, VIEW_MEDIUM, VIEW_FAR } radius_mode;
  124. i4_float view_radii[3]; // contains the three fields, near, medium, and far
  125. i4_float visual_radius() { return view_radii[radius_mode]; }
  126. w16 net_hostname_x, net_hostname_y,
  127. net_username_x, net_username_y,
  128. net_found_x1, net_found_x2, net_found_y,
  129. net_start_x, net_start_y;
  130. w16 net_find_port, net_udp_port;
  131. w16 small_health_added, large_health_added;
  132. w16 small_bullets_added, large_bullets_added;
  133. w16 small_missiles_added, large_missiles_added;
  134. w16 small_money_added, large_money_added;
  135. w16 small_chain_added, large_chain_added;
  136. sw16 compass_x, compass_y;
  137. w16 stat_pad_size_x, stat_pad_size_y;
  138. sw16 stat_pad_start_x, stat_pad_start_y,
  139. stat_pad_step_x, stat_pad_step_y;
  140. // temporary vehicle values
  141. w32 supertank_machine_gun_damage,
  142. supertank_turret_damage,
  143. supertank_guided_missile_damage;
  144. w32 disable_a3d;
  145. w32 disable_sound;
  146. w32 action_strategy_ticks_to_switch;
  147. w32 lock_cheat;
  148. i4_bool paused; // if the game is paused
  149. void load();
  150. void cleanup();
  151. };
  152. extern g1_resource_class g1_resources;
  153. inline i4_float g1_near_z_range() { return 0.01f; }
  154. inline i4_float g1_far_z_range() { return 100.0; }
  155. #endif