diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5c6d2a077..097663de1 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,5 +1,9 @@ D2X-Rebirth Changelog +20080323 +-------- +main/kconfig.c, main/laser.c, main/menu.c, main/newmenu.c, main/playsave.c: Added lock status for mouse axis weapon cycling because of scaled mouse delta; Due to player feedback (any my opinion) making homer turn rate smaller to make them a bit harder to dodge; Preventing write of player data while Demo playback; Small code cleanup and corrections + 20080322 -------- INSTALL.txt, SConstruct: make compile instructions clearer for Windows and Mac users, for Mac OS X don't use Sharepath when using SConstruct diff --git a/main/kconfig.c b/main/kconfig.c index 1648ead43..cda70c967 100644 --- a/main/kconfig.c +++ b/main/kconfig.c @@ -1531,82 +1531,67 @@ void controls_read_all() #ifdef D2X_KEYS //--------- Read primary weapon select ------------- - if (!Player_is_dead && !Automap_flag) + if (!Player_is_dead && !Automap_flag && !(keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT])) { - { - int d2x_joystick_state[10]; + int d2x_joystick_state[10]; - for(i=0;i<10;i++) - d2x_joystick_state[i] = joy_get_button_state(kc_d2x[i*2+1].value); + for(i=0;i<10;i++) + d2x_joystick_state[i] = joy_get_button_state(kc_d2x[i*2+1].value); - //----------------Weapon 1---------------- - if(key_down_count(kc_d2x[0].value) || - (joy_get_button_state(kc_d2x[1].value) && - (d2x_joystick_state[0]!=d2x_joystick_ostate[0]) ) ) - if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[0].value >= 2 && kc_d2x[0].value <= 11))) // this (and the following statements) prevents to select weapon if guide-bot shortcut has done and weapon key is mapped from 0 to 9 or Automap is active - do_weapon_select(0,0); - //----------------Weapon 2---------------- - if(key_down_count(kc_d2x[2].value) || - (joy_get_button_state(kc_d2x[3].value) && - (d2x_joystick_state[1]!=d2x_joystick_ostate[1]) ) ) - if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[2].value >= 2 && kc_d2x[2].value <= 11))) - do_weapon_select(1,0); - //----------------Weapon 3---------------- - if(key_down_count(kc_d2x[4].value) || - (joy_get_button_state(kc_d2x[5].value) && - (d2x_joystick_state[2]!=d2x_joystick_ostate[2]) ) ) - if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[4].value >= 2 && kc_d2x[4].value <= 11))) - do_weapon_select(2,0); - //----------------Weapon 4---------------- - if(key_down_count(kc_d2x[6].value) || - (joy_get_button_state(kc_d2x[7].value) && - (d2x_joystick_state[3]!=d2x_joystick_ostate[3]) ) ) - if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[6].value >= 2 && kc_d2x[6].value <= 11))) - do_weapon_select(3,0); - //----------------Weapon 5---------------- - if(key_down_count(kc_d2x[8].value) || - (joy_get_button_state(kc_d2x[9].value) && - (d2x_joystick_state[4]!=d2x_joystick_ostate[4]) ) ) - if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[8].value >= 2 && kc_d2x[8].value <= 11))) - do_weapon_select(4,0); - - //--------- Read secondary weapon select ---------- - //----------------Weapon 6---------------- - if(key_down_count(kc_d2x[10].value) || - (joy_get_button_state(kc_d2x[11].value) && - (d2x_joystick_state[5]!=d2x_joystick_ostate[5]) ) ) - if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[10].value >= 2 && kc_d2x[10].value <= 11))) - do_weapon_select(0,1); - //----------------Weapon 7---------------- - if(key_down_count(kc_d2x[12].value) || - (joy_get_button_state(kc_d2x[13].value) && - (d2x_joystick_state[6]!=d2x_joystick_ostate[6]) ) ) - if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[12].value >= 2 && kc_d2x[12].value <= 11))) - do_weapon_select(1,1); - //----------------Weapon 8---------------- - if(key_down_count(kc_d2x[14].value) || - (joy_get_button_state(kc_d2x[15].value) && - (d2x_joystick_state[7]!=d2x_joystick_ostate[7]) ) ) - if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[14].value >= 2 && kc_d2x[14].value <= 11))) - do_weapon_select(2,1); - //----------------Weapon 9---------------- - if(key_down_count(kc_d2x[16].value) || - (joy_get_button_state(kc_d2x[17].value) && - (d2x_joystick_state[8]!=d2x_joystick_ostate[8]) ) ) - if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[16].value >= 2 && kc_d2x[16].value <= 11))) - do_weapon_select(3,1); - //----------------Weapon 0---------------- - if(key_down_count(kc_d2x[18].value) || - (joy_get_button_state(kc_d2x[19].value) && - (d2x_joystick_state[9]!=d2x_joystick_ostate[9]) ) ) - if (!((keyd_pressed[KEY_LSHIFT] || keyd_pressed[KEY_RSHIFT]) && (kc_d2x[18].value >= 2 && kc_d2x[18].value <= 11))) - do_weapon_select(4,1); - memcpy(d2x_joystick_ostate,d2x_joystick_state,10*sizeof(int)); - } - //end this section addition - VR - + //----------------Weapon 1---------------- + if(key_down_count(kc_d2x[0].value) || + (joy_get_button_state(kc_d2x[1].value) && + (d2x_joystick_state[0]!=d2x_joystick_ostate[0]) ) ) + do_weapon_select(0,0); + //----------------Weapon 2---------------- + if(key_down_count(kc_d2x[2].value) || + (joy_get_button_state(kc_d2x[3].value) && + (d2x_joystick_state[1]!=d2x_joystick_ostate[1]) ) ) + do_weapon_select(1,0); + //----------------Weapon 3---------------- + if(key_down_count(kc_d2x[4].value) || + (joy_get_button_state(kc_d2x[5].value) && + (d2x_joystick_state[2]!=d2x_joystick_ostate[2]) ) ) + do_weapon_select(2,0); + //----------------Weapon 4---------------- + if(key_down_count(kc_d2x[6].value) || + (joy_get_button_state(kc_d2x[7].value) && + (d2x_joystick_state[3]!=d2x_joystick_ostate[3]) ) ) + do_weapon_select(3,0); + //----------------Weapon 5---------------- + if(key_down_count(kc_d2x[8].value) || + (joy_get_button_state(kc_d2x[9].value) && + (d2x_joystick_state[4]!=d2x_joystick_ostate[4]) ) ) + do_weapon_select(4,0); + //--------- Read secondary weapon select ---------- + //----------------Weapon 6---------------- + if(key_down_count(kc_d2x[10].value) || + (joy_get_button_state(kc_d2x[11].value) && + (d2x_joystick_state[5]!=d2x_joystick_ostate[5]) ) ) + do_weapon_select(0,1); + //----------------Weapon 7---------------- + if(key_down_count(kc_d2x[12].value) || + (joy_get_button_state(kc_d2x[13].value) && + (d2x_joystick_state[6]!=d2x_joystick_ostate[6]) ) ) + do_weapon_select(1,1); + //----------------Weapon 8---------------- + if(key_down_count(kc_d2x[14].value) || + (joy_get_button_state(kc_d2x[15].value) && + (d2x_joystick_state[7]!=d2x_joystick_ostate[7]) ) ) + do_weapon_select(2,1); + //----------------Weapon 9---------------- + if(key_down_count(kc_d2x[16].value) || + (joy_get_button_state(kc_d2x[17].value) && + (d2x_joystick_state[8]!=d2x_joystick_ostate[8]) ) ) + do_weapon_select(3,1); + //----------------Weapon 0---------------- + if(key_down_count(kc_d2x[18].value) || + (joy_get_button_state(kc_d2x[19].value) && + (d2x_joystick_state[9]!=d2x_joystick_ostate[9]) ) ) + do_weapon_select(4,1); + memcpy(d2x_joystick_ostate,d2x_joystick_state,10*sizeof(int)); }//end "if (!Player_is_dead)" - WraithX #endif @@ -1924,6 +1909,8 @@ void controls_read_all() // done so that dead players can't move if (!Player_is_dead) { + static int mouse_pricycle_lock=0, mouse_seccycle_lock=0; + //----------- Read forward_thrust_time ------------- // From keyboard... @@ -1991,8 +1978,9 @@ void controls_read_all() Controls.cycle_primary_count+=joy_get_button_down_cnt(kc_joystick[28].value); if ((use_joystick)&&(kc_joystick[47].value < 255 )) Controls.cycle_primary_count+=joy_get_button_down_cnt(kc_joystick[47].value); - if ( (use_mouse)&&(kc_mouse[28].value < 255) ) + if ( (use_mouse)&&(kc_mouse[28].value < 255) && !mouse_pricycle_lock) Controls.cycle_primary_count = kc_mouse[29].value?(mouse_axis[kc_mouse[28].value]<0):(mouse_axis[kc_mouse[28].value]>0); + mouse_pricycle_lock=mouse_axis[kc_mouse[28].value]; //--------Read Cycle Secondary Key------------------ @@ -2005,8 +1993,9 @@ void controls_read_all() Controls.cycle_secondary_count+=joy_get_button_down_cnt(kc_joystick[29].value); if ((use_joystick)&&(kc_joystick[48].value < 255 )) Controls.cycle_secondary_count+=joy_get_button_down_cnt(kc_joystick[48].value); - if ( (use_mouse)&&(kc_mouse[28].value < 255) ) + if ( (use_mouse)&&(kc_mouse[28].value < 255) && !mouse_seccycle_lock) Controls.cycle_secondary_count = kc_mouse[29].value?(mouse_axis[kc_mouse[28].value]>0):(mouse_axis[kc_mouse[28].value]<0); + mouse_seccycle_lock=mouse_axis[kc_mouse[28].value]; //--------Read Toggle Bomb key---------------------- diff --git a/main/laser.c b/main/laser.c index ba5df0fa8..726911733 100644 --- a/main/laser.c +++ b/main/laser.c @@ -1587,7 +1587,7 @@ void Laser_do_weapon_sequence(object *obj) { fix turn_radius; - turn_radius = 0x0024 * F1_0; + turn_radius = 0x0018 * F1_0; vm_vec_sub(&vector_to_object, &Objects[track_goal].pos, &obj->pos); diff --git a/main/menu.c b/main/menu.c index 33012ecf4..b46f5dcc3 100644 --- a/main/menu.c +++ b/main/menu.c @@ -72,7 +72,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "gauges.h" #include "powerup.h" #include "strutil.h" -#include "reorder.h" #ifdef EDITOR #include "editor/editor.h" @@ -140,6 +139,8 @@ void do_ip_manual_join_menu(); int UDPConnectManual(char *addr); #endif //NETWORK extern void newmenu_close(); +extern void ReorderPrimary(); +extern void ReorderSecondary(); //returns the number of demo files on the disk int newdemo_count_demos(); diff --git a/main/newmenu.c b/main/newmenu.c index 6a1ac0484..8fe749317 100644 --- a/main/newmenu.c +++ b/main/newmenu.c @@ -848,11 +848,7 @@ int newmenu_do4( char * title, char * subtitle, int nitems, newmenu_item * item, #ifdef NEWMENU_MOUSE mouse_state = omouse_state = 0; - - if (!MenuReordering) - { - newmenu_show_cursor(); - } + newmenu_show_cursor(); #endif mprintf ((0,"Set to true!\n")); @@ -897,8 +893,7 @@ int newmenu_do4( char * title, char * subtitle, int nitems, newmenu_item * item, #ifdef NEWMENU_MOUSE newmenu_show_cursor(); // possibly hidden omouse_state = mouse_state; - if (!MenuReordering) - mouse_state = mouse_button_state(0); + mouse_state = mouse_button_state(0); #endif //see if redbook song needs to be restarted @@ -1409,8 +1404,7 @@ int newmenu_do4( char * title, char * subtitle, int nitems, newmenu_item * item, item[i].y-=(LINE_SPACING*ScrollOffset); draw_item( &bg, &item[i], (i==choice && !all_text),TinyMode ); #ifdef NEWMENU_MOUSE - if (!MenuReordering) - newmenu_show_cursor(); + newmenu_show_cursor(); #endif item[i].y+=(LINE_SPACING*ScrollOffset); diff --git a/main/playsave.c b/main/playsave.c index 4f2d4600c..9ae0f6bb4 100644 --- a/main/playsave.c +++ b/main/playsave.c @@ -65,6 +65,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "strio.h" #include "physfsx.h" #include "vers_id.h" +#include "newdemo.h" #define SAVE_FILE_ID MAKE_SIG('D','P','L','R') @@ -174,7 +175,24 @@ int read_player_d2x(char *filename) cfgets(line,50,f); word=splitword(line,':'); strupr(word); - if (strstr(word,"MOUSE")) + if (strstr(word,"JOYSTICK")) + { + d_free(word); + cfgets(line,50,f); + word=splitword(line,'='); + strupr(word); + + while(!strstr(word,"END") && !PHYSFS_eof(f)) + { + if(!strcmp(word,"DEADZONE")) + sscanf(line,"%i",&joy_deadzone); + d_free(word); + cfgets(line,50,f); + word=splitword(line,'='); + strupr(word); + } + } + else if (strstr(word,"MOUSE")) { d_free(word); cfgets(line,50,f); @@ -195,27 +213,6 @@ int read_player_d2x(char *filename) strupr(word); } } - else if (strstr(word,"JOYSTICK")) - { - d_free(word); - cfgets(line,50,f); - word=splitword(line,'='); - strupr(word); - - while(!strstr(word,"END") && !PHYSFS_eof(f)) - { - if(!strcmp(word,"DEADZONE")) - { - int tmp; - sscanf(line,"%d",&tmp); - joy_deadzone = tmp; - } - d_free(word); - cfgets(line,50,f); - word=splitword(line,'='); - strupr(word); - } - } else if (strstr(word,"END") || PHYSFS_eof(f)) { Stop=1; @@ -298,7 +295,7 @@ ubyte control_type_dos,control_type_win; //read in the player's saved games. returns errno (0 == no error) int read_player_file() { - char filename[FILENAME_LEN]; + char filename[32]; PHYSFS_file *file; int id, i; short player_file_version; @@ -564,6 +561,9 @@ int write_player_file() PHYSFS_file *file; int i; + if ( Newdemo_state == ND_STATE_PLAYBACK ) + return -1; + WriteConfigFile(); sprintf(filename, GameArg.SysUsePlayersDir? "Players/%.8s.plx" : "%.8s.plx", Players[Player_num].callsign); diff --git a/main/reorder.h b/main/reorder.h deleted file mode 100644 index 1a202fd8e..000000000 --- a/main/reorder.h +++ /dev/null @@ -1,16 +0,0 @@ -/* $Id: reorder.h,v 1.1.1.1 2006/03/17 19:55:10 zicodxx Exp $ */ - -/* - * - * User interface+data for weapon autoselect order selection - * - */ - -#ifndef _REORDER_H -#define _REORDER_H - -/* These are defined in weapon.c */ -extern void ReorderPrimary(); -extern void ReorderSecondary(); - -#endif /* _REORDER_H */