1
0
Fork 0
mirror of https://git.coom.tech/drummyfish/raycastlib.git synced 2024-11-23 20:49:57 +01:00

Fix SDL example

This commit is contained in:
Miloslav Číž 2020-10-10 12:35:52 +02:00
parent 296868005d
commit b505669206
2 changed files with 8 additions and 4 deletions

View file

@ -526,13 +526,13 @@ RCL_Unit textureAt(int16_t x, int16_t y)
RCL_Unit floorHeightAt(int16_t x, int16_t y)
{
if (x == 6 && (y == 13 || y == 14)) // moving lift
return ((RCL_absVal(-1 * (frame % 64) + 32)) * RCL_UNITS_PER_SQUARE) / 8;
return ((RCL_abs(-1 * (frame % 64) + 32)) * RCL_UNITS_PER_SQUARE) / 8;
if (x >= 0 && x < LEVEL_X_RES && y >= 0 && y < LEVEL_Y_RES)
return (levelFloor[(LEVEL_Y_RES - y -1) * LEVEL_X_RES + x] * RCL_UNITS_PER_SQUARE) / 8;
int a = RCL_absVal(x - LEVEL_X_RES / 2) - LEVEL_X_RES / 2;
int b = RCL_absVal(y - LEVEL_Y_RES / 2) - LEVEL_Y_RES / 2;
int a = RCL_abs(x - LEVEL_X_RES / 2) - LEVEL_X_RES / 2;
int b = RCL_abs(y - LEVEL_Y_RES / 2) - LEVEL_Y_RES / 2;
return (a > b ? a : b) * RCL_UNITS_PER_SQUARE;
}

View file

@ -26,7 +26,11 @@
author: Miloslav "drummyfish" Ciz
license: CC0 1.0
version: 0.908
version: 0.908d
Version numbering: major.minor[d], id 'd' is appended, this is a
in-development version based on the previous stable major.minor version. Two
'd' versions with the same version number, .e.g. 1.0d, may be different.
*/
#include <stdint.h>