From 18965fe1bdf685efe70255f84dd1cfdd722b0bc2 Mon Sep 17 00:00:00 2001 From: Godzil Date: Fri, 6 Mar 2020 21:59:16 +0000 Subject: [PATCH] They say it is better to do this way. --- source/pattern/texturemap.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/source/pattern/texturemap.h b/source/pattern/texturemap.h index 91984ab..3cb5fd0 100644 --- a/source/pattern/texturemap.h +++ b/source/pattern/texturemap.h @@ -153,18 +153,17 @@ public: double u,v; if (this->type == CUBIC_MAP) { - CubeFaces face = this->faceFromPoint(point); + CubeFaces face = TextureMap::faceFromPoint(point); UVPattern *facePat; - double u, v; switch(face) { default: - case CUBE_LEFT: facePat = this->leftPat; this->cubeUBLeft(point, u, v); break; - case CUBE_RIGHT: facePat = this->rightPat; this->cubeUBRight(point, u, v); break; - case CUBE_FRONT: facePat = this->frontPat; this->cubeUBFront(point, u, v); break; - case CUBE_BACK: facePat = this->backPat; this->cubeUBBack(point, u, v); break; - case CUBE_UP: facePat = this->upPat; this->cubeUBUp(point, u, v); break; - case CUBE_DOWN: facePat = this->downPat; this->cubeUBDown(point, u, v); break; + case CUBE_LEFT: facePat = this->leftPat; TextureMap::cubeUBLeft(point, u, v); break; + case CUBE_RIGHT: facePat = this->rightPat; TextureMap::cubeUBRight(point, u, v); break; + case CUBE_FRONT: facePat = this->frontPat; TextureMap::cubeUBFront(point, u, v); break; + case CUBE_BACK: facePat = this->backPat; TextureMap::cubeUBBack(point, u, v); break; + case CUBE_UP: facePat = this->upPat; TextureMap::cubeUBUp(point, u, v); break; + case CUBE_DOWN: facePat = this->downPat; TextureMap::cubeUBDown(point, u, v); break; } return facePat->uvPatternAt(u, v);