Skip to content

Commit

Permalink
Quick fix for patch atlas lookups for invalid characters
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Nov 20, 2024
1 parent 3fdd755 commit 3c6da71
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source_files/edge/hu_draw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1092,10 +1092,10 @@ void HUDDrawChar(float left_x, float top_y, const Image *img, char ch, float siz
(current_font->patch_font_cache_.atlas_rectangles.at(kCP437UnicodeValues[(uint8_t)ch]).offset_x * sc_x);
y -=
(current_font->patch_font_cache_.atlas_rectangles.at(kCP437UnicodeValues[(uint8_t)ch]).offset_y * sc_y);
tx1 = current_font->patch_font_cache_.atlas_rectangles.at((uint8_t)ch).texture_coordinate_x;
ty2 = current_font->patch_font_cache_.atlas_rectangles.at((uint8_t)ch).texture_coordinate_y;
tx2 = tx1 + current_font->patch_font_cache_.atlas_rectangles.at((uint8_t)ch).texture_coordinate_width;
ty1 = ty2 + current_font->patch_font_cache_.atlas_rectangles.at((uint8_t)ch).texture_coordinate_height;
tx1 = current_font->patch_font_cache_.atlas_rectangles.at(kCP437UnicodeValues[(uint8_t)ch]).texture_coordinate_x;
ty2 = current_font->patch_font_cache_.atlas_rectangles.at(kCP437UnicodeValues[(uint8_t)ch]).texture_coordinate_y;
tx2 = tx1 + current_font->patch_font_cache_.atlas_rectangles.at(kCP437UnicodeValues[(uint8_t)ch]).texture_coordinate_width;
ty1 = ty2 + current_font->patch_font_cache_.atlas_rectangles.at(kCP437UnicodeValues[(uint8_t)ch]).texture_coordinate_height;
}
}
else // spritesheet font
Expand Down

0 comments on commit 3c6da71

Please sign in to comment.