mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-13 01:57:18 -07:00
spockalicious (#2751)
* Rough mockup of LUS XML loading * Updated code for merge * Loading from FS support and custom DList WIP implementation * Added current directory support to F3D and impl most of the dlist cmds * WIP Skeleton support * Almost done * Rebase fixes * Submodule updates * HD Texture Support * Fixes * bump lus * fix exporter build, header update * soh builds * setMesh image path cleanup * Update soh/src/overlays/actors/ovl_player_actor/z_player.c * Update soh/src/overlays/actors/ovl_player_actor/z_player.c * Update OTRExporter/OTRExporter/Main.cpp * Update ZAPDTR/ZAPD/ZResource.h * Update soh/src/code/z_skelanime.c * Update OTRExporter/OTRExporter/Main.cpp * Fixed jpeg backgrounds and decreased icon buffer size * Bump lus * Increased even more the buffer because it crashes on long texts * Removed print because sometimes the if is not triggered when the image is already byteswapped * fix non-windows build * fix build Co-authored-by: Kenix <kenixwhisperwind@gmail.com> * add hd checkbox * Various fixes for custom model support (#23) * Some fixes * Updated LUS Version * Fixed issue with Link Skirt on pause menu * Added CVar for custom link model changes * Fixed headers * Additional header fixes * Tweaks * Unload HD game assets on scene transition. (#16) * Unload game assets on scene transition. * Bump LUS * Unloads all HD assets on scene transition. * Only unload hd assets if hd assets are turned on. * Fixes issues on toggling between HD and non HD assets. --------- Co-authored-by: briaguya <briaguya@alice> * fix: actually load hd debug font (#27) * fix: actually load hd debug font * toggle debug text correctly --------- Co-authored-by: briaguya <briaguya> * Yes. (#28) * Merge branch 'develop' into dev-to-ghost * HD Skeleton Swapping and Language Fixes (#32) * Yes. * HD Skeleton Swapping and Language Fixes * Test * Fixed issues with ganon cape (#34) * Fixed Bongo Bongo Crash (#35) * Added HD Assets Toggle (#37) * Ivan the Fairy - Coop Mode (#36) * wip * hookshotable ivan * added hookshot item * new items & changes & fixes & restored navi * farore, din and nayru's spells are done * fixed slingshot & bow * added more items supported * done with all main items * bug fixes & ready * added imgui button * wip * hookshotable ivan * added hookshot item * new items & changes & fixes & restored navi * farore, din and nayru's spells are done * fixed slingshot & bow * added more items supported * fix own dungeon items on shuffled boss rooms (#2683) * bump lus (#2692) * fix: lowercase package names for vcpkg (#2693) vcpkg was throwing an error `error: invalid character in package name (must be lowercase, digits, '-')` this updates our calls to `vcpkg_install_packages` to use lowercase package names instead of uppercase * fix death mountain cloud in rando (#2691) * Fix: Switch Age No Longer Reloads Start Room (#2679) * [Reduced Clutter] Disable Hot/Underwater Warning Text (#2684) * Disable Warning Text * Moved to Reduced Clutter * done with all main items * bug fixes & ready * fix: process roms in consistent order (#2696) * chore: move rando savefile setup and document flags (#2697) * remove rando save init from sram * move rando savefile init logic and set more flags * document flags for rando save creation * Fix: Use correct fps value for frame interpolation with match refresh rate (#2694) * Fix: Kak GS placement on construction site (#2695) * added imgui button * addressed kenix's comments * fixed useless null * added rupee dash mode in extra modes * changed menu position --------- Co-authored-by: Adam Bird <Archez@users.noreply.github.com> Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com> Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> * LUS Scancodes (#42) * Added HD Assets Toggle * Switched out SDL for LUS scancodes * Ivan tweaks (#45) * Magic consumption slowed down; Bosses now affected by Ivan's Din spell * Adjust magic timer * clean up imgui * model fixes/improvements (#50) * replace `gUseCustomLinkModel` with custom resource check * handle adult/child * bump lus * fix model switching with tab * use lus main * fix carpet man (#52) Co-authored-by: Rozelette <Rozelette@users.noreply.github.com> * get ship model and lus texture into soh.otr, use `gAuthenticLogo` to toggle between ship and authentic (#55) * Use libultra features for CPU-modified textures (#40) * Use libultra features for CPU-modified textures * Comment * bump lus on ghost (#58) * fix: properly use `Interface_LoadActionLabel` to display start button text (#61) * Changes hd -> alt for texture replacement. (#65) * Changes hd -> alt for texture replacement. * Renames variables in gfxprint for hd -> alt change. * Update soh/soh/resource/type/Skeleton.cpp --------- Co-authored-by: briaguya <70942617+briaguya-ai@users.noreply.github.com> * Fixes kaleido dungeon maps (#67) * skeleton stuff (#69) * comment out wii u build (#70) * bump lus (#71) * Rework readme (#72) * Update README.md * docs * put custom music docs somewhere * Update README.md * Update README.md * Update README.md * Update README.md * dark/light title image * lus * Update README.md * Fixed vanilla minimap (#73) * Fixed vanilla minimap * Workaround for pulsing SD maps with non-broken HD maps. --------- Co-authored-by: Christopher Leggett <chris@leggett.dev> * Skeleton fix fixed (#75) * WIP skelton patcher fix * Fixes skeleton reference change. * Adds const back to name in ResourceMgr_LoadSkeletonByName --------- Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Kenix <kenixwhisperwind@gmail.com> * Fixes z_message_otr memory leak. * Update soh/soh/z_message_OTR.cpp * Update soh/src/code/game.c * docs: add how to find otr files to switch instructions (#78) * bump lus (#79) * comment out RegisterBlendedTexture in king d (#80) --------- Co-authored-by: Nicholas Estelami <NEstelami@users.noreply.github.com> Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: briaguya <briaguya@alice> Co-authored-by: Kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: KiritoDv <kiritodev01@gmail.com> Co-authored-by: briaguya <briaguya> Co-authored-by: Ralphie Morell <stratomaster64@gmail.com> Co-authored-by: MelonSpeedruns <melonspeedruns@outlook.com> Co-authored-by: Adam Bird <Archez@users.noreply.github.com> Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com> Co-authored-by: Patrick12115 <115201185+Patrick12115@users.noreply.github.com> Co-authored-by: Rozelette <Rozelette@users.noreply.github.com> Co-authored-by: Christopher Leggett <chris@leggett.dev> Co-authored-by: Lywx <36680385+KiritoDv@users.noreply.github.com>
This commit is contained in:
parent
2af99dfc3a
commit
4166dbf907
107 changed files with 4130 additions and 1174 deletions
|
@ -16,30 +16,9 @@
|
|||
#include "soh/Enhancements/game-interactor/GameInteractor.h"
|
||||
|
||||
|
||||
static uint16_t _doActionTexWidth, _doActionTexHeight = -1;
|
||||
static uint16_t DO_ACTION_TEX_WIDTH() {
|
||||
return 48;
|
||||
|
||||
// TODO: Figure out why Ship::Texture is not returning a valid width
|
||||
if (_doActionTexWidth == -1)
|
||||
_doActionTexWidth = GetResourceTexWidthByName(gCheckDoActionENGTex, false);
|
||||
return _doActionTexWidth;
|
||||
}
|
||||
static uint16_t DO_ACTION_TEX_HEIGHT() {
|
||||
return 16;
|
||||
|
||||
// TODO: Figure out why Ship::Texture is not returning a valid height
|
||||
if (_doActionTexHeight == -1)
|
||||
_doActionTexHeight = GetResourceTexHeightByName(gCheckDoActionENGTex, false);
|
||||
return _doActionTexHeight;
|
||||
}
|
||||
|
||||
static uint32_t _doActionTexSize = -1;
|
||||
static uint32_t DO_ACTION_TEX_SIZE() {
|
||||
if (_doActionTexSize == -1)
|
||||
_doActionTexSize = GetResourceTexSizeByName(gCheckDoActionENGTex, false);
|
||||
return _doActionTexSize;
|
||||
}
|
||||
#define DO_ACTION_TEX_WIDTH() 48
|
||||
#define DO_ACTION_TEX_HEIGHT() 16
|
||||
#define DO_ACTION_TEX_SIZE() ((DO_ACTION_TEX_WIDTH() * DO_ACTION_TEX_HEIGHT()) / 2)
|
||||
|
||||
// The button statuses include the A button when most things are only the equip item buttons
|
||||
// So, when indexing into it with a item button index, we need to adjust
|
||||
|
@ -225,6 +204,8 @@ static const char* actionsTbl[] =
|
|||
gNum8DoActionENGTex,
|
||||
};
|
||||
|
||||
static const char gDoEmptyTexture[] = "__OTR__textures/virtual/gEmptyTexture";
|
||||
|
||||
// original name: "alpha_change"
|
||||
void Interface_ChangeAlpha(u16 alphaType) {
|
||||
if (alphaType != gSaveContext.unk_13EA) {
|
||||
|
@ -2848,11 +2829,7 @@ bool Inventory_HatchPocketCucco(PlayState* play) {
|
|||
}
|
||||
|
||||
void func_80086D5C(s32* buf, u16 size) {
|
||||
u16 i;
|
||||
|
||||
//buf = GetResourceDataByName(buf, false);
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
for (u16 i = 0; i < size; i++) {
|
||||
buf[i] = 0;
|
||||
}
|
||||
}
|
||||
|
@ -2865,46 +2842,25 @@ void Interface_LoadActionLabel(InterfaceContext* interfaceCtx, u16 action, s16 l
|
|||
|
||||
char* doAction = actionsTbl[action];
|
||||
|
||||
char newName[512];
|
||||
static char newName[4][512];
|
||||
if (gSaveContext.language != LANGUAGE_ENG) {
|
||||
size_t length = strlen(doAction);
|
||||
strcpy(newName, doAction);
|
||||
strcpy(newName[loadOffset], doAction);
|
||||
if (gSaveContext.language == LANGUAGE_FRA) {
|
||||
newName[length - 6] = 'F';
|
||||
newName[length - 5] = 'R';
|
||||
newName[length - 4] = 'A';
|
||||
newName[loadOffset][length - 6] = 'F';
|
||||
newName[loadOffset][length - 5] = 'R';
|
||||
newName[loadOffset][length - 4] = 'A';
|
||||
} else if (gSaveContext.language == LANGUAGE_GER) {
|
||||
newName[length - 6] = 'G';
|
||||
newName[length - 5] = 'E';
|
||||
newName[length - 4] = 'R';
|
||||
newName[loadOffset][length - 6] = 'G';
|
||||
newName[loadOffset][length - 5] = 'E';
|
||||
newName[loadOffset][length - 4] = 'R';
|
||||
}
|
||||
doAction = newName;
|
||||
}
|
||||
|
||||
/*
|
||||
if (gSaveContext.language != LANGUAGE_ENG) {
|
||||
action += DO_ACTION_MAX;
|
||||
}
|
||||
|
||||
if (gSaveContext.language == LANGUAGE_FRA) {
|
||||
action += DO_ACTION_MAX;
|
||||
}*/
|
||||
|
||||
|
||||
if (action != DO_ACTION_NONE) {
|
||||
//osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
|
||||
memcpy(interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE()), GetResourceDataByName(doAction, false),
|
||||
DO_ACTION_TEX_SIZE());
|
||||
//DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160,
|
||||
//interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE),
|
||||
//(uintptr_t)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), DO_ACTION_TEX_SIZE,
|
||||
//0, &interfaceCtx->loadQueue, NULL, __FILE__, __LINE__);
|
||||
//osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
|
||||
} else {
|
||||
gSegments[7] = VIRTUAL_TO_PHYSICAL(interfaceCtx->doActionSegment);
|
||||
//func_80086D5C(SEGMENTED_TO_VIRTUAL(sDoActionTextures[loadOffset]), DO_ACTION_TEX_SIZE / 4);
|
||||
func_80086D5C(interfaceCtx->doActionSegment + (loadOffset * DO_ACTION_TEX_SIZE()), DO_ACTION_TEX_SIZE() / 4);
|
||||
doAction = newName[loadOffset];
|
||||
}
|
||||
|
||||
char* segment = interfaceCtx->doActionSegment[loadOffset];
|
||||
interfaceCtx->doActionSegment[loadOffset] = action != DO_ACTION_NONE ? doAction : gDoEmptyTexture;
|
||||
gSegments[7] = interfaceCtx->doActionSegment[loadOffset];
|
||||
}
|
||||
|
||||
void Interface_SetDoAction(PlayState* play, u16 action) {
|
||||
|
@ -2950,7 +2906,7 @@ void Interface_LoadActionLabelB(PlayState* play, u16 action) {
|
|||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
char* doAction = actionsTbl[action];
|
||||
char newName[512];
|
||||
static char newName[512];
|
||||
|
||||
if (gSaveContext.language != LANGUAGE_ENG) {
|
||||
size_t length = strlen(doAction);
|
||||
|
@ -2967,24 +2923,10 @@ void Interface_LoadActionLabelB(PlayState* play, u16 action) {
|
|||
doAction = newName;
|
||||
}
|
||||
|
||||
/*if (gSaveContext.language != LANGUAGE_ENG) {
|
||||
action += DO_ACTION_MAX;
|
||||
}
|
||||
|
||||
if (gSaveContext.language == LANGUAGE_FRA) {
|
||||
action += DO_ACTION_MAX;
|
||||
}*/
|
||||
|
||||
interfaceCtx->unk_1FC = action;
|
||||
|
||||
|
||||
|
||||
// OTRTODO
|
||||
osCreateMesgQueue(&interfaceCtx->loadQueue, &interfaceCtx->loadMsg, OS_MESG_BLOCK);
|
||||
memcpy(interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE(), GetResourceDataByName(doAction, false), DO_ACTION_TEX_SIZE());
|
||||
//DmaMgr_SendRequest2(&interfaceCtx->dmaRequest_160, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE,
|
||||
//(uintptr_t)_do_action_staticSegmentRomStart + (action * DO_ACTION_TEX_SIZE), DO_ACTION_TEX_SIZE, 0,
|
||||
//&interfaceCtx->loadQueue, NULL, __FILE__, __LINE__);
|
||||
|
||||
char* segment = interfaceCtx->doActionSegment[1];
|
||||
interfaceCtx->doActionSegment[1] = action != DO_ACTION_NONE ? doAction : gDoEmptyTexture;
|
||||
osRecvMesg(&interfaceCtx->loadQueue, NULL, OS_MESG_BLOCK);
|
||||
|
||||
interfaceCtx->unk_1FA = 1;
|
||||
|
@ -4040,28 +3982,8 @@ void Interface_DrawItemButtons(PlayState* play) {
|
|||
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
||||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||
|
||||
//There is probably a more elegant way to do it.
|
||||
char* doAction = actionsTbl[3];
|
||||
char newName[512];
|
||||
if (gSaveContext.language != LANGUAGE_ENG) {
|
||||
size_t length = strlen(doAction);
|
||||
strcpy(newName, doAction);
|
||||
if (gSaveContext.language == LANGUAGE_FRA) {
|
||||
newName[length - 6] = 'F';
|
||||
newName[length - 5] = 'R';
|
||||
newName[length - 4] = 'A';
|
||||
} else if (gSaveContext.language == LANGUAGE_GER) {
|
||||
newName[length - 6] = 'G';
|
||||
newName[length - 5] = 'E';
|
||||
newName[length - 4] = 'R';
|
||||
}
|
||||
doAction = newName;
|
||||
}
|
||||
|
||||
memcpy(interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE() * 2, GetResourceDataByName(doAction, false), DO_ACTION_TEX_SIZE());
|
||||
|
||||
gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE() * 2, G_IM_FMT_IA,
|
||||
Interface_LoadActionLabel(interfaceCtx, 3, 2);
|
||||
gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment[2], G_IM_FMT_IA,
|
||||
DO_ACTION_TEX_WIDTH(), DO_ACTION_TEX_HEIGHT(), 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
|
@ -4076,7 +3998,7 @@ void Interface_DrawItemButtons(PlayState* play) {
|
|||
gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
|
||||
G_MTX_MODELVIEW | G_MTX_LOAD);
|
||||
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[4], 4, 0);
|
||||
Interface_DrawActionLabel(play->state.gfxCtx, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE() * 2);
|
||||
Interface_DrawActionLabel(play->state.gfxCtx, interfaceCtx->doActionSegment[2]);
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
}
|
||||
}
|
||||
|
@ -4900,10 +4822,6 @@ void Interface_Draw(PlayState* play) {
|
|||
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
// Invalidate Do Action textures as they may have changed
|
||||
gSPInvalidateTexCache(OVERLAY_DISP++, interfaceCtx->doActionSegment);
|
||||
gSPInvalidateTexCache(OVERLAY_DISP++, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE());
|
||||
|
||||
gSPSegment(OVERLAY_DISP++, 0x02, interfaceCtx->parameterSegment);
|
||||
gSPSegment(OVERLAY_DISP++, 0x07, interfaceCtx->doActionSegment);
|
||||
gSPSegment(OVERLAY_DISP++, 0x08, interfaceCtx->iconItemSegment);
|
||||
|
@ -5211,7 +5129,7 @@ void Interface_Draw(PlayState* play) {
|
|||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->bAlpha);
|
||||
|
||||
gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE(), G_IM_FMT_IA,
|
||||
gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->doActionSegment[1], G_IM_FMT_IA,
|
||||
DO_ACTION_TEX_WIDTH(), DO_ACTION_TEX_HEIGHT(), 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
|
@ -5301,7 +5219,7 @@ void Interface_Draw(PlayState* play) {
|
|||
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, dPadColor.r, dPadColor.g, dPadColor.b, dpadAlpha);
|
||||
if (fullUi) {
|
||||
gDPLoadTextureBlock(OVERLAY_DISP++, GetResourceDataByName("__OTR__textures/parameter_static/gDPad", false),
|
||||
gDPLoadTextureBlock(OVERLAY_DISP++, "__OTR__textures/parameter_static/gDPad",
|
||||
G_IM_FMT_IA, G_IM_SIZ_16b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
gSPWideTextureRectangle(OVERLAY_DISP++, DpadPosX << 2, DpadPosY << 2,
|
||||
|
@ -5417,9 +5335,9 @@ void Interface_Draw(PlayState* play) {
|
|||
gSPVertex(OVERLAY_DISP++, &interfaceCtx->actionVtx[4], 4, 0);
|
||||
|
||||
if ((interfaceCtx->unk_1EC < 2) || (interfaceCtx->unk_1EC == 3)) {
|
||||
Interface_DrawActionLabel(play->state.gfxCtx, interfaceCtx->doActionSegment);
|
||||
Interface_DrawActionLabel(play->state.gfxCtx, interfaceCtx->doActionSegment[0]);
|
||||
} else {
|
||||
Interface_DrawActionLabel(play->state.gfxCtx, interfaceCtx->doActionSegment + DO_ACTION_TEX_SIZE());
|
||||
Interface_DrawActionLabel(play->state.gfxCtx, interfaceCtx->doActionSegment[1]);
|
||||
}
|
||||
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue