From 80bea88c9f9b93bb4ac9d64d84c449d4f5c7d848 Mon Sep 17 00:00:00 2001 From: Bill Meltsner Date: Wed, 14 Apr 2010 11:10:17 -0400 Subject: [PATCH] replaced a few hardcoded radian->degree conversions with LOVE_TODEG --- src/modules/graphics/opengl/Graphics.cpp | 3 ++- src/modules/graphics/opengl/ParticleSystem.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index 4cfd44203..c304e849a 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -19,6 +19,7 @@ **/ #include +#include #include "Graphics.h" @@ -1121,7 +1122,7 @@ namespace opengl void Graphics::rotate(float r) { - glRotatef(r * 57.29578f, 0, 0, 1); + glRotatef(LOVE_TODEG(r), 0, 0, 1); } void Graphics::scale(float x, float y) diff --git a/src/modules/graphics/opengl/ParticleSystem.cpp b/src/modules/graphics/opengl/ParticleSystem.cpp index aae65b7d3..e8f1d26fe 100644 --- a/src/modules/graphics/opengl/ParticleSystem.cpp +++ b/src/modules/graphics/opengl/ParticleSystem.cpp @@ -20,6 +20,8 @@ #include "ParticleSystem.h" +#include + #include #include #include @@ -397,7 +399,7 @@ namespace opengl glPushAttrib(GL_CURRENT_BIT); glTranslatef(x, y, 0); - glRotatef(angle * 57.29578f, 0, 0, 1.0f); + glRotatef(LOVE_TODEG(angle), 0, 0, 1.0f); glScalef(sx, sy, 1.0f); glTranslatef( ox, oy, 0); @@ -408,7 +410,7 @@ namespace opengl glColor4f(p->color[0],p->color[1],p->color[2],p->color[3]); glTranslatef(p->position[0],p->position[1],0.0f); - glRotatef(p->rotation * 57.29578f, 0.0f, 0.0f, 1.0f); // rad * (180 / pi) + glRotatef(LOVE_TODEG(p->rotation), 0.0f, 0.0f, 1.0f); // rad * (180 / pi) glScalef(p->size,p->size,1.0f); glTranslatef(-offsetX,-offsetY,0.0f); sprite->draw(0,0, 0, 1, 1, 0, 0);