Canvases can now be used in SpriteBatches, ParticleSystems, and Meshes (resolves issue #782).

Canvases and Images are now subclasses of the new Texture class.
Added setTexture and getTexture methods for Meshes, ParticleSystems, and SpriteBatches (the old set/getImage methods are deprecated but not removed.)
Canvas texture coordinates are no longer flipped.
This commit is contained in:
Alex Szpakowski
2014-01-03 17:07:12 -04:00
parent 1d3f6e967d
commit aa69a695d3
43 changed files with 1011 additions and 852 deletions
+9 -9
View File
@@ -26,7 +26,7 @@
#include "common/math.h"
#include "common/StringMap.h"
#include "graphics/Drawable.h"
#include "Image.h"
#include "Texture.h"
#include "VertexBuffer.h"
// C++
@@ -110,20 +110,20 @@ public:
size_t getVertexMapCount() const;
/**
* Sets the Image used when drawing the Mesh.
* Sets the texture used when drawing the Mesh.
**/
void setImage(Image *img);
void setTexture(Texture *texture);
/**
* Disables any Image from being used when drawing the Mesh.
* Disables any texture from being used when drawing the Mesh.
**/
void setImage();
void setTexture();
/**
* Gets the Image used when drawing the Mesh. May return null if no Image is
* set.
* Gets the texture used when drawing the Mesh. May return null if no
* texture is set.
**/
Image *getImage() const;
Texture *getTexture() const;
/**
* Sets the draw mode used when drawing the Mesh.
@@ -167,7 +167,7 @@ private:
DrawMode draw_mode;
Image *image;
Texture *texture;
// Whether the per-vertex colors are used when drawing.
bool colors_enabled;