DXGL r331 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r330‎ | r331 | r332 >
Date:01:38, 22 February 2013
Author:admin
Status:new
Tags:
Comment:
Add a couple viewport variables.
Adjust D3DTLVERTEX pixel coordinates to half-pixel positions.
Modified paths:
  • /ddraw/glDirect3DViewport.cpp (modified) (history)
  • /ddraw/shadergen.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirect3DViewport.cpp
@@ -294,6 +294,8 @@
295295 vp.dvClipX = viewport.dvClipX;
296296 vp.dvClipY = viewport.dvClipY;
297297 viewport = vp;
 298+ maxX = lpData->dvMaxX;
 299+ maxY = lpData->dvMaxY;
298300 scaleX = lpData->dvScaleX;
299301 scaleY = lpData->dvScaleY;
300302 if(current && device) Sync();
Index: ddraw/shadergen.cpp
@@ -280,7 +280,7 @@
281281 gl_Position = vec4(pos.x,-pos.y,pos.z,pos.w);\n";
282282 static const char op_normalize[] = "N = normalize(gl_NormalMatrix*nxyz);\n";
283283 static const char op_normalpassthru[] = "N = gl_NormalMatrix*nxyz;\n";
284 -static const char op_passthru[] = "gl_Position = vec4(((xyz.x)/(width/2.0))-1.0,((xyz.y)/(height/2.0))-1.0,(xyz.z),1.0);\n";
 284+static const char op_passthru[] = "gl_Position = vec4(((xyz.x+.5)/(width/2.0))-1.0,((xyz.y+.5)/(height/2.0))-1.0,(xyz.z),1.0);\n";
285285 static const char op_resetcolor[] = "diffuse = specular = vec4(0.0);\n\
286286 ambient = ambientcolor / 255.0;\n";
287287 static const char op_dirlight[] = "DirLight(lightX);\n";