2022-03-22 02:51:23 +01:00
|
|
|
|
#include "OTRGlobals.h"
|
2022-05-12 13:28:24 -04:00
|
|
|
|
#include "OTRAudio.h"
|
2022-03-22 02:51:23 +01:00
|
|
|
|
#include <iostream>
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
#include <algorithm>
|
2022-06-20 13:54:44 -04:00
|
|
|
|
#include <filesystem>
|
2022-03-22 02:51:23 +01:00
|
|
|
|
#include <locale>
|
|
|
|
|
#include <codecvt>
|
|
|
|
|
#include "GlobalCtx2.h"
|
2022-04-26 16:50:24 -07:00
|
|
|
|
#include "GameSettings.h"
|
2022-03-22 02:51:23 +01:00
|
|
|
|
#include "ResourceMgr.h"
|
|
|
|
|
#include "DisplayList.h"
|
|
|
|
|
#include "PlayerAnimation.h"
|
|
|
|
|
#include "Skeleton.h"
|
|
|
|
|
#include "Window.h"
|
|
|
|
|
#include "z64animation.h"
|
|
|
|
|
#include "z64bgcheck.h"
|
2022-05-12 02:18:24 +09:00
|
|
|
|
#include "Enhancements/gameconsole.h"
|
2022-03-22 02:51:23 +01:00
|
|
|
|
#include <ultra64/gbi.h>
|
|
|
|
|
#include <Animation.h>
|
2022-05-12 02:18:24 +09:00
|
|
|
|
#ifdef _WIN32
|
2022-03-22 02:51:23 +01:00
|
|
|
|
#include <Windows.h>
|
2022-05-12 02:18:24 +09:00
|
|
|
|
#else
|
|
|
|
|
#include <time.h>
|
|
|
|
|
#endif
|
2022-03-22 02:51:23 +01:00
|
|
|
|
#include <Vertex.h>
|
|
|
|
|
#include <CollisionHeader.h>
|
|
|
|
|
#include <Array.h>
|
|
|
|
|
#include <Cutscene.h>
|
|
|
|
|
#include <Texture.h>
|
|
|
|
|
#include "Lib/stb/stb_image.h"
|
2022-06-15 14:18:41 -05:00
|
|
|
|
#define DRMP3_IMPLEMENTATION
|
|
|
|
|
#include "Lib/dr_libs/mp3.h"
|
|
|
|
|
#define DRWAV_IMPLEMENTATION
|
|
|
|
|
#include "Lib/dr_libs/wav.h"
|
2022-03-22 02:51:23 +01:00
|
|
|
|
#include "AudioPlayer.h"
|
2022-07-06 02:52:01 +02:00
|
|
|
|
#include "Enhancements/cosmetics/CosmeticsEditor.h"
|
2022-05-12 02:18:24 +09:00
|
|
|
|
#include "Enhancements/debugconsole.h"
|
|
|
|
|
#include "Enhancements/debugger/debugger.h"
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
#include "Enhancements/randomizer/randomizer.h"
|
|
|
|
|
#include <soh/Enhancements/randomizer/randomizer_item_tracker.h>
|
2022-07-06 15:46:01 -07:00
|
|
|
|
#include "Enhancements/n64_weird_frame_data.inc"
|
2022-05-14 00:43:55 +02:00
|
|
|
|
#include "soh/frame_interpolation.h"
|
2022-03-31 19:42:44 -04:00
|
|
|
|
#include "Utils/BitConverter.h"
|
2022-04-18 11:37:47 +02:00
|
|
|
|
#include "variables.h"
|
2022-05-12 02:18:24 +09:00
|
|
|
|
#include "macros.h"
|
2022-04-29 11:49:28 -04:00
|
|
|
|
#include <Utils/StringHelper.h>
|
2022-03-22 02:51:23 +01:00
|
|
|
|
|
2022-06-22 20:59:21 +02:00
|
|
|
|
#ifdef __APPLE__
|
|
|
|
|
#include <SDL_scancode.h>
|
|
|
|
|
#else
|
2022-05-12 13:28:24 -04:00
|
|
|
|
#include <SDL2/SDL_scancode.h>
|
2022-06-22 20:59:21 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
2022-06-01 13:06:32 -04:00
|
|
|
|
#include <Audio.h>
|
2022-03-22 02:51:23 +01:00
|
|
|
|
|
2022-05-12 13:28:24 -04:00
|
|
|
|
OTRGlobals* OTRGlobals::Instance;
|
2022-06-20 12:41:43 -05:00
|
|
|
|
SaveManager* SaveManager::Instance;
|
2022-04-18 11:37:47 +02:00
|
|
|
|
|
2022-03-22 02:51:23 +01:00
|
|
|
|
OTRGlobals::OTRGlobals() {
|
|
|
|
|
context = Ship::GlobalCtx2::CreateInstance("Ship of Harkinian");
|
2022-05-12 13:28:24 -04:00
|
|
|
|
gSaveStateMgr = std::make_shared<SaveStateMgr>();
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
gRandomizer = std::make_shared<Randomizer>();
|
2022-03-22 02:51:23 +01:00
|
|
|
|
context->GetWindow()->Init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
OTRGlobals::~OTRGlobals() {
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-15 14:18:41 -05:00
|
|
|
|
struct ExtensionEntry {
|
|
|
|
|
std::string path;
|
|
|
|
|
std::string ext;
|
|
|
|
|
};
|
|
|
|
|
|
2022-03-22 02:51:23 +01:00
|
|
|
|
extern uintptr_t clearMtx;
|
|
|
|
|
extern "C" Mtx gMtxClear;
|
|
|
|
|
extern "C" MtxF gMtxFClear;
|
|
|
|
|
extern "C" void OTRMessage_Init();
|
2022-04-18 11:37:47 +02:00
|
|
|
|
extern "C" void AudioMgr_CreateNextAudioBuffer(s16* samples, u32 num_samples);
|
|
|
|
|
extern "C" void AudioPlayer_Play(const uint8_t* buf, uint32_t len);
|
|
|
|
|
extern "C" int AudioPlayer_Buffered(void);
|
|
|
|
|
extern "C" int AudioPlayer_GetDesiredBuffered(void);
|
2022-06-01 13:06:32 -04:00
|
|
|
|
extern "C" void ResourceMgr_CacheDirectory(const char* resName);
|
2022-06-10 13:37:50 -04:00
|
|
|
|
extern "C" SequenceData ResourceMgr_LoadSeqByName(const char* path);
|
2022-06-15 14:18:41 -05:00
|
|
|
|
std::unordered_map<std::string, ExtensionEntry> ExtensionCache;
|
2022-03-22 02:51:23 +01:00
|
|
|
|
|
|
|
|
|
// C->C++ Bridge
|
2022-06-01 15:11:11 -05:00
|
|
|
|
extern "C" void OTRAudio_Init()
|
2022-06-01 13:06:32 -04:00
|
|
|
|
{
|
|
|
|
|
// Precache all our samples, sequences, etc...
|
|
|
|
|
ResourceMgr_CacheDirectory("audio");
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-15 14:18:41 -05:00
|
|
|
|
extern "C" void OTRExtScanner() {
|
|
|
|
|
auto lst = *OTRGlobals::Instance->context->GetResourceManager()->ListFiles("*.*").get();
|
2022-06-15 14:33:25 -05:00
|
|
|
|
|
2022-06-15 14:18:41 -05:00
|
|
|
|
for (auto& rPath : lst) {
|
|
|
|
|
std::vector<std::string> raw = StringHelper::Split(rPath, ".");
|
|
|
|
|
std::string ext = raw[raw.size() - 1];
|
|
|
|
|
std::string nPath = rPath.substr(0, rPath.size() - (ext.size() + 1));
|
|
|
|
|
replace(nPath.begin(), nPath.end(), '\\', '/');
|
2022-06-15 14:33:25 -05:00
|
|
|
|
|
|
|
|
|
ExtensionCache[nPath] = { rPath, ext };
|
2022-06-15 14:18:41 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-22 02:51:23 +01:00
|
|
|
|
extern "C" void InitOTR() {
|
|
|
|
|
OTRGlobals::Instance = new OTRGlobals();
|
2022-06-20 12:41:43 -05:00
|
|
|
|
SaveManager::Instance = new SaveManager();
|
2022-03-31 19:42:44 -04:00
|
|
|
|
auto t = OTRGlobals::Instance->context->GetResourceManager()->LoadFile("version");
|
|
|
|
|
|
2022-05-12 02:18:24 +09:00
|
|
|
|
if (!t->bHasLoadError)
|
2022-03-31 19:42:44 -04:00
|
|
|
|
{
|
|
|
|
|
//uint32_t gameVersion = BitConverter::ToUInt32BE((uint8_t*)t->buffer.get(), 0);
|
|
|
|
|
uint32_t gameVersion = *((uint32_t*)t->buffer.get());
|
|
|
|
|
OTRGlobals::Instance->context->GetResourceManager()->SetGameVersion(gameVersion);
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-22 02:51:23 +01:00
|
|
|
|
clearMtx = (uintptr_t)&gMtxClear;
|
|
|
|
|
OTRMessage_Init();
|
2022-06-01 13:06:32 -04:00
|
|
|
|
OTRAudio_Init();
|
2022-07-06 02:52:01 +02:00
|
|
|
|
InitCosmeticsEditor();
|
2022-03-22 02:51:23 +01:00
|
|
|
|
DebugConsole_Init();
|
2022-04-03 14:47:24 -05:00
|
|
|
|
Debug_Init();
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
Rando_Init();
|
|
|
|
|
InitItemTracker();
|
2022-06-15 14:18:41 -05:00
|
|
|
|
OTRExtScanner();
|
2022-03-22 02:51:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
2022-05-12 02:18:24 +09:00
|
|
|
|
#ifdef _WIN32
|
2022-03-22 02:51:23 +01:00
|
|
|
|
extern "C" uint64_t GetFrequency() {
|
|
|
|
|
LARGE_INTEGER nFreq;
|
|
|
|
|
|
|
|
|
|
QueryPerformanceFrequency(&nFreq);
|
|
|
|
|
|
|
|
|
|
return nFreq.QuadPart;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" uint64_t GetPerfCounter() {
|
|
|
|
|
LARGE_INTEGER ticks;
|
|
|
|
|
QueryPerformanceCounter(&ticks);
|
|
|
|
|
|
|
|
|
|
return ticks.QuadPart;
|
|
|
|
|
}
|
2022-05-12 02:18:24 +09:00
|
|
|
|
#else
|
|
|
|
|
extern "C" uint64_t GetFrequency() {
|
|
|
|
|
return 1000; // sec -> ms
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" uint64_t GetPerfCounter() {
|
|
|
|
|
struct timespec monotime;
|
|
|
|
|
clock_gettime(CLOCK_MONOTONIC, &monotime);
|
|
|
|
|
|
|
|
|
|
uint64_t remainingMs = (monotime.tv_nsec / 1000000);
|
|
|
|
|
|
|
|
|
|
// in milliseconds
|
|
|
|
|
return monotime.tv_sec * 1000 + remainingMs;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
2022-03-22 02:51:23 +01:00
|
|
|
|
|
|
|
|
|
// C->C++ Bridge
|
|
|
|
|
extern "C" void Graph_ProcessFrame(void (*run_one_game_iter)(void)) {
|
|
|
|
|
OTRGlobals::Instance->context->GetWindow()->MainLoop(run_one_game_iter);
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-29 22:17:07 +02:00
|
|
|
|
extern "C" void Graph_StartFrame() {
|
2022-05-12 13:28:24 -04:00
|
|
|
|
// Why -1?
|
|
|
|
|
int32_t dwScancode = OTRGlobals::Instance->context->GetWindow()->lastScancode;
|
|
|
|
|
OTRGlobals::Instance->context->GetWindow()->lastScancode = -1;
|
|
|
|
|
|
|
|
|
|
switch (dwScancode - 1) {
|
|
|
|
|
case SDL_SCANCODE_F5: {
|
|
|
|
|
const unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot();
|
|
|
|
|
const SaveStateReturn stateReturn =
|
|
|
|
|
OTRGlobals::Instance->gSaveStateMgr->AddRequest({ slot, RequestType::SAVE });
|
|
|
|
|
|
|
|
|
|
switch (stateReturn) {
|
|
|
|
|
case SaveStateReturn::SUCCESS:
|
|
|
|
|
SPDLOG_INFO("[SOH] Saved state to slot {}", slot);
|
|
|
|
|
break;
|
|
|
|
|
case SaveStateReturn::FAIL_WRONG_GAMESTATE:
|
|
|
|
|
SPDLOG_ERROR("[SOH] Can not save a state outside of \"GamePlay\"");
|
|
|
|
|
break;
|
|
|
|
|
[[unlikely]] default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SDL_SCANCODE_F6: {
|
|
|
|
|
unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot();
|
|
|
|
|
slot++;
|
|
|
|
|
if (slot > 5) {
|
|
|
|
|
slot = 0;
|
|
|
|
|
}
|
|
|
|
|
OTRGlobals::Instance->gSaveStateMgr->SetCurrentSlot(slot);
|
|
|
|
|
SPDLOG_INFO("Set SaveState slot to {}.", slot);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case SDL_SCANCODE_F7: {
|
|
|
|
|
const unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot();
|
|
|
|
|
const SaveStateReturn stateReturn =
|
|
|
|
|
OTRGlobals::Instance->gSaveStateMgr->AddRequest({ slot, RequestType::LOAD });
|
|
|
|
|
|
|
|
|
|
switch (stateReturn) {
|
|
|
|
|
case SaveStateReturn::SUCCESS:
|
|
|
|
|
SPDLOG_INFO("[SOH] Loaded state from slot {}", slot);
|
|
|
|
|
break;
|
|
|
|
|
case SaveStateReturn::FAIL_INVALID_SLOT:
|
|
|
|
|
SPDLOG_ERROR("[SOH] Invalid State Slot Number {}", slot);
|
|
|
|
|
break;
|
|
|
|
|
case SaveStateReturn::FAIL_STATE_EMPTY:
|
|
|
|
|
SPDLOG_ERROR("[SOH] State Slot {} is empty", slot);
|
|
|
|
|
break;
|
|
|
|
|
case SaveStateReturn::FAIL_WRONG_GAMESTATE:
|
|
|
|
|
SPDLOG_ERROR("[SOH] Can not load a state outside of \"GamePlay\"");
|
|
|
|
|
break;
|
|
|
|
|
[[unlikely]] default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-04-29 22:17:07 +02:00
|
|
|
|
OTRGlobals::Instance->context->GetWindow()->StartFrame();
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-22 02:51:23 +01:00
|
|
|
|
// C->C++ Bridge
|
|
|
|
|
extern "C" void Graph_ProcessGfxCommands(Gfx* commands) {
|
2022-04-18 11:37:47 +02:00
|
|
|
|
if (!audio.initialized) {
|
|
|
|
|
audio.initialized = true;
|
|
|
|
|
std::thread([]() {
|
|
|
|
|
for (;;) {
|
|
|
|
|
{
|
|
|
|
|
std::unique_lock<std::mutex> Lock(audio.mutex);
|
|
|
|
|
while (!audio.processing) {
|
|
|
|
|
audio.cv_to_thread.wait(Lock);
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-05-12 13:28:24 -04:00
|
|
|
|
std::unique_lock<std::mutex> Lock(audio.mutex);
|
2022-04-18 11:37:47 +02:00
|
|
|
|
//AudioMgr_ThreadEntry(&gAudioMgr);
|
|
|
|
|
// 528 and 544 relate to 60 fps at 32 kHz 32000/60 = 533.333..
|
|
|
|
|
// in an ideal world, one third of the calls should use num_samples=544 and two thirds num_samples=528
|
2022-06-10 13:37:50 -04:00
|
|
|
|
//#define SAMPLES_HIGH 560
|
|
|
|
|
//#define SAMPLES_LOW 528
|
2022-04-18 11:37:47 +02:00
|
|
|
|
// PAL values
|
|
|
|
|
//#define SAMPLES_HIGH 656
|
|
|
|
|
//#define SAMPLES_LOW 624
|
2022-06-10 13:37:50 -04:00
|
|
|
|
|
|
|
|
|
// 44KHZ values
|
|
|
|
|
#define SAMPLES_HIGH 752
|
|
|
|
|
#define SAMPLES_LOW 720
|
|
|
|
|
|
2022-04-18 11:37:47 +02:00
|
|
|
|
#define AUDIO_FRAMES_PER_UPDATE (R_UPDATE_RATE > 0 ? R_UPDATE_RATE : 1 )
|
|
|
|
|
#define NUM_AUDIO_CHANNELS 2
|
|
|
|
|
int samples_left = AudioPlayer_Buffered();
|
|
|
|
|
u32 num_audio_samples = samples_left < AudioPlayer_GetDesiredBuffered() ? SAMPLES_HIGH : SAMPLES_LOW;
|
|
|
|
|
// printf("Audio samples: %d %u\n", samples_left, num_audio_samples);
|
|
|
|
|
|
|
|
|
|
// 3 is the maximum authentic frame divisor.
|
|
|
|
|
s16 audio_buffer[SAMPLES_HIGH * NUM_AUDIO_CHANNELS * 3];
|
|
|
|
|
for (int i = 0; i < AUDIO_FRAMES_PER_UPDATE; i++) {
|
|
|
|
|
AudioMgr_CreateNextAudioBuffer(audio_buffer + i * (num_audio_samples * NUM_AUDIO_CHANNELS), num_audio_samples);
|
|
|
|
|
}
|
|
|
|
|
//for (uint32_t i = 0; i < 2 * num_audio_samples; i++) {
|
|
|
|
|
// audio_buffer[i] = Rand_Next() & 0xFF;
|
|
|
|
|
//}
|
|
|
|
|
// printf("Audio samples before submitting: %d\n", audio_api->buffered());
|
|
|
|
|
AudioPlayer_Play((u8*)audio_buffer, num_audio_samples * (sizeof(int16_t) * NUM_AUDIO_CHANNELS * AUDIO_FRAMES_PER_UPDATE));
|
|
|
|
|
|
2022-05-12 13:28:24 -04:00
|
|
|
|
audio.processing = false;
|
2022-04-18 11:37:47 +02:00
|
|
|
|
audio.cv_from_thread.notify_one();
|
|
|
|
|
}
|
|
|
|
|
}).detach();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
std::unique_lock<std::mutex> Lock(audio.mutex);
|
|
|
|
|
audio.processing = true;
|
|
|
|
|
}
|
|
|
|
|
audio.cv_to_thread.notify_one();
|
|
|
|
|
|
2022-05-14 00:43:55 +02:00
|
|
|
|
std::vector<std::unordered_map<Mtx*, MtxF>> mtx_replacements;
|
2022-05-29 18:16:23 +02:00
|
|
|
|
int target_fps = CVar_GetS32("gInterpolationFPS", 20);
|
|
|
|
|
static int last_fps;
|
|
|
|
|
static int last_update_rate;
|
|
|
|
|
static int time;
|
|
|
|
|
int fps = target_fps;
|
|
|
|
|
int original_fps = 60 / R_UPDATE_RATE;
|
|
|
|
|
|
|
|
|
|
if (target_fps == 20 || original_fps > target_fps) {
|
|
|
|
|
fps = original_fps;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (last_fps != fps || last_update_rate != R_UPDATE_RATE) {
|
|
|
|
|
time = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// time_base = fps * original_fps (one second)
|
|
|
|
|
int next_original_frame = fps;
|
|
|
|
|
|
|
|
|
|
while (time + original_fps <= next_original_frame) {
|
|
|
|
|
time += original_fps;
|
|
|
|
|
if (time != next_original_frame) {
|
|
|
|
|
mtx_replacements.push_back(FrameInterpolation_Interpolate((float)time / next_original_frame));
|
|
|
|
|
} else {
|
|
|
|
|
mtx_replacements.emplace_back();
|
2022-05-14 00:43:55 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-29 18:16:23 +02:00
|
|
|
|
time -= fps;
|
|
|
|
|
|
|
|
|
|
OTRGlobals::Instance->context->GetWindow()->SetTargetFps(fps);
|
|
|
|
|
|
|
|
|
|
int threshold = CVar_GetS32("gExtraLatencyThreshold", 80);
|
|
|
|
|
OTRGlobals::Instance->context->GetWindow()->SetMaximumFrameLatency(threshold > 0 && target_fps >= threshold ? 2 : 1);
|
|
|
|
|
|
2022-05-14 00:43:55 +02:00
|
|
|
|
OTRGlobals::Instance->context->GetWindow()->RunCommands(commands, mtx_replacements);
|
2022-03-22 02:51:23 +01:00
|
|
|
|
|
2022-05-29 18:16:23 +02:00
|
|
|
|
last_fps = fps;
|
|
|
|
|
last_update_rate = R_UPDATE_RATE;
|
|
|
|
|
|
2022-04-18 11:37:47 +02:00
|
|
|
|
{
|
|
|
|
|
std::unique_lock<std::mutex> Lock(audio.mutex);
|
|
|
|
|
while (audio.processing) {
|
|
|
|
|
audio.cv_from_thread.wait(Lock);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-22 02:51:23 +01:00
|
|
|
|
// OTRTODO: FIGURE OUT END FRAME POINT
|
|
|
|
|
/* if (OTRGlobals::Instance->context->GetWindow()->lastScancode != -1)
|
|
|
|
|
OTRGlobals::Instance->context->GetWindow()->lastScancode = -1;*/
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float divisor_num = 0.0f;
|
|
|
|
|
|
2022-04-18 11:37:47 +02:00
|
|
|
|
extern "C" void OTRGetPixelDepthPrepare(float x, float y) {
|
|
|
|
|
OTRGlobals::Instance->context->GetWindow()->GetPixelDepthPrepare(x, y);
|
2022-03-22 02:51:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" uint16_t OTRGetPixelDepth(float x, float y) {
|
|
|
|
|
return OTRGlobals::Instance->context->GetWindow()->GetPixelDepth(x, y);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" int32_t OTRGetLastScancode()
|
|
|
|
|
{
|
|
|
|
|
return OTRGlobals::Instance->context->GetWindow()->lastScancode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" void OTRResetScancode()
|
|
|
|
|
{
|
|
|
|
|
OTRGlobals::Instance->context->GetWindow()->lastScancode = -1;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-12 02:18:24 +09:00
|
|
|
|
extern "C" uint32_t ResourceMgr_GetGameVersion()
|
2022-03-31 19:42:44 -04:00
|
|
|
|
{
|
|
|
|
|
return OTRGlobals::Instance->context->GetResourceManager()->GetGameVersion();
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-22 02:51:23 +01:00
|
|
|
|
extern "C" void ResourceMgr_CacheDirectory(const char* resName) {
|
|
|
|
|
OTRGlobals::Instance->context->GetResourceManager()->CacheDirectory(resName);
|
|
|
|
|
}
|
|
|
|
|
extern "C" void ResourceMgr_DirtyDirectory(const char* resName) {
|
|
|
|
|
OTRGlobals::Instance->context->GetResourceManager()->DirtyDirectory(resName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" void ResourceMgr_InvalidateCache() {
|
|
|
|
|
OTRGlobals::Instance->context->GetResourceManager()->InvalidateResourceCache();
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-10 13:37:50 -04:00
|
|
|
|
// OTRTODO: There is probably a more elegant way to go about this...
|
|
|
|
|
extern "C" char** ResourceMgr_ListFiles(const char* searchMask, int* resultSize) {
|
|
|
|
|
auto lst = OTRGlobals::Instance->context->GetResourceManager()->ListFiles(searchMask);
|
|
|
|
|
char** result = (char**)malloc(lst->size() * sizeof(char*));
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < lst->size(); i++) {
|
2022-06-10 13:37:50 -04:00
|
|
|
|
char* str = (char*)malloc(lst.get()[0][i].size() + 1);
|
|
|
|
|
memcpy(str, lst.get()[0][i].data(), lst.get()[0][i].size());
|
|
|
|
|
str[lst.get()[0][i].size()] = '\0';
|
|
|
|
|
result[i] = str;
|
|
|
|
|
}
|
|
|
|
|
*resultSize = lst->size();
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
2022-03-22 02:51:23 +01:00
|
|
|
|
|
|
|
|
|
extern "C" void ResourceMgr_LoadFile(const char* resName) {
|
|
|
|
|
OTRGlobals::Instance->context->GetResourceManager()->LoadResource(resName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" char* ResourceMgr_LoadFileRaw(const char* resName) {
|
|
|
|
|
return OTRGlobals::Instance->context->GetResourceManager()->LoadFile(resName)->buffer.get();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" char* ResourceMgr_LoadFileFromDisk(const char* filePath) {
|
|
|
|
|
FILE* file = fopen(filePath, "r");
|
|
|
|
|
fseek(file, 0, SEEK_END);
|
|
|
|
|
int fSize = ftell(file);
|
|
|
|
|
fseek(file, 0, SEEK_SET);
|
|
|
|
|
|
|
|
|
|
char* data = (char*)malloc(fSize);
|
|
|
|
|
fread(data, 1, fSize, file);
|
|
|
|
|
|
|
|
|
|
fclose(file);
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" char* ResourceMgr_LoadJPEG(char* data, int dataSize)
|
|
|
|
|
{
|
|
|
|
|
static char* finalBuffer = 0;
|
|
|
|
|
|
|
|
|
|
if (finalBuffer == 0)
|
|
|
|
|
finalBuffer = (char*)malloc(dataSize);
|
|
|
|
|
|
|
|
|
|
int w;
|
|
|
|
|
int h;
|
|
|
|
|
int comp;
|
|
|
|
|
|
|
|
|
|
unsigned char* pixels = stbi_load_from_memory((const unsigned char*)data, 320 * 240 * 2, &w, &h, &comp, STBI_rgb_alpha);
|
|
|
|
|
//unsigned char* pixels = stbi_load_from_memory((const unsigned char*)data, 480 * 240 * 2, &w, &h, &comp, STBI_rgb_alpha);
|
|
|
|
|
int idx = 0;
|
|
|
|
|
|
|
|
|
|
for (int y = 0; y < h; y++)
|
|
|
|
|
{
|
|
|
|
|
for (int x = 0; x < w; x++)
|
|
|
|
|
{
|
|
|
|
|
uint16_t* bufferTest = (uint16_t*)finalBuffer;
|
|
|
|
|
int pixelIdx = ((y * w) + x) * 4;
|
|
|
|
|
|
|
|
|
|
uint8_t r = pixels[pixelIdx + 0] / 8;
|
|
|
|
|
uint8_t g = pixels[pixelIdx + 1] / 8;
|
|
|
|
|
uint8_t b = pixels[pixelIdx + 2] / 8;
|
|
|
|
|
|
|
|
|
|
uint8_t alphaBit = pixels[pixelIdx + 3] != 0;
|
|
|
|
|
|
|
|
|
|
uint16_t data = (r << 11) + (g << 6) + (b << 1) + alphaBit;
|
|
|
|
|
|
|
|
|
|
finalBuffer[idx++] = (data & 0xFF00) >> 8;
|
|
|
|
|
finalBuffer[idx++] = (data & 0x00FF);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (char*)finalBuffer;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-06 17:42:23 -07:00
|
|
|
|
extern "C" char* ResourceMgr_LoadTexByName(const char* texPath);
|
2022-03-22 02:51:23 +01:00
|
|
|
|
|
2022-04-06 17:42:23 -07:00
|
|
|
|
extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) {
|
2022-03-22 02:51:23 +01:00
|
|
|
|
auto res = OTRGlobals::Instance->context->GetResourceManager()->LoadResource(filePath);
|
|
|
|
|
|
|
|
|
|
if (res->resType == Ship::ResourceType::DisplayList)
|
|
|
|
|
return (char*)&((std::static_pointer_cast<Ship::DisplayList>(res))->instructions[0]);
|
|
|
|
|
else if (res->resType == Ship::ResourceType::Array)
|
|
|
|
|
return (char*)(std::static_pointer_cast<Ship::Array>(res))->vertices.data();
|
|
|
|
|
else
|
|
|
|
|
return ResourceMgr_LoadTexByName(filePath);
|
|
|
|
|
}
|
|
|
|
|
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
extern "C" Sprite* GetSeedTexture(uint8_t index) {
|
|
|
|
|
return Randomizer::GetSeedTexture(index);
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-06 17:42:23 -07:00
|
|
|
|
extern "C" char* ResourceMgr_LoadPlayerAnimByName(const char* animPath) {
|
2022-03-22 02:51:23 +01:00
|
|
|
|
auto anim = std::static_pointer_cast<Ship::PlayerAnimation>(
|
|
|
|
|
OTRGlobals::Instance->context->GetResourceManager()->LoadResource(animPath));
|
|
|
|
|
|
|
|
|
|
return (char*)&anim->limbRotData[0];
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-06 17:42:23 -07:00
|
|
|
|
extern "C" Gfx* ResourceMgr_LoadGfxByName(const char* path)
|
2022-03-22 02:51:23 +01:00
|
|
|
|
{
|
|
|
|
|
auto res = std::static_pointer_cast<Ship::DisplayList>(
|
|
|
|
|
OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path));
|
|
|
|
|
return (Gfx*)&res->instructions[0];
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-02 17:26:32 -05:00
|
|
|
|
extern "C" Gfx* ResourceMgr_PatchGfxByName(const char* path, int size) {
|
|
|
|
|
auto res = std::static_pointer_cast<Ship::DisplayList>(
|
|
|
|
|
OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path));
|
|
|
|
|
res->instructions.resize(res->instructions.size() + size);
|
|
|
|
|
return (Gfx*)&res->instructions[0];
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-06 17:42:23 -07:00
|
|
|
|
extern "C" char* ResourceMgr_LoadArrayByName(const char* path)
|
2022-03-22 02:51:23 +01:00
|
|
|
|
{
|
|
|
|
|
auto res = std::static_pointer_cast<Ship::Array>(OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path));
|
|
|
|
|
|
|
|
|
|
return (char*)res->scalars.data();
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-06 17:42:23 -07:00
|
|
|
|
extern "C" char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path) {
|
2022-03-22 02:51:23 +01:00
|
|
|
|
auto res =
|
|
|
|
|
std::static_pointer_cast<Ship::Array>(OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path));
|
|
|
|
|
|
|
|
|
|
if (res->cachedGameAsset != nullptr)
|
|
|
|
|
return (char*)res->cachedGameAsset;
|
2022-05-12 02:18:24 +09:00
|
|
|
|
else
|
2022-03-22 02:51:23 +01:00
|
|
|
|
{
|
|
|
|
|
Vec3s* data = (Vec3s*)malloc(sizeof(Vec3s) * res->scalars.size());
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < res->scalars.size(); i += 3) {
|
2022-03-22 02:51:23 +01:00
|
|
|
|
data[(i / 3)].x = res->scalars[i + 0].s16;
|
|
|
|
|
data[(i / 3)].y = res->scalars[i + 1].s16;
|
|
|
|
|
data[(i / 3)].z = res->scalars[i + 2].s16;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
res->cachedGameAsset = data;
|
|
|
|
|
|
|
|
|
|
return (char*)data;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-06 17:42:23 -07:00
|
|
|
|
extern "C" CollisionHeader* ResourceMgr_LoadColByName(const char* path)
|
2022-03-22 02:51:23 +01:00
|
|
|
|
{
|
|
|
|
|
auto colRes = std::static_pointer_cast<Ship::CollisionHeader>(OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path));
|
|
|
|
|
|
|
|
|
|
if (colRes->cachedGameAsset != nullptr)
|
|
|
|
|
return (CollisionHeader*)colRes->cachedGameAsset;
|
|
|
|
|
|
|
|
|
|
CollisionHeader* colHeader = (CollisionHeader*)malloc(sizeof(CollisionHeader));
|
|
|
|
|
|
|
|
|
|
colHeader->minBounds.x = colRes->absMinX;
|
|
|
|
|
colHeader->minBounds.y = colRes->absMinY;
|
|
|
|
|
colHeader->minBounds.z = colRes->absMinZ;
|
|
|
|
|
|
|
|
|
|
colHeader->maxBounds.x = colRes->absMaxX;
|
|
|
|
|
colHeader->maxBounds.y = colRes->absMaxY;
|
|
|
|
|
colHeader->maxBounds.z = colRes->absMaxZ;
|
|
|
|
|
|
|
|
|
|
colHeader->vtxList = (Vec3s*)malloc(sizeof(Vec3s) * colRes->vertices.size());
|
|
|
|
|
colHeader->numVertices = colRes->vertices.size();
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < colRes->vertices.size(); i++)
|
2022-03-22 02:51:23 +01:00
|
|
|
|
{
|
|
|
|
|
colHeader->vtxList[i].x = colRes->vertices[i].x;
|
|
|
|
|
colHeader->vtxList[i].y = colRes->vertices[i].y;
|
|
|
|
|
colHeader->vtxList[i].z = colRes->vertices[i].z;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
colHeader->polyList = (CollisionPoly*)malloc(sizeof(CollisionPoly) * colRes->polygons.size());
|
|
|
|
|
colHeader->numPolygons = colRes->polygons.size();
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < colRes->polygons.size(); i++)
|
2022-03-22 02:51:23 +01:00
|
|
|
|
{
|
|
|
|
|
colHeader->polyList[i].type = colRes->polygons[i].type;
|
|
|
|
|
colHeader->polyList[i].flags_vIA = colRes->polygons[i].vtxA;
|
|
|
|
|
colHeader->polyList[i].flags_vIB = colRes->polygons[i].vtxB;
|
|
|
|
|
colHeader->polyList[i].vIC = colRes->polygons[i].vtxC;
|
|
|
|
|
colHeader->polyList[i].normal.x = colRes->polygons[i].a;
|
|
|
|
|
colHeader->polyList[i].normal.y = colRes->polygons[i].b;
|
|
|
|
|
colHeader->polyList[i].normal.z = colRes->polygons[i].c;
|
|
|
|
|
colHeader->polyList[i].dist = colRes->polygons[i].d;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
colHeader->surfaceTypeList = (SurfaceType*)malloc(colRes->polygonTypes.size() * sizeof(SurfaceType));
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < colRes->polygonTypes.size(); i++)
|
2022-03-22 02:51:23 +01:00
|
|
|
|
{
|
|
|
|
|
colHeader->surfaceTypeList[i].data[0] = colRes->polygonTypes[i] >> 32;
|
|
|
|
|
colHeader->surfaceTypeList[i].data[1] = colRes->polygonTypes[i] & 0xFFFFFFFF;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
colHeader->cameraDataList = (CamData*)malloc(sizeof(CamData) * colRes->camData->entries.size());
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < colRes->camData->entries.size(); i++)
|
2022-03-22 02:51:23 +01:00
|
|
|
|
{
|
|
|
|
|
colHeader->cameraDataList[i].cameraSType = colRes->camData->entries[i]->cameraSType;
|
|
|
|
|
colHeader->cameraDataList[i].numCameras = colRes->camData->entries[i]->numData;
|
|
|
|
|
|
|
|
|
|
int idx = colRes->camData->entries[i]->cameraPosDataIdx;
|
|
|
|
|
|
|
|
|
|
colHeader->cameraDataList[i].camPosData = (Vec3s*)malloc(sizeof(Vec3s));
|
|
|
|
|
|
|
|
|
|
if (colRes->camData->cameraPositionData.size() > 0)
|
|
|
|
|
{
|
|
|
|
|
colHeader->cameraDataList[i].camPosData->x = colRes->camData->cameraPositionData[idx]->x;
|
|
|
|
|
colHeader->cameraDataList[i].camPosData->y = colRes->camData->cameraPositionData[idx]->y;
|
|
|
|
|
colHeader->cameraDataList[i].camPosData->z = colRes->camData->cameraPositionData[idx]->z;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
colHeader->cameraDataList[i].camPosData->x = 0;
|
|
|
|
|
colHeader->cameraDataList[i].camPosData->y = 0;
|
|
|
|
|
colHeader->cameraDataList[i].camPosData->z = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
colHeader->numWaterBoxes = colRes->waterBoxes.size();
|
|
|
|
|
colHeader->waterBoxes = (WaterBox*)malloc(sizeof(WaterBox) * colHeader->numWaterBoxes);
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < colHeader->numWaterBoxes; i++)
|
|
|
|
|
{
|
|
|
|
|
colHeader->waterBoxes[i].xLength = colRes->waterBoxes[i].xLength;
|
|
|
|
|
colHeader->waterBoxes[i].ySurface = colRes->waterBoxes[i].ySurface;
|
|
|
|
|
colHeader->waterBoxes[i].xMin = colRes->waterBoxes[i].xMin;
|
|
|
|
|
colHeader->waterBoxes[i].zMin = colRes->waterBoxes[i].zMin;
|
|
|
|
|
colHeader->waterBoxes[i].xLength = colRes->waterBoxes[i].xLength;
|
|
|
|
|
colHeader->waterBoxes[i].zLength = colRes->waterBoxes[i].zLength;
|
|
|
|
|
colHeader->waterBoxes[i].properties = colRes->waterBoxes[i].properties;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
colRes->cachedGameAsset = colHeader;
|
|
|
|
|
|
|
|
|
|
return (CollisionHeader*)colHeader;
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-01 13:06:32 -04:00
|
|
|
|
extern "C" Vtx* ResourceMgr_LoadVtxByName(const char* path)
|
2022-03-22 02:51:23 +01:00
|
|
|
|
{
|
|
|
|
|
auto res = std::static_pointer_cast<Ship::Array>(OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path));
|
|
|
|
|
return (Vtx*)res->vertices.data();
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-15 09:42:37 -05:00
|
|
|
|
extern "C" SequenceData ResourceMgr_LoadSeqByName(const char* path)
|
2022-06-01 13:06:32 -04:00
|
|
|
|
{
|
2022-06-15 12:22:21 -04:00
|
|
|
|
auto file = std::static_pointer_cast<Ship::AudioSequence>(OTRGlobals::Instance->context->GetResourceManager()
|
|
|
|
|
->LoadResource(path));
|
2022-06-10 13:37:50 -04:00
|
|
|
|
|
|
|
|
|
SequenceData seqData;
|
2022-06-15 12:22:21 -04:00
|
|
|
|
seqData.seqNumber = file->seqNumber;
|
|
|
|
|
seqData.medium = file->medium;
|
|
|
|
|
seqData.cachePolicy = file->cachePolicy;
|
|
|
|
|
seqData.numFonts = file->fonts.size();
|
2022-06-10 13:37:50 -04:00
|
|
|
|
|
|
|
|
|
for (int i = 0; i < seqData.numFonts; i++)
|
2022-06-15 12:22:21 -04:00
|
|
|
|
seqData.fonts[i] = file->fonts[i];
|
2022-06-10 13:37:50 -04:00
|
|
|
|
|
2022-06-15 12:22:21 -04:00
|
|
|
|
seqData.seqData = file->seqData.data();
|
|
|
|
|
seqData.seqDataSize = file->seqData.size();
|
2022-06-10 13:37:50 -04:00
|
|
|
|
|
|
|
|
|
return seqData;
|
2022-06-01 13:06:32 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::map<std::string, SoundFontSample*> cachedCustomSFs;
|
|
|
|
|
|
2022-06-15 14:33:25 -05:00
|
|
|
|
extern "C" SoundFontSample* ReadCustomSample(const char* path) {
|
|
|
|
|
|
2022-06-15 14:38:36 -05:00
|
|
|
|
if (!ExtensionCache.contains(path))
|
2022-06-15 14:33:25 -05:00
|
|
|
|
return nullptr;
|
|
|
|
|
|
2022-06-15 14:38:36 -05:00
|
|
|
|
ExtensionEntry entry = ExtensionCache[path];
|
2022-06-15 14:33:25 -05:00
|
|
|
|
|
2022-06-15 14:18:41 -05:00
|
|
|
|
auto sampleRaw = OTRGlobals::Instance->context->GetResourceManager()->LoadFile(entry.path);
|
2022-06-01 13:06:32 -04:00
|
|
|
|
uint32_t* strem = (uint32_t*)sampleRaw->buffer.get();
|
|
|
|
|
uint8_t* strem2 = (uint8_t*)strem;
|
|
|
|
|
|
2022-06-15 14:18:41 -05:00
|
|
|
|
SoundFontSample* sampleC = new SoundFontSample;
|
2022-06-01 13:06:32 -04:00
|
|
|
|
|
2022-06-15 14:33:25 -05:00
|
|
|
|
if (entry.ext == "wav") {
|
2022-06-15 14:18:41 -05:00
|
|
|
|
drwav_uint32 channels;
|
|
|
|
|
drwav_uint32 sampleRate;
|
|
|
|
|
drwav_uint64 totalPcm;
|
2022-06-19 02:03:04 -05:00
|
|
|
|
drmp3_int16* pcmData =
|
2022-06-15 14:33:25 -05:00
|
|
|
|
drwav_open_memory_and_read_pcm_frames_s16(strem2, sampleRaw->dwBufferSize, &channels, &sampleRate, &totalPcm, NULL);
|
2022-06-15 14:18:41 -05:00
|
|
|
|
sampleC->size = totalPcm;
|
|
|
|
|
sampleC->sampleAddr = (uint8_t*)pcmData;
|
2022-06-01 13:06:32 -04:00
|
|
|
|
sampleC->codec = CODEC_S16;
|
|
|
|
|
|
2022-06-15 14:33:25 -05:00
|
|
|
|
sampleC->loop = new AdpcmLoop;
|
2022-06-01 13:06:32 -04:00
|
|
|
|
sampleC->loop->start = 0;
|
2022-06-15 14:18:41 -05:00
|
|
|
|
sampleC->loop->end = sampleC->size - 1;
|
2022-06-01 13:06:32 -04:00
|
|
|
|
sampleC->loop->count = 0;
|
2022-06-10 13:37:50 -04:00
|
|
|
|
sampleC->sampleRateMagicValue = 'RIFF';
|
|
|
|
|
sampleC->sampleRate = sampleRate;
|
2022-06-01 15:11:11 -05:00
|
|
|
|
|
2022-06-15 14:33:25 -05:00
|
|
|
|
cachedCustomSFs[path] = sampleC;
|
2022-06-01 13:06:32 -04:00
|
|
|
|
return sampleC;
|
2022-06-15 14:18:41 -05:00
|
|
|
|
} else if (entry.ext == "mp3") {
|
|
|
|
|
drmp3_config mp3Info;
|
|
|
|
|
drmp3_uint64 totalPcm;
|
|
|
|
|
drmp3_int16* pcmData =
|
|
|
|
|
drmp3_open_memory_and_read_pcm_frames_s16(strem2, sampleRaw->dwBufferSize, &mp3Info, &totalPcm, NULL);
|
|
|
|
|
|
|
|
|
|
sampleC->size = totalPcm * mp3Info.channels * sizeof(short);
|
|
|
|
|
sampleC->sampleAddr = (uint8_t*)pcmData;
|
|
|
|
|
sampleC->codec = CODEC_S16;
|
|
|
|
|
|
2022-06-15 14:33:25 -05:00
|
|
|
|
sampleC->loop = new AdpcmLoop;
|
2022-06-15 14:18:41 -05:00
|
|
|
|
sampleC->loop->start = 0;
|
|
|
|
|
sampleC->loop->end = sampleC->size;
|
|
|
|
|
sampleC->loop->count = 0;
|
|
|
|
|
sampleC->sampleRateMagicValue = 'RIFF';
|
|
|
|
|
sampleC->sampleRate = mp3Info.sampleRate;
|
|
|
|
|
|
2022-06-15 14:33:25 -05:00
|
|
|
|
cachedCustomSFs[path] = sampleC;
|
2022-06-15 14:18:41 -05:00
|
|
|
|
return sampleC;
|
|
|
|
|
}
|
2022-06-15 14:33:25 -05:00
|
|
|
|
|
2022-06-15 14:18:41 -05:00
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" SoundFontSample* ResourceMgr_LoadAudioSample(const char* path)
|
|
|
|
|
{
|
|
|
|
|
if (std::string(path) == "")
|
|
|
|
|
return nullptr;
|
|
|
|
|
|
|
|
|
|
if (cachedCustomSFs.find(path) != cachedCustomSFs.end())
|
|
|
|
|
return cachedCustomSFs[path];
|
2022-06-15 14:33:25 -05:00
|
|
|
|
|
|
|
|
|
SoundFontSample* cSample = ReadCustomSample(path);
|
|
|
|
|
|
|
|
|
|
if (cSample != nullptr)
|
|
|
|
|
return cSample;
|
2022-06-01 13:06:32 -04:00
|
|
|
|
|
2022-06-10 13:37:50 -04:00
|
|
|
|
auto sample = std::static_pointer_cast<Ship::AudioSample>(
|
|
|
|
|
OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path));
|
2022-06-01 15:11:11 -05:00
|
|
|
|
|
2022-06-01 13:06:32 -04:00
|
|
|
|
if (sample == nullptr)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
2022-06-15 09:42:37 -05:00
|
|
|
|
if (sample->cachedGameAsset != nullptr)
|
2022-06-01 13:06:32 -04:00
|
|
|
|
{
|
2022-06-01 13:06:32 -04:00
|
|
|
|
SoundFontSample* sampleC = (SoundFontSample*)sample->cachedGameAsset;
|
|
|
|
|
return (SoundFontSample*)sample->cachedGameAsset;
|
2022-06-01 13:06:32 -04:00
|
|
|
|
}
|
2022-06-15 09:42:37 -05:00
|
|
|
|
else
|
2022-06-01 13:06:32 -04:00
|
|
|
|
{
|
2022-06-15 14:33:25 -05:00
|
|
|
|
SoundFontSample* sampleC = new SoundFontSample;
|
2022-06-01 13:06:32 -04:00
|
|
|
|
|
|
|
|
|
sampleC->sampleAddr = sample->data.data();
|
|
|
|
|
|
|
|
|
|
sampleC->size = sample->data.size();
|
|
|
|
|
sampleC->codec = sample->codec;
|
|
|
|
|
sampleC->medium = sample->medium;
|
|
|
|
|
sampleC->unk_bit26 = sample->unk_bit26;
|
|
|
|
|
sampleC->unk_bit25 = sample->unk_bit25;
|
|
|
|
|
|
2022-06-15 14:33:25 -05:00
|
|
|
|
sampleC->book = new AdpcmBook[sample->book.books.size() * sizeof(int16_t)];
|
2022-06-01 13:06:32 -04:00
|
|
|
|
sampleC->book->npredictors = sample->book.npredictors;
|
|
|
|
|
sampleC->book->order = sample->book.order;
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < sample->book.books.size(); i++)
|
2022-06-01 13:06:32 -04:00
|
|
|
|
sampleC->book->book[i] = sample->book.books[i];
|
|
|
|
|
|
2022-06-15 14:33:25 -05:00
|
|
|
|
sampleC->loop = new AdpcmLoop;
|
2022-06-01 13:06:32 -04:00
|
|
|
|
sampleC->loop->start = sample->loop.start;
|
|
|
|
|
sampleC->loop->end = sample->loop.end;
|
|
|
|
|
sampleC->loop->count = sample->loop.count;
|
|
|
|
|
|
2022-06-13 18:05:51 -04:00
|
|
|
|
for (int i = 0; i < 16; i++)
|
|
|
|
|
sampleC->loop->state[i] = 0;
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < sample->loop.states.size(); i++)
|
2022-06-01 13:06:32 -04:00
|
|
|
|
sampleC->loop->state[i] = sample->loop.states[i];
|
|
|
|
|
|
|
|
|
|
sample->cachedGameAsset = sampleC;
|
|
|
|
|
return sampleC;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-14 00:59:31 -04:00
|
|
|
|
extern "C" SoundFont* ResourceMgr_LoadAudioSoundFont(const char* path) {
|
2022-06-01 13:06:32 -04:00
|
|
|
|
auto soundFont =
|
2022-06-14 00:59:31 -04:00
|
|
|
|
std::static_pointer_cast<Ship::AudioSoundFont>(OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path));
|
2022-06-01 13:06:32 -04:00
|
|
|
|
|
|
|
|
|
if (soundFont == nullptr)
|
|
|
|
|
return NULL;
|
|
|
|
|
|
2022-06-01 15:11:11 -05:00
|
|
|
|
if (soundFont->cachedGameAsset != nullptr)
|
2022-06-01 13:06:32 -04:00
|
|
|
|
{
|
|
|
|
|
return (SoundFont*)soundFont->cachedGameAsset;
|
|
|
|
|
}
|
2022-06-01 15:11:11 -05:00
|
|
|
|
else
|
2022-06-01 13:06:32 -04:00
|
|
|
|
{
|
|
|
|
|
SoundFont* soundFontC = (SoundFont*)malloc(sizeof(SoundFont));
|
|
|
|
|
|
2022-06-14 00:59:31 -04:00
|
|
|
|
soundFontC->fntIndex = soundFont->id;
|
2022-06-01 13:06:32 -04:00
|
|
|
|
soundFontC->numDrums = soundFont->drums.size();
|
|
|
|
|
soundFontC->numInstruments = soundFont->instruments.size();
|
|
|
|
|
soundFontC->numSfx = soundFont->soundEffects.size();
|
|
|
|
|
soundFontC->sampleBankId1 = soundFont->data1 >> 8;
|
|
|
|
|
soundFontC->sampleBankId2 = soundFont->data1 & 0xFF;
|
|
|
|
|
|
|
|
|
|
soundFontC->drums = (Drum**)malloc(sizeof(Drum*) * soundFont->drums.size());
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < soundFont->drums.size(); i++)
|
2022-06-01 13:06:32 -04:00
|
|
|
|
{
|
|
|
|
|
Drum* drum = (Drum*)malloc(sizeof(Drum));
|
|
|
|
|
|
|
|
|
|
drum->releaseRate = soundFont->drums[i].releaseRate;
|
|
|
|
|
drum->pan = soundFont->drums[i].pan;
|
|
|
|
|
drum->loaded = 0;
|
|
|
|
|
|
|
|
|
|
if (soundFont->drums[i].env.size() == 0)
|
|
|
|
|
drum->envelope = NULL;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
drum->envelope = (AdsrEnvelope*)malloc(sizeof(AdsrEnvelope) * soundFont->drums[i].env.size());
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t k = 0; k < soundFont->drums[i].env.size(); k++)
|
2022-06-01 13:06:32 -04:00
|
|
|
|
{
|
|
|
|
|
drum->envelope[k].delay = BOMSWAP16(soundFont->drums[i].env[k]->delay);
|
|
|
|
|
drum->envelope[k].arg = BOMSWAP16(soundFont->drums[i].env[k]->arg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-10 13:37:50 -04:00
|
|
|
|
drum->sound.sample = ResourceMgr_LoadAudioSample(soundFont->drums[i].sampleFileName.c_str());
|
2022-06-01 13:06:32 -04:00
|
|
|
|
drum->sound.tuning = soundFont->drums[i].tuning;
|
|
|
|
|
|
|
|
|
|
soundFontC->drums[i] = drum;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
soundFontC->instruments = (Instrument**)malloc(sizeof(Instrument*) * soundFont->instruments.size());
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < soundFont->instruments.size(); i++) {
|
2022-06-01 13:06:32 -04:00
|
|
|
|
|
2022-06-01 15:11:11 -05:00
|
|
|
|
if (soundFont->instruments[i].isValidEntry)
|
2022-06-01 13:06:32 -04:00
|
|
|
|
{
|
|
|
|
|
Instrument* inst = (Instrument*)malloc(sizeof(Instrument));
|
|
|
|
|
|
|
|
|
|
inst->loaded = 0;
|
|
|
|
|
inst->releaseRate = soundFont->instruments[i].releaseRate;
|
|
|
|
|
inst->normalRangeLo = soundFont->instruments[i].normalRangeLo;
|
|
|
|
|
inst->normalRangeHi = soundFont->instruments[i].normalRangeHi;
|
|
|
|
|
|
|
|
|
|
if (soundFont->instruments[i].env.size() == 0)
|
|
|
|
|
inst->envelope = NULL;
|
2022-06-01 15:11:11 -05:00
|
|
|
|
else
|
2022-06-01 13:06:32 -04:00
|
|
|
|
{
|
|
|
|
|
inst->envelope = (AdsrEnvelope*)malloc(sizeof(AdsrEnvelope) * soundFont->instruments[i].env.size());
|
2022-06-01 15:11:11 -05:00
|
|
|
|
|
|
|
|
|
for (int k = 0; k < soundFont->instruments[i].env.size(); k++)
|
2022-06-01 13:06:32 -04:00
|
|
|
|
{
|
|
|
|
|
inst->envelope[k].delay = BOMSWAP16(soundFont->instruments[i].env[k]->delay);
|
|
|
|
|
inst->envelope[k].arg = BOMSWAP16(soundFont->instruments[i].env[k]->arg);
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-06-01 15:11:11 -05:00
|
|
|
|
if (soundFont->instruments[i].lowNotesSound != nullptr)
|
2022-06-01 13:06:32 -04:00
|
|
|
|
{
|
|
|
|
|
inst->lowNotesSound.sample =
|
2022-06-10 13:37:50 -04:00
|
|
|
|
ResourceMgr_LoadAudioSample(soundFont->instruments[i].lowNotesSound->sampleFileName.c_str());
|
2022-06-01 13:06:32 -04:00
|
|
|
|
inst->lowNotesSound.tuning = soundFont->instruments[i].lowNotesSound->tuning;
|
|
|
|
|
} else {
|
|
|
|
|
inst->lowNotesSound.sample = NULL;
|
|
|
|
|
inst->lowNotesSound.tuning = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (soundFont->instruments[i].normalNotesSound != nullptr) {
|
|
|
|
|
inst->normalNotesSound.sample =
|
2022-06-10 13:37:50 -04:00
|
|
|
|
ResourceMgr_LoadAudioSample(soundFont->instruments[i].normalNotesSound->sampleFileName.c_str());
|
2022-06-01 13:06:32 -04:00
|
|
|
|
inst->normalNotesSound.tuning = soundFont->instruments[i].normalNotesSound->tuning;
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
inst->normalNotesSound.sample = NULL;
|
|
|
|
|
inst->normalNotesSound.tuning = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (soundFont->instruments[i].highNotesSound != nullptr) {
|
|
|
|
|
inst->highNotesSound.sample =
|
2022-06-10 13:37:50 -04:00
|
|
|
|
ResourceMgr_LoadAudioSample(soundFont->instruments[i].highNotesSound->sampleFileName.c_str());
|
2022-06-01 13:06:32 -04:00
|
|
|
|
inst->highNotesSound.tuning = soundFont->instruments[i].highNotesSound->tuning;
|
|
|
|
|
} else {
|
|
|
|
|
inst->highNotesSound.sample = NULL;
|
|
|
|
|
inst->highNotesSound.tuning = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
soundFontC->instruments[i] = inst;
|
2022-06-16 23:09:50 -05:00
|
|
|
|
}
|
|
|
|
|
else
|
2022-06-01 13:06:32 -04:00
|
|
|
|
{
|
2022-06-01 13:06:32 -04:00
|
|
|
|
soundFontC->instruments[i] = nullptr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
soundFontC->soundEffects = (SoundFontSound*)malloc(sizeof(SoundFontSound) * soundFont->soundEffects.size());
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < soundFont->soundEffects.size(); i++)
|
2022-06-01 13:06:32 -04:00
|
|
|
|
{
|
2022-06-10 13:37:50 -04:00
|
|
|
|
soundFontC->soundEffects[i].sample = ResourceMgr_LoadAudioSample(soundFont->soundEffects[i]->sampleFileName.c_str());
|
2022-06-01 13:06:32 -04:00
|
|
|
|
soundFontC->soundEffects[i].tuning = soundFont->soundEffects[i]->tuning;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
soundFont->cachedGameAsset = soundFontC;
|
|
|
|
|
return soundFontC;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-22 02:51:23 +01:00
|
|
|
|
extern "C" int ResourceMgr_OTRSigCheck(char* imgData)
|
|
|
|
|
{
|
|
|
|
|
uintptr_t i = (uintptr_t)(imgData);
|
|
|
|
|
|
2022-06-17 00:39:07 -04:00
|
|
|
|
// if (i == 0xD9000000 || i == 0xE7000000 || (i & 1) == 1)
|
2022-05-15 01:19:02 +02:00
|
|
|
|
if ((i & 1) == 1)
|
2022-03-22 02:51:23 +01:00
|
|
|
|
return 0;
|
|
|
|
|
|
2022-06-17 00:39:07 -04:00
|
|
|
|
// if ((i & 0xFF000000) != 0xAB000000 && (i & 0xFF000000) != 0xCD000000 && i != 0) {
|
2022-05-15 01:19:02 +02:00
|
|
|
|
if (i != 0) {
|
2022-03-22 02:51:23 +01:00
|
|
|
|
if (imgData[0] == '_' && imgData[1] == '_' && imgData[2] == 'O' && imgData[3] == 'T' && imgData[4] == 'R' &&
|
|
|
|
|
imgData[5] == '_' && imgData[6] == '_')
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-06 17:42:23 -07:00
|
|
|
|
extern "C" AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path) {
|
2022-03-22 02:51:23 +01:00
|
|
|
|
auto res = std::static_pointer_cast<Ship::Animation>(
|
|
|
|
|
OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path));
|
|
|
|
|
|
|
|
|
|
if (res->cachedGameAsset != nullptr)
|
|
|
|
|
return (AnimationHeaderCommon*)res->cachedGameAsset;
|
|
|
|
|
|
|
|
|
|
AnimationHeaderCommon* anim = nullptr;
|
|
|
|
|
|
|
|
|
|
if (res->type == Ship::AnimationType::Normal) {
|
|
|
|
|
AnimationHeader* animNormal = (AnimationHeader*)malloc(sizeof(AnimationHeader));
|
|
|
|
|
|
|
|
|
|
animNormal->common.frameCount = res->frameCount;
|
|
|
|
|
animNormal->frameData = (int16_t*)malloc(res->rotationValues.size() * sizeof(int16_t));
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < res->rotationValues.size(); i++)
|
2022-03-22 02:51:23 +01:00
|
|
|
|
animNormal->frameData[i] = res->rotationValues[i];
|
|
|
|
|
|
|
|
|
|
animNormal->jointIndices = (JointIndex*)malloc(res->rotationIndices.size() * sizeof(Vec3s));
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < res->rotationIndices.size(); i++) {
|
2022-03-22 02:51:23 +01:00
|
|
|
|
animNormal->jointIndices[i].x = res->rotationIndices[i].x;
|
|
|
|
|
animNormal->jointIndices[i].y = res->rotationIndices[i].y;
|
|
|
|
|
animNormal->jointIndices[i].z = res->rotationIndices[i].z;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
animNormal->staticIndexMax = res->limit;
|
|
|
|
|
|
|
|
|
|
anim = (AnimationHeaderCommon*)animNormal;
|
|
|
|
|
}
|
|
|
|
|
else if (res->type == Ship::AnimationType::Curve)
|
|
|
|
|
{
|
|
|
|
|
TransformUpdateIndex* animCurve = (TransformUpdateIndex*)malloc(sizeof(TransformUpdateIndex));
|
|
|
|
|
|
|
|
|
|
animCurve->copyValues = (s16*)malloc(res->copyValuesArr.size() * sizeof(s16));
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < res->copyValuesArr.size(); i++)
|
2022-03-22 02:51:23 +01:00
|
|
|
|
animCurve->copyValues[i] = res->copyValuesArr[i];
|
|
|
|
|
|
|
|
|
|
animCurve->transformData = (TransformData*)malloc(res->transformDataArr.size() * sizeof(TransformData));
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < res->transformDataArr.size(); i++)
|
2022-03-22 02:51:23 +01:00
|
|
|
|
{
|
|
|
|
|
animCurve->transformData[i].unk_00 = res->transformDataArr[i].unk_00;
|
|
|
|
|
animCurve->transformData[i].unk_02 = res->transformDataArr[i].unk_02;
|
|
|
|
|
animCurve->transformData[i].unk_04 = res->transformDataArr[i].unk_04;
|
|
|
|
|
animCurve->transformData[i].unk_06 = res->transformDataArr[i].unk_06;
|
|
|
|
|
animCurve->transformData[i].unk_08 = res->transformDataArr[i].unk_08;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
animCurve->refIndex = (u8*)malloc(res->refIndexArr.size());
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < res->refIndexArr.size(); i++)
|
2022-03-22 02:51:23 +01:00
|
|
|
|
animCurve->refIndex[i] = res->refIndexArr[i];
|
|
|
|
|
|
|
|
|
|
anim = (AnimationHeaderCommon*)animCurve;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
LinkAnimationHeader* animLink = (LinkAnimationHeader*)malloc(sizeof(LinkAnimationHeader));
|
|
|
|
|
animLink->common.frameCount = res->frameCount;
|
|
|
|
|
animLink->segment = (void*)res->segPtr;
|
|
|
|
|
|
|
|
|
|
anim = (AnimationHeaderCommon*)animLink;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
res->cachedGameAsset = anim;
|
|
|
|
|
|
|
|
|
|
return anim;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-06 17:42:23 -07:00
|
|
|
|
extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path) {
|
2022-03-22 02:51:23 +01:00
|
|
|
|
auto res = std::static_pointer_cast<Ship::Skeleton>(OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path));
|
|
|
|
|
|
|
|
|
|
if (res->cachedGameAsset != nullptr)
|
|
|
|
|
return (SkeletonHeader*)res->cachedGameAsset;
|
|
|
|
|
|
|
|
|
|
SkeletonHeader* baseHeader = nullptr;
|
|
|
|
|
|
|
|
|
|
if (res->type == Ship::SkeletonType::Normal)
|
|
|
|
|
{
|
|
|
|
|
baseHeader = (SkeletonHeader*)malloc(sizeof(SkeletonHeader));
|
|
|
|
|
}
|
|
|
|
|
else if (res->type == Ship::SkeletonType::Curve)
|
|
|
|
|
{
|
|
|
|
|
SkelCurveLimbList* curve = (SkelCurveLimbList*)malloc(sizeof(SkelCurveLimbList));
|
|
|
|
|
curve->limbCount = res->limbCount;
|
|
|
|
|
curve->limbs = (SkelCurveLimb**)malloc(res->limbCount * sizeof(SkelCurveLimb*));
|
|
|
|
|
baseHeader = (SkeletonHeader*)curve;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
FlexSkeletonHeader* flex = (FlexSkeletonHeader*)malloc(sizeof(FlexSkeletonHeader));
|
|
|
|
|
flex->dListCount = res->dListCount;
|
|
|
|
|
|
|
|
|
|
baseHeader = (SkeletonHeader*)flex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (res->type != Ship::SkeletonType::Curve)
|
|
|
|
|
{
|
|
|
|
|
baseHeader->limbCount = res->limbCount;
|
|
|
|
|
baseHeader->segment = (void**)malloc(sizeof(StandardLimb*) * res->limbTable.size());
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < res->limbTable.size(); i++) {
|
2022-03-22 02:51:23 +01:00
|
|
|
|
std::string limbStr = res->limbTable[i];
|
|
|
|
|
auto limb = std::static_pointer_cast<Ship::SkeletonLimb>(
|
|
|
|
|
OTRGlobals::Instance->context->GetResourceManager()->LoadResource(limbStr.c_str()));
|
|
|
|
|
|
|
|
|
|
if (limb->limbType == Ship::LimbType::LOD) {
|
|
|
|
|
LodLimb* limbC = (LodLimb*)malloc(sizeof(LodLimb));
|
|
|
|
|
limbC->jointPos.x = limb->transX;
|
|
|
|
|
limbC->jointPos.y = limb->transY;
|
|
|
|
|
limbC->jointPos.z = limb->transZ;
|
|
|
|
|
limbC->child = limb->childIndex;
|
|
|
|
|
limbC->sibling = limb->siblingIndex;
|
|
|
|
|
|
|
|
|
|
if (limb->dListPtr != "") {
|
2022-04-06 17:42:23 -07:00
|
|
|
|
auto dList = ResourceMgr_LoadGfxByName(limb->dListPtr.c_str());
|
2022-03-22 02:51:23 +01:00
|
|
|
|
limbC->dLists[0] = dList;
|
|
|
|
|
} else {
|
|
|
|
|
limbC->dLists[0] = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (limb->dList2Ptr != "") {
|
2022-04-06 17:42:23 -07:00
|
|
|
|
auto dList = ResourceMgr_LoadGfxByName(limb->dList2Ptr.c_str());
|
2022-03-22 02:51:23 +01:00
|
|
|
|
limbC->dLists[1] = dList;
|
|
|
|
|
} else {
|
|
|
|
|
limbC->dLists[1] = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
baseHeader->segment[i] = limbC;
|
|
|
|
|
}
|
|
|
|
|
else if (limb->limbType == Ship::LimbType::Standard)
|
|
|
|
|
{
|
|
|
|
|
const auto limbC = new StandardLimb;
|
|
|
|
|
limbC->jointPos.x = limb->transX;
|
|
|
|
|
limbC->jointPos.y = limb->transY;
|
|
|
|
|
limbC->jointPos.z = limb->transZ;
|
|
|
|
|
limbC->child = limb->childIndex;
|
|
|
|
|
limbC->sibling = limb->siblingIndex;
|
|
|
|
|
limbC->dList = nullptr;
|
|
|
|
|
|
|
|
|
|
if (!limb->dListPtr.empty()) {
|
2022-04-06 17:42:23 -07:00
|
|
|
|
const auto dList = ResourceMgr_LoadGfxByName(limb->dListPtr.c_str());
|
2022-03-22 02:51:23 +01:00
|
|
|
|
limbC->dList = dList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
baseHeader->segment[i] = limbC;
|
|
|
|
|
}
|
|
|
|
|
else if (limb->limbType == Ship::LimbType::Curve)
|
|
|
|
|
{
|
|
|
|
|
const auto limbC = new SkelCurveLimb;
|
|
|
|
|
|
|
|
|
|
limbC->firstChildIdx = limb->childIndex;
|
|
|
|
|
limbC->nextLimbIdx = limb->siblingIndex;
|
|
|
|
|
limbC->dList[0] = nullptr;
|
|
|
|
|
limbC->dList[1] = nullptr;
|
|
|
|
|
|
|
|
|
|
if (!limb->dListPtr.empty()) {
|
2022-04-06 17:42:23 -07:00
|
|
|
|
const auto dList = ResourceMgr_LoadGfxByName(limb->dListPtr.c_str());
|
2022-03-22 02:51:23 +01:00
|
|
|
|
limbC->dList[0] = dList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!limb->dList2Ptr.empty()) {
|
2022-04-06 17:42:23 -07:00
|
|
|
|
const auto dList = ResourceMgr_LoadGfxByName(limb->dList2Ptr.c_str());
|
2022-03-22 02:51:23 +01:00
|
|
|
|
limbC->dList[1] = dList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const auto curve = reinterpret_cast<SkelCurveLimbList*>(baseHeader);
|
|
|
|
|
curve->limbs[i] = limbC;
|
|
|
|
|
}
|
|
|
|
|
else if (limb->limbType == Ship::LimbType::Skin)
|
|
|
|
|
{
|
|
|
|
|
const auto limbC = new SkinLimb;
|
|
|
|
|
limbC->jointPos.x = limb->transX;
|
|
|
|
|
limbC->jointPos.y = limb->transY;
|
|
|
|
|
limbC->jointPos.z = limb->transZ;
|
|
|
|
|
limbC->child = limb->childIndex;
|
|
|
|
|
limbC->sibling = limb->siblingIndex;
|
|
|
|
|
|
|
|
|
|
if (limb->skinSegmentType == Ship::ZLimbSkinType::SkinType_DList)
|
|
|
|
|
limbC->segmentType = static_cast<int32_t>(limb->skinSegmentType);
|
|
|
|
|
else if (limb->skinSegmentType == Ship::ZLimbSkinType::SkinType_4)
|
|
|
|
|
limbC->segmentType = 4;
|
|
|
|
|
else if (limb->skinSegmentType == Ship::ZLimbSkinType::SkinType_5)
|
|
|
|
|
limbC->segmentType = 5;
|
|
|
|
|
else
|
|
|
|
|
limbC->segmentType = 0;
|
|
|
|
|
|
|
|
|
|
if (limb->skinSegmentType == Ship::ZLimbSkinType::SkinType_DList)
|
2022-04-06 17:42:23 -07:00
|
|
|
|
limbC->segment = ResourceMgr_LoadGfxByName(limb->skinDList.c_str());
|
2022-03-22 02:51:23 +01:00
|
|
|
|
else if (limb->skinSegmentType == Ship::ZLimbSkinType::SkinType_4) {
|
|
|
|
|
const auto animData = new SkinAnimatedLimbData;
|
|
|
|
|
const int skinDataSize = limb->skinData.size();
|
|
|
|
|
|
|
|
|
|
animData->totalVtxCount = limb->skinVtxCnt;
|
|
|
|
|
animData->limbModifCount = skinDataSize;
|
|
|
|
|
animData->limbModifications = new SkinLimbModif[animData->limbModifCount];
|
2022-04-06 17:42:23 -07:00
|
|
|
|
animData->dlist = ResourceMgr_LoadGfxByName(limb->skinDList2.c_str());
|
2022-03-22 02:51:23 +01:00
|
|
|
|
|
2022-06-19 02:03:04 -05:00
|
|
|
|
for (size_t i = 0; i < skinDataSize; i++)
|
2022-03-22 02:51:23 +01:00
|
|
|
|
{
|
|
|
|
|
animData->limbModifications[i].vtxCount = limb->skinData[i].unk_8_arr.size();
|
|
|
|
|
animData->limbModifications[i].transformCount = limb->skinData[i].unk_C_arr.size();
|
|
|
|
|
animData->limbModifications[i].unk_4 = limb->skinData[i].unk_4;
|
|
|
|
|
|
|
|
|
|
animData->limbModifications[i].skinVertices = new SkinVertex[limb->skinData[i].unk_8_arr.size()];
|
|
|
|
|
|
|
|
|
|
for (int k = 0; k < limb->skinData[i].unk_8_arr.size(); k++)
|
|
|
|
|
{
|
|
|
|
|
animData->limbModifications[i].skinVertices[k].index = limb->skinData[i].unk_8_arr[k].unk_0;
|
|
|
|
|
animData->limbModifications[i].skinVertices[k].s = limb->skinData[i].unk_8_arr[k].unk_2;
|
|
|
|
|
animData->limbModifications[i].skinVertices[k].t = limb->skinData[i].unk_8_arr[k].unk_4;
|
|
|
|
|
animData->limbModifications[i].skinVertices[k].normX = limb->skinData[i].unk_8_arr[k].unk_6;
|
|
|
|
|
animData->limbModifications[i].skinVertices[k].normY = limb->skinData[i].unk_8_arr[k].unk_7;
|
|
|
|
|
animData->limbModifications[i].skinVertices[k].normZ = limb->skinData[i].unk_8_arr[k].unk_8;
|
|
|
|
|
animData->limbModifications[i].skinVertices[k].alpha = limb->skinData[i].unk_8_arr[k].unk_9;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
animData->limbModifications[i].limbTransformations =
|
|
|
|
|
new SkinTransformation[limb->skinData[i].unk_C_arr.size()];
|
|
|
|
|
|
|
|
|
|
for (int k = 0; k < limb->skinData[i].unk_C_arr.size(); k++)
|
|
|
|
|
{
|
|
|
|
|
animData->limbModifications[i].limbTransformations[k].limbIndex = limb->skinData[i].unk_C_arr[k].unk_0;
|
|
|
|
|
animData->limbModifications[i].limbTransformations[k].x = limb->skinData[i].unk_C_arr[k].x;
|
|
|
|
|
animData->limbModifications[i].limbTransformations[k].y = limb->skinData[i].unk_C_arr[k].y;
|
|
|
|
|
animData->limbModifications[i].limbTransformations[k].z = limb->skinData[i].unk_C_arr[k].z;
|
|
|
|
|
animData->limbModifications[i].limbTransformations[k].scale = limb->skinData[i].unk_C_arr[k].unk_8;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
limbC->segment = animData;
|
|
|
|
|
|
|
|
|
|
//limbC->segment = nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*if (limb->dListPtr != "") {
|
|
|
|
|
auto dList = ResourceMgr_LoadGfxByName((char*)limb->dListPtr.c_str());
|
|
|
|
|
limbC->unk_8 = dList;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
limbC->unk_8 = nullptr;
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
baseHeader->segment[i] = limbC;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// OTRTODO: Print error here...
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
res->cachedGameAsset = baseHeader;
|
|
|
|
|
|
|
|
|
|
return baseHeader;
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-06 17:42:23 -07:00
|
|
|
|
extern "C" s32* ResourceMgr_LoadCSByName(const char* path)
|
2022-03-22 02:51:23 +01:00
|
|
|
|
{
|
|
|
|
|
auto res = std::static_pointer_cast<Ship::Cutscene>(OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path));
|
|
|
|
|
return (s32*)res->commands.data();
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-13 22:12:11 -05:00
|
|
|
|
std::filesystem::path GetSaveFile(std::shared_ptr<Mercury> Conf) {
|
|
|
|
|
const std::string fileName = Conf->getString("Game.SaveName", Ship::GlobalCtx2::GetPathRelativeToAppDirectory("oot_save.sav"));
|
2022-06-20 13:54:44 -04:00
|
|
|
|
std::filesystem::path saveFile = std::filesystem::absolute(fileName);
|
|
|
|
|
|
2022-07-13 22:12:11 -05:00
|
|
|
|
if (!exists(saveFile.parent_path())) {
|
|
|
|
|
create_directories(saveFile.parent_path());
|
2022-06-20 13:54:44 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return saveFile;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::filesystem::path GetSaveFile() {
|
2022-07-13 22:12:11 -05:00
|
|
|
|
const std::shared_ptr<Mercury> pConf = OTRGlobals::Instance->context->GetConfig();
|
2022-06-20 13:54:44 -04:00
|
|
|
|
|
2022-07-13 22:12:11 -05:00
|
|
|
|
return GetSaveFile(pConf);
|
2022-06-20 13:54:44 -04:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-13 22:12:11 -05:00
|
|
|
|
void OTRGlobals::CheckSaveFile(size_t sramSize) const {
|
|
|
|
|
const std::shared_ptr<Mercury> pConf = Instance->context->GetConfig();
|
2022-06-20 13:54:44 -04:00
|
|
|
|
|
2022-07-13 22:12:11 -05:00
|
|
|
|
std::filesystem::path savePath = GetSaveFile(pConf);
|
2022-06-20 13:54:44 -04:00
|
|
|
|
std::fstream saveFile(savePath, std::fstream::in | std::fstream::out | std::fstream::binary);
|
|
|
|
|
if (saveFile.fail()) {
|
|
|
|
|
saveFile.open(savePath, std::fstream::in | std::fstream::out | std::fstream::binary | std::fstream::app);
|
|
|
|
|
for (int i = 0; i < sramSize; ++i) {
|
|
|
|
|
saveFile.write("\0", 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
saveFile.close();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" void Ctx_ReadSaveFile(uintptr_t addr, void* dramAddr, size_t size) {
|
|
|
|
|
OTRGlobals::Instance->context->ReadSaveFile(GetSaveFile(), addr, dramAddr, size);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" void Ctx_WriteSaveFile(uintptr_t addr, void* dramAddr, size_t size) {
|
|
|
|
|
OTRGlobals::Instance->context->WriteSaveFile(GetSaveFile(), addr, dramAddr, size);
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-22 02:51:23 +01:00
|
|
|
|
std::wstring StringToU16(const std::string& s) {
|
|
|
|
|
std::vector<unsigned long> result;
|
|
|
|
|
size_t i = 0;
|
|
|
|
|
while (i < s.size()) {
|
|
|
|
|
unsigned long uni;
|
|
|
|
|
size_t nbytes;
|
|
|
|
|
bool error = false;
|
|
|
|
|
unsigned char c = s[i++];
|
|
|
|
|
if (c < 0x80) { // ascii
|
|
|
|
|
uni = c;
|
|
|
|
|
nbytes = 0;
|
|
|
|
|
} else if (c <= 0xBF) { // assuming kata/hiragana delimiter
|
|
|
|
|
nbytes = 0;
|
|
|
|
|
uni = '\1';
|
|
|
|
|
} else if (c <= 0xDF) {
|
|
|
|
|
uni = c & 0x1F;
|
|
|
|
|
nbytes = 1;
|
|
|
|
|
} else if (c <= 0xEF) {
|
|
|
|
|
uni = c & 0x0F;
|
|
|
|
|
nbytes = 2;
|
|
|
|
|
} else if (c <= 0xF7) {
|
|
|
|
|
uni = c & 0x07;
|
|
|
|
|
nbytes = 3;
|
|
|
|
|
}
|
|
|
|
|
for (size_t j = 0; j < nbytes; ++j) {
|
|
|
|
|
unsigned char c = s[i++];
|
|
|
|
|
uni <<= 6;
|
|
|
|
|
uni += c & 0x3F;
|
|
|
|
|
}
|
|
|
|
|
if (uni != '\1')
|
|
|
|
|
result.push_back(uni);
|
|
|
|
|
}
|
|
|
|
|
std::wstring utf16;
|
|
|
|
|
for (size_t i = 0; i < result.size(); ++i) {
|
|
|
|
|
unsigned long uni = result[i];
|
|
|
|
|
if (uni <= 0xFFFF) {
|
|
|
|
|
utf16 += (wchar_t)uni;
|
|
|
|
|
} else {
|
|
|
|
|
uni -= 0x10000;
|
|
|
|
|
utf16 += (wchar_t)((uni >> 10) + 0xD800);
|
|
|
|
|
utf16 += (wchar_t)((uni & 0x3FF) + 0xDC00);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return utf16;
|
|
|
|
|
}
|
|
|
|
|
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
int CopyStringToCharBuffer(const std::string& inputStr, char* buffer, const int maxBufferSize) {
|
|
|
|
|
if (!inputStr.empty()) {
|
|
|
|
|
// Prevent potential horrible overflow due to implicit conversion of maxBufferSize to an unsigned. Prevents negatives.
|
|
|
|
|
memset(buffer, 0, std::max<int>(0, maxBufferSize));
|
|
|
|
|
// Gaurentee that this value will be greater than 0, regardless of passed variables.
|
|
|
|
|
const int copiedCharLen = std::min<int>(std::max<int>(0, maxBufferSize - 1), inputStr.length());
|
|
|
|
|
memcpy(buffer, inputStr.c_str(), copiedCharLen);
|
|
|
|
|
return copiedCharLen;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-22 02:51:23 +01:00
|
|
|
|
extern "C" void OTRGfxPrint(const char* str, void* printer, void (*printImpl)(void*, char)) {
|
|
|
|
|
const std::vector<uint32_t> hira1 = {
|
|
|
|
|
u'を', u'ぁ', u'ぃ', u'ぅ', u'ぇ', u'ぉ', u'ゃ', u'ゅ', u'ょ', u'っ', u'-', u'あ', u'い',
|
|
|
|
|
u'う', u'え', u'お', u'か', u'き', u'く', u'け', u'こ', u'さ', u'し', u'す', u'せ', u'そ',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const std::vector<uint32_t> hira2 = {
|
|
|
|
|
u'た', u'ち', u'つ', u'て', u'と', u'な', u'に', u'ぬ', u'ね', u'の', u'は', u'ひ', u'ふ', u'へ', u'ほ', u'ま',
|
|
|
|
|
u'み', u'む', u'め', u'も', u'や', u'ゆ', u'よ', u'ら', u'り', u'る', u'れ', u'ろ', u'わ', u'ん', u'゛', u'゜',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
std::wstring wstr = StringToU16(str);
|
|
|
|
|
|
|
|
|
|
for (const auto& c : wstr) {
|
|
|
|
|
unsigned char convt = ' ';
|
|
|
|
|
if (c < 0x80) {
|
|
|
|
|
printImpl(printer, c);
|
|
|
|
|
} else if (c >= u'。' && c <= u'゚') { // katakana
|
|
|
|
|
printImpl(printer, c - 0xFEC0);
|
|
|
|
|
} else {
|
|
|
|
|
auto it = std::find(hira1.begin(), hira1.end(), c);
|
|
|
|
|
if (it != hira1.end()) { // hiragana block 1
|
|
|
|
|
printImpl(printer, 0x88 + std::distance(hira1.begin(), it));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
auto it2 = std::find(hira2.begin(), hira2.end(), c);
|
|
|
|
|
if (it2 != hira2.end()) { // hiragana block 2
|
|
|
|
|
printImpl(printer, 0xe0 + std::distance(hira2.begin(), it2));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" uint32_t OTRGetCurrentWidth() {
|
|
|
|
|
return OTRGlobals::Instance->context->GetWindow()->GetCurrentWidth();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" uint32_t OTRGetCurrentHeight() {
|
|
|
|
|
return OTRGlobals::Instance->context->GetWindow()->GetCurrentHeight();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" void OTRControllerCallback(ControllerCallback* controller) {
|
2022-07-13 22:12:11 -05:00
|
|
|
|
const auto controllers = Ship::Window::ControllerApi->virtualDevices;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < controllers.size(); ++i) {
|
|
|
|
|
Ship::Window::ControllerApi->physicalDevices[controllers[i]]->WriteToSource(i, controller);
|
2022-03-22 02:51:23 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" float OTRGetAspectRatio() {
|
|
|
|
|
return gfx_current_dimensions.aspect_ratio;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" float OTRGetDimensionFromLeftEdge(float v) {
|
|
|
|
|
return (SCREEN_WIDTH / 2 - SCREEN_HEIGHT / 2 * OTRGetAspectRatio() + (v));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" float OTRGetDimensionFromRightEdge(float v) {
|
|
|
|
|
return (SCREEN_WIDTH / 2 + SCREEN_HEIGHT / 2 * OTRGetAspectRatio() - (SCREEN_WIDTH - v));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
f32 floorf(f32 x);
|
|
|
|
|
f32 ceilf(f32 x);
|
|
|
|
|
|
|
|
|
|
extern "C" int16_t OTRGetRectDimensionFromLeftEdge(float v) {
|
|
|
|
|
return ((int)floorf(OTRGetDimensionFromLeftEdge(v)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" int16_t OTRGetRectDimensionFromRightEdge(float v) {
|
|
|
|
|
return ((int)ceilf(OTRGetDimensionFromRightEdge(v)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" bool AudioPlayer_Init(void) {
|
|
|
|
|
if (OTRGlobals::Instance->context->GetWindow()->GetAudioPlayer() != nullptr) {
|
|
|
|
|
return OTRGlobals::Instance->context->GetWindow()->GetAudioPlayer()->Init();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" int AudioPlayer_Buffered(void) {
|
|
|
|
|
if (OTRGlobals::Instance->context->GetWindow()->GetAudioPlayer() != nullptr) {
|
|
|
|
|
return OTRGlobals::Instance->context->GetWindow()->GetAudioPlayer()->Buffered();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" int AudioPlayer_GetDesiredBuffered(void) {
|
|
|
|
|
if (OTRGlobals::Instance->context->GetWindow()->GetAudioPlayer() != nullptr) {
|
|
|
|
|
return OTRGlobals::Instance->context->GetWindow()->GetAudioPlayer()->GetDesiredBuffered();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" void AudioPlayer_Play(const uint8_t* buf, uint32_t len) {
|
|
|
|
|
if (OTRGlobals::Instance->context->GetWindow()->GetAudioPlayer() != nullptr) {
|
|
|
|
|
OTRGlobals::Instance->context->GetWindow()->GetAudioPlayer()->Play(buf, len);
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-04-26 16:50:24 -07:00
|
|
|
|
|
|
|
|
|
extern "C" int Controller_ShouldRumble(size_t i) {
|
2022-04-29 11:49:28 -04:00
|
|
|
|
|
2022-07-13 22:12:11 -05:00
|
|
|
|
const auto controllers = Ship::Window::ControllerApi->virtualDevices;
|
|
|
|
|
|
|
|
|
|
for (const auto virtual_entry : controllers) {
|
|
|
|
|
if (Ship::Window::ControllerApi->physicalDevices[virtual_entry]->CanRumble()) {
|
2022-04-26 16:50:24 -07:00
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2022-07-06 15:46:01 -07:00
|
|
|
|
|
|
|
|
|
extern "C" void* getN64WeirdFrame(s32 i) {
|
|
|
|
|
char* weirdFrameBytes = reinterpret_cast<char*>(n64WeirdFrames);
|
|
|
|
|
return &weirdFrameBytes[i + sizeof(n64WeirdFrames)];
|
|
|
|
|
}
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
|
2022-07-18 19:20:07 -04:00
|
|
|
|
extern "C" s16 Randomizer_GetItemModelFromId(s16 itemId) {
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
return OTRGlobals::Instance->gRandomizer->GetItemModelFromId(itemId);
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-18 19:20:07 -04:00
|
|
|
|
extern "C" s32 Randomizer_GetItemIDFromGetItemID(s32 getItemId) {
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
return OTRGlobals::Instance->gRandomizer->GetItemIDFromGetItemID(getItemId);
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-18 19:20:07 -04:00
|
|
|
|
extern "C" void Randomizer_LoadSettings(const char* spoilerFileName) {
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
OTRGlobals::Instance->gRandomizer->LoadRandomizerSettings(spoilerFileName);
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-18 19:20:07 -04:00
|
|
|
|
extern "C" void Randomizer_LoadHintLocations(const char* spoilerFileName) {
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
OTRGlobals::Instance->gRandomizer->LoadHintLocations(spoilerFileName);
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-18 19:20:07 -04:00
|
|
|
|
extern "C" void Randomizer_LoadItemLocations(const char* spoilerFileName, bool silent) {
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
OTRGlobals::Instance->gRandomizer->LoadItemLocations(spoilerFileName, silent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" bool SpoilerFileExists(const char* spoilerFileName) {
|
|
|
|
|
return OTRGlobals::Instance->gRandomizer->SpoilerFileExists(spoilerFileName);
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-18 19:20:07 -04:00
|
|
|
|
extern "C" u8 Randomizer_GetSettingValue(RandomizerSettingKey randoSettingKey) {
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
return OTRGlobals::Instance->gRandomizer->GetRandoSettingValue(randoSettingKey);
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-18 19:20:07 -04:00
|
|
|
|
extern "C" RandomizerCheck Randomizer_GetCheckFromActor(s16 sceneNum, s16 actorId, s16 actorParams) {
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
return OTRGlobals::Instance->gRandomizer->GetCheckFromActor(sceneNum, actorId, actorParams);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
extern "C" int CopyScrubMessage(u16 scrubTextId, char* buffer, const int maxBufferSize) {
|
|
|
|
|
std::string scrubText("");
|
|
|
|
|
int language = CVar_GetS32("gLanguages", 0);
|
|
|
|
|
int price = 0;
|
|
|
|
|
switch (scrubTextId) {
|
|
|
|
|
case 0x10A2:
|
|
|
|
|
price = 10;
|
|
|
|
|
break;
|
|
|
|
|
case 0x10DC:
|
|
|
|
|
case 0x10DD:
|
|
|
|
|
price = 40;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
switch (language) {
|
|
|
|
|
case 0: default:
|
|
|
|
|
scrubText += 0x12; // add the sound
|
|
|
|
|
scrubText += 0x38; // sound id
|
|
|
|
|
scrubText += 0x82; // sound id
|
|
|
|
|
scrubText += "All right! You win! In return for";
|
|
|
|
|
scrubText += 0x01; // newline
|
|
|
|
|
scrubText += "sparing me, I will sell you a";
|
|
|
|
|
scrubText += 0x01; // newline
|
|
|
|
|
scrubText += 0x05; // change the color
|
|
|
|
|
scrubText += 0x42; // green
|
|
|
|
|
scrubText += "mysterious item";
|
|
|
|
|
scrubText += 0x05; // change the color
|
|
|
|
|
scrubText += 0x40; // white
|
|
|
|
|
scrubText += "!";
|
|
|
|
|
scrubText += 0x01; // newline
|
|
|
|
|
scrubText += 0x05; // change the color
|
|
|
|
|
scrubText += 0x41; // red
|
|
|
|
|
scrubText += std::to_string(price);
|
|
|
|
|
scrubText += price > 1 ? " Rupees" : " Rupee";
|
|
|
|
|
scrubText += 0x05; // change the color
|
|
|
|
|
scrubText += 0x40; // white
|
|
|
|
|
scrubText += " it is!";
|
|
|
|
|
scrubText += 0x07; // go to a new message
|
|
|
|
|
scrubText += 0x10; // message id
|
|
|
|
|
scrubText += 0xA3; // message id
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
scrubText += 0x12; // add the sound
|
|
|
|
|
scrubText += 0x38; // sound id
|
|
|
|
|
scrubText += 0x82; // sound id
|
|
|
|
|
scrubText += "J'abandonne! Tu veux bien m'acheter";
|
|
|
|
|
scrubText += 0x01; // newline
|
|
|
|
|
scrubText += "un ";
|
|
|
|
|
scrubText += 0x05; // change the color
|
|
|
|
|
scrubText += 0x42; // green
|
|
|
|
|
scrubText += "objet myst\x96rieux";
|
|
|
|
|
//scrubText += ";
|
|
|
|
|
scrubText += 0x05; // change the color
|
|
|
|
|
scrubText += 0x40; // white
|
|
|
|
|
scrubText += "?";
|
|
|
|
|
scrubText += 0x01; // newline
|
|
|
|
|
scrubText += "\x84";
|
|
|
|
|
scrubText += "a fera ";
|
|
|
|
|
scrubText += 0x05; // change the color
|
|
|
|
|
scrubText += 0x41; // red
|
|
|
|
|
scrubText += std::to_string(price) + " Rubis";
|
|
|
|
|
scrubText += 0x05; // change the color
|
|
|
|
|
scrubText += 0x40; // white
|
|
|
|
|
scrubText += "!";
|
|
|
|
|
scrubText += 0x07; // go to a new message
|
|
|
|
|
scrubText += 0x10; // message id
|
|
|
|
|
scrubText += 0xA3; // message id
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return CopyStringToCharBuffer(scrubText, buffer, maxBufferSize);
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-18 19:20:07 -04:00
|
|
|
|
extern "C" int Randomizer_CopyAltarMessage(char* buffer, const int maxBufferSize) {
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
const std::string& altarText = (LINK_IS_ADULT) ? OTRGlobals::Instance->gRandomizer->GetAdultAltarText()
|
|
|
|
|
: OTRGlobals::Instance->gRandomizer->GetChildAltarText();
|
|
|
|
|
return CopyStringToCharBuffer(altarText, buffer, maxBufferSize);
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-18 19:20:07 -04:00
|
|
|
|
extern "C" int Randomizer_CopyGanonText(char* buffer, const int maxBufferSize) {
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
const std::string& ganonText = OTRGlobals::Instance->gRandomizer->GetGanonText();
|
|
|
|
|
return CopyStringToCharBuffer(ganonText, buffer, maxBufferSize);
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-18 19:20:07 -04:00
|
|
|
|
extern "C" int Randomizer_CopyGanonHintText(char* buffer, const int maxBufferSize) {
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
const std::string& ganonText = OTRGlobals::Instance->gRandomizer->GetGanonHintText();
|
|
|
|
|
return CopyStringToCharBuffer(ganonText, buffer, maxBufferSize);
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-18 19:20:07 -04:00
|
|
|
|
extern "C" int Randomizer_CopyHintFromCheck(RandomizerCheck check, char* buffer, const int maxBufferSize) {
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
// we don't want to make a copy of the std::string returned from GetHintFromCheck
|
|
|
|
|
// so we're just going to let RVO take care of it
|
|
|
|
|
const std::string& hintText = OTRGlobals::Instance->gRandomizer->GetHintFromCheck(check);
|
|
|
|
|
return CopyStringToCharBuffer(hintText, buffer, maxBufferSize);
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-18 19:20:07 -04:00
|
|
|
|
extern "C" s32 Randomizer_GetRandomizedItemId(GetItemID ogId, s16 actorId, s16 actorParams, s16 sceneNum) {
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
return OTRGlobals::Instance->gRandomizer->GetRandomizedItemId(ogId, actorId, actorParams, sceneNum);
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-18 19:20:07 -04:00
|
|
|
|
extern "C" s32 Randomizer_GetItemIdFromKnownCheck(RandomizerCheck randomizerCheck, GetItemID ogId) {
|
testing out item replacement (#416)
* skip learning song of storms
* don't set flag when getting goron tunic as child
* Initiates prelude check when master sword unloads.
Not quite how N64 rando does it but so far it's the only way I've found to make it trigger without also triggering the time travel again.
* Stops Shadow Temple lore prompts from appearing in rando.
* Skips cutscene of royal tomb explosion in rando.
Explosion sound doesn't play correctly and I think the debris appears in the wrong place, but the functionality is here.
* Improves visual of exploding gravestone.
* Adds some comments explaining the rando differences
* Skip ruto text box in jabu blue warp
For rando
* skip intro cutscene in dodongo's cavern
* load spoiler files on boot, fix spoilerfile existing check when making new saves
* name entry dropped spoiler logic
* make sure to actually init the cvar
* no chime on load
* uncomment
* Skip ganondrof cutscene
Skip to scream part of the death animation, skipping the text boxes etc. For rando
* Update z_boss_ganondrof.c
* skip owl flight cutscenes in rando
* Fixes skipped text so it only applies to shadow temple.
Earlier fix inadvertently applied to some other text as well, changed logic so that only specified sceneNums and textIds can have this enabled, and text skipped by sceneNum can have the skip overriden by textId if needed. Currently there are no overrides so the textId section of the logic is commented out to avoid compilation errors.
* Adds a default to the switch case statements that leaves the randoSkipText variable unchanged, just in case.
* TEST: Text for item
* Adding ganon flavor text
* ADD: AMMO Count
* format ganon text/hint text
* Autoskip the tower cutscene if settings call for tower collapse.
* ganon hint text logic
* Improved prelude after time travel fix
* swapped the sizes between ganon hint text and ganon text, as they were set to the wrong things.
* this is all i did
* not the cleanest code ever but it's working
* ADD: GS Count
* ADD: Wallter (crash for now)
* TWEAK: Wallet check
* FIX: Use DrawItem instread of DrawUpgrade... b-baka!
* Fixes some vanilla bugs introduced by rando code.
* Added cutscene skip for zelda escaping
Using the debug cutscene skipping function. Also added a conditional so the bridge doesn't spawn closed when cutscene is ready to trigger
* ADD: X Spacing + Placeholders for song
* ADD: default case for items
* TWEAK: Spacing
* FIX: Light Arrow
* ADD: Ammo Option
* use groups instead
* ADD: More spacing logic
* songs and names
* TWEAK: Color on wallet
* colors
* Added flags cutscene before nabooru fight
* ADD: ChromaKey text
* First attempt skip cs after nabooru defeat
* Better implementation for specific rando cutscene skips
* use pulseaudio defaults
* spaces/tabs
* move color push/pop to stop crash
* make the colors work again
* the real bottle fix
* pulseaudio values tuned for n64 audio at 44.1khz
* update tlength
* remove one hardcoded samplerate
* Cleaned up and fixed zelda escape skip
The if statement is a freaking monster, but unless we want to skip more cutscenes in the same way later, this is the most compact way of doing it that I know of.
* Revert one line to match original
nothing functional
* another hint line that breaks autonewline logic
* don't autospawn epona if we don't have the song/ocarina
* Trying to use iron knuckle death effects
not working yet
* Streamlined OoT cutscene skip for future additions
Also cleaned up if statement in general
* Made if statement more readable
Also added clarity for what cutscene was skipped
* Fixed typo in comment
* Janky nabooru defeat cs skip
* altar text formatting (gonna need help shortening some of the french ones)
* more altar text formatting
* english altar text formatting complete
* make gtg blocking guard check for card not bridge
* FIX: Typo!
* FIX: Uppercases
* FIX: Typo
* TWEAK: Alter + some names
* TWEAK: More caps!
* ADD: Missing string
TWEAK more uppercases and namefixe
s
* Hide nabooru death by covering her in flames
* bandaid fix for death crash issue
* Twinrova defeat cs skip
Skips the animation and manually calls the function to show the "beam" around the sisters
* fix crash
* fix caps to match
* fix great fairy reward mashing/shielding issue
* TWEAK : Typo clé to Clé
* TWEAK: Some Altar hints
TWEAK: Some capitals
* TWEAK: Unmatching text + some cap again
* TWEAK: More tweaks
* fix build
* remove extra json.hpp, add hint
* Update randomizer_item_tracker.cpp
* TWEAK: Double Defense with RedParticles instead of white
* make sure we don't optimize out the check to ensure a spoilerfile exists
* vanilla ganon boss key hint formatting
* TWEAK: FR- better way of the hero text
* fix
* and again
* Initializes dungeonsDone items in gSaveContext to 0.
* Replaces sizeof calculation with a NUM_DUNGEONS constant.
* Fixes Saria's Gift on the LW Bridge from getting killed when holding shield.
* More airtight fix for Saria's Gift on the Bridge.
* Lifts one of the conditions in the if statement a little higher to prevent unnecessary lookups of getItemId.
* Invalidate text box icon before drawing
* Fixes the case where Saria's gift is an Ice Trap.
We still get the Ice Trap once, but never again. This does mean you can now hold R while walking in to avoid the ice trap, but everything else seems to work fine.
* Initial commit
Might need changing when we change the settings in the future
* Fixes Door of Time opening cutscene after warping with prelude.
* Initial waterfall skip
Very rudimentary way of doing things but it seems to work so :shrug:
* inital rework
* fixed default rotation for 2D sprites
* fix tab/space issues
* 3d drops rando merge fix again
* Allows Impa to appear in the Lullaby check post drawbridge escape.
* Changes Ganon's Trials Count setting to a checkbox
The checkbox is whether or not to skip all of them. Leaving the box unchecked will mean doing all of them. Eventually this will be switched back to a slider once we implement the logic for which trials start out completed.
* Sets all Ganon's Trials to incomplete in new saves.
Fixes https://github.com/briaguya-ai/rando-issue-tracker/issues/131
* fix castle guards when oot throw cutscene has already played in rando
* Properly removes the beams when trials are cleared.
* Removes Question Mark from Skip Ganon's Trials UI.
* Adds a todo comment about when to change back to slider.
* make deku seeds check for bullet bag
* Various tweaks
TWEAK: Altar Text
TWEAK: Hint names
TWEAK: Replace more problematic œ to oe
* upgrade ocarina on both child and adult equips
* FIX: Jabu Item
* update equipped hookshot/longshot when obtained as other age
* add hint
* don't give the bgs check without the claim check
* Skips Darunia Cutscene in Fire Temple
* Added a TODO note about not skipping the cutscene.
There is a setting we will want to have eventually that will require this cutscene to not be skipped since it is used during a glitch.
* remove todo
* restore fast ocarina option in imgui that was lost in merge
* Fixes grey screen issue + tooltip for 2 handed shield
* update to use dg instead of g for textures in item tracker
* TWEAK: Default color for cosmetic RAND button was not the corect one
* fix texture crash, remove unused item tracker code
* don't open mask shop until we get zelda's letter
* Update README.md
* Prevents "correct" chime under incorrect conditions.
* Fixes typo in conditional and adds "bonk" sound effect.
"Bonk" sound is NA_SE_SY_OCARINA_ERROR and it plays when conditions for the Door of Time have not been met after playing Song of Time. This is only possible in rando's "Intended" Door of Time option, in which the Ocarina of Time and all 3 spritual stones are required to open the door, instead of the vanilla requirements of just having the song of time.
* remove modify dpad equips toggle, replace with checks for dpad menu
* remove extra check
* add ability to hold c-up to assign to dpad when dpad menuing is enabled
* disable d-pad navigation on item menu when holding c-up to equip
* dpad+c-up stuff for equipment menu
* ADD: Checbox for songs colors
* TWEAK: RandoColors for normal songs
* kind of quick and dirty but it works
* TWEAK: Clarity of the tooltip
Co-authored-by: briaguya <briaguya@alice>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
Co-authored-by: aMannus <mannusmenting@gmail.com>
Co-authored-by: PurpleHato <linkvssangoku.jr@gmail.com>
Co-authored-by: Dog <5172592+Dog@users.noreply.github.com>
Co-authored-by: Vague Rant <vaguerant@users.noreply.github.com>
Co-authored-by: Baoulettes <perlouzerie@hotmail.fr>
Co-authored-by: Ada <60364512+GreatArgorath@users.noreply.github.com>
2022-07-11 20:11:07 -04:00
|
|
|
|
return OTRGlobals::Instance->gRandomizer->GetRandomizedItemIdFromKnownCheck(randomizerCheck, ogId);
|
|
|
|
|
}
|