DXGL r203 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r202‎ | r203 | r204 >
Date:18:29, 5 July 2012
Author:admin
Status:new
Tags:
Comment:
Fix texture stage shaders.
Modified paths:
  • /ddraw/shadergen.cpp (modified) (history)

Diff [purge]

Index: ddraw/shadergen.cpp
@@ -157,7 +157,10 @@
158158 {
159159 if(genshaders[i].id == id)
160160 {
161 - if(!memcmp(genshaders[i].texids,texstate,8*sizeof(__int64)))
 161+ bool texidmatch = true;
 162+ for(int j = 0; j < 8; j++)
 163+ if(genshaders[i].texids[j] != texstate[j].shaderid) texidmatch = false;
 164+ if(texidmatch)
162165 {
163166 if(!memcmp(genshaders[i].texcoords,texcoords,8*sizeof(int)))
164167 {
@@ -187,7 +190,8 @@
188191 if(genindex >= 256) genindex = 0;
189192 }
190193 genshaders[shaderindex].id = id;
191 - memcpy(genshaders[shaderindex].texids,texstate,8*sizeof(__int64));
 194+ for(int i = 0; i < 8; i++)
 195+ genshaders[shaderindex].texids[i] = texstate[i].shaderid;
192196 memcpy(genshaders[shaderindex].texcoords,texcoords,8*sizeof(int));
193197 glUseProgram(genshaders[shaderindex].shader.prog);
194198 current_prog = genshaders[shaderindex].shader.prog;