This commit is contained in:
MihailRis
2024-02-25 22:44:37 +03:00
parent d189bdc107
commit e06350915e
9 changed files with 284 additions and 236 deletions
+4 -2
View File
@@ -44,6 +44,8 @@ void Font::draw(Batch2D* batch, std::wstring text, int x, int y) {
static inline void drawGlyph(Batch2D* batch, int x, int y, uint c, FontStyle style) {
switch (style){
case FontStyle::none:
break;
case FontStyle::shadow:
batch->sprite(x+1, y+1, GLYPH_SIZE, GLYPH_SIZE, 16, c, SHADOW_TINT);
break;
@@ -57,7 +59,7 @@ static inline void drawGlyph(Batch2D* batch, int x, int y, uint c, FontStyle sty
}
break;
}
batch->sprite(x, y, GLYPH_SIZE, GLYPH_SIZE, 16, c, batch->color);
batch->sprite(x, y, GLYPH_SIZE, GLYPH_SIZE, 16, c, batch->getColor());
}
void Font::draw(Batch2D* batch, std::wstring text, int x, int y, FontStyle style) {
@@ -74,7 +76,7 @@ void Font::draw(Batch2D* batch, std::wstring_view text, int x, int y, FontStyle
x += 8;
continue;
}
int charpage = c >> 8;
uint charpage = c >> 8;
if (charpage == page){
Texture* texture = pages[charpage].get();
if (texture == nullptr){