Skip to content

Commit

Permalink
rm unnecessary field from Glyph;
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornbytes committed Jun 5, 2024
1 parent 52f135d commit 5b6e156
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/modules/graphics/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ struct Material {
};

typedef struct {
uint32_t codepoint;
float advance;
uint16_t x, y;
uint16_t uv[4];
Expand Down Expand Up @@ -3581,7 +3580,6 @@ static Glyph* lovrFontGetGlyph(Font* font, uint32_t codepoint, bool* resized) {
map_set(&font->glyphLookup, hash, font->glyphs.length);
Glyph* glyph = &font->glyphs.data[font->glyphs.length++];

glyph->codepoint = codepoint;
glyph->advance = lovrRasterizerGetAdvance(font->info.rasterizer, codepoint);

if (lovrRasterizerIsGlyphEmpty(font->info.rasterizer, codepoint)) {
Expand Down Expand Up @@ -3693,7 +3691,7 @@ static Glyph* lovrFontGetGlyph(Font* font, uint32_t codepoint, bool* resized) {

size_t stack = tempPush(&state.allocator);
float* pixels = tempAlloc(&state.allocator, pixelWidth * pixelHeight * 4 * sizeof(float));
lovrRasterizerGetPixels(font->info.rasterizer, glyph->codepoint, pixels, pixelWidth, pixelHeight, font->info.spread);
lovrRasterizerGetPixels(font->info.rasterizer, codepoint, pixels, pixelWidth, pixelHeight, font->info.spread);
BufferView view = getBuffer(GPU_BUFFER_UPLOAD, pixelWidth * pixelHeight * 4 * sizeof(uint8_t), 64);
float* src = pixels;
uint8_t* dst = view.pointer;
Expand Down

0 comments on commit 5b6e156

Please sign in to comment.