From 9bd293af66373ac4161350915213b1d465cf46b9 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:24:10 +0200 Subject: [PATCH] Move texcoords to compile time --- demo1.cpp | 1 - demo2.cpp | 7 +++++-- demo3.cpp | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/demo1.cpp b/demo1.cpp index aa3b5c9..c395878 100644 --- a/demo1.cpp +++ b/demo1.cpp @@ -1021,7 +1021,6 @@ void draw() c.maxHits = 8; c.maxSteps = 10; - c.computeTextureCoords = 1; render(player.mCamera,floorHeightAt,ceilingHeightAt,textureAt,pixelFunc,c); diff --git a/demo2.cpp b/demo2.cpp index 39a5c01..275745d 100644 --- a/demo2.cpp +++ b/demo2.cpp @@ -25,7 +25,7 @@ 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 +#define NO_TEXTURES /* ^ Turns off textures and only uses colors, which increases FPS. */ //#define USE_DIST_APPROX 1 @@ -43,6 +43,10 @@ /* ^ Defines how the door roll: -1 opens the door to the left, 1 to the right, 0 to both. */ +#ifdef NO_TEXTURES +#define COMPUTE_WALL_TEXCOORDS 0 +#endif + #define FPS 60 #define HEAD_BOB_HEIGHT 200 #define HEAD_BOB_STEP 20 @@ -966,7 +970,6 @@ void draw() c.maxHits = 1; c.maxSteps = 20; - c.computeTextureCoords = 1; player.mCamera.height += player.mHeadBob; diff --git a/demo3.cpp b/demo3.cpp index 94b805a..19050f0 100644 --- a/demo3.cpp +++ b/demo3.cpp @@ -19,6 +19,8 @@ #define HEAD_BOB_HEIGHT 150 #define HEAD_BOB_STEP 20 +#define COMPUTE_WALL_TEXCOORDS 0 // we won't be using textures, so turn them off + #include "general.hpp" #define LEVEL_X_RES 29 @@ -500,7 +502,6 @@ void draw() c.maxHits = 6; c.maxSteps = 20; - c.computeTextureCoords = 0; player.mCamera.height += player.mHeadBob; render(player.mCamera,floorHeightAt,0,colorAt,pixelFunc,c);