fixed issues (sorta)
This commit is contained in:
parent
6db0105744
commit
f8481aae42
@ -154,6 +154,9 @@ void castRay(s16 angle, s16 column){
|
|||||||
|
|
||||||
//Wall height calcs
|
//Wall height calcs
|
||||||
shortestDist = fix16Mul(dx, shortestDist);
|
shortestDist = fix16Mul(dx, shortestDist);
|
||||||
|
if(shortestDist < 0){
|
||||||
|
shortestDist = -shortestDist;
|
||||||
|
}
|
||||||
fix16 wallHeightFix16 = fix16Div(FIX16(SCREEN_HEIGHT), (shortestDist + FIX16(1)));
|
fix16 wallHeightFix16 = fix16Div(FIX16(SCREEN_HEIGHT), (shortestDist + FIX16(1)));
|
||||||
wallHeightFix16 = fix16Mul(wallHeightFix16, WALL_HEIGHT_SCALE);
|
wallHeightFix16 = fix16Mul(wallHeightFix16, WALL_HEIGHT_SCALE);
|
||||||
int wallHeight = fix16ToInt(wallHeightFix16);
|
int wallHeight = fix16ToInt(wallHeightFix16);
|
||||||
|
Loading…
Reference in New Issue
Block a user