Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The definitive Particle Effect rework #6465

Merged
merged 71 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
7d10ed4
Removal of effects, pt. 1
BMagnu Aug 21, 2024
97dbd2f
Removal of effects, pt. 2
BMagnu Aug 21, 2024
2f2e8b2
Remove particle_effect and ParticleType
BMagnu Aug 21, 2024
5dfc210
Fix bugs from particle_emitter refactor
BMagnu Aug 27, 2024
e5afc04
Add OmniEffect
BMagnu Sep 15, 2024
efed464
Code volumes
BMagnu Sep 15, 2024
989e216
Allow creating of OmniParticleEffects as needed for the non-part-tbm …
BMagnu Sep 16, 2024
e0c2ba7
Prepare for the removal of composite effects
BMagnu Sep 17, 2024
8503c8a
Start replacing legacy effects with omnieffect
BMagnu Sep 21, 2024
63a18b2
Update Ship and Supernova effects to Omni
BMagnu Sep 22, 2024
5304763
Replace final legacy effect with omni effect
BMagnu Sep 22, 2024
db4ec11
Remove redundant effects
BMagnu Sep 22, 2024
09d8ffe
Do legacy parsin
BMagnu Sep 24, 2024
562c39d
fix parse
BMagnu Sep 24, 2024
0ec845b
Make builtin particle sources actually anonymous
BMagnu Sep 24, 2024
b9b7a13
Fix source bugs
BMagnu Sep 24, 2024
9247378
Fix correct random range constructor overlaod
BMagnu Sep 24, 2024
8e1474f
Account for negative velocities in particle setup for weapons
BMagnu Oct 22, 2024
2bba61a
Account for negative velocities in particle setup for weapons, again
BMagnu Oct 22, 2024
39c6dc7
Fix default ship particle parameters
BMagnu Oct 22, 2024
9b2d069
Actually apply rotation to the cone volume
BMagnu Oct 22, 2024
c16dfba
Fix directional scaling
BMagnu Oct 22, 2024
a79c23b
Add orientation-based velocity inherit for beampiercingeffects
BMagnu Oct 23, 2024
c937bc6
Actually get rid of particle emitters
BMagnu Oct 23, 2024
bd1792d
Move Effect timing into the ParticleSource.
BMagnu Oct 24, 2024
c513ab5
Fix legacy particle lifetime when built-in bitmap is used
BMagnu Oct 25, 2024
c0f5b0b
Properly deal with always-particle sources
BMagnu Oct 27, 2024
bb3e508
Fix particle end conditions and vector-based orientations for offset
BMagnu Oct 27, 2024
e28671f
Assign the correct flash particle variable
BMagnu Oct 28, 2024
98ddb15
Add sensible particle host class
BMagnu Nov 1, 2024
1aa67c9
Properly use new effect host
BMagnu Nov 2, 2024
e2dbb46
Fold OmniEffect into ParticleEffect
BMagnu Nov 3, 2024
3d171eb
Remove EffectTiming
BMagnu Nov 3, 2024
1f79091
Remove particle properties
BMagnu Nov 3, 2024
32835b0
Small cleanups
BMagnu Nov 3, 2024
fe815f8
Set pre-curve lifetime for damage-spew and similar to 1
BMagnu Nov 3, 2024
189803a
Allow modern particles for ship / thruster particles
BMagnu Nov 14, 2024
50ac2b8
remove redundant function
BMagnu Nov 21, 2024
12ad35e
restore shield_impact_explosion_radius
BMagnu Dec 9, 2024
e955a7f
Merge branch 'master' into particle_cleanup
BMagnu Dec 10, 2024
6050821
make modular_curves work with member funcs and smart pointers
BMagnu Dec 11, 2024
c205157
Basic modular curves for particles
BMagnu Dec 11, 2024
13e3f57
Deal with split particle velocity curves
BMagnu Dec 11, 2024
2ed3b62
Curvify thruster particles
BMagnu Dec 11, 2024
2aac63e
Allow particle volumes to have access to the source for modular curves
BMagnu Dec 11, 2024
7773b42
Typo
BMagnu Dec 11, 2024
5272604
Integrate type_traits
BMagnu Dec 10, 2024
40312e7
Add modular curve sets to volumes
BMagnu Dec 12, 2024
df4c123
Volume Parsing
BMagnu Dec 12, 2024
a2e14b0
Add parser modules for everything
BMagnu Dec 12, 2024
7390e68
Allow actual cones
BMagnu Dec 13, 2024
621d88e
Make length a modular curve output
BMagnu Dec 13, 2024
bcaac06
Modern basic particle parsing
BMagnu Dec 15, 2024
783ebba
Finish parsing
BMagnu Dec 16, 2024
b22716a
remove no longer required delay restriction
BMagnu Dec 16, 2024
8323d9e
Fix parsing
BMagnu Dec 16, 2024
ec027bd
Fix compile issues
BMagnu Dec 16, 2024
ec0e55d
De-movify random ranges
BMagnu Dec 16, 2024
d19f36a
Remove incorrect forward
BMagnu Dec 16, 2024
55bb209
Clang tends to have weird behaviour for is_convertible apparently
BMagnu Dec 16, 2024
6ab3d53
Fix template deduction for GCC pre 14
BMagnu Dec 16, 2024
aecc2ab
Fix macos target
BMagnu Dec 16, 2024
05259a5
Make sure that clang does accept implicit random range copy constructors
BMagnu Dec 16, 2024
a2a1910
More MSVC warnings + clang tidy
BMagnu Dec 16, 2024
284fb4a
Even More MSVC warnings
BMagnu Dec 16, 2024
a0e9f0d
Merge branch 'master' into particle_cleanup
BMagnu Jan 2, 2025
45c7ee1
Get rid of cast warnings on MSVC
BMagnu Jan 5, 2025
467bc32
Merge branch 'particle_cleanup' of github:BMagnu/fs2open.github.com i…
BMagnu Jan 5, 2025
5ce7881
Merge branch 'master' into particle_cleanup
BMagnu Jan 19, 2025
64bfc4a
Allow Submodel hosts for non-ship objects
BMagnu Jan 26, 2025
d9e859a
Remove Typo and fix volumetrics merge issue
BMagnu Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cmake/platform-darwin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ endif()

target_link_libraries(platform INTERFACE ${COCOA_LIBRARY})

SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.9")
# To support C++17 we need to target at least 10.13. maybe 10.14 for some rare features
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.13")

SET(CMAKE_SKIP_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
Expand Down
10 changes: 6 additions & 4 deletions code/actions/types/ParticleEffectAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include "math/vecmat.h"
#include "parse/parselo.h"
#include "particle/hosts/EffectHostObject.h"
#include "particle/ParticleManager.h"
#include "ship/ship.h"

#include <utility>
Expand Down Expand Up @@ -56,11 +58,11 @@ ActionResult ParticleEffectAction::execute(ProgramLocals& locals) const
local_pos += locals.variables.getValue({"locals", "position"}).getVector();

auto direction = locals.variables.getValue({"locals", "direction"}).getVector();
matrix orientation;
vm_vector_2_matrix(&orientation, &direction);

source.moveToObject(locals.host.objp(), &local_pos);
source.setOrientationFromNormalizedVec(&direction, true);

source.finish();
source->setHost(make_unique<EffectHostObject>(locals.host.objp(), local_pos, orientation, true));
source->finishCreation();

return ActionResult::Finished;
}
Expand Down
1 change: 0 additions & 1 deletion code/actions/types/ParticleEffectAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include "actions/Action.h"
#include "actions/expression/ActionExpression.h"
#include "particle/ParticleManager.h"

namespace actions {
namespace types {
Expand Down
10 changes: 4 additions & 6 deletions code/ai/aiturret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1994,9 +1994,8 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
if (wip->muzzle_effect.isValid()) {
//spawn particle effect
auto particleSource = particle::ParticleManager::get()->createSource(wip->muzzle_effect);
particleSource.moveToTurret(&Objects[parent_ship->objnum], turret->system_info->turret_gun_sobj, turret->turret_next_fire_pos);
particleSource.setVelocity(&Objects[parent_ship->objnum].phys_info.vel);
particleSource.finish();
particleSource->setHost(make_unique<EffectHostTurret>(&Objects[parent_ship->objnum], turret->system_info->turret_gun_sobj, turret->turret_next_fire_pos));
particleSource->finishCreation();
}
else if (wip->muzzle_flash >= 0) {
mflash_create(firing_pos, firing_vec, &Objects[parent_ship->objnum].phys_info, wip->muzzle_flash);
Expand Down Expand Up @@ -2111,9 +2110,8 @@ void turret_swarm_fire_from_turret(turret_swarm_info *tsi)
if (Weapon_info[tsi->weapon_class].muzzle_effect.isValid()) {
//spawn particle effect
auto particleSource = particle::ParticleManager::get()->createSource(Weapon_info[tsi->weapon_class].muzzle_effect);
particleSource.moveToTurret(&Objects[tsi->parent_objnum], tsi->turret->system_info->turret_gun_sobj, tsi->turret->turret_next_fire_pos - 1);
particleSource.setVelocity(&Objects[tsi->parent_objnum].phys_info.vel);
particleSource.finish();
particleSource->setHost(make_unique<EffectHostTurret>(&Objects[tsi->parent_objnum], tsi->turret->system_info->turret_gun_sobj, tsi->turret->turret_next_fire_pos - 1));
particleSource->finishCreation();
}
else if (Weapon_info[tsi->weapon_class].muzzle_flash >= 0) {
mflash_create(&turret_pos, &turret_fvec, &Objects[tsi->parent_objnum].phys_info, Weapon_info[tsi->weapon_class].muzzle_flash);
Expand Down
4 changes: 2 additions & 2 deletions code/asteroid/asteroid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ static void asteroid_load(int asteroid_info_index, int asteroid_subtype)
if (asip->subtypes[asteroid_subtype].model_number >= 0)
return;

asip->subtypes[asteroid_subtype].model_number = model_load( asip->subtypes[asteroid_subtype].pof_filename, 0, nullptr );
asip->subtypes[asteroid_subtype].model_number = model_load( asip->subtypes[asteroid_subtype].pof_filename );

if (asip->subtypes[asteroid_subtype].model_number >= 0)
{
Expand Down Expand Up @@ -1690,7 +1690,7 @@ void asteroid_hit( object * pasteroid_obj, object * other_obj, vec3d * hitpos, f
wip = &Weapon_info[Weapons[other_obj->instance].weapon_info_index];
// If the weapon didn't play any impact animation, play custom asteroid impact animation
if (!wip->impact_weapon_expl_effect.isValid()) {
particle::create( hitpos, &vmd_zero_vector, 0.0f, Asteroid_impact_explosion_radius, particle::PARTICLE_BITMAP, Asteroid_impact_explosion_ani );
particle::create( hitpos, &vmd_zero_vector, 0.0f, Asteroid_impact_explosion_radius, Asteroid_impact_explosion_ani );
}
}
}
Expand Down
59 changes: 35 additions & 24 deletions code/debris/debris.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
#include "object/objcollide.h"
#include "object/objectsnd.h"
#include "particle/particle.h"
#include "radar/radar.h"
#include "particle/ParticleEffect.h"
#include "particle/volumes/LegacyAACuboidVolume.h"
#include "radar/radarsetup.h"
#include "render/3d.h"
#include "scripting/global_hooks.h"
Expand Down Expand Up @@ -54,6 +55,8 @@ int Debris_model = -1;
int Debris_vaporize_model = -1;
int Debris_num_submodels = 0;

particle::ParticleEffectHandle Debris_hit_particle;

#define DEBRIS_INDEX(dp) (int)(dp-Debris.data())


Expand Down Expand Up @@ -112,6 +115,27 @@ void debris_init()
Debris.reserve(SOFT_LIMIT_DEBRIS_PIECES);

Num_hull_pieces = 0;

Debris_hit_particle = particle::ParticleManager::get()->addEffect(particle::ParticleEffect(
"", //Name
::util::UniformFloatRange(10.f), //Particle num
particle::ParticleEffect::ShapeDirection::ALIGNED, //Particle direction
::util::UniformFloatRange(1.f), //Velocity Inherit
false, //Velocity Inherit absolute?
make_unique<particle::LegacyAACuboidVolume>(0.3f, 1.f, true), //Velocity volume
::util::UniformFloatRange(0.f, 10.f), //Velocity volume multiplier
particle::ParticleEffect::VelocityScaling::NONE, //Velocity directional scaling
tl::nullopt, //Orientation-based velocity
tl::nullopt, //Position-based velocity
nullptr, //Position volume
particle::ParticleEffectHandle::invalid(), //Trail
1.f, //Chance
true, //Affected by detail
1.f, //Culling range multiplier
true, //Disregard Animation Length. Must be true for everything using particle::Anim_bitmap_X
::util::UniformFloatRange(0.25f, 0.75f), //Lifetime
::util::UniformFloatRange(0.2f, 0.4f), //Radius
particle::Anim_bitmap_id_fire)); //Bitmap
}

/**
Expand All @@ -121,14 +145,14 @@ void debris_page_in()
{
uint i;

Debris_model = model_load( NOX("debris01.pof"), 0, NULL );
Debris_model = model_load( NOX("debris01.pof") );
if (Debris_model >= 0) {
polymodel * pm;
pm = model_get(Debris_model);
Debris_num_submodels = pm->n_models;
}

Debris_vaporize_model = model_load( NOX("debris02.pof"), 0, NULL );
Debris_vaporize_model = model_load( NOX("debris02.pof") );

for (i=0; i<Species_info.size(); i++ )
{
Expand Down Expand Up @@ -781,30 +805,17 @@ void debris_hit(object *debris_obj, object * /*other_obj*/, vec3d *hitpos, float
debris *debris_p = &Debris[debris_obj->instance];

// Do a little particle spark shower to show we hit
{
particle::particle_emitter pe;

pe.pos = *hitpos; // Where the particles emit from
pe.vel = debris_obj->phys_info.vel; // Initial velocity of all the particles

if (Debris_hit_particle.isValid()){ // Where the particles emit from
vec3d tmp_norm;
vm_vec_sub( &tmp_norm, hitpos, &debris_obj->pos );
vm_vec_normalize_safe(&tmp_norm);

pe.normal = tmp_norm; // What normal the particle emit around
pe.normal_variance = 0.3f; // How close they stick to that normal 0=good, 1=360 degree
pe.min_rad = 0.20f; // Min radius
pe.max_rad = 0.40f; // Max radius

// Sparks for first time at this spot
pe.num_low = 10; // Lowest number of particles to create
pe.num_high = 10; // Highest number of particles to create
pe.normal_variance = 0.3f; // How close they stick to that normal 0=good, 1=360 degree
pe.min_vel = 0.0f; // How fast the slowest particle can move
pe.max_vel = 10.0f; // How fast the fastest particle can move
pe.min_life = 0.25f; // How long the particles live
pe.max_life = 0.75f; // How long the particles live
particle::emit( &pe, particle::PARTICLE_FIRE, 0 );
matrix orient;
vm_vector_2_matrix_norm(&orient, &tmp_norm);

auto source = particle::ParticleManager::get()->createSource(Debris_hit_particle);

source->setHost(make_unique<EffectHostVector>(*hitpos, orient, debris_obj->phys_info.vel));
source->finishCreation();
}

// multiplayer clients bail here
Expand Down
2 changes: 1 addition & 1 deletion code/fireball/fireballs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,7 @@ void fireballs_page_in()
// load the warp model, if we have one
if (strlen(fd->warp_model) > 0 && cf_exists_full(fd->warp_model, CF_TYPE_MODELS)) {
mprintf(("Loading warp model '%s'\n", fd->warp_model));
fd->warp_model_id = model_load(fd->warp_model, 0, nullptr, 0);
fd->warp_model_id = model_load(fd->warp_model, nullptr, 0);
} else {
fd->warp_model_id = -1;
}
Expand Down
41 changes: 40 additions & 1 deletion code/globalincs/type_traits.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include "globalincs/scp_defines.h"

#include <optional>
#include <tl/optional.hpp>

Expand All @@ -16,4 +18,41 @@ template <typename T> struct is_tuple : std::false_type {};
template <typename... U> struct is_tuple<std::tuple <U...>> : std::true_type {};

template<typename T>
inline constexpr bool is_tuple_v = is_tuple<T>::value;
inline constexpr bool is_tuple_v = is_tuple<T>::value;

template<typename T, typename F>
constexpr auto has_member_impl(F&& f) -> decltype(f(std::declval<T>()), true) {
SCP_UNUSED(f);
return true;
}

template<typename>
constexpr bool has_member_impl(...) { return false; }

#define has_member(T, member) has_member_impl<T>( [](auto&& obj)->decltype(obj.member){ return obj.member; } )

template<typename T, typename Enable = void>
struct is_dereferenceable_pointer : std::false_type {};

template<typename T>
struct is_dereferenceable_pointer<T, typename std::enable_if_t<std::is_same_v<typename std::decay_t<T>, std::unique_ptr<typename std::decay_t<T>::element_type>>>> : std::true_type {};

template<typename T>
struct is_dereferenceable_pointer<T, typename std::enable_if_t<std::is_same_v<typename std::decay_t<T>, std::shared_ptr<typename std::decay_t<T>::element_type>>>> : std::true_type {};

template<typename T>
struct is_dereferenceable_pointer<T, typename std::enable_if_t<std::is_same_v<typename std::decay_t<T>, std::weak_ptr<typename std::decay_t<T>::element_type>>>> : std::true_type {};

template<typename T>
struct is_dereferenceable_pointer<T, typename std::enable_if_t<std::is_pointer_v<typename std::decay_t<T>>>> : std::true_type {};

template<typename T>
inline constexpr bool is_dereferenceable_pointer_v = is_dereferenceable_pointer<T>::value;

template<class T, template<class...> class U>
inline constexpr bool is_instance_of_v = std::false_type{};

template<template<class...> class U, class... Vs>
inline constexpr bool is_instance_of_v<U<Vs...>,U> = std::true_type{};


4 changes: 2 additions & 2 deletions code/jumpnode/jumpnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ CJumpNode::CJumpNode(const vec3d* position)
m_display[0] = '\0';

// Set m_modelnum and m_radius
m_modelnum = model_load(NOX(JN_DEFAULT_MODEL), 0, NULL, 0);
m_modelnum = model_load(NOX(JN_DEFAULT_MODEL), nullptr, 0);
if (m_modelnum == -1) {
Warning(LOCATION, "Could not load default model for %s", m_name);
} else {
Expand Down Expand Up @@ -238,7 +238,7 @@ void CJumpNode::SetModel(const char *model_name, bool show_polys)
Assert(model_name != NULL);

//Try to load the new model; if we can't, then we can't set it
int new_model = model_load(model_name, 0, NULL, 0);
int new_model = model_load(model_name, nullptr, 0);

if(new_model == -1)
{
Expand Down
1 change: 1 addition & 0 deletions code/lab/manager/lab_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "missionui/missionscreencommon.h"
#include "debris/debris.h"
#include "ship/shipfx.h"
#include "particle/particle.h"
#include "weapon/muzzleflash.h"
#include "weapon/beam.h"

Expand Down
1 change: 1 addition & 0 deletions code/lab/renderer/lab_renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "math/bitarray.h"
#include "nebula/neb.h"
#include "parse/parselo.h"
#include "particle/particle.h"
#include "starfield/starfield.h"
#include "starfield/nebula.h"

Expand Down
2 changes: 1 addition & 1 deletion code/menuui/techmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ void techroom_select_new_entry()

// Make sure model is loaded
if (VALID_FNAME(wip->tech_model)) {
Techroom_modelnum = model_load(wip->tech_model, 0, nullptr, 0);
Techroom_modelnum = model_load(wip->tech_model, nullptr, 0);
}

if (Techroom_modelnum >= 0) {
Expand Down
9 changes: 2 additions & 7 deletions code/mission/missionparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3658,7 +3658,6 @@ int parse_object(mission *pm, int /*flag*/, p_object *p_objp)
void mission_parse_handle_late_arrivals(p_object *p_objp)
{
ship_info *sip = NULL;
model_subsystem *subsystems = NULL;

// only for objects which show up after the start of a mission
if (p_objp->created_object != NULL)
Expand All @@ -3668,12 +3667,8 @@ void mission_parse_handle_late_arrivals(p_object *p_objp)

sip = &Ship_info[p_objp->ship_class];

if (sip->n_subsystems > 0) {
subsystems = &sip->subsystems[0];
}

// we need the model to process the texture set, so go ahead and load it now
sip->model_num = model_load(sip->pof_file, sip->n_subsystems, subsystems);
sip->model_num = model_load(sip->pof_file, sip);
}

// Goober5000 - I split this because 1) it's clearer; and 2) initially multiple docked ships would have been
Expand Down Expand Up @@ -4979,7 +4974,7 @@ void resolve_path_masks(int anchor, int *path_mask)

// Load the anchor ship model with subsystems and all; it'll need to be done for this mission anyway
ship_info *sip = &Ship_info[parent_pobjp->ship_class];
modelnum = model_load(sip->pof_file, sip->n_subsystems, &sip->subsystems[0]);
modelnum = model_load(sip->pof_file, sip);

// resolve names to indexes
*path_mask = 0;
Expand Down
2 changes: 1 addition & 1 deletion code/missionui/missionbrief.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1393,7 +1393,7 @@ int brief_setup_closeup(brief_icon *bi, bool api_access)
if (!api_access) {
if (Closeup_icon->modelnum < 0) {
if (sip == nullptr) {
Closeup_icon->modelnum = model_load(pof_filename, 0, nullptr);
Closeup_icon->modelnum = model_load(pof_filename);
} else {
Closeup_icon->modelnum = model_load(sip, true);
Closeup_icon->model_instance_num = model_create_instance(model_objnum_special::OBJNUM_NONE, Closeup_icon->modelnum);
Expand Down
8 changes: 4 additions & 4 deletions code/missionui/missionweaponchoice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1364,11 +1364,11 @@ void wl_load_icons(int weapon_class)
{
if(VALID_FNAME(wip->tech_model))
{
icon->model_index = model_load(wip->tech_model, 0, NULL, 0);
icon->model_index = model_load(wip->tech_model, nullptr, 0);
}
if(wip->render_type != WRT_LASER && icon->model_index == -1)
{
icon->model_index = model_load(wip->pofbitmap_name, 0, NULL);
icon->model_index = model_load(wip->pofbitmap_name);
}
}
}
Expand Down Expand Up @@ -2770,10 +2770,10 @@ void weapon_select_do(float frametime)

//Get the model
if (VALID_FNAME(wip->tech_model)) {
modelIdx = model_load(wip->tech_model, 0, NULL, 0);
modelIdx = model_load(wip->tech_model, nullptr, 0);
}
if (wip->render_type != WRT_LASER && modelIdx == -1) {
modelIdx = model_load(wip->pofbitmap_name, 0, NULL);
modelIdx = model_load(wip->pofbitmap_name);
}

model_render_params render_info;
Expand Down
2 changes: 1 addition & 1 deletion code/model/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,7 @@ void model_instance_free_all();
int model_load(ship_info* sip, bool prefer_tech_model);

// Loads a model from disk and returns the model number it loaded into.
int model_load(const char *filename, int n_subsystems, model_subsystem *subsystems, int ferror = 1, int duplicate = 0);
int model_load(const char *filename, ship_info* sip = nullptr, int ferror = 1, int duplicate = 0);

int model_create_instance(int objnum, int model_num);
void model_delete_instance(int model_instance_num);
Expand Down
Loading
Loading