Skip to content

Commit

Permalink
Merge pull request stfj#3 from jonbro/master
Browse files Browse the repository at this point in the history
fixed the issue with the rotation not working
  • Loading branch information
stfj committed May 24, 2011
2 parents 620e610 + 0fc4482 commit 10b3e82
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ofxSpriteSheetRenderer.cpp
Expand Up @@ -37,10 +37,10 @@ ofxSpriteSheetRenderer::ofxSpriteSheetRenderer(int _numLayers, int _tilesPerLaye
safeMode = true; safeMode = true;


gameTime = ofGetElapsedTimeMillis(); gameTime = ofGetElapsedTimeMillis();

reAllocateArrays(_numLayers, _tilesPerLayer, _defaultLayer, _tileSize);


generateRotationArrays(); generateRotationArrays();

reAllocateArrays(_numLayers, _tilesPerLayer, _defaultLayer, _tileSize);
} }


ofxSpriteSheetRenderer::~ofxSpriteSheetRenderer() ofxSpriteSheetRenderer::~ofxSpriteSheetRenderer()
Expand Down Expand Up @@ -102,9 +102,9 @@ void ofxSpriteSheetRenderer::allocate(int widthHeight, int internalGLScaleMode)
if(texture == NULL) if(texture == NULL)
{ {
tileSize_f = tileSize; tileSize_f = tileSize;
#ifdef TARGET_OPENGLES // if we don't have arb, it's crazy important that things are power of 2 so that this float is set properly #ifdef TARGET_OPENGLES // if we don't have arb, it's crazy important that things are power of 2 so that this float is set properly
tileSize_f /= widthHeight; tileSize_f /= widthHeight;
#endif #endif


spriteSheetWidth = widthHeight/tileSize; spriteSheetWidth = widthHeight/tileSize;


Expand Down Expand Up @@ -512,7 +512,7 @@ bool ofxSpriteSheetRenderer::addCenterRotatedTile(int tile_name, int frame, floa
frameX += frame*wh*tileSize_f; frameX += frame*wh*tileSize_f;


addTexCoords(f, frameX, frameY, layer, wh, wh); addTexCoords(f, frameX, frameY, layer, wh, wh);

rot*=2; rot*=2;


wh*=scale; wh*=scale;
Expand Down

0 comments on commit 10b3e82

Please sign in to comment.