Commit Graph

183 Commits

Author SHA1 Message Date
Lioncash 5fc0802373 CPathCamera: Mark kLineOfSightFilter as constexpr
Same behavior, minus any potential runtime initializers.
2020-04-12 10:21:35 -04:00
Lioncash 535c02abe8 CCameraShakeData: Mark skChargedShotCameraShakeData as constexpr
Same behavior, minus potential runtime initializers.
2020-04-12 10:20:24 -04:00
Lioncash c662634226 CBallCamera: Mark BallCameraFilter as constexpr
Allows removal of runtime initializers.
2020-04-12 10:19:13 -04:00
Lioncash 886d951736 CCameraShakeData: Make use of boolean literals where applicable in LoadCameraShakeData
Same behavior, minus the implicit conversions to bool.
2020-04-11 14:33:27 -04:00
Luke Street 496bb3e624 Runtime/Camera: Replace bitfield unions with constructor initializers 2020-04-10 15:03:05 -04:00
Lioncash 89e2e65100 CCameraManager: Eliminate variable shadowing
We can get rid of shadowing in an inner scope.
2020-04-10 13:43:55 -04:00
Lioncash bfd17e4513 CActor: Make Render() a non-const function
A few implementations of Render() contain const-casts nested within its
their call hierarchy to get around the fact that this function is marked
const. We can just make the member function non-const to allow removal
of these casts in follow up changes.
2020-04-09 14:32:20 -04:00
Luke Street 529fced48a
Merge pull request #298 from lioncash/filter
CCameraFilter: Make Draw() non-const
2020-04-09 10:46:37 -04:00
Lioncash 3ea8eb21cf CInterpolationCamera: Always initialize x1d8_24_sinusoidal
Provides a deterministic consistent initial state.
2020-04-07 12:58:47 -04:00
Lioncash 18ad2595cf CCameraFilter: Always initialize m_shape
Provides a deterministic initial state and prevents any potential
uninitialized reads.
2020-04-07 12:36:45 -04:00
Lioncash 92d65462b9 CCameraSpline: Resolve sign-conversion warnings
All call sites are already compatible with these changes, so they can
safely be made.
2020-04-06 12:50:28 -04:00
Phillip Stephens 28853f5ea6
Merge branch 'constexpr5' of https://github.com/lioncash/urde into lioncash-constexpr5 2020-04-05 05:10:42 -07:00
Lioncash 6ba0641b79 CCameraFilter: Make Draw() non-const
Eliminates another usage of const_cast.
2020-04-05 08:05:04 -04:00
Lioncash 1b01b232e6 CCinematicCamera: Make use of const where applicable
Makes read-only intent explicit.
2020-04-05 01:45:08 -04:00
Lioncash 4e55edf0fe CCameraSpline: Make use of TCastToConstPtr where applicable
Makes the read-only intent explicit.
2020-04-05 01:25:55 -04:00
Lioncash 7d8bcfbd5e CCameraManager: Make use of TCastToConstPtr where applicable
Makes the read-only behavior explicit.
2020-04-05 01:19:51 -04:00
Lioncash 75cd9b6cf3 CBallCamera: Make use of TCastToConstPtr where applicable
Same behavior, but makes the read-only nature explicit.
2020-04-05 00:54:40 -04:00
Lioncash d240e40a17 CCameraShakeData: Make classes and structs constexpr where applicable
Same behavior, but allows eliminating file-scope initializers needing to
be run on program start.
2020-04-02 21:40:19 -04:00
Lioncash 2f0d774ed8 General: Make use of emplace_back where applicable 2020-03-31 05:33:10 -04:00
Lioncash 67f6666ea1 Runtime: Add more usages of explicit
Prevents error-prone implicit conversions where applicable.

This targets the regular RuntimeCommon target this time around.
2020-03-31 03:53:49 -04:00
Lioncash 20548ddeaa CCameraSpline: Make constructor explicit
Same behavior, but prevents error-prone implicit constructions from
occurring.
2020-03-25 02:41:07 -04:00
Lioncash f1fce0f631 CCameraSpline: Add names to prototypes
More self-documenting from the interface alone.
2020-03-25 02:40:03 -04:00
Lioncash 7bced5308b CCameraManager: Add names to parameters in prototypes
More self documenting and allows IDE inspections to be better.
2020-03-25 02:33:34 -04:00
Phillip Stephens f7fdbc07ba
Merge pull request #219 from lioncash/false
CPathCamera: Change 0 to false in CPathCamera constructor
2020-03-13 15:30:59 -07:00
Lioncash 92fb31fd40 CPathCamera: Change 0 to false in CPathCamera constructor
Same thing, but without implicit conversion to bool
2020-03-13 17:38:14 -04:00
Lioncash 097d4a4422 Runtime: Collapse emplace_back() calls where applicable
Same behavior, but with less code.
2020-03-13 17:14:44 -04:00
Lioncash 363386cbd9 CBallCamera: Collapse identical switch cases within AvoidGeometry()
Same behavior, but less code.

This is identical in behavior to the code within the GM8E v0 binary.
2020-03-08 23:40:22 -04:00
Lioncash b847930a85 CCameraManager: Collapse loop into std::find_if in RemoveCameraShaker
We can collapse the loop into a find_if call here, since it only does a
look up and nothing more.
2020-01-20 12:57:23 -05:00
Lioncash b3fcbf9a89 CCameraManager: Resolve signed/unsigned mismatch in RemoveCameraShaker
An unsigned value is passed into RemoveCameraShaker at its only usage
spot. This also resolves unsigned/signed comparisons within the function
itself.
2020-01-20 12:51:52 -05:00
Lioncash 1cb289f243 RuntimeCommon: Normalize cpp inclusions
Normalizes the headers for the cpp files in the RuntimeCommon target.
Now all headers and source files within the RuntimeCommon/RuntimeCommonB
targets are normalized and consistent with one another.
2020-01-15 09:15:47 -05:00
Phillip Stephens 6c1f682e0f
Initial CRidley implementation 2019-11-09 15:48:46 -08:00
Lioncash 660d092cad CSegId: Add member functions for querying validity
Allows querying validity of segment IDs without hardcoding the magic
value that signifies an invalid ID.
2019-10-26 22:43:11 -04:00
Lioncash 21c1ed2940 CBallCamera: Use bool instead of float for holding boolean value
Using a float is very suspect and also more expensive in terms of
code-gen to access and modify the variable.
2019-10-12 02:25:24 -04:00
Phillip Stephens 79ac5d76df
Update hecl, more CVar imps 2019-09-29 08:17:55 -07:00
Phillip Stephens 00cff89141
Merge pull request #86 from lioncash/header
General: Normalize RuntimeCommon include paths
2019-09-28 08:02:35 -07:00
Lioncash a633b8e8fd General: Normalize RuntimeCommon include paths
Performs the same normalizing done to the RuntimeCommonB target, now all
of the runtime headers have normalized include paths.
2019-09-28 04:14:29 -04:00
Lioncash 359f505787 CCameraManager: Collapse private static variables into functions
Four of the five variables aren't modified, so they can be specified
directly within the functions and just be reused in place of the
variable names. This allows the constants to be elided or put into
read-only memory if necessary. It also makes the mutable value explicit.
2019-09-27 22:46:59 -04:00
Phillip Stephens 68e2fad74f
Fix TCastTo.hpp inclusions, add comment to warn against modifying include path 2019-09-21 06:07:13 -07:00
Lioncash d3d629d405 RuntimeCommon: Use const on member functions where applicable
Adds missing const qualifiers on class member functions that don't
modify instance state.
2019-08-14 09:25:39 -04:00
Lioncash 9312eef905 RuntimeCommon: Use override where applicable
Continues the override modernization by applying it to the main
RuntimeCommon target. Resolves around 1100+ cases where override can be
used.
2019-08-09 17:39:42 -04:00
Jack Andersen e218b8aeb5 CActorContraption fixes, better CMake dependency handling 2019-06-11 16:05:17 -10:00
Jack Andersen b72cc490e8 Implement CFishCloud 2019-04-02 18:32:31 -10:00
Jack Andersen 8df0a4913c zeus constexpr refactor and thermal visor fixes 2019-02-23 21:15:54 -10:00
Jack Andersen 48eaa2545b Working CScriptGunTurret 2019-02-17 19:47:46 -10:00
Jack Andersen 01af7b735d Implement CScriptSpindleCamera 2019-02-09 18:41:35 -10:00
Jack Andersen ad2681f857 Windows fixes 2019-01-28 22:28:35 -10:00
Jack Andersen f9b0614327 Various bug fixes 2019-01-04 22:34:09 -10:00
Jack Andersen d60fcc99c9 Fix CNewIntroBoss and particle bugs 2019-01-04 17:28:02 -10:00
Jack Andersen 636c82a568 New code style refactor 2018-12-07 19:30:43 -10:00
Jack Andersen 7c7da6671a SIMD refactor 2018-12-07 15:49:15 -10:00