summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--med.c18
-rw-r--r--vis.c18
2 files changed, 18 insertions, 18 deletions
diff --git a/med.c b/med.c
index 8de1656..4ba9d30 100644
--- a/med.c
+++ b/med.c
@@ -280,10 +280,10 @@ gouraudshader(FSparams *sp)
{
Color tc, c;
- if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0)
- tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler);
- else if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0)
+ if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0)
tc = sampletexture(sp->su->entity->mdl->tex, sp->v.uv, tsampler);
+ else if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0)
+ tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler);
else
tc = Pt3(1,1,1,1);
@@ -376,10 +376,10 @@ phongshader(FSparams *sp)
specular = mulpt3(lightc, spec*Ks);
specular = modulapt3(specular, m.specular);
- if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0)
- tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler);
- else if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0)
+ if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0)
tc = sampletexture(sp->su->entity->mdl->tex, sp->v.uv, tsampler);
+ else if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0)
+ tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler);
else
tc = Pt3(1,1,1,1);
@@ -403,10 +403,10 @@ identshader(FSparams *sp)
{
Color tc, c;
- if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0)
- tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler);
- else if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0)
+ if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0)
tc = sampletexture(sp->su->entity->mdl->tex, sp->v.uv, tsampler);
+ else if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0)
+ tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler);
else
tc = Pt3(1,1,1,1);
diff --git a/vis.c b/vis.c
index c9aabc3..e43ac08 100644
--- a/vis.c
+++ b/vis.c
@@ -165,10 +165,10 @@ gouraudshader(FSparams *sp)
{
Color tc;
- if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0)
- tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler);
- else if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0)
+ if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0)
tc = sampletexture(sp->su->entity->mdl->tex, sp->v.uv, tsampler);
+ else if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0)
+ tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler);
else
tc = Pt3(1,1,1,1);
@@ -262,10 +262,10 @@ phongshader(FSparams *sp)
specular = mulpt3(lightc, spec*Ks);
specular = modulapt3(specular, m.specular);
- if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0)
- tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler);
- else if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0)
+ if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0)
tc = sampletexture(sp->su->entity->mdl->tex, sp->v.uv, tsampler);
+ else if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0)
+ tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler);
else
tc = Pt3(1,1,1,1);
@@ -321,10 +321,10 @@ identshader(FSparams *sp)
{
Color tc;
- if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0)
- tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler);
- else if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0)
+ if(sp->su->entity->mdl->tex != nil && sp->v.uv.w != 0)
tc = sampletexture(sp->su->entity->mdl->tex, sp->v.uv, tsampler);
+ else if(sp->v.mtl != nil && sp->v.mtl->diffusemap != nil && sp->v.uv.w != 0)
+ tc = sampletexture(sp->v.mtl->diffusemap, sp->v.uv, tsampler);
else
tc = Pt3(1,1,1,1);