Section-start glows used the b_add of the most recently created bolt
type (Nebl_type) rather than the bolt being drawn, so concurrent bolts
of different types got the wrong glow offset. The cap glow already
used the correct type.
Clamp $Collision LOD to num_detail_levels - 1, the highest valid
detail level. The previous bound was harmless because the collision
code falls back to the lowest existing LOD, but it was off by one.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Most places in the code that use `vm_vector_2_matrix` do so on already-normalized vectors. Changing these to `vm_vector_2_matrix_norm` avoids redundant normalization.
Having a missing bolt texture is not fatal; TBP uses it for `b_invisible`. Modify the bolt checks to display a non-fatal warning if the bolt texture is explicitly specified but not found.
Some of the `frand_range` calls were used for integer calculations, so we can use `Random::next` now.
This also reduces the number of C-style casts in the codebase.
* better types and initialize objects with reasonable values
* modular -ltng.tbm
* fixes
* remove warning on no glow being defined
* do not error in FRED since the above code won't load the texture in FRED
In #4443, `fl_near_zero` was set to use default epsilon values in the `IS_VEC_NULL` check. In this comparison, epsilon is the wrong threshold because it used to have a much smaller threshold. The fix restores the previous definitions of `IS_VEC_NULL` and `IS_VEC_NULL_SQ_SAFE` by exposing the epsilon value as an optional parameter (similar to how `IS_NEAR_ZERO` used to work. This PR also restores `IS_VEC_NULL_SQ_SAFE` where it was replaced by `IS_VEC_NULL.`
* more cleanup in preparation for model translation
1) Clean up stepped rotation, fixing some logic, adding safeguards for invalid values, and allowing rotations to go in the opposite direction
2) Add more specific SEXP error checking for AWACS and rotating subsystems
3) Assorted refactoring and polishing
* address feedback, plus a bit of extra cleanup
This adds a new class which allows to create type safe resource handle
types. At the moment, the engine uses ints pretty much everywhere for
providing handles to resources created by the specific subsystems. Since
all ints are the same to the C/C++ typesystem it is perfectly legal to
pass a sound handle to the graphics API as a buffer handle which will
obviously cause issues.
This adds a new type called "ID" which is a wrapper class for a generic
handle but with added type safety. An instance of this class cannot be
passed to a function expecting another type of handle which provided
compile-time type safety for these APIs.
As an initial test I converted the game sound handles to this new type.
I already found a bug in the mainhall system thanks to this new type.
The mainhall used the game sound handles as sound instance handles which
probably meant that that specific code never really worked right. I
removed the code since there was no better alternative for fixing it.
The HDR changes made the nebula bitmaps a lot less visible. This fixes
that by boosting the color of the bitmaps when they are rendered.
I choose 3 since that gives a similar look to 3.7.4 but that can be
further tweaked if desired.
I also added two debug scopes to help track down where that stuff was
actually rendered.
This fixes#712.
This introduces a new mechanism for handling bit flags. Instead of using an int (or two, or three) to write bits into, this uses the std::bitset in a wrapper class that accepts an enum class as input. This means that certain classes of errors we've had a few of in the engine, where a coder used the wrong set of flags or checked them against the wrong variable (SF_STEALTH vs SIF_STEALTH, for example) can now be detected at a compiler level rather than not at all.
Don't set PF_PROJECTED in g3_transfer_vertex() as it's not projecting
the vertex
Note: displaying nebula emp/lightning used to depend on unitialised data!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10828 387891d4-d844-0410-90c0-e4c51a9137d3
+F -donotenforce = to turn off concurrent playback limit for sounds.
+F -percent_flashtobang = sets the default percentage of nebula flashes get converted to bangs. Default is 50, max 100, min 0.
+T lightning.tbl +flash_to_bang_percent: = sets the percentage of nebula flashes that get converted to bangs for the storm type.
-- Audio gain of OpenAL is set to 65% of max.