mirror of
https://git.coom.tech/drummyfish/raycastlib.git
synced 2024-11-23 20:49:57 +01:00
Fix render simple
This commit is contained in:
parent
a18264c2a6
commit
2169b4db39
1 changed files with 11 additions and 8 deletions
19
raycastlib.h
19
raycastlib.h
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue