Palm-Studios / sh3redux

SILENT HILL 3 Engine Remake in OpenGL and C++
GNU General Public License v3.0
162 stars 16 forks source link

Fixed 8-bit textures not displaying #119

Closed Quaker762 closed 6 years ago

Quaker762 commented 6 years ago

There was a problem with the texture type in texture.cpp for 8-bit paletted textures. This has now been rectified.

Quaker762 commented 6 years ago

There might be a problem with the 16-bit textures, we'll need to test them before pull.

z33ky commented 6 years ago

I couldn't find a 16-bit texture in the trial version, though I can confirm this fixes paletted textures.

z33ky commented 6 years ago

Actually, I think the proper fix is making the palette be a std::vector of rgba instead of bgra

Quaker762 commented 6 years ago

Actually, I think the proper fix is making the palette be a std::vector of rgba instead of bgra

How do you mean? According to the debugger I was using it was caused by an invalid OpenGL source texture format. Are you referring to 16-bit textures?

z33ky commented 6 years ago

Well, type should still be changed to GL_UNSIGNED_BYTE, but I think srcFormat should stay GL_RGB, since we're decoding the texture that way (see line 307-309, 320-322). The actual issue is that the pallette should be rgba I think; it just works with the current change because two wrongs make a right in this case.

Quaker762 commented 6 years ago

@z33ky Ahhh I see what you mean, I was under the assumption that pallete was a bgra. I've fixed it up.