|
|
@@ -73,12 +73,12 @@ SpriteBatch::~SpriteBatch()
|
|
|
SpriteBatch* SpriteBatch::create(const char* texturePath, Effect* effect, unsigned int initialCapacity)
|
|
|
{
|
|
|
Texture* texture = Texture::create(texturePath);
|
|
|
- SpriteBatch* batch = SpriteBatch::create(texture);
|
|
|
+ SpriteBatch* batch = SpriteBatch::create(texture, effect, initialCapacity);
|
|
|
SAFE_RELEASE(texture);
|
|
|
return batch;
|
|
|
}
|
|
|
|
|
|
-SpriteBatch* SpriteBatch::create(Texture* texture, Effect* effect, unsigned int initialCapacity)
|
|
|
+SpriteBatch* SpriteBatch::create(Texture* texture, Effect* effect, unsigned int initialCapacity)
|
|
|
{
|
|
|
GP_ASSERT(texture != NULL);
|
|
|
|
|
|
@@ -154,10 +154,11 @@ SpriteBatch* SpriteBatch::create(Texture* texture, Effect* effect, unsigned int
|
|
|
batch->_textureWidthRatio = 1.0f / (float)texture->getWidth();
|
|
|
batch->_textureHeightRatio = 1.0f / (float)texture->getHeight();
|
|
|
|
|
|
- // Bind an ortho projection to the material by default (user can override with setProjectionMatrix)
|
|
|
- Game* game = Game::getInstance();
|
|
|
- Matrix::createOrthographicOffCenter(0, game->getWidth(), game->getHeight(), 0, 0, 1, &batch->_projectionMatrix);
|
|
|
- material->getParameter("u_projectionMatrix")->bindValue(batch, &SpriteBatch::getProjectionMatrix);
|
|
|
+ // Bind an ortho projection to the material by default (user can override with setProjectionMatrix)
|
|
|
+ Game* game = Game::getInstance();
|
|
|
+ Matrix::createOrthographicOffCenter(0, game->getWidth(), game->getHeight(), 0, 0, 1, &batch->_projectionMatrix);
|
|
|
+ material->getParameter("u_projectionMatrix")->bindValue(batch, &SpriteBatch::getProjectionMatrix);
|
|
|
+
|
|
|
return batch;
|
|
|
}
|
|
|
|