From 33522dd6c5dd8427b862d8796f23b35d6886a220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Sun, 16 Sep 2018 14:50:58 +0200 Subject: [PATCH] Add more options --- demo1.cpp | 8 ++++++++ demo2.cpp | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/demo1.cpp b/demo1.cpp index a1ee53b..0dea3e0 100644 --- a/demo1.cpp +++ b/demo1.cpp @@ -10,6 +10,9 @@ license: CC0 1.0 */ +//#define COMPUTE_WALL_TEXCOORDS 0 + // ^ this turns off textures + // redefine some parameters #define FPS 60 #define GRAVITY_ACCELERATION (UNITS_PER_SQUARE * 3) @@ -1007,7 +1010,12 @@ inline void pixelFunc(PixelInfo *pixel) if (intensity < 0) intensity = 0; +#if COMPUTE_WALL_TEXCOORDS == 1 c = sampleImage(textures[pixel->hit.type],pixel->texCoords.x,pixel->texCoords.y); +#else + c = textures[pixel->hit.type][2]; +#endif + c = addIntensity(c,intensity - 3); } else diff --git a/demo2.cpp b/demo2.cpp index ffef11f..23ed886 100644 --- a/demo2.cpp +++ b/demo2.cpp @@ -28,6 +28,9 @@ //#define NO_TEXTURES /* ^ Turns off textures and only uses colors, which increases FPS. */ +//#define NO_SHADING + /* ^ Turns off shading (fog) which increases FPS. */ + //#define USE_DIST_APPROX 1 /* ^ Turns on distance approximation, which won't compute exact distances but only approximations - this should increase performance a little, but @@ -948,6 +951,7 @@ inline void pixelFunc(PixelInfo *pixel) textureAverageColors[pixel->hit.type]; #endif +#ifndef NO_SHADING if (previousColumn == pixel->position.x) { c = addIntensity(c,pixelIntensity); @@ -959,6 +963,8 @@ inline void pixelFunc(PixelInfo *pixel) previousColumn = pixel->position.x; c = addIntensity(c,pixelIntensity); } +#endif + } putSubsampledPixel // macro