Skip to content

Commit

Permalink
Rename Item_ID -> Item_FileID
Browse files Browse the repository at this point in the history
  • Loading branch information
lhearachel committed Sep 4, 2023
1 parent 3258ab3 commit 92858a8
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion include/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void Item_MoveInPocket(void *pocket, u16 srcSlot, u16 dstSlot);
* @param type The type of ID to get.
* @return The item's ID of the specified type.
*/
u16 Item_ID(u16 item, enum ItemFileType type);
u16 Item_FileID(u16 item, enum ItemFileType type);

/**
* @brief Get the ID of an item which matches the given GBA-era item ID.
Expand Down
4 changes: 2 additions & 2 deletions src/item.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ void Item_MoveInPocket(void *pocket, u16 srcSlot, u16 dstSlot)
items[dstSlot] = item;
}

u16 Item_ID(u16 item, enum ItemFileType type)
u16 Item_FileID(u16 item, enum ItemFileType type)
{
switch (type) {
case ITEM_FILE_TYPE_DATA:
Expand Down Expand Up @@ -1052,7 +1052,7 @@ u8 Item_IsHerbalMedicine(u16 item)

void* ItemTable_Load(int heapID)
{
int maxItem = Item_ID(NUM_ITEMS, ITEM_FILE_TYPE_DATA);
int maxItem = Item_FileID(NUM_ITEMS, ITEM_FILE_TYPE_DATA);
return NARC_AllocAndReadFromMemberByIndexPair(NARC_INDEX_ITEMTOOL__ITEMDATA__PL_ITEM_DATA, 0, heapID, 0, sizeof(ItemData) * maxItem);
}

Expand Down
4 changes: 2 additions & 2 deletions src/overlay007/ov7_0224CD28.c
Original file line number Diff line number Diff line change
Expand Up @@ -1513,12 +1513,12 @@ static void ov7_0224EB7C (UnkStruct_ov7_0224D008 * param0, u16 param1)

v0 = sub_02009DC8(param0->unk_94.unk_194[0], 2);

sub_02009968(param0->unk_94.unk_194[0], v0, 16, Item_ID(param1, 1), 0, 11);
sub_02009968(param0->unk_94.unk_194[0], v0, 16, Item_FileID(param1, 1), 0, 11);
sub_0200A4C0(v0);

v0 = sub_02009DC8(param0->unk_94.unk_194[1], 1);

sub_020099D4(param0->unk_94.unk_194[1], v0, 16, Item_ID(param1, 2), 0, 11);
sub_020099D4(param0->unk_94.unk_194[1], v0, 16, Item_FileID(param1, 2), 0, 11);
sub_0200A6B8(v0);
}

Expand Down
8 changes: 4 additions & 4 deletions src/overlay013/ov13_02227BDC.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ static void ov13_02227C54 (UnkStruct_ov13_02227244 * param0)
v0 = ov16_0223E010(param0->unk_00->unk_00);

for (v1 = 0; v1 < 6; v1++) {
sub_0200CC3C(v0, param0->unk_30C, v2, Item_ID(1, 1), 0, NNS_G2D_VRAM_TYPE_2DSUB, 46263 + v1);
sub_0200CDC4(param0->unk_08, 3, v0, param0->unk_30C, v2, Item_ID(1, 2), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 46263 + v1);
sub_0200CC3C(v0, param0->unk_30C, v2, Item_FileID(1, 1), 0, NNS_G2D_VRAM_TYPE_2DSUB, 46263 + v1);
sub_0200CDC4(param0->unk_08, 3, v0, param0->unk_30C, v2, Item_FileID(1, 2), 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 46263 + v1);
}

sub_0200CE24(v0, param0->unk_30C, v2, Item_IconNCERFile(), 0, 46263);
Expand All @@ -109,12 +109,12 @@ static void ov13_02227C54 (UnkStruct_ov13_02227244 * param0)
static void ov13_02227D10 (UnkStruct_ov13_02227244 * param0, u16 param1, u32 param2)
{
UnkStruct_0200C6E4 * v0 = ov16_0223E010(param0->unk_00->unk_00);
sub_0200D948(v0, param0->unk_30C, 16, Item_ID(param1, 1), 0, param2);
sub_0200D948(v0, param0->unk_30C, 16, Item_FileID(param1, 1), 0, param2);
}

static void ov13_02227D48 (UnkStruct_ov13_02227244 * param0, u16 param1, u16 param2, u32 param3)
{
sub_02003050(param0->unk_08, 16, Item_ID(param1, 2), param0->unk_00->unk_0C, 3, 0x20, param2 * 16);
sub_02003050(param0->unk_08, 16, Item_FileID(param1, 2), param0->unk_00->unk_0C, 3, 0x20, param2 * 16);
}

static UnkStruct_0200D0F4 * ov13_02227D78 (UnkStruct_ov13_02227244 * param0, u32 param1)
Expand Down
2 changes: 1 addition & 1 deletion src/overlay016/ov16_0225177C.c
Original file line number Diff line number Diff line change
Expand Up @@ -6961,7 +6961,7 @@ s32 ov16_0225B0FC (BattleContext * param0, u16 param1, u16 param2)
ItemData * v0;
u16 v1;

v1 = Item_ID(param1, 0);
v1 = Item_FileID(param1, 0);
v0 = ItemTable_Index(param0->aiContext.itemTable, v1);

return Item_Get(v0, param2);
Expand Down
4 changes: 2 additions & 2 deletions src/overlay019/ov19_021DB8E4.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,11 +713,11 @@ static void ov19_021DC4F8 (UnkStruct_ov19_021DBA9C * param0, u32 param1)
ov19_021D783C(&v0, &v2, ov19_021D77D0(param0->unk_00), v1->unk_1C, v1->unk_20, 0);
NNS_G2dInitImageProxy(&v2);

v4 = sub_02006F50(16, Item_ID(param1, 1), 0, &v3, 10);
v4 = sub_02006F50(16, Item_FileID(param1, 1), 0, &v3, 10);
v3->mapingType = GX_GetOBJVRamModeChar();
NNS_G2dLoadImage1DMapping(v3, 1520 * 0x20, NNS_G2D_VRAM_TYPE_2DMAIN, &v2);

sub_02006E84(16, Item_ID(param1, 2), 1, 6 * 0x20, 0x20, 10);
sub_02006E84(16, Item_FileID(param1, 2), 1, 6 * 0x20, 0x20, 10);
param0->unk_90 = ov19_021D785C(param0->unk_08, &v0, 18, 224, 0, NNS_G2D_VRAM_TYPE_2DMAIN);

if (param0->unk_90) {
Expand Down
10 changes: 5 additions & 5 deletions src/overlay019/ov19_021DE3E8.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static void ov19_021DE450 (UnkStruct_ov19_021DE3E8 * param0)
int v4;

ov19_021D783C(&v0, &v1, ov19_021D77D0(param0->unk_04), param0->unk_14->unk_1C, param0->unk_14->unk_20, 0);
v3 = sub_02006F50(16, Item_ID(1, 1), 0, &v2, 10);
v3 = sub_02006F50(16, Item_FileID(1, 1), 0, &v2, 10);

if (v3) {
int v5;
Expand Down Expand Up @@ -228,8 +228,8 @@ static void ov19_021DE5D4 (UnkStruct_ov19_021DE3E8 * param0)
v2 = 2;
}

sub_02006EC0(16, Item_ID(v0, 1), 0, Unk_ov19_021E04CC[v3].unk_00, 0, 0, 10);
sub_02006E84(16, Item_ID(v0, 2), 1, Unk_ov19_021E04CC[v3].unk_04 * 0x20, 0x20, 10);
sub_02006EC0(16, Item_FileID(v0, 1), 0, Unk_ov19_021E04CC[v3].unk_00, 0, 0, 10);
sub_02006E84(16, Item_FileID(v0, 2), 1, Unk_ov19_021E04CC[v3].unk_04 * 0x20, 0x20, 10);
sub_02021E80(param0->unk_1C[v3], v2);

ov19_021D78AC(param0->unk_1C[v3], 2);
Expand Down Expand Up @@ -269,8 +269,8 @@ static void ov19_021DE718 (UnkStruct_ov19_021DE3E8 * param0, int param1, int par

ov19_021DE694(param0, &v0, &v1);

sub_02006EC0(16, Item_ID(param2, 1), 0, Unk_ov19_021E04CC[param1].unk_00, 0, 0, 10);
sub_02006E84(16, Item_ID(param2, 2), 1, Unk_ov19_021E04CC[param1].unk_04 * 0x20, 0x20, 10);
sub_02006EC0(16, Item_FileID(param2, 1), 0, Unk_ov19_021E04CC[param1].unk_00, 0, 0, 10);
sub_02006E84(16, Item_FileID(param2, 2), 1, Unk_ov19_021E04CC[param1].unk_04 * 0x20, 0x20, 10);
sub_02021E80(param0->unk_1C[param1], v1);

ov19_021D78AC(param0->unk_1C[param1], 3);
Expand Down
8 changes: 4 additions & 4 deletions src/overlay084/ov84_022403F4.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,12 @@ static void ov84_022404C0 (UnkStruct_ov84_0223B5A0 * param0)
sub_0200CC3C(param0->unk_D8, param0->unk_DC, param0->unk_D4, 10, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49405);
sub_0200CC3C(param0->unk_D8, param0->unk_DC, param0->unk_D4, 36, 0, NNS_G2D_VRAM_TYPE_2DSUB, 49406);
sub_0200CBDC(param0->unk_D8, param0->unk_DC, 62, 4, 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49408);
sub_0200CBDC(param0->unk_D8, param0->unk_DC, 16, Item_ID(0, 1), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49407);
sub_0200CBDC(param0->unk_D8, param0->unk_DC, 16, Item_FileID(0, 1), 0, NNS_G2D_VRAM_TYPE_2DMAIN, 49407);
sub_0207C948(param0->unk_D8, param0->unk_DC, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 49409);
sub_0207CAC4(param0->unk_D8, param0->unk_DC, NNS_G2D_VRAM_TYPE_2DMAIN, 0, 49410);
sub_0200CD0C(param0->unk_D8, param0->unk_DC, param0->unk_D4, v1, 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 49401);
sub_0200CD0C(param0->unk_D8, param0->unk_DC, param0->unk_D4, 20, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 49402);
sub_0200CC9C(param0->unk_D8, param0->unk_DC, 16, Item_ID(0, 2), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 49404);
sub_0200CC9C(param0->unk_D8, param0->unk_DC, 16, Item_FileID(0, 2), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 49404);
sub_0200CC9C(param0->unk_D8, param0->unk_DC, 62, 10, 0, 2, NNS_G2D_VRAM_TYPE_2DMAIN, 49405);
sub_0207C97C(param0->unk_D8, param0->unk_DC, NNS_G2D_VRAM_TYPE_2DMAIN, 49406);
sub_0200CD0C(param0->unk_D8, param0->unk_DC, param0->unk_D4, 37, 0, 1, NNS_G2D_VRAM_TYPE_2DSUB, 49403);
Expand Down Expand Up @@ -319,8 +319,8 @@ void ov84_02240ABC (UnkStruct_ov84_0223B5A0 * param0)

void ov84_02240AD8 (UnkStruct_ov84_0223B5A0 * param0, u16 param1)
{
sub_0200D948(param0->unk_D8, param0->unk_DC, 16, Item_ID(param1, 1), 0, 49407);
sub_0200D97C(param0->unk_D8, param0->unk_DC, 16, Item_ID(param1, 2), 0, 49404);
sub_0200D948(param0->unk_D8, param0->unk_DC, 16, Item_FileID(param1, 1), 0, 49407);
sub_0200D97C(param0->unk_D8, param0->unk_DC, 16, Item_FileID(param1, 2), 0, 49404);
}

void ov84_02240B34 (UnkStruct_ov84_0223B5A0 * param0, u8 param1)
Expand Down
2 changes: 1 addition & 1 deletion src/overlay097/ov97_02237694.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ static void ov97_022380C8 (UnkStruct_ov97_0223F550 * param0, int param1, UnkStru
break;
}

ov97_02237B0C(16, Item_ID(v0, 1), Item_ID(v0, 2), Item_IconNCERFile(), Item_IconNANRFile(), 1);
ov97_02237B0C(16, Item_FileID(v0, 1), Item_FileID(v0, 2), Item_IconNCERFile(), Item_IconNANRFile(), 1);
ov97_02237C80((0 * FX32_ONE), (256 * FX32_ONE));

param0->unk_26C = ov97_02237D14(1, param0->unk_26C, HW_LCD_WIDTH / 2, 0, 0);
Expand Down
8 changes: 4 additions & 4 deletions src/overlay107/ov107_02249604.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ void ov107_02249604 (UnkStruct_ov107_02249954 * param0, Party * param1, u8 param

v1 = NARC_ctor(NARC_INDEX_ITEMTOOL__ITEMDATA__ITEM_ICON, 100);

param0->unk_1A0[1][0] = sub_02009A4C(param0->unk_190[0], v1, Item_ID(0, 1), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 100);
param0->unk_1A0[1][1] = sub_020098B8(param0->unk_190[1], 16, Item_ID(0, 2), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 3, 100);
param0->unk_1A0[1][0] = sub_02009A4C(param0->unk_190[0], v1, Item_FileID(0, 1), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 100);
param0->unk_1A0[1][1] = sub_020098B8(param0->unk_190[1], 16, Item_FileID(0, 2), 0, 1, NNS_G2D_VRAM_TYPE_2DMAIN, 3, 100);
param0->unk_1A0[1][2] = sub_02009BC4(param0->unk_190[2], v1, Item_IconNCERFile(), 0, 1, 2, 100);
param0->unk_1A0[1][3] = sub_02009BC4(param0->unk_190[3], v1, Item_IconNANRFile(), 0, 1, 3, 100);

Expand Down Expand Up @@ -186,7 +186,7 @@ void ov107_022499BC (UnkStruct_ov107_02249954 * param0, u16 param1)

v0 = sub_02009DC8(param0->unk_190[0], 1);

sub_02009968(param0->unk_190[0], v0, 16, Item_ID(param1, 1), 0, 100);
sub_02009968(param0->unk_190[0], v0, 16, Item_FileID(param1, 1), 0, 100);
sub_0200A4C0(v0);

return;
Expand All @@ -198,7 +198,7 @@ void ov107_022499FC (UnkStruct_ov107_02249954 * param0, u16 param1)

v0 = sub_02009DC8(param0->unk_190[1], 1);

sub_020099D4(param0->unk_190[1], v0, 16, Item_ID(param1, 2), 0, 100);
sub_020099D4(param0->unk_190[1], v0, 16, Item_FileID(param1, 2), 0, 100);
sub_0200A6B8(v0);

return;
Expand Down

0 comments on commit 92858a8

Please sign in to comment.