diff options
Diffstat (limited to 'src/libjin/Graphics/je_graphic.cpp')
-rw-r--r-- | src/libjin/Graphics/je_graphic.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libjin/Graphics/je_graphic.cpp b/src/libjin/Graphics/je_graphic.cpp index 6f3ff58..f439b0b 100644 --- a/src/libjin/Graphics/je_graphic.cpp +++ b/src/libjin/Graphics/je_graphic.cpp @@ -45,7 +45,7 @@ namespace JinEngine void Graphic::render(int x, int y, float sx, float sy, float r, float ox, float oy) const { - gl.ModelMatrix.setTransformation(x, y, r, sx, sy, ox, oy); + static Math::Matrix modelMatrix = gl.getModelMatrix(x, y, r, sx, sy, ox, oy); int w = getWidth(), h = getHeight(); static float vertexCoords[8]; static float textureCoords[8]; @@ -61,7 +61,7 @@ namespace JinEngine textureCoords[6] = 1; textureCoords[7] = 0; // Set shader. Shader* shader = Shader::getCurrentShader(); - shader->sendMatrix4(SHADER_MODEL_MATRIX, &(gl.getMatrix() * gl.ModelMatrix)); + shader->sendMatrix4(SHADER_MODEL_MATRIX, &modelMatrix); shader->sendMatrix4(SHADER_PROJECTION_MATRIX, &gl.ProjectionMatrix); shader->setVertexPointer(2, GL_FLOAT, 0, vertexCoords); shader->setUVPointer(2, GL_FLOAT, 0, textureCoords); @@ -91,10 +91,10 @@ namespace JinEngine textureCoords[4] = slx + slw; textureCoords[5] = sly + slh; textureCoords[6] = slx + slw; textureCoords[7] = sly; - gl.ModelMatrix.setTransformation(x, y, r, sx, sy, ax, ay); + static Math::Matrix modelMatrix = gl.getModelMatrix(x, y, r, sx, sy, ax, ay); Shader* shader = Shader::getCurrentShader(); - shader->sendMatrix4(SHADER_MODEL_MATRIX, &(gl.getMatrix() * gl.ModelMatrix)); + shader->sendMatrix4(SHADER_MODEL_MATRIX, &modelMatrix); shader->sendMatrix4(SHADER_PROJECTION_MATRIX, &gl.ProjectionMatrix); shader->setVertexPointer(2, GL_FLOAT, 0, vertexCoords); shader->setUVPointer(2, GL_FLOAT, 0, textureCoords); |