mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-16 10:02:59 -07:00
Use tex sizes from texture rather than hardcoded values (#610)
* Use tex sizes from texture rather than hardcoded values * Dynamic do action tex sizes * Remove unused minimap texture keys * Restore MESSAGE_STATIC_TEX_SIZE * Use dynamic offsets * MACRO it up * Enable SPDLOG in Xcode * Handle non-existent texture
This commit is contained in:
parent
47ad3bdc47
commit
582f084973
13 changed files with 209 additions and 87 deletions
|
@ -8,7 +8,6 @@ void func_80110990(GlobalContext* globalCtx) {
|
|||
void func_801109B0(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
u32 parameterSize;
|
||||
u16 doActionOffset;
|
||||
u8 temp;
|
||||
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
|
@ -49,30 +48,11 @@ void func_801109B0(GlobalContext* globalCtx) {
|
|||
|
||||
ASSERT(interfaceCtx->doActionSegment != NULL);
|
||||
|
||||
if (gSaveContext.language == LANGUAGE_ENG) {
|
||||
doActionOffset = 0;
|
||||
} else if (gSaveContext.language == LANGUAGE_GER) {
|
||||
doActionOffset = 0x2B80;
|
||||
} else {
|
||||
doActionOffset = 0x5700;
|
||||
}
|
||||
uint32_t attackDoActionTexSize = ResourceMgr_LoadTexSizeByName(gAttackDoActionENGTex);
|
||||
memcpy(interfaceCtx->doActionSegment, ResourceMgr_LoadTexByName(gAttackDoActionENGTex), attackDoActionTexSize);
|
||||
memcpy(interfaceCtx->doActionSegment + (attackDoActionTexSize / 2), ResourceMgr_LoadTexByName(gCheckDoActionENGTex), attackDoActionTexSize);
|
||||
|
||||
memcpy(interfaceCtx->doActionSegment, ResourceMgr_LoadTexByName(gAttackDoActionENGTex), 0x180);
|
||||
memcpy(interfaceCtx->doActionSegment + 0x180, ResourceMgr_LoadTexByName(gCheckDoActionENGTex), 0x180);
|
||||
//DmaMgr_SendRequest1(interfaceCtx->doActionSegment, (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, 0x300,
|
||||
//__FILE__, __LINE__);
|
||||
|
||||
if (gSaveContext.language == LANGUAGE_ENG) {
|
||||
doActionOffset = 0x480;
|
||||
} else if (gSaveContext.language == LANGUAGE_GER) {
|
||||
doActionOffset = 0x3000;
|
||||
} else {
|
||||
doActionOffset = 0x5B80;
|
||||
}
|
||||
|
||||
memcpy(interfaceCtx->doActionSegment + 0x300, ResourceMgr_LoadTexByName(gReturnDoActionENGTex), 0x180);
|
||||
//DmaMgr_SendRequest1(interfaceCtx->doActionSegment + 0x300, (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset,
|
||||
//0x180);
|
||||
memcpy(interfaceCtx->doActionSegment + attackDoActionTexSize, ResourceMgr_LoadTexByName(gReturnDoActionENGTex), ResourceMgr_LoadTexSizeByName(gReturnDoActionENGTex));
|
||||
|
||||
interfaceCtx->iconItemSegment = GAMESTATE_ALLOC_MC(
|
||||
&globalCtx->state, 0x1000 * ARRAY_COUNT(gSaveContext.equips.buttonItems));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue