Fix regression

Fixed a bug introduced when removing SOIL that'd cause non-alpha PNGs to display incorrectly.
This commit is contained in:
2024-06-21 19:38:00 -04:00
parent 4405c9dff6
commit d8dc4d9b82
2 changed files with 2 additions and 2 deletions

View File

@@ -56,7 +56,7 @@ CPMAddPackage(
CPMAddPackage(
NAME ReTexture
URL https://git.redacted.cc/Redacted/ReTexture/archive/vA0.1.zip
URL https://git.redacted.cc/Redacted/ReTexture/archive/Prerelease-1.zip
)
CPMAddPackage(

View File

@@ -9,7 +9,7 @@ void Texture::load(Entity* entity, const std::string& file, bool storeOnTextureL
if (texture->format == RTextureFormat::RGBA)
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texture->width, texture->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture->pixelData.data());
if (texture->format == RTextureFormat::RGB)
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, texture->width, texture->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, texture->pixelData.data());
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, texture->width, texture->height, 0, GL_RGB, GL_UNSIGNED_BYTE, texture->pixelData.data());
delete texture;
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);