DXGL r378 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r377
|
r378
|
r379
>
Date:
22:31, 15 May 2013
Author:
admin
Status:
new
Tags:
Comment:
Use GL_R8 format for 8-bit surfaces on GL 3.0 and above.
Set G and B values of color key shader uniform to 0 on GL 3.0 and above.
Adjust color key float-to-int conversion.
Modified paths:
/ddraw/glRenderer.cpp
(modified) (
history
)
/ddraw/shaders.cpp
(modified) (
history
)
/ddraw/texture.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glRenderer.cpp
—
—
@@ -930,7 +930,8 @@
931
931
switch(ddInterface->GetBPP())
932
932
{
933
933
case 8:
934
- glUniform3i(shaders[progtype].ckey,src->colorkey[0].key.dwColorSpaceHighValue,src->colorkey[0].key.dwColorSpaceHighValue,
934
+ if(glver_major >= 3) glUniform3i(shaders[progtype].ckey,src->colorkey[0].key.dwColorSpaceHighValue,0,0);
935
+ else glUniform3i(shaders[progtype].ckey,src->colorkey[0].key.dwColorSpaceHighValue,src->colorkey[0].key.dwColorSpaceHighValue,
935
936
src->colorkey[0].key.dwColorSpaceHighValue);
936
937
break;
937
938
case 15:
Index: ddraw/shaders.cpp
—
—
@@ -58,7 +58,7 @@
59
59
void main (void)\n\
60
60
{\n\
61
61
vec4 value = texture2D(tex0, vec2(gl_TexCoord[0]));\n\
62
- ivec3 comp = ivec3(texture2D(tex0, vec2(gl_TexCoord[0]))*255.0);\n\
62
+ ivec3 comp = ivec3(texture2D(tex0, vec2(gl_TexCoord[0]))*255.5);\n\
63
63
if (comp == ckey)\n\
64
64
discard;\n\
65
65
gl_FragColor = value;\n\
—
—
@@ -71,7 +71,7 @@
72
72
void main (void)\n\
73
73
{\n\
74
74
vec4 value = texture2D(tex0, vec2(gl_TexCoord[0]));\n\
75
- ivec4 comp = ivec4(texture2D(tex0, vec2(gl_TexCoord[0]))*255.0);\n\
75
+ ivec4 comp = ivec4(texture2D(tex0, vec2(gl_TexCoord[0]))*255.5);\n\
76
76
if (comp == ckey)\n\
77
77
gl_FragColor[0] = 1.0;\n\
78
78
else gl_FragColor[0] = 0.0;\n\
—
—
@@ -85,10 +85,10 @@
86
86
void main (void)\n\
87
87
{\n\
88
88
vec4 value = texture2D(tex0, vec2(gl_TexCoord[0]));\n\
89
- ivec4 comp = ivec4(texture2D(tex0, vec2(gl_TexCoord[0]))*255.0);\n\
89
+ ivec4 comp = ivec4(texture2D(tex0, vec2(gl_TexCoord[0]))*255.5);\n\
90
90
if (comp == ckey)\n\
91
91
discard;\n\
92
- ivec4 comp2 = ivec4(texture2D(tex1,vec2(gl_TexCoord[1]))*255.0);\n\
92
+ ivec4 comp2 = ivec4(texture2D(tex1,vec2(gl_TexCoord[1]))*255.5);\n\
93
93
if(comp2[0] == 0)\n\
94
94
discard;\n\
95
95
gl_FragColor = value;\n\
Index: ddraw/texture.cpp
—
—
@@ -69,8 +69,8 @@
70
70
case 0: // 8-bit palette
71
71
if(glver_major >= 3)
72
72
{
73
- texture->internalformat = GL_LUMINANCE8;
74
- texture->format = GL_LUMINANCE;
73
+ texture->internalformat = GL_R8;
74
+ texture->format = GL_RED;
75
75
}
76
76
else
77
77
{
Navigation menu
Personal tools
Log in
Namespaces
Special page
English
expanded
collapsed
Views
More
expanded
collapsed
Search
Navigation
Home
Main page
Recent changes
Random page
MediaWiki help
Introduction
Progress
Downloads
Source code
Build from source
AppDB
Bug reports
Forums
Tools
Special pages
Printable version