* Add a *ton* of const and constexpr around the codebase.
This makes the codebase compile without strings being cast to non-const char*. I also went through and added constexpr where appropriate for tons of static data.
* Make process definitions const too
Might as well
* Array size UB fixes
* Fix ShieldD
* Remove (almost) all unsafe strcpy calls
Bunch of macros. C arrays are easy enough and just need a different call. For various cases where a char* is passed around bare, I've made a TEXT_SPAN macro that can store a length too for bounds checking.
* Move crash handling in safe string operations to separate TU
* strcat safe version
* sprintf made safe too
* Fix compile
alpha comparison mID is u16, but indexes into a 256-item table.
this causes MAT3 materials with an alpha comparison index of 0xFF crashes on linux
closes#1073closes#1531
- Properly load all MAT4 data
New fields/inlines/structs are based on what HD does. Still looking for ways to clean things up, particularly getMatInitData.
According to the C++ standard, regular operator new must always return a valid pointer, and allocation failure should throw an exception.
The original game did not use exceptions, and instead had its operator new return null on alloc failure.
Clang and GCC seem to be enforcing the standard here, and this is causing crashes on non-Windows platforms like https://sentry.twilitrealm.dev/organizations/twilitrealm/issues/952/, where a JAISe allocation failure (custom pooled operator new overload) crashes the game when it should be handled gracefully. MSVC seems to not make use of this opportunity, meaning the code works as intended.
Tagging the operators with noexcept seems to satisfy GCC, but I admit cppreference is very light on details here.
* first tphd wip
* fix CMakeLists.txt after rebase
* fix mipmapping (I hope) thanks to decaf-emu. Skipped a few textures in favor of GC assets and added new HD asset file formats
* added third hook into dusk for second JKRMemArchive constructor (e.g. for sign textures). skip texture load for textures with imageoffset = 0 to get STG.arc loaded instead. And small refactorings/rebasings. added a few parameters in logging
* Disable waitForTick and waitBlanking
* Initial frame interpolation implementation
* Initial batch of speed fixes
* Fix Iron Boots
* Strip dead code once used for debugging
* Interpolate shadows
* Revert overzealous/redundant lookups
* Fix JUTFader
* Fix field map cursor
* Fix various particle effects
* Fix Midna when riding Wolf Link
* Fix title logo
* Title Logo 2: Electric Boogaloo
* Fixed grass and flowers
* "Unlock Framerate" config option (WIP)
* Wrap more things in TARGET_PC
* Finish wrapping things in TARGET_PC
* Missed one
* Disable dComIfGd_drawXluListInvisible when interpolating
---------
Co-authored-by: Luke Street <luke@street.dev>
currently builds a "Metaforce" apk, will need to change name of course. Running the apk using Android Studio's emulator can get in game, however running on a samsung phone does not seem to work.