Loads a legacy 8-bit sprite as a texture.
More...
#include <SpriteTextureRes.h>
Loads a legacy 8-bit sprite as a texture.
- Author
- Michael Imamura
HoverRace::Display::SpriteTextureRes::SpriteTextureRes |
( |
const std::string & |
recordName, |
|
|
Parcel::ObjStream & |
archive, |
|
|
bool |
flipped = false |
|
) |
| |
Constructor.
- Parameters
-
recordName | The name of the record being loaded. |
archive | The input object stream. |
flipped | true if the sprite data is stored upside-down. |
virtual HoverRace::Display::SpriteTextureRes::~SpriteTextureRes |
( |
| ) |
|
|
inlinevirtual |
std::string HoverRace::Display::SpriteTextureRes::GetId |
( |
| ) |
const |
|
inlineoverridevirtual |
Retrieve the ID for this resource.
The ID should be unique for every resource being pointed at, so two instances that point to the same resource (e.g. a file) should return the same ID.
This allows loaded resources to be cached, so if two instances point to, say, the same file, then the resource will be loaded once (although this is left as an exercise for the Display).
- Returns
- The identifier.
Implements HoverRace::Display::BaseRes.
const ImageData* HoverRace::Display::SpriteTextureRes::GetImageData |
( |
| ) |
|
|
inlineoverridevirtual |
bool HoverRace::Display::SpriteTextureRes::IsGenerated |
( |
| ) |
const |
|
inlineoverridevirtual |
Check if this texture is generated from memory rather than an input stream.
If this texture is generated, then the image data is retrieved via GetImageData() instead of Open().
- Returns
true
if generated, false
if not.
Reimplemented from HoverRace::Display::Res< Texture >.
std::unique_ptr<std::istream> HoverRace::Display::SpriteTextureRes::Open |
( |
| ) |
const |
|
inlineoverridevirtual |
std::string HoverRace::Display::SpriteTextureRes::id |
|
private |
ImageData HoverRace::Display::SpriteTextureRes::imageData |
|
private |
The documentation for this class was generated from the following files: