diff --git a/framework/TextureLoader.cpp b/framework/TextureLoader.cpp index bf4a8654..68714a3c 100644 --- a/framework/TextureLoader.cpp +++ b/framework/TextureLoader.cpp @@ -55,7 +55,7 @@ bool TextureLoader::loadFromMemory(char *data) uint8_t* coldata = reinterpret_cast(rootSection.raw() + sizeof(RW::BSSectionHeader) + sizeof(RW::BSTextureNative) + sizeof(RW::BSPaletteData) - 4); uint8_t fullColor[texNative.width * texNative.height * 4]; - bool hasAlpha = (texNative.rasterformat & 0x0500) == 0x0500; + bool hasAlpha = texNative.alpha == 1; for(size_t j = 0; j < texNative.width * texNative.height; ++j) { diff --git a/viewer/main.cpp b/viewer/main.cpp index 9626ff4b..8bf8e393 100644 --- a/viewer/main.cpp +++ b/viewer/main.cpp @@ -38,8 +38,9 @@ const char *fragmentShaderSource = "#version 130\n" "uniform sampler2D texture;" "void main()" "{" -// " gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);" -" gl_FragColor = texture2D(texture, TexCoords);" +" vec4 c = texture2D(texture, TexCoords);" +" if(c.a < 0.9) discard;" +" gl_FragColor = c;" "}"; GLuint uniModel, uniProj, uniView;