Commit Graph

800 Commits

Author SHA1 Message Date
Lioncash 1adb20dc0b CResourceEntry: Eliminate sign conversion warning 2020-06-19 19:03:27 -04:00
Lioncash 92fe105e82 CRenderer: Make use of std::array 2020-06-19 18:57:33 -04:00
Lioncash 9441933ce2 CRenderer: Make use of in-class initializers
Same behavior, less code.
2020-06-19 18:51:45 -04:00
Lioncash f88122b2ed CRenderBucket: Tidy up code 2020-06-19 18:47:24 -04:00
Lioncash b02b507675 CRayCollisionTester: Tidy up code a little 2020-06-19 18:39:21 -04:00
Lioncash 40f0fbca4c CPointOfInterestExtra: Make color instances constexpr
Avoids unnecessary file-scope static constructors.
2020-06-19 18:35:11 -04:00
Lioncash 84506c99fb CModelCooker: Make use of unsigned stream helpers where applicable 2020-06-19 18:04:37 -04:00
Lioncash 0059558efc CScene: Make use of in-class initializers 2020-06-19 03:44:19 -04:00
Lioncash ffbe857c2c CScanLoader: Make use of unsigned stream helpers 2020-06-19 03:41:41 -04:00
Lioncash 125da2d930 CScanCooking: Make use of unsigned stream helpers 2020-06-19 03:40:31 -04:00
Lioncash 61ec2f2e08 CResourceEntry: Make use of static qualifier
This function doesn't depend on instance state.
2020-06-19 03:38:02 -04:00
Lioncash 1e46717b57 CPropertyNameGenerator: Make use of in-class initializers
Same behavior, less code.
2020-06-19 03:32:25 -04:00
Lioncash 53881d1748 CPoiToWorldLoader: Make use of unsigned stream utilities 2020-06-19 03:30:42 -04:00
Lioncash be97a39778 CPoiToWorldCooker: Make use of unsigned stream utilities 2020-06-19 03:30:10 -04:00
Lioncash 5661d0263e CPoiToWorld: Make use of ranged for 2020-06-19 03:27:46 -04:00
Lioncash a6caff1387 CPoiToWorld: Make use of unique_ptr
Safer memory management.
2020-06-19 03:22:24 -04:00
Lioncash df29cc2109 CPackage: Make use of unsigned stream helpers where applicable 2020-06-19 03:13:41 -04:00
Lioncash 9a2580ad03 CModelNode: Make use of in-class initializers
Same behavior, less code.
2020-06-19 02:56:52 -04:00
Lioncash 73d010e6d1 CModelLoader: Make use of unsigned stream helpers where applicable
Same behavior without implicit sign conversions
2020-06-19 02:50:40 -04:00
Lioncash 80e4790384 CFontLoader: Make use of unsigned stream helpers
Same behavior, minus implicit sign conversions.
2020-06-19 02:44:46 -04:00
Lioncash b559df4e0a CDoorExtra: Tidying up
- Fix wonky formatting
- Apply const
2020-06-19 02:38:35 -04:00
Lioncash 0ec31eef71 CDependencyGroupLoader: Make use of unsigned stream helpers
Eliminates implicit sign conversions
2020-06-19 02:35:21 -04:00
Lioncash 3dd325f708 CDamageableTriggerExtra: Make use of unique_ptr
Safer lifetime management.
2020-06-19 00:28:25 -04:00
Lioncash 81560138c0 CDamageableTriggerExtra: add missing override specifier 2020-06-19 00:26:48 -04:00
Lioncash 75be364148 CDamageableTriggerExtra: Make use of std::array
Stronger typing.
2020-06-19 00:26:09 -04:00
Lioncash e875c2bf08 CCollisionLoader: Make use of unsigned helper functions where applicable
Same behavior minus several sign conversion warnings.
2020-06-19 00:19:44 -04:00
Lioncash bcc27ddd5c CAudioGroupLoader: Make use of unsigned stream helpers where applicable
Same behavior, minus implicit sign conversions.
2020-06-18 19:38:22 -04:00
Lioncash 59cfe6fc02 CAreaLoader: Make use of unsigned stream helpers
Same behavior, minus all the implicit sign conversions.
2020-06-18 19:35:11 -04:00
Lioncash d646b896e1 CAreaLoader: Make use of in-class initializers where applicable
Same behavior, less code.
2020-06-18 19:20:01 -04:00
Lioncash 4d4f1490b7 CAreaCooker: Make use of unsigned stream helpers where applicable
Same behavior minus numerous implicit sign conversions.
2020-06-18 19:16:51 -04:00
Lioncash cf0898792a CAnimSetLoader: Make use of unsigned stream helpers where applicable
Same behavior, minus all of the implicit sign conversions.
2020-06-18 19:08:37 -04:00
Lioncash 36e005844f CPackage: std::move strings in constructor where applicable
Allows calling code to completely avoid copies.
2020-06-18 18:47:23 -04:00
Lioncash bf9be7f2ad CGameProject: Mark vars as const where applicable 2020-06-18 18:45:45 -04:00
Lioncash 811447a387 CGameExporter: Mark ShouldExportDiscNode() as a const member function
This doesn't modify internal state.
2020-06-18 18:41:00 -04:00
Lioncash 2d1e6b9672 CGameExporter: Make use of unsigned stream helpers where applicable 2020-06-18 18:39:44 -04:00
Lioncash a603b3a4ef CMaterialLoader: Make use of unsigned stream helpers where applicable 2020-06-18 18:14:33 -04:00
Lioncash 4b20a8ad9f CMaterialCooker: Make use of unsigned write variants where applicable
Gets rid of a bunch of implicit sign conversion warnings.
2020-06-18 17:50:25 -04:00
Lioncash 4b980458ef CAnimationLoader: Make use of ranged for where applicable 2020-06-18 15:55:19 -04:00
Lioncash 87fac0896d CModelLoader: Eliminate some sign conversion warnings 2020-06-18 15:38:52 -04:00
Lioncash 80d5983229 CMaterialPass: Add another missing break for Mode 6 in SetAnimCurrent 2020-06-18 13:51:08 -04:00
Lioncash e65a2a7cc8 CMaterialPass: Add missing break for Mode 6 in SetAnimCurrent 2020-06-18 13:39:20 -04:00
Lioncash 1c0e7a3b1d CGameExporter: Make use of in-class initializers
Same behavior, less code.
2020-06-18 13:35:01 -04:00
Lioncash 7177295cbb CCamera: Make use of in-class initializers
Same behavior, less code.
2020-06-18 13:32:49 -04:00
Lioncash 46e5056ba7 CMaterial: Make use of in-class initializers
Same behavior, less code.
2020-06-18 13:28:25 -04:00
Lioncash b18accfa60 CFramebuffer: Make use of in-class initializers
Same behavior, less code.
2020-06-18 13:23:51 -04:00
Lioncash 3d74639bea CScriptTemplate: Fix debug print formatting in CheckVolumeConditions
Ensures that the proper type is passed in.
2020-06-18 13:17:30 -04:00
Lioncash e75ef00d1c CAreaLoader: Fix debug print formatting
Passes the correct type to the formatting specifier.
2020-06-18 13:15:42 -04:00
Lioncash 9d21516296 CWorldCooker: Prevent signed overflow in CookMLVL
Even if all 32 bits aren't used, this still eliminates a sign-conversion
warning from int to uint64.`
2020-06-18 13:13:26 -04:00
Lioncash 1d54df7185 CAnimSetLoader: Collapse emplace_back() and back() calls into one
emplace_back returns a reference to the emplaced element.
2020-06-18 12:47:37 -04:00
Lioncash 4f4ef28bb1 CUniformBuffer: Convert 0 literal into nullptr
Explicit typing.
2020-06-18 12:43:09 -04:00
Lioncash 82d47e82e9 CUniformBuffer: uint -> uint32 2020-06-18 12:42:34 -04:00
Lioncash db7614be95 CTweakData: uint -> uint32
Makes the assumption about having a 32-bit value explicit in the
class itself.
2020-06-18 12:40:53 -04:00
Lioncash 24bfee8528 DependencyListBuilders: Make use of ranged for where applicable 2020-06-18 12:19:43 -04:00
Lioncash a0ec0d938f GLCommon: Make use of std::array where applicable 2020-06-18 12:00:31 -04:00
Lioncash b781ca7b89 CPointOfInterestExtra: Convert 0 literal to nullptr 2020-06-18 08:03:54 -04:00
Lioncash 09de312ac3 CPoiToWorld: Make use of size_t where applicable
Plays nicer with standard containers.
2020-06-18 08:02:43 -04:00
Lioncash 709fcf18ae CPackage: Make use of size_t where applicable
Plays nicer with std containers.
2020-06-18 07:54:17 -04:00
Lioncash 59ef329c27 CPackage: Remove unnecessary qualifier in EPackageDefinitionVersion
Same thing, less code.
2020-06-18 07:50:08 -04:00
Lioncash bc05e9bd4b CResource: Make StaticType() constexpr
These only return enum values, so this can be trivially made constexpr
2020-06-18 07:35:08 -04:00
Lioncash 84e0d177d8 CSkeleton: Remove default constructor from SBoneTransformInfo
This is unnecessary given initializers are already provided.

This also makes the struct constexpr capable by default as well.
2020-06-18 07:31:07 -04:00
Lioncash 60d003df88 CSkeleton: Make BoneByName() use a string view
Same behavior, but without a mandatory allocating API.
2020-06-18 07:29:19 -04:00
Lioncash 671b8037b9 CSkeleton: Make NumBones() return a size_t
Consistent with the rest of the API.
2020-06-18 07:27:58 -04:00
Lioncash 132d452c88 CScriptObject: Mark IsEditorProperty() as const
This doesn't modify internal member state.
2020-06-18 07:23:10 -04:00
Lioncash 6f1d6a8649 CScriptObject: Make use of size_t where applicable
Plays with standard containers nicer.
2020-06-18 07:17:02 -04:00
Lioncash 0cda26b105 CScriptTemplate: Make use of size_t where applicable
Plays nicer with standard containers and eliminates implicit truncation
warnings.
2020-06-18 06:54:55 -04:00
Lioncash 3bd84d8c41 CScriptTemplate: Convert EAttachType into an enum class
Prevents polluting the global namespace.
2020-06-18 06:52:56 -04:00
Lioncash 31a1de9191 CScriptExtra: Eliminate sign conversion warnings 2020-06-18 06:50:17 -04:00
Lioncash 1b71d91ea7 CResourceStore: Make use of ranged for where applicable
Same behavior, less code.
2020-06-18 06:47:02 -04:00
Lioncash e9dd2c57a6 CResTypeInfo: Shorten std::sort call
We can remove unnecessary qualifiers to make this a little less verbose.
2020-06-18 06:35:18 -04:00
Lioncash 2b7c4941e5 CResTypeInfo: Make use of std::move in the constructor
Allows calling code to eliminate copies altogether from occurring.
2020-06-18 06:30:21 -04:00
Lioncash 8f70b20312 CResTypeInfo: Make use of ranged for where applicable
Same behavior, better readability
2020-06-18 06:28:00 -04:00
Lioncash a612751cb0 CResTypeInfo: Make use of in-class initializers where applicable
Same behavior, less code.
2020-06-18 06:19:08 -04:00
Lioncash b77f52bb0e CResTypeFilter: Make use of ranged for where applicable
We can also collapse a loop down into a std::any_of.
2020-06-18 06:14:50 -04:00
Lioncash 5ce6b972a0 CGameProject: Make use of size_t where applicable
Plays nicely with standard containers.
2020-06-18 06:14:26 -04:00
Lioncash 6a0a20e3fa CGameProject: Make use of std::move where applicable
Same behavior, but allows calling code to completely eliminate copies.
2020-06-18 05:30:29 -04:00
Lioncash bb9947fe0e CGameProject: Make use of std::string_view where applicable
Makes a few functions have non-allocating arguments
2020-06-18 05:29:52 -04:00
Lioncash 6d98e918ae CGameArea: Make use of size_t where applicable
Plays nicer with the standard library and avoids truncation warnings.
2020-06-18 05:16:46 -04:00
Lioncash 456530605f NGameList: Remove const qualifier
Fixes the build.
2020-06-18 04:52:35 -04:00
Lioncash e9df5625e6 CScriptLayer: std::move string in SetName()
Allows calling code to avoid copies.
2020-06-18 04:48:15 -04:00
Lioncash a55fafac22 CScriptLayer: Add const overload for operator[]
Behavioral symmetry.
2020-06-18 04:47:17 -04:00
Lioncash 2b7c322e59 CScriptLayer: Make use of prefix increment on iterators 2020-06-18 04:46:38 -04:00
Lioncash 363b19ebe6 CScriptLayer: Make use of explicit 2020-06-18 04:45:40 -04:00
Lioncash 26f847494e CDynamicVertexBuffer: Make use of std::array where applicable
Same behavior, but eliminates hardcoded sizes.
2020-06-18 04:42:57 -04:00
Lioncash 65482ba272 CCollisionMeshData: Make use of size_t where applicable
Plays nicer with standard types.
2020-06-18 04:37:20 -04:00
Lioncash ce97d79fa3 CBoneTransformData: Make use of size_t where applicable
Plays nicer with standard containers and prevents truncation warnings.
2020-06-18 04:30:57 -04:00
Lioncash cc04eee1b7 NGameList: Tidying up
Cleans up linkage and casts.
2020-06-18 04:20:41 -04:00
Lioncash a54bd900c0 NPropertyMap: Make use of ranged for where applicable
While we're at it, we can tidy up a few other things like linkage
2020-06-18 04:13:18 -04:00
Lioncash 6799e40ef5 IProperty: Make use of ranged for where applicable
Same behavior, less moving parts.
2020-06-17 17:54:57 -04:00
Lioncash e4feff9930 CTweakManager: Remove unnecessary inline specifier 2020-06-17 17:34:34 -04:00
Lioncash b2ad9cf13b CTweakData: Fix -Wreorder warnings 2020-06-17 04:32:14 -04:00
Lioncash 4a020d1d4a CSkin: Make use of ranged for where applicable
Same behavior, less code.
2020-06-17 04:27:54 -04:00
Lioncash 32dafc6bb8 CSkeleton: Make use of size_t where applicable
Prevents truncation warnings.
2020-06-17 04:24:49 -04:00
Lioncash 566a32fd75 General: Migrate off non-constexpr constants 2020-06-16 22:48:11 -04:00
Lioncash c8ebbc860b CMaterialSet: Collapse loop into find_if
Same behavior, explicit intent.
2020-06-16 18:45:52 -04:00
Lioncash 2d2210cd9e CMaterial: Make use of size_t for loops where applicable
Consistency.

While we're at it, remove an unused include.
2020-06-16 18:42:28 -04:00
Lioncash f44a5fc8d2 CShader: Mark several functions as const
These don't modify internal member state.
2020-06-16 18:33:01 -04:00
Lioncash a67df9865e CShader: Make use of unique_ptr where applicable
Prevents unsafe allocations by default.
2020-06-16 18:27:13 -04:00
Lioncash 4d34589816 CDrawUtil: Make use of std::array
While we're at it, we can make several arrays constexpr.
2020-06-16 18:04:10 -04:00
Lioncash 43596280c5 CVertexBuffer: Make use of size_t in Reserve() 2020-06-16 17:42:24 -04:00
Lioncash 3d1ced47e2 CVertex: Make use of std::array where applicable
Allows dehardcoding sizes and simplifies comparison code.
2020-06-16 17:17:20 -04:00
Lioncash a17d43a87d CVertexBuffer: Make use of size_t where applicable
Same behavior, less truncations.
2020-06-16 16:48:25 -04:00
Lioncash d081dd87cf CVertexBuffer: Make use of std::array
Same behavior, but without hardcoded array sizes.
2020-06-16 16:13:47 -04:00
Lioncash 09f5163184 CStringTable: Make use of size_t
Plays nicer with standard containers. While we're at it, we can use
std::move where applicable.
2020-06-16 15:17:23 -04:00
Lioncash f71ef1e615 CStringList: Make use of size_t
Prevents truncation warnings.
2020-06-16 14:25:07 -04:00
Lioncash c980df5188 CSourceAnimData: Make use of ranged for where applicable 2020-06-16 14:21:02 -04:00
Lioncash 84a42cd3c2 CWorld: Make use of size_t where applicable
Plays nicer with standard types and prevents type truncations.
2020-06-15 20:14:17 -04:00
Lioncash c9270b65ed CWorld: Make use of std::move in SetName()
Allows calling code to avoid copies.
2020-06-15 19:55:43 -04:00
Lioncash e18e73cca5 CBasicModel: Make use of size_t where applicable
Same behavior, but without some internal variable truncation.
2020-06-15 19:48:25 -04:00
Lioncash 4978bc9e5c CBasicModel: Make use of explicit 2020-06-15 19:32:44 -04:00
Lioncash fa883930db CAudioManager: Make use of ranged for 2020-06-15 19:28:34 -04:00
Lioncash 7a6c30861d CAreaAttributes: Make constructor explicit 2020-06-15 18:59:04 -04:00
Lioncash 9bcb2f288d CAnimationParameters: Provide operator!=
Provides logical symmetry.
2020-06-15 15:41:58 -04:00
Lioncash f498088bed CAnimationParameters: Default copy constructor and assignment operator
Same behavior, less code.
2020-06-15 15:36:33 -04:00
Lioncash 247fcd37a8 CAnimationParameters: Remove unnecessary inline specifiers 2020-06-15 15:34:57 -04:00
LC d0a32518cd
Merge pull request #21 from lioncash/anim
CAnimationParameters: Add missing break in switch cases in SetUnknown()
2020-06-15 15:33:31 -04:00
Lioncash 7ba5a0cc58 CSceneNode: Convert 0 literal to nullptr 2020-06-15 15:31:12 -04:00
Lioncash 77248960f8 CModel: Simplify InternalGetIBO() a little
We can use the result of the emplace_back directly.
2020-06-15 14:55:50 -04:00
Lioncash 79f7b62960 CMaterialSet/CModel: Make use of size_t where applicable
Prevents type truncation warnings internally and also provides slightly
better code-gen, given the upper half of 64-bit registers don't need to
be constantly cleared.
2020-06-15 14:49:38 -04:00
Lioncash 6edea6a225 CMaterialSet: Make Clone() return a unique_ptr
Makes the returned pointer leak-free by default.
2020-06-15 14:12:06 -04:00
Lioncash 95f6c3360d CMaterialPass: Make use of size_t where applicable
Plays nicer with standard types.
2020-06-15 14:08:36 -04:00
Lioncash b90bd90e03 CMaterial: std::move string in SetName()
Allows callers to avoid copies.
2020-06-15 14:02:59 -04:00
Lioncash e7b3015f08 CMaterial: Make use of size_t where applicable
Prevents truncation warnings from occurring.
2020-06-15 14:02:55 -04:00
Lioncash 5b96480a45 CMaterial: Simplify Clone() a little
Given we use std::array now, we can perform a direct assignment instead
of a loop.
2020-06-15 13:55:22 -04:00
Lioncash 28587fb622 CSceneNode: std::move string in SetName()
Allows for calling code to completely avoid copies being made.
2020-06-15 13:48:57 -04:00
Lioncash e962d9ba96 CLight: Correct lack of assignment in SetSpotCutoff()
Brought this up with Antidote and was told that this is likely what was
intended to be done.
2020-06-14 20:16:54 -04:00
Lioncash 9e3018809f CWorld: Eliminate sign conversion warnings 2020-06-14 19:48:23 -04:00
Lioncash 35ea47e473 CWorld: Make use of in-class initializers
Same behavior, less code.
2020-06-14 19:47:05 -04:00
Lioncash 128ee0d01c CMaterialLoader: Make use of static
This function doesn't touch instance state at all
2020-06-14 19:43:43 -04:00
Lioncash cc376d3e21 CMaterialLoader: Make use of std::array 2020-06-14 19:41:42 -04:00
Lioncash 903f6dfe7e CGameArea: Make use of in-class initializers where applicable
Same behavior, less code.
2020-06-14 19:27:54 -04:00
Lioncash 2c274897c9 CLightParameters: Make EWorldLightingOptions an enum class
Avoids polluting the global namespace.
2020-06-14 19:21:30 -04:00
Lioncash cec88d182b CLightNode: Mark member functions as const where applicable
Several functions don't modify internal member state.
2020-06-14 19:13:35 -04:00
Lioncash f2201ca03c CLight: Make CalculateSpotAngleAtten() const
This member function doesn't modify internal member state.
2020-06-14 19:05:29 -04:00
Lioncash b439e4bba1 CLight: Make use of in-class initializers where applicable
Same behavior, less code.
2020-06-14 19:03:32 -04:00
Lioncash f942ad6551 CGameTemplate: Mark getter functions as const
These don't modify internal class state, so we can mark them as const.
2020-06-14 18:58:05 -04:00
Lioncash 15708b8624 CGameTemplate: Collapse loops into ranged for where applicable 2020-06-14 18:49:37 -04:00
Lioncash d9bb255518 CGameTemplate: Use in-class initializers where applicable
Same behavior, less code.
2020-06-14 18:35:10 -04:00
Lioncash 332be356de CIndexBuffer: Make use of size_t where applicable
Provides a nicer interface for operating with standard types, etc.
2020-06-14 18:29:39 -04:00
Lioncash d4564434c3 FShowFlags: Remove use of cpp file
Now that these constructs are constexpr capable, we can make use of
constexpr here to contain it fully within the header.
2020-06-14 17:12:37 -04:00
Lioncash b2db6a21fa CFlagsProperty: Mark HasValidValue() as const
This doesn't modify internal state.
2020-06-14 17:07:47 -04:00
Lioncash d5a33b631a CFlagsProperty: Make use of a ranged for loop 2020-06-14 17:06:46 -04:00
Lioncash 84184da66d CFont: Prevent Wmaybe-uninitialized warning 2020-06-14 17:04:35 -04:00
Lioncash 4861f118fb CFont: Make PtsToFloat() internally linked
This is only ever used within the cpp file
2020-06-14 17:04:35 -04:00
Lioncash 1c292f5e2d CFont: Make use of std::array
Same behavior, stronger typing.
2020-06-14 17:04:32 -04:00
Lioncash b6b7bcace1 CFont: In-class initialize members where applicable
Provides a consistent initial state.
2020-06-14 16:54:16 -04:00
Lioncash 01e68ec5d8 CFontLoader: Default constructor 2020-06-14 16:51:13 -04:00
Lioncash e49315a645 CSkeleton: Make use of unique_ptr where applicable
Makes ownership semantics explicit.
2020-06-14 16:49:51 -04:00
Lioncash 4dcb539763 CSkeletonLoader: Make use of ranged for where applicable
Same behavior, less code.
2020-06-14 16:13:28 -04:00
Lioncash 6909c75d64 CTextureDecoder: Misc cleanup
Const correctness, unimplemented prototypes, reducing copies, etc.
2020-06-14 16:07:43 -04:00
Lioncash 68455c54e8 CTextureDecoder: Make utility functions internally linked
Same behavior, but keeps implementation details internal.
2020-06-14 15:41:32 -04:00