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