mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-04-26 00:32:20 -05:00
Document berry patch effects (#770)
This commit is contained in:
parent
f03b3ee539
commit
3c41ead4b5
16
include/overlay005/berry_patch_effects.h
Normal file
16
include/overlay005/berry_patch_effects.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#ifndef POKEPLATINUM_OV5_021F204C_H
|
||||
#define POKEPLATINUM_OV5_021F204C_H
|
||||
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
||||
#include "overlay005/struct_ov5_021DF47C_decl.h"
|
||||
#include "overlay101/struct_ov101_021D5D90_decl.h"
|
||||
|
||||
void *BerryPatchGraphicsManager_New(UnkStruct_ov5_021DF47C *renderManager);
|
||||
void BerryPatchGraphicsManager_Free(void *manager);
|
||||
void BerryPatchGraphics_NewMoistureEffect(MapObject *mapObject);
|
||||
void *BerryPatchGraphicsManager_NewEffectCounter(UnkStruct_ov5_021DF47C *renderManager);
|
||||
void BerryPatchGraphicsManager_FreeEffectCounter(void *counter);
|
||||
UnkStruct_ov101_021D5D90 *BerryPatchGraphics_NewSparkleEffect(MapObject *mapObject);
|
||||
|
||||
#endif // POKEPLATINUM_OV5_021F204C_H
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
#ifndef POKEPLATINUM_OV5_021F204C_H
|
||||
#define POKEPLATINUM_OV5_021F204C_H
|
||||
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
|
||||
#include "overlay005/struct_ov5_021DF47C_decl.h"
|
||||
#include "overlay101/struct_ov101_021D5D90_decl.h"
|
||||
|
||||
void *ov5_021F204C(UnkStruct_ov5_021DF47C *param0);
|
||||
void ov5_021F2068(void *param0);
|
||||
void ov5_021F20D4(MapObject *param0);
|
||||
void *ov5_021F21E0(UnkStruct_ov5_021DF47C *param0);
|
||||
void ov5_021F21F4(void *param0);
|
||||
UnkStruct_ov101_021D5D90 *ov5_021F22BC(MapObject *param0);
|
||||
|
||||
#endif // POKEPLATINUM_OV5_021F204C_H
|
||||
|
|
@ -526,7 +526,7 @@ Overlay overlay5
|
|||
Object main.nef.p/src_overlay005_ov5_021F134C.c.o
|
||||
Object main.nef.p/src_overlay005_ov5_021F17B8.c.o
|
||||
Object main.nef.p/src_overlay005_ov5_021F1CC8.c.o
|
||||
Object main.nef.p/src_overlay005_ov5_021F204C.c.o
|
||||
Object main.nef.p/src_overlay005_berry_patch_effects.c.o
|
||||
Object main.nef.p/src_overlay005_ov5_021F23D0.c.o
|
||||
Object main.nef.p/src_overlay005_ov5_021F25C0.c.o
|
||||
Object main.nef.p/src_overlay005_ov5_021F2850.c.o
|
||||
|
|
|
|||
|
|
@ -3,13 +3,6 @@
|
|||
#include "constants/items.h"
|
||||
#include "generated/berry_growth_stages.h"
|
||||
|
||||
// Variable aliases for better readability
|
||||
#define VAR_BerryItemID VAR_0x8000
|
||||
#define VAR_BerryYield VAR_0x8001
|
||||
#define VAR_TempItemCount VAR_0x8004
|
||||
#define VAR_SelectedMulchID VAR_0x8005
|
||||
#define VAR_MenuSelection VAR_0x8008
|
||||
|
||||
|
||||
ScriptEntry BerryTreeMainScript
|
||||
ScriptEntry BerryTree_PlantBerryScript
|
||||
|
|
@ -21,29 +14,29 @@ BerryTreeMainScript:
|
|||
PlayFanfare SEQ_SE_CONFIRM
|
||||
LockAll
|
||||
FacePlayer
|
||||
GetBerryItemID VAR_BerryItemID
|
||||
GetBerryYield VAR_BerryYield
|
||||
GetBerryItemID VAR_0x8000
|
||||
GetBerryYield VAR_0x8001
|
||||
GetBerryGrowthStage VAR_RESULT
|
||||
SetVar VAR_MenuSelection, VAR_RESULT
|
||||
GoToIfEq VAR_MenuSelection, BERRY_GROWTH_STAGE_NONE, BerryTree_CheckExistingMulch
|
||||
GoToIfEq VAR_MenuSelection, BERRY_GROWTH_STAGE_PLANTED, BerryTree_PlantedState
|
||||
GoToIfEq VAR_MenuSelection, BERRY_GROWTH_STAGE_SPROUTED, BerryTree_SproutedState
|
||||
GoToIfEq VAR_MenuSelection, BERRY_GROWTH_STAGE_GROWING, BerryTree_GrowingState
|
||||
GoToIfEq VAR_MenuSelection, BERRY_GROWTH_STAGE_BLOOMING, BerryTree_BloomingState
|
||||
GoToIfEq VAR_MenuSelection, BERRY_GROWTH_STAGE_FRUIT, BerryTree_FruitState
|
||||
SetVar VAR_0x8008, VAR_RESULT
|
||||
GoToIfEq VAR_0x8008, BERRY_GROWTH_STAGE_NONE, BerryTree_CheckExistingMulch
|
||||
GoToIfEq VAR_0x8008, BERRY_GROWTH_STAGE_PLANTED, BerryTree_PlantedState
|
||||
GoToIfEq VAR_0x8008, BERRY_GROWTH_STAGE_SPROUTED, BerryTree_SproutedState
|
||||
GoToIfEq VAR_0x8008, BERRY_GROWTH_STAGE_GROWING, BerryTree_GrowingState
|
||||
GoToIfEq VAR_0x8008, BERRY_GROWTH_STAGE_BLOOMING, BerryTree_BloomingState
|
||||
GoToIfEq VAR_0x8008, BERRY_GROWTH_STAGE_FRUIT, BerryTree_FruitState
|
||||
GoTo BerryTree_CheckExistingMulch
|
||||
End
|
||||
|
||||
BerryTree_PlantedState:
|
||||
Call BerryTree_CheckPlayerHasSprayduck
|
||||
GoToIfEq VAR_RESULT, 0, BerryTree_PlantedStateNoWater
|
||||
BufferItemNameWithArticle 0, VAR_BerryItemID
|
||||
BufferItemNameWithArticle 0, VAR_0x8000
|
||||
CapitalizeFirstLetter 0
|
||||
Message BerryTrees_Text_BerryWasPlantedHere
|
||||
GoTo BerryTree_OfferWatering
|
||||
|
||||
BerryTree_PlantedStateNoWater:
|
||||
BufferItemNameWithArticle 0, VAR_BerryItemID
|
||||
BufferItemNameWithArticle 0, VAR_0x8000
|
||||
CapitalizeFirstLetter 0
|
||||
Message BerryTrees_Text_BerryWasPlantedHereAfterHarvest
|
||||
WaitABXPadPress
|
||||
|
|
@ -52,12 +45,12 @@ BerryTree_PlantedStateNoWater:
|
|||
BerryTree_SproutedState:
|
||||
Call BerryTree_CheckPlayerHasSprayduck
|
||||
GoToIfEq VAR_RESULT, 0, BerryTree_SproutedStateNoWater
|
||||
BufferBerryName 0, VAR_BerryItemID
|
||||
BufferBerryName 0, VAR_0x8000
|
||||
Message BerryTrees_Text_BerryPlantHasSprouted
|
||||
GoTo BerryTree_OfferWatering
|
||||
|
||||
BerryTree_SproutedStateNoWater:
|
||||
BufferBerryName 0, VAR_BerryItemID
|
||||
BufferBerryName 0, VAR_0x8000
|
||||
Message BerryTrees_Text_BerryPlantHasSproutedAfterHarvest
|
||||
WaitABXPadPress
|
||||
GoTo BerryTree_CloseAndEnd
|
||||
|
|
@ -65,12 +58,12 @@ BerryTree_SproutedStateNoWater:
|
|||
BerryTree_GrowingState:
|
||||
Call BerryTree_CheckPlayerHasSprayduck
|
||||
GoToIfEq VAR_RESULT, 0, BerryTree_GrowingStateNoWater
|
||||
BufferBerryName 0, VAR_BerryItemID
|
||||
BufferBerryName 0, VAR_0x8000
|
||||
Message BerryTrees_Text_BerryPlantIsGrowingBigger
|
||||
GoTo BerryTree_OfferWatering
|
||||
|
||||
BerryTree_GrowingStateNoWater:
|
||||
BufferBerryName 0, VAR_BerryItemID
|
||||
BufferBerryName 0, VAR_0x8000
|
||||
Message BerryTrees_Text_BerryPlantIsGrowingBiggerAfterHarvest
|
||||
WaitABXPadPress
|
||||
GoTo BerryTree_CloseAndEnd
|
||||
|
|
@ -78,12 +71,12 @@ BerryTree_GrowingStateNoWater:
|
|||
BerryTree_BloomingState:
|
||||
Call BerryTree_CheckPlayerHasSprayduck
|
||||
GoToIfEq VAR_RESULT, 0, BerryTree_BloomingStateNoWater
|
||||
BufferBerryName 0, VAR_BerryItemID
|
||||
BufferBerryName 0, VAR_0x8000
|
||||
Message BerryTrees_Text_BerryPlantIsInBloom
|
||||
GoTo BerryTree_OfferWatering
|
||||
|
||||
BerryTree_BloomingStateNoWater:
|
||||
BufferBerryName 0, VAR_BerryItemID
|
||||
BufferBerryName 0, VAR_0x8000
|
||||
Message BerryTrees_Text_BerryPlantIsInBloomAfterHarvest
|
||||
WaitABXPadPress
|
||||
GoTo BerryTree_CloseAndEnd
|
||||
|
|
@ -128,53 +121,53 @@ BerryTree_OfferWatering:
|
|||
GoTo BerryTree_CloseAndEnd
|
||||
|
||||
BerryTree_FruitState:
|
||||
BufferNumber 1, VAR_BerryYield
|
||||
GoToIfGt VAR_BerryYield, 1, BerryTree_ShowMultipleBerriesMessage
|
||||
BufferItemNameWithArticle 0, VAR_BerryItemID
|
||||
BufferNumber 1, VAR_0x8001
|
||||
GoToIfGt VAR_0x8001, 1, BerryTree_ShowMultipleBerriesMessage
|
||||
BufferItemNameWithArticle 0, VAR_0x8000
|
||||
Message BerryTrees_Text_ThereIsBerryWantToPickIt
|
||||
GoTo BerryTree_ShowHarvestMenu
|
||||
|
||||
BerryTree_ShowMultipleBerriesMessage:
|
||||
BufferItemNamePlural 0, VAR_BerryItemID
|
||||
BufferItemNamePlural 0, VAR_0x8000
|
||||
Message BerryTrees_Text_ThereAreBerriesWantToPickThem
|
||||
BerryTree_ShowHarvestMenu:
|
||||
ShowYesNoMenu VAR_RESULT
|
||||
GoToIfEq VAR_RESULT, MENU_NO, BerryTree_HandleHarvestDeclined
|
||||
GoToIfCannotFitItem VAR_BerryItemID, VAR_BerryYield, VAR_RESULT, BerryTree_CheckBagSpace
|
||||
BufferNumber 1, VAR_BerryYield
|
||||
GoToIfGt VAR_BerryYield, 1, BerryTree_ShowMultipleBerriesPickedMessage
|
||||
BufferItemName 0, VAR_BerryItemID
|
||||
GoToIfCannotFitItem VAR_0x8000, VAR_0x8001, VAR_RESULT, BerryTree_CheckBagSpace
|
||||
BufferNumber 1, VAR_0x8001
|
||||
GoToIfGt VAR_0x8001, 1, BerryTree_ShowMultipleBerriesPickedMessage
|
||||
BufferItemName 0, VAR_0x8000
|
||||
Message BerryTrees_Text_YouPickedTheBerry
|
||||
GoTo BerryTree_HarvestBerries
|
||||
|
||||
BerryTree_ShowMultipleBerriesPickedMessage:
|
||||
BufferItemNamePlural 0, VAR_BerryItemID
|
||||
BufferItemNamePlural 0, VAR_0x8000
|
||||
Message BerryTrees_Text_YouPickedTheBerries
|
||||
BerryTree_HarvestBerries:
|
||||
PlaySound SEQ_KINOMI
|
||||
WaitSound
|
||||
HarvestBerry
|
||||
BufferPlayerName 0
|
||||
GoToIfGt VAR_BerryYield, 1, BerryTree_ShowMultipleBerriesStoredMessage
|
||||
BufferItemName 1, VAR_BerryItemID
|
||||
GoToIfGt VAR_0x8001, 1, BerryTree_ShowMultipleBerriesStoredMessage
|
||||
BufferItemName 1, VAR_0x8000
|
||||
GoTo BerryTree_ShowBerriesStoredMessage
|
||||
|
||||
BerryTree_ShowMultipleBerriesStoredMessage:
|
||||
BufferItemNamePlural 1, VAR_BerryItemID
|
||||
BufferItemNamePlural 1, VAR_0x8000
|
||||
BerryTree_ShowBerriesStoredMessage:
|
||||
GetItemPocket VAR_BerryItemID, VAR_RESULT
|
||||
GetItemPocket VAR_0x8000, VAR_RESULT
|
||||
BufferPocketName 3, VAR_RESULT
|
||||
Message BerryTrees_Text_PlayerPutAwayBerriesInBagPocket
|
||||
WaitABXPadPress
|
||||
GoTo BerryTree_CloseAndEnd
|
||||
|
||||
BerryTree_CheckBagSpace:
|
||||
GoToIfGt VAR_BerryYield, 1, BerryTree_ShowMultipleBerriesBagFullMessage
|
||||
BufferItemName 0, VAR_BerryItemID
|
||||
GoToIfGt VAR_0x8001, 1, BerryTree_ShowMultipleBerriesBagFullMessage
|
||||
BufferItemName 0, VAR_0x8000
|
||||
GoTo BerryTree_ShowBagFullMessage
|
||||
|
||||
BerryTree_ShowMultipleBerriesBagFullMessage:
|
||||
BufferItemNamePlural 0, VAR_BerryItemID
|
||||
BufferItemNamePlural 0, VAR_0x8000
|
||||
BerryTree_ShowBagFullMessage:
|
||||
Message BerryTrees_Text_BagIsFullBerriesCouldntBeTaken
|
||||
WaitABXPadPress
|
||||
|
|
@ -187,13 +180,13 @@ BerryTree_HandleHarvestDeclined:
|
|||
|
||||
BerryTree_ShowLeftBerryMessage:
|
||||
BufferPlayerName 0
|
||||
GoToIfGt VAR_BerryYield, 1, BerryTree_ShowLeftBerriesMessage
|
||||
BufferItemName 1, VAR_BerryItemID
|
||||
GoToIfGt VAR_0x8001, 1, BerryTree_ShowLeftBerriesMessage
|
||||
BufferItemName 1, VAR_0x8000
|
||||
Message BerryTrees_Text_PlayerLeftBerryWhereItWas
|
||||
GoTo BerryTree_EndLeftBerryMessage
|
||||
|
||||
BerryTree_ShowLeftBerriesMessage:
|
||||
BufferItemNamePlural 1, VAR_BerryItemID
|
||||
BufferItemNamePlural 1, VAR_0x8000
|
||||
Message BerryTrees_Text_PlayerLeftBerriesWhereTheyWere
|
||||
BerryTree_EndLeftBerryMessage:
|
||||
WaitABXPadPress
|
||||
|
|
@ -228,10 +221,10 @@ BerryTree_ShowSoilMenu:
|
|||
AddMenuEntryImm BerryTrees_Text_PlantBerry, 1
|
||||
AddMenuEntryImm BerryTrees_Text_Exit, 2
|
||||
ShowMenu
|
||||
SetVar VAR_MenuSelection, VAR_RESULT
|
||||
GoToIfEq VAR_MenuSelection, 0, BerryTree_OpenMulchMenu
|
||||
GoToIfEq VAR_MenuSelection, 1, BerryTree_OpenBerryMenu
|
||||
GoToIfEq VAR_MenuSelection, 2, BerryTree_CloseAndEnd
|
||||
SetVar VAR_0x8008, VAR_RESULT
|
||||
GoToIfEq VAR_0x8008, 0, BerryTree_OpenMulchMenu
|
||||
GoToIfEq VAR_0x8008, 1, BerryTree_OpenBerryMenu
|
||||
GoToIfEq VAR_0x8008, 2, BerryTree_CloseAndEnd
|
||||
GoTo BerryTree_CloseAndEnd
|
||||
|
||||
BerryTree_OfferFertilizer:
|
||||
|
|
@ -248,26 +241,26 @@ BerryTree_OpenMulchMenu:
|
|||
ReturnToField
|
||||
FadeScreenIn
|
||||
WaitFadeScreen
|
||||
GetSelectedItem VAR_SelectedMulchID
|
||||
SetVar VAR_MenuSelection, VAR_SelectedMulchID
|
||||
GoToIfEq VAR_MenuSelection, ITEM_NONE, BerryTree_ReleaseAndEnd
|
||||
GoToIfEq VAR_MenuSelection, ITEM_GROWTH_MULCH, BerryTree_ApplyMulch
|
||||
GoToIfEq VAR_MenuSelection, ITEM_DAMP_MULCH, BerryTree_ApplyMulch
|
||||
GoToIfEq VAR_MenuSelection, ITEM_STABLE_MULCH, BerryTree_ApplyMulch
|
||||
GoToIfEq VAR_MenuSelection, ITEM_GOOEY_MULCH, BerryTree_ApplyMulch
|
||||
GetSelectedItem VAR_0x8005
|
||||
SetVar VAR_0x8008, VAR_0x8005
|
||||
GoToIfEq VAR_0x8008, ITEM_NONE, BerryTree_ReleaseAndEnd
|
||||
GoToIfEq VAR_0x8008, ITEM_GROWTH_MULCH, BerryTree_ApplyMulch
|
||||
GoToIfEq VAR_0x8008, ITEM_DAMP_MULCH, BerryTree_ApplyMulch
|
||||
GoToIfEq VAR_0x8008, ITEM_STABLE_MULCH, BerryTree_ApplyMulch
|
||||
GoToIfEq VAR_0x8008, ITEM_GOOEY_MULCH, BerryTree_ApplyMulch
|
||||
GoTo BerryTree_ReleaseAndEnd
|
||||
|
||||
BerryTree_ApplyMulch:
|
||||
RemoveItem VAR_SelectedMulchID, 1, VAR_TempItemCount
|
||||
SetBerryMulch VAR_SelectedMulchID
|
||||
RemoveItem VAR_0x8005, 1, VAR_0x8004
|
||||
SetBerryMulch VAR_0x8005
|
||||
CheckPocketHasItems POCKET_BERRIES, VAR_RESULT
|
||||
GoToIfEq VAR_RESULT, 0, BerryTree_ShowMulchAppliedMessage
|
||||
BufferItemName 0, VAR_SelectedMulchID
|
||||
BufferItemName 0, VAR_0x8005
|
||||
Message BerryTrees_Text_MulchWasScatteredOnSoil
|
||||
GoTo BerryTree_OfferPlantBerry
|
||||
|
||||
BerryTree_ShowMulchAppliedMessage:
|
||||
BufferItemName 0, VAR_SelectedMulchID
|
||||
BufferItemName 0, VAR_0x8005
|
||||
Message BerryTrees_Text_MulchWasScatteredOnSoilAfterHarvest
|
||||
WaitABXPadPress
|
||||
GoTo BerryTree_CloseAndEnd
|
||||
|
|
@ -289,7 +282,7 @@ BerryTree_OpenBerryMenu:
|
|||
BufferItemName 0, VAR_RESULT
|
||||
Message BerryTrees_Text_BerryWasPlantedInSoftSoil
|
||||
WaitABXPadPress
|
||||
RemoveItem VAR_RESULT, 1, VAR_TempItemCount
|
||||
RemoveItem VAR_RESULT, 1, VAR_0x8004
|
||||
PlantBerry VAR_RESULT
|
||||
GoTo BerryTree_CloseAndEnd
|
||||
|
||||
|
|
@ -315,12 +308,12 @@ BerryTree_PlantBerryScript:
|
|||
PlayFanfare SEQ_SE_CONFIRM
|
||||
LockAll
|
||||
FacePlayer
|
||||
BufferItemName 0, VAR_BerryItemID
|
||||
BufferItemName 0, VAR_0x8000
|
||||
Message BerryTrees_Text_BerryWasPlantedInSoftSoil
|
||||
WaitABXPadPress
|
||||
CloseMessage
|
||||
RemoveItem VAR_BerryItemID, 1, VAR_TempItemCount
|
||||
PlantBerry VAR_BerryItemID
|
||||
RemoveItem VAR_0x8000, 1, VAR_0x8004
|
||||
PlantBerry VAR_0x8000
|
||||
ReleaseAll
|
||||
End
|
||||
|
||||
|
|
@ -336,6 +329,6 @@ BerryTree_WaterBerryScript:
|
|||
|
||||
BerryTree_ApplyMulchScript:
|
||||
LockAll
|
||||
SetVar VAR_RESULT, VAR_BerryItemID
|
||||
SetVar VAR_SelectedMulchID, VAR_BerryItemID
|
||||
SetVar VAR_RESULT, VAR_0x8000
|
||||
SetVar VAR_0x8005, VAR_0x8000
|
||||
GoTo BerryTree_ApplyMulch
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@
|
|||
|
||||
#include "overlay005/berry_graphics_data.h"
|
||||
#include "overlay005/berry_graphics_table.h"
|
||||
#include "overlay005/berry_patch_effects.h"
|
||||
#include "overlay005/ov5_021ECC20.h"
|
||||
#include "overlay005/ov5_021ECE40.h"
|
||||
#include "overlay005/ov5_021F204C.h"
|
||||
#include "overlay005/struct_ov5_021ED01C.h"
|
||||
|
||||
#include "berry_patch_manager.h"
|
||||
|
|
@ -91,7 +91,7 @@ void BerryPatchGraphics_NewGraphics(MapObject *mapObject)
|
|||
graphicsData->graphicsResourceID = 0xffff;
|
||||
graphicsData->lastGrowthStage = BERRY_GROWTH_STAGE_NONE;
|
||||
|
||||
ov5_021F20D4(mapObject);
|
||||
BerryPatchGraphics_NewMoistureEffect(mapObject);
|
||||
}
|
||||
|
||||
void BerryPatchGraphics_UpdateGraphics(MapObject *mapObject)
|
||||
|
|
@ -112,13 +112,13 @@ void BerryPatchGraphics_UpdateGraphics(MapObject *mapObject)
|
|||
|
||||
if (graphicsData->graphicsResourceID != 0xffff) {
|
||||
if (graphicsData->lastGrowthStage != BERRY_GROWTH_STAGE_NONE) {
|
||||
ov5_021F22BC(mapObject);
|
||||
BerryPatchGraphics_NewSparkleEffect(mapObject);
|
||||
}
|
||||
|
||||
ov5_021ECEB4(mapObject, &graphicsData->graphicsObject, graphicsData->graphicsResourceID);
|
||||
} else {
|
||||
if (graphicsData->lastGrowthStage != BERRY_GROWTH_STAGE_NONE && patchData->needsUpdate == FALSE) {
|
||||
ov5_021F22BC(mapObject);
|
||||
if (graphicsData->lastGrowthStage != BERRY_GROWTH_STAGE_NONE && !patchData->needsUpdate) {
|
||||
BerryPatchGraphics_NewSparkleEffect(mapObject);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -175,7 +175,7 @@ void BerryPatchGraphics_ResumeGraphics(MapObject *mapObject)
|
|||
MapObject_SetStatusFlagOff(mapObject, MAP_OBJ_STATUS_21);
|
||||
}
|
||||
|
||||
ov5_021F20D4(mapObject);
|
||||
BerryPatchGraphics_NewMoistureEffect(mapObject);
|
||||
}
|
||||
|
||||
if (graphicsData->graphicsObject != NULL) {
|
||||
|
|
|
|||
|
|
@ -417,7 +417,7 @@ pokeplatinum_c = files(
|
|||
'overlay005/ov5_021F134C.c',
|
||||
'overlay005/ov5_021F17B8.c',
|
||||
'overlay005/ov5_021F1CC8.c',
|
||||
'overlay005/ov5_021F204C.c',
|
||||
'overlay005/berry_patch_effects.c',
|
||||
'overlay005/ov5_021F23D0.c',
|
||||
'overlay005/ov5_021F25C0.c',
|
||||
'overlay005/ov5_021F2850.c',
|
||||
|
|
|
|||
364
src/overlay005/berry_patch_effects.c
Normal file
364
src/overlay005/berry_patch_effects.c
Normal file
|
|
@ -0,0 +1,364 @@
|
|||
#include "overlay005/berry_patch_effects.h"
|
||||
|
||||
#include <nitro.h>
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
#include "struct_defs/struct_02073838.h"
|
||||
#include "struct_defs/struct_02073B50.h"
|
||||
|
||||
#include "overlay005/ov5_021DF440.h"
|
||||
#include "overlay005/ov5_021ECC20.h"
|
||||
#include "overlay005/struct_ov5_021DF47C_decl.h"
|
||||
#include "overlay101/struct_ov101_021D5D90_decl.h"
|
||||
#include "overlay101/struct_ov101_021D86B0.h"
|
||||
|
||||
#include "berry_patch_manager.h"
|
||||
#include "map_object.h"
|
||||
#include "unk_02020AEC.h"
|
||||
#include "unk_020711EC.h"
|
||||
#include "unk_02073838.h"
|
||||
|
||||
// Berry patch moisture effect resource IDs
|
||||
#define BERRY_PATCH_MOISTURE_RESOURCE_COUNT 3
|
||||
#define BERRY_PATCH_MOISTURE_RESOURCE_DRY 77
|
||||
#define BERRY_PATCH_MOISTURE_RESOURCE_MOIST 76
|
||||
#define BERRY_PATCH_MOISTURE_RESOURCE_WET 75
|
||||
|
||||
typedef struct BerryPatchGraphicsManager {
|
||||
UnkStruct_ov5_021DF47C *renderManager;
|
||||
UnkStruct_02073B50 resourceData[BERRY_PATCH_MOISTURE_RESOURCE_COUNT];
|
||||
UnkStruct_02073838 resources[BERRY_PATCH_MOISTURE_RESOURCE_COUNT];
|
||||
} BerryPatchGraphicsManager;
|
||||
|
||||
typedef struct BerryPatchMoistureEffectContext {
|
||||
UnkStruct_ov5_021DF47C *renderManager;
|
||||
BerryPatchGraphicsManager *graphicsManager;
|
||||
MapObject *mapObject;
|
||||
} BerryPatchMoistureEffectContext;
|
||||
|
||||
typedef struct BerryPatchMoistureEffect {
|
||||
int localID;
|
||||
int mapID;
|
||||
BOOL isHidden;
|
||||
int moistureLevel;
|
||||
BerryPatchMoistureEffectContext context;
|
||||
} BerryPatchMoistureEffect;
|
||||
|
||||
typedef struct BerryPatchEffectCounter {
|
||||
int counter;
|
||||
BOOL isEnabled;
|
||||
UnkStruct_ov5_021DF47C *renderManager;
|
||||
} BerryPatchEffectCounter;
|
||||
|
||||
typedef struct BerryPatchSparkleEffectContext {
|
||||
UnkStruct_ov5_021DF47C *renderManager;
|
||||
BerryPatchEffectCounter *effectCounter;
|
||||
MapObject *mapObject;
|
||||
} BerryPatchSparkleEffectContext;
|
||||
|
||||
typedef struct BerryPatchSparkleEffect {
|
||||
int dummy;
|
||||
int animationFrame;
|
||||
BOOL isAnimating;
|
||||
BerryPatchSparkleEffectContext context;
|
||||
UnkStruct_020216E0 *graphicsObject;
|
||||
} BerryPatchSparkleEffect;
|
||||
|
||||
static void BerryPatchGraphicsManager_InitResources(BerryPatchGraphicsManager *manager);
|
||||
static void BerryPatchGraphicsManager_FreeResources(BerryPatchGraphicsManager *manager);
|
||||
static void BerryPatchEffectCounter_Increment(BerryPatchEffectCounter *counter);
|
||||
static void BerryPatchEffectCounter_Decrement(BerryPatchEffectCounter *counter);
|
||||
static void BerryPatchEffectCounter_EnableEffects(BerryPatchEffectCounter *counter);
|
||||
static void BerryPatchEffectCounter_DisableEffects(BerryPatchEffectCounter *counter);
|
||||
static void BerryPatchEffectCounter_CheckEnable(BerryPatchEffectCounter *counter);
|
||||
static void BerryPatchEffectCounter_CheckDisable(BerryPatchEffectCounter *counter);
|
||||
|
||||
static const UnkStruct_ov101_021D86B0 sBerryPatchMoistureEffectDefinition;
|
||||
static const UnkStruct_ov101_021D86B0 sBerryPatchSparkleEffectDefinition;
|
||||
static const u32 sBerryPatchMoistureResourceIDs[BERRY_PATCH_MOISTURE_RESOURCE_COUNT];
|
||||
static const UnkStruct_020217F4 sBerryPatchSparkleEffectData[];
|
||||
|
||||
void *BerryPatchGraphicsManager_New(UnkStruct_ov5_021DF47C *renderManager)
|
||||
{
|
||||
BerryPatchGraphicsManager *manager = ov5_021DF53C(renderManager, sizeof(BerryPatchGraphicsManager), 0, 0);
|
||||
manager->renderManager = renderManager;
|
||||
|
||||
BerryPatchGraphicsManager_InitResources(manager);
|
||||
return manager;
|
||||
}
|
||||
|
||||
void BerryPatchGraphicsManager_Free(void *manager)
|
||||
{
|
||||
BerryPatchGraphicsManager *graphicsManager = manager;
|
||||
|
||||
BerryPatchGraphicsManager_FreeResources(graphicsManager);
|
||||
ov5_021DF554(graphicsManager);
|
||||
}
|
||||
|
||||
static void BerryPatchGraphicsManager_InitResources(BerryPatchGraphicsManager *manager)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
do {
|
||||
ov5_021DFB00(
|
||||
manager->renderManager, &manager->resources[i], 0, sBerryPatchMoistureResourceIDs[i], 0);
|
||||
sub_02073B70(&manager->resourceData[i], &manager->resources[i]);
|
||||
i++;
|
||||
} while (i < BERRY_PATCH_MOISTURE_RESOURCE_COUNT);
|
||||
}
|
||||
|
||||
static void BerryPatchGraphicsManager_FreeResources(BerryPatchGraphicsManager *manager)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
do {
|
||||
sub_0207395C(&manager->resources[i]);
|
||||
i++;
|
||||
} while (i < BERRY_PATCH_MOISTURE_RESOURCE_COUNT);
|
||||
}
|
||||
|
||||
void BerryPatchGraphics_NewMoistureEffect(MapObject *mapObject)
|
||||
{
|
||||
BerryPatchMoistureEffectContext context;
|
||||
UnkStruct_ov5_021DF47C *renderManager = ov5_021DF578(mapObject);
|
||||
VecFx32 position;
|
||||
|
||||
context.renderManager = renderManager;
|
||||
context.graphicsManager = ov5_021DF55C(renderManager, 12);
|
||||
context.mapObject = mapObject;
|
||||
|
||||
MapObject_GetPosPtr(mapObject, &position);
|
||||
|
||||
int priority = 0;
|
||||
int effectPriority = sub_02062C0C(mapObject) + 1;
|
||||
|
||||
ov5_021DF72C(renderManager, &sBerryPatchMoistureEffectDefinition, &position, priority, &context, effectPriority);
|
||||
}
|
||||
|
||||
static BOOL BerryPatchMoistureEffect_Init(UnkStruct_ov101_021D5D90 *effect, void *context)
|
||||
{
|
||||
BerryPatchMoistureEffect *moistureEffect = context;
|
||||
const BerryPatchMoistureEffectContext *effectContext = sub_020715BC(effect);
|
||||
|
||||
moistureEffect->context = *effectContext;
|
||||
moistureEffect->localID = MapObject_GetLocalID(moistureEffect->context.mapObject);
|
||||
moistureEffect->mapID = sub_02062918(moistureEffect->context.mapObject);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void BerryPatchMoistureEffect_Free(UnkStruct_ov101_021D5D90 *effect, void *context)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void BerryPatchMoistureEffect_Update(UnkStruct_ov101_021D5D90 *effectTask, void *effectData)
|
||||
{
|
||||
BerryPatchMoistureEffect *berryPatchEffect = effectData;
|
||||
MapObject *mapObject = berryPatchEffect->context.mapObject;
|
||||
|
||||
if (!sub_02062764(mapObject, berryPatchEffect->localID, berryPatchEffect->mapID)) {
|
||||
ov5_021DF74C(effectTask);
|
||||
return;
|
||||
}
|
||||
|
||||
berryPatchEffect->isHidden = FALSE;
|
||||
|
||||
if (MapObject_CheckStatusFlag(mapObject, MAP_OBJ_STATUS_HIDE) == TRUE || !BerryPatches_GetGrowthStage(MapObject_FieldSystem(mapObject), mapObject)) {
|
||||
berryPatchEffect->isHidden = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
berryPatchEffect->moistureLevel = BerryPatches_GetMoisture(MapObject_FieldSystem(mapObject), mapObject);
|
||||
|
||||
VecFx32 mapObjectPosition;
|
||||
|
||||
MapObject_GetPosPtr(mapObject, &mapObjectPosition);
|
||||
sub_020715D4(effectTask, &mapObjectPosition);
|
||||
}
|
||||
|
||||
static void BerryPatchMoistureEffect_Render(UnkStruct_ov101_021D5D90 *effectTask, void *effectData)
|
||||
{
|
||||
BerryPatchMoistureEffect *berryPatchEffect = effectData;
|
||||
|
||||
if (berryPatchEffect->isHidden != TRUE) {
|
||||
VecFx32 effectPosition;
|
||||
|
||||
sub_020715E4(effectTask, &effectPosition);
|
||||
sub_02073BB4(&berryPatchEffect->context.graphicsManager->resourceData[berryPatchEffect->moistureLevel], &effectPosition);
|
||||
}
|
||||
}
|
||||
|
||||
static const UnkStruct_ov101_021D86B0 sBerryPatchMoistureEffectDefinition = {
|
||||
sizeof(BerryPatchMoistureEffect),
|
||||
BerryPatchMoistureEffect_Init,
|
||||
BerryPatchMoistureEffect_Free,
|
||||
BerryPatchMoistureEffect_Update,
|
||||
BerryPatchMoistureEffect_Render
|
||||
};
|
||||
|
||||
void *BerryPatchGraphicsManager_NewEffectCounter(UnkStruct_ov5_021DF47C *renderManager)
|
||||
{
|
||||
BerryPatchEffectCounter *effectCounter = ov5_021DF53C(renderManager, sizeof(BerryPatchEffectCounter), 0, 0);
|
||||
effectCounter->renderManager = renderManager;
|
||||
|
||||
return effectCounter;
|
||||
}
|
||||
|
||||
void BerryPatchGraphicsManager_FreeEffectCounter(void *counter)
|
||||
{
|
||||
BerryPatchEffectCounter *effectCounter = counter;
|
||||
|
||||
BerryPatchEffectCounter_DisableEffects(effectCounter);
|
||||
ov5_021DF554(effectCounter);
|
||||
}
|
||||
|
||||
static void BerryPatchEffectCounter_Increment(BerryPatchEffectCounter *counter)
|
||||
{
|
||||
counter->counter++;
|
||||
}
|
||||
|
||||
static void BerryPatchEffectCounter_Decrement(BerryPatchEffectCounter *counter)
|
||||
{
|
||||
counter->counter--;
|
||||
GF_ASSERT(counter->counter >= 0);
|
||||
}
|
||||
|
||||
static void BerryPatchEffectCounter_EnableEffects(BerryPatchEffectCounter *counter)
|
||||
{
|
||||
if (!counter->isEnabled) {
|
||||
counter->isEnabled = TRUE;
|
||||
// Load sparkle effect graphics resources
|
||||
ov5_021DF9E0(counter->renderManager, 11, 109);
|
||||
ov5_021DFA14(counter->renderManager, 11, 181);
|
||||
ov5_021DFA3C(counter->renderManager, 12, 14, 1);
|
||||
ov5_021DF864(counter->renderManager, 13, 11, 11, 12, 0, sBerryPatchSparkleEffectData);
|
||||
}
|
||||
}
|
||||
|
||||
static void BerryPatchEffectCounter_DisableEffects(BerryPatchEffectCounter *counter)
|
||||
{
|
||||
if (counter->isEnabled == TRUE) {
|
||||
counter->isEnabled = FALSE;
|
||||
// Clean up sparkle effect graphics resources
|
||||
ov5_021DFA08(counter->renderManager, 11);
|
||||
ov5_021DFA30(counter->renderManager, 11);
|
||||
ov5_021DFA7C(counter->renderManager, 12);
|
||||
ov5_021DF9D4(counter->renderManager, 13);
|
||||
}
|
||||
}
|
||||
|
||||
static void BerryPatchEffectCounter_CheckEnable(BerryPatchEffectCounter *counter)
|
||||
{
|
||||
if (counter->counter == 0) {
|
||||
BerryPatchEffectCounter_EnableEffects(counter);
|
||||
}
|
||||
}
|
||||
|
||||
static void BerryPatchEffectCounter_CheckDisable(BerryPatchEffectCounter *counter)
|
||||
{
|
||||
if (counter->counter == 0) {
|
||||
BerryPatchEffectCounter_DisableEffects(counter);
|
||||
}
|
||||
}
|
||||
|
||||
UnkStruct_ov101_021D5D90 *BerryPatchGraphics_NewSparkleEffect(MapObject *mapObject)
|
||||
{
|
||||
VecFx32 position;
|
||||
UnkStruct_ov5_021DF47C *renderManager;
|
||||
BerryPatchSparkleEffectContext effectContext;
|
||||
UnkStruct_ov101_021D5D90 *effectTask;
|
||||
|
||||
renderManager = ov5_021DF578(mapObject);
|
||||
ov5_021ECDA0(mapObject, &position);
|
||||
position.z += (FX32_ONE * 8); // Offset sparkle effect 8 units above ground
|
||||
|
||||
effectContext.renderManager = renderManager;
|
||||
effectContext.effectCounter = ov5_021DF55C(renderManager, 28);
|
||||
effectTask = ov5_021DF72C(renderManager, &sBerryPatchSparkleEffectDefinition, &position, 0, &effectContext, 255);
|
||||
|
||||
return effectTask;
|
||||
}
|
||||
|
||||
static BOOL BerryPatchSparkleEffect_Init(UnkStruct_ov101_021D5D90 *effect, void *context)
|
||||
{
|
||||
VecFx32 position;
|
||||
BerryPatchSparkleEffect *sparkleEffect = context;
|
||||
const BerryPatchSparkleEffectContext *effectContext = sub_020715BC(effect);
|
||||
|
||||
sparkleEffect->context = *effectContext;
|
||||
|
||||
BerryPatchEffectCounter_CheckEnable(sparkleEffect->context.effectCounter);
|
||||
sub_020715E4(effect, &position);
|
||||
|
||||
sparkleEffect->graphicsObject = ov5_021DF84C(sparkleEffect->context.renderManager, 13, &position);
|
||||
BerryPatchEffectCounter_Increment(sparkleEffect->context.effectCounter);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void BerryPatchSparkleEffect_Free(UnkStruct_ov101_021D5D90 *effect, void *context)
|
||||
{
|
||||
BerryPatchSparkleEffect *sparkleEffect = context;
|
||||
|
||||
sub_020211FC(sparkleEffect->graphicsObject);
|
||||
BerryPatchEffectCounter_Decrement(sparkleEffect->context.effectCounter);
|
||||
BerryPatchEffectCounter_CheckDisable(sparkleEffect->context.effectCounter);
|
||||
}
|
||||
|
||||
static void BerryPatchSparkleEffect_Update(UnkStruct_ov101_021D5D90 *effect, void *context)
|
||||
{
|
||||
// Animation speed multipliers for different sparkle effect frames
|
||||
fx32 animationSpeeds[5] = { 4096, 4096, 8192, 8192, 4096 };
|
||||
BerryPatchSparkleEffect *sparkleEffect = context;
|
||||
|
||||
if (sparkleEffect->isAnimating == TRUE) {
|
||||
sparkleEffect->isAnimating = FALSE;
|
||||
sparkleEffect->animationFrame++;
|
||||
|
||||
if (sparkleEffect->animationFrame >= (int)NELEMS(animationSpeeds)) {
|
||||
ov5_021DF74C(effect);
|
||||
return;
|
||||
}
|
||||
|
||||
sub_02021380(sparkleEffect->graphicsObject, 0);
|
||||
}
|
||||
|
||||
if (sub_02021368(sparkleEffect->graphicsObject, animationSpeeds[sparkleEffect->animationFrame]) != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
sparkleEffect->isAnimating = TRUE;
|
||||
}
|
||||
|
||||
static void BerryPatchSparkleEffect_Render(UnkStruct_ov101_021D5D90 *effect, void *context)
|
||||
{
|
||||
VecFx32 position;
|
||||
BerryPatchSparkleEffect *sparkleEffect = context;
|
||||
|
||||
sub_020715E4(effect, &position);
|
||||
sub_020212A8(sparkleEffect->graphicsObject, &position);
|
||||
}
|
||||
|
||||
static const UnkStruct_ov101_021D86B0 sBerryPatchSparkleEffectDefinition = {
|
||||
sizeof(BerryPatchSparkleEffect),
|
||||
BerryPatchSparkleEffect_Init,
|
||||
BerryPatchSparkleEffect_Free,
|
||||
BerryPatchSparkleEffect_Update,
|
||||
BerryPatchSparkleEffect_Render
|
||||
};
|
||||
|
||||
static const u32 sBerryPatchMoistureResourceIDs[BERRY_PATCH_MOISTURE_RESOURCE_COUNT] = {
|
||||
BERRY_PATCH_MOISTURE_RESOURCE_DRY,
|
||||
BERRY_PATCH_MOISTURE_RESOURCE_MOIST,
|
||||
BERRY_PATCH_MOISTURE_RESOURCE_WET
|
||||
};
|
||||
|
||||
// Sparkle effect configuration data for berry patches
|
||||
// Each entry defines: { model_variant, animation_frame_count, effect_type }
|
||||
static const UnkStruct_020217F4 sBerryPatchSparkleEffectData[] = {
|
||||
{ 0, 9, 1 }, // Animated sparkle effect (9 animation frames, type 1)
|
||||
{ 0, 0, 2 } // Static sparkle effect (no animation, type 2)
|
||||
};
|
||||
|
|
@ -81,30 +81,30 @@ typedef struct {
|
|||
TextureResourceManager *unk_08;
|
||||
} UnkStruct_ov5_021DFA88;
|
||||
|
||||
static u32 ov5_021DF584(const UnkStruct_ov5_021DF47C *param0);
|
||||
static void ov5_021DF588(UnkStruct_ov5_021DF47C *param0);
|
||||
static void ov5_021DF59C(UnkStruct_ov5_021DF47C *param0);
|
||||
static void ov5_021DF5E8(UnkStruct_ov5_021DF47C *param0);
|
||||
static void ov5_021DF600(UnkStruct_ov5_021DF47C *param0, u32 param1);
|
||||
static void ov5_021DF628(UnkStruct_ov5_021DF47C *param0, UnkStruct_ov5_021DF6AC *param1);
|
||||
static void ov5_021DF644(UnkStruct_ov5_021DF47C *param0);
|
||||
static UnkStruct_ov5_021DF6AC *ov5_021DF66C(UnkStruct_ov5_021DF47C *param0);
|
||||
static UnkStruct_ov5_021DF6AC *ov5_021DF694(UnkStruct_ov5_021DF47C *param0, u32 param1);
|
||||
static u32 ov5_021DF584(const UnkStruct_ov5_021DF47C *renderManager);
|
||||
static void ov5_021DF588(UnkStruct_ov5_021DF47C *renderManager);
|
||||
static void ov5_021DF59C(UnkStruct_ov5_021DF47C *renderManager);
|
||||
static void ov5_021DF5E8(UnkStruct_ov5_021DF47C *renderManager);
|
||||
static void ov5_021DF600(UnkStruct_ov5_021DF47C *renderManager, u32 objectID);
|
||||
static void ov5_021DF628(UnkStruct_ov5_021DF47C *renderManager, UnkStruct_ov5_021DF6AC *param1);
|
||||
static void ov5_021DF644(UnkStruct_ov5_021DF47C *renderManager);
|
||||
static UnkStruct_ov5_021DF6AC *ov5_021DF66C(UnkStruct_ov5_021DF47C *renderManager);
|
||||
static UnkStruct_ov5_021DF6AC *ov5_021DF694(UnkStruct_ov5_021DF47C *renderManager, u32 objectID);
|
||||
static void ov5_021DF6AC(UnkStruct_ov5_021DF6AC *param0);
|
||||
static void ov5_021DF6B8(UnkStruct_ov5_021DF6AC *param0, u32 param1, void *param2);
|
||||
static int ov5_021DF6C0(const UnkStruct_ov5_021DF6AC *param0);
|
||||
static const UnkStruct_ov5_021FF85C *ov5_021DF6D0(u32 param0);
|
||||
static void ov5_021DF6F8(UnkStruct_ov5_021DF47C *param0);
|
||||
static void ov5_021DF708(UnkStruct_ov5_021DF47C *param0);
|
||||
static void ov5_021DF71C(UnkStruct_ov5_021DF47C *param0);
|
||||
static void ov5_021DF6F8(UnkStruct_ov5_021DF47C *renderManager);
|
||||
static void ov5_021DF708(UnkStruct_ov5_021DF47C *renderManager);
|
||||
static void ov5_021DF71C(UnkStruct_ov5_021DF47C *renderManager);
|
||||
static void ov5_021DF754(UnkStruct_ov5_021DF47C *param0, u32 heapID, u32 param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8);
|
||||
static void ov5_021DF7C4(UnkStruct_ov5_021DF47C *param0);
|
||||
static void ov5_021DF8C8(UnkStruct_ov5_021DF47C *param0, UnkStruct_ov5_021DF8FC *param1, u32 param2);
|
||||
static void ov5_021DF8FC(UnkStruct_ov5_021DF8FC *param0);
|
||||
static UnkStruct_ov5_021DF84C *ov5_021DF9B4(UnkStruct_ov5_021DF8FC *param0, u32 param1);
|
||||
static void ov5_021DF910(UnkStruct_ov5_021DF8FC *param0, u32 param1);
|
||||
static UnkStruct_ov5_021DF84C *ov5_021DF930(UnkStruct_ov5_021DF8FC *param0, u32 param1, void *param2, UnkStruct_02024184 *param3, void *param4, TextureResource *param5, const UnkStruct_020217F4 *param6);
|
||||
static void ov5_021DFA88(UnkStruct_ov5_021DF47C *param0, u32 param1, TextureResourceManager *param2);
|
||||
static void ov5_021DF7C4(UnkStruct_ov5_021DF47C *renderManager);
|
||||
static void ov5_021DF8C8(UnkStruct_ov5_021DF47C *renderManager, UnkStruct_ov5_021DF8FC *graphicsManager, u32 objectCount);
|
||||
static void ov5_021DF8FC(UnkStruct_ov5_021DF8FC *graphicsManager);
|
||||
static UnkStruct_ov5_021DF84C *ov5_021DF9B4(UnkStruct_ov5_021DF8FC *graphicsManager, u32 objectID);
|
||||
static void ov5_021DF910(UnkStruct_ov5_021DF8FC *graphicsManager, u32 objectID);
|
||||
static UnkStruct_ov5_021DF84C *ov5_021DF930(UnkStruct_ov5_021DF8FC *graphicsManager, u32 objectID, void *modelData, UnkStruct_02024184 *textureData, void *textureResource, TextureResource *texture, const UnkStruct_020217F4 *effectData);
|
||||
static void ov5_021DFA88(UnkStruct_ov5_021DF47C *renderManager, u32 slotID, TextureResourceManager *textureManager);
|
||||
static void ov5_021DFAC0(SysTask *param0, void *param1);
|
||||
static void ov5_021DFADC(SysTask *param0, void *param1);
|
||||
|
||||
|
|
@ -135,27 +135,27 @@ void ov5_021DF488(UnkStruct_ov5_021DF47C *param0, u32 heapID, u32 param2, u32 pa
|
|||
ov5_021DF754(param0, heapID, param2, param3, param4, param5, param6, param7, param8);
|
||||
}
|
||||
|
||||
void ov5_021DF4A8(UnkStruct_ov5_021DF47C *param0, u32 param1)
|
||||
void ov5_021DF4A8(UnkStruct_ov5_021DF47C *renderManager, u32 objectID)
|
||||
{
|
||||
if (ov5_021DF694(param0, param1) != NULL) {
|
||||
if (ov5_021DF694(renderManager, objectID) != NULL) {
|
||||
GF_ASSERT(FALSE);
|
||||
return;
|
||||
}
|
||||
|
||||
ov5_021DF600(param0, param1);
|
||||
ov5_021DF600(renderManager, objectID);
|
||||
}
|
||||
|
||||
void ov5_021DF4C8(UnkStruct_ov5_021DF47C *param0, const u32 *param1)
|
||||
void ov5_021DF4C8(UnkStruct_ov5_021DF47C *renderManager, const u32 *param1)
|
||||
{
|
||||
while ((*param1) != 34) {
|
||||
ov5_021DF4A8(param0, (*param1));
|
||||
ov5_021DF4A8(renderManager, (*param1));
|
||||
param1++;
|
||||
}
|
||||
}
|
||||
|
||||
int ov5_021DF4E4(UnkStruct_ov5_021DF47C *param0, u32 param1)
|
||||
int ov5_021DF4E4(UnkStruct_ov5_021DF47C *renderManager, u32 objectID)
|
||||
{
|
||||
if (ov5_021DF694(param0, param1) == NULL) {
|
||||
if (ov5_021DF694(renderManager, objectID) == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -203,9 +203,9 @@ void ov5_021DF554(void *param0)
|
|||
Heap_Free(param0);
|
||||
}
|
||||
|
||||
void *ov5_021DF55C(UnkStruct_ov5_021DF47C *param0, u32 param1)
|
||||
void *ov5_021DF55C(UnkStruct_ov5_021DF47C *renderManager, u32 objectID)
|
||||
{
|
||||
UnkStruct_ov5_021DF6AC *v0 = ov5_021DF694(param0, param1);
|
||||
UnkStruct_ov5_021DF6AC *v0 = ov5_021DF694(renderManager, objectID);
|
||||
|
||||
if (v0 == NULL) {
|
||||
GF_ASSERT(0);
|
||||
|
|
@ -220,9 +220,9 @@ FieldSystem *ov5_021DF574(const UnkStruct_ov5_021DF47C *param0)
|
|||
return param0->fieldSystem;
|
||||
}
|
||||
|
||||
UnkStruct_ov5_021DF47C *ov5_021DF578(const MapObject *param0)
|
||||
UnkStruct_ov5_021DF47C *ov5_021DF578(const MapObject *mapObject)
|
||||
{
|
||||
FieldSystem *fieldSystem = MapObject_FieldSystem(param0);
|
||||
FieldSystem *fieldSystem = MapObject_FieldSystem(mapObject);
|
||||
return (UnkStruct_ov5_021DF47C *)fieldSystem->unk_40;
|
||||
}
|
||||
|
||||
|
|
@ -274,13 +274,13 @@ static void ov5_021DF5E8(UnkStruct_ov5_021DF47C *param0)
|
|||
}
|
||||
}
|
||||
|
||||
static void ov5_021DF600(UnkStruct_ov5_021DF47C *param0, u32 param1)
|
||||
static void ov5_021DF600(UnkStruct_ov5_021DF47C *renderManager, u32 objectID)
|
||||
{
|
||||
const UnkStruct_ov5_021FF85C *v0 = ov5_021DF6D0(param1);
|
||||
void *v1 = v0->unk_04(param0);
|
||||
UnkStruct_ov5_021DF6AC *v2 = ov5_021DF66C(param0);
|
||||
const UnkStruct_ov5_021FF85C *v0 = ov5_021DF6D0(objectID);
|
||||
void *v1 = v0->unk_04(renderManager);
|
||||
UnkStruct_ov5_021DF6AC *v2 = ov5_021DF66C(renderManager);
|
||||
|
||||
ov5_021DF6B8(v2, param1, v1);
|
||||
ov5_021DF6B8(v2, objectID, v1);
|
||||
}
|
||||
|
||||
static void ov5_021DF628(UnkStruct_ov5_021DF47C *param0, UnkStruct_ov5_021DF6AC *param1)
|
||||
|
|
@ -324,13 +324,13 @@ static UnkStruct_ov5_021DF6AC *ov5_021DF66C(UnkStruct_ov5_021DF47C *param0)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static UnkStruct_ov5_021DF6AC *ov5_021DF694(UnkStruct_ov5_021DF47C *param0, u32 param1)
|
||||
static UnkStruct_ov5_021DF6AC *ov5_021DF694(UnkStruct_ov5_021DF47C *renderManager, u32 objectID)
|
||||
{
|
||||
u32 v0 = param0->unk_04;
|
||||
UnkStruct_ov5_021DF6AC *v1 = param0->unk_14;
|
||||
u32 v0 = renderManager->unk_04;
|
||||
UnkStruct_ov5_021DF6AC *v1 = renderManager->unk_14;
|
||||
|
||||
while (v0) {
|
||||
if (v1->unk_00 == param1) {
|
||||
if (v1->unk_00 == objectID) {
|
||||
return v1;
|
||||
}
|
||||
|
||||
|
|
@ -621,59 +621,59 @@ static UnkStruct_ov5_021DF84C *ov5_021DF9B4(UnkStruct_ov5_021DF8FC *param0, u32
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void ov5_021DF9D4(UnkStruct_ov5_021DF47C *param0, u32 param1)
|
||||
void ov5_021DF9D4(UnkStruct_ov5_021DF47C *renderManager, u32 slotID)
|
||||
{
|
||||
UnkStruct_ov5_021DF8FC *v0 = param0->unk_20;
|
||||
ov5_021DF910(v0, param1);
|
||||
UnkStruct_ov5_021DF8FC *v0 = renderManager->unk_20;
|
||||
ov5_021DF910(v0, slotID);
|
||||
}
|
||||
|
||||
void ov5_021DF9E0(UnkStruct_ov5_021DF47C *param0, u32 param1, u32 param2)
|
||||
void ov5_021DF9E0(UnkStruct_ov5_021DF47C *renderManager, u32 slotID, u32 resourceID)
|
||||
{
|
||||
UnkStruct_ov5_021DF8FC *v0 = param0->unk_20;
|
||||
UnkStruct_ov5_021DF8FC *v0 = renderManager->unk_20;
|
||||
|
||||
ov5_021F0784(v0->unk_10, param1, param0->unk_18, param2, 0);
|
||||
ov5_021F0784(v0->unk_10, slotID, renderManager->unk_18, resourceID, 0);
|
||||
}
|
||||
|
||||
void *ov5_021DF9FC(UnkStruct_ov5_021DF47C *param0, u32 param1)
|
||||
void *ov5_021DF9FC(UnkStruct_ov5_021DF47C *renderManager, u32 slotID)
|
||||
{
|
||||
UnkStruct_ov5_021DF8FC *v0 = param0->unk_20;
|
||||
void *v1 = ov5_021F075C(v0->unk_10, param1);
|
||||
UnkStruct_ov5_021DF8FC *v0 = renderManager->unk_20;
|
||||
void *v1 = ov5_021F075C(v0->unk_10, slotID);
|
||||
|
||||
return v1;
|
||||
}
|
||||
|
||||
void ov5_021DFA08(UnkStruct_ov5_021DF47C *param0, u32 param1)
|
||||
void ov5_021DFA08(UnkStruct_ov5_021DF47C *renderManager, u32 slotID)
|
||||
{
|
||||
UnkStruct_ov5_021DF8FC *v0 = param0->unk_20;
|
||||
ov5_021F0740(v0->unk_10, param1);
|
||||
UnkStruct_ov5_021DF8FC *v0 = renderManager->unk_20;
|
||||
ov5_021F0740(v0->unk_10, slotID);
|
||||
}
|
||||
|
||||
void ov5_021DFA14(UnkStruct_ov5_021DF47C *param0, u32 param1, u32 param2)
|
||||
void ov5_021DFA14(UnkStruct_ov5_021DF47C *renderManager, u32 slotID, u32 resourceID)
|
||||
{
|
||||
UnkStruct_ov5_021DF8FC *v0 = param0->unk_20;
|
||||
ov5_021F0784(v0->unk_14, param1, param0->unk_18, param2, 0);
|
||||
UnkStruct_ov5_021DF8FC *v0 = renderManager->unk_20;
|
||||
ov5_021F0784(v0->unk_14, slotID, renderManager->unk_18, resourceID, 0);
|
||||
}
|
||||
|
||||
void ov5_021DFA30(UnkStruct_ov5_021DF47C *param0, u32 param1)
|
||||
void ov5_021DFA30(UnkStruct_ov5_021DF47C *renderManager, u32 slotID)
|
||||
{
|
||||
UnkStruct_ov5_021DF8FC *v0 = param0->unk_20;
|
||||
ov5_021F0740(v0->unk_14, param1);
|
||||
UnkStruct_ov5_021DF8FC *v0 = renderManager->unk_20;
|
||||
ov5_021F0740(v0->unk_14, slotID);
|
||||
}
|
||||
|
||||
void ov5_021DFA3C(UnkStruct_ov5_021DF47C *param0, u32 param1, u32 param2, u32 param3)
|
||||
void ov5_021DFA3C(UnkStruct_ov5_021DF47C *renderManager, u32 slotID, u32 param2, u32 param3)
|
||||
{
|
||||
UnkStruct_ov5_021DF8FC *v0 = param0->unk_20;
|
||||
void *v1 = ov5_021DF5C0(param0, param2, 1);
|
||||
TextureResource *v2 = TextureResourceManager_AddTextureAndAllocVRam(v0->unk_18, v1, param1, param3, ov5_021DF584(param0));
|
||||
UnkStruct_ov5_021DF8FC *v0 = renderManager->unk_20;
|
||||
void *v1 = ov5_021DF5C0(renderManager, param2, 1);
|
||||
TextureResource *v2 = TextureResourceManager_AddTextureAndAllocVRam(v0->unk_18, v1, slotID, param3, ov5_021DF584(renderManager));
|
||||
|
||||
GF_ASSERT(v2 != NULL);
|
||||
ov5_021DFA88(param0, param1, v0->unk_18);
|
||||
ov5_021DFA88(renderManager, slotID, v0->unk_18);
|
||||
}
|
||||
|
||||
void ov5_021DFA7C(UnkStruct_ov5_021DF47C *param0, u32 param1)
|
||||
void ov5_021DFA7C(UnkStruct_ov5_021DF47C *renderManager, u32 slotID)
|
||||
{
|
||||
UnkStruct_ov5_021DF8FC *v0 = param0->unk_20;
|
||||
TextureResourceManager_RemoveTextureWithID(v0->unk_18, param1);
|
||||
UnkStruct_ov5_021DF8FC *v0 = renderManager->unk_20;
|
||||
TextureResourceManager_RemoveTextureWithID(v0->unk_18, slotID);
|
||||
}
|
||||
|
||||
static void ov5_021DFA88(UnkStruct_ov5_021DF47C *param0, u32 param1, TextureResourceManager *param2)
|
||||
|
|
|
|||
|
|
@ -1,368 +0,0 @@
|
|||
#include "overlay005/ov5_021F204C.h"
|
||||
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_020216E0_decl.h"
|
||||
#include "struct_decls/struct_02061AB4_decl.h"
|
||||
#include "struct_defs/struct_020217F4.h"
|
||||
#include "struct_defs/struct_02073838.h"
|
||||
#include "struct_defs/struct_02073B50.h"
|
||||
|
||||
#include "overlay005/ov5_021DF440.h"
|
||||
#include "overlay005/ov5_021ECC20.h"
|
||||
#include "overlay005/struct_ov5_021DF47C_decl.h"
|
||||
#include "overlay101/struct_ov101_021D5D90_decl.h"
|
||||
#include "overlay101/struct_ov101_021D86B0.h"
|
||||
|
||||
#include "berry_patch_manager.h"
|
||||
#include "map_object.h"
|
||||
#include "unk_02020AEC.h"
|
||||
#include "unk_020711EC.h"
|
||||
#include "unk_02073838.h"
|
||||
|
||||
typedef struct {
|
||||
UnkStruct_ov5_021DF47C *unk_00;
|
||||
UnkStruct_02073B50 unk_04[3];
|
||||
UnkStruct_02073838 unk_100[3];
|
||||
} UnkStruct_ov5_021F2078;
|
||||
|
||||
typedef struct {
|
||||
UnkStruct_ov5_021DF47C *unk_00;
|
||||
UnkStruct_ov5_021F2078 *unk_04;
|
||||
MapObject *unk_08;
|
||||
} UnkStruct_ov5_021F20D4;
|
||||
|
||||
typedef struct {
|
||||
int unk_00;
|
||||
int unk_04;
|
||||
int unk_08;
|
||||
int unk_0C;
|
||||
UnkStruct_ov5_021F20D4 unk_10;
|
||||
} UnkStruct_ov5_021F2118;
|
||||
|
||||
typedef struct {
|
||||
int unk_00;
|
||||
int unk_04;
|
||||
UnkStruct_ov5_021DF47C *unk_08;
|
||||
} UnkStruct_ov5_021F2204;
|
||||
|
||||
typedef struct {
|
||||
UnkStruct_ov5_021DF47C *unk_00;
|
||||
UnkStruct_ov5_021F2204 *unk_04;
|
||||
MapObject *unk_08;
|
||||
} UnkStruct_ov5_021F22BC;
|
||||
|
||||
typedef struct {
|
||||
int unk_00;
|
||||
int unk_04;
|
||||
int unk_08;
|
||||
UnkStruct_ov5_021F22BC unk_0C;
|
||||
UnkStruct_020216E0 *unk_18;
|
||||
} UnkStruct_ov5_021F2304;
|
||||
|
||||
static void ov5_021F2078(UnkStruct_ov5_021F2078 *param0);
|
||||
static void ov5_021F20B8(UnkStruct_ov5_021F2078 *param0);
|
||||
static void ov5_021F2204(UnkStruct_ov5_021F2204 *param0);
|
||||
static void ov5_021F220C(UnkStruct_ov5_021F2204 *param0);
|
||||
static void ov5_021F221C(UnkStruct_ov5_021F2204 *param0);
|
||||
static void ov5_021F226C(UnkStruct_ov5_021F2204 *param0);
|
||||
static void ov5_021F229C(UnkStruct_ov5_021F2204 *param0);
|
||||
static void ov5_021F22AC(UnkStruct_ov5_021F2204 *param0);
|
||||
|
||||
static const UnkStruct_ov101_021D86B0 Unk_ov5_02200438;
|
||||
static const UnkStruct_ov101_021D86B0 Unk_ov5_02200410;
|
||||
static const u32 Unk_ov5_02200404[3];
|
||||
const UnkStruct_020217F4 Unk_ov5_0220044C[];
|
||||
|
||||
void *ov5_021F204C(UnkStruct_ov5_021DF47C *param0)
|
||||
{
|
||||
UnkStruct_ov5_021F2078 *v0 = ov5_021DF53C(param0, sizeof(UnkStruct_ov5_021F2078), 0, 0);
|
||||
v0->unk_00 = param0;
|
||||
|
||||
ov5_021F2078(v0);
|
||||
return v0;
|
||||
}
|
||||
|
||||
void ov5_021F2068(void *param0)
|
||||
{
|
||||
UnkStruct_ov5_021F2078 *v0 = param0;
|
||||
|
||||
ov5_021F20B8(v0);
|
||||
ov5_021DF554(v0);
|
||||
}
|
||||
|
||||
static void ov5_021F2078(UnkStruct_ov5_021F2078 *param0)
|
||||
{
|
||||
int v0 = 0;
|
||||
|
||||
do {
|
||||
ov5_021DFB00(
|
||||
param0->unk_00, ¶m0->unk_100[v0], 0, Unk_ov5_02200404[v0], 0);
|
||||
sub_02073B70(¶m0->unk_04[v0], ¶m0->unk_100[v0]);
|
||||
v0++;
|
||||
} while (v0 < (2 + 1));
|
||||
}
|
||||
|
||||
static void ov5_021F20B8(UnkStruct_ov5_021F2078 *param0)
|
||||
{
|
||||
int v0 = 0;
|
||||
|
||||
do {
|
||||
sub_0207395C(¶m0->unk_100[v0]);
|
||||
v0++;
|
||||
} while (v0 < (2 + 1));
|
||||
}
|
||||
|
||||
void ov5_021F20D4(MapObject *param0)
|
||||
{
|
||||
int v0, v1;
|
||||
UnkStruct_ov5_021F20D4 v2;
|
||||
UnkStruct_ov5_021DF47C *v3;
|
||||
VecFx32 v4;
|
||||
|
||||
v3 = ov5_021DF578(param0);
|
||||
|
||||
v2.unk_00 = v3;
|
||||
v2.unk_04 = ov5_021DF55C(v3, 12);
|
||||
v2.unk_08 = param0;
|
||||
|
||||
MapObject_GetPosPtr(param0, &v4);
|
||||
|
||||
v0 = 0;
|
||||
v1 = sub_02062C0C(param0) + 1;
|
||||
|
||||
ov5_021DF72C(v3, &Unk_ov5_02200438, &v4, v0, &v2, v1);
|
||||
}
|
||||
|
||||
static int ov5_021F2118(UnkStruct_ov101_021D5D90 *param0, void *param1)
|
||||
{
|
||||
UnkStruct_ov5_021F2118 *v0;
|
||||
const UnkStruct_ov5_021F20D4 *v1;
|
||||
|
||||
v0 = param1;
|
||||
v1 = sub_020715BC(param0);
|
||||
|
||||
v0->unk_10 = *v1;
|
||||
v0->unk_00 = MapObject_GetLocalID(v0->unk_10.unk_08);
|
||||
v0->unk_04 = sub_02062918(v0->unk_10.unk_08);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void ov5_021F2144(UnkStruct_ov101_021D5D90 *param0, void *param1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static void BerryPatchGraphicsEffect_Update(UnkStruct_ov101_021D5D90 *effectTask, void *effectData)
|
||||
{
|
||||
UnkStruct_ov5_021F2118 *berryPatchEffect = effectData;
|
||||
MapObject *mapObject = berryPatchEffect->unk_10.unk_08;
|
||||
|
||||
if (sub_02062764(mapObject, berryPatchEffect->unk_00, berryPatchEffect->unk_04) == 0) {
|
||||
ov5_021DF74C(effectTask);
|
||||
return;
|
||||
}
|
||||
|
||||
berryPatchEffect->unk_08 = 0;
|
||||
|
||||
if ((MapObject_CheckStatusFlag(mapObject, MAP_OBJ_STATUS_HIDE) == 1) || (!BerryPatches_GetGrowthStage(MapObject_FieldSystem(mapObject), mapObject))) {
|
||||
berryPatchEffect->unk_08 = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
berryPatchEffect->unk_0C = BerryPatches_GetMoisture(MapObject_FieldSystem(mapObject), mapObject);
|
||||
}
|
||||
|
||||
{
|
||||
VecFx32 mapObjectPosition;
|
||||
|
||||
MapObject_GetPosPtr(mapObject, &mapObjectPosition);
|
||||
sub_020715D4(effectTask, &mapObjectPosition);
|
||||
}
|
||||
}
|
||||
|
||||
static void BerryPatchGraphicsEffect_Render(UnkStruct_ov101_021D5D90 *effectTask, void *effectData)
|
||||
{
|
||||
UnkStruct_ov5_021F2118 *berryPatchEffect = effectData;
|
||||
|
||||
if (berryPatchEffect->unk_08 != 1) {
|
||||
VecFx32 effectPosition;
|
||||
|
||||
sub_020715E4(effectTask, &effectPosition);
|
||||
effectPosition.z += (FX32_ONE * 0);
|
||||
sub_02073BB4(&berryPatchEffect->unk_10.unk_04->unk_04[berryPatchEffect->unk_0C], &effectPosition);
|
||||
}
|
||||
}
|
||||
|
||||
static const UnkStruct_ov101_021D86B0 Unk_ov5_02200438 = {
|
||||
sizeof(UnkStruct_ov5_021F2118),
|
||||
ov5_021F2118,
|
||||
ov5_021F2144,
|
||||
BerryPatchGraphicsEffect_Update,
|
||||
BerryPatchGraphicsEffect_Render
|
||||
};
|
||||
|
||||
void *ov5_021F21E0(UnkStruct_ov5_021DF47C *param0)
|
||||
{
|
||||
UnkStruct_ov5_021F2204 *v0 = ov5_021DF53C(param0, sizeof(UnkStruct_ov5_021F2204), 0, 0);
|
||||
v0->unk_08 = param0;
|
||||
|
||||
return v0;
|
||||
}
|
||||
|
||||
void ov5_021F21F4(void *param0)
|
||||
{
|
||||
UnkStruct_ov5_021F2204 *v0 = param0;
|
||||
|
||||
ov5_021F226C(v0);
|
||||
ov5_021DF554(v0);
|
||||
}
|
||||
|
||||
static void ov5_021F2204(UnkStruct_ov5_021F2204 *param0)
|
||||
{
|
||||
param0->unk_00++;
|
||||
}
|
||||
|
||||
static void ov5_021F220C(UnkStruct_ov5_021F2204 *param0)
|
||||
{
|
||||
param0->unk_00--;
|
||||
GF_ASSERT(param0->unk_00 >= 0);
|
||||
}
|
||||
|
||||
static void ov5_021F221C(UnkStruct_ov5_021F2204 *param0)
|
||||
{
|
||||
if (param0->unk_04 == 0) {
|
||||
param0->unk_04 = 1;
|
||||
ov5_021DF9E0(param0->unk_08, 11, 109);
|
||||
ov5_021DFA14(param0->unk_08, 11, 181);
|
||||
ov5_021DFA3C(param0->unk_08, 12, 14, 1);
|
||||
ov5_021DF864(param0->unk_08, 13, 11, 11, 12, 0, Unk_ov5_0220044C);
|
||||
}
|
||||
}
|
||||
|
||||
static void ov5_021F226C(UnkStruct_ov5_021F2204 *param0)
|
||||
{
|
||||
if (param0->unk_04 == 1) {
|
||||
param0->unk_04 = 0;
|
||||
|
||||
ov5_021DFA08(param0->unk_08, 11);
|
||||
ov5_021DFA30(param0->unk_08, 11);
|
||||
ov5_021DFA7C(param0->unk_08, 12);
|
||||
ov5_021DF9D4(param0->unk_08, 13);
|
||||
}
|
||||
}
|
||||
|
||||
static void ov5_021F229C(UnkStruct_ov5_021F2204 *param0)
|
||||
{
|
||||
if (param0->unk_00 == 0) {
|
||||
ov5_021F221C(param0);
|
||||
}
|
||||
}
|
||||
|
||||
static void ov5_021F22AC(UnkStruct_ov5_021F2204 *param0)
|
||||
{
|
||||
if (param0->unk_00 == 0) {
|
||||
ov5_021F226C(param0);
|
||||
}
|
||||
}
|
||||
|
||||
UnkStruct_ov101_021D5D90 *ov5_021F22BC(MapObject *param0)
|
||||
{
|
||||
VecFx32 v0;
|
||||
UnkStruct_ov5_021DF47C *v1;
|
||||
UnkStruct_ov5_021F22BC v2;
|
||||
UnkStruct_ov101_021D5D90 *v3;
|
||||
|
||||
v1 = ov5_021DF578(param0);
|
||||
ov5_021ECDA0(param0, &v0);
|
||||
v0.z += (FX32_ONE * 8);
|
||||
|
||||
v2.unk_00 = v1;
|
||||
v2.unk_04 = ov5_021DF55C(v1, 28);
|
||||
v3 = ov5_021DF72C(v1, &Unk_ov5_02200410, &v0, 0, &v2, 0xff);
|
||||
|
||||
return v3;
|
||||
}
|
||||
|
||||
static int ov5_021F2304(UnkStruct_ov101_021D5D90 *param0, void *param1)
|
||||
{
|
||||
VecFx32 v0;
|
||||
UnkStruct_ov5_021F2304 *v1;
|
||||
const UnkStruct_ov5_021F22BC *v2;
|
||||
|
||||
v1 = param1;
|
||||
v2 = sub_020715BC(param0);
|
||||
v1->unk_0C = *v2;
|
||||
|
||||
ov5_021F229C(v1->unk_0C.unk_04);
|
||||
sub_020715E4(param0, &v0);
|
||||
|
||||
v1->unk_18 = ov5_021DF84C(v1->unk_0C.unk_00, 13, &v0);
|
||||
ov5_021F2204(v1->unk_0C.unk_04);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void ov5_021F2344(UnkStruct_ov101_021D5D90 *param0, void *param1)
|
||||
{
|
||||
UnkStruct_ov5_021F2304 *v0 = param1;
|
||||
|
||||
sub_020211FC(v0->unk_18);
|
||||
ov5_021F220C(v0->unk_0C.unk_04);
|
||||
ov5_021F22AC(v0->unk_0C.unk_04);
|
||||
}
|
||||
|
||||
static void ov5_021F235C(UnkStruct_ov101_021D5D90 *param0, void *param1)
|
||||
{
|
||||
fx32 v0[5] = { 0x1000, 0x1000, 0x2000, 0x2000, 0x1000 };
|
||||
UnkStruct_ov5_021F2304 *v1 = param1;
|
||||
|
||||
if (v1->unk_08 == 1) {
|
||||
v1->unk_08 = 0;
|
||||
v1->unk_04++;
|
||||
|
||||
if (v1->unk_04 >= 5) {
|
||||
ov5_021DF74C(param0);
|
||||
return;
|
||||
}
|
||||
|
||||
sub_02021380(v1->unk_18, 0);
|
||||
}
|
||||
|
||||
if (sub_02021368(v1->unk_18, v0[v1->unk_04]) != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
v1->unk_08 = 1;
|
||||
}
|
||||
|
||||
static void ov5_021F23B8(UnkStruct_ov101_021D5D90 *param0, void *param1)
|
||||
{
|
||||
VecFx32 v0;
|
||||
UnkStruct_ov5_021F2304 *v1 = param1;
|
||||
|
||||
sub_020715E4(param0, &v0);
|
||||
sub_020212A8(v1->unk_18, &v0);
|
||||
}
|
||||
|
||||
static const UnkStruct_ov101_021D86B0 Unk_ov5_02200410 = {
|
||||
sizeof(UnkStruct_ov5_021F2304),
|
||||
ov5_021F2304,
|
||||
ov5_021F2344,
|
||||
ov5_021F235C,
|
||||
ov5_021F23B8
|
||||
};
|
||||
|
||||
static const u32 Unk_ov5_02200404[3] = {
|
||||
0x4D,
|
||||
0x4C,
|
||||
0x4B
|
||||
};
|
||||
|
||||
static const UnkStruct_020217F4 Unk_ov5_0220044C[] = {
|
||||
{ 0x0, 0x9, 0x1 },
|
||||
{ 0x0, 0x0, 0x2 }
|
||||
};
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "overlay005/berry_patch_effects.h"
|
||||
#include "overlay005/const_ov5_021FF6B8.h"
|
||||
#include "overlay005/const_ov5_021FF744.h"
|
||||
#include "overlay005/const_ov5_021FF7D0.h"
|
||||
|
|
@ -9,7 +10,6 @@
|
|||
#include "overlay005/ov5_021F134C.h"
|
||||
#include "overlay005/ov5_021F17B8.h"
|
||||
#include "overlay005/ov5_021F1CC8.h"
|
||||
#include "overlay005/ov5_021F204C.h"
|
||||
#include "overlay005/ov5_021F23D0.h"
|
||||
#include "overlay005/ov5_021F25C0.h"
|
||||
#include "overlay005/ov5_021F2850.h"
|
||||
|
|
@ -53,7 +53,7 @@ const UnkStruct_ov5_021FF85C Unk_ov5_021FF85C[35] = {
|
|||
{ 0x9, ov5_021F575C, ov5_021F5778 },
|
||||
{ 0xA, ov5_021F5894, ov5_021F58B0 },
|
||||
{ 0xB, ov5_021F1CC8, ov5_021F1CE8 },
|
||||
{ 0xC, ov5_021F204C, ov5_021F2068 },
|
||||
{ 0xC, BerryPatchGraphicsManager_New, BerryPatchGraphicsManager_Free },
|
||||
{ 0xD, ov5_021F23D0, ov5_021F23EC },
|
||||
{ 0xE, ov5_021F61BC, ov5_021F61D8 },
|
||||
{ 0xF, ov5_021F25C0, ov5_021F25DC },
|
||||
|
|
@ -69,7 +69,7 @@ const UnkStruct_ov5_021FF85C Unk_ov5_021FF85C[35] = {
|
|||
{ 0x19, ov5_021F3A50, ov5_021F3A6C },
|
||||
{ 0x1A, ov5_021F3D00, ov5_021F3D1C },
|
||||
{ 0x1B, ov5_021F3E74, ov5_021F3E90 },
|
||||
{ 0x1C, ov5_021F21E0, ov5_021F21F4 },
|
||||
{ 0x1C, BerryPatchGraphicsManager_NewEffectCounter, BerryPatchGraphicsManager_FreeEffectCounter },
|
||||
{ 0x1D, ov5_021F10E8, ov5_021F10FC },
|
||||
{ 0x1E, ov5_021F4018, ov5_021F4034 },
|
||||
{ 0x1F, ov5_021F428C, ov5_021F42A8 },
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user