Added texture data format support

This commit is contained in:
2023-06-20 08:35:28 -07:00
parent 811271dc5d
commit 9574e9a3e9
32 changed files with 189 additions and 57 deletions

View File

@ -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;
}

View File

@ -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;