Permalink
Browse files

support for not loading sprites from their own textures

  • Loading branch information...
1 parent dbe363e commit 0233c8f40eb663dac3ee406cb71191f9e645c953 @jonbro committed Mar 30, 2012
Showing with 7 additions and 0 deletions.
  1. +5 −0 src/bludSpriteSheet.cpp
  2. +2 −0 src/bludSpriteSheet.h
@@ -30,6 +30,7 @@ Lunar<bludSprite>::RegType bludSprite::methods[] = {
Lunar<bludSpriteSheet>::RegType bludSpriteSheet::methods[] = {
method(bludSpriteSheet, loadTexture),
+ method(bludSpriteSheet, setupTexture),
method(bludSpriteSheet, clear),
method(bludSpriteSheet, update),
method(bludSpriteSheet, draw),
@@ -54,4 +55,8 @@ int bludSpriteSheet::loadTexture(lua_State *L){
texture->loadTexture(luaL_checkstring(L, 1));
spriteRenderer->loadTexture(texture);
return 1;
+}
+int bludSpriteSheet::setupTexture(lua_State *L){
+ spriteRenderer->loadTexture(texture);
+ return 1;
}
@@ -2,6 +2,7 @@
#import "ofxSpriteSheetRenderer.h"
#import "lunar.h"
+
// sprite
// wrapper for a struct that contains data about the current sprite
@@ -136,6 +137,7 @@ class bludSpriteSheet {
bludSpriteSheet(lua_State *L);
int loadTexture(lua_State *L);
+ int setupTexture(lua_State *L);
int clear(lua_State *L) {
spriteRenderer->clear();

0 comments on commit 0233c8f

Please sign in to comment.