TextureRegion* TextureRegion::create(const std::string& filename, const Rect& rect, bool rotated, const Point& offset, const Size& originalSize) { TextureRegion *TextureRegion = new (std::nothrow) TextureRegion(); TextureRegion->initWithTextureFilename(filename, rect, rotated, offset, originalSize); TextureRegion->autorelease(); return TextureRegion; }
TextureRegion* TextureRegion::createWithTexture(Texture2D* texture, const Rect& rect, bool rotated, const Point& offset, const Size& originalSize) { TextureRegion *TextureRegion = new (std::nothrow) TextureRegion(); TextureRegion->initWithTexture(texture, rect, rotated, offset, originalSize); TextureRegion->autorelease(); return TextureRegion; }
TextureRegion* TextureRegion::createWithTexture(Texture2D *texture, const Rect& rect) { TextureRegion *TextureRegion = new (std::nothrow) TextureRegion(); TextureRegion->initWithTexture(texture, rect); TextureRegion->autorelease(); return TextureRegion; }
TextureRegion* TextureRegion::clone() const { // no copy constructor TextureRegion *copy = new (std::nothrow) TextureRegion(); copy->initWithTextureFilename(_textureFilename.c_str(), _rectInPixels, _rotated, _offsetInPixels, _originalSizeInPixels); copy->setTexture(_texture); copy->autorelease(); return copy; }
FLAKOR_NS_BEGIN // implementation of TextureRegion TextureRegion* TextureRegion::create(const std::string& filename, const Rect& rect) { TextureRegion *TextureRegion = new (std::nothrow) TextureRegion(); TextureRegion->initWithTextureFilename(filename, rect); TextureRegion->autorelease(); return TextureRegion; }