MYST3: Fixed tglTexImage2D calls in software renderer

This commit is contained in:
Paweł Kołodziejski 2021-12-04 15:59:34 +01:00
parent 6c34b70f89
commit 3ed4be59c8
No known key found for this signature in database
GPG Key ID: 0BDADC9E74440FF7

View File

@ -41,7 +41,7 @@ TinyGLTexture::TinyGLTexture(const Graphics::Surface *surface) {
tglGenTextures(1, &id);
tglBindTexture(TGL_TEXTURE_2D, id);
tglTexImage2D(TGL_TEXTURE_2D, 0, 3, width, height, 0, internalFormat, sourceFormat, nullptr);
tglTexImage2D(TGL_TEXTURE_2D, 0, internalFormat, width, height, 0, internalFormat, sourceFormat, nullptr);
tglTexParameteri(TGL_TEXTURE_2D, TGL_TEXTURE_MIN_FILTER, TGL_LINEAR);
tglTexParameteri(TGL_TEXTURE_2D, TGL_TEXTURE_MAG_FILTER, TGL_LINEAR);
@ -60,7 +60,7 @@ TinyGLTexture::~TinyGLTexture() {
void TinyGLTexture::update(const Graphics::Surface *surface) {
tglBindTexture(TGL_TEXTURE_2D, id);
tglTexImage2D(TGL_TEXTURE_2D, 0, 3, width, height, 0,
tglTexImage2D(TGL_TEXTURE_2D, 0, internalFormat, width, height, 0,
internalFormat, sourceFormat, const_cast<void *>(surface->getPixels())); // TESTME: Not sure if it works.
Graphics::tglUploadBlitImage(_blitImage, *surface, 0, false);
}