Skip to content

Commit

Permalink
small sprite cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
seleb committed Dec 15, 2015
1 parent 9557b07 commit 68add1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion S-Tengine2/Source/S-Tengine2/src/Box2DSprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ b2Fixture * Box2DSprite::createFixture(b2Filter _filter, b2Vec2 _offset, void *
b2Fixture * f = body->CreateFixture(&fd);

// reposition mesh vertices to match collider vertices
for(unsigned long int i = 0; i < tShape.GetVertexCount(); ++i){
const unsigned long int numVerts = tShape.GetVertexCount();
for(unsigned long int i = 0; i < numVerts; ++i){
mesh->vertices.at(i).x = tShape.GetVertex(i).x;
mesh->vertices.at(i).y = tShape.GetVertex(i).y;
}
Expand Down
4 changes: 2 additions & 2 deletions S-Tengine2/Source/S-Tengine2/src/Sprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ void Sprite::setPrimaryTexture(Texture * _texture) {

float negHeight = -height/mag/2;
float negWidth = -width/mag/2;
float posHeight = height/mag/2;;
float posWidth = width/mag/2;;
float posHeight = height/mag/2;
float posWidth = width/mag/2;

mesh->vertices.at(0).x = negWidth;
mesh->vertices.at(0).y = posHeight;
Expand Down

0 comments on commit 68add1b

Please sign in to comment.