#include <spriteloader.hpp>
Public Member Functions | |
void | AllocateData (size_t size) |
Allocate the sprite data of this sprite. | |
Data Fields | |
uint16 | height |
Height of the sprite. | |
uint16 | width |
Width of the sprite. | |
int16 | x_offs |
The x-offset of where the sprite will be drawn. | |
int16 | y_offs |
The y-offset of where the sprite will be drawn. | |
SpriteLoader::CommonPixel * | data |
The sprite itself. | |
Static Private Attributes | |
static ReusableBuffer < SpriteLoader::CommonPixel > | buffer |
Allocated memory to pass sprite data around. |
You can only use this struct once at a time when using AllocateData to allocate the memory as that will always return the same memory address. This to prevent thousands of malloc + frees just to load a sprite.
Definition at line 33 of file spriteloader.hpp.
void SpriteLoader::Sprite::AllocateData | ( | size_t | size | ) | [inline] |
Allocate the sprite data of this sprite.
size | the minimum size of the data field. |
Definition at line 44 of file spriteloader.hpp.
References buffer, data, and ReusableBuffer< T >::ZeroAllocate().