1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-11 17:30:25 +00:00

Doc player drawing (#1098)

* Introduce and use more enums and defines for equips and data involved in player drawing

* `EQUIP_TYPE_`, `EQUIP_INV_`, `EQUIP_VALUE_`

* Improve doc on ItemEquips/Inventory's `equipment` field

* Run formatter

* Add `PLAYER_MODELGROUPENTRY_*` for second index of `gPlayerModelTypes`

* Name `PLAYER_MODELGROUPENTRY_*` from existing documentation

* Partial doc on `PLAYER_MODELTYPE_*`

* Some doc on `PLAYER_MODELGROUP_*`

* Run formatter

* Name and some doc/cleanup on the various player draw functions

* Name symbols used for player position in pause menu

* Name player override/post limb draw callbacks

* `BOOTS_NORMAL` -> `BOOTS_KOKIRI`

* `EQUIP_INV_SWORD_GIANTKNIFE` -> `EQUIP_INV_SWORD_BROKENGIANTKNIFE`

* `currentSword` -> `currentSwordItem` to avoid confusion with `PlayerSword` enum

* Make one constant more explicit

* Document severe bug (not an issue by luck)

* Some doc on `PLAYER_MODELTYPE_RH_FF`

* Actually name most of `PlayerModelType`

* Actually name most of `PlayerModelGroup` and improve comments

* Make equipment in debug save data use equip enums

* Name symbol for computing player's `bodyPartsPos` and fix struct access

* Name right/left `HandType` symbols

* Add `PlayerBodyPart` enum

* Run formatter

* Introduce defines for pause player render dimensions and cleanup viewport usage in pause drawing

* Document `playerSegment` related usage

* Run formatter

* Revert player bodypart changes

* Revert equips doc changes

* Revert player model and anim data changes

* Revert drawing-unrelated changes

* Move `sTunicColors` tunic comments to after data
This commit is contained in:
Dragorn421 2022-03-13 01:06:43 +01:00 committed by GitHub
parent a160fb96c8
commit 054bac7583
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 112 additions and 85 deletions

View file

@ -106,9 +106,9 @@ void KaleidoScope_DrawPlayerWork(GlobalContext* globalCtx) {
rot.y = 32300;
rot.x = rot.z = 0;
func_8009214C(globalCtx, pauseCtx->playerSegment, &pauseCtx->playerSkelAnime, &pos, &rot, scale,
CUR_EQUIP_VALUE(EQUIP_SWORD), CUR_EQUIP_VALUE(EQUIP_TUNIC) - 1, CUR_EQUIP_VALUE(EQUIP_SHIELD),
CUR_EQUIP_VALUE(EQUIP_BOOTS) - 1);
Player_DrawPause(globalCtx, pauseCtx->playerSegment, &pauseCtx->playerSkelAnime, &pos, &rot, scale,
CUR_EQUIP_VALUE(EQUIP_SWORD), CUR_EQUIP_VALUE(EQUIP_TUNIC) - 1, CUR_EQUIP_VALUE(EQUIP_SHIELD),
CUR_EQUIP_VALUE(EQUIP_BOOTS) - 1);
}
void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) {
@ -588,7 +588,8 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) {
gSPSegment(POLY_OPA_DISP++, 0x0C, pauseCtx->iconItemAltSegment);
func_800949A8(globalCtx->state.gfxCtx);
KaleidoScope_DrawEquipmentImage(globalCtx, pauseCtx->playerSegment, 64, 112);
KaleidoScope_DrawEquipmentImage(globalCtx, pauseCtx->playerSegment, PAUSE_EQUIP_PLAYER_WIDTH,
PAUSE_EQUIP_PLAYER_HEIGHT);
if (gUpgradeMasks[0]) {}

View file

@ -243,7 +243,7 @@ void KaleidoScope_SetupPlayerPreRender(GlobalContext* globalCtx) {
gfx = Graph_GfxPlusOne(gfxRef);
gSPDisplayList(WORK_DISP++, gfx);
PreRender_SetValues(&sPlayerPreRender, 64, 112, fbuf, NULL);
PreRender_SetValues(&sPlayerPreRender, PAUSE_EQUIP_PLAYER_WIDTH, PAUSE_EQUIP_PLAYER_HEIGHT, fbuf, NULL);
func_800C1F20(&sPlayerPreRender, &gfx);
func_800C20B4(&sPlayerPreRender, &gfx);
@ -2634,7 +2634,8 @@ void KaleidoScope_Update(GlobalContext* globalCtx) {
sPreRenderCvg = (void*)ALIGN16((u32)pauseCtx->nameSegment + 0x400 + 0xA00);
PreRender_Init(&sPlayerPreRender);
PreRender_SetValuesSave(&sPlayerPreRender, 64, 112, pauseCtx->playerSegment, NULL, sPreRenderCvg);
PreRender_SetValuesSave(&sPlayerPreRender, PAUSE_EQUIP_PLAYER_WIDTH, PAUSE_EQUIP_PLAYER_HEIGHT,
pauseCtx->playerSegment, NULL, sPreRenderCvg);
KaleidoScope_DrawPlayerWork(globalCtx);
KaleidoScope_SetupPlayerPreRender(globalCtx);