From b65980cd4ea7e1a8052a0d2c5cb6edd73d35b89c Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 19 Jan 2021 17:50:52 -0500 Subject: Remove unused local variables and functions --- gflib/text.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'gflib/text.c') diff --git a/gflib/text.c b/gflib/text.c index 4cbad1376..ffce2cb56 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -165,7 +165,6 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u8 speed, voi { int i; u16 j; - u8 *ptr; if (!gFonts) return FALSE; @@ -1235,7 +1234,6 @@ s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing) bool8 isJapanese; int minGlyphWidth; u32 (*func)(u16 glyphId, bool32 isJapanese); - s32 result; int localLetterSpacing; u32 lineWidth; const u8 *bufferPointer; -- cgit v1.2.3 From 7198d40ec8dac00e3fc5b0d2ae01741fd12aea0e Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Fri, 19 Mar 2021 18:49:19 -0400 Subject: port some documentation from FR --- gflib/text.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gflib/text.c') diff --git a/gflib/text.c b/gflib/text.c index ffce2cb56..f07a2367a 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -1280,7 +1280,7 @@ s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing) default: return 0; } - case CHAR_DYNAMIC: + case CHAR_SPECIAL_F7: if (bufferPointer == NULL) bufferPointer = DynamicPlaceholderTextUtil_GetPlaceholderPtr(*++str); while (*bufferPointer != EOS) @@ -1398,8 +1398,7 @@ s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing) if (lineWidth > width) return lineWidth; - else - return width; + return width; } u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str) -- cgit v1.2.3 From 0691632ac61decd53901f4a59a56d2ca79554311 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Fri, 19 Mar 2021 18:52:37 -0400 Subject: oops --- gflib/text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gflib/text.c') diff --git a/gflib/text.c b/gflib/text.c index f07a2367a..a4e8d8bd3 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -1280,7 +1280,7 @@ s32 GetStringWidth(u8 fontId, const u8 *str, s16 letterSpacing) default: return 0; } - case CHAR_SPECIAL_F7: + case CHAR_DYNAMIC: if (bufferPointer == NULL) bufferPointer = DynamicPlaceholderTextUtil_GetPlaceholderPtr(*++str); while (*bufferPointer != EOS) -- cgit v1.2.3 From 6cceb05cb75f368c924c19fd456c2e09e71426a0 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Mon, 29 Mar 2021 11:20:00 -0500 Subject: Document some text-related things --- gflib/text.c | 232 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 116 insertions(+), 116 deletions(-) (limited to 'gflib/text.c') diff --git a/gflib/text.c b/gflib/text.c index ffce2cb56..d75be2fbf 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -21,8 +21,8 @@ static u16 gLastTextFgColor; static u16 gLastTextShadowColor; const struct FontInfo *gFonts; -u8 gUnknown_03002F84; -struct Struct_03002F90 gUnknown_03002F90; +u8 gDisableTextPrinters; +struct TextGlyph gCurGlyph; TextFlags gTextFlags; const u8 gFontHalfRowOffsets[] = @@ -204,7 +204,7 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u8 speed, voi CopyWindowToVram(gTempTextPrinter.printerTemplate.windowId, 2); gTextPrinters[printerTemplate->windowId].active = 0; } - gUnknown_03002F84 = 0; + gDisableTextPrinters = 0; return TRUE; } @@ -212,7 +212,7 @@ void RunTextPrinters(void) { int i; - if (gUnknown_03002F84 == 0) + if (gDisableTextPrinters == 0) { for (i = 0; i < NUM_TEXT_PRINTERS; ++i) { @@ -461,9 +461,9 @@ u8 GetLastTextColor(u8 colorType) } } -inline static void GLYPH_COPY(u8 *windowTiles, u32 widthOffset, u32 j, u32 i, u32 *ptr, s32 width, s32 height) +inline static void GLYPH_COPY(u8 *windowTiles, u32 widthOffset, u32 j, u32 i, u32 *glyphPixels, s32 width, s32 height) { - u32 xAdd, yAdd, r5, bits, toOrr, dummyX; + u32 xAdd, yAdd, pixelData, bits, toOrr, dummyX; u8 *dst; xAdd = j + width; @@ -471,69 +471,69 @@ inline static void GLYPH_COPY(u8 *windowTiles, u32 widthOffset, u32 j, u32 i, u3 dummyX = j; for (; i < yAdd; i++) { - r5 = *ptr++; + pixelData = *glyphPixels++; for (j = dummyX; j < xAdd; j++) { - if ((toOrr = r5 & 0xF)) + if ((toOrr = pixelData & 0xF)) { dst = windowTiles + ((j / 8) * 32) + ((j % 8) / 2) + ((i / 8) * widthOffset) + ((i % 8) * 4); bits = ((j & 1) * 4); *dst = (toOrr << bits) | (*dst & (0xF0 >> bits)); } - r5 >>= 4; + pixelData >>= 4; } } } void CopyGlyphToWindow(struct TextPrinter *textPrinter) { - struct Window *win; - struct WindowTemplate *winTempl; - u32 *unkStruct; + struct Window *window; + struct WindowTemplate *template; + u32 *glyphPixels; u32 currX, currY, widthOffset; - s32 r4, r0; + s32 glyphWidth, glyphHeight; u8 *windowTiles; - win = &gWindows[textPrinter->printerTemplate.windowId]; - winTempl = &win->window; + window = &gWindows[textPrinter->printerTemplate.windowId]; + template = &window->window; - if ((r4 = (winTempl->width * 8) - textPrinter->printerTemplate.currentX) > gUnknown_03002F90.width) - r4 = gUnknown_03002F90.width; + if ((glyphWidth = (template->width * 8) - textPrinter->printerTemplate.currentX) > gCurGlyph.width) + glyphWidth = gCurGlyph.width; - if ((r0 = (winTempl->height * 8) - textPrinter->printerTemplate.currentY) > gUnknown_03002F90.height) - r0 = gUnknown_03002F90.height; + if ((glyphHeight = (template->height * 8) - textPrinter->printerTemplate.currentY) > gCurGlyph.height) + glyphHeight = gCurGlyph.height; currX = textPrinter->printerTemplate.currentX; currY = textPrinter->printerTemplate.currentY; - unkStruct = (u32 *)&gUnknown_03002F90.unk0; - windowTiles = win->tileData; - widthOffset = winTempl->width * 32; + glyphPixels = gCurGlyph.gfxBufferTop; + windowTiles = window->tileData; + widthOffset = template->width * 32; - if (r4 < 9) + if (glyphWidth < 9) { - if (r0 < 9) + if (glyphHeight < 9) { - GLYPH_COPY(windowTiles, widthOffset, currX, currY, unkStruct, r4, r0); + GLYPH_COPY(windowTiles, widthOffset, currX, currY, glyphPixels, glyphWidth, glyphHeight); } else { - GLYPH_COPY(windowTiles, widthOffset, currX, currY, unkStruct, r4, 8); - GLYPH_COPY(windowTiles, widthOffset, currX, currY + 8, unkStruct + 16, r4, r0 - 8); + GLYPH_COPY(windowTiles, widthOffset, currX, currY, glyphPixels, glyphWidth, 8); + GLYPH_COPY(windowTiles, widthOffset, currX, currY + 8, glyphPixels + 16, glyphWidth, glyphHeight - 8); } } else { - if (r0 < 9) + if (glyphHeight < 9) { - GLYPH_COPY(windowTiles, widthOffset, currX, currY, unkStruct, 8, r0); - GLYPH_COPY(windowTiles, widthOffset, currX + 8, currY, unkStruct + 8, r4 - 8, r0); + GLYPH_COPY(windowTiles, widthOffset, currX, currY, glyphPixels, 8, glyphHeight); + GLYPH_COPY(windowTiles, widthOffset, currX + 8, currY, glyphPixels + 8, glyphWidth - 8, glyphHeight); } else { - GLYPH_COPY(windowTiles, widthOffset, currX, currY, unkStruct, 8, 8); - GLYPH_COPY(windowTiles, widthOffset, currX + 8, currY, unkStruct + 8, r4 - 8, 8); - GLYPH_COPY(windowTiles, widthOffset, currX, currY + 8, unkStruct + 16, 8, r0 - 8); - GLYPH_COPY(windowTiles, widthOffset, currX + 8, currY + 8, unkStruct + 24, r4 - 8, r0 - 8); + GLYPH_COPY(windowTiles, widthOffset, currX, currY, glyphPixels, 8, 8); + GLYPH_COPY(windowTiles, widthOffset, currX + 8, currY, glyphPixels + 8, glyphWidth - 8, 8); + GLYPH_COPY(windowTiles, widthOffset, currX, currY + 8, glyphPixels + 16, 8, glyphHeight - 8); + GLYPH_COPY(windowTiles, widthOffset, currX + 8, currY + 8, glyphPixels + 24, glyphWidth - 8, glyphHeight - 8); } } } @@ -542,7 +542,7 @@ void ClearTextSpan(struct TextPrinter *textPrinter, u32 width) { struct Window *window; struct Bitmap pixels_data; - struct Struct_03002F90 *gUnk; + struct TextGlyph *glyph; u8* glyphHeight; if (gLastTextBgColor != 0) @@ -552,8 +552,8 @@ void ClearTextSpan(struct TextPrinter *textPrinter, u32 width) pixels_data.width = window->window.width << 3; pixels_data.height = window->window.height << 3; - gUnk = &gUnknown_03002F90; - glyphHeight = &gUnk->height; + glyph = &gCurGlyph; + glyphHeight = &glyph->height; FillBitmapRect4Bit( &pixels_data, @@ -1015,8 +1015,8 @@ u16 RenderText(struct TextPrinter *textPrinter) break; case CHAR_KEYPAD_ICON: currChar = *textPrinter->printerTemplate.currentChar++; - gUnknown_03002F90.width = DrawKeypadIcon(textPrinter->printerTemplate.windowId, currChar, textPrinter->printerTemplate.currentX, textPrinter->printerTemplate.currentY); - textPrinter->printerTemplate.currentX += gUnknown_03002F90.width + textPrinter->printerTemplate.letterSpacing; + gCurGlyph.width = DrawKeypadIcon(textPrinter->printerTemplate.windowId, currChar, textPrinter->printerTemplate.currentX, textPrinter->printerTemplate.currentY); + textPrinter->printerTemplate.currentX += gCurGlyph.width + textPrinter->printerTemplate.letterSpacing; return 0; case EOS: return 1; @@ -1050,8 +1050,8 @@ u16 RenderText(struct TextPrinter *textPrinter) if (textPrinter->minLetterSpacing) { - textPrinter->printerTemplate.currentX += gUnknown_03002F90.width; - width = textPrinter->minLetterSpacing - gUnknown_03002F90.width; + textPrinter->printerTemplate.currentX += gCurGlyph.width; + width = textPrinter->minLetterSpacing - gCurGlyph.width; if (width > 0) { ClearTextSpan(textPrinter, width); @@ -1061,9 +1061,9 @@ u16 RenderText(struct TextPrinter *textPrinter) else { if (textPrinter->japanese) - textPrinter->printerTemplate.currentX += (gUnknown_03002F90.width + textPrinter->printerTemplate.letterSpacing); + textPrinter->printerTemplate.currentX += (gCurGlyph.width + textPrinter->printerTemplate.letterSpacing); else - textPrinter->printerTemplate.currentX += gUnknown_03002F90.width; + textPrinter->printerTemplate.currentX += gCurGlyph.width; } return 0; case 1: @@ -1499,8 +1499,8 @@ u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str) DecompressGlyphFont1(temp, 1); break; } - CpuCopy32(gUnknown_03002F90.unk0, pixels, 0x20); - CpuCopy32(gUnknown_03002F90.unk40, pixels + 0x20, 0x20); + CpuCopy32(gCurGlyph.gfxBufferTop, pixels, 0x20); + CpuCopy32(gCurGlyph.gfxBufferBottom, pixels + 0x20, 0x20); pixels += 0x40; break; } @@ -1592,30 +1592,30 @@ void DecompressGlyphFont0(u16 glyphId, bool32 isJapanese) if (isJapanese == 1) { glyphs = gFont0JapaneseGlyphs + (0x100 * (glyphId >> 0x4)) + (0x8 * (glyphId & 0xF)); - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x80, gUnknown_03002F90.unk40); // gUnknown_03002F90 + 0x40 - gUnknown_03002F90.width = 8; // gGlyphWidth - gUnknown_03002F90.height = 12; // gGlyphHeight + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom); + gCurGlyph.width = 8; + gCurGlyph.height = 12; } else { glyphs = gFont0LatinGlyphs + (0x20 * glyphId); - gUnknown_03002F90.width = gFont0LatinGlyphWidths[glyphId]; + gCurGlyph.width = gFont0LatinGlyphWidths[glyphId]; - if (gUnknown_03002F90.width <= 8) + if (gCurGlyph.width <= 8) { - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x10, gUnknown_03002F90.unk40); + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom); } else { - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x8, gUnknown_03002F90.unk20); - DecompressGlyphTile(glyphs + 0x10, gUnknown_03002F90.unk40); - DecompressGlyphTile(glyphs + 0x18, gUnknown_03002F90.unk60); + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8); + DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom); + DecompressGlyphTile(glyphs + 0x18, gCurGlyph.gfxBufferBottom + 8); } - gUnknown_03002F90.height = 13; + gCurGlyph.height = 13; } } @@ -1635,30 +1635,30 @@ void DecompressGlyphFont7(u16 glyphId, bool32 isJapanese) { int eff; glyphs = gFont1JapaneseGlyphs + (0x100 * (glyphId >> 0x4)) + (0x8 * (glyphId & (eff = 0xF))); // shh, no questions, only matching now - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x80, gUnknown_03002F90.unk40); // gUnknown_03002F90 + 0x40 - gUnknown_03002F90.width = 8; // gGlyphWidth - gUnknown_03002F90.height = 15; // gGlyphHeight + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom); + gCurGlyph.width = 8; + gCurGlyph.height = 15; } else { glyphs = gFont7LatinGlyphs + (0x20 * glyphId); - gUnknown_03002F90.width = gFont7LatinGlyphWidths[glyphId]; + gCurGlyph.width = gFont7LatinGlyphWidths[glyphId]; - if (gUnknown_03002F90.width <= 8) + if (gCurGlyph.width <= 8) { - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x10, gUnknown_03002F90.unk40); + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom); } else { - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x8, gUnknown_03002F90.unk20); - DecompressGlyphTile(glyphs + 0x10, gUnknown_03002F90.unk40); - DecompressGlyphTile(glyphs + 0x18, gUnknown_03002F90.unk60); + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8); + DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom); + DecompressGlyphTile(glyphs + 0x18, gCurGlyph.gfxBufferBottom + 8); } - gUnknown_03002F90.height = 15; + gCurGlyph.height = 15; } } @@ -1677,30 +1677,30 @@ void DecompressGlyphFont8(u16 glyphId, bool32 isJapanese) if (isJapanese == TRUE) { glyphs = gFont0JapaneseGlyphs + (0x100 * (glyphId >> 0x4)) + (0x8 * (glyphId & 0xF)); - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x80, gUnknown_03002F90.unk40); // gUnknown_03002F90 + 0x40 - gUnknown_03002F90.width = 8; // gGlyphWidth - gUnknown_03002F90.height = 12; // gGlyphHeight + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom); + gCurGlyph.width = 8; + gCurGlyph.height = 12; } else { glyphs = gFont8LatinGlyphs + (0x20 * glyphId); - gUnknown_03002F90.width = gFont8LatinGlyphWidths[glyphId]; + gCurGlyph.width = gFont8LatinGlyphWidths[glyphId]; - if (gUnknown_03002F90.width <= 8) + if (gCurGlyph.width <= 8) { - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x10, gUnknown_03002F90.unk40); + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom); } else { - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x8, gUnknown_03002F90.unk20); - DecompressGlyphTile(glyphs + 0x10, gUnknown_03002F90.unk40); - DecompressGlyphTile(glyphs + 0x18, gUnknown_03002F90.unk60); + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8); + DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom); + DecompressGlyphTile(glyphs + 0x18, gCurGlyph.gfxBufferBottom + 8); } - gUnknown_03002F90.height = 12; + gCurGlyph.height = 12; } } @@ -1719,32 +1719,32 @@ void DecompressGlyphFont2(u16 glyphId, bool32 isJapanese) if (isJapanese == TRUE) { glyphs = gFont2JapaneseGlyphs + (0x100 * (glyphId >> 0x3)) + (0x10 * (glyphId & 0x7)); - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x8, gUnknown_03002F90.unk20); // gUnknown_03002F90 + 0x40 - DecompressGlyphTile(glyphs + 0x80, gUnknown_03002F90.unk40); // gUnknown_03002F90 + 0x20 - DecompressGlyphTile(glyphs + 0x88, gUnknown_03002F90.unk60); // gUnknown_03002F90 + 0x60 - gUnknown_03002F90.width = gFont2JapaneseGlyphWidths[glyphId]; // gGlyphWidth - gUnknown_03002F90.height = 14; // gGlyphHeight + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8); + DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom); // gCurGlyph + 0x20 + DecompressGlyphTile(glyphs + 0x88, gCurGlyph.gfxBufferBottom + 8); // gCurGlyph + 0x60 + gCurGlyph.width = gFont2JapaneseGlyphWidths[glyphId]; + gCurGlyph.height = 14; } else { glyphs = gFont2LatinGlyphs + (0x20 * glyphId); - gUnknown_03002F90.width = gFont2LatinGlyphWidths[glyphId]; + gCurGlyph.width = gFont2LatinGlyphWidths[glyphId]; - if (gUnknown_03002F90.width <= 8) + if (gCurGlyph.width <= 8) { - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x10, gUnknown_03002F90.unk40); + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom); } else { - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x8, gUnknown_03002F90.unk20); - DecompressGlyphTile(glyphs + 0x10, gUnknown_03002F90.unk40); - DecompressGlyphTile(glyphs + 0x18, gUnknown_03002F90.unk60); + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8); + DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom); + DecompressGlyphTile(glyphs + 0x18, gCurGlyph.gfxBufferBottom + 8); } - gUnknown_03002F90.height = 14; + gCurGlyph.height = 14; } } @@ -1764,30 +1764,30 @@ void DecompressGlyphFont1(u16 glyphId, bool32 isJapanese) { int eff; glyphs = gFont1JapaneseGlyphs + (0x100 * (glyphId >> 0x4)) + (0x8 * (glyphId & (eff = 0xF))); // shh, no questions, only matching now - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x80, gUnknown_03002F90.unk40); // gUnknown_03002F90 + 0x40 - gUnknown_03002F90.width = 8; // gGlyphWidth - gUnknown_03002F90.height = 15; // gGlyphHeight + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom); + gCurGlyph.width = 8; + gCurGlyph.height = 15; } else { glyphs = gFont1LatinGlyphs + (0x20 * glyphId); - gUnknown_03002F90.width = gFont1LatinGlyphWidths[glyphId]; + gCurGlyph.width = gFont1LatinGlyphWidths[glyphId]; - if (gUnknown_03002F90.width <= 8) + if (gCurGlyph.width <= 8) { - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x10, gUnknown_03002F90.unk40); + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom); } else { - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x8, gUnknown_03002F90.unk20); - DecompressGlyphTile(glyphs + 0x10, gUnknown_03002F90.unk40); - DecompressGlyphTile(glyphs + 0x18, gUnknown_03002F90.unk60); + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8); + DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom); + DecompressGlyphTile(glyphs + 0x18, gCurGlyph.gfxBufferBottom + 8); } - gUnknown_03002F90.height = 15; + gCurGlyph.height = 15; } } @@ -1804,8 +1804,8 @@ void DecompressGlyphFont9(u16 glyphId) const u16* glyphs; glyphs = gFont9JapaneseGlyphs + (0x100 * (glyphId >> 4)) + (0x8 * (glyphId & 0xF)); - DecompressGlyphTile(glyphs, gUnknown_03002F90.unk0); - DecompressGlyphTile(glyphs + 0x80, gUnknown_03002F90.unk40); - gUnknown_03002F90.width = 8; - gUnknown_03002F90.height = 12; + DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); + DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom); + gCurGlyph.width = 8; + gCurGlyph.height = 12; } -- cgit v1.2.3 From 3e725272fc8b8f2ea825783771d54104d1f25e82 Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Fri, 9 Apr 2021 22:39:34 -0400 Subject: standardize "grey" to "gray" --- gflib/text.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gflib/text.c') diff --git a/gflib/text.c b/gflib/text.c index e456a695d..445a7b1be 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -1416,9 +1416,9 @@ u8 RenderTextFont9(u8 *pixels, u8 fontId, u8 *str) fgColor = TEXT_COLOR_WHITE; bgColor = TEXT_COLOR_TRANSPARENT; - shadowColor = TEXT_COLOR_LIGHT_GREY; + shadowColor = TEXT_COLOR_LIGHT_GRAY; - GenerateFontHalfRowLookupTable(TEXT_COLOR_WHITE, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_LIGHT_GREY); + GenerateFontHalfRowLookupTable(TEXT_COLOR_WHITE, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_LIGHT_GRAY); strLocal = str; strPos = 0; -- cgit v1.2.3 From dfd87e09f95910c6ce3b0b9d955e179d6d65951f Mon Sep 17 00:00:00 2001 From: Kurausukun Date: Sun, 2 May 2021 20:56:30 -0400 Subject: [LEAK-INFORMED] fix text.c "eff" fakematch --- gflib/text.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'gflib/text.c') diff --git a/gflib/text.c b/gflib/text.c index 445a7b1be..eb993c421 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -1632,8 +1632,7 @@ void DecompressGlyphFont7(u16 glyphId, bool32 isJapanese) if (isJapanese == TRUE) { - int eff; - glyphs = gFont1JapaneseGlyphs + (0x100 * (glyphId >> 0x4)) + (0x8 * (glyphId & (eff = 0xF))); // shh, no questions, only matching now + glyphs = gFont1JapaneseGlyphs + (0x100 * (glyphId >> 0x4)) + (0x8 * (glyphId % 0x10)); DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom); gCurGlyph.width = 8; @@ -1761,8 +1760,7 @@ void DecompressGlyphFont1(u16 glyphId, bool32 isJapanese) if (isJapanese == TRUE) { - int eff; - glyphs = gFont1JapaneseGlyphs + (0x100 * (glyphId >> 0x4)) + (0x8 * (glyphId & (eff = 0xF))); // shh, no questions, only matching now + glyphs = gFont1JapaneseGlyphs + (0x100 * (glyphId >> 0x4)) + (0x8 * (glyphId % 0x10)); DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop); DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom); gCurGlyph.width = 8; -- cgit v1.2.3