Added texture data format support
This commit is contained in:
@ -22,7 +22,7 @@ void TextureAsset::updateSync() {
|
||||
this->state = 0x04;
|
||||
|
||||
|
||||
this->texture.setSize(this->width, this->height, this->format);
|
||||
this->texture.setSize(this->width, this->height, this->format, TEXTURE_DATA_FORMAT_UNSIGNED_BYTE);
|
||||
this->texture.buffer(this->colors);
|
||||
|
||||
this->texture.wrapModeX = this->wrapModeX;
|
||||
@ -57,7 +57,7 @@ void TextureAsset::updateAsync() {
|
||||
|
||||
switch(parseState) {
|
||||
case TEXTURE_ASSET_HEADER_PARSE_STATE_VERSION: {
|
||||
auto compared = strcmp(integer, "DT_1.00");
|
||||
auto compared = strcmp(integer, "DT_2.00");
|
||||
assertTrue(compared == 0);
|
||||
j = 0;
|
||||
parseState = TEXTURE_ASSET_HEADER_PARSE_STATE_WIDTH;
|
||||
@ -120,7 +120,7 @@ void TextureAsset::updateAsync() {
|
||||
}
|
||||
}
|
||||
|
||||
this->colors = (struct Color *)((void *)(this->buffer + i));
|
||||
this->colors = (uint8_t*)((void *)(this->buffer + i));
|
||||
this->state = 0x03;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ namespace Dawn {
|
||||
AssetLoader loader;
|
||||
uint8_t *buffer = nullptr;
|
||||
int32_t width = -1, height = -1;
|
||||
struct Color *colors;
|
||||
uint8_t *colors;
|
||||
enum TextureFormat format;
|
||||
enum TextureWrapMode wrapModeX;
|
||||
enum TextureWrapMode wrapModeY;
|
||||
|
Reference in New Issue
Block a user