-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
battle_input.c #347
base: main
Are you sure you want to change the base?
battle_input.c #347
Conversation
@@ -1,6 +1,6 @@ | |||
#ifndef POKEPLATINUM_STRUCT_OV16_02268A14_DECL_H | |||
#define POKEPLATINUM_STRUCT_OV16_02268A14_DECL_H | |||
|
|||
typedef struct UnkStruct_ov16_02268A14_t UnkStruct_ov16_02268A14; | |||
typedef struct BattleInput_t BattleInput; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
polish: Pull this (and other such structs named in this PR) out into the corresponding header, if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one specifically is defined in the c file, I can default to just putting it in battle_input.h for now
u8 ov13_02228A5C(UnkStruct_ov13_02228A50 *param0); | ||
void ov13_02228A60(UnkStruct_ov13_02228A50 *param0, u8 param1); | ||
void ov13_02228A64(UnkStruct_ov13_02228A50 *param0, UnkStruct_ov16_0226DC24 *param1); | ||
void ov13_02228A64(UnkStruct_ov13_02228A50 *param0, BattleCursor *param1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void ov13_02228A64(UnkStruct_ov13_02228A50 *param0, BattleCursor *param1); | |
void ov13_02228A64(UnkStruct_ov13_02228A50 *param0, BattleCursor *battleCursor); |
include/battle/ov16_0226DB7C.h
Outdated
void BattleCursor_LoadResources(SpriteRenderer *param0, SpriteGfxHandler *param1, PaletteData *param2, int param3, u32 param4, u32 param5, u32 param6, u32 param7); | ||
void BattleCursor_FreeResources(SpriteGfxHandler *param0, u32 param1, u32 param2, u32 param3, u32 param4); | ||
BattleCursor *BattleCursor_New(SpriteRenderer *param0, SpriteGfxHandler *param1, int param2, u32 param3, u32 param4, u32 param5, u32 param6, u32 param7, u32 param8); | ||
void BattleCursor_Free(BattleCursor *param0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void BattleCursor_Free(BattleCursor *param0); | |
void BattleCursor_Free(BattleCursor *battleCursor); |
etc.
@@ -460,7 +460,7 @@ static void BattleController_CommandSelectionInput(BattleSystem *battleSys, Batt | |||
break; | |||
|
|||
case PLAYER_INPUT_ITEM: | |||
if (BattleSystem_BattleType(battleSys) & BATTLE_TYPE_NO_ITEMS) { | |||
if (BattleSystem_GetBattleType(battleSys) & BATTLE_TYPE_NO_ITEMS) { | |||
msg.id = 593; // "Items can’t be used here." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
polish: GMM constant
@@ -22,7 +22,7 @@ void ov16_02264798(BattlerData *param0, BattleSystem *param1) | |||
return; | |||
} | |||
|
|||
if (BattleSystem_BattleType(param1) & (0x20 | 0x200)) { | |||
if (BattleSystem_GetBattleType(param1) & (0x20 | 0x200)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
polish: Use from constants/battle.h
src/overlay013/ov13_02224500.c
Outdated
@@ -291,7 +291,7 @@ static void ov13_02224720(UnkStruct_ov13_022213F0 *param0) | |||
|
|||
v0 = ov16_0223E010(param0->unk_00->unk_08); | |||
|
|||
sub_0207C9B0(param0->unk_1E4, 3, v0, param0->unk_1FB0, NNS_G2D_VRAM_TYPE_2DSUB, 45065); | |||
MoveTypeIcon_LoadPalette(param0->unk_1E4, 3, v0, param0->unk_1FB0, NNS_G2D_VRAM_TYPE_2DSUB, 45065); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question I think that I recall these being battle-specific... I could be wrong, though.
Should be ready to review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is about as far as I've gotten at this point.
As a general rule, I'd like to push for isolating smaller, more granular modules being changed rather than an entire module like this one and its associated submodules. This PR feels a bit kitchen-sink, and that makes it more difficult to review.
v0.surface = 0; | ||
v0.bgPrio = 1; | ||
ballThrow.type = Unk_ov16_0226F174[param1->battlerType]; | ||
ballThrow.heapID = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
polish: HEAP_ID_BATTLE
ballThrow.ballID = param2; | ||
ballThrow.cellActorSys = BattleSystem_GetSpriteSystem(param0); | ||
ballThrow.paletteSys = BattleSystem_GetPaletteData(param0); | ||
ballThrow.surface = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: This should be the screen number, right? So should be DS_SCREEN_MAIN
?
spriteSystem = BattleSystem_GetSpriteSystem(battleInput->battleSystem); | ||
spriteManager = BattleSystem_GetSpriteManager(battleInput->battleSystem); | ||
|
||
SpriteManager_UnloadCharObjById(spriteManager, 20023); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: We will definitely want to make an enum
of some kind for all the resource IDs flying around the battle system.
No description provided.