33 #if defined(USE_OPENGL) || !defined(USE_SDL2)
49 #include "resources/map/map.h"
51 #include "utils/timer.h"
54 PRAGMA48(GCC diagnostic ignored
"-Wshadow")
55 #ifndef SDL_BIG_ENDIAN
56 #include <SDL_endian.h>
87 mEnableAlphaFix(
config.getBoolValue(
"enableAlphaFix")),
88 mDisableAdvBeingCaching(
config.getBoolValue(
"disableAdvBeingCaching")),
89 mDisableBeingCaching(
config.getBoolValue(
"disableBeingCaching"))
107 ret |= (*it)->reset();
123 const bool tmpVal = (*it)->play(action);
143 ret |= (*it)->update(time);
151 const int posY)
const
178 const int posY)
const
185 (*it)->draw(graphics, posX, posY);
192 const int posY)
const
197 (*it)->draw(graphics, posX, posY);
207 return base->getWidth();
219 return base->getHeight();
236 ret |= (*it)->setSpriteDirection(direction);
256 return (*it)->getCurrentFrame();
266 return (*it)->getFrameCount();
327 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
328 const uint32_t rmask = 0xff000000U;
329 const uint32_t gmask = 0x00ff0000U;
330 const uint32_t bmask = 0x0000ff00U;
331 const uint32_t amask = 0x000000ffU;
333 const uint32_t rmask = 0x000000ffU;
334 const uint32_t gmask = 0x0000ff00U;
335 const uint32_t bmask = 0x00ff0000U;
336 const uint32_t amask = 0xff000000U;
342 if (surface ==
nullptr)
374 SDL_SetAlpha(surface, 0, SDL_ALPHA_OPAQUE);
382 SDL_BlitSurface(surface,
nullptr, surfaceA,
nullptr);
410 (*it)->setAlpha(alpha);
484 if ((ic !=
nullptr) && ic->
data.size() == sz)
487 VectorPointers::const_iterator it2 = ic->
data.begin();
488 const VectorPointers::const_iterator it2_end = ic->
data.end();
492 it1 != it1_end && it2 != it2_end;
495 const void *ptr1 =
nullptr;
496 const void *ptr2 =
nullptr;
498 ptr1 = (*it1)->getHash();
549 if ((*it)->updateNumber(num))
void updateImages() const
void ensureSize(const size_t layerCount)
const Image * getImage() const
std::vector< Sprite * >::iterator SpriteIterator
void drawSimple(Graphics *const graphics, const int posX, const int posY) const
bool setSpriteDirection(const SpriteDirection::Type direction)
std::vector< Sprite * > mSprites
virtual void drawSpritesSDL(Graphics *const graphics, const int posX, const int posY) const
int getNumberOfLayers() const
bool update(const int time)
CompoundItem * mCacheItem
unsigned int getFrameCount() const
void setAlpha(float alpha)
bool mDisableBeingCaching
bool play(const std::string &action)
void drawSprites(Graphics *const graphics, const int posX, const int posY) const
bool updateFromCache() const
void addSprite(Sprite *const sprite)
bool updateNumber(const unsigned num)
std::vector< Sprite * >::const_iterator SpriteConstIterator
unsigned int getCurrentFrame() const
void removeSprite(const int layer)
void initCurrentCacheItem() const
bool mDisableAdvBeingCaching
void setSprite(const size_t layer, Sprite *const sprite)
Map * getCurrentMap() const
virtual void drawImage(const Image *const image, int dstX, int dstY)=0
virtual RenderType useOpenGL() const
virtual Image * loadSurface(SDL_Surface *const)
void setTarget(SDL_Surface *const target)
void setBlitMode(const BlitModeT mode)
static const int BUFFER_HEIGHT
static const unsigned cache_clean_part
static const unsigned cache_max_size
static const int BUFFER_WIDTH
static const int mapTileSize
#define MSDL_CreateRGBSurface(flags, w, h, d, r, g, b, a)
#define MSDL_FreeSurface(surface)
void delete_all(Container &c)
#define FOR_EACH(type, iter, array)
ImageHelper * imageHelper
#define FUNC_BLOCK(name, id)
int get_elapsed_time1(const int startTime)