diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2020-08-14 23:59:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-14 23:59:44 -0400 |
commit | 98e68a81120433348296e6947af5a539ec20ae3c (patch) | |
tree | 3d9c92a47c8dba0976d64413614d18acd3851ed6 | |
parent | 50d6e9ea3477a8e4c81c332abe6215a7ed1cc100 (diff) | |
parent | d3e00cadccb20566b9a4239b398ec9aad33c8f91 (diff) |
Merge pull request #1137 from PokeCodec/glyphREMATCH
Create Enum for Colors
-rw-r--r-- | gflib/text.c | 10 | ||||
-rw-r--r-- | gflib/text.h | 7 |
2 files changed, 12 insertions, 5 deletions
diff --git a/gflib/text.c b/gflib/text.c index 5722d5a43..07fd23109 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -451,11 +451,11 @@ u8 GetLastTextColor(u8 colorType) { switch (colorType) { - case 0: + case COLOR_FOREGROUND: return gLastTextFgColor; - case 2: + case COLOR_BACKGROUND: return gLastTextBgColor; - case 1: + case COLOR_SHADOW: return gLastTextShadowColor; default: return 0; @@ -482,8 +482,8 @@ u8 GetLastTextColor(u8 colorType) const u32 toOrr = r5 & 0xF; \ if (toOrr) \ { \ - dst = windowTiles + ((j >> 3) * 32) + ((j & 7) >> 1) + ((i >> 3) * widthOffset) + ((i & 7) * 4); \ - bits = ((j & 1) << 2); \ + dst = windowTiles + ((j / 8) * 32) + ((j & 7) >> 1) + ((i / 8) * widthOffset) + ((i & 7) * 4); \ + bits = ((j & 1) * 4); \ *dst = (toOrr << bits) | ((0xF0 >> bits) & *dst); \ } \ r5 >>= 4; \ diff --git a/gflib/text.h b/gflib/text.h index 0d0f3341d..0829d748f 100644 --- a/gflib/text.h +++ b/gflib/text.h @@ -271,6 +271,13 @@ enum { + COLOR_FOREGROUND, + COLOR_SHADOW, + COLOR_BACKGROUND +}; + +enum +{ FONTATTR_MAX_LETTER_WIDTH, FONTATTR_MAX_LETTER_HEIGHT, FONTATTR_LETTER_SPACING, |