From 2daffdeecf9912d4c8f7095a91cbfa2ecf12b2e1 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Sat, 11 Oct 2003 09:28:38 +0000 Subject: [PATCH] lots of shareware and oem fixes --- ChangeLog | 7 +++++++ main/cntrlcen.c | 25 +++++++++++----------- main/endlevel.c | 11 +++++----- main/gamecntl.c | 18 +++++++++------- main/gamerend.c | 25 +++++++++++----------- main/gameseq.c | 26 ++++++++++++++--------- main/gauges.c | 12 +++++------ main/kmatrix.c | 32 +++++++++++++++------------- main/menu.c | 13 ++++++------ main/mission.h | 5 ++++- main/network.c | 12 +++++------ main/weapon.c | 6 +++--- main/weapon.h | 56 +------------------------------------------------ 13 files changed, 107 insertions(+), 141 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b96a3b9..bd3424fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-10-11 Bradley Bell + + * main/cntrlcen.c, main/endlevel.c, main/gamecntl.c, + main/gamerend.c, main/gameseq.c, main/gauges.c, main/kmatrix.c, + main/menu.c, main/mission.h, main/network.c, main/weapon.c, + main/weapon.h: lots of shareware and oem fixes + 2003-10-10 Bradley Bell * arch/win32/winnet.c: fixed stupid win32 network bug diff --git a/main/cntrlcen.c b/main/cntrlcen.c index b4e7b9f9..667394af 100644 --- a/main/cntrlcen.c +++ b/main/cntrlcen.c @@ -1,4 +1,4 @@ -/* $Id: cntrlcen.c,v 1.11 2003-10-10 09:36:34 btb Exp $ */ +/* $Id: cntrlcen.c,v 1.12 2003-10-11 09:28:38 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -109,7 +109,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: cntrlcen.c,v 1.11 2003-10-10 09:36:34 btb Exp $"; +static char rcsid[] = "$Id: cntrlcen.c,v 1.12 2003-10-11 09:28:38 btb Exp $"; #endif #ifdef WINDOWS @@ -251,16 +251,17 @@ void do_countdown_frame() if (!Control_center_destroyed) return; - #if !defined(D2_OEM) && !defined(SHAREWARE) // get countdown in OEM and SHAREWARE only - // On last level, we don't want a countdown. - if ((Current_mission_num == Builtin_mission_num) && (Current_level_num == Last_level)) - { - if (!(Game_mode & GM_MULTI)) - return; - if (Game_mode & GM_MULTI_ROBOTS) - return; - } - #endif + if (!is_D2_OEM && !is_SHAREWARE) // get countdown in OEM and SHAREWARE only + { + // On last level, we don't want a countdown. + if ((Current_mission_num == Builtin_mission_num) && (Current_level_num == Last_level)) + { + if (!(Game_mode & GM_MULTI)) + return; + if (Game_mode & GM_MULTI_ROBOTS) + return; + } + } // Control center destroyed, rock the player's ship. fc = Countdown_seconds_left; diff --git a/main/endlevel.c b/main/endlevel.c index 2409aa5a..62ad458b 100644 --- a/main/endlevel.c +++ b/main/endlevel.c @@ -1,4 +1,4 @@ -/* $Id: endlevel.c,v 1.17 2003-10-10 09:36:35 btb Exp $ */ +/* $Id: endlevel.c,v 1.18 2003-10-11 09:28:38 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -241,7 +241,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: endlevel.c,v 1.17 2003-10-10 09:36:35 btb Exp $"; +static char rcsid[] = "$Id: endlevel.c,v 1.18 2003-10-11 09:28:38 btb Exp $"; #endif //#define SLEW_ON 1 @@ -434,10 +434,9 @@ int start_endlevel_movie() //Assert(N_MOVIES >= Last_level); //Assert(N_MOVIES_SECRET >= -Last_secret_level); - #ifndef D2_OEM - if (Current_level_num == Last_level) - return 1; //don't play movie - #endif + if (!is_D2_OEM) + if (Current_level_num == Last_level) + return 1; //don't play movie if (Current_level_num > 0) movie_name[2] = movie_table[Current_level_num-1]; diff --git a/main/gamecntl.c b/main/gamecntl.c index 46a082ae..bf07c705 100644 --- a/main/gamecntl.c +++ b/main/gamecntl.c @@ -1,4 +1,4 @@ -/* $Id: gamecntl.c,v 1.21 2003-10-10 09:36:35 btb Exp $ */ +/* $Id: gamecntl.c,v 1.22 2003-10-11 09:28:38 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -2245,13 +2245,16 @@ void FinalCheats(int key) HUD_init_message(TXT_WOWIE_ZOWIE); do_cheat_penalty(); - #ifdef SHAREWARE + if (Piggy_hamfile_version < 3) // SHAREWARE + { Players[Player_num].primary_weapon_flags = ~((1<-1)) { // && (Countdown_seconds_left<127)) { int y; - #if !defined(D2_OEM) && !defined(SHAREWARE) // no countdown on registered only - // On last level, we don't want a countdown. - if ((Current_mission_num == Builtin_mission_num) && (Current_level_num == Last_level)) - { - if (!(Game_mode & GM_MULTI)) - return; - if (Game_mode & GM_MULTI_ROBOTS) - return; - } - #endif + if (!is_D2_OEM && !is_SHAREWARE) // no countdown on registered only + { + // On last level, we don't want a countdown. + if ((Current_mission_num == Builtin_mission_num) && (Current_level_num == Last_level)) + { + if (!(Game_mode & GM_MULTI)) + return; + if (Game_mode & GM_MULTI_ROBOTS) + return; + } + } gr_set_curfont( SMALL_FONT ); gr_set_fontcolor(gr_getcolor(0,63,0), -1 ); diff --git a/main/gameseq.c b/main/gameseq.c index 9f7d6a1b..2b3f4b26 100644 --- a/main/gameseq.c +++ b/main/gameseq.c @@ -1,4 +1,4 @@ -/* $Id: gameseq.c,v 1.29 2003-10-10 09:36:35 btb Exp $ */ +/* $Id: gameseq.c,v 1.30 2003-10-11 09:28:38 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -292,7 +292,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -char gameseq_rcsid[] = "$Id: gameseq.c,v 1.29 2003-10-10 09:36:35 btb Exp $"; +char gameseq_rcsid[] = "$Id: gameseq.c,v 1.30 2003-10-11 09:28:38 btb Exp $"; #endif #ifdef WINDOWS @@ -554,9 +554,8 @@ gameseq_init_network_players() //Int3(); // Not enough positions!! } #endif -#if defined (D2_OEM) - if ((Game_mode & GM_MULTI) && Current_mission_num == Builtin_mission_num && Current_level_num==8) + if (is_D2_OEM && (Game_mode & GM_MULTI) && Current_mission_num == Builtin_mission_num && Current_level_num==8) { for (i=0;ileft,box->top,box->right,box->bot); -#ifndef SHAREWARE - if (Current_display_mode) { + if (Piggy_hamfile_version >= 3 // !SHAREWARE + && Current_display_mode) + { bm=&GameBitmaps[Weapon_info[info_index].hires_picture.index]; PIGGY_PAGE_IN( Weapon_info[info_index].hires_picture ); } else { -#endif bm=&GameBitmaps[Weapon_info[info_index].picture.index]; PIGGY_PAGE_IN( Weapon_info[info_index].picture ); -#ifndef SHAREWARE } -#endif - + Assert(bm != NULL); // PA_DFX (pa_set_frontbuffer_current()); diff --git a/main/kmatrix.c b/main/kmatrix.c index 18ec8ba2..f5882bbe 100644 --- a/main/kmatrix.c +++ b/main/kmatrix.c @@ -1,4 +1,4 @@ -/* $Id: kmatrix.c,v 1.5 2003-10-10 09:36:35 btb Exp $ */ +/* $Id: kmatrix.c,v 1.6 2003-10-11 09:28:38 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -723,8 +723,9 @@ void kmatrix_view(int network) kmatrix_kills_changed = 0; for (i=0; i<4; i++ ) if (joy_get_button_down_cnt(i)>0) - { - #if defined (D2_OEM) + { + if (is_D2_OEM) + { if (Current_level_num==8) { Players[Player_num].connected=0; @@ -739,8 +740,8 @@ void kmatrix_view(int network) longjmp(LeaveGame, 0); return; } - #endif - + } + Players[Player_num].connected=7; if (network) network_send_endlevel_packet(); @@ -749,7 +750,8 @@ void kmatrix_view(int network) for (i=0; i<3; i++ ) if (mouse_button_down_count(i)>0) { - #if defined (D2_OEM) + if (is_D2_OEM) + { if (Current_level_num==8) { Players[Player_num].connected=0; @@ -764,7 +766,7 @@ void kmatrix_view(int network) longjmp(LeaveGame, 0); return; } - #endif + } Players[Player_num].connected=7; if (network) network_send_endlevel_packet(); @@ -783,8 +785,9 @@ void kmatrix_view(int network) done=1; break; } - - #if defined (D2_OEM) + + if (is_D2_OEM) + { if (Current_level_num==8) { Players[Player_num].connected=0; @@ -799,8 +802,8 @@ void kmatrix_view(int network) longjmp(LeaveGame, 0); return; } - #endif - + } + Players[Player_num].connected=7; if (network) network_send_endlevel_packet(); @@ -843,7 +846,8 @@ void kmatrix_view(int network) } if (timer_get_approx_seconds() >= (entry_time+MAX_VIEW_TIME) && Players[Player_num].connected!=7) { - #if defined (D2_OEM) + if (is_D2_OEM) + { if (Current_level_num==8) { Players[Player_num].connected=0; @@ -858,8 +862,8 @@ void kmatrix_view(int network) longjmp(LeaveGame, 0); return; } - #endif - + } + if ((Game_mode & GM_SERIAL) || (Game_mode & GM_MODEM)) { done=1; diff --git a/main/menu.c b/main/menu.c index 19a1ccf2..37843952 100644 --- a/main/menu.c +++ b/main/menu.c @@ -1,4 +1,4 @@ -/* $Id: menu.c,v 1.30 2003-10-10 09:36:35 btb Exp $ */ +/* $Id: menu.c,v 1.31 2003-10-11 09:28:38 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -297,9 +297,8 @@ void create_main_menu(newmenu_item *m, int *menu_choice, int *callers_num_option ADD_ITEM(TXT_CHANGE_PILOTS,MENU_NEW_PLAYER,unused); ADD_ITEM(TXT_VIEW_DEMO,MENU_DEMO_PLAY,0); ADD_ITEM(TXT_VIEW_SCORES,MENU_VIEW_SCORES,KEY_V); - #ifdef SHAREWARE - ADD_ITEM(TXT_ORDERING_INFO,MENU_ORDER_INFO,-1); - #endif + if (cfexist("orderd2.pcx")) /* SHAREWARE */ + ADD_ITEM(TXT_ORDERING_INFO,MENU_ORDER_INFO,-1); ADD_ITEM(TXT_CREDITS,MENU_SHOW_CREDITS,-1); #endif ADD_ITEM(TXT_QUIT,MENU_QUIT,KEY_Q); @@ -396,11 +395,11 @@ void do_option ( int select) gr_palette_fade_out( gr_palette,32,0 ); scores_view(-1); break; - #ifdef SHAREWARE +#if 1 //def SHAREWARE case MENU_ORDER_INFO: show_order_form(); break; - #endif +#endif case MENU_QUIT: #ifdef EDITOR if (! SafetyCheck()) break; @@ -901,7 +900,7 @@ void do_screen_res_menu() if (i >= 3) i++; -#ifdef SHAREWARE +#if 0 //def SHAREWARE if (i > 1) nm_messagebox(TXT_SORRY, 1, TXT_OK, "High resolution modes are\n" diff --git a/main/mission.h b/main/mission.h index 333ed453..9c64efb5 100644 --- a/main/mission.h +++ b/main/mission.h @@ -1,4 +1,4 @@ -/* $Id: mission.h,v 1.11 2003-03-14 09:17:08 btb Exp $ */ +/* $Id: mission.h,v 1.12 2003-10-11 09:28:38 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -109,6 +109,9 @@ extern char *Current_mission_filename,*Current_mission_longname; extern char Builtin_mission_filename[9]; extern int Builtin_mission_hogsize; +#define is_SHAREWARE (Builtin_mission_hogsize == SHAREWARE_MISSION_HOGSIZE) +#define is_D2_OEM (Builtin_mission_hogsize == OEM_MISSION_HOGSIZE) + //arrays of name of the level files extern char Level_names[MAX_LEVELS_PER_MISSION][FILENAME_LEN]; extern char Secret_level_names[MAX_SECRET_LEVELS_PER_MISSION][FILENAME_LEN]; diff --git a/main/network.c b/main/network.c index 6a32e1e2..80b9a812 100644 --- a/main/network.c +++ b/main/network.c @@ -1,4 +1,4 @@ -/* $Id: network.c,v 1.21 2003-10-04 03:14:47 btb Exp $ */ +/* $Id: network.c,v 1.22 2003-10-11 09:28:38 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -23,7 +23,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: network.c,v 1.21 2003-10-04 03:14:47 btb Exp $"; +static char rcsid[] = "$Id: network.c,v 1.22 2003-10-11 09:28:38 btb Exp $"; #endif #define PATCH12 @@ -398,10 +398,9 @@ network_init(void) My_Seq.type = PID_REQUEST; memcpy(My_Seq.player.callsign, Players[Player_num].callsign, CALLSIGN_LEN+1); - #if defined (D2_OEM) + if (is_D2_OEM) Version_minor|=NETWORK_OEM; - #endif - + My_Seq.player.version_major=Version_major; My_Seq.player.version_minor=Version_minor; My_Seq.player.rank=GetMyNetRanking(); @@ -4452,7 +4451,7 @@ remenu: } #endif -#if defined (D2_OEM) + if (is_D2_OEM) { if (Active_games[choice].levelnum>8) { @@ -4460,7 +4459,6 @@ remenu: goto remenu; } } -#endif if (!network_wait_for_all_info (choice)) { diff --git a/main/weapon.c b/main/weapon.c index 62b902b5..2b39aa1f 100644 --- a/main/weapon.c +++ b/main/weapon.c @@ -1,4 +1,4 @@ -/* $Id: weapon.c,v 1.8 2003-10-10 00:24:38 btb Exp $ */ +/* $Id: weapon.c,v 1.9 2003-10-11 09:28:38 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -200,7 +200,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: weapon.c,v 1.8 2003-10-10 00:24:38 btb Exp $"; +static char rcsid[] = "$Id: weapon.c,v 1.9 2003-10-11 09:28:38 btb Exp $"; #endif #include @@ -1552,7 +1552,7 @@ extern int weapon_info_read_n(weapon_info *wi, int n, CFILE *fp, int file_versio if (file_version >= 3) wi[i].multi_damage_scale = cfile_read_fix(fp); - else + else /* FIXME: hack this to set the real values */ wi[i].multi_damage_scale = F1_0; bitmap_index_read(&wi[i].bitmap, fp); diff --git a/main/weapon.h b/main/weapon.h index 1b218d7e..f72db7f4 100644 --- a/main/weapon.h +++ b/main/weapon.h @@ -1,4 +1,4 @@ -/* $Id: weapon.h,v 1.5 2003-10-04 03:14:48 btb Exp $ */ +/* $Id: weapon.h,v 1.6 2003-10-11 09:28:38 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -145,60 +145,6 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. // weapon info flags #define WIF_PLACABLE 1 // can be placed by level designer -typedef struct v2_weapon_info { - sbyte render_type; // How to draw 0=laser, 1=blob, 2=object - sbyte persistent; // 0 = dies when it hits something, 1 = continues (eg, fusion cannon) - short model_num; // Model num if rendertype==2. - short model_num_inner; // Model num of inner part if rendertype==2. - - sbyte flash_vclip; // What vclip to use for muzzle flash - sbyte robot_hit_vclip; // What vclip for impact with robot - short flash_sound; // What sound to play when fired - - sbyte wall_hit_vclip; // What vclip for impact with wall - sbyte fire_count; // Number of bursts fired from EACH GUN per firing. For weapons which fire from both sides, 3*fire_count shots will be fired. - short robot_hit_sound; // What sound for impact with robot - - sbyte ammo_usage; // How many units of ammunition it uses. - sbyte weapon_vclip; // Vclip to render for the weapon, itself. - short wall_hit_sound; // What sound for impact with wall - - sbyte destroyable; // If !0, this weapon can be destroyed by another weapon. - sbyte matter; // Flag: set if this object is matter (as opposed to energy) - sbyte bounce; // 1==always bounces, 2=bounces twice - sbyte homing_flag; // Set if this weapon can home in on a target. - - ubyte speedvar; // allowed variance in speed below average, /128: 64 = 50% meaning if speed = 100, can be 50..100 - - ubyte flags; // see values above - - sbyte flash; // Flash effect - sbyte afterburner_size; // Size of blobs in F1_0/16 units, specify in bitmaps.tbl as floating point. Player afterburner size = 2.5. - - fix energy_usage; // How much fuel is consumed to fire this weapon. - fix fire_wait; // Time until this weapon can be fired again. - - bitmap_index bitmap; // Pointer to bitmap if rendertype==0 or 1. - - fix blob_size; // Size of blob if blob type - fix flash_size; // How big to draw the flash - fix impact_size; // How big of an impact - fix strength[NDL]; // How much damage it can inflict - fix speed[NDL]; // How fast it can move, difficulty level based. - fix mass; // How much mass it has - fix drag; // How much drag it has - fix thrust; // How much thrust it has - fix po_len_to_width_ratio; // For polyobjects, the ratio of len/width. (10 maybe?) - fix light; // Amount of light this weapon casts. - fix lifetime; // Lifetime in seconds of this weapon. - fix damage_radius; // Radius of damage caused by weapon, used for missiles (not lasers) to apply to damage to things it did not hit - //-- unused-- fix damage_force; // Force of damage caused by weapon, used for missiles (not lasers) to apply to damage to things it did not hit -// damage_force was a real mess. Wasn't Difficulty_level based, and -// was being applied instead of weapon's actual strength. Now use -// 2*strength instead. --MK, 01/19/95 - bitmap_index picture; // a picture of the weapon for the cockpit -} v2_weapon_info; - typedef struct weapon_info { sbyte render_type; // How to draw 0=laser, 1=blob, 2=object sbyte persistent; // 0 = dies when it hits something, 1 = continues (eg, fusion cannon) -- 2.39.2