23 #ifndef QDENGINE_SYSTEM_GRAPHICS_GR_TILE_ANIMATION_H 24 #define QDENGINE_SYSTEM_GRAPHICS_GR_TILE_ANIMATION_H 26 #include "common/path.h" 28 #include "qdengine/xmath.h" 29 #include "qdengine/system/graphics/gr_tile_sprite.h" 32 class SeekableReadStream;
41 typedef void (*CompressionProgressHandler)(
int percents_loaded,
void *context);
47 bool isEmpty()
const {
53 int frameCount()
const {
56 const Vect2i &frameSize()
const {
59 const Vect2i &frameTileSize()
const {
60 return _frameTileSize;
62 int tileCount()
const {
63 return _tileOffsets.size() - 1;
66 void init(
int frame_count,
const Vect2i &frame_size,
bool alpha_flag);
70 bool compress(grTileCompressionMethod method);
73 grTileSprite getFrameTile(
int frame_number,
int tile_index)
const;
75 void addFrame(
const uint32 *frame_data);
79 void drawFrame(
const Vect2i &position, int32 frame_index, int32 mode,
int closest_scale)
const;
80 void drawFrame(
const Vect2i &position,
int frame_index,
float angle,
int mode = 0)
const;
81 void drawFrame(
const Vect2i &position,
int frame_index,
float angle,
const Vect2f &
scale,
int mode)
const;
83 void drawFrame_scale(
const Vect2i &position,
int frame_index,
float scale,
int mode)
const;
85 void drawMask(
const Vect2i &position,
int frame_index, uint32 mask_color,
int mask_alpha,
int mode,
int closest_scale)
const;
86 void drawMask_scale(
const Vect2i &pos,
int frame_index, uint32 mask_colour,
int mask_alpha,
float scale,
int mode)
const;
87 void drawMask_rot(
const Vect2i &pos,
int frame_index, uint32 mask_colour,
int mask_alpha,
float angle,
int mode)
const;
88 void drawMask_rot(
const Vect2i &pos,
int frame_index, uint32 mask_colour,
int mask_alpha,
float angle,
Vect2f scale,
int mode)
const;
90 void drawContour(
const Vect2i &position,
int frame_index, uint32 color,
int mode,
int closest_scale)
const;
91 void drawContour(
const Vect2i &position,
int frame_index, uint32 color,
float scale,
int mode)
const;
93 bool hit(
int frame_number,
Vect2i &pos)
const;
95 static void setProgressHandler(CompressionProgressHandler handler,
void *context) {
96 _progressHandler = handler;
97 _progressHandlerContext = context;
100 void addScale(
int i,
float scale);
101 byte *decode_frame_data(
int frame_index,
int closest_scale)
const;
102 int find_closest_scale(
float *scale)
const;
103 bool wasFrameSizeChanged(
int frame_index,
int scaleIdx,
float scale)
const;
106 void dumpTiles(
Common::Path baseName,
int tilesPerRow)
const;
112 grTileCompressionMethod _compression;
140 FrameIndex _frameIndex;
144 TileOffsets _tileOffsets;
151 static CompressionProgressHandler _progressHandler;
152 static void *_progressHandlerContext;
157 #endif // QDENGINE_SYSTEM_GRAPHICS_GR_TILE_ANIMATION_H Definition: managed_surface.h:51
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Базовый класс для игровых ресурсов.
Definition: console.h:28
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: gr_tile_animation.h:43
Тайл-спрайт
Definition: gr_tile_sprite.h:44