From 568eaa66e5687c7bb2b4a3a05e9ea8bfbc7e7554 Mon Sep 17 00:00:00 2001 From: Spoike Date: Wed, 14 Sep 2005 04:16:36 +0000 Subject: [PATCH] This fixes a few quirks seen in q3bsps. We no longer depthsort textures, but sort by shader instead. this is more similar to how q3 works. models are still going to be wierd though. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1313 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/gl_q2bsp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/engine/common/gl_q2bsp.c b/engine/common/gl_q2bsp.c index 6e8f53cf1..478dc6b77 100644 --- a/engine/common/gl_q2bsp.c +++ b/engine/common/gl_q2bsp.c @@ -2396,7 +2396,7 @@ mesh_t *GL_CreateMeshForPatch (model_t *mod, int patchwidth, int patchheight, in void CModQ3_SortShaders(void) { -/* texture_t *textemp; + texture_t *textemp; int i, j; //sort loadmodel->textures //correct pointers in loadmodel->texinfo @@ -2405,19 +2405,19 @@ void CModQ3_SortShaders(void) { for (j = i+1; j < numtexinfo; j++) { - if (!loadmodel->textures[i]->shader || (loadmodel->textures[j]->shader && loadmodel->textures[j]->shader->sort > loadmodel->textures[i]->shader->sort)) + if ((loadmodel->textures[i]->shader && loadmodel->textures[j]->shader) && (loadmodel->textures[j]->shader->sort < loadmodel->textures[i]->shader->sort)) { textemp = loadmodel->textures[j]; loadmodel->textures[j] = loadmodel->textures[i]; loadmodel->textures[i] = textemp; - textemp = loadmodel->texinfo[j].texture; - loadmodel->texinfo[j].texture = loadmodel->texinfo[i].texture; - loadmodel->texinfo[i].texture = textemp; + if (skytexturenum==i) + skytexturenum=j; + else if (skytexturenum==j) + skytexturenum=i; } } } - */ } mesh_t nullmesh;