Skip to content

Fix "Colormatic" splash text rendering as single color#1017

Open
ayushthoren wants to merge 1 commit intosmartcmd:mainfrom
ayushthoren:font-color-fix
Open

Fix "Colormatic" splash text rendering as single color#1017
ayushthoren wants to merge 1 commit intosmartcmd:mainfrom
ayushthoren:font-color-fix

Conversation

@ayushthoren
Copy link
Contributor

Description

A font rendering bug would cause the last color code in a string to apply to the whole thing.

Changes

Previous Behavior

The Colormaitc splash (§1C§2o§3l§4o§5r§6m§7a§8t§9i§ac) rendered in one flat color instead of showing per-segment colors.

Root Cause

Font::draw put all glyphs together in the same tesselator batch while handling § color codes. Because the batch was not flushed on color transitions, earlier glyphs did not preserve their intended colors.

New Behavior

Splash strings containing § color codes now render with the correct per-segment colors.

Fix Implementation

In Minecraft.Client/Font.cpp, when a valid color code is parsed in Font::draw, the renderer now:

  • Ends the current tesselator batch.
  • Applies the new color with glColor3f.
  • Begins a new tesselator batch.

This ensures previous glyphs keep their original color and new ones use the updated color.

AI Use Disclosure

I did not use AI to fix this issue.

Related Issues

  • Fixes Discord Thread 1480350614977384550

How it looked before:

image

How it looks after:

image

Signed-off-by: Ayush Thoren <ayushthoren@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant