summaryrefslogtreecommitdiff
path: root/gflib/sprite.c
diff options
context:
space:
mode:
authorGriffinR <griffin.richards@comcast.net>2019-12-10 20:43:27 -0500
committerGitHub <noreply@github.com>2019-12-10 20:43:27 -0500
commit47b0d8a5970a75862279bde9d19a06c3d7f96eee (patch)
tree462ebc6e6bce61be28d862cd89c8bec08ebfa61e /gflib/sprite.c
parent77bf40d32b7bbab40db36030399586430ae57010 (diff)
parent49f1a90534180445d293761e2bdac165b49319a2 (diff)
Merge branch 'master' into doc-matchcall
Diffstat (limited to 'gflib/sprite.c')
-rw-r--r--gflib/sprite.c43
1 files changed, 23 insertions, 20 deletions
diff --git a/gflib/sprite.c b/gflib/sprite.c
index e25eac62e..2e96acf2c 100644
--- a/gflib/sprite.c
+++ b/gflib/sprite.c
@@ -264,23 +264,26 @@ static const s32 sUnknown_082EC6F4[3][4][2] =
static const struct OamDimensions sOamDimensions[3][4] =
{
- { // square
- { 8, 8 },
- { 16, 16 },
- { 32, 32 },
- { 64, 64 },
+ [ST_OAM_SQUARE] =
+ {
+ [SPRITE_SIZE(8x8)] = { 8, 8 },
+ [SPRITE_SIZE(16x16)] = { 16, 16 },
+ [SPRITE_SIZE(32x32)] = { 32, 32 },
+ [SPRITE_SIZE(64x64)] = { 64, 64 },
},
- { // horizontal rectangle
- { 16, 8 },
- { 32, 8 },
- { 32, 16 },
- { 64, 32 },
+ [ST_OAM_H_RECTANGLE] =
+ {
+ [SPRITE_SIZE(16x8)] = { 16, 8 },
+ [SPRITE_SIZE(32x8)] = { 32, 8 },
+ [SPRITE_SIZE(32x16)] = { 32, 16 },
+ [SPRITE_SIZE(64x32)] = { 64, 32 },
},
- { // vertical rectangle
- { 8, 16 },
- { 8, 32 },
- { 16, 32 },
- { 32, 64 },
+ [ST_OAM_V_RECTANGLE] =
+ {
+ [SPRITE_SIZE(8x16)] = { 8, 16 },
+ [SPRITE_SIZE(8x32)] = { 8, 32 },
+ [SPRITE_SIZE(16x32)] = { 16, 32 },
+ [SPRITE_SIZE(32x64)] = { 32, 64 },
},
};
@@ -406,10 +409,10 @@ void SortSprites(void)
sprite2Y = sprite2Y - 256;
if (sprite1->oam.affineMode == ST_OAM_AFFINE_DOUBLE
- && sprite1->oam.size == 3)
+ && sprite1->oam.size == ST_OAM_SIZE_3)
{
u32 shape = sprite1->oam.shape;
- if (shape == ST_OAM_SQUARE || shape == 2)
+ if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE)
{
if (sprite1Y > 128)
sprite1Y = sprite1Y - 256;
@@ -417,7 +420,7 @@ void SortSprites(void)
}
if (sprite2->oam.affineMode == ST_OAM_AFFINE_DOUBLE
- && sprite2->oam.size == 3)
+ && sprite2->oam.size == ST_OAM_SIZE_3)
{
u32 shape = sprite2->oam.shape;
if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE)
@@ -455,7 +458,7 @@ void SortSprites(void)
sprite2Y = sprite2Y - 256;
if (sprite1->oam.affineMode == ST_OAM_AFFINE_DOUBLE
- && sprite1->oam.size == 3)
+ && sprite1->oam.size == ST_OAM_SIZE_3)
{
u32 shape = sprite1->oam.shape;
if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE)
@@ -466,7 +469,7 @@ void SortSprites(void)
}
if (sprite2->oam.affineMode == ST_OAM_AFFINE_DOUBLE
- && sprite2->oam.size == 3)
+ && sprite2->oam.size == ST_OAM_SIZE_3)
{
u32 shape = sprite2->oam.shape;
if (shape == ST_OAM_SQUARE || shape == ST_OAM_V_RECTANGLE)