From 355498d85b71536580025364ccaa5ceb94c4194d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 13 Jun 2017 19:28:50 -0400 Subject: Decoration inventory data --- src/decoration.c | 28 ++++++++++++++-------------- src/decoration_inventory.c | 13 +++++++++++++ src/menu.c | 0 src/scrcmd.c | 0 4 files changed, 27 insertions(+), 14 deletions(-) mode change 100644 => 100755 src/decoration_inventory.c mode change 100644 => 100755 src/menu.c mode change 100644 => 100755 src/scrcmd.c (limited to 'src') diff --git a/src/decoration.c b/src/decoration.c index 729f14280..3fa230cd5 100755 --- a/src/decoration.c +++ b/src/decoration.c @@ -2105,7 +2105,7 @@ void sub_8100B6C(void) } for (j=0; jmap)[(x + k) + gMapHeader.mapData->width * (y - j)] | 0x3000); } @@ -2277,43 +2277,43 @@ void sub_8101118(u8 decorIdx, struct UnkStruct_020391B4 *unk_020391B4) { if (gDecorations[decorIdx].decor_field_12 == 0) { - unk_020391B4->var01 = 1; + unk_020391B4->width = 1; unk_020391B4->var02 = 1; } else if (gDecorations[decorIdx].decor_field_12 == 1) { - unk_020391B4->var01 = 2; + unk_020391B4->width = 2; unk_020391B4->var02 = 1; } else if (gDecorations[decorIdx].decor_field_12 == 2) { - unk_020391B4->var01 = 3; + unk_020391B4->width = 3; unk_020391B4->var02 = 1; } else if (gDecorations[decorIdx].decor_field_12 == 3) { - unk_020391B4->var01 = 4; + unk_020391B4->width = 4; unk_020391B4->var02 = 2; } else if (gDecorations[decorIdx].decor_field_12 == 4) { - unk_020391B4->var01 = 2; + unk_020391B4->width = 2; unk_020391B4->var02 = 2; } else if (gDecorations[decorIdx].decor_field_12 == 5) { - unk_020391B4->var01 = 1; + unk_020391B4->width = 1; unk_020391B4->var02 = 2; } else if (gDecorations[decorIdx].decor_field_12 == 6) { - unk_020391B4->var01 = 1; + unk_020391B4->width = 1; unk_020391B4->var02 = 3; } else if (gDecorations[decorIdx].decor_field_12 == 7) { - unk_020391B4->var01 = 2; + unk_020391B4->width = 2; unk_020391B4->var02 = 4; } else if (gDecorations[decorIdx].decor_field_12 == 8) { - unk_020391B4->var01 = 3; + unk_020391B4->width = 3; unk_020391B4->var02 = 3; } else if (gDecorations[decorIdx].decor_field_12 == 9) { - unk_020391B4->var01 = 3; + unk_020391B4->width = 3; unk_020391B4->var02 = 2; } } @@ -2340,9 +2340,9 @@ bool8 sub_8101200(u8 taskId, u8 decorIdx, struct UnkStruct_020391B4 *unk_020391B { unk_020391B4->var02--; } - if (x >= xOff && x < xOff + unk_020391B4->var01 && y > yOff - unk_020391B4->var02 && y <= yOff) + if (x >= xOff && x < xOff + unk_020391B4->width && y > yOff - unk_020391B4->var02 && y <= yOff) { - sub_8101198(unk_020391B4->var01 - (x - xOff + 1), yOff - y); + sub_8101198(unk_020391B4->width - (x - xOff + 1), yOff - y); return TRUE; } return FALSE; @@ -2434,7 +2434,7 @@ void sub_8101460(u8 taskId) { xOff = ewram_1f000.pos[gUnknown_020391B4[0].var00] >> 4; yOff = ewram_1f000.pos[gUnknown_020391B4[0].var00] & 0xf; - sub_81013B8(xOff, yOff - gUnknown_020391B4[0].var02 + 1, xOff + gUnknown_020391B4[0].var01 - 1, yOff); + sub_81013B8(xOff, yOff - gUnknown_020391B4[0].var02 + 1, xOff + gUnknown_020391B4[0].width - 1, yOff); } } } diff --git a/src/decoration_inventory.c b/src/decoration_inventory.c old mode 100644 new mode 100755 index a483629b1..c3dfdb2a8 --- a/src/decoration_inventory.c +++ b/src/decoration_inventory.c @@ -8,6 +8,19 @@ #include "decoration.h" #include "decoration_inventory.h" +#define DECOR_INV(ptr) {.items = (u8 *)&ptr, .size = sizeof ptr} + +struct DecorationInventory const gDecorationInventories[] = { + DECOR_INV(gSaveBlock1.decorDesk), + DECOR_INV(gSaveBlock1.decorChair), + DECOR_INV(gSaveBlock1.decorPlant), + DECOR_INV(gSaveBlock1.decorOrnament), + DECOR_INV(gSaveBlock1.decorMat), + DECOR_INV(gSaveBlock1.decorPoster), + DECOR_INV(gSaveBlock1.decorDoll), + DECOR_INV(gSaveBlock1.decorCushion) +}; + void ClearDecorationInventory(u8 invIdx) { u8 i; diff --git a/src/menu.c b/src/menu.c old mode 100644 new mode 100755 diff --git a/src/scrcmd.c b/src/scrcmd.c old mode 100644 new mode 100755 -- cgit v1.2.3