Address review comments

This commit is contained in:
PikalaxALT 2023-12-31 08:06:57 -05:00
parent 30eb437fb6
commit 372ca5e4af
No known key found for this signature in database
GPG Key ID: C7E3D40F3BAC7AEB
4 changed files with 38 additions and 39 deletions

View File

@ -177,7 +177,7 @@ typedef enum NarcId
NARC_poketool_personal_performance = 169,
NARC_a_1_7_0 = 170,
NARC_a_1_7_1 = 171,
NARC_files_application_annon_puzzle_gra = 172,
NARC_application_annon_puzzle_gra = 172,
NARC_a_1_7_3 = 173,
NARC_a_1_7_4 = 174,
NARC_data_resdat = 175,

View File

@ -40,15 +40,15 @@ typedef struct YesNoPromptState {
u8 unk76_4 : 4;
u8 unk77_0 : 4;
u8 unk77_4 : 4;
} YesNoPromptState;
} YesNoPrompt;
YesNoPromptState *YesNoPrompt_Create(HeapID);
void YesNoPrompt_Destroy(YesNoPromptState *);
void sub_020169CC(YesNoPromptState *);
void YesNoPrompt_InitFromTemplate(YesNoPromptState *, const YesNoPromptTemplate *);
void YesNoPrompt_InitFromTemplateWithPalette(YesNoPromptState *, const YesNoPromptTemplate *, PaletteData *);
u32 sub_02016748(YesNoPromptState *);
int YesNoPrompt_HandleInput(YesNoPromptState *);
int sub_020169C0(YesNoPromptState *);
YesNoPrompt *YesNoPrompt_Create(HeapID);
void YesNoPrompt_Destroy(YesNoPrompt *);
void sub_020169CC(YesNoPrompt *);
void YesNoPrompt_InitFromTemplate(YesNoPrompt *, const YesNoPromptTemplate *);
void YesNoPrompt_InitFromTemplateWithPalette(YesNoPrompt *, const YesNoPromptTemplate *, PaletteData *);
u32 sub_02016748(YesNoPrompt *);
int YesNoPrompt_HandleInput(YesNoPrompt *);
int sub_020169C0(YesNoPrompt *);
#endif //POKEHEARTGOLD_UNK_0201660C_H

View File

@ -125,7 +125,7 @@ typedef struct AlphPuzzleData {
String *hintText[ALPH_PUZZLE_MAX];
String *confirmQuitText[1];
Window window[3];
YesNoPromptState *yesNoPrompt;
YesNoPrompt *yesNoPrompt;
PaletteData *palette;
SpriteRenderer *spriteRenderer;
void *spriteGfxHandler;
@ -174,15 +174,15 @@ static void AlphPuzzle_SetGraphicsBanks();
static void AlphPuzzle_AllocBackgroundBuffers(AlphPuzzleData *data);
static void AlphPuzzle_FreeBackgroundBuffers(AlphPuzzleData *data);
static void AlphPuzzle_LoadBackgroundGraphics(AlphPuzzleData *data);
static void AlphPuzzle_UnloadBackgroundGraphics(AlphPuzzleData *data);
static void AlphPuzzle_FreeBackgroundGraphics(AlphPuzzleData *data);
static void AlphPuzzle_InitText(AlphPuzzleData *data);
static void AlphPuzzle_DeleteText(AlphPuzzleData *data);
static void AlphPuzzle_CreateWindows(AlphPuzzleData *data);
static void AlphPuzzle_DestroyWindows(AlphPuzzleData *data);
static void AlphPuzzle_CreateSpriteGraphicsEngine(AlphPuzzleData *data);
static void AlphPuzzle_DestroySpriteGraphicsEngine(AlphPuzzleData *data);
static void AlphPuzzle_InitSpriteGraphics(AlphPuzzleData *data);
static void AlphPuzzle_DeinitSpriteGraphics(AlphPuzzleData *data);
static void AlphPuzzle_DestroySpriteGraphicsEngine(AlphPuzzleData *data);
static void AlphPuzzle_CreateSpriteGraphics(AlphPuzzleData *data);
static void AlphPuzzle_DeleteSpriteGraphics(AlphPuzzleData *data);
static void AlphPuzzle_CreateSprites(AlphPuzzleData *data);
static void AlphPuzzle_DeleteSprites(AlphPuzzleData *data);
static BOOL AlphPuzzle_CheckComplete(AlphPuzzleData *data);
@ -485,7 +485,6 @@ static const UnkStruct_0200D2B4 sSpriteTemplates[3] = {
{ALPH_SPRITE_RES_PUZZLETILES, 208, 168, 0, 0, 2, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 1, 0, 0, 0}
};
// related to text color
static const u32 sQuitButtonTextColors[3] = {
MAKE_TEXT_COLOR(1, 2, 0),
MAKE_TEXT_COLOR(3, 4, 0),
@ -672,15 +671,15 @@ static void AlphPuzzle_SetupGraphics(AlphPuzzleData *data) {
AlphPuzzle_LoadBackgroundGraphics(data);
AlphPuzzle_InitText(data);
AlphPuzzle_CreateWindows(data);
AlphPuzzle_InitSpriteGraphics(data);
AlphPuzzle_CreateSpriteGraphics(data);
Main_SetVBlankIntrCB(AlphPuzzle_VBlankCB, data);
}
static void AlphPuzzle_TeardownGraphics(AlphPuzzleData *data) {
AlphPuzzle_DeinitSpriteGraphics(data);
AlphPuzzle_DeleteSpriteGraphics(data);
AlphPuzzle_DestroyWindows(data);
AlphPuzzle_DeleteText(data);
AlphPuzzle_UnloadBackgroundGraphics(data);
AlphPuzzle_FreeBackgroundGraphics(data);
AlphPuzzle_FreeBackgroundBuffers(data);
}
@ -1030,7 +1029,7 @@ static void AlphPuzzle_FreeBackgroundBuffers(AlphPuzzleData *data) {
}
static void AlphPuzzle_LoadBackgroundGraphics(AlphPuzzleData *data) {
NARC *narc = NARC_New(NARC_files_application_annon_puzzle_gra, data->heapId);
NARC *narc = NARC_New(NARC_application_annon_puzzle_gra, data->heapId);
data->palette = PaletteData_Init(data->heapId);
PaletteData_AllocBuffers(data->palette, 0, 256, data->heapId);
@ -1059,7 +1058,7 @@ static void AlphPuzzle_LoadBackgroundGraphics(AlphPuzzleData *data) {
sub_0200398C(data->palette);
}
static void AlphPuzzle_UnloadBackgroundGraphics(AlphPuzzleData *data) {
static void AlphPuzzle_FreeBackgroundGraphics(AlphPuzzleData *data) {
FreeToHeap(data->screenDataAlloc);
PaletteData_FreeBuffers(data->palette, 2);
PaletteData_FreeBuffers(data->palette, 1);
@ -1111,7 +1110,7 @@ static void AlphPuzzle_DestroyWindows(AlphPuzzleData *data) {
YesNoPrompt_Destroy(data->yesNoPrompt);
}
static void AlphPuzzle_CreateSpriteGraphicsEngine(AlphPuzzleData *data) {
static void AlphPuzzle_InitSpriteGraphics(AlphPuzzleData *data) {
GF_CreateVramTransferManager(32, data->heapId);
data->spriteRenderer = SpriteRenderer_Create(data->heapId);
sub_0200CF70(data->spriteRenderer, &ov110_021E6EA4, &ov110_021E6DD0, 3);
@ -1131,13 +1130,13 @@ static void AlphPuzzle_DestroySpriteGraphicsEngine(AlphPuzzleData *data) {
sub_0200B2E0(data->heapId);
}
static void AlphPuzzle_InitSpriteGraphics(AlphPuzzleData *data) {
AlphPuzzle_CreateSpriteGraphicsEngine(data);
static void AlphPuzzle_CreateSpriteGraphics(AlphPuzzleData *data) {
AlphPuzzle_InitSpriteGraphics(data);
AlphPuzzle_CreateSprites(data);
GfGfx_EngineATogglePlanes(GX_PLANEMASK_OBJ, GF_PLANE_TOGGLE_ON);
}
static void AlphPuzzle_DeinitSpriteGraphics(AlphPuzzleData *data) {
static void AlphPuzzle_DeleteSpriteGraphics(AlphPuzzleData *data) {
GfGfx_EngineATogglePlanes(GX_PLANEMASK_OBJ, GF_PLANE_TOGGLE_OFF);
AlphPuzzle_DeleteSprites(data);
AlphPuzzle_DestroySpriteGraphicsEngine(data);
@ -1155,7 +1154,7 @@ static void AlphPuzzle_CreateSprites(AlphPuzzleData *data) {
sub_02024B78(data->sprites[ALPH_SPRITE_INDEX_PREV_CURSOR], GX_OAM_MODE_NORMAL);
Sprite_SetPriority(data->sprites[ALPH_SPRITE_INDEX_PREV_CURSOR], 2);
sub_02024B78(data->sprites[ALPH_SPRITE_INDEX_PREV_CURSOR], GX_OAM_MODE_XLU);
sub_0200E248(data->spriteRenderer, data->spriteGfxHandler, NARC_files_application_annon_puzzle_gra, data->puzzleIndex + NARC_puzzle_gra_puzzle_gra_00000004_NCGR, 0, 1);
sub_0200E248(data->spriteRenderer, data->spriteGfxHandler, NARC_application_annon_puzzle_gra, data->puzzleIndex + NARC_puzzle_gra_puzzle_gra_00000004_NCGR, 0, 1);
for (i = 0; i < 16; i++) {
u8 index = i + ALPH_SPRITE_INDEX_TILE_00;
data->sprites[index] = SpriteRenderer_CreateSprite(data->spriteRenderer, data->spriteGfxHandler, &sSpriteTemplates[ALPH_SPRITE_INDEX_TILE_00]);

View File

@ -57,7 +57,7 @@ typedef struct TouchSaveAppData {
MessageFormat *messageFormat;
UnkStruct_field_021F4360 *unk40;
Options *options;
YesNoPromptState *unk48;
YesNoPrompt *yesnoState;
Window window;
String *string;
u32 textPrinter;
@ -311,8 +311,8 @@ static void ov30_0225D880(TouchSaveAppData *data) {
BgClearTilemapBufferAndCommit(data->bgConfig, GF_BG_LYR_SUB_2);
YesNoPromptState* unk = YesNoPrompt_Create(HEAP_ID_4);
data->unk48 = unk;
YesNoPrompt* unk = YesNoPrompt_Create(HEAP_ID_4);
data->yesnoState = unk;
YesNoPrompt_InitFromTemplate(unk, &template);
}
@ -361,10 +361,10 @@ static BOOL TouchSaveApp_GetSaveConfirmation(TouchSaveAppData *data) {
}
static BOOL TouchSaveApp_HandleSaveConfirmation(TouchSaveAppData *data) {
switch (sub_02016748(data->unk48)) {
switch (sub_02016748(data->yesnoState)) {
case 1: // Yes
ov30_0225DC00(&data->fieldSystem->unk_10C, sub_020169C0(data->unk48));
YesNoPrompt_Destroy(data->unk48);
ov30_0225DC00(&data->fieldSystem->unk_10C, sub_020169C0(data->yesnoState));
YesNoPrompt_Destroy(data->yesnoState);
if (Save_FileExists(data->fieldSystem->saveData) == TRUE) {
data->state = TOUCHSAVEAPP_STATE_PRINT_OVERWRITE_MESSAGE;
} else {
@ -372,8 +372,8 @@ static BOOL TouchSaveApp_HandleSaveConfirmation(TouchSaveAppData *data) {
}
break;
case 2: // No
ov30_0225DC00(&data->fieldSystem->unk_10C, sub_020169C0(data->unk48));
YesNoPrompt_Destroy(data->unk48);
ov30_0225DC00(&data->fieldSystem->unk_10C, sub_020169C0(data->yesnoState));
YesNoPrompt_Destroy(data->yesnoState);
return TRUE;
}
@ -397,15 +397,15 @@ static BOOL TouchSaveApp_GetOverwriteConfirmation(TouchSaveAppData *data) {
}
static BOOL TouchSaveApp_HandleOverwriteConfirmation(TouchSaveAppData *data) {
switch (sub_02016748(data->unk48)) {
switch (sub_02016748(data->yesnoState)) {
case 1: // Yes
ov30_0225DC00(&data->fieldSystem->unk_10C, sub_020169C0(data->unk48));
YesNoPrompt_Destroy(data->unk48);
ov30_0225DC00(&data->fieldSystem->unk_10C, sub_020169C0(data->yesnoState));
YesNoPrompt_Destroy(data->yesnoState);
data->state = TOUCHSAVEAPP_STATE_PRINT_SAVING_MESSAGE;
break;
case 2: // No
ov30_0225DC00(&data->fieldSystem->unk_10C, sub_020169C0(data->unk48));
YesNoPrompt_Destroy(data->unk48);
ov30_0225DC00(&data->fieldSystem->unk_10C, sub_020169C0(data->yesnoState));
YesNoPrompt_Destroy(data->yesnoState);
return TRUE;
}