diff --git a/code/cfilearchiver/cfilearchiver.cpp b/code/cfilearchiver/cfilearchiver.cpp index 4df4a8f232..fbf54d4dcf 100644 --- a/code/cfilearchiver/cfilearchiver.cpp +++ b/code/cfilearchiver/cfilearchiver.cpp @@ -340,7 +340,7 @@ void print_instructions() exit(0); } -// we end up #include'ing SDL.h which on Windows and Mac will redfine main() which is something +// we end up #include'ing SDL.h which on Windows and Mac will redefine main() which is something // that we don't want since we don't actually link against SDL, this solves the problem... #ifdef main #undef main diff --git a/code/cfileextractor/cfileextractor.cpp b/code/cfileextractor/cfileextractor.cpp index 607341aa69..f4084c507d 100644 --- a/code/cfileextractor/cfileextractor.cpp +++ b/code/cfileextractor/cfileextractor.cpp @@ -422,7 +422,7 @@ void help() printf("\n"); } -// we end up #include'ing SDL.h which on Windows and Mac will redfine main() which is something +// we end up #include'ing SDL.h which on Windows and Mac will redefine main() which is something // that we don't want since we don't actually link against SDL, this solves the problem... #ifdef main #undef main diff --git a/code/controlconfig/controlsconfig.cpp b/code/controlconfig/controlsconfig.cpp index c39a738dc4..16cd6a3431 100644 --- a/code/controlconfig/controlsconfig.cpp +++ b/code/controlconfig/controlsconfig.cpp @@ -38,7 +38,7 @@ #define NUM_SYSTEM_KEYS 14 #define NUM_BUTTONS 19 -#define NUM_TABS 4 +#define NUM_TABS 4 // coordinate indicies #define CONTROL_X_COORD 0 @@ -59,28 +59,28 @@ char* Conflict_background_bitmap_mask_fname[GR_NUM_RESOLUTIONS] = { // control list area int Control_list_coords[GR_NUM_RESOLUTIONS][4] = { { - 32, 58, 198, 259 // GR_640 + 32, 58, 198, 259 // GR_640 }, { - 32, 94, 904, 424 // GR_1024 + 32, 94, 904, 424 // GR_1024 } }; // width of the control name section of the list int Control_list_ctrl_w[GR_NUM_RESOLUTIONS] = { - 350, // GR_640 + 350, // GR_640 600 // GR_1024 }; // x start position of the binding area section of the list int Control_list_key_x[GR_NUM_RESOLUTIONS] = { - 397, // GR_640 + 397, // GR_640 712 // GR_1024 }; // width of the binding area section of the list int Control_list_key_w[GR_NUM_RESOLUTIONS] = { - 198, // GR_640 + 198, // GR_640 230 // GR_1024 }; @@ -120,7 +120,7 @@ int Conflict_stamp = -1; int Conflict_bright = 0; #define LIST_BUTTONS_MAX 42 -#define JOY_AXIS 0x80000 +#define JOY_AXIS 0x80000 static int Num_cc_lines; static struct { @@ -140,18 +140,13 @@ struct config_item_undo { config_item Control_config_backup[CCFG_MAX]; -#ifdef GRAVIS_OEM -int Axis_map_to[] = { JOY_X_AXIS, JOY_Y_AXIS, JOY_RX_AXIS, JOY_Z_AXIS, -1 }; -int Axis_map_to_defaults[] = { JOY_X_AXIS, JOY_Y_AXIS, JOY_RX_AXIS, JOY_Z_AXIS, -1 }; -#else int Axis_map_to[] = { JOY_X_AXIS, JOY_Y_AXIS, JOY_RX_AXIS, -1, -1 }; int Axis_map_to_defaults[] = { JOY_X_AXIS, JOY_Y_AXIS, JOY_RX_AXIS, -1, -1 }; -#endif // all this stuff is localized/externalized #define NUM_AXIS_TEXT 6 #define NUM_MOUSE_TEXT 5 -#define NUM_MOUSE_AXIS_TEXT 2 +#define NUM_MOUSE_AXIS_TEXT 2 #define NUM_INVERT_TEXT 2 char *Joy_axis_action_text[NUM_JOY_AXIS_ACTIONS]; char *Joy_axis_text[NUM_AXIS_TEXT]; @@ -188,24 +183,24 @@ static struct { int Conflicts_axes[NUM_JOY_AXIS_ACTIONS]; #define TARGET_TAB 0 -#define SHIP_TAB 1 +#define SHIP_TAB 1 #define WEAPON_TAB 2 -#define COMPUTER_TAB 3 +#define COMPUTER_TAB 3 #define SCROLL_UP_BUTTON 4 #define SCROLL_DOWN_BUTTON 5 #define ALT_TOGGLE 6 -#define SHIFT_TOGGLE 7 +#define SHIFT_TOGGLE 7 #define INVERT_AXIS 8 #define CANCEL_BUTTON 9 #define UNDO_BUTTON 10 -#define RESET_BUTTON 11 +#define RESET_BUTTON 11 #define SEARCH_MODE 12 #define BIND_BUTTON 13 #define HELP_BUTTON 14 #define ACCEPT_BUTTON 15 #define CLEAR_OTHER_BUTTON 16 #define CLEAR_ALL_BUTTON 17 -#define CLEAR_BUTTON 18 +#define CLEAR_BUTTON 18 ui_button_info CC_Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { { // GR_640 @@ -390,11 +385,6 @@ int control_config_detect_axis() return axis; } -int control_config_valid_action(int n) -{ - return 1; -} - void control_config_conflict_check() { int i, j, a, b, c, shift = -1, alt = -1; @@ -419,29 +409,25 @@ void control_config_conflict_check() } for (i=0; i= 0) { - c = 0; - a = Control_config[i].key_id; - b = Control_config[j].key_id; - if (a == b) { - Conflicts[i].key = j; - Conflicts[j].key = i; - Conflicts_tabs[ Control_config[i].tab ] = 1; - Conflicts_tabs[ Control_config[j].tab ] = 1; - } - } - - if ((Control_config[i].joy_id >= 0) && (Control_config[i].joy_id == Control_config[j].joy_id)) { - Conflicts[i].joy = j; - Conflicts[j].joy = i; - Conflicts_tabs[ Control_config[i].tab ] = 1; - Conflicts_tabs[ Control_config[j].tab ] = 1; - } + for (j=i+1; j= 0) { + c = 0; + a = Control_config[i].key_id; + b = Control_config[j].key_id; + if (a == b) { + Conflicts[i].key = j; + Conflicts[j].key = i; + Conflicts_tabs[ Control_config[i].tab ] = 1; + Conflicts_tabs[ Control_config[j].tab ] = 1; } } + + if ((Control_config[i].joy_id >= 0) && (Control_config[i].joy_id == Control_config[j].joy_id)) { + Conflicts[i].joy = j; + Conflicts[j].joy = i; + Conflicts_tabs[ Control_config[i].tab ] = 1; + Conflicts_tabs[ Control_config[j].tab ] = 1; + } } } @@ -468,7 +454,7 @@ void control_config_list_prepare() Num_cc_lines = y = z = 0; while (z < CCFG_MAX) { - if ((Control_config[z].tab == Tab) && control_config_valid_action(z)) { + if ((Control_config[z].tab == Tab)) { k = Control_config[z].key_id; j = Control_config[z].joy_id; @@ -478,7 +464,6 @@ void control_config_list_prepare() Cc_lines[Num_cc_lines].label = Control_config[z].text; } - Cc_lines[Num_cc_lines].cc_index = z; Cc_lines[Num_cc_lines++].y = y; y += font_height + 2; diff --git a/code/cryptstring/cryptstring.cpp b/code/cryptstring/cryptstring.cpp index 18c61686eb..c0cddcd726 100644 --- a/code/cryptstring/cryptstring.cpp +++ b/code/cryptstring/cryptstring.cpp @@ -15,7 +15,7 @@ #include "globalincs/crypt.h" -// we end up #include'ing SDL.h which on Windows and Mac will redfine main() which is something +// we end up #include'ing SDL.h which on Windows and Mac will redefine main() which is something // that we don't want since we don't actually link against SDL, this solves the problem... #ifdef main #undef main diff --git a/code/physics/physics.cpp b/code/physics/physics.cpp index 5a2d0d7d6b..53baceefe1 100644 --- a/code/physics/physics.cpp +++ b/code/physics/physics.cpp @@ -26,7 +26,6 @@ // defines for physics functions #define MAX_TURN_LIMIT 0.2618f // about 15 degrees -#define ROT_DEBUG #define ROTVEL_TOL 0.1 // Amount of rotvel is decreased if over cap #define ROTVEL_CAP 14.0 // Rotational velocity cap for live objects #define DEAD_ROTVEL_CAP 16.3 // Rotational velocity cap for dead objects @@ -42,8 +41,6 @@ #define WEAPON_SHAKE_TIME 500 // ms (0.5 sec) viewer shake time after hit by weapon (implemented via afterburner shake) #define SPECIAL_WARP_T_CONST 0.651 // special warp time constant (loose 99 % of excess speed in 3 sec) -#define PHYS_DEBUG // check if (vel > 500) or (displacement in one frame > 350) - void update_reduced_damp_timestamp( physics_info *pi, float impulse ); float velocity_ramp (float v_in, float v_goal, float time_const, float t); float glide_ramp (float v_in, float v_goal, float ramp_time_const, float accel_mult, float t); @@ -183,13 +180,6 @@ void physics_sim_rot(matrix * orient, physics_info * pi, float sim_time ) apply_physics( rotdamp, pi->desired_rotvel.xyz.y, pi->rotvel.xyz.y, sim_time, &new_vel.xyz.y, NULL ); apply_physics( rotdamp, pi->desired_rotvel.xyz.z, pi->rotvel.xyz.z, sim_time, &new_vel.xyz.z, NULL ); - /* -#ifdef ROT_DEBUG - if (check_rotvel_limit( pi )) { - nprintf(("Physics", "rotvel reset in physics_sim_rot\n")); - } -#endif -*/ Assert(is_valid_vec(&new_vel)); pi->rotvel = new_vel; @@ -397,14 +387,6 @@ void physics_sim_vel(vec3d * position, physics_info * pi, float sim_time, matrix // update world position from local to world coords using orient vec3d world_disp; vm_vec_unrotate (&world_disp, &local_disp, orient); -#ifdef PHYS_DEBUG - // check for excess velocity or translation - // GET DaveA. - if ( (Game_mode & GM_IN_MISSION) && (Game_mode & GM_NORMAL) ) { - // Assert( (sim_time > 0.5f) || (vm_vec_mag_squared(&pi->vel) < 500*500) ); - // Assert( (sim_time > 0.5f) || (vm_vec_mag_squared(&world_disp) < 350*350) ); - } -#endif vm_vec_add2 (position, &world_disp); // update world velocity @@ -835,12 +817,6 @@ void physics_apply_whack(vec3d *impulse, vec3d *pos, physics_info *pi, matrix *o vm_vec_scale ( &delta_rotvel, (float) ROTVEL_WHACK_CONST ); vm_vec_add2( &pi->rotvel, &delta_rotvel ); -#ifdef ROT_DEBUG - if (check_rotvel_limit( pi )) { - nprintf(("Physics", "rotvel reset in physics_apply_whack\n")); - } -#endif - //mprintf(("Whack: %7.3f %7.3f %7.3f\n", pi->rotvel.xyz.x, pi->rotvel.xyz.y, pi->rotvel.xyz.z)); // instant whack on the velocity @@ -1050,14 +1026,6 @@ void physics_apply_shock(vec3d *direction_vec, float pressure, physics_info *pi, vm_vec_normalize(&pi->vel); vm_vec_scale(&pi->vel, (float)RESET_SHIP_SPEED); } - -#ifdef ROT_DEBUG - if (check_rotvel_limit( pi )) { - nprintf(("Physics", "rotvel reset in physics_apply_shock\n")); - } -#endif - - // ramped velocity is now affected by collision } // ---------------------------------------------------------------------------- @@ -1086,12 +1054,6 @@ void physics_collide_whack( vec3d *impulse, vec3d *world_delta_rotvel, physics_i // vm_vec_scale( &body_delta_rotvel, (float) ROTVEL_COLLIDE_WHACK_CONST ); vm_vec_add2( &pi->rotvel, &body_delta_rotvel ); -#ifdef ROT_DEBUG - if (check_rotvel_limit( pi )) { - nprintf(("Physics", "rotvel reset in physics_collide_whack\n")); - } -#endif - update_reduced_damp_timestamp( pi, vm_vec_mag(impulse) ); // find time for shake from weapon to end diff --git a/code/scramble/scramble.cpp b/code/scramble/scramble.cpp index 24c39e9b2f..8763598c5b 100644 --- a/code/scramble/scramble.cpp +++ b/code/scramble/scramble.cpp @@ -293,7 +293,7 @@ void print_instructions() } -// we end up #includ'ing SDL.h which on Windows and Mac will redfine main() which is something +// we end up #includ'ing SDL.h which on Windows and Mac will redefine main() which is something // that we don't want since we don't actually link against SDL, this solves the problem... #ifdef main #undef main