This commit is contained in:
Miloslav Číž 2018-09-18 19:10:20 +02:00
parent c752646293
commit 6ac29936ca
2 changed files with 12 additions and 12 deletions

View file

@ -995,7 +995,7 @@ inline void pixelFunc(RCL_PixelInfo *pixel)
if (pixel->position.y == MIDDLE_ROW) if (pixel->position.y == MIDDLE_ROW)
zBuffer[pixel->position.x] = pixel->depth; zBuffer[pixel->position.x] = pixel->depth;
uint8_t c; uint8_t color;
RCL_Unit depth = pixel->depth - RCL_UNITS_PER_SQUARE * 3; RCL_Unit depth = pixel->depth - RCL_UNITS_PER_SQUARE * 3;
depth = depth > 0 ? depth : 1; depth = depth > 0 ? depth : 1;
@ -1014,19 +1014,19 @@ inline void pixelFunc(RCL_PixelInfo *pixel)
intensity = 0; intensity = 0;
#if RCL_COMPUTE_WALL_TEXCOORDS == 1 #if RCL_COMPUTE_WALL_TEXCOORDS == 1
c = sampleImage(textures[pixel->hit.type],pixel->texCoords.x,pixel->texCoords.y); color = sampleImage(textures[pixel->hit.type],pixel->texCoords.x,pixel->texCoords.y);
#else #else
c = textures[pixel->hit.type][2]; color = textures[pixel->hit.type][2];
#endif #endif
c = addIntensity(c,intensity - 3); color = addIntensity(color,intensity - 3);
} }
else else
c = pixel->isFloor ? color = pixel->isFloor ?
rgbToIndex(intensity/2,intensity,intensity/3) : rgbToIndex(intensity/2,intensity,intensity/3) :
rgbToIndex(intensity,intensity/2,0); rgbToIndex(intensity,intensity/2,0);
putSubsampledPixel(pixel,c); putSubsampledPixel(pixel->position.x,pixel->position.y,color);
} }
void draw() void draw()

View file

@ -460,12 +460,12 @@ uint16_t backgroundColumn = 0; ///< Precomputed background column.
*/ */
inline void pixelFunc(RCL_PixelInfo *pixel) inline void pixelFunc(RCL_PixelInfo *pixel)
{ {
uint8_t c = 0; uint8_t color = 0;
int16_t intensity = 0; int16_t intensity = 0;
if (pixel->isWall) if (pixel->isWall)
{ {
c = pixel->hit.square.x != selectedSquare.x || pixel->hit.square.y != selectedSquare.y || (editing && pokitto.frameCount % 2) == 0 ? color = pixel->hit.square.x != selectedSquare.x || pixel->hit.square.y != selectedSquare.y || (editing && pokitto.frameCount % 2) == 0 ?
squareColors[pixel->hit.type] : 30; squareColors[pixel->hit.type] : 30;
intensity = pixel->depth / (RCL_UNITS_PER_SQUARE * 3); intensity = pixel->depth / (RCL_UNITS_PER_SQUARE * 3);
@ -473,7 +473,7 @@ inline void pixelFunc(RCL_PixelInfo *pixel)
} }
else if (pixel->isFloor) else if (pixel->isFloor)
{ {
c = floorColor; color = floorColor;
if (!pixel->isHorizon) if (!pixel->isHorizon)
intensity = pixel->depth / (RCL_UNITS_PER_SQUARE * 3); intensity = pixel->depth / (RCL_UNITS_PER_SQUARE * 3);
@ -482,7 +482,7 @@ inline void pixelFunc(RCL_PixelInfo *pixel)
{ {
if (previousColumn == pixel->position.x) if (previousColumn == pixel->position.x)
{ {
c = imageBackground[2 + backgroundColumn * 44 + RCL_clamp(pixel->position.y - player.mCamera.shear,0,43)]; color = imageBackground[2 + backgroundColumn * 44 + RCL_clamp(pixel->position.y - player.mCamera.shear,0,43)];
} }
else else
{ {
@ -492,9 +492,9 @@ inline void pixelFunc(RCL_PixelInfo *pixel)
} }
if (intensity != 0) if (intensity != 0)
c = addIntensity(c,intensity); color = addIntensity(color,intensity);
putSubsampledPixel(pixel,c); putSubsampledPixel(pixel->position.x,pixel->position.y,color);
} }
bool flyBy = true; bool flyBy = true;