Skip to content

Commit

Permalink
They say it is better to do this way.
Browse files Browse the repository at this point in the history
  • Loading branch information
Godzil committed Mar 6, 2020
1 parent 57eff48 commit 18965fe
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions source/pattern/texturemap.h
Expand Up @@ -153,18 +153,17 @@ class TextureMap : public Pattern
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);
Expand Down

0 comments on commit 18965fe

Please sign in to comment.