DXGL r282 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r281‎ | r282 | r283 >
Date:01:03, 11 December 2012
Author:admin
Status:new
Tags:
Comment:
Partially fix ambient calculation.
Modified paths:
  • /ddraw/shadergen.cpp (modified) (history)

Diff [purge]

Index: ddraw/shadergen.cpp
@@ -279,7 +279,7 @@
280280 static const char op_dirlight[] = "DirLight(lightX);\n";
281281 static const char op_pointlight[] = "PointLight(lightX);\n";
282282 static const char op_spotlight[] = "SpotLight(lightX);\n";
283 -static const char op_colorout[] = "gl_FrontColor = (gl_FrontMaterial.diffuse * diffuse) + (gl_FrontMaterial.ambient + ambient)\n\
 283+static const char op_colorout[] = "gl_FrontColor = (gl_FrontMaterial.diffuse * diffuse) + (gl_FrontMaterial.ambient * ambient)\n\
284284 + (gl_FrontMaterial.specular * specular) + gl_FrontMaterial.emission;\n\
285285 gl_FrontSecondaryColor = (gl_FrontMaterial.specular * specular);\n";
286286 static const char op_colorvert[] = "gl_FrontColor = rgba0.bgra;\n";
@@ -528,7 +528,7 @@
529529 if((matcolor == D3DMCS_COLOR1) && hascolor1) vsrc->append(colorargs[4]);
530530 else if((matcolor == D3DMCS_COLOR2) && hascolor2) vsrc->append(colorargs[5]);
531531 else vsrc->append(colorargs[1]);
532 - vsrc->append(" + ambient)\n+ (");
 532+ vsrc->append(" * ambient)\n+ (");
533533 matcolor = ((id>>25)&3);
534534 if((matcolor == D3DMCS_COLOR1) && hascolor1) vsrc->append(colorargs[4]);
535535 else if((matcolor == D3DMCS_COLOR2) && hascolor2) vsrc->append(colorargs[5]);