1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-24 17:49:52 +01:00

make rgb555 hack working on older hardware as well

This commit is contained in:
FunkyFr3sh 2023-09-06 22:55:54 +02:00
parent d93a78b2a0
commit 0eda9d21e1
2 changed files with 27 additions and 11 deletions

View File

@ -205,7 +205,7 @@ void oglu_init()
g_oglu_got_version2 = glGetUniformLocation && glActiveTexture && glUniform1i; g_oglu_got_version2 = glGetUniformLocation && glActiveTexture && glUniform1i;
g_oglu_got_version3 = glGenFramebuffers && glBindFramebuffer && glFramebufferTexture2D && glDrawBuffers && g_oglu_got_version3 = glGenFramebuffers&& glBindFramebuffer&& glFramebufferTexture2D&& glDrawBuffers&&
glCheckFramebufferStatus && glUniform4f && glActiveTexture && glUniform1i && glCheckFramebufferStatus && glUniform4f && glActiveTexture && glUniform1i &&
glGetAttribLocation && glGenBuffers && glBindBuffer && glBufferData && glVertexAttribPointer && glGetAttribLocation && glGenBuffers && glBindBuffer && glBufferData && glVertexAttribPointer &&
glEnableVertexAttribArray && glUniform2fv && glUniformMatrix4fv && glGenVertexArrays && glBindVertexArray && glEnableVertexAttribArray && glUniform2fv && glUniformMatrix4fv && glGenVertexArrays && glBindVertexArray &&

View File

@ -261,16 +261,32 @@ static void ogl_create_textures(int width, int height)
} }
else if (g_ddraw->bpp == 16 && g_ddraw->rgb555) else if (g_ddraw->bpp == 16 && g_ddraw->rgb555)
{ {
glTexImage2D( if (g_oglu_got_version3)
GL_TEXTURE_2D, {
0, glTexImage2D(
GL_RG8, GL_TEXTURE_2D,
g_ogl.surface_tex_width, 0,
g_ogl.surface_tex_height, GL_RG8,
0, g_ogl.surface_tex_width,
g_ogl.surface_format = GL_RG, g_ogl.surface_tex_height,
g_ogl.surface_type = GL_UNSIGNED_BYTE, 0,
0); g_ogl.surface_format = GL_RG,
g_ogl.surface_type = GL_UNSIGNED_BYTE,
0);
}
else
{
glTexImage2D(
GL_TEXTURE_2D,
0,
GL_RGBA8,
g_ogl.surface_tex_width,
g_ogl.surface_tex_height,
0,
g_ogl.surface_format = GL_BGRA,
g_ogl.surface_type = GL_UNSIGNED_SHORT_1_5_5_5_REV,
0);
}
} }
else if (g_ddraw->bpp == 16) else if (g_ddraw->bpp == 16)
{ {