Fix NO_SHADING
This commit is contained in:
parent
e24231ea84
commit
175ea1ef85
1 changed files with 11 additions and 5 deletions
16
demo2.cpp
16
demo2.cpp
|
@ -917,9 +917,9 @@ inline void pixelFunc(RCL_PixelInfo *pixel)
|
||||||
mirror = 0;
|
mirror = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool drawCeiling = false;
|
bool drawCeiling = false;
|
||||||
|
|
||||||
int16_t intensity = 0;
|
int16_t intensity = 0;
|
||||||
|
|
||||||
if (!pixel->isWall)
|
if (!pixel->isWall)
|
||||||
{
|
{
|
||||||
|
@ -951,14 +951,17 @@ int16_t intensity = 0;
|
||||||
color = pixel->isFloor ? cFloor: cCeiling;
|
color = pixel->isFloor ? cFloor: cCeiling;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NO_MIRROR
|
#ifndef NO_SHADING
|
||||||
|
#ifndef NO_MIRROR
|
||||||
intensity = pixel->isFloor ?
|
intensity = pixel->isFloor ?
|
||||||
2 - (pixel->depth - mirror * 128) / RCL_UNITS_PER_SQUARE : 0;
|
2 - (pixel->depth - mirror * 128) / RCL_UNITS_PER_SQUARE : 0;
|
||||||
#else
|
#else
|
||||||
intensity = 2 - pixel->depth / RCL_UNITS_PER_SQUARE;
|
intensity = 2 - pixel->depth / RCL_UNITS_PER_SQUARE;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
color = addIntensity(color,intensity);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
color = addIntensity(color,intensity);
|
|
||||||
|
|
||||||
mirror++;
|
mirror++;
|
||||||
}
|
}
|
||||||
|
@ -1006,7 +1009,10 @@ int16_t intensity = 0;
|
||||||
color = pixel->depth > TEXTURE_MAX_DISTANCE_FLOOR ?
|
color = pixel->depth > TEXTURE_MAX_DISTANCE_FLOOR ?
|
||||||
textureAverageColors[0] :
|
textureAverageColors[0] :
|
||||||
sampleImage(textures[0],pixel->texCoords.x / FLOOR_TEXTURE_SCALE,pixel->texCoords.y / FLOOR_TEXTURE_SCALE);
|
sampleImage(textures[0],pixel->texCoords.x / FLOOR_TEXTURE_SCALE,pixel->texCoords.y / FLOOR_TEXTURE_SCALE);
|
||||||
|
#ifndef NO_SHADING
|
||||||
color = addIntensity(color,intensity);
|
color = addIntensity(color,intensity);
|
||||||
|
#endif
|
||||||
|
|
||||||
putSubsampledPixel(pixel->position.x,RESOLUTION_Y - pixel->position.y - 1,color);
|
putSubsampledPixel(pixel->position.x,RESOLUTION_Y - pixel->position.y - 1,color);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue