ManaPlus
|
#include <dye.h>
Public Member Functions | |
Dye (const std::string &dye) | |
~Dye () | |
const DyePalette * | getSPalete () const |
const DyePalette * | getAPalete () const |
int | getType () const |
void | normalDye (uint32_t *pixels, const int bufSize) const |
void | normalOGLDye (uint32_t *pixels, const int bufSize) const |
Static Public Member Functions | |
static void | instantiate (std::string &target, const std::string &palettes) |
Private Attributes | |
DyePalette * | mDyePalettes [dyePalateSize] |
Class for dispatching pixel-recoloring amongst several palettes.
|
explicit |
Creates a set of palettes based on the given string.
The parts of string are separated by semi-colons. Each part starts by an uppercase letter, followed by a colon and then a palette name.
Definition at line 43 of file dye.cpp.
References dyePalateSize, Logger::log(), logger, and mDyePalettes.
Dye::~Dye | ( | ) |
Destroys the associated palettes.
Definition at line 91 of file dye.cpp.
References delete2, dyePalateSize, and mDyePalettes.
|
inline |
Return special dye palete (A)
Definition at line 73 of file dye.h.
References aPaleteIndex, and mDyePalettes.
Referenced by ImageHelper::load(), OpenGLImageHelper::load(), SafeOpenGLImageHelper::load(), and SDLImageHelper::load().
|
inline |
Return special dye palete (S)
Definition at line 67 of file dye.h.
References mDyePalettes, and sPaleteIndex.
Referenced by ImageHelper::load(), OpenGLImageHelper::load(), SafeOpenGLImageHelper::load(), and SDLImageHelper::load().
int Dye::getType | ( | ) | const |
Return dye type for S - 1, for A - 2, 0 for other
Definition at line 149 of file dye.cpp.
References aPaleteIndex, mDyePalettes, and sPaleteIndex.
Referenced by ImageHelper::load(), OpenGLImageHelper::load(), SafeOpenGLImageHelper::load(), and SDLImageHelper::load().
|
static |
Fills the blank in a dye placeholder with some palette names.
Definition at line 97 of file dye.cpp.
References Logger::log(), and logger.
Referenced by Particle::addEffect(), ParticleEngine::addEffect(), SimpleAnimation::initializeAnimation(), SpriteDef::loadImageSet(), and ParticleEmitter::ParticleEmitter().
void Dye::normalDye | ( | uint32_t * | pixels, |
const int | bufSize | ||
) | const |
Definition at line 158 of file dye.cpp.
References CAST_SIZE.
Referenced by ImageHelper::load(), and SDLImageHelper::load().
void Dye::normalOGLDye | ( | uint32_t * | pixels, |
const int | bufSize | ||
) | const |
Definition at line 224 of file dye.cpp.
References CAST_SIZE.
Referenced by OpenGLImageHelper::load(), and SafeOpenGLImageHelper::load().
|
private |
The order of the palettes, as well as their uppercase letter, is:
Red, Green, Yellow, Blue, Magenta, White (or rather gray), Simple.
Definition at line 93 of file dye.h.
Referenced by Dye(), getAPalete(), getSPalete(), getType(), and ~Dye().