summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/decoration.c28
-rwxr-xr-x[-rw-r--r--]src/decoration_inventory.c13
-rwxr-xr-x[-rw-r--r--]src/menu.c0
-rwxr-xr-x[-rw-r--r--]src/scrcmd.c0
4 files changed, 27 insertions, 14 deletions
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; j<gUnknown_020391B4[i].var02; j++)
{
- for (k=0; k<gUnknown_020391B4[i].var01; k++)
+ for (k=0; k<gUnknown_020391B4[i].width; k++)
{
MapGridSetMetatileEntryAt(x + 7 + k, y + 7 - j, ((u16 *)gMapHeader.mapData->map)[(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
index a483629b1..c3dfdb2a8 100644..100755
--- 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
index 61eaebb6f..61eaebb6f 100644..100755
--- a/src/menu.c
+++ b/src/menu.c
diff --git a/src/scrcmd.c b/src/scrcmd.c
index 33867b58a..33867b58a 100644..100755
--- a/src/scrcmd.c
+++ b/src/scrcmd.c