From 11cb48540878740a03389b00fe6e7b7125ccb60e Mon Sep 17 00:00:00 2001 From: theoddone33 Date: Fri, 3 May 2002 13:34:34 +0000 Subject: [PATCH] More stuff compiles --- include/hudartillery.h | 45 ++++++++++++++++++++++++++++++-- include/model.h | 11 +++++--- src/gamesnd/gamesnd.cpp | 10 ++++--- src/hud/hudartillery.cpp | 42 ++++------------------------- src/hud/hudmessage.cpp | 10 ++++--- src/math/spline.cpp | 10 ++++--- src/missionui/redalert.cpp | 10 ++++--- src/object/collidedebrisship.cpp | 10 ++++--- src/physics/physics.cpp | 10 ++++--- src/render/3dclipper.cpp | 32 ++++++++++------------- src/render/3ddraw.cpp | 45 +++++++++++++++++--------------- src/ship/aicode.cpp | 10 ++++--- src/ship/ship.cpp | 12 ++++++--- src/ship/shiphit.cpp | 12 ++++++--- 14 files changed, 158 insertions(+), 111 deletions(-) diff --git a/include/hudartillery.h b/include/hudartillery.h index d01d10d..8e7c5d5 100644 --- a/include/hudartillery.h +++ b/include/hudartillery.h @@ -6,8 +6,11 @@ * * * $Log$ - * Revision 1.1 2002/05/03 03:28:12 root - * Initial revision + * Revision 1.2 2002/05/03 13:34:33 theoddone33 + * More stuff compiles + * + * Revision 1.1.1.1 2002/05/03 03:28:12 root + * Initial import. * * * 2 4/20/99 6:39p Dave @@ -32,6 +35,44 @@ // ARTILLERY FUNCTIONS // +#include "parselo.h" + +#define MAX_SSM_TYPES 10 +#define MAX_SSM_STRIKES 10 +#define MAX_SSM_COUNT 10 + +// global ssm types +typedef struct ssm_info { + char name[NAME_LENGTH+1]; // strike name + int count; // # of missiles in this type of strike + int weapon_info_index; // missile type + float warp_radius; // radius of associated warp effect + float warp_time; // how long the warp effect lasts + float radius; // radius around the shooting ship + float offset; // offset in front of the shooting ship +} ssm_info; + +// creation info for the strike (useful for multiplayer) +typedef struct ssm_firing_info { + int delay_stamp[MAX_SSM_COUNT]; // timestamps + vector start_pos[MAX_SSM_COUNT]; // start positions + + int ssm_index; // index info ssm_info array + vector target; // target for the strike +} ssm_firing_info; + +// the strike itself +typedef struct ssm_strike { + int fireballs[MAX_SSM_COUNT]; // warpin effect fireballs + int done_flags[MAX_SSM_COUNT]; // when we've fired off the individual missiles + + // this is the info that controls how the strike behaves (just like for beam weapons) + ssm_firing_info sinfo; + + ssm_strike *next, *prev; // for list +} ssm_strike; + + // level init void hud_init_artillery(); diff --git a/include/model.h b/include/model.h index cd8af00..79be14f 100644 --- a/include/model.h +++ b/include/model.h @@ -7,8 +7,11 @@ * header file for information about polygon models * * $Log$ - * Revision 1.1 2002/05/03 03:28:12 root - * Initial revision + * Revision 1.2 2002/05/03 13:34:33 theoddone33 + * More stuff compiles + * + * Revision 1.1.1.1 2002/05/03 03:28:12 root + * Initial import. * * * 38 9/13/99 10:09a Andsager @@ -542,7 +545,7 @@ typedef struct ship_bay { int paths[MAX_SHIP_BAY_PATHS]; // index into polymodel->paths[] array int arrive_flags; // bitfield, set to 1 when that path number is reserved for an arrival int depart_flags; // bitfield, set to 1 when that path number is reserved for a departure -} ship_bay; +} ship_bay_t; // three structures now used for representing shields. // shield_tri structure stores information concerning each face of the shield. @@ -666,7 +669,7 @@ typedef struct polymodel { w_bank *missile_banks; // array of missile banks dock_bay *docking_bays; // array of docking point pairs thruster_bank *thrusters; // array of thruster objects -- likely to change in the future - ship_bay *ship_bay_v; // contains path indexes for ship bay approach/depart paths + ship_bay_t *ship_bay; // contains path indexes for ship bay approach/depart paths shield_info shield; // new shield information diff --git a/src/gamesnd/gamesnd.cpp b/src/gamesnd/gamesnd.cpp index c052cf3..4623e00 100644 --- a/src/gamesnd/gamesnd.cpp +++ b/src/gamesnd/gamesnd.cpp @@ -7,8 +7,11 @@ * Routines to keep track of which sound files go where * * $Log$ - * Revision 1.1 2002/05/03 03:28:09 root - * Initial revision + * Revision 1.2 2002/05/03 13:34:33 theoddone33 + * More stuff compiles + * + * Revision 1.1.1.1 2002/05/03 03:28:09 root + * Initial import. * * * 6 7/01/99 11:44a Dave @@ -411,4 +414,5 @@ void common_play_highlight_sound() void gamesnd_play_error_beep() { gamesnd_play_iface(SND_GENERAL_FAIL); -} \ No newline at end of file +} + diff --git a/src/hud/hudartillery.cpp b/src/hud/hudartillery.cpp index 7c9dbe3..15485b9 100644 --- a/src/hud/hudartillery.cpp +++ b/src/hud/hudartillery.cpp @@ -6,8 +6,11 @@ * * * $Log$ - * Revision 1.1 2002/05/03 03:28:09 root - * Initial revision + * Revision 1.2 2002/05/03 13:34:33 theoddone33 + * More stuff compiles + * + * Revision 1.1.1.1 2002/05/03 03:28:09 root + * Initial import. * * * 5 6/01/99 8:35p Dave @@ -54,45 +57,10 @@ // test code for subspace missile strike ------------------------------------------- -#define MAX_SSM_TYPES 10 - -// global ssm types -typedef struct ssm_info { - char name[NAME_LENGTH+1]; // strike name - int count; // # of missiles in this type of strike - int weapon_info_index; // missile type - float warp_radius; // radius of associated warp effect - float warp_time; // how long the warp effect lasts - float radius; // radius around the shooting ship - float offset; // offset in front of the shooting ship -} ssm_info; int Ssm_info_count = 0; ssm_info Ssm_info[MAX_SSM_TYPES]; -#define MAX_SSM_STRIKES 10 -#define MAX_SSM_COUNT 10 - -// creation info for the strike (useful for multiplayer) -typedef struct ssm_firing_info { - int delay_stamp[MAX_SSM_COUNT]; // timestamps - vector start_pos[MAX_SSM_COUNT]; // start positions - - int ssm_index; // index info ssm_info array - vector target; // target for the strike -} ssm_firing_info; - -// the strike itself -typedef struct ssm_strike { - int fireballs[MAX_SSM_COUNT]; // warpin effect fireballs - int done_flags[MAX_SSM_COUNT]; // when we've fired off the individual missiles - - // this is the info that controls how the strike behaves (just like for beam weapons) - ssm_firing_info sinfo; - - ssm_strike *next, *prev; // for list -} ssm_strike; - // list of active/free strikes ssm_strike Ssm_strikes[MAX_SSM_STRIKES]; ssm_strike Ssm_free_list; diff --git a/src/hud/hudmessage.cpp b/src/hud/hudmessage.cpp index 6a8a48d..e43b40c 100644 --- a/src/hud/hudmessage.cpp +++ b/src/hud/hudmessage.cpp @@ -7,8 +7,11 @@ * C module that controls and manages the message window on the HUD * * $Log$ - * Revision 1.1 2002/05/03 03:28:09 root - * Initial revision + * Revision 1.2 2002/05/03 13:34:33 theoddone33 + * More stuff compiles + * + * Revision 1.1.1.1 2002/05/03 03:28:09 root + * Initial import. * * * 23 9/08/99 5:38p Jefff @@ -1560,4 +1563,5 @@ void hud_scrollback_do_frame(float frametime) void hud_scrollback_exit() { gameseq_post_event(GS_EVENT_PREVIOUS_STATE); -} \ No newline at end of file +} + diff --git a/src/math/spline.cpp b/src/math/spline.cpp index 5dc6ab9..7503565 100644 --- a/src/math/spline.cpp +++ b/src/math/spline.cpp @@ -6,8 +6,11 @@ * * * $Log$ - * Revision 1.1 2002/05/03 03:28:09 root - * Initial revision + * Revision 1.2 2002/05/03 13:34:33 theoddone33 + * More stuff compiles + * + * Revision 1.1.1.1 2002/05/03 03:28:09 root + * Initial import. * * * 3 7/08/99 10:53a Dave @@ -307,4 +310,5 @@ void herm_spline::herm_render(int divs, color *clc) for(idx=0; idxreduced_damp_decay = timestamp( reduced_damp_decay_time ); } -} \ No newline at end of file +} + diff --git a/src/render/3dclipper.cpp b/src/render/3dclipper.cpp index 7335e2a..ccc0d58 100644 --- a/src/render/3dclipper.cpp +++ b/src/render/3dclipper.cpp @@ -7,8 +7,11 @@ * Polygon clipping functions * * $Log$ - * Revision 1.1 2002/05/03 03:28:10 root - * Initial revision + * Revision 1.2 2002/05/03 13:34:33 theoddone33 + * More stuff compiles + * + * Revision 1.1.1.1 2002/05/03 03:28:10 root + * Initial import. * * * 2 10/07/98 10:53a Dave @@ -247,7 +250,7 @@ int clip_plane(int plane_flag,vertex **src,vertex **dest,int *nv,ccodes *cc,uint src[*nv] = src[0]; src[*nv+1] = src[1]; - cc->and = 0xff; cc->or = 0; + cc->vand = 0xff; cc->vor = 0; for (i=1;i<=*nv;i++) { @@ -256,16 +259,16 @@ int clip_plane(int plane_flag,vertex **src,vertex **dest,int *nv,ccodes *cc,uint if (! (src[i-1]->codes & plane_flag)) { //prev not off? *dest = clip_edge(plane_flag,src[i-1],src[i],flags); - cc->or |= (*dest)->codes; - cc->and &= (*dest)->codes; + cc->vor |= (*dest)->codes; + cc->vand &= (*dest)->codes; dest++; } if (! (src[i+1]->codes & plane_flag)) { *dest = clip_edge(plane_flag,src[i+1],src[i],flags); - cc->or |= (*dest)->codes; - cc->and &= (*dest)->codes; + cc->vor |= (*dest)->codes; + cc->vand &= (*dest)->codes; dest++; } @@ -278,8 +281,8 @@ int clip_plane(int plane_flag,vertex **src,vertex **dest,int *nv,ccodes *cc,uint *dest++ = src[i]; - cc->or |= src[i]->codes; - cc->and &= src[i]->codes; + cc->vor |= src[i]->codes; + cc->vand &= src[i]->codes; } } @@ -294,11 +297,11 @@ vertex **clip_polygon(vertex **src,vertex **dest,int *nv,ccodes *cc,uint flags) for (plane_flag=1;plane_flag<=CC_OFF_USER;plane_flag<<=1) - if (cc->or & plane_flag) { + if (cc->vor & plane_flag) { *nv = clip_plane(plane_flag,src,dest,nv,cc,flags); - if (cc->and) //clipped away + if (cc->vand) //clipped away return dest; t = src; src = dest; dest = t; @@ -308,10 +311,3 @@ vertex **clip_polygon(vertex **src,vertex **dest,int *nv,ccodes *cc,uint flags) return src; //we swapped after we copied } - - - - - - - diff --git a/src/render/3ddraw.cpp b/src/render/3ddraw.cpp index 57c7a8c..72a32f6 100644 --- a/src/render/3ddraw.cpp +++ b/src/render/3ddraw.cpp @@ -7,8 +7,11 @@ * 3D rendering primitives * * $Log$ - * Revision 1.1 2002/05/03 03:28:10 root - * Initial revision + * Revision 1.2 2002/05/03 13:34:33 theoddone33 + * More stuff compiles + * + * Revision 1.1.1.1 2002/05/03 03:28:10 root + * Initial import. * * * 18 9/06/99 3:23p Andsager @@ -308,7 +311,7 @@ int g3_draw_poly(int nv,vertex **pointlist,uint tmap_flags) Assert( G3_count == 1 ); - cc.or = 0; cc.and = 0xff; + cc.vor = 0; cc.vand = 0xff; bufptr = Vbuf0; @@ -317,19 +320,19 @@ int g3_draw_poly(int nv,vertex **pointlist,uint tmap_flags) p = bufptr[i] = pointlist[i]; - cc.and &= p->codes; - cc.or |= p->codes; + cc.vand &= p->codes; + cc.vor |= p->codes; } - if (cc.and) + if (cc.vand) return 1; //all points off screen - if (cc.or) { + if (cc.vor) { Assert( G3_count == 1 ); bufptr = clip_polygon(Vbuf0,Vbuf1,&nv,&cc,tmap_flags); - if (nv && !(cc.or&CC_BEHIND) && !cc.and) { + if (nv && !(cc.vor&CC_BEHIND) && !cc.vand) { for (i=0;icodes; - cc.or |= p->codes; + cc.vand &= p->codes; + cc.vor |= p->codes; } - if (cc.and) + if (cc.vand) return 1; //all points off screen - if (cc.or) { + if (cc.vor) { Assert( G3_count == 1 ); bufptr = clip_polygon(Vbuf0, Vbuf1, &nv, &cc, tmap_flags); - if (nv && !(cc.or&CC_BEHIND) && !cc.and) { + if (nv && !(cc.vor&CC_BEHIND) && !cc.vand) { for (i=0;icodes; - cc.or |= p->codes; + cc.vand &= p->codes; + cc.vor |= p->codes; } - if (cc.and){ + if (cc.vand){ return 0.0f; //all points off screen } - if (cc.or) { + if (cc.vor) { Assert( G3_count == 1 ); bufptr = clip_polygon(Vbuf0, Vbuf1, &nv, &cc, tmap_flags); - if (nv && !(cc.or&CC_BEHIND) && !cc.and) { + if (nv && !(cc.vor&CC_BEHIND) && !cc.vand) { for (i=0;itype == OBJ_SHIP) diff --git a/src/ship/ship.cpp b/src/ship/ship.cpp index aa92c26..4605b70 100644 --- a/src/ship/ship.cpp +++ b/src/ship/ship.cpp @@ -7,8 +7,11 @@ * Ship (and other object) handling functions * * $Log$ - * Revision 1.1 2002/05/03 03:28:10 root - * Initial revision + * Revision 1.2 2002/05/03 13:34:34 theoddone33 + * More stuff compiles + * + * Revision 1.1.1.1 2002/05/03 03:28:10 root + * Initial import. * * * 144 10/13/99 3:43p Jefff @@ -693,6 +696,7 @@ #include "asteroid.h" #include "hudtargetbox.h" #include "multi_respawn.h" +#include "hudartillery.h" #include "hudwingmanstatus.h" #include "jumpnode.h" #include "redalert.h" @@ -9243,6 +9247,8 @@ int ship_get_texture(int bitmap) return -1; } +extern void ssm_create(vector *target, vector *start, int ssm_index, ssm_firing_info *override); + // update artillery lock info #define CLEAR_ARTILLERY_AND_CONTINUE() { if(aip != NULL){ aip->artillery_objnum = -1; aip->artillery_sig = -1; aip->artillery_lock_time = 0.0f;} continue; } float artillery_dist = 10.0f; @@ -9338,8 +9344,6 @@ void ship_update_artillery_lock() // TEST CODE if(aip->artillery_lock_time >= 2.0f){ - struct ssm_firing_info; - extern void ssm_create(vector *target, vector *start, int ssm_index, ssm_firing_info *override); HUD_printf("Firing artillery"); diff --git a/src/ship/shiphit.cpp b/src/ship/shiphit.cpp index a715950..616415c 100644 --- a/src/ship/shiphit.cpp +++ b/src/ship/shiphit.cpp @@ -7,8 +7,11 @@ * Code to deal with a ship getting hit by something, be it a missile, dog, or ship. * * $Log$ - * Revision 1.1 2002/05/03 03:28:10 root - * Initial revision + * Revision 1.2 2002/05/03 13:34:34 theoddone33 + * More stuff compiles + * + * Revision 1.1.1.1 2002/05/03 03:28:10 root + * Initial import. * * * 61 9/14/99 3:26a Dave @@ -1880,7 +1883,7 @@ void ship_self_destruct( object *objp ) ship_hit_kill(objp, NULL, 1.0f, 1); } -extern Homing_hits, Homing_misses; +extern int Homing_hits, Homing_misses; // Call this instead of physics_apply_whack directly to // deal with two ships docking properly. @@ -2478,4 +2481,5 @@ void ship_hit_pain(float damage) if ( Game_mode & GM_MULTIPLAYER ){ popup_kill_any_active(); } -} \ No newline at end of file +} + -- 2.39.2