From 84bfa26bc71303114089a53f1af10fae99ff98c3 Mon Sep 17 00:00:00 2001 From: zeromus Date: Wed, 7 Jul 2010 05:12:09 +0000 Subject: [PATCH] rasterizer: apparently decal needs a special case for texture-disable after all. --- desmume/src/rasterize.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/desmume/src/rasterize.cpp b/desmume/src/rasterize.cpp index 35d3649c3..45f3b9ebb 100644 --- a/desmume/src/rasterize.cpp +++ b/desmume/src/rasterize.cpp @@ -482,13 +482,16 @@ public: //#endif break; case 1: //decal - u = shader.invu*shader.w; - v = shader.invv*shader.w; - texColor = sample(u,v); - dst.r = decal_table[texColor.a][texColor.r][shader.materialColor.r]; - dst.g = decal_table[texColor.a][texColor.g][shader.materialColor.g]; - dst.b = decal_table[texColor.a][texColor.b][shader.materialColor.b]; - dst.a = shader.materialColor.a; + if(sampler.enabled) + { + u = shader.invu*shader.w; + v = shader.invv*shader.w; + texColor = sample(u,v); + dst.r = decal_table[texColor.a][texColor.r][shader.materialColor.r]; + dst.g = decal_table[texColor.a][texColor.g][shader.materialColor.g]; + dst.b = decal_table[texColor.a][texColor.b][shader.materialColor.b]; + dst.a = shader.materialColor.a; + } else dst = shader.materialColor; break; case 2: //toon/highlight shading {