First phase moving from STBTT to FreeType
This commit is contained in:
@ -15,7 +15,7 @@ TrueTypeAsset::TrueTypeAsset(AssetManager *assMan, std::string name) :
|
||||
|
||||
void TrueTypeAsset::updateSync() {
|
||||
if(this->state != 0x04) return;
|
||||
this->font.texture.setSize(this->width, this->height, TEXTURE_FORMAT_RGBA);
|
||||
this->font.texture.setSize(this->width, this->height, TEXTURE_FORMAT_R);
|
||||
this->font.texture.buffer(this->pixels);
|
||||
auto i = this->pixels;
|
||||
memoryCopy(
|
||||
@ -71,9 +71,9 @@ void TrueTypeAsset::updateAsync() {
|
||||
|
||||
this->state = 0x03;
|
||||
this->font.fontSize = fontSize;
|
||||
this->pixels = (struct Color*)(this->buffer + i);
|
||||
this->pixels = (uint8_t*)(this->buffer + i);
|
||||
this->characterData = (truetypechar_t*)(
|
||||
(uint8_t*)this->pixels + (this->width * this->height * sizeof(struct Color))
|
||||
(uint8_t*)this->pixels + (this->width * this->height * sizeof(uint8_t))
|
||||
);
|
||||
this->state = 0x04;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ namespace Dawn {
|
||||
AssetLoader loader;
|
||||
uint8_t *buffer = nullptr;
|
||||
truetypechar_t *characterData = nullptr;
|
||||
struct Color *pixels = nullptr;
|
||||
uint8_t *pixels = nullptr;
|
||||
int32_t width, height;
|
||||
|
||||
public:
|
||||
|
Reference in New Issue
Block a user