Some cleanup/doc on the item icons (#1263)

* Some cleanup/doc on the item enum and icons

* `gItemIconBigBottlePoeTex` -> `gItemIconBottleBigPoeTex`

* Biggoron sword / giant knife items (?)

* `SPSTONE_` -> `SPIRITUAL_` ?

* `gItemIconBrokenBiggoronSwordTex` -> `gItemIconBrokenGoronsSwordTex`

* `gQuestIcon...MedallionTex` -> `gQuestIconMedallion...Tex`

* `ITEM_MAGIC_` -> `ITEM_MAGIC_JAR_`small/big

* `ITEM_BOW_ARROW_` -> `ITEM_BOW_`

* `MASK_BUNNY` -> `MASK_BUNNY_HOOD`

* Update `GID_` enum from `ITEM_` enum

* ITEM/GID`_ARROW_`small/medium/large -> 5/10/30

* Run formatter

* .

* fix regressions and revert bad ideas

* chicken

* obey the newline police and also prevent the range police from intervening

* fixups

* dimensions -> dimension (singular)

* Note on inconsequential oddities about the `gItemIcons` mapping
This commit is contained in:
Dragorn421
2022-12-13 03:45:54 +01:00
committed by GitHub
parent c420885513
commit 880e7c937c
17 changed files with 369 additions and 336 deletions
+1 -1
View File
@@ -99,7 +99,7 @@
#define R_TEXTBOX_HEIGHT YREG(23)
#define R_TEXTBOX_ICON_XPOS YREG(71)
#define R_TEXTBOX_ICON_YPOS YREG(72)
#define R_TEXTBOX_ICON_SIZE YREG(75)
#define R_TEXTBOX_ICON_DIMENSION YREG(75)
#define R_MESSAGE_DEBUGGER_SELECT YREG(78)
#define R_MESSAGE_DEBUGGER_TEXTID YREG(79)
#define R_C_UP_ICON_X YREG(88)
+28
View File
@@ -1,6 +1,34 @@
#ifndef Z64INTERFACE_H
#define Z64INTERFACE_H
extern u8 _icon_item_staticSegmentRomStart[];
extern u8 _icon_item_24_staticSegmentRomStart[];
// An "item icon" (gItemIcon*Tex) is 32x32 rgba32
#define ITEM_ICON_WIDTH 32
#define ITEM_ICON_HEIGHT 32
#define ITEM_ICON_SIZE (ITEM_ICON_WIDTH * ITEM_ICON_HEIGHT * 4) // The size in bytes of an item icon
/**
* Get the VROM address of the item icon for the specified item.
*
* @param itemId An ItemId value in the range `ITEM_DEKU_STICK`..`ITEM_FISHING_POLE`
*/
#define GET_ITEM_ICON_VROM(itemId) ((uintptr_t)_icon_item_staticSegmentRomStart + ((itemId)*ITEM_ICON_SIZE))
// A "quest icon" (gQuestIcon*Tex) is 24x24 rgba32
#define QUEST_ICON_WIDTH 24
#define QUEST_ICON_HEIGHT 24
#define QUEST_ICON_SIZE (QUEST_ICON_WIDTH * QUEST_ICON_HEIGHT * 4) // The size in bytes of a quest icon
/**
* Get the VROM address of the quest icon for the specified item.
*
* @param itemId An ItemId value in the range `ITEM_MEDALLION_FOREST`..`ITEM_MAGIC_JAR_BIG`
*/
#define GET_QUEST_ICON_VROM(itemId) \
((uintptr_t)_icon_item_24_staticSegmentRomStart + (((itemId)-ITEM_MEDALLION_FOREST) * QUEST_ICON_SIZE))
/**
* Button HUD Positions (Upper Left)
*/
-8
View File
@@ -1,14 +1,6 @@
#ifndef Z64ITEM_H
#define Z64ITEM_H
#define ICON_ITEM_TEX_WIDTH 32
#define ICON_ITEM_TEX_HEIGHT 32
#define ICON_ITEM_TEX_SIZE ((ICON_ITEM_TEX_WIDTH * ICON_ITEM_TEX_HEIGHT) * 4) // 32x32 RGBA32 texture
#define ICON_ITEM_24_TEX_WIDTH 24
#define ICON_ITEM_24_TEX_HEIGHT 24
#define ICON_ITEM_24_TEX_SIZE ((ICON_ITEM_24_TEX_WIDTH * ICON_ITEM_24_TEX_HEIGHT) * 4) // 24x24 RGBA32 texture
// Note that z_kaleido_scope_PAL.c assumes that the dimensions and texture format here also matches the dimensions and
// texture format for MAP_NAME_TEX1_*
#define ITEM_NAME_TEX_WIDTH 128