Shipwright/soh/soh/GbiWrap.cpp

120 lines
3.8 KiB
C++
Raw Permalink Normal View History

#include "z64.h"
//OTRTODO - this is awful
extern "C" {
void InitOTR();
void Graph_ProcessFrame(void (*run_one_game_iter)(void));
void Graph_StartFrame();
void Graph_ProcessGfxCommands(Gfx* commands);
void OTRLogString(const char* src);
void OTRGfxPrint(const char* str, void* printer, void (*printImpl)(void*, char));
void OTRSetFrameDivisor(int divisor);
void OTRGetPixelDepthPrepare(float x, float y);
uint16_t OTRGetPixelDepth(float x, float y);
int32_t OTRGetLastScancode();
2023-03-14 02:45:19 -04:00
void ResourceMgr_LoadDirectory(const char* resName);
uint16_t ResourceMgr_LoadTexWidthByName(char* texPath);
uint16_t ResourceMgr_LoadTexHeightByName(char* texPath);
build soh with LUS 1.0.0 (#2881) * Bump LUS * Ship -> LUS namespace change * z_scene_otr Ship -> LUS namespace * Starting to get SoH to build with LUS imgui changes. * start stuff * gamecontroleditor build issues resolved maybe * cosmetics editor and what not * console * actor viewer * more stuff * more stuff * on to errors that make sense * putting this down for a bit * no idea what these errors mean now * some kind of progress maybe * latest lus main * more * back to linker errors and being lost * Fixes command function signature. * More fixes * Even more fixes * Bump LUS * More Fixes. * Fixes even more errors. * lus bump * input editor as var * audio editor working * it builds with this * bump lus * it opens * bump lus to latest main again * make sure to do all the command registering in debugconsole * lus and what not * switch type stuff plz * undo * do the thing that fixes the thing * fix mac? * correctly show/hide menubar on boot * bump lus * input blocking updates * bump lus * Bump LUS * Press F1 to open enhancement menus moved to SoH * lus and rendering backend stuff * audio backend and lus * Bump LUS * Fixes WindowBackend dropdown * Bump LUS * misc -> utils and moves binarytools to utils. * Window refactor * bump lus * make it work * Fixes for moved files again * Bump LUS * Mercury -> Config * Bump LUS * Reacts to removed LUS hooks and bump LUS * Remove Hook: GfxInit * Removes debug audio_setgamevolume to 1 * use non-crashing branch of lus * fix: make audio init work without hooks * game icon stuff * multifix bmp * use input viewer class branch for now * just "Ship" it's cleaner * Bump LUS * Removed ExitGame hook. * Bump LUS * Hook system removed from LUS. * More LUS updates * Changes to make window position saving. * Bump LUS * Bump LUS (for real) * LUS resources now return a specialized pointer. * Bump LUS * Fixes issue in SetPathways::GetPointerSize * Bump LUS to 1.0.0 * builds but crashes * fix crash * better macro names in debug console * remove commeted out line * remove redundant check tracker settings window logic * remove commented out line * move the * * remove extra seqplayers enum def * this sneaky little guy was hiding behind a wii u ifdef * remove extra check tracker header --------- Co-authored-by: Kenix <kenixwhisperwind@gmail.com> Co-authored-by: briaguya <briaguya@alice>
2023-06-03 15:27:45 -04:00
size_t ResourceGetTexSizeByName(const char* name);
char* ResourceMgr_LoadTexOrDListByName(char* filePath);
spockalicious (#2751) * Rough mockup of LUS XML loading * Updated code for merge * Loading from FS support and custom DList WIP implementation * Added current directory support to F3D and impl most of the dlist cmds * WIP Skeleton support * Almost done * Rebase fixes * Submodule updates * HD Texture Support * Fixes * bump lus * fix exporter build, header update * soh builds * setMesh image path cleanup * Update soh/src/overlays/actors/ovl_player_actor/z_player.c * Update soh/src/overlays/actors/ovl_player_actor/z_player.c * Update OTRExporter/OTRExporter/Main.cpp * Update ZAPDTR/ZAPD/ZResource.h * Update soh/src/code/z_skelanime.c * Update OTRExporter/OTRExporter/Main.cpp * Fixed jpeg backgrounds and decreased icon buffer size * Bump lus * Increased even more the buffer because it crashes on long texts * Removed print because sometimes the if is not triggered when the image is already byteswapped * fix non-windows build * fix build Co-authored-by: Kenix <kenixwhisperwind@gmail.com> * add hd checkbox * Various fixes for custom model support (#23) * Some fixes * Updated LUS Version * Fixed issue with Link Skirt on pause menu * Added CVar for custom link model changes * Fixed headers * Additional header fixes * Tweaks * Unload HD game assets on scene transition. (#16) * Unload game assets on scene transition. * Bump LUS * Unloads all HD assets on scene transition. * Only unload hd assets if hd assets are turned on. * Fixes issues on toggling between HD and non HD assets. --------- Co-authored-by: briaguya <briaguya@alice> * fix: actually load hd debug font (#27) * fix: actually load hd debug font * toggle debug text correctly --------- Co-authored-by: briaguya <briaguya> * Yes. (#28) * Merge branch 'develop' into dev-to-ghost * HD Skeleton Swapping and Language Fixes (#32) * Yes. * HD Skeleton Swapping and Language Fixes * Test * Fixed issues with ganon cape (#34) * Fixed Bongo Bongo Crash (#35) * Added HD Assets Toggle (#37) * Ivan the Fairy - Coop Mode (#36) * wip * hookshotable ivan * added hookshot item * new items & changes & fixes & restored navi * farore, din and nayru's spells are done * fixed slingshot & bow * added more items supported * done with all main items * bug fixes & ready * added imgui button * wip * hookshotable ivan * added hookshot item * new items & changes & fixes & restored navi * farore, din and nayru's spells are done * fixed slingshot & bow * added more items supported * fix own dungeon items on shuffled boss rooms (#2683) * bump lus (#2692) * fix: lowercase package names for vcpkg (#2693) vcpkg was throwing an error `error: invalid character in package name (must be lowercase, digits, '-')` this updates our calls to `vcpkg_install_packages` to use lowercase package names instead of uppercase * fix death mountain cloud in rando (#2691) * Fix: Switch Age No Longer Reloads Start Room (#2679) * [Reduced Clutter] Disable Hot/Underwater Warning Text (#2684) * Disable Warning Text * Moved to Reduced Clutter * done with all main items * bug fixes & ready * fix: process roms in consistent order (#2696) * chore: move rando savefile setup and document flags (#2697) * remove rando save init from sram * move rando savefile init logic and set more flags * document flags for rando save creation * Fix: Use correct fps value for frame interpolation with match refresh rate (#2694) * Fix: Kak GS placement on construction site (#2695) * added imgui button * addressed kenix's comments * fixed useless null * added rupee dash mode in extra modes * changed menu position --------- Co-authored-by: Adam Bird <Archez@users.noreply.github.com> Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com> Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> * LUS Scancodes (#42) * Added HD Assets Toggle * Switched out SDL for LUS scancodes * Ivan tweaks (#45) * Magic consumption slowed down; Bosses now affected by Ivan's Din spell * Adjust magic timer * clean up imgui * model fixes/improvements (#50) * replace `gUseCustomLinkModel` with custom resource check * handle adult/child * bump lus * fix model switching with tab * use lus main * fix carpet man (#52) Co-authored-by: Rozelette <Rozelette@users.noreply.github.com> * get ship model and lus texture into soh.otr, use `gAuthenticLogo` to toggle between ship and authentic (#55) * Use libultra features for CPU-modified textures (#40) * Use libultra features for CPU-modified textures * Comment * bump lus on ghost (#58) * fix: properly use `Interface_LoadActionLabel` to display start button text (#61) * Changes hd -> alt for texture replacement. (#65) * Changes hd -> alt for texture replacement. * Renames variables in gfxprint for hd -> alt change. * Update soh/soh/resource/type/Skeleton.cpp --------- Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fixes kaleido dungeon maps (#67) * skeleton stuff (#69) * comment out wii u build (#70) * bump lus (#71) * Rework readme (#72) * Update README.md * docs * put custom music docs somewhere * Update README.md * Update README.md * Update README.md * Update README.md * dark/light title image * lus * Update README.md * Fixed vanilla minimap (#73) * Fixed vanilla minimap * Workaround for pulsing SD maps with non-broken HD maps. --------- Co-authored-by: Christopher Leggett <chris@leggett.dev> * Skeleton fix fixed (#75) * WIP skelton patcher fix * Fixes skeleton reference change. * Adds const back to name in ResourceMgr_LoadSkeletonByName --------- Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Kenix <kenixwhisperwind@gmail.com> * Fixes z_message_otr memory leak. * Update soh/soh/z_message_OTR.cpp * Update soh/src/code/game.c * docs: add how to find otr files to switch instructions (#78) * bump lus (#79) * comment out RegisterBlendedTexture in king d (#80) --------- Co-authored-by: Nicholas Estelami <NEstelami@users.noreply.github.com> Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: KiritoDv <kiritodev01@gmail.com> Co-authored-by: briaguya <briaguya> Co-authored-by: Ralphie Morell <stratomaster64@gmail.com> Co-authored-by: MelonSpeedruns <melonspeedruns@outlook.com> Co-authored-by: Adam Bird <Archez@users.noreply.github.com> Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com> Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> Co-authored-by: Rozelette <Rozelette@users.noreply.github.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Lywx <36680385+KiritoDv@users.noreply.github.com>
2023-04-27 19:20:41 -04:00
char* ResourceMgr_LoadIfDListByName(char* filePath);
char* ResourceMgr_LoadPlayerAnimByName(char* animPath);
char* ResourceMgr_GetNameByCRC(uint64_t crc, char* alloc);
Gfx* ResourceMgr_LoadGfxByCRC(uint64_t crc);
Gfx* ResourceMgr_LoadGfxByName(char* path);
Vtx* ResourceMgr_LoadVtxByCRC(uint64_t crc);
Vtx* ResourceMgr_LoadVtxByName(char* path);
CollisionHeader* ResourceMgr_LoadColByName(char* path);
uint64_t GetPerfCounter();
int ResourceMgr_OTRSigCheck(char* imgData);
spockalicious (#2751) * Rough mockup of LUS XML loading * Updated code for merge * Loading from FS support and custom DList WIP implementation * Added current directory support to F3D and impl most of the dlist cmds * WIP Skeleton support * Almost done * Rebase fixes * Submodule updates * HD Texture Support * Fixes * bump lus * fix exporter build, header update * soh builds * setMesh image path cleanup * Update soh/src/overlays/actors/ovl_player_actor/z_player.c * Update soh/src/overlays/actors/ovl_player_actor/z_player.c * Update OTRExporter/OTRExporter/Main.cpp * Update ZAPDTR/ZAPD/ZResource.h * Update soh/src/code/z_skelanime.c * Update OTRExporter/OTRExporter/Main.cpp * Fixed jpeg backgrounds and decreased icon buffer size * Bump lus * Increased even more the buffer because it crashes on long texts * Removed print because sometimes the if is not triggered when the image is already byteswapped * fix non-windows build * fix build Co-authored-by: Kenix <kenixwhisperwind@gmail.com> * add hd checkbox * Various fixes for custom model support (#23) * Some fixes * Updated LUS Version * Fixed issue with Link Skirt on pause menu * Added CVar for custom link model changes * Fixed headers * Additional header fixes * Tweaks * Unload HD game assets on scene transition. (#16) * Unload game assets on scene transition. * Bump LUS * Unloads all HD assets on scene transition. * Only unload hd assets if hd assets are turned on. * Fixes issues on toggling between HD and non HD assets. --------- Co-authored-by: briaguya <briaguya@alice> * fix: actually load hd debug font (#27) * fix: actually load hd debug font * toggle debug text correctly --------- Co-authored-by: briaguya <briaguya> * Yes. (#28) * Merge branch 'develop' into dev-to-ghost * HD Skeleton Swapping and Language Fixes (#32) * Yes. * HD Skeleton Swapping and Language Fixes * Test * Fixed issues with ganon cape (#34) * Fixed Bongo Bongo Crash (#35) * Added HD Assets Toggle (#37) * Ivan the Fairy - Coop Mode (#36) * wip * hookshotable ivan * added hookshot item * new items & changes & fixes & restored navi * farore, din and nayru's spells are done * fixed slingshot & bow * added more items supported * done with all main items * bug fixes & ready * added imgui button * wip * hookshotable ivan * added hookshot item * new items & changes & fixes & restored navi * farore, din and nayru's spells are done * fixed slingshot & bow * added more items supported * fix own dungeon items on shuffled boss rooms (#2683) * bump lus (#2692) * fix: lowercase package names for vcpkg (#2693) vcpkg was throwing an error `error: invalid character in package name (must be lowercase, digits, '-')` this updates our calls to `vcpkg_install_packages` to use lowercase package names instead of uppercase * fix death mountain cloud in rando (#2691) * Fix: Switch Age No Longer Reloads Start Room (#2679) * [Reduced Clutter] Disable Hot/Underwater Warning Text (#2684) * Disable Warning Text * Moved to Reduced Clutter * done with all main items * bug fixes & ready * fix: process roms in consistent order (#2696) * chore: move rando savefile setup and document flags (#2697) * remove rando save init from sram * move rando savefile init logic and set more flags * document flags for rando save creation * Fix: Use correct fps value for frame interpolation with match refresh rate (#2694) * Fix: Kak GS placement on construction site (#2695) * added imgui button * addressed kenix's comments * fixed useless null * added rupee dash mode in extra modes * changed menu position --------- Co-authored-by: Adam Bird <Archez@users.noreply.github.com> Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com> Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> * LUS Scancodes (#42) * Added HD Assets Toggle * Switched out SDL for LUS scancodes * Ivan tweaks (#45) * Magic consumption slowed down; Bosses now affected by Ivan's Din spell * Adjust magic timer * clean up imgui * model fixes/improvements (#50) * replace `gUseCustomLinkModel` with custom resource check * handle adult/child * bump lus * fix model switching with tab * use lus main * fix carpet man (#52) Co-authored-by: Rozelette <Rozelette@users.noreply.github.com> * get ship model and lus texture into soh.otr, use `gAuthenticLogo` to toggle between ship and authentic (#55) * Use libultra features for CPU-modified textures (#40) * Use libultra features for CPU-modified textures * Comment * bump lus on ghost (#58) * fix: properly use `Interface_LoadActionLabel` to display start button text (#61) * Changes hd -> alt for texture replacement. (#65) * Changes hd -> alt for texture replacement. * Renames variables in gfxprint for hd -> alt change. * Update soh/soh/resource/type/Skeleton.cpp --------- Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fixes kaleido dungeon maps (#67) * skeleton stuff (#69) * comment out wii u build (#70) * bump lus (#71) * Rework readme (#72) * Update README.md * docs * put custom music docs somewhere * Update README.md * Update README.md * Update README.md * Update README.md * dark/light title image * lus * Update README.md * Fixed vanilla minimap (#73) * Fixed vanilla minimap * Workaround for pulsing SD maps with non-broken HD maps. --------- Co-authored-by: Christopher Leggett <chris@leggett.dev> * Skeleton fix fixed (#75) * WIP skelton patcher fix * Fixes skeleton reference change. * Adds const back to name in ResourceMgr_LoadSkeletonByName --------- Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Kenix <kenixwhisperwind@gmail.com> * Fixes z_message_otr memory leak. * Update soh/soh/z_message_OTR.cpp * Update soh/src/code/game.c * docs: add how to find otr files to switch instructions (#78) * bump lus (#79) * comment out RegisterBlendedTexture in king d (#80) --------- Co-authored-by: Nicholas Estelami <NEstelami@users.noreply.github.com> Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: KiritoDv <kiritodev01@gmail.com> Co-authored-by: briaguya <briaguya> Co-authored-by: Ralphie Morell <stratomaster64@gmail.com> Co-authored-by: MelonSpeedruns <melonspeedruns@outlook.com> Co-authored-by: Adam Bird <Archez@users.noreply.github.com> Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com> Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> Co-authored-by: Rozelette <Rozelette@users.noreply.github.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Lywx <36680385+KiritoDv@users.noreply.github.com>
2023-04-27 19:20:41 -04:00
void ResourceMgr_PushCurrentDirectory(char* path);
}
extern "C" void gSPSegment(void* value, int segNum, uintptr_t target) {
char* imgData = (char*)target;
int res = ResourceMgr_OTRSigCheck(imgData);
spockalicious (#2751) * Rough mockup of LUS XML loading * Updated code for merge * Loading from FS support and custom DList WIP implementation * Added current directory support to F3D and impl most of the dlist cmds * WIP Skeleton support * Almost done * Rebase fixes * Submodule updates * HD Texture Support * Fixes * bump lus * fix exporter build, header update * soh builds * setMesh image path cleanup * Update soh/src/overlays/actors/ovl_player_actor/z_player.c * Update soh/src/overlays/actors/ovl_player_actor/z_player.c * Update OTRExporter/OTRExporter/Main.cpp * Update ZAPDTR/ZAPD/ZResource.h * Update soh/src/code/z_skelanime.c * Update OTRExporter/OTRExporter/Main.cpp * Fixed jpeg backgrounds and decreased icon buffer size * Bump lus * Increased even more the buffer because it crashes on long texts * Removed print because sometimes the if is not triggered when the image is already byteswapped * fix non-windows build * fix build Co-authored-by: Kenix <kenixwhisperwind@gmail.com> * add hd checkbox * Various fixes for custom model support (#23) * Some fixes * Updated LUS Version * Fixed issue with Link Skirt on pause menu * Added CVar for custom link model changes * Fixed headers * Additional header fixes * Tweaks * Unload HD game assets on scene transition. (#16) * Unload game assets on scene transition. * Bump LUS * Unloads all HD assets on scene transition. * Only unload hd assets if hd assets are turned on. * Fixes issues on toggling between HD and non HD assets. --------- Co-authored-by: briaguya <briaguya@alice> * fix: actually load hd debug font (#27) * fix: actually load hd debug font * toggle debug text correctly --------- Co-authored-by: briaguya <briaguya> * Yes. (#28) * Merge branch 'develop' into dev-to-ghost * HD Skeleton Swapping and Language Fixes (#32) * Yes. * HD Skeleton Swapping and Language Fixes * Test * Fixed issues with ganon cape (#34) * Fixed Bongo Bongo Crash (#35) * Added HD Assets Toggle (#37) * Ivan the Fairy - Coop Mode (#36) * wip * hookshotable ivan * added hookshot item * new items & changes & fixes & restored navi * farore, din and nayru's spells are done * fixed slingshot & bow * added more items supported * done with all main items * bug fixes & ready * added imgui button * wip * hookshotable ivan * added hookshot item * new items & changes & fixes & restored navi * farore, din and nayru's spells are done * fixed slingshot & bow * added more items supported * fix own dungeon items on shuffled boss rooms (#2683) * bump lus (#2692) * fix: lowercase package names for vcpkg (#2693) vcpkg was throwing an error `error: invalid character in package name (must be lowercase, digits, '-')` this updates our calls to `vcpkg_install_packages` to use lowercase package names instead of uppercase * fix death mountain cloud in rando (#2691) * Fix: Switch Age No Longer Reloads Start Room (#2679) * [Reduced Clutter] Disable Hot/Underwater Warning Text (#2684) * Disable Warning Text * Moved to Reduced Clutter * done with all main items * bug fixes & ready * fix: process roms in consistent order (#2696) * chore: move rando savefile setup and document flags (#2697) * remove rando save init from sram * move rando savefile init logic and set more flags * document flags for rando save creation * Fix: Use correct fps value for frame interpolation with match refresh rate (#2694) * Fix: Kak GS placement on construction site (#2695) * added imgui button * addressed kenix's comments * fixed useless null * added rupee dash mode in extra modes * changed menu position --------- Co-authored-by: Adam Bird <Archez@users.noreply.github.com> Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com> Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> * LUS Scancodes (#42) * Added HD Assets Toggle * Switched out SDL for LUS scancodes * Ivan tweaks (#45) * Magic consumption slowed down; Bosses now affected by Ivan's Din spell * Adjust magic timer * clean up imgui * model fixes/improvements (#50) * replace `gUseCustomLinkModel` with custom resource check * handle adult/child * bump lus * fix model switching with tab * use lus main * fix carpet man (#52) Co-authored-by: Rozelette <Rozelette@users.noreply.github.com> * get ship model and lus texture into soh.otr, use `gAuthenticLogo` to toggle between ship and authentic (#55) * Use libultra features for CPU-modified textures (#40) * Use libultra features for CPU-modified textures * Comment * bump lus on ghost (#58) * fix: properly use `Interface_LoadActionLabel` to display start button text (#61) * Changes hd -> alt for texture replacement. (#65) * Changes hd -> alt for texture replacement. * Renames variables in gfxprint for hd -> alt change. * Update soh/soh/resource/type/Skeleton.cpp --------- Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fixes kaleido dungeon maps (#67) * skeleton stuff (#69) * comment out wii u build (#70) * bump lus (#71) * Rework readme (#72) * Update README.md * docs * put custom music docs somewhere * Update README.md * Update README.md * Update README.md * Update README.md * dark/light title image * lus * Update README.md * Fixed vanilla minimap (#73) * Fixed vanilla minimap * Workaround for pulsing SD maps with non-broken HD maps. --------- Co-authored-by: Christopher Leggett <chris@leggett.dev> * Skeleton fix fixed (#75) * WIP skelton patcher fix * Fixes skeleton reference change. * Adds const back to name in ResourceMgr_LoadSkeletonByName --------- Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Kenix <kenixwhisperwind@gmail.com> * Fixes z_message_otr memory leak. * Update soh/soh/z_message_OTR.cpp * Update soh/src/code/game.c * docs: add how to find otr files to switch instructions (#78) * bump lus (#79) * comment out RegisterBlendedTexture in king d (#80) --------- Co-authored-by: Nicholas Estelami <NEstelami@users.noreply.github.com> Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: KiritoDv <kiritodev01@gmail.com> Co-authored-by: briaguya <briaguya> Co-authored-by: Ralphie Morell <stratomaster64@gmail.com> Co-authored-by: MelonSpeedruns <melonspeedruns@outlook.com> Co-authored-by: Adam Bird <Archez@users.noreply.github.com> Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com> Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> Co-authored-by: Rozelette <Rozelette@users.noreply.github.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Lywx <36680385+KiritoDv@users.noreply.github.com>
2023-04-27 19:20:41 -04:00
// OTRTODO: Disabled for now to fix an issue with HD Textures.
// With HD textures, we need to pass the path to F3D, not the raw texture data.
// Otherwise the needed metadata is not available for proper rendering...
// This should *not* cause any crashes, but some testing may be needed...
// UPDATE: To maintain compatability it will still do the old behavior if the resource is a display list.
// That should not affect HD textures.
if (res) {
uintptr_t desiredTarget = (uintptr_t)ResourceMgr_LoadIfDListByName(imgData);
if (desiredTarget != NULL)
target = desiredTarget;
}
__gSPSegment(value, segNum, target);
}
extern "C" void gSPSegmentLoadRes(void* value, int segNum, uintptr_t target) {
char* imgData = (char*)target;
int res = ResourceMgr_OTRSigCheck(imgData);
if (res) {
target = (uintptr_t)ResourceMgr_LoadTexOrDListByName(imgData);
spockalicious (#2751) * Rough mockup of LUS XML loading * Updated code for merge * Loading from FS support and custom DList WIP implementation * Added current directory support to F3D and impl most of the dlist cmds * WIP Skeleton support * Almost done * Rebase fixes * Submodule updates * HD Texture Support * Fixes * bump lus * fix exporter build, header update * soh builds * setMesh image path cleanup * Update soh/src/overlays/actors/ovl_player_actor/z_player.c * Update soh/src/overlays/actors/ovl_player_actor/z_player.c * Update OTRExporter/OTRExporter/Main.cpp * Update ZAPDTR/ZAPD/ZResource.h * Update soh/src/code/z_skelanime.c * Update OTRExporter/OTRExporter/Main.cpp * Fixed jpeg backgrounds and decreased icon buffer size * Bump lus * Increased even more the buffer because it crashes on long texts * Removed print because sometimes the if is not triggered when the image is already byteswapped * fix non-windows build * fix build Co-authored-by: Kenix <kenixwhisperwind@gmail.com> * add hd checkbox * Various fixes for custom model support (#23) * Some fixes * Updated LUS Version * Fixed issue with Link Skirt on pause menu * Added CVar for custom link model changes * Fixed headers * Additional header fixes * Tweaks * Unload HD game assets on scene transition. (#16) * Unload game assets on scene transition. * Bump LUS * Unloads all HD assets on scene transition. * Only unload hd assets if hd assets are turned on. * Fixes issues on toggling between HD and non HD assets. --------- Co-authored-by: briaguya <briaguya@alice> * fix: actually load hd debug font (#27) * fix: actually load hd debug font * toggle debug text correctly --------- Co-authored-by: briaguya <briaguya> * Yes. (#28) * Merge branch 'develop' into dev-to-ghost * HD Skeleton Swapping and Language Fixes (#32) * Yes. * HD Skeleton Swapping and Language Fixes * Test * Fixed issues with ganon cape (#34) * Fixed Bongo Bongo Crash (#35) * Added HD Assets Toggle (#37) * Ivan the Fairy - Coop Mode (#36) * wip * hookshotable ivan * added hookshot item * new items & changes & fixes & restored navi * farore, din and nayru's spells are done * fixed slingshot & bow * added more items supported * done with all main items * bug fixes & ready * added imgui button * wip * hookshotable ivan * added hookshot item * new items & changes & fixes & restored navi * farore, din and nayru's spells are done * fixed slingshot & bow * added more items supported * fix own dungeon items on shuffled boss rooms (#2683) * bump lus (#2692) * fix: lowercase package names for vcpkg (#2693) vcpkg was throwing an error `error: invalid character in package name (must be lowercase, digits, '-')` this updates our calls to `vcpkg_install_packages` to use lowercase package names instead of uppercase * fix death mountain cloud in rando (#2691) * Fix: Switch Age No Longer Reloads Start Room (#2679) * [Reduced Clutter] Disable Hot/Underwater Warning Text (#2684) * Disable Warning Text * Moved to Reduced Clutter * done with all main items * bug fixes & ready * fix: process roms in consistent order (#2696) * chore: move rando savefile setup and document flags (#2697) * remove rando save init from sram * move rando savefile init logic and set more flags * document flags for rando save creation * Fix: Use correct fps value for frame interpolation with match refresh rate (#2694) * Fix: Kak GS placement on construction site (#2695) * added imgui button * addressed kenix's comments * fixed useless null * added rupee dash mode in extra modes * changed menu position --------- Co-authored-by: Adam Bird <Archez@users.noreply.github.com> Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com> Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> * LUS Scancodes (#42) * Added HD Assets Toggle * Switched out SDL for LUS scancodes * Ivan tweaks (#45) * Magic consumption slowed down; Bosses now affected by Ivan's Din spell * Adjust magic timer * clean up imgui * model fixes/improvements (#50) * replace `gUseCustomLinkModel` with custom resource check * handle adult/child * bump lus * fix model switching with tab * use lus main * fix carpet man (#52) Co-authored-by: Rozelette <Rozelette@users.noreply.github.com> * get ship model and lus texture into soh.otr, use `gAuthenticLogo` to toggle between ship and authentic (#55) * Use libultra features for CPU-modified textures (#40) * Use libultra features for CPU-modified textures * Comment * bump lus on ghost (#58) * fix: properly use `Interface_LoadActionLabel` to display start button text (#61) * Changes hd -> alt for texture replacement. (#65) * Changes hd -> alt for texture replacement. * Renames variables in gfxprint for hd -> alt change. * Update soh/soh/resource/type/Skeleton.cpp --------- Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fixes kaleido dungeon maps (#67) * skeleton stuff (#69) * comment out wii u build (#70) * bump lus (#71) * Rework readme (#72) * Update README.md * docs * put custom music docs somewhere * Update README.md * Update README.md * Update README.md * Update README.md * dark/light title image * lus * Update README.md * Fixed vanilla minimap (#73) * Fixed vanilla minimap * Workaround for pulsing SD maps with non-broken HD maps. --------- Co-authored-by: Christopher Leggett <chris@leggett.dev> * Skeleton fix fixed (#75) * WIP skelton patcher fix * Fixes skeleton reference change. * Adds const back to name in ResourceMgr_LoadSkeletonByName --------- Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Kenix <kenixwhisperwind@gmail.com> * Fixes z_message_otr memory leak. * Update soh/soh/z_message_OTR.cpp * Update soh/src/code/game.c * docs: add how to find otr files to switch instructions (#78) * bump lus (#79) * comment out RegisterBlendedTexture in king d (#80) --------- Co-authored-by: Nicholas Estelami <NEstelami@users.noreply.github.com> Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: KiritoDv <kiritodev01@gmail.com> Co-authored-by: briaguya <briaguya> Co-authored-by: Ralphie Morell <stratomaster64@gmail.com> Co-authored-by: MelonSpeedruns <melonspeedruns@outlook.com> Co-authored-by: Adam Bird <Archez@users.noreply.github.com> Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com> Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> Co-authored-by: Rozelette <Rozelette@users.noreply.github.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Lywx <36680385+KiritoDv@users.noreply.github.com>
2023-04-27 19:20:41 -04:00
}
__gSPSegment(value, segNum, target);
}
extern "C" void gDPSetTextureImage(Gfx* pkt, u32 format, u32 size, u32 width, uintptr_t i) {
__gDPSetTextureImage(pkt, format, size, width, i);
}
extern "C" void gDPSetTextureImageFB(Gfx* pkt, u32 format, u32 size, u32 width, int fb)
{
__gDPSetTextureImageFB(pkt, format, size, width, fb);
}
extern "C" void gSPDisplayList(Gfx* pkt, Gfx* dl) {
char* imgData = (char*)dl;
spockalicious (#2751) * Rough mockup of LUS XML loading * Updated code for merge * Loading from FS support and custom DList WIP implementation * Added current directory support to F3D and impl most of the dlist cmds * WIP Skeleton support * Almost done * Rebase fixes * Submodule updates * HD Texture Support * Fixes * bump lus * fix exporter build, header update * soh builds * setMesh image path cleanup * Update soh/src/overlays/actors/ovl_player_actor/z_player.c * Update soh/src/overlays/actors/ovl_player_actor/z_player.c * Update OTRExporter/OTRExporter/Main.cpp * Update ZAPDTR/ZAPD/ZResource.h * Update soh/src/code/z_skelanime.c * Update OTRExporter/OTRExporter/Main.cpp * Fixed jpeg backgrounds and decreased icon buffer size * Bump lus * Increased even more the buffer because it crashes on long texts * Removed print because sometimes the if is not triggered when the image is already byteswapped * fix non-windows build * fix build Co-authored-by: Kenix <kenixwhisperwind@gmail.com> * add hd checkbox * Various fixes for custom model support (#23) * Some fixes * Updated LUS Version * Fixed issue with Link Skirt on pause menu * Added CVar for custom link model changes * Fixed headers * Additional header fixes * Tweaks * Unload HD game assets on scene transition. (#16) * Unload game assets on scene transition. * Bump LUS * Unloads all HD assets on scene transition. * Only unload hd assets if hd assets are turned on. * Fixes issues on toggling between HD and non HD assets. --------- Co-authored-by: briaguya <briaguya@alice> * fix: actually load hd debug font (#27) * fix: actually load hd debug font * toggle debug text correctly --------- Co-authored-by: briaguya <briaguya> * Yes. (#28) * Merge branch 'develop' into dev-to-ghost * HD Skeleton Swapping and Language Fixes (#32) * Yes. * HD Skeleton Swapping and Language Fixes * Test * Fixed issues with ganon cape (#34) * Fixed Bongo Bongo Crash (#35) * Added HD Assets Toggle (#37) * Ivan the Fairy - Coop Mode (#36) * wip * hookshotable ivan * added hookshot item * new items & changes & fixes & restored navi * farore, din and nayru's spells are done * fixed slingshot & bow * added more items supported * done with all main items * bug fixes & ready * added imgui button * wip * hookshotable ivan * added hookshot item * new items & changes & fixes & restored navi * farore, din and nayru's spells are done * fixed slingshot & bow * added more items supported * fix own dungeon items on shuffled boss rooms (#2683) * bump lus (#2692) * fix: lowercase package names for vcpkg (#2693) vcpkg was throwing an error `error: invalid character in package name (must be lowercase, digits, '-')` this updates our calls to `vcpkg_install_packages` to use lowercase package names instead of uppercase * fix death mountain cloud in rando (#2691) * Fix: Switch Age No Longer Reloads Start Room (#2679) * [Reduced Clutter] Disable Hot/Underwater Warning Text (#2684) * Disable Warning Text * Moved to Reduced Clutter * done with all main items * bug fixes & ready * fix: process roms in consistent order (#2696) * chore: move rando savefile setup and document flags (#2697) * remove rando save init from sram * move rando savefile init logic and set more flags * document flags for rando save creation * Fix: Use correct fps value for frame interpolation with match refresh rate (#2694) * Fix: Kak GS placement on construction site (#2695) * added imgui button * addressed kenix's comments * fixed useless null * added rupee dash mode in extra modes * changed menu position --------- Co-authored-by: Adam Bird <Archez@users.noreply.github.com> Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com> Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> * LUS Scancodes (#42) * Added HD Assets Toggle * Switched out SDL for LUS scancodes * Ivan tweaks (#45) * Magic consumption slowed down; Bosses now affected by Ivan's Din spell * Adjust magic timer * clean up imgui * model fixes/improvements (#50) * replace `gUseCustomLinkModel` with custom resource check * handle adult/child * bump lus * fix model switching with tab * use lus main * fix carpet man (#52) Co-authored-by: Rozelette <Rozelette@users.noreply.github.com> * get ship model and lus texture into soh.otr, use `gAuthenticLogo` to toggle between ship and authentic (#55) * Use libultra features for CPU-modified textures (#40) * Use libultra features for CPU-modified textures * Comment * bump lus on ghost (#58) * fix: properly use `Interface_LoadActionLabel` to display start button text (#61) * Changes hd -> alt for texture replacement. (#65) * Changes hd -> alt for texture replacement. * Renames variables in gfxprint for hd -> alt change. * Update soh/soh/resource/type/Skeleton.cpp --------- Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fixes kaleido dungeon maps (#67) * skeleton stuff (#69) * comment out wii u build (#70) * bump lus (#71) * Rework readme (#72) * Update README.md * docs * put custom music docs somewhere * Update README.md * Update README.md * Update README.md * Update README.md * dark/light title image * lus * Update README.md * Fixed vanilla minimap (#73) * Fixed vanilla minimap * Workaround for pulsing SD maps with non-broken HD maps. --------- Co-authored-by: Christopher Leggett <chris@leggett.dev> * Skeleton fix fixed (#75) * WIP skelton patcher fix * Fixes skeleton reference change. * Adds const back to name in ResourceMgr_LoadSkeletonByName --------- Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Kenix <kenixwhisperwind@gmail.com> * Fixes z_message_otr memory leak. * Update soh/soh/z_message_OTR.cpp * Update soh/src/code/game.c * docs: add how to find otr files to switch instructions (#78) * bump lus (#79) * comment out RegisterBlendedTexture in king d (#80) --------- Co-authored-by: Nicholas Estelami <NEstelami@users.noreply.github.com> Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: KiritoDv <kiritodev01@gmail.com> Co-authored-by: briaguya <briaguya> Co-authored-by: Ralphie Morell <stratomaster64@gmail.com> Co-authored-by: MelonSpeedruns <melonspeedruns@outlook.com> Co-authored-by: Adam Bird <Archez@users.noreply.github.com> Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com> Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> Co-authored-by: Rozelette <Rozelette@users.noreply.github.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Lywx <36680385+KiritoDv@users.noreply.github.com>
2023-04-27 19:20:41 -04:00
if (ResourceMgr_OTRSigCheck(imgData) == 1) {
//ResourceMgr_PushCurrentDirectory(imgData);
//gsSPPushCD(pkt++, imgData);
dl = ResourceMgr_LoadGfxByName(imgData);
spockalicious (#2751) * Rough mockup of LUS XML loading * Updated code for merge * Loading from FS support and custom DList WIP implementation * Added current directory support to F3D and impl most of the dlist cmds * WIP Skeleton support * Almost done * Rebase fixes * Submodule updates * HD Texture Support * Fixes * bump lus * fix exporter build, header update * soh builds * setMesh image path cleanup * Update soh/src/overlays/actors/ovl_player_actor/z_player.c * Update soh/src/overlays/actors/ovl_player_actor/z_player.c * Update OTRExporter/OTRExporter/Main.cpp * Update ZAPDTR/ZAPD/ZResource.h * Update soh/src/code/z_skelanime.c * Update OTRExporter/OTRExporter/Main.cpp * Fixed jpeg backgrounds and decreased icon buffer size * Bump lus * Increased even more the buffer because it crashes on long texts * Removed print because sometimes the if is not triggered when the image is already byteswapped * fix non-windows build * fix build Co-authored-by: Kenix <kenixwhisperwind@gmail.com> * add hd checkbox * Various fixes for custom model support (#23) * Some fixes * Updated LUS Version * Fixed issue with Link Skirt on pause menu * Added CVar for custom link model changes * Fixed headers * Additional header fixes * Tweaks * Unload HD game assets on scene transition. (#16) * Unload game assets on scene transition. * Bump LUS * Unloads all HD assets on scene transition. * Only unload hd assets if hd assets are turned on. * Fixes issues on toggling between HD and non HD assets. --------- Co-authored-by: briaguya <briaguya@alice> * fix: actually load hd debug font (#27) * fix: actually load hd debug font * toggle debug text correctly --------- Co-authored-by: briaguya <briaguya> * Yes. (#28) * Merge branch 'develop' into dev-to-ghost * HD Skeleton Swapping and Language Fixes (#32) * Yes. * HD Skeleton Swapping and Language Fixes * Test * Fixed issues with ganon cape (#34) * Fixed Bongo Bongo Crash (#35) * Added HD Assets Toggle (#37) * Ivan the Fairy - Coop Mode (#36) * wip * hookshotable ivan * added hookshot item * new items & changes & fixes & restored navi * farore, din and nayru's spells are done * fixed slingshot & bow * added more items supported * done with all main items * bug fixes & ready * added imgui button * wip * hookshotable ivan * added hookshot item * new items & changes & fixes & restored navi * farore, din and nayru's spells are done * fixed slingshot & bow * added more items supported * fix own dungeon items on shuffled boss rooms (#2683) * bump lus (#2692) * fix: lowercase package names for vcpkg (#2693) vcpkg was throwing an error `error: invalid character in package name (must be lowercase, digits, '-')` this updates our calls to `vcpkg_install_packages` to use lowercase package names instead of uppercase * fix death mountain cloud in rando (#2691) * Fix: Switch Age No Longer Reloads Start Room (#2679) * [Reduced Clutter] Disable Hot/Underwater Warning Text (#2684) * Disable Warning Text * Moved to Reduced Clutter * done with all main items * bug fixes & ready * fix: process roms in consistent order (#2696) * chore: move rando savefile setup and document flags (#2697) * remove rando save init from sram * move rando savefile init logic and set more flags * document flags for rando save creation * Fix: Use correct fps value for frame interpolation with match refresh rate (#2694) * Fix: Kak GS placement on construction site (#2695) * added imgui button * addressed kenix's comments * fixed useless null * added rupee dash mode in extra modes * changed menu position --------- Co-authored-by: Adam Bird <Archez@users.noreply.github.com> Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com> Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> * LUS Scancodes (#42) * Added HD Assets Toggle * Switched out SDL for LUS scancodes * Ivan tweaks (#45) * Magic consumption slowed down; Bosses now affected by Ivan's Din spell * Adjust magic timer * clean up imgui * model fixes/improvements (#50) * replace `gUseCustomLinkModel` with custom resource check * handle adult/child * bump lus * fix model switching with tab * use lus main * fix carpet man (#52) Co-authored-by: Rozelette <Rozelette@users.noreply.github.com> * get ship model and lus texture into soh.otr, use `gAuthenticLogo` to toggle between ship and authentic (#55) * Use libultra features for CPU-modified textures (#40) * Use libultra features for CPU-modified textures * Comment * bump lus on ghost (#58) * fix: properly use `Interface_LoadActionLabel` to display start button text (#61) * Changes hd -> alt for texture replacement. (#65) * Changes hd -> alt for texture replacement. * Renames variables in gfxprint for hd -> alt change. * Update soh/soh/resource/type/Skeleton.cpp --------- Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fixes kaleido dungeon maps (#67) * skeleton stuff (#69) * comment out wii u build (#70) * bump lus (#71) * Rework readme (#72) * Update README.md * docs * put custom music docs somewhere * Update README.md * Update README.md * Update README.md * Update README.md * dark/light title image * lus * Update README.md * Fixed vanilla minimap (#73) * Fixed vanilla minimap * Workaround for pulsing SD maps with non-broken HD maps. --------- Co-authored-by: Christopher Leggett <chris@leggett.dev> * Skeleton fix fixed (#75) * WIP skelton patcher fix * Fixes skeleton reference change. * Adds const back to name in ResourceMgr_LoadSkeletonByName --------- Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Kenix <kenixwhisperwind@gmail.com> * Fixes z_message_otr memory leak. * Update soh/soh/z_message_OTR.cpp * Update soh/src/code/game.c * docs: add how to find otr files to switch instructions (#78) * bump lus (#79) * comment out RegisterBlendedTexture in king d (#80) --------- Co-authored-by: Nicholas Estelami <NEstelami@users.noreply.github.com> Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: KiritoDv <kiritodev01@gmail.com> Co-authored-by: briaguya <briaguya> Co-authored-by: Ralphie Morell <stratomaster64@gmail.com> Co-authored-by: MelonSpeedruns <melonspeedruns@outlook.com> Co-authored-by: Adam Bird <Archez@users.noreply.github.com> Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com> Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> Co-authored-by: Rozelette <Rozelette@users.noreply.github.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Lywx <36680385+KiritoDv@users.noreply.github.com>
2023-04-27 19:20:41 -04:00
}
__gSPDisplayList(pkt, dl);
}
extern "C" void gSPDisplayListOffset(Gfx* pkt, Gfx* dl, int offset) {
char* imgData = (char*)dl;
if (ResourceMgr_OTRSigCheck(imgData) == 1)
dl = ResourceMgr_LoadGfxByName(imgData);
__gSPDisplayList(pkt, dl + offset);
}
extern "C" void gSPVertex(Gfx* pkt, uintptr_t v, int n, int v0) {
if (ResourceMgr_OTRSigCheck((char*)v) == 1)
v = (uintptr_t)ResourceMgr_LoadVtxByName((char*)v);
__gSPVertex(pkt, v, n, v0);
}
extern "C" void gSPInvalidateTexCache(Gfx* pkt, uintptr_t texAddr)
{
char* imgData = (char*)texAddr;
if (texAddr != 0 && ResourceMgr_OTRSigCheck(imgData)) {
// Temporary solution to the mq/nonmq issue, this will be
// handled better with LUS 1.0
texAddr = (uintptr_t)ResourceMgr_LoadTexOrDListByName(imgData);
}
__gSPInvalidateTexCache(pkt, texAddr);
}