mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
refactor
This commit is contained in:
parent
d189bdc107
commit
e06350915e
9 changed files with 284 additions and 236 deletions
|
|
@ -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){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue