From cd8a192f7c3c52c29453ba8824b454f7f85cb24f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20=C4=8C=C3=AD=C5=BE?= Date: Mon, 17 Sep 2018 07:14:35 +0200 Subject: [PATCH] FPS++! --- demo1.cpp | 2 +- demo2.cpp | 4 ++-- demo3.cpp | 2 +- general.hpp | 4 ++++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/demo1.cpp b/demo1.cpp index 0dea3e0..5b76c11 100644 --- a/demo1.cpp +++ b/demo1.cpp @@ -1033,7 +1033,7 @@ void draw() c.maxHits = 8; c.maxSteps = 10; - render(player.mCamera,floorHeightAt,ceilingHeightAt,textureAt,pixelFunc,c); + render(player.mCamera,floorHeightAt,ceilingHeightAt,textureAt,c); Unit previousDepth; diff --git a/demo2.cpp b/demo2.cpp index 23ed886..88c708f 100644 --- a/demo2.cpp +++ b/demo2.cpp @@ -980,9 +980,9 @@ void draw() player.mCamera.height += player.mHeadBob; #ifdef RENDER_PRECISE - render(player.mCamera,floorHeightAt,0,textureAt,pixelFunc,c); + render(player.mCamera,floorHeightAt,0,textureAt,c); #else - renderSimple(player.mCamera,floorHeightAt,textureAt,pixelFunc,rollAt,c); + renderSimple(player.mCamera,floorHeightAt,textureAt,rollAt,c); #endif player.mCamera.height -= player.mHeadBob; diff --git a/demo3.cpp b/demo3.cpp index 95fc699..4174373 100644 --- a/demo3.cpp +++ b/demo3.cpp @@ -504,7 +504,7 @@ void draw() c.maxSteps = 20; player.mCamera.height += player.mHeadBob; - render(player.mCamera,floorHeightAt,0,colorAt,pixelFunc,c); + render(player.mCamera,floorHeightAt,0,colorAt,c); player.mCamera.height -= player.mHeadBob; if (flyBy && (pokitto.frameCount >> 3) % 3 != 0) diff --git a/general.hpp b/general.hpp index 39a0115..234eb8f 100644 --- a/general.hpp +++ b/general.hpp @@ -16,6 +16,10 @@ #define VERTICAL_FOV UNITS_PER_SQUARE // redefine camera vertical FOV +#define PIXEL_FUNCTION pixelFunc +/* ^ This has to be defined to the name of the function that will render + pixels. */ + #include "raycastlib.h" #include "Pokitto.h"