From cf9504fbd938986c5db9dba291ddf8af1f2207e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sat, 15 Sep 2018 11:22:50 +0200 Subject: [PATCH] Adjust settings --- demo2.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/demo2.cpp b/demo2.cpp index 8f15cf9..91fcfd7 100644 --- a/demo2.cpp +++ b/demo2.cpp @@ -22,7 +22,8 @@ //#define RENDER_PRECISE /* ^ Turns on rendering using a more precise but slower algorithm. This can - be seen at less shaky head bobbing when moving. */ + be seen at less shaky head bobbing when moving. However the latter + algorithm doesn't support rolling doors (these will be turned off). */ //#define NO_TEXTURES /* ^ Turns off textures and only uses colors, which increases FPS. */ @@ -767,11 +768,13 @@ unsigned char textureAverageColors[TEXTURES]; Unit floorHeightAt(int16_t x, int16_t y) { - if (x >= 0 && x < LEVEL_X_RES && y >= 0 && y < LEVEL_Y_RES) - return level[(LEVEL_Y_RES - y -1) * LEVEL_X_RES + x] == 0 ? - 0 : UNITS_PER_SQUARE * 2; + Unit square = level[(LEVEL_Y_RES - y -1) * LEVEL_X_RES + x]; - return UNITS_PER_SQUARE * 2; +#ifdef RENDER_PRECISE + return square == 0 || square == 6 ? 0 : UNITS_PER_SQUARE * 2; +#else + return square == 0 ? 0 : UNITS_PER_SQUARE * 2; +#endif } Unit collisionAt(int16_t x, int16_t y)