Skip to content

Document remainder of Battle Factory App (Overlay 105)#983

Merged
lhearachel merged 3 commits intopret:mainfrom
VicSevenT:battle_factory_app_2
Mar 4, 2026
Merged

Document remainder of Battle Factory App (Overlay 105)#983
lhearachel merged 3 commits intopret:mainfrom
VicSevenT:battle_factory_app_2

Conversation

@VicSevenT
Copy link
Contributor

Followup of #978

@@ -97,239 +132,241 @@ typedef struct BattleFactoryApp {
PaletteData *plttData;
G3DPipelineBuffers *g3dPipeline;
PokemonSpriteManager *monSpriteMan;
PokemonSprite *unk_12C[3];
PokemonSprite *monSprites[3];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Create a local constant for this 3 as a codified number of mon sprites. Might also apply to the personal party data?

Make sure to apply those constants to the dimensions of the coordinate-tables below so that they also have codified sizes for the compiler.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case I am actually reluctant to add the sprite amount constants. While normally those constants would see additional use, for example in constructor and destructor for loops, I don't think there are any other places in this file where those would be used in this case. All the relevant for loops use function calls or variables that are ultimately set by NELEMS, not hardcoded.

I am also not sure what you mean regarding the coordinates tables. None of the coordinate tables are related to the mon sprites.

I have been thinking a little about how maybe it makes sense to create constants for the party sizes in the different battle facilities depending on challenge type, which could potentially help here, but that feels like something better addressed when more of the core logic of the facilities is documented, not now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "coordinate tables" was in reference to ballSprites; aren't some of those related to the number of available mons that can be received?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. I mulled over this today, decided that to add constants here, it's probably best to add the additional constants for party size now - they can always be moved to a more general header file later. So now all the constant arrays should have meaningful length indicators.

u16 unk_324[6];
u16 *unk_330;
int unk_334;
BattleFactoryAppPokeballSprite *ballSprites[6];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Similar here as for the party sprites.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above discussion

}

return 1;
return !!app->menuWasCancelled;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

praise: Fantastic!

@VicSevenT VicSevenT requested a review from lhearachel March 4, 2026 00:46
@lhearachel lhearachel merged commit 007a26c into pret:main Mar 4, 2026
2 checks passed
github-actions bot pushed a commit to lhearachel/pokeplatinum that referenced this pull request Mar 5, 2026
github-actions bot pushed a commit to Kuruyia/pokeplatinum that referenced this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants