1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/raycastlib.git synced 2024-11-21 20:29:59 +01:00

Fix render simple

This commit is contained in:
Miloslav Číž 2020-06-20 18:19:33 +02:00
parent a18264c2a6
commit 2169b4db39

View file

@ -26,7 +26,7 @@
author: Miloslav "drummyfish" Ciz author: Miloslav "drummyfish" Ciz
license: CC0 1.0 license: CC0 1.0
version: 0.904 version: 0.905
*/ */
#include <stdint.h> #include <stdint.h>
@ -1526,16 +1526,18 @@ void _RCL_columnFunctionSimple(RCL_HitResult *hits, uint16_t hitCount,
int16_t wallHeightWorld = _RCL_floorFunction(hit.square.x,hit.square.y); int16_t wallHeightWorld = _RCL_floorFunction(hit.square.x,hit.square.y);
wallHeightScreen = RCL_perspectiveScaleVertical((wallHeightWorld * RCL_Unit worldPointTop = wallHeightWorld - _RCL_camera.height;
_RCL_camera.resolution.y) / RCL_UNITS_PER_SQUARE,dist); RCL_Unit worldPointBottom = -1 * _RCL_camera.height;
int16_t RCL_normalizedWallHeight = wallHeightWorld != 0 ? wallStart = _RCL_middleRow -
((RCL_UNITS_PER_SQUARE * wallHeightScreen) / wallHeightWorld) : 0; (RCL_perspectiveScaleVertical(worldPointTop,dist)
* _RCL_camera.resolution.y) / RCL_UNITS_PER_SQUARE;
heightOffset = RCL_perspectiveScaleVertical(_RCL_cameraHeightScreen,dist); int16_t wallEnd = _RCL_middleRow -
(RCL_perspectiveScaleVertical(worldPointBottom,dist)
* _RCL_camera.resolution.y) / RCL_UNITS_PER_SQUARE;
wallStart = _RCL_middleRow - wallHeightScreen + heightOffset + wallHeightScreen = wallEnd - wallStart;
RCL_normalizedWallHeight;
} }
} }
else else
@ -2036,3 +2038,4 @@ void RCL_initRayConstraints(RCL_RayConstraints *constraints)
} }
#endif #endif