diff options
Diffstat (limited to 'src/libjin/Graphics/Drawable.cpp')
-rw-r--r-- | src/libjin/Graphics/Drawable.cpp | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/src/libjin/Graphics/Drawable.cpp b/src/libjin/Graphics/Drawable.cpp index cab6c50..799498e 100644 --- a/src/libjin/Graphics/Drawable.cpp +++ b/src/libjin/Graphics/Drawable.cpp @@ -9,34 +9,22 @@ namespace jin { namespace graphics { - Drawable::Drawable(int w, int h):texture(0), width(w), height(h), ancx(0), ancy(0), textCoord(0), vertCoord(0) + Drawable::Drawable(int w, int h) + : texture(0) + , size() + , anchor() { } Drawable::~Drawable() { glDeleteTextures(1, &texture); - delete[] vertCoord; - delete[] textCoord; - } - - void Drawable::setVertices(float* v, float* t) - { - // render area - if (vertCoord) - delete[] vertCoord; - vertCoord = v; - - // textrue - if (textCoord) - delete[] textCoord; - textCoord = t; } void Drawable::setAnchor(int x, int y) { - ancx = x; - ancy = y; + anchor.x = x; + anchor.y = y; } void Drawable::draw(int x, int y, float sx, float sy, float r) @@ -45,7 +33,7 @@ namespace graphics if (! textCoord||! vertCoord) return; static jin::math::Matrix t; - t.setTransformation(x, y, r, sx, sy, ancx, ancy); + t.setTransformation(x, y, r, sx, sy, anchor.x, anchor.y); glEnable(GL_TEXTURE_2D); |