| 63 | } |
| 64 | |
| 65 | void TextureResource::initFromMemory(const char* data, size_t length) |
| 66 | { |
| 67 | // This is only valid if we have a local texture data object |
| 68 | assert(mTextureData != nullptr); |
| 69 | mTextureData->releaseVRAM(); |
| 70 | mTextureData->releaseRAM(); |
| 71 | mTextureData->initImageFromMemory((const unsigned char*)data, length); |
| 72 | // Get the size from the texture data |
| 73 | mSize = Vector2i((int)mTextureData->width(), (int)mTextureData->height()); |
| 74 | mSourceSize = Vector2f(mTextureData->sourceWidth(), mTextureData->sourceHeight()); |
| 75 | } |
| 76 | |
| 77 | const Vector2i TextureResource::getSize() const |
| 78 | { |
no test coverage detected