summaryrefslogtreecommitdiffstats
path: root/src/extras/custompipes_d3d9.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2021-01-10 13:05:34 +0100
committeraap <aap@papnet.eu>2021-01-10 13:05:34 +0100
commit453405f131f91e601f0300a3c4fbe0b689880431 (patch)
tree9cb5f34cb35641bef51b2d569bd2127a2937c9ea /src/extras/custompipes_d3d9.cpp
parentenv map rendering (diff)
downloadre3-453405f131f91e601f0300a3c4fbe0b689880431.tar
re3-453405f131f91e601f0300a3c4fbe0b689880431.tar.gz
re3-453405f131f91e601f0300a3c4fbe0b689880431.tar.bz2
re3-453405f131f91e601f0300a3c4fbe0b689880431.tar.lz
re3-453405f131f91e601f0300a3c4fbe0b689880431.tar.xz
re3-453405f131f91e601f0300a3c4fbe0b689880431.tar.zst
re3-453405f131f91e601f0300a3c4fbe0b689880431.zip
Diffstat (limited to '')
-rw-r--r--src/extras/custompipes_d3d9.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/extras/custompipes_d3d9.cpp b/src/extras/custompipes_d3d9.cpp
index 2483bb30..c4505b75 100644
--- a/src/extras/custompipes_d3d9.cpp
+++ b/src/extras/custompipes_d3d9.cpp
@@ -733,6 +733,9 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
for(rw::uint32 i = 0; i < building->instHeader->numMeshes; i++, inst++){
Material *m = inst->material;
+ if(m->texture == nil)
+ continue;
+
if(inst->vertexAlpha || m->color.alpha != 255 ||
IsTextureTransparent(m->texture)){
defer = true;
@@ -769,10 +772,7 @@ AtomicFirstPass(RpAtomic *atomic, int pass)
colorscale[0] = colorscale[1] = colorscale[2] = cs;
d3ddevice->SetPixelShaderConstantF(CustomPipes::PSLOC_colorscale, colorscale, 1);
- if(m->texture)
- d3d::setTexture(0, m->texture);
- else
- d3d::setTexture(0, gpWhiteTexture); // actually we don't even render this
+ d3d::setTexture(0, m->texture);
setMaterial(m->color, m->surfaceProps, 0.5f);
@@ -836,19 +836,18 @@ RenderBlendPass(int pass)
InstanceData *inst = building->instHeader->inst;
for(rw::uint32 j = 0; j < building->instHeader->numMeshes; j++, inst++){
Material *m = inst->material;
+ if(m->texture == nil)
+ continue;
if(!inst->vertexAlpha && m->color.alpha == 255 && !IsTextureTransparent(m->texture) && building->fadeAlpha == 255)
continue; // already done this one
float cs = 1.0f;
- if(m->texture)
+ if(m->texture) // always true
cs = 255/128.0f;
colorscale[0] = colorscale[1] = colorscale[2] = cs;
d3ddevice->SetPixelShaderConstantF(CustomPipes::PSLOC_colorscale, colorscale, 1);
- if(m->texture)
- d3d::setTexture(0, m->texture);
- else
- d3d::setTexture(0, gpWhiteTexture); // actually we don't even render this
+ d3d::setTexture(0, m->texture);
rw::RGBA color = m->color;
color.alpha = (color.alpha * building->fadeAlpha)/255;