mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-08 07:28:22 -10:00
Strip out unused rendering code.
This commit is contained in:
1 parent
fcc40b4812
commit
1ef7688fa1
20 files changed
+24
-3600
No files matched your search
@@ -1167,25 +1167,6 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
|
||||
}
|
||||
}
|
||||
|
||||
void asteroid_render_DEPRECATED(object * obj)
|
||||
{
|
||||
if (Asteroids_enabled) {
|
||||
int num;
|
||||
asteroid *asp;
|
||||
|
||||
num = obj->instance;
|
||||
|
||||
Assert((num >= 0) && (num < MAX_ASTEROIDS));
|
||||
asp = &Asteroids[num];
|
||||
|
||||
Assert( asp->flags & AF_USED );
|
||||
|
||||
model_clear_instance( Asteroid_info[asp->asteroid_type].model_num[asp->asteroid_subtype]);
|
||||
|
||||
model_render_DEPRECATED(Asteroid_info[asp->asteroid_type].model_num[asp->asteroid_subtype], &obj->orient, &obj->pos, MR_DEPRECATED_NORMAL|MR_DEPRECATED_IS_ASTEROID, OBJ_INDEX(obj) ); // Replace MR_NORMAL with 0x07 for big yellow blobs
|
||||
}
|
||||
}
|
||||
|
||||
void asteroid_render(object * obj, draw_list *scene)
|
||||
{
|
||||
if (Asteroids_enabled) {
|
||||
|
||||
@@ -152,7 +152,6 @@ void asteroid_init();
|
||||
void asteroid_level_init();
|
||||
void asteroid_level_close();
|
||||
void asteroid_create_all();
|
||||
void asteroid_render_DEPRECATED( object *asteroid_objp );
|
||||
void asteroid_render(object * obj, draw_list *scene);
|
||||
void asteroid_delete( object *asteroid_objp );
|
||||
void asteroid_process_pre( object *asteroid_objp );
|
||||
|
||||
+7
-60
@@ -144,64 +144,6 @@ void debris_page_in()
|
||||
MONITOR(NumSmallDebrisRend)
|
||||
MONITOR(NumHullDebrisRend)
|
||||
|
||||
/**
|
||||
* Render debris
|
||||
*/
|
||||
void debris_render_DEPRECATED(object * obj)
|
||||
{
|
||||
int i, num, swapped;
|
||||
polymodel *pm;
|
||||
debris *db;
|
||||
|
||||
|
||||
swapped = -1;
|
||||
pm = NULL;
|
||||
num = obj->instance;
|
||||
|
||||
Assert(num >= 0 && num < MAX_DEBRIS_PIECES);
|
||||
db = &Debris[num];
|
||||
|
||||
Assert(db->flags & DEBRIS_USED);
|
||||
|
||||
texture_info *tbase = NULL;
|
||||
|
||||
model_clear_instance( db->model_num );
|
||||
|
||||
// Swap in a different texture depending on the species
|
||||
if (db->species >= 0)
|
||||
{
|
||||
pm = model_get( db->model_num );
|
||||
|
||||
//WMC - Someday, we should have glowing debris.
|
||||
if ( pm != NULL && (pm->n_textures == 1) ) {
|
||||
tbase = &pm->maps[0].textures[TM_BASE_TYPE];
|
||||
swapped = tbase->GetTexture();
|
||||
tbase->SetTexture(Species_info[db->species].debris_texture.bitmap_id);
|
||||
}
|
||||
}
|
||||
|
||||
// Only render electrical arcs if within 500m of the eye (for a 10m piece)
|
||||
if ( vm_vec_dist_quick( &obj->pos, &Eye_position ) < obj->radius*50.0f ) {
|
||||
for (i=0; i<MAX_DEBRIS_ARCS; i++ ) {
|
||||
if ( timestamp_valid( db->arc_timestamp[i] ) ) {
|
||||
model_add_arc( db->model_num, db->submodel_num, &db->arc_pts[i][0], &db->arc_pts[i][1], MARC_TYPE_NORMAL );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( db->is_hull ) {
|
||||
MONITOR_INC(NumHullDebrisRend,1);
|
||||
submodel_render_DEPRECATED( db->model_num, db->submodel_num, &obj->orient, &obj->pos );
|
||||
} else {
|
||||
MONITOR_INC(NumSmallDebrisRend,1);
|
||||
submodel_render_DEPRECATED( db->model_num, db->submodel_num, &obj->orient, &obj->pos, MR_NO_LIGHTING );
|
||||
}
|
||||
|
||||
if (tbase != NULL && (swapped!=-1) && pm) {
|
||||
tbase->SetTexture(swapped);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removed the ::DEBRIS_EXPIRE flag, and remove item from ::Hull_debris_list
|
||||
*/
|
||||
@@ -1096,6 +1038,9 @@ void calc_debris_physics_properties( physics_info *pi, vec3d *mins, vec3d *maxs
|
||||
pi->I_body_inv.vec.fvec.xyz.z = 12.0f / (pi->mass * (dx*dx + dy*dy));
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders debris
|
||||
*/
|
||||
void debris_render(object * obj, draw_list *scene)
|
||||
{
|
||||
int i, num, swapped;
|
||||
@@ -1140,11 +1085,13 @@ void debris_render(object * obj, draw_list *scene)
|
||||
|
||||
model_render_params render_info;
|
||||
|
||||
if ( !db->is_hull ) {
|
||||
if ( db->is_hull ) {
|
||||
MONITOR_INC(NumHullDebrisRend, 1);
|
||||
} else {
|
||||
MONITOR_INC(NumSmallDebrisRend, 1);
|
||||
render_info.set_flags(MR_NO_LIGHTING);
|
||||
}
|
||||
|
||||
MONITOR_INC(NumHullDebrisRend,1);
|
||||
submodel_render_queue( &render_info, scene, db->model_num, db->submodel_num, &obj->orient, &obj->pos );
|
||||
|
||||
if (tbase != NULL && (swapped!=-1) && pm) {
|
||||
|
||||
@@ -63,7 +63,6 @@ extern int Num_debris_pieces;
|
||||
struct collision_info_struct;
|
||||
|
||||
void debris_init();
|
||||
void debris_render_DEPRECATED( object * obj );
|
||||
void debris_render(object * obj, draw_list *scene);
|
||||
void debris_delete( object * obj );
|
||||
void debris_process_post( object * obj, float frame_time);
|
||||
|
||||
@@ -374,79 +374,6 @@ void fireball_init()
|
||||
|
||||
MONITOR( NumFireballsRend )
|
||||
|
||||
void fireball_render_DEPRECATED(object * obj)
|
||||
{
|
||||
int num;
|
||||
vertex p;
|
||||
fireball *fb;
|
||||
|
||||
MONITOR_INC( NumFireballsRend, 1 );
|
||||
|
||||
memset(&p, 0, sizeof(p));
|
||||
|
||||
num = obj->instance;
|
||||
fb = &Fireballs[num];
|
||||
|
||||
if ( Fireballs[num].current_bitmap < 0 )
|
||||
return;
|
||||
|
||||
// turn off fogging
|
||||
if(The_mission.flags & MISSION_FLAG_FULLNEB){
|
||||
gr_fog_set(GR_FOGMODE_NONE, 0, 0, 0);
|
||||
}
|
||||
|
||||
g3_transfer_vertex(&p, &obj->pos);
|
||||
|
||||
switch( fb->fireball_render_type ) {
|
||||
|
||||
case FIREBALL_MEDIUM_EXPLOSION:
|
||||
batch_add_bitmap (
|
||||
Fireballs[num].current_bitmap,
|
||||
TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT | TMAP_FLAG_SOFT_QUAD,
|
||||
&p,
|
||||
fb->orient,
|
||||
obj->radius
|
||||
);
|
||||
break;
|
||||
|
||||
case FIREBALL_LARGE_EXPLOSION:
|
||||
// Make the big explosions rotate with the viewer.
|
||||
batch_add_bitmap_rotated (
|
||||
Fireballs[num].current_bitmap,
|
||||
TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT | TMAP_FLAG_SOFT_QUAD,
|
||||
&p,
|
||||
(i2fl(fb->orient)*PI)/180.0f,
|
||||
obj->radius
|
||||
);
|
||||
break;
|
||||
|
||||
case FIREBALL_WARP_EFFECT: {
|
||||
|
||||
float percent_life = fb->time_elapsed / fb->total_time;
|
||||
|
||||
float rad;
|
||||
|
||||
// Code to make effect grow/shrink.
|
||||
float t = fb->time_elapsed;
|
||||
|
||||
if ( t < WARPHOLE_GROW_TIME ) {
|
||||
rad = (float)pow(t/WARPHOLE_GROW_TIME,0.4f)*obj->radius;
|
||||
} else if ( t < fb->total_time - WARPHOLE_GROW_TIME ) {
|
||||
rad = obj->radius;
|
||||
} else {
|
||||
rad = (float)pow((fb->total_time - t)/WARPHOLE_GROW_TIME,0.4f)*obj->radius;
|
||||
}
|
||||
|
||||
warpin_render(obj, &obj->orient, &obj->pos, Fireballs[num].current_bitmap, rad, percent_life, obj->radius, (Fireballs[num].flags & FBF_WARP_3D) );
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
Int3();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a fireball.
|
||||
* Called by object_delete() code... do not call directly.
|
||||
|
||||
@@ -77,7 +77,6 @@ typedef struct fireball {
|
||||
// end move
|
||||
|
||||
void fireball_init();
|
||||
void fireball_render_DEPRECATED(object * obj);
|
||||
void fireball_render(object* obj, draw_list *scene);
|
||||
void fireball_delete( object * obj );
|
||||
void fireball_process_post(object * obj, float frame_time);
|
||||
|
||||
+12
-61
@@ -283,67 +283,11 @@ bool CJumpNode::IsSpecialModel()
|
||||
}
|
||||
|
||||
/**
|
||||
* Render jump node
|
||||
*
|
||||
* @param pos World position
|
||||
* @param view_pos Viewer's world position, can be NULL
|
||||
*/
|
||||
void CJumpNode::RenderDEPRECATED(vec3d *pos, vec3d *view_pos)
|
||||
{
|
||||
Assert(pos != NULL);
|
||||
// Assert(view_pos != NULL); - view_pos can be NULL
|
||||
|
||||
if(m_flags & JN_HIDE)
|
||||
return;
|
||||
|
||||
if(m_modelnum < 0)
|
||||
return;
|
||||
|
||||
matrix node_orient = IDENTITY_MATRIX;
|
||||
|
||||
int mr_flags = MR_NO_LIGHTING;
|
||||
if(!(m_flags & JN_SHOW_POLYS)) {
|
||||
mr_flags |= MR_NO_CULL | MR_NO_POLYS | MR_SHOW_OUTLINE_PRESET;
|
||||
}
|
||||
|
||||
if ( Fred_running ) {
|
||||
gr_set_color_fast(&m_display_color);
|
||||
model_render_DEPRECATED(m_modelnum, &node_orient, pos, mr_flags );
|
||||
} else {
|
||||
if (m_flags & JN_USE_DISPLAY_COLOR) {
|
||||
gr_set_color_fast(&m_display_color);
|
||||
}
|
||||
else if ( view_pos != NULL) {
|
||||
int alpha_index = HUD_color_alpha;
|
||||
|
||||
// generate alpha index based on distance to jump this
|
||||
float dist;
|
||||
|
||||
dist = vm_vec_dist_quick(view_pos, pos);
|
||||
|
||||
// linearly interpolate alpha. At 1000m or less, full intensity. At 10000m or more 1/2 intensity.
|
||||
if ( dist < 1000 ) {
|
||||
alpha_index = HUD_COLOR_ALPHA_USER_MAX - 2;
|
||||
} else if ( dist > 10000 ) {
|
||||
alpha_index = HUD_COLOR_ALPHA_USER_MIN;
|
||||
} else {
|
||||
alpha_index = fl2i( HUD_COLOR_ALPHA_USER_MAX - 2 + (dist-1000) * (HUD_COLOR_ALPHA_USER_MIN-HUD_COLOR_ALPHA_USER_MAX-2) / (9000) + 0.5f);
|
||||
if ( alpha_index < HUD_COLOR_ALPHA_USER_MIN ) {
|
||||
alpha_index = HUD_COLOR_ALPHA_USER_MIN;
|
||||
}
|
||||
}
|
||||
|
||||
gr_set_color_fast(&HUD_color_defaults[alpha_index]);
|
||||
|
||||
} else {
|
||||
gr_set_color(HUD_color_red, HUD_color_green, HUD_color_blue);
|
||||
}
|
||||
|
||||
model_render_DEPRECATED(m_modelnum, &node_orient, pos, mr_flags );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
* Render jump node. Creates its own draw list to render
|
||||
*
|
||||
* @param pos World position
|
||||
* @param view_pos Viewer's world position, can be NULL
|
||||
*/
|
||||
void CJumpNode::Render(vec3d *pos, vec3d *view_pos)
|
||||
{
|
||||
draw_list scene;
|
||||
@@ -358,6 +302,13 @@ void CJumpNode::Render(vec3d *pos, vec3d *view_pos)
|
||||
gr_set_buffer(-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render jump node
|
||||
*
|
||||
* @param scene A scene's draw list
|
||||
* @param pos World position
|
||||
* @param view_pos Viewer's world position, can be NULL
|
||||
*/
|
||||
void CJumpNode::Render(draw_list* scene, vec3d *pos, vec3d *view_pos)
|
||||
{
|
||||
Assert(pos != NULL);
|
||||
|
||||
@@ -74,7 +74,6 @@ public:
|
||||
bool IsSpecialModel();
|
||||
|
||||
//Rendering
|
||||
void RenderDEPRECATED(vec3d *pos, vec3d *view_pos = NULL);
|
||||
void Render(vec3d *pos, vec3d *view_pos = NULL);
|
||||
void Render(draw_list *scene, vec3d *pos, vec3d *view_pos = NULL);
|
||||
};
|
||||
|
||||
@@ -892,40 +892,6 @@ void model_set_detail_level(int n);
|
||||
#define MR_EMPTY_SLOT5 (1<<30) // Use a animated Shader - Valathil
|
||||
#define MR_ATTACHED_MODEL (1<<31) // Used for attached weapon model lodding
|
||||
|
||||
#define MR_DEPRECATED_NORMAL (0) // Draw a normal object
|
||||
#define MR_DEPRECATED_SHOW_OUTLINE (1<<0) // Draw the object in outline mode. Color specified by model_set_outline_color
|
||||
#define MR_DEPRECATED_SHOW_PIVOTS (1<<1) // Show the pivot points
|
||||
#define MR_DEPRECATED_SHOW_PATHS (1<<2) // Show the paths associated with a model
|
||||
#define MR_DEPRECATED_SHOW_RADIUS (1<<3) // Show the radius around the object
|
||||
#define MR_DEPRECATED_SHOW_SHIELDS (1<<4) // Show the shield mesh
|
||||
#define MR_DEPRECATED_SHOW_THRUSTERS (1<<5) // Show the engine thrusters. See model_set_thrust for how long it draws.
|
||||
#define MR_DEPRECATED_LOCK_DETAIL (1<<6) // Only draw the detail level defined in model_set_detail_level
|
||||
#define MR_DEPRECATED_NO_POLYS (1<<7) // Don't draw the polygons.
|
||||
#define MR_DEPRECATED_NO_LIGHTING (1<<8) // Don't perform any lighting on the model.
|
||||
#define MR_DEPRECATED_NO_TEXTURING (1<<9) // Draw textures as flat-shaded polygons.
|
||||
#define MR_DEPRECATED_NO_CORRECT (1<<10) // Don't to correct texture mapping
|
||||
#define MR_DEPRECATED_NO_SMOOTHING (1<<11) // Don't perform smoothing on vertices.
|
||||
#define MR_DEPRECATED_IS_ASTEROID (1<<12) // When set, treat this as an asteroid.
|
||||
#define MR_DEPRECATED_IS_MISSILE (1<<13) // When set, treat this as a missilie. No lighting, small thrusters.
|
||||
#define MR_DEPRECATED_SHOW_OUTLINE_PRESET (1<<14) // Draw the object in outline mode. Color assumed to be set already.
|
||||
#define MR_DEPRECATED_SHOW_INVISIBLE_FACES (1<<15) // Show invisible faces as green...
|
||||
#define MR_DEPRECATED_AUTOCENTER (1<<16) // Always use the center of the hull bounding box as the center, instead of the pivot point
|
||||
#define MR_DEPRECATED_BAY_PATHS (1<<17) // draw bay paths
|
||||
#define MR_DEPRECATED_ALL_XPARENT (1<<18) // render it fully transparent
|
||||
#define MR_DEPRECATED_NO_ZBUFFER (1<<19) // switch z-buffering off completely
|
||||
#define MR_DEPRECATED_NO_CULL (1<<20) // don't cull backfacing poly's
|
||||
#define MR_DEPRECATED_FORCE_TEXTURE (1<<21) // force a given texture to always be used
|
||||
#define MR_DEPRECATED_FORCE_LOWER_DETAIL (1<<22) // force the model to draw 1 LOD lower, if possible
|
||||
#define MR_DEPRECATED_EDGE_ALPHA (1<<23) // makes norms that are faceing away from you render more transparent -Bobboau
|
||||
#define MR_DEPRECATED_CENTER_ALPHA (1<<24) // oposite of above -Bobboau
|
||||
#define MR_DEPRECATED_NO_FOGGING (1<<25) // Don't fog - taylor
|
||||
#define MR_DEPRECATED_SHOW_OUTLINE_HTL (1<<26) // Show outlines (wireframe view) using HTL method
|
||||
#define MR_DEPRECATED_NO_GLOWMAPS (1<<27) // disable rendering of glowmaps - taylor
|
||||
#define MR_DEPRECATED_FULL_DETAIL (1<<28) // render all valid objects, particularly ones that are otherwise in/out of render boxes - taylor
|
||||
#define MR_DEPRECATED_FORCE_CLAMP (1<<29) // force clamp - Hery
|
||||
#define MR_DEPRECATED_ANIMATED_SHADER (1<<30) // Use a animated Shader - Valathil
|
||||
#define MR_DEPRECATED_ATTACHED_MODEL (1<<31) // Used for attached weapon model lodding
|
||||
|
||||
#define MR_DEBUG_PIVOTS (1<<0) // Show the pivot points
|
||||
#define MR_DEBUG_PATHS (1<<1) // Show the paths associated with a model
|
||||
#define MR_DEBUG_RADIUS (1<<2) // Show the radius around the object
|
||||
@@ -937,14 +903,6 @@ void model_set_detail_level(int n);
|
||||
#define MODEL_RENDER_TRANS 2
|
||||
#define MODEL_RENDER_ALL 3
|
||||
|
||||
// Renders a model and all it's submodels.
|
||||
// See MR_? defines for values for flags
|
||||
void model_render_DEPRECATED(int model_num, matrix *orient, vec3d * pos, uint flags = MR_DEPRECATED_NORMAL, int objnum = -1, int lighting_skip = -1, int *replacement_textures = NULL, int render = MODEL_RENDER_ALL, const bool is_skybox = false);
|
||||
|
||||
// Renders just one particular submodel on a model.
|
||||
// See MR_? defines for values for flags
|
||||
void submodel_render_DEPRECATED(int model_num,int submodel_num, matrix *orient, vec3d * pos, uint flags = MR_DEPRECATED_NORMAL, int objnum = -1, int *replacement_textures = NULL, int render = MODEL_RENDER_ALL);
|
||||
|
||||
// Returns the radius of a model
|
||||
float model_get_radius(int modelnum);
|
||||
float submodel_get_radius(int modelnum, int submodelnum);
|
||||
@@ -1366,9 +1324,6 @@ void model_set_warp_globals(float scale_x = 1.0f, float scale_y = 1.0f, float sc
|
||||
|
||||
void model_set_replacement_textures(int *replacement_textures);
|
||||
|
||||
void model_setup_cloak(vec3d *shift, int full_cloak, int alpha);
|
||||
void model_finish_cloak(int full_cloak);
|
||||
|
||||
void model_do_look_at(int model_num); //Bobboau
|
||||
|
||||
void model_do_intrinsic_rotations(int model_instance_num = -1);
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1534,72 +1534,6 @@ MONITOR( NumObjectsRend )
|
||||
* Render an object. Calls one of several routines based on type
|
||||
*/
|
||||
extern int Cmdline_dis_weapons;
|
||||
void obj_render_DEPRECATED(object *obj)
|
||||
{
|
||||
SCP_list<CJumpNode>::iterator jnp;
|
||||
|
||||
if ( obj->flags & OF_SHOULD_BE_DEAD ) return;
|
||||
|
||||
MONITOR_INC( NumObjectsRend, 1 );
|
||||
|
||||
//WMC - By definition, override statements are executed before the actual statement
|
||||
Script_system.SetHookObject("Self", obj);
|
||||
if(!Script_system.IsConditionOverride(CHA_OBJECTRENDER, obj))
|
||||
{
|
||||
switch( obj->type ) {
|
||||
case OBJ_NONE:
|
||||
#ifndef NDEBUG
|
||||
mprintf(( "ERROR!!!! Bogus obj " PTRDIFF_T_ARG " is rendering!\n", obj-Objects ));
|
||||
Int3();
|
||||
#endif
|
||||
break;
|
||||
case OBJ_WEAPON:
|
||||
if(Cmdline_dis_weapons) return;
|
||||
weapon_render_DEPRECATED(obj);
|
||||
break;
|
||||
case OBJ_SHIP:
|
||||
ship_render_DEPRECATED(obj);
|
||||
break;
|
||||
case OBJ_FIREBALL:
|
||||
fireball_render_DEPRECATED(obj);
|
||||
break;
|
||||
case OBJ_SHOCKWAVE:
|
||||
shockwave_render_DEPRECATED(obj);
|
||||
break;
|
||||
case OBJ_DEBRIS:
|
||||
debris_render_DEPRECATED(obj);
|
||||
break;
|
||||
case OBJ_ASTEROID:
|
||||
asteroid_render_DEPRECATED(obj);
|
||||
break;
|
||||
/* case OBJ_CMEASURE:
|
||||
cmeasure_render(obj);
|
||||
break;*/
|
||||
case OBJ_JUMP_NODE:
|
||||
for (jnp = Jump_nodes.begin(); jnp != Jump_nodes.end(); ++jnp) {
|
||||
if(jnp->GetSCPObject() != obj)
|
||||
continue;
|
||||
jnp->RenderDEPRECATED(&obj->pos, &Eye_position);
|
||||
}
|
||||
break;
|
||||
case OBJ_WAYPOINT:
|
||||
if (Show_waypoints) {
|
||||
gr_set_color( 128, 128, 128 );
|
||||
g3_draw_sphere_ez( &obj->pos, 5.0f );
|
||||
}
|
||||
break;
|
||||
case OBJ_GHOST:
|
||||
break;
|
||||
case OBJ_BEAM:
|
||||
break;
|
||||
default:
|
||||
Error( LOCATION, "Unhandled obj type %d in obj_render", obj->type );
|
||||
}
|
||||
}
|
||||
|
||||
Script_system.RunCondition(CHA_OBJECTRENDER, '\0', NULL, obj);
|
||||
Script_system.RemHookVar("Self");
|
||||
}
|
||||
|
||||
void obj_render(object *obj)
|
||||
{
|
||||
|
||||
@@ -248,9 +248,6 @@ void obj_init();
|
||||
//You can pass null for orient and/or pos if you don't care.
|
||||
int obj_create(ubyte type,int parent_obj, int instance, matrix * orient, vec3d * pos, float radius, uint flags );
|
||||
|
||||
//Render an object. Calls one of several routines based on type
|
||||
void obj_render_DEPRECATED(object *obj);
|
||||
|
||||
void obj_render(object* obj);
|
||||
|
||||
void obj_queue_render(object* obj, draw_list* scene);
|
||||
|
||||
@@ -6737,544 +6737,6 @@ man_thruster_renderer *man_thruster_get_slot(int bmap_frame)
|
||||
//WMC - used for FTL and maneuvering thrusters
|
||||
geometry_batcher fx_batcher;
|
||||
extern bool Rendering_to_shadow_map;
|
||||
void ship_render_DEPRECATED(object * obj)
|
||||
{
|
||||
int num = obj->instance;
|
||||
Assert( num >= 0);
|
||||
ship *shipp = &Ships[num];
|
||||
ship *warp_shipp = NULL;
|
||||
ship_info *sip = &Ship_info[Ships[num].ship_info_index];
|
||||
bool is_first_stage_arrival = false;
|
||||
bool show_thrusters = ((shipp->flags2 & SF2_NO_THRUSTERS) == 0) && !Rendering_to_shadow_map;
|
||||
dock_function_info dfi;
|
||||
|
||||
|
||||
#if 0
|
||||
// show target when attacking big ship
|
||||
vec3d temp, target;
|
||||
ai_info *aip = &Ai_info[Ships[obj->instance].ai_index];
|
||||
if ( (aip->target_objnum >= 0) && (Ship_info[Ships[Objects[aip->target_objnum].instance].ship_info_index].flags & (SIF_SUPERCAP|SIF_CAPITAL|SIF_CRUISER)) ) {
|
||||
vm_vec_unrotate(&temp, &aip->big_attack_point, &Objects[aip->target_objnum].orient);
|
||||
vm_vec_add(&target, &temp, &Objects[aip->target_objnum].pos);
|
||||
|
||||
vertex v0, v1;
|
||||
gr_set_color(128,0,0);
|
||||
g3_rotate_vertex( &v0, &obj->pos );
|
||||
g3_rotate_vertex( &v1, &target );
|
||||
|
||||
g3_draw_line(&v0, &v1);
|
||||
|
||||
g3_draw_sphere(&v1, 5.0f);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if ( obj == Viewer_obj && !Rendering_to_shadow_map)
|
||||
{
|
||||
if (ship_show_velocity_dot && (obj==Player_obj) )
|
||||
{
|
||||
vec3d p0,v;
|
||||
vertex v0;
|
||||
|
||||
vm_vec_scale_add( &v, &obj->phys_info.vel, &obj->orient.vec.fvec, 3.0f );
|
||||
vm_vec_normalize( &v );
|
||||
|
||||
|
||||
vm_vec_scale_add( &p0, &obj->pos, &v, 20.0f);
|
||||
|
||||
g3_rotate_vertex( &v0, &p0 );
|
||||
|
||||
gr_set_color(0,128,0);
|
||||
g3_draw_sphere( &v0, 0.1f );
|
||||
}
|
||||
|
||||
// Show the shield hit effect for the viewer.
|
||||
if ( Show_shield_hits )
|
||||
{
|
||||
shipp = &Ships[num];
|
||||
if (shipp->shield_hits)
|
||||
{
|
||||
create_shield_explosion_all(obj);
|
||||
shipp->shield_hits = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(Viewer_mode & VM_TOPDOWN))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
MONITOR_INC( NumShipsRend, 1 );
|
||||
|
||||
// look for a warping ship, whether for me or for anybody I'm docked with
|
||||
dock_evaluate_all_docked_objects(obj, &dfi, ship_find_warping_ship_helper);
|
||||
|
||||
// if any docked objects are set to stage 1 arrival then set bool
|
||||
if (dfi.maintained_variables.bool_value) {
|
||||
warp_shipp = &Ships[dfi.maintained_variables.objp_value->instance];
|
||||
|
||||
is_first_stage_arrival = ((warp_shipp->flags & SF_ARRIVING_STAGE_1) > 0);
|
||||
|
||||
// This is a hack to make ships using the hyperspace warpin type to
|
||||
// render even in stage 1, which is used for collision detection
|
||||
// purposes -zookeeper
|
||||
if (Ship_info[warp_shipp->ship_info_index].warpin_type == WT_HYPERSPACE) {
|
||||
warp_shipp = NULL;
|
||||
is_first_stage_arrival = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Make ships that are warping in not render during stage 1
|
||||
if ( !(is_first_stage_arrival) )
|
||||
{
|
||||
if ( Ship_shadows && shipfx_in_shadow( obj ) ) {
|
||||
light_set_shadow(1);
|
||||
} else {
|
||||
light_set_shadow(0);
|
||||
}
|
||||
|
||||
ship_model_start(obj);
|
||||
|
||||
uint render_flags = MR_DEPRECATED_NORMAL;
|
||||
#ifndef NDEBUG
|
||||
// if(Show_paths || Show_fpaths){
|
||||
// render_flags |= MR_DEPRECATED_BAY_PATHS;
|
||||
// }
|
||||
#endif
|
||||
|
||||
// Only render electrical arcs if within 500m of the eye (for a 10m piece)
|
||||
if ( vm_vec_dist_quick( &obj->pos, &Eye_position ) < obj->radius*50.0f && !Rendering_to_shadow_map) {
|
||||
int i;
|
||||
for (i=0; i<MAX_SHIP_ARCS; i++ ) {
|
||||
if ( timestamp_valid( shipp->arc_timestamp[i] ) ) {
|
||||
model_add_arc(sip->model_num, -1, &shipp->arc_pts[i][0], &shipp->arc_pts[i][1], shipp->arc_type[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( shipp->large_ship_blowup_index >= 0 ) {
|
||||
shipfx_large_blowup_render(shipp);
|
||||
} else {
|
||||
//WMC - I suppose this is a bit hackish.
|
||||
if(!Rendering_to_shadow_map)
|
||||
{
|
||||
physics_info *pi = &Objects[shipp->objnum].phys_info;
|
||||
float render_amount;
|
||||
fx_batcher.allocate(sip->num_maneuvering); //Act as if all thrusters are going.
|
||||
|
||||
for(int i = 0; i < sip->num_maneuvering; i++)
|
||||
{
|
||||
man_thruster *mtp = &sip->maneuvering[i];
|
||||
|
||||
render_amount = 0.0f;
|
||||
|
||||
//WMC - get us a steady value
|
||||
vec3d des_vel;
|
||||
vm_vec_rotate(&des_vel, &pi->desired_vel, &obj->orient);
|
||||
|
||||
if(pi->desired_rotvel.xyz.x < 0 && (mtp->use_flags & MT_PITCH_UP)) {
|
||||
render_amount = fl_abs(pi->desired_rotvel.xyz.x) / pi->max_rotvel.xyz.x;
|
||||
} else if(pi->desired_rotvel.xyz.x > 0 && (mtp->use_flags & MT_PITCH_DOWN)) {
|
||||
render_amount = fl_abs(pi->desired_rotvel.xyz.x) / pi->max_rotvel.xyz.x;
|
||||
} else if(pi->desired_rotvel.xyz.y < 0 && (mtp->use_flags & MT_ROLL_RIGHT)) {
|
||||
render_amount = fl_abs(pi->desired_rotvel.xyz.y) / pi->max_rotvel.xyz.y;
|
||||
} else if(pi->desired_rotvel.xyz.y > 0 && (mtp->use_flags & MT_ROLL_LEFT)) {
|
||||
render_amount = fl_abs(pi->desired_rotvel.xyz.y) / pi->max_rotvel.xyz.y;
|
||||
} else if(pi->desired_rotvel.xyz.z < 0 && (mtp->use_flags & MT_BANK_RIGHT)) {
|
||||
render_amount = fl_abs(pi->desired_rotvel.xyz.z) / pi->max_rotvel.xyz.z;
|
||||
} else if(pi->desired_rotvel.xyz.z > 0 && (mtp->use_flags & MT_BANK_LEFT)) {
|
||||
render_amount = fl_abs(pi->desired_rotvel.xyz.z) / pi->max_rotvel.xyz.z;
|
||||
}
|
||||
|
||||
//Backslash - show thrusters according to thrust amount, not speed
|
||||
if(pi->side_thrust > 0 && (mtp->use_flags & MT_SLIDE_RIGHT)) {
|
||||
render_amount = pi->side_thrust;
|
||||
} else if(pi->side_thrust < 0 && (mtp->use_flags & MT_SLIDE_LEFT)) {
|
||||
render_amount = -pi->side_thrust;
|
||||
} else if(pi->vert_thrust > 0 && (mtp->use_flags & MT_SLIDE_UP)) {
|
||||
render_amount = pi->vert_thrust;
|
||||
} else if(pi->vert_thrust < 0 && (mtp->use_flags & MT_SLIDE_DOWN)) {
|
||||
render_amount = -pi->vert_thrust;
|
||||
} else if(pi->forward_thrust > 0 && (mtp->use_flags & MT_FORWARD)) {
|
||||
render_amount = pi->forward_thrust;
|
||||
} else if(pi->forward_thrust < 0 && (mtp->use_flags & MT_REVERSE)) {
|
||||
render_amount = -pi->forward_thrust;
|
||||
}
|
||||
|
||||
//Don't render small faraway thrusters (more than 10k * radius away)
|
||||
if (vm_vec_dist(&Eye_position, &obj->pos) > (10000.0f * mtp->radius))
|
||||
render_amount = 0.0f;
|
||||
|
||||
if(render_amount > 0.0f)
|
||||
{
|
||||
//Handle sounds and stuff
|
||||
if(shipp->thrusters_start[i] <= 0)
|
||||
{
|
||||
shipp->thrusters_start[i] = timestamp();
|
||||
if(mtp->start_snd >= 0)
|
||||
snd_play_3d( &Snds[mtp->start_snd], &mtp->pos, &Eye_position, 0.0f, &obj->phys_info.vel );
|
||||
}
|
||||
|
||||
//Only assign looping sound if
|
||||
//it is specified
|
||||
//it isn't assigned already
|
||||
//start sound doesn't exist or has finished
|
||||
if (!Cmdline_freespace_no_sound)
|
||||
if(mtp->loop_snd >= 0
|
||||
&& shipp->thrusters_sounds[i] < 0
|
||||
&& (mtp->start_snd < 0 || (snd_get_duration(mtp->start_snd) < timestamp() - shipp->thrusters_start[i]))
|
||||
)
|
||||
{
|
||||
shipp->thrusters_sounds[i] = obj_snd_assign(OBJ_INDEX(obj), mtp->loop_snd, &mtp->pos, 1);
|
||||
}
|
||||
|
||||
//Draw graphics
|
||||
//Skip invalid ones
|
||||
if(mtp->tex_id >= 0)
|
||||
{
|
||||
float rad = mtp->radius;
|
||||
if(rad <= 0.0f)
|
||||
rad = 1.0f;
|
||||
|
||||
float len = mtp->length;
|
||||
if(len == 0.0f)
|
||||
len = rad;
|
||||
|
||||
vec3d start, tmpend, end;
|
||||
//Start
|
||||
vm_vec_unrotate(&start, &mtp->pos, &obj->orient);
|
||||
vm_vec_add2(&start, &obj->pos);
|
||||
|
||||
//End
|
||||
vm_vec_scale_add(&tmpend, &mtp->pos, &mtp->norm, len * render_amount);
|
||||
vm_vec_unrotate(&end, &tmpend, &obj->orient);
|
||||
vm_vec_add2(&end, &obj->pos);
|
||||
|
||||
//Draw
|
||||
fx_batcher.draw_beam(&start, &end, rad, 1.0f);
|
||||
|
||||
int bmap_frame = mtp->tex_id;
|
||||
if(mtp->tex_nframes > 0)
|
||||
bmap_frame += bm_get_anim_frame(mtp->tex_id, i2fl(timestamp() - shipp->thrusters_start[i]) / 1000.0f, 0.0f, true);
|
||||
|
||||
man_thruster_renderer *mtr = man_thruster_get_slot(bmap_frame);
|
||||
mtr->man_batcher.add_allocate(1);
|
||||
mtr->man_batcher.draw_beam(&start, &end, rad, 1.0f);
|
||||
}
|
||||
|
||||
}
|
||||
//We've stopped firing a thruster
|
||||
else if(shipp->thrusters_start[i] > 0)
|
||||
{
|
||||
shipp->thrusters_start[i] = 0;
|
||||
if(shipp->thrusters_sounds[i] >= 0)
|
||||
{
|
||||
obj_snd_delete(OBJ_INDEX(obj), shipp->thrusters_sounds[i]);
|
||||
shipp->thrusters_sounds[i] = -1;
|
||||
}
|
||||
|
||||
if(mtp->stop_snd >= 0)
|
||||
{
|
||||
//Get world pos
|
||||
vec3d start;
|
||||
vm_vec_unrotate(&start, &mtp->pos, &obj->orient);
|
||||
vm_vec_add2(&start, &obj->pos);
|
||||
|
||||
snd_play_3d( &Snds[mtp->stop_snd], &mtp->pos, &Eye_position, 0.0f, &obj->phys_info.vel );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !(shipp->flags & SF_DISABLED) && !ship_subsys_disrupted(shipp, SUBSYSTEM_ENGINE) && show_thrusters) {
|
||||
mst_info mst;
|
||||
|
||||
mst.length.xyz.z = obj->phys_info.forward_thrust;
|
||||
mst.length.xyz.x = obj->phys_info.side_thrust;
|
||||
mst.length.xyz.y = obj->phys_info.vert_thrust;
|
||||
|
||||
// Maybe add noise to thruster geometry.
|
||||
if (!(sip->flags2 & SIF2_NO_THRUSTER_GEO_NOISE)) {
|
||||
mst.length.xyz.z *= (1.0f + frand()/5.0f - 0.1f);
|
||||
mst.length.xyz.y *= (1.0f + frand()/5.0f - 0.1f);
|
||||
mst.length.xyz.x *= (1.0f + frand()/5.0f - 0.1f);
|
||||
}
|
||||
|
||||
CLAMP(mst.length.xyz.z, -1.0f, 1.0f);
|
||||
CLAMP(mst.length.xyz.y, -1.0f, 1.0f);
|
||||
CLAMP(mst.length.xyz.x, -1.0f, 1.0f);
|
||||
|
||||
mst.primary_bitmap = shipp->thruster_bitmap;
|
||||
mst.primary_glow_bitmap = shipp->thruster_glow_bitmap;
|
||||
mst.secondary_glow_bitmap = shipp->thruster_secondary_glow_bitmap;
|
||||
mst.tertiary_glow_bitmap = shipp->thruster_tertiary_glow_bitmap;
|
||||
mst.distortion_bitmap = shipp->thruster_distortion_bitmap;
|
||||
|
||||
mst.use_ab = (obj->phys_info.flags & PF_AFTERBURNER_ON) || (obj->phys_info.flags & PF_BOOSTER_ON);
|
||||
mst.glow_noise = shipp->thruster_glow_noise * sip->thruster_glow_noise_mult;
|
||||
mst.rotvel = Objects[shipp->objnum].phys_info.rotvel;
|
||||
|
||||
mst.glow_rad_factor = sip->thruster01_glow_rad_factor;
|
||||
mst.secondary_glow_rad_factor = sip->thruster02_glow_rad_factor;
|
||||
mst.tertiary_glow_rad_factor = sip->thruster03_glow_rad_factor;
|
||||
mst.glow_length_factor = sip->thruster02_glow_len_factor;
|
||||
mst.distortion_length_factor = sip->thruster_dist_len_factor;
|
||||
mst.distortion_rad_factor = sip->thruster_dist_rad_factor;
|
||||
|
||||
mst.draw_distortion = sip->draw_distortion;
|
||||
|
||||
model_set_thrust(sip->model_num, &mst);
|
||||
|
||||
render_flags |= MR_DEPRECATED_SHOW_THRUSTERS;
|
||||
}
|
||||
|
||||
// fill the model flash lighting values in
|
||||
shipfx_flash_light_model( obj, sip->model_num );
|
||||
|
||||
|
||||
// If the ship is going "through" the warp effect, then
|
||||
// set up the model renderer to only draw the polygons in front
|
||||
// of the warp in effect
|
||||
int clip_started = 0;
|
||||
|
||||
// Warp_shipp points to the ship that is going through a
|
||||
// warp... either this ship or the ship it is docked with.
|
||||
if ( warp_shipp != NULL )
|
||||
{
|
||||
if(warp_shipp->flags & SF_ARRIVING)
|
||||
clip_started = warp_shipp->warpin_effect->warpShipClip();
|
||||
else if(warp_shipp->flags & SF_DEPART_WARP)
|
||||
clip_started = warp_shipp->warpout_effect->warpShipClip();
|
||||
}
|
||||
|
||||
// maybe set squad logo bitmap
|
||||
model_set_insignia_bitmap(-1);
|
||||
if(!Rendering_to_shadow_map)
|
||||
{
|
||||
if(Game_mode & GM_MULTIPLAYER){
|
||||
// if its any player's object
|
||||
int np_index = multi_find_player_by_object( obj );
|
||||
if((np_index >= 0) && (np_index < MAX_PLAYERS) && MULTI_CONNECTED(Net_players[np_index]) && (Net_players[np_index].m_player != NULL)){
|
||||
model_set_insignia_bitmap(Net_players[np_index].m_player->insignia_texture);
|
||||
}
|
||||
}
|
||||
// in single player, we want to render model insignias on all ships in alpha beta and gamma
|
||||
// Goober5000 - and also on wings that have their logos set
|
||||
else {
|
||||
// if its an object in my squadron
|
||||
if(ship_in_my_squadron(shipp)) {
|
||||
model_set_insignia_bitmap(Player->insignia_texture);
|
||||
}
|
||||
|
||||
// maybe it has a wing squad logo - Goober5000
|
||||
if (shipp->wingnum >= 0)
|
||||
{
|
||||
// don't override the player's wing
|
||||
if (shipp->wingnum != Player_ship->wingnum)
|
||||
{
|
||||
// if we have a logo texture
|
||||
if (Wings[shipp->wingnum].wing_insignia_texture >= 0)
|
||||
{
|
||||
model_set_insignia_bitmap(Wings[shipp->wingnum].wing_insignia_texture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// nebula
|
||||
if(The_mission.flags & MISSION_FLAG_FULLNEB){
|
||||
extern void model_set_fog_level(float l);
|
||||
model_set_fog_level(neb2_get_fog_intensity(obj));
|
||||
}
|
||||
|
||||
// Valathil - maybe do a scripting hook here to do some scriptable effects?
|
||||
if(shipp->shader_effect_active && is_minimum_GLSL_version())
|
||||
{
|
||||
float timer;
|
||||
render_flags |= (MR_DEPRECATED_ANIMATED_SHADER);
|
||||
|
||||
ship_effect* sep = &Ship_effects[shipp->shader_effect_num];
|
||||
|
||||
if (sep->invert_timer) {
|
||||
timer = 1.0f - ((timer_get_milliseconds() - shipp->shader_effect_start_time) / (float)shipp->shader_effect_duration);
|
||||
timer = MAX(timer,0.0f);
|
||||
} else {
|
||||
timer = ((timer_get_milliseconds() - shipp->shader_effect_start_time) / (float)shipp->shader_effect_duration);
|
||||
}
|
||||
|
||||
model_interp_set_animated_effect_and_timer(sep->shader_effect, timer);
|
||||
|
||||
if (sep->disables_rendering && (timer_get_milliseconds() > shipp->shader_effect_start_time + shipp->shader_effect_duration) ) {
|
||||
shipp->flags2 |= SF2_CLOAKED;
|
||||
shipp->shader_effect_active = false;
|
||||
} else {
|
||||
shipp->flags2 &= ~SF2_CLOAKED;
|
||||
if (timer_get_milliseconds() > shipp->shader_effect_start_time + shipp->shader_effect_duration)
|
||||
shipp->shader_effect_active = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (sip->uses_team_colors) {
|
||||
model_interp_set_team_color(shipp->team_name, shipp->secondary_team_name, shipp->team_change_timestamp, shipp->team_change_time);
|
||||
}
|
||||
|
||||
if(sip->flags2 & SIF2_NO_LIGHTING)
|
||||
render_flags |= MR_DEPRECATED_NO_LIGHTING;
|
||||
}
|
||||
if(Rendering_to_shadow_map)
|
||||
render_flags = MR_DEPRECATED_NO_TEXTURING | MR_DEPRECATED_NO_LIGHTING;
|
||||
|
||||
//draw weapon models
|
||||
if ((sip->flags2 & SIF2_DRAW_WEAPON_MODELS) && !(shipp->flags2 & SF2_CLOAKED)) {
|
||||
int i,k;
|
||||
ship_weapon *swp = &shipp->weapons;
|
||||
g3_start_instance_matrix(&obj->pos, &obj->orient, true);
|
||||
|
||||
int save_flags = render_flags;
|
||||
|
||||
render_flags &= ~MR_DEPRECATED_SHOW_THRUSTERS;
|
||||
render_flags |= MR_DEPRECATED_ATTACHED_MODEL;
|
||||
|
||||
//primary weapons
|
||||
for (i = 0; i < swp->num_primary_banks; i++) {
|
||||
if (Weapon_info[swp->primary_bank_weapons[i]].external_model_num == -1 || !sip->draw_primary_models[i])
|
||||
continue;
|
||||
|
||||
w_bank *bank = &model_get(sip->model_num)->gun_banks[i];
|
||||
for(k = 0; k < bank->num_slots; k++) {
|
||||
polymodel* pm = model_get(Weapon_info[swp->primary_bank_weapons[i]].external_model_num);
|
||||
pm->gun_submodel_rotation = shipp->primary_rotate_ang[i];
|
||||
model_render_DEPRECATED(Weapon_info[swp->primary_bank_weapons[i]].external_model_num, &vmd_identity_matrix, &bank->pnt[k], render_flags, shipp->objnum);
|
||||
pm->gun_submodel_rotation = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
//secondary weapons
|
||||
int num_secondaries_rendered = 0;
|
||||
vec3d secondary_weapon_pos;
|
||||
w_bank* bank;
|
||||
|
||||
for (i = 0; i < swp->num_secondary_banks; i++) {
|
||||
if (Weapon_info[swp->secondary_bank_weapons[i]].external_model_num == -1 || !sip->draw_secondary_models[i])
|
||||
continue;
|
||||
|
||||
bank = &(model_get(sip->model_num))->missile_banks[i];
|
||||
|
||||
if (Weapon_info[swp->secondary_bank_weapons[i]].wi_flags2 & WIF2_EXTERNAL_WEAPON_LNCH) {
|
||||
for(k = 0; k < bank->num_slots; k++) {
|
||||
model_render_DEPRECATED(Weapon_info[swp->secondary_bank_weapons[i]].external_model_num, &vmd_identity_matrix, &bank->pnt[k], render_flags, shipp->objnum);
|
||||
}
|
||||
} else {
|
||||
num_secondaries_rendered = 0;
|
||||
|
||||
for(k = 0; k < bank->num_slots; k++)
|
||||
{
|
||||
secondary_weapon_pos = bank->pnt[k];
|
||||
|
||||
if (num_secondaries_rendered >= shipp->weapons.secondary_bank_ammo[i])
|
||||
break;
|
||||
|
||||
if(shipp->secondary_point_reload_pct[i][k] <= 0.0)
|
||||
continue;
|
||||
|
||||
num_secondaries_rendered++;
|
||||
|
||||
vm_vec_scale_add2(&secondary_weapon_pos, &vmd_z_vector, -(1.0f-shipp->secondary_point_reload_pct[i][k]) * model_get(Weapon_info[swp->secondary_bank_weapons[i]].external_model_num)->rad);
|
||||
|
||||
model_render_DEPRECATED(Weapon_info[swp->secondary_bank_weapons[i]].external_model_num, &vmd_identity_matrix, &secondary_weapon_pos, render_flags, shipp->objnum);
|
||||
}
|
||||
}
|
||||
}
|
||||
g3_done_instance(true);
|
||||
render_flags = save_flags;
|
||||
}
|
||||
|
||||
// small ships
|
||||
if (!(shipp->flags2 & SF2_CLOAKED)) {
|
||||
if ((The_mission.flags & MISSION_FLAG_FULLNEB) && (sip->flags & SIF_SMALL_SHIP)) {
|
||||
// force detail levels
|
||||
float fog_val = neb2_get_fog_intensity(obj);
|
||||
if(fog_val >= 0.6f){
|
||||
model_set_detail_level(2);
|
||||
model_render_DEPRECATED( sip->model_num, &obj->orient, &obj->pos, render_flags, OBJ_INDEX(obj), -1, shipp->ship_replacement_textures, ship_render_mode );
|
||||
} else {
|
||||
model_render_DEPRECATED( sip->model_num, &obj->orient, &obj->pos, render_flags, OBJ_INDEX(obj), -1, shipp->ship_replacement_textures, ship_render_mode );
|
||||
}
|
||||
} else {
|
||||
model_render_DEPRECATED( sip->model_num, &obj->orient, &obj->pos, render_flags, OBJ_INDEX(obj), -1, shipp->ship_replacement_textures, ship_render_mode );
|
||||
}
|
||||
}
|
||||
|
||||
// always turn off fog after rendering a ship
|
||||
gr_fog_set(GR_FOGMODE_NONE, 0, 0, 0);
|
||||
light_set_shadow(0);
|
||||
|
||||
#ifndef NDEBUG
|
||||
if (Show_shield_mesh)
|
||||
ship_draw_shield( obj); // Render the shield.
|
||||
#endif
|
||||
|
||||
if ( clip_started ) {
|
||||
g3_stop_user_clip_plane();
|
||||
}
|
||||
}
|
||||
|
||||
ship_model_stop(obj);
|
||||
|
||||
if (shipp->shield_hits && !Rendering_to_shadow_map) {
|
||||
create_shield_explosion_all(obj);
|
||||
shipp->shield_hits = 0;
|
||||
}
|
||||
|
||||
#ifndef NDEBUG
|
||||
if (Ai_render_debug_flag || Show_paths) {
|
||||
if ( shipp->ai_index != -1 ){
|
||||
render_path_points(obj);
|
||||
}
|
||||
|
||||
render_dock_bays(obj);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NDEBUG
|
||||
if(Show_tnorms){
|
||||
ship_subsys *systemp;
|
||||
vec3d tpos, tnorm, temp;
|
||||
vec3d v1, v2;
|
||||
vertex l1, l2;
|
||||
|
||||
gr_set_color(0, 0, 255);
|
||||
systemp = GET_FIRST( &shipp->subsys_list );
|
||||
while ( systemp != END_OF_LIST(&shipp->subsys_list) ) {
|
||||
ship_get_global_turret_gun_info(obj, systemp, &tpos, &tnorm, 1, &temp);
|
||||
|
||||
v1 = tpos;
|
||||
vm_vec_scale_add(&v2, &v1, &tnorm, 20.0f);
|
||||
|
||||
g3_rotate_vertex(&l1, &v1);
|
||||
g3_rotate_vertex(&l2, &v2);
|
||||
|
||||
g3_draw_sphere(&l1, 2.0f);
|
||||
g3_draw_line(&l1, &l2);
|
||||
|
||||
systemp = GET_NEXT(systemp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//WMC - Draw animated warp effect (ie BSG thingy)
|
||||
//WMC - based on Bobb's secondary thruster stuff
|
||||
//which was in turn based on the beam code.
|
||||
//I'm gonna need some serious acid to neutralize this base.
|
||||
if(shipp->flags & SF_ARRIVING)
|
||||
shipp->warpin_effect->warpShipRender();
|
||||
else if(shipp->flags & SF_DEPART_WARP)
|
||||
shipp->warpout_effect->warpShipRender();
|
||||
}
|
||||
|
||||
void ship_render_cockpit(object *objp)
|
||||
{
|
||||
|
||||
@@ -1612,7 +1612,6 @@ extern void change_ship_type(int n, int ship_type, int by_sexp = 0);
|
||||
extern void ship_model_change(int n, int ship_type);
|
||||
extern void ship_process_pre( object * objp, float frametime );
|
||||
extern void ship_process_post( object * objp, float frametime );
|
||||
extern void ship_render_DEPRECATED( object * objp );
|
||||
extern void ship_render( object * obj, draw_list * scene );
|
||||
extern void ship_render_cockpit( object * objp);
|
||||
extern void ship_render_show_ship_cockpit( object * objp);
|
||||
|
||||
@@ -1808,98 +1808,6 @@ static void split_ship_init( ship* shipp, split_ship* split_shipp )
|
||||
shipfx_maybe_create_live_debris_at_ship_death( parent_ship_obj );
|
||||
}
|
||||
|
||||
|
||||
static void half_ship_render_ship_and_debris(clip_ship* half_ship,ship *shipp)
|
||||
{
|
||||
polymodel *pm = model_get(Ship_info[shipp->ship_info_index].model_num);
|
||||
|
||||
// get rotated clip plane normal and world coord of original ship center
|
||||
vec3d orig_ship_world_center, clip_plane_norm, model_clip_plane_pt, debris_clip_plane_pt;
|
||||
vm_vec_unrotate(&clip_plane_norm, &half_ship->clip_plane_norm, &half_ship->orient);
|
||||
vm_vec_unrotate(&orig_ship_world_center, &half_ship->model_center_disp_to_orig_center, &half_ship->orient);
|
||||
vm_vec_add2(&orig_ship_world_center, &half_ship->local_pivot);
|
||||
|
||||
// get debris clip plane pt and draw debris
|
||||
vm_vec_unrotate(&debris_clip_plane_pt, &half_ship->model_center_disp_to_orig_center, &half_ship->orient);
|
||||
vm_vec_add2(&debris_clip_plane_pt, &half_ship->local_pivot);
|
||||
g3_start_user_clip_plane( &debris_clip_plane_pt, &clip_plane_norm);
|
||||
|
||||
// set up render flags
|
||||
uint render_flags = MR_DEPRECATED_NORMAL;
|
||||
|
||||
for (int i=0; i<pm->num_debris_objects; i++ ) {
|
||||
// draw DEBRIS_FREE in test only
|
||||
if (half_ship->draw_debris[i] == DEBRIS_DRAW) {
|
||||
vec3d temp_pos = orig_ship_world_center;
|
||||
vec3d tmp = ZERO_VECTOR;
|
||||
vec3d tmp1 = pm->submodel[pm->debris_objects[i]].offset;
|
||||
|
||||
// determine if explosion front has past debris piece
|
||||
// 67 ~ dist expl moves in 2 frames -- maybe fraction works better
|
||||
int is_live_debris = pm->submodel[pm->debris_objects[i]].is_live_debris;
|
||||
int create_debris = 0;
|
||||
// front ship
|
||||
if (half_ship->explosion_vel > 0) {
|
||||
if (half_ship->cur_clip_plane_pt > tmp1.xyz.z + pm->submodel[pm->debris_objects[i]].max.xyz.z - 0.1f*half_ship->explosion_vel) {
|
||||
create_debris = 1;
|
||||
}
|
||||
// back ship
|
||||
} else {
|
||||
if (half_ship->cur_clip_plane_pt < tmp1.xyz.z + pm->submodel[pm->debris_objects[i]].min.xyz.z - 0.1f*half_ship->explosion_vel) {
|
||||
create_debris = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Draw debris, but not live debris
|
||||
if ( !is_live_debris ) {
|
||||
model_find_world_point(&tmp, &tmp1, pm->id, -1, &half_ship->orient, &temp_pos);
|
||||
submodel_render_DEPRECATED(pm->id, pm->debris_objects[i], &half_ship->orient, &tmp, render_flags, -1, shipp->ship_replacement_textures);
|
||||
}
|
||||
|
||||
// make free piece of debris
|
||||
if ( create_debris ) {
|
||||
half_ship->draw_debris[i] = DEBRIS_FREE; // mark debris to not render with model
|
||||
vec3d center_to_debris, debris_vel, radial_vel;
|
||||
// check if last debris piece, ie, debris_count == 0
|
||||
int debris_count = 0;
|
||||
for (int j=0; j<pm->num_debris_objects; j++ ) {
|
||||
if (half_ship->draw_debris[j] == DEBRIS_DRAW) {
|
||||
debris_count++;
|
||||
}
|
||||
}
|
||||
// do debris create here, but not for live debris
|
||||
// debris vel (1) split ship vel (2) split ship rotvel (3) random
|
||||
if ( !is_live_debris ) {
|
||||
object* debris_obj;
|
||||
debris_obj = debris_create(half_ship->parent_obj, pm->id, pm->debris_objects[i], &tmp, &half_ship->local_pivot, 1, 1.0f);
|
||||
// AL: make sure debris_obj isn't NULL!
|
||||
if ( debris_obj ) {
|
||||
vm_vec_scale(&debris_obj->phys_info.rotvel, 4.0f);
|
||||
debris_obj->orient = half_ship->orient;
|
||||
|
||||
vm_vec_sub(¢er_to_debris, &tmp, &half_ship->local_pivot);
|
||||
vm_vec_cross(&debris_vel, ¢er_to_debris, &half_ship->phys_info.rotvel);
|
||||
vm_vec_add2(&debris_vel, &half_ship->phys_info.vel);
|
||||
vm_vec_copy_normalize(&radial_vel, ¢er_to_debris);
|
||||
float radial_mag = 10.0f + 30.0f*frand();
|
||||
vm_vec_scale_add2(&debris_vel, &radial_vel, radial_mag);
|
||||
debris_obj->phys_info.vel = debris_vel;
|
||||
shipfx_debris_limit_speed(&Debris[debris_obj->instance], shipp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// get model clip plane pt and draw model
|
||||
vec3d temp;
|
||||
vm_vec_make(&temp, 0.0f, 0.0f, half_ship->cur_clip_plane_pt);
|
||||
vm_vec_unrotate(&model_clip_plane_pt, &temp, &half_ship->orient);
|
||||
vm_vec_add2(&model_clip_plane_pt, &orig_ship_world_center);
|
||||
g3_start_user_clip_plane( &model_clip_plane_pt, &clip_plane_norm );
|
||||
model_render_DEPRECATED(pm->id, &half_ship->orient, &orig_ship_world_center, render_flags, -1, -1, shipp->ship_replacement_textures);
|
||||
}
|
||||
|
||||
void shipfx_queue_render_ship_halves_and_debris(draw_list *scene, clip_ship* half_ship, ship *shipp)
|
||||
{
|
||||
polymodel *pm = model_get(Ship_info[shipp->ship_info_index].model_num);
|
||||
@@ -2371,25 +2279,6 @@ int shipfx_large_blowup_do_frame(ship *shipp, float frametime)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void shipfx_large_blowup_render(ship* shipp)
|
||||
{
|
||||
Assert( shipp->large_ship_blowup_index > -1 );
|
||||
Assert( shipp->large_ship_blowup_index < (int)Split_ships.size() );
|
||||
|
||||
split_ship *the_split_ship = &Split_ships[shipp->large_ship_blowup_index];
|
||||
Assert( the_split_ship->used ); // Get John
|
||||
|
||||
if (the_split_ship->front_ship.length_left > 0) {
|
||||
half_ship_render_ship_and_debris(&the_split_ship->front_ship,shipp);
|
||||
}
|
||||
|
||||
if (the_split_ship->back_ship.length_left > 0) {
|
||||
half_ship_render_ship_and_debris(&the_split_ship->back_ship,shipp);
|
||||
}
|
||||
|
||||
g3_stop_user_clip_plane();
|
||||
}
|
||||
|
||||
void shipfx_large_blowup_queue_render(draw_list *scene, ship* shipp)
|
||||
{
|
||||
Assert( shipp->large_ship_blowup_index > -1 );
|
||||
|
||||
@@ -111,8 +111,6 @@ void shipfx_large_blowup_init(ship *shipp);
|
||||
// Returns 1 when explosion is done
|
||||
int shipfx_large_blowup_do_frame(ship *shipp, float frametime);
|
||||
|
||||
void shipfx_large_blowup_render(ship *shipp);
|
||||
|
||||
void shipfx_large_blowup_queue_render(draw_list *scene, ship* shipp);
|
||||
|
||||
void shipfx_debris_limit_speed(struct debris *db, ship *shipp);
|
||||
|
||||
@@ -356,80 +356,11 @@ void shockwave_move(object *shockwave_objp, float frametime)
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw the shockwave identified by handle
|
||||
*
|
||||
* @param objp pointer to shockwave object
|
||||
*/
|
||||
void shockwave_render_DEPRECATED(object *objp)
|
||||
{
|
||||
shockwave *sw;
|
||||
vertex p;
|
||||
|
||||
Assert(objp->type == OBJ_SHOCKWAVE);
|
||||
Assert(objp->instance >= 0 && objp->instance < MAX_SHOCKWAVES);
|
||||
|
||||
memset(&p, 0, sizeof(p));
|
||||
sw = &Shockwaves[objp->instance];
|
||||
|
||||
if( (sw->delay_stamp != -1) && !timestamp_elapsed(sw->delay_stamp)){
|
||||
return;
|
||||
}
|
||||
|
||||
if ( (sw->current_bitmap < 0) && (sw->model_id < 0) )
|
||||
return;
|
||||
|
||||
// turn off fogging
|
||||
if(The_mission.flags & MISSION_FLAG_FULLNEB){
|
||||
gr_fog_set(GR_FOGMODE_NONE, 0, 0, 0);
|
||||
}
|
||||
|
||||
if (sw->model_id > -1) {
|
||||
float model_Interp_scale_xyz = sw->radius / 50.0f;
|
||||
|
||||
model_set_warp_globals( model_Interp_scale_xyz, model_Interp_scale_xyz, model_Interp_scale_xyz, -1, 1.0f - (sw->radius/sw->outer_radius) );
|
||||
|
||||
float dist = vm_vec_dist_quick( &sw->pos, &Eye_position );
|
||||
|
||||
model_set_detail_level((int)(dist / (sw->radius * 10.0f)));
|
||||
model_render_DEPRECATED( sw->model_id, &Objects[sw->objnum].orient, &sw->pos, MR_DEPRECATED_NO_LIGHTING | MR_DEPRECATED_NO_FOGGING | MR_DEPRECATED_NORMAL | MR_DEPRECATED_CENTER_ALPHA | MR_DEPRECATED_NO_CULL, sw->objnum);
|
||||
|
||||
model_set_warp_globals();
|
||||
if(Cmdline_fb_explosions)
|
||||
{
|
||||
g3_transfer_vertex(&p, &sw->pos);
|
||||
|
||||
distortion_add_bitmap_rotated(
|
||||
Shockwave_info[1].bitmap_id+shockwave_get_framenum(objp->instance, Shockwave_info[1].bitmap_id),
|
||||
TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT | TMAP_FLAG_SOFT_QUAD | TMAP_FLAG_DISTORTION,
|
||||
&p,
|
||||
fl_radians(sw->rot_angles.p),
|
||||
sw->radius,
|
||||
((sw->time_elapsed/sw->total_time)>0.9f)?(1.0f-(sw->time_elapsed/sw->total_time))*10.0f:1.0f
|
||||
);
|
||||
}
|
||||
}else{
|
||||
g3_transfer_vertex(&p, &sw->pos);
|
||||
if(Cmdline_fb_explosions)
|
||||
{
|
||||
distortion_add_bitmap_rotated(
|
||||
sw->current_bitmap,
|
||||
TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT | TMAP_FLAG_SOFT_QUAD | TMAP_FLAG_DISTORTION,
|
||||
&p,
|
||||
fl_radians(sw->rot_angles.p),
|
||||
sw->radius,
|
||||
((sw->time_elapsed/sw->total_time)>0.9f)?(1.0f-(sw->time_elapsed/sw->total_time))*10.0f:1.0f
|
||||
);
|
||||
}
|
||||
batch_add_bitmap_rotated(
|
||||
sw->current_bitmap,
|
||||
TMAP_FLAG_TEXTURED | TMAP_HTL_3D_UNLIT | TMAP_FLAG_SOFT_QUAD,
|
||||
&p,
|
||||
fl_radians(sw->rot_angles.p),
|
||||
sw->radius
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
* Draw the shockwave identified by handle
|
||||
*
|
||||
* @param objp pointer to shockwave object
|
||||
* @param scene the scene's draw list we're adding this to
|
||||
*/
|
||||
void shockwave_render(object *objp, draw_list *scene)
|
||||
{
|
||||
shockwave *sw;
|
||||
@@ -686,22 +617,6 @@ void shockwave_move_all(float frametime)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render all shockwaves
|
||||
*/
|
||||
void shockwave_render_all()
|
||||
{
|
||||
shockwave *sw, *next;
|
||||
|
||||
sw = GET_FIRST(&Shockwave_list);
|
||||
while ( sw != &Shockwave_list ) {
|
||||
next = sw->next;
|
||||
Assert(sw->objnum != -1);
|
||||
shockwave_render_DEPRECATED(&Objects[sw->objnum]);
|
||||
sw = next;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the weapon_info_index field for a shockwave
|
||||
*/
|
||||
|
||||
@@ -94,7 +94,6 @@ void shockwave_level_close();
|
||||
void shockwave_delete(object *objp);
|
||||
void shockwave_move_all(float frametime);
|
||||
int shockwave_create(int parent_objnum, vec3d *pos, shockwave_create_info *sci, int flag, int delay = -1);
|
||||
void shockwave_render_DEPRECATED(object *objp);
|
||||
void shockwave_render(object *objp, draw_list *scene);
|
||||
int shockwave_load(char *s_name, bool shock_3D = false);
|
||||
|
||||
|
||||
@@ -617,7 +617,6 @@ int weapon_info_lookup(const char *name = NULL);
|
||||
void weapon_init(); // called at game startup
|
||||
void weapon_close(); // called at game shutdown
|
||||
void weapon_level_init(); // called before the start of each level
|
||||
void weapon_render_DEPRECATED(object * obj);
|
||||
void weapon_render(object* obj, draw_list *scene);
|
||||
void weapon_delete( object * obj );
|
||||
void weapon_process_pre( object *obj, float frame_time);
|
||||
|
||||
@@ -3622,192 +3622,6 @@ const float weapon_glow_scale_r = 2.3f;
|
||||
const float weapon_glow_scale_l = 1.5f;
|
||||
const int weapon_glow_alpha = 217; // (0.85 * 255);
|
||||
|
||||
void weapon_render_DEPRECATED(object *obj)
|
||||
{
|
||||
int num;
|
||||
weapon_info *wip;
|
||||
weapon *wp;
|
||||
color c;
|
||||
|
||||
MONITOR_INC(NumWeaponsRend, 1);
|
||||
|
||||
Assert(obj->type == OBJ_WEAPON);
|
||||
|
||||
num = obj->instance;
|
||||
wp = &Weapons[num];
|
||||
wip = &Weapon_info[Weapons[num].weapon_info_index];
|
||||
|
||||
if (wip->wi_flags2 & WIF2_TRANSPARENT) {
|
||||
if (wp->alpha_current == -1.0f) {
|
||||
wp->alpha_current = wip->alpha_max;
|
||||
} else if (wip->alpha_cycle > 0.0f) {
|
||||
if (wp->alpha_backward) {
|
||||
wp->alpha_current += wip->alpha_cycle;
|
||||
|
||||
if (wp->alpha_current > wip->alpha_max) {
|
||||
wp->alpha_current = wip->alpha_max;
|
||||
wp->alpha_backward = 0;
|
||||
}
|
||||
} else {
|
||||
wp->alpha_current -= wip->alpha_cycle;
|
||||
|
||||
if (wp->alpha_current < wip->alpha_min) {
|
||||
wp->alpha_current = wip->alpha_min;
|
||||
wp->alpha_backward = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (wip->render_type)
|
||||
{
|
||||
case WRT_LASER:
|
||||
{
|
||||
if(wip->laser_length < 0.0001f)
|
||||
return;
|
||||
// turn off fogging for good measure
|
||||
gr_fog_set(GR_FOGMODE_NONE, 0, 0, 0);
|
||||
int alpha = 255;
|
||||
int framenum = 0;
|
||||
|
||||
if (wip->laser_bitmap.first_frame >= 0) {
|
||||
gr_set_color_fast(&wip->laser_color_1);
|
||||
|
||||
if (wip->laser_bitmap.num_frames > 1) {
|
||||
wp->laser_bitmap_frame += flFrametime;
|
||||
|
||||
framenum = bm_get_anim_frame(wip->laser_bitmap.first_frame, wp->laser_bitmap_frame, wip->laser_bitmap.total_time, true);
|
||||
}
|
||||
|
||||
if (wip->wi_flags2 & WIF2_TRANSPARENT)
|
||||
alpha = fl2i(wp->alpha_current * 255.0f);
|
||||
|
||||
vec3d headp;
|
||||
|
||||
vm_vec_scale_add(&headp, &obj->pos, &obj->orient.vec.fvec, wip->laser_length);
|
||||
wp->weapon_flags &= ~WF_CONSIDER_FOR_FLYBY_SOUND;
|
||||
|
||||
if ( batch_add_laser(wip->laser_bitmap.first_frame + framenum, &headp, wip->laser_head_radius, &obj->pos, wip->laser_tail_radius, alpha, alpha, alpha) ) {
|
||||
wp->weapon_flags |= WF_CONSIDER_FOR_FLYBY_SOUND;
|
||||
}
|
||||
}
|
||||
|
||||
// maybe draw laser glow bitmap
|
||||
if (wip->laser_glow_bitmap.first_frame >= 0) {
|
||||
// get the laser color
|
||||
weapon_get_laser_color(&c, obj);
|
||||
|
||||
// *Tail point "getting bigger" as well as headpoint isn't being taken into consideration, so
|
||||
// it caused uneven glow between the head and tail, which really shows in big lasers. So...fixed! -Et1
|
||||
vec3d headp2, tailp;
|
||||
|
||||
vm_vec_scale_add(&headp2, &obj->pos, &obj->orient.vec.fvec, wip->laser_length * weapon_glow_scale_l);
|
||||
vm_vec_scale_add(&tailp, &obj->pos, &obj->orient.vec.fvec, wip->laser_length * (1 - weapon_glow_scale_l) );
|
||||
|
||||
framenum = 0;
|
||||
|
||||
if (wip->laser_glow_bitmap.num_frames > 1) {
|
||||
wp->laser_glow_bitmap_frame += flFrametime;
|
||||
|
||||
// Sanity checks
|
||||
if (wp->laser_glow_bitmap_frame < 0.0f)
|
||||
wp->laser_glow_bitmap_frame = 0.0f;
|
||||
if (wp->laser_glow_bitmap_frame > 100.0f)
|
||||
wp->laser_glow_bitmap_frame = 0.0f;
|
||||
|
||||
while (wp->laser_glow_bitmap_frame > wip->laser_glow_bitmap.total_time)
|
||||
wp->laser_glow_bitmap_frame -= wip->laser_glow_bitmap.total_time;
|
||||
|
||||
framenum = fl2i( (wp->laser_glow_bitmap_frame * wip->laser_glow_bitmap.num_frames) / wip->laser_glow_bitmap.total_time );
|
||||
|
||||
CLAMP(framenum, 0, wip->laser_glow_bitmap.num_frames-1);
|
||||
}
|
||||
|
||||
if (wip->wi_flags2 & WIF2_TRANSPARENT) {
|
||||
alpha = fl2i(wp->alpha_current * 255.0f);
|
||||
alpha -= 38; // take 1.5f into account for the normal glow alpha
|
||||
|
||||
if (alpha < 0)
|
||||
alpha = 0;
|
||||
} else {
|
||||
alpha = weapon_glow_alpha;
|
||||
}
|
||||
|
||||
batch_add_laser(wip->laser_glow_bitmap.first_frame + framenum, &headp2, wip->laser_head_radius * weapon_glow_scale_f, &tailp, wip->laser_tail_radius * weapon_glow_scale_r, (c.red*alpha)/255, (c.green*alpha)/255, (c.blue*alpha)/255);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case WRT_POF:
|
||||
{
|
||||
uint render_flags = MR_DEPRECATED_NORMAL|MR_DEPRECATED_IS_MISSILE|MR_DEPRECATED_NO_LIGHTING;
|
||||
|
||||
if (Cmdline_missile_lighting && !(wip->wi_flags2 & WIF2_MR_NO_LIGHTING))
|
||||
render_flags &= ~MR_DEPRECATED_NO_LIGHTING;
|
||||
|
||||
if (wip->wi_flags2 & WIF2_TRANSPARENT) {
|
||||
model_set_alpha(wp->alpha_current);
|
||||
render_flags |= MR_DEPRECATED_ALL_XPARENT;
|
||||
}
|
||||
|
||||
model_clear_instance(wip->model_num);
|
||||
|
||||
if ( (wip->wi_flags & WIF_THRUSTER) && ((wp->thruster_bitmap > -1) || (wp->thruster_glow_bitmap > -1)) ) {
|
||||
float ft;
|
||||
mst_info mst;
|
||||
|
||||
// Add noise to thruster geometry.
|
||||
ft = 1.0f; // Always use 1.0f for missiles
|
||||
ft *= (1.0f + frand()/5.0f - 1.0f/10.0f);
|
||||
if (ft > 1.0f)
|
||||
ft = 1.0f;
|
||||
|
||||
mst.length.xyz.x = ft;
|
||||
mst.length.xyz.y = ft;
|
||||
mst.length.xyz.z = ft;
|
||||
|
||||
mst.primary_bitmap = wp->thruster_bitmap;
|
||||
mst.primary_glow_bitmap = wp->thruster_glow_bitmap;
|
||||
mst.glow_rad_factor = wip->thruster_glow_factor;
|
||||
mst.glow_noise = wp->thruster_glow_noise;
|
||||
|
||||
model_set_thrust(wip->model_num, &mst);
|
||||
|
||||
render_flags |= MR_DEPRECATED_SHOW_THRUSTERS;
|
||||
}
|
||||
|
||||
|
||||
//don't render local ssm's when they are still in subspace
|
||||
if (wp->lssm_stage==3)
|
||||
break;
|
||||
|
||||
int clip_plane=0;
|
||||
|
||||
//start a clip plane
|
||||
if (wp->lssm_stage==2)
|
||||
{
|
||||
object *wobj=&Objects[wp->lssm_warp_idx]; //warphole object
|
||||
clip_plane=1;
|
||||
|
||||
g3_start_user_clip_plane(&wobj->pos,&wobj->orient.vec.fvec);
|
||||
}
|
||||
|
||||
|
||||
model_render_DEPRECATED(wip->model_num, &obj->orient, &obj->pos, render_flags);
|
||||
wp->weapon_flags |= WF_CONSIDER_FOR_FLYBY_SOUND;
|
||||
if (clip_plane)
|
||||
{
|
||||
g3_stop_user_clip_plane();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
Warning(LOCATION, "Unknown weapon rendering type = %i for weapon %s\n", wip->render_type, wip->name);
|
||||
}
|
||||
}
|
||||
|
||||
void weapon_delete(object *obj)
|
||||
{
|
||||
weapon *wp;
|
||||
|
||||
Reference in new issue
Block a user