CorsixTH engine (the C++ part)
Open source implementation of Theme Hospital
Loading...
Searching...
No Matches
th_gfx.h
Go to the documentation of this file.
1/*
2Copyright (c) 2009 Peter "Corsix" Cawley
3
4Permission is hereby granted, free of charge, to any person obtaining a copy of
5this software and associated documentation files (the "Software"), to deal in
6the Software without restriction, including without limitation the rights to
7use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
8of the Software, and to permit persons to whom the Software is furnished to do
9so, subject to the following conditions:
10
11The above copyright notice and this permission notice shall be included in all
12copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20SOFTWARE.
21*/
22
23#ifndef CORSIX_TH_TH_GFX_H_
24#define CORSIX_TH_TH_GFX_H_
25
26#include "config.h"
27
28#include <map>
29#include <string>
30#include <string_view>
31#include <utility>
32#include <vector>
33
34#include "lua.hpp"
35#include "th.h"
36#include "th_gfx_common.h"
37#include "th_gfx_sdl.h"
38#include "th_lua.h"
39
42class memory_reader;
43struct map_tile;
44
46
47void clip_rect_intersection(clip_rect& rcClip, const clip_rect& rcIntersect);
48
50enum draw_flags : uint32_t {
52 /* Where possible, designed to be the same values used by TH data files */
53
60 thdf_alpha_50 = 1 << 2,
63 thdf_alpha_75 = 1 << 3,
66
68 /* A 3 bit field (bits 5,6,7), currently 2 bits used. */
69
74
81
83 /* (should be set prior to attaching to a tile) */
84 thdf_early_list = 1 << 10,
85
89 thdf_crop = 1 << 13,
91 thdf_nearest = 1 << 14,
92};
93
94// Integer 2D pair.
95struct xy_pair {
96 int x{};
97 int y{};
98};
99
105// TODO: Replace this struct with something cleaner
106struct drawable : public link_list {
107 drawable() = default;
108
110
113 virtual void draw_fn(render_target* canvas, const xy_pair& draw_pos) = 0;
114
116
120 virtual bool hit_test_fn(const xy_pair& draw_pos, const xy_pair& obj_pos) = 0;
121
126
127 int get_drawing_layer() { return drawing_layer; }
128 void set_drawing_layer(int layer) { drawing_layer = layer; }
129
131 uint32_t flags{0};
132
133 private:
134 int drawing_layer{0};
135};
136
142 public:
144
150 chunk_renderer(int width, int height, std::vector<uint8_t>::iterator start);
151
153
160 void decode_chunks(const uint8_t* pData, int iDataLen, bool bComplex);
161
163 void chunk_copy(int npixels, const uint8_t* in_data);
164
166 void chunk_fill(int npixels, uint8_t value);
167
169 void chunk_fill_to_end_of_line(uint8_t value);
170
172 void chunk_finish(uint8_t value);
173
174 private:
175 inline bool is_done() const { return ptr == end; }
176 inline void fix_n_pixels(int& npixels) const;
177 inline void increment_position(int npixels);
178
179 std::vector<uint8_t>::iterator ptr, end;
180 int x{0}, y{0};
181 int width, height;
182 bool skip_eol{false};
183};
184
186// a nibble.
187const int max_number_of_layers = 13;
188
193
196 std::string name;
198};
199
201
206inline bool operator<(const animation_key& oK, const animation_key& oL) {
207 if (oK.tile_size != oL.tile_size) return oK.tile_size < oL.tile_size;
208 return oK.name < oL.name;
209}
210
216 long north{-1};
217 long east{-1};
218 long south{-1};
219 long west{-1};
220};
221
223typedef std::map<animation_key, animation_start_frames> named_animations_map;
224
226typedef std::pair<animation_key, animation_start_frames> named_animation_pair;
227
229
235 public:
236 animation_manager() = default;
237
239
241
253 bool load_from_th_file(const uint8_t* pStartData, size_t iStartDataLength,
254 const uint8_t* pFrameData, size_t iFrameDataLength,
255 const uint8_t* pListData, size_t iListDataLength,
256 const uint8_t* pElementData,
257 size_t iElementDataLength);
258
260
264
266
271 bool load_custom_animations(const uint8_t* pData, size_t iDataLength);
272
274 size_t get_animation_count() const;
275
277 size_t get_frame_count() const;
278
280 size_t get_first_frame(size_t iAnimation) const;
281
283
289 size_t get_next_frame(size_t iFrame) const;
290
292
299 void set_animation_alt_palette_map(size_t iAnimation, const uint8_t* pMap,
300 uint32_t iAlt32);
301
303
325 const ::layers& oLayers, int iX, int iY, uint32_t iFlags,
327 size_t patient_effect_offset = 0) const;
328
329 void get_frame_extent(size_t iFrame, const ::layers& oLayers, int* pMinX,
330 int* pMaxX, int* pMinY, int* pMaxY,
331 uint32_t iFlags) const;
332 size_t get_frame_sound(size_t iFrame);
333
334 bool hit_test(size_t iFrame, const ::layers& oLayers, int iX, int iY,
335 uint32_t iFlags, int iTestX, int iTestY) const;
336
337 bool set_frame_primary_marker(size_t iFrame, int iX, int iY);
338 bool set_frame_secondary_marker(size_t iFrame, int iX, int iY);
339 bool get_frame_primary_marker(size_t iFrame, int* pX, int* pY);
340 bool get_frame_secondary_marker(size_t iFrame, int* pX, int* pY);
341
343
348 const animation_start_frames& get_named_animations(std::string_view sName,
349 int iTilesize) const;
350
352 void tick();
353
354 private:
355 struct frame {
356 size_t list_index;
358 size_t next_frame;
359 unsigned int sound;
360 unsigned int flags;
361
362 // Bounding rectangle is with all layers / options enabled - used as a
363 // quick test prior to a full pixel perfect test.
364 int bounding_left;
366 int bounding_right;
368 int bounding_top;
370 int bounding_bottom;
372
373 // Markers are used to know where humanoids are on an frame. The
374 // positions are pixels offsets from the centre of the frame's base
375 // tile to the centre of the humanoid's feet.
376 int primary_marker_x;
378 int primary_marker_y;
380 int secondary_marker_x;
382 int secondary_marker_y;
384 };
385
386 struct element {
387 size_t sprite;
388 uint32_t flags;
391 int x;
392 int y;
393 uint8_t layer;
394 uint8_t layer_id;
395
396 sprite_sheet* element_sprite_sheet;
398 };
399
400 std::vector<size_t> first_frames;
401 std::vector<frame> frames;
402 std::vector<uint16_t> element_list;
403 std::vector<element> elements;
404 std::vector<sprite_sheet>
405 custom_sheets;
406 named_animations_map named_animations;
407
408 sprite_sheet* sheet{nullptr};
409 render_target* canvas{nullptr};
410
411 size_t animation_count{0};
412 size_t frame_count{0};
413 size_t element_list_count{0};
414 size_t element_count{0};
415
417 size_t game_ticks{0};
418
420
423 void set_bounding_box(frame& oFrame);
424
426
436 size_t load_elements(memory_reader& input, sprite_sheet* pSpriteSheet,
437 size_t iNumElements, size_t& iLoadedElements,
438 size_t iElementStart, size_t iElementCount);
439
441
451 size_t make_list_elements(size_t iFirstElement, size_t iNumElements,
452 size_t& iLoadedListElements, size_t iListStart,
453 size_t iListCount);
454
457
461 void fix_next_frame(uint32_t iFirst, size_t iLength);
462};
463
464class animation_base : public drawable {
465 public:
467
468 void remove_from_tile();
469 void attach_to_tile(const xy_pair& tile_pos, map_tile* node, int layer);
470
471 uint32_t get_flags() const { return flags; }
472 const xy_pair& get_pixel_offset() const { return pixel_offset; }
473 const xy_pair& get_tile() const { return tile; }
474
475 void set_flags(uint32_t iFlags) { flags = iFlags; }
477 void set_pixel_offset(int x, int y) {
478 pixel_offset.x = x;
479 pixel_offset.y = y;
480 }
481 void set_layer(int iLayer, int iId);
482 void set_layers_from(const animation_base* pSrc) { layers = pSrc->layers; }
483
484 protected:
486 xy_pair tile{-1, -1};
487
490
492};
493
496
497class animation : public animation_base {
498 public:
499 animation();
500
502
503 void tick();
504 void draw(render_target* canvas, const xy_pair& draw_pos);
505 void draw_morph(render_target* canvas, const xy_pair& draw_pos);
506 void draw_child(render_target* canvas, const xy_pair& draw_pos,
507 bool use_primary);
508
509 void draw_fn(render_target* canvas, const xy_pair& draw_pos) override {
510 switch (anim_kind) {
512 draw(canvas, draw_pos);
513 return;
515 draw_child(canvas, draw_pos, true);
516 return;
518 draw_child(canvas, draw_pos, false);
519 return;
521 draw_morph(canvas, draw_pos);
522 return;
523 }
524 }
525
526 bool hit_test(const xy_pair& draw_pos, const xy_pair& obj_pos);
527 bool hit_test_morph(const xy_pair& draw_pos, const xy_pair& obj_pos);
528 bool hit_test_child(const xy_pair& draw_pos, const xy_pair& obj_pos);
529
530 bool hit_test_fn(const xy_pair& draw_pos, const xy_pair& obj_pos) override {
531 switch (anim_kind) {
533 return hit_test(draw_pos, obj_pos);
539 }
540 return false;
541 }
542
544 size_t anim = get_animation();
546 size_t next_frame = get_animation_manager()->get_next_frame(first_frame);
547 return next_frame != first_frame;
548 }
549
551 size_t get_animation() const { return animation_index; }
552 bool get_primary_marker(int* pX, int* pY);
553 bool get_secondary_marker(int* pX, int* pY);
554 size_t get_frame() const { return frame_index; }
555 int get_crop_column() const { return crop_column; }
556
558 void set_morph_target(animation* target, int duration = 1);
559 void set_frame(size_t new_frame);
560
561 void set_speed(int x, int y) {
562 speed.x = x;
563 speed.y = y;
564 }
565 void set_crop_column(int column) { crop_column = column; }
566
567 void persist(lua_persist_writer* writer) const;
568 void depersist(lua_persist_reader* reader);
569
570 void set_patient_effect(animation_effect patient_effect);
571 void set_animation_kind(animation_kind anim_kind);
572 animation_kind get_animation_kind() { return anim_kind; }
573
575
576 private:
577 animation_manager* manager{nullptr};
578 animation* morph_target{nullptr};
579 size_t animation_index{};
580 size_t frame_index{};
581 union {
583
587 };
588
589 size_t sound_to_play{};
590 int crop_column{};
595 size_t patient_effect_offset;
596};
597
599 public:
600 void tick();
601
603 void set_speed(int x_speed, int y_speed) {
604 dx_per_tick = x_speed;
605 dy_per_tick = y_speed;
606 }
607 void set_lifetime(int life_time);
609 void append_sprite(size_t spr_num, int xpos, int ypos);
610 bool is_dead() const { return lifetime == 0; }
611
612 void persist(lua_persist_writer* writer) const;
613 void depersist(lua_persist_reader* reader);
614
615 void draw(render_target* canvas, const xy_pair& draw_pos);
616
617 void draw_fn(render_target* canvas, const xy_pair& draw_pos) override {
618 draw(canvas, draw_pos);
619 }
620
621 bool hit_test(const xy_pair& draw_pos, const xy_pair& obj_pos);
622
623 bool hit_test_fn(const xy_pair& draw_pos, const xy_pair& obj_pos) override {
624 return hit_test(draw_pos, obj_pos);
625 }
626
627 bool is_multiple_frame_animation_fn() override { return false; }
628
629 private:
630 struct sprite {
631 size_t index;
632 int x;
633 int y;
634 };
635
636 sprite_sheet* sheet{nullptr};
637 std::vector<sprite> sprites{};
638
640 int dx_per_tick{0};
642 int dy_per_tick{0};
644 int lifetime{-1};
647 bool use_intermediate_buffer{false};
648};
649
650// Find the appropriate subclass of animation_base for a given
651// userdata object.
652//
653// th_lua_internal.h defines our c++ binding class metatables:
654// metatable: { __index = method_table, ... }
655// method_table: { ... }
656// method_table metatable: { __class_name = class_name }
659 L, idx, {"animation", "spriteList"});
660}
661
662#endif // CORSIX_TH_TH_GFX_H_
Definition th_gfx.h:464
void remove_from_tile()
Definition th_gfx.cpp:1141
const xy_pair & get_pixel_offset() const
Definition th_gfx.h:472
void set_tile(const xy_pair &tile_pos)
Definition th_gfx.h:476
xy_pair pixel_offset
Offset in pixels relative to the center of the animation tile.
Definition th_gfx.h:489
xy_pair tile
Tile containing the animation. A negative x or y means it is not active.
Definition th_gfx.h:486
uint32_t get_flags() const
Definition th_gfx.h:471
void attach_to_tile(const xy_pair &tile_pos, map_tile *node, int layer)
Definition th_gfx.cpp:1146
void set_flags(uint32_t iFlags)
Definition th_gfx.h:475
void set_layer(int iLayer, int iId)
Definition th_gfx.cpp:1174
const xy_pair & get_tile() const
Definition th_gfx.h:473
void set_pixel_offset(int x, int y)
Definition th_gfx.h:477
animation_base()
Definition th_gfx.cpp:1139
void set_layers_from(const animation_base *pSrc)
Definition th_gfx.h:482
Theme Hospital sprite animation manager.
Definition th_gfx.h:234
size_t get_frame_sound(size_t iFrame)
Definition th_gfx.cpp:984
bool load_from_th_file(const uint8_t *pStartData, size_t iStartDataLength, const uint8_t *pFrameData, size_t iFrameDataLength, const uint8_t *pListData, size_t iListDataLength, const uint8_t *pElementData, size_t iElementDataLength)
Load original animations.
Definition th_gfx.cpp:188
void set_sprite_sheet(sprite_sheet *pSpriteSheet)
Definition th_gfx.cpp:143
bool set_frame_secondary_marker(size_t iFrame, int iX, int iY)
Definition th_gfx.cpp:815
void set_animation_alt_palette_map(size_t iAnimation, const uint8_t *pMap, uint32_t iAlt32)
Set the palette remap data for an animation.
Definition th_gfx.cpp:777
void get_frame_extent(size_t iFrame, const ::layers &oLayers, int *pMinX, int *pMaxX, int *pMinY, int *pMaxY, uint32_t iFlags) const
Definition th_gfx.cpp:992
animation_manager()=default
bool hit_test(size_t iFrame, const ::layers &oLayers, int iX, int iY, uint32_t iFlags, int iTestX, int iTestY) const
Definition th_gfx.cpp:850
size_t get_next_frame(size_t iFrame) const
Get the index of the frame after a given frame.
Definition th_gfx.cpp:769
bool get_frame_primary_marker(size_t iFrame, int *pX, int *pY)
Definition th_gfx.cpp:826
void draw_frame(render_target *pCanvas, size_t iFrame, const ::layers &oLayers, int iX, int iY, uint32_t iFlags, animation_effect patient_effect=animation_effect::none, size_t patient_effect_offset=0) const
Draw an animation frame.
Definition th_gfx.cpp:919
size_t get_frame_count() const
Get the total number of animation frames.
Definition th_gfx.cpp:759
void tick()
Notified every world tick to allow tracking rate of game time passage.
Definition th_gfx.cpp:848
bool get_frame_secondary_marker(size_t iFrame, int *pX, int *pY)
Definition th_gfx.cpp:837
bool set_frame_primary_marker(size_t iFrame, int iX, int iY)
Definition th_gfx.cpp:804
const animation_start_frames & get_named_animations(std::string_view sName, int iTilesize) const
Retrieve a custom animation by name and tile size.
Definition th_gfx.cpp:740
size_t get_animation_count() const
Get the total number of animations.
Definition th_gfx.cpp:755
size_t get_first_frame(size_t iAnimation) const
Get the index of the first frame of an animation.
Definition th_gfx.cpp:761
bool load_custom_animations(const uint8_t *pData, size_t iDataLength)
Load free animations.
Definition th_gfx.cpp:498
void set_canvas(render_target *pCanvas)
Set the video target.
Definition th_gfx.cpp:370
Definition th_gfx.h:497
void draw_fn(render_target *canvas, const xy_pair &draw_pos) override
Draw the object at a specific point on a render target.
Definition th_gfx.h:509
bool hit_test_fn(const xy_pair &draw_pos, const xy_pair &obj_pos) override
Perform a hit test against the object.
Definition th_gfx.h:530
animation()
Definition th_gfx.cpp:1188
void tick()
Definition th_gfx.cpp:1548
void depersist(lua_persist_reader *reader)
Definition th_gfx.cpp:1378
bool hit_test_child(const xy_pair &draw_pos, const xy_pair &obj_pos)
Definition th_gfx.cpp:1236
void draw(render_target *canvas, const xy_pair &draw_pos)
Definition th_gfx.cpp:1190
void set_animation_kind(animation_kind anim_kind)
Definition th_gfx.cpp:1483
bool hit_test_morph(const xy_pair &draw_pos, const xy_pair &obj_pos)
Definition th_gfx.cpp:1289
size_t get_frame() const
Definition th_gfx.h:554
xy_pair speed
Speed in pixels per tick.
Definition th_gfx.h:582
void set_frame(size_t new_frame)
Definition th_gfx.cpp:1710
void set_crop_column(int column)
Definition th_gfx.h:565
void draw_child(render_target *canvas, const xy_pair &draw_pos, bool use_primary)
Definition th_gfx.cpp:1216
void set_speed(int x, int y)
Definition th_gfx.h:561
int get_crop_column() const
Definition th_gfx.h:555
bool hit_test(const xy_pair &draw_pos, const xy_pair &obj_pos)
Definition th_gfx.cpp:1275
void draw_morph(render_target *canvas, const xy_pair &draw_pos)
Definition th_gfx.cpp:1242
void set_animation(animation_manager *mgr, size_t anim)
Definition th_gfx.cpp:1589
size_t get_animation() const
Definition th_gfx.h:551
bool get_primary_marker(int *pX, int *pY)
Definition th_gfx.cpp:1600
void persist(lua_persist_writer *writer) const
Definition th_gfx.cpp:1305
void set_parent(animation *parent_anim, bool use_primary)
Definition th_gfx.cpp:1573
bool is_multiple_frame_animation_fn() override
Definition th_gfx.h:543
void set_morph_target(animation *target, int duration=1)
Definition th_gfx.cpp:1659
animation_manager * get_animation_manager()
Definition th_gfx.h:574
link_list * get_previous()
Definition th_gfx.h:550
animation_kind get_animation_kind()
Definition th_gfx.h:572
animation * parent
Definition th_gfx.h:586
void set_patient_effect(animation_effect patient_effect)
Definition th_gfx.cpp:1479
bool get_secondary_marker(int *pX, int *pY)
Definition th_gfx.cpp:1614
Definition th_gfx.h:141
void chunk_fill_to_end_of_line(uint8_t value)
Perform a "fill to end of line" chunk (normally called by decodeChunks)
Definition th_gfx.cpp:1038
void chunk_copy(int npixels, const uint8_t *in_data)
Perform a "copy" chunk (normally called by decodeChunks)
Definition th_gfx.cpp:1057
void decode_chunks(const uint8_t *pData, int iDataLen, bool bComplex)
Convert a stream of chunks into a raw bitmap.
Definition th_gfx.cpp:1079
void chunk_fill(int npixels, uint8_t value)
Perform a "fill" chunk (normally called by decodeChunks)
Definition th_gfx.cpp:1049
void chunk_finish(uint8_t value)
Perform a "fill to end of file" chunk (normally called by decodeChunks)
Definition th_gfx.cpp:1045
Interface used for depersisting Lua objects.
Definition persist_lua.h:107
Interface used for persisting Lua objects.
Definition persist_lua.h:44
Definition th_gfx.cpp:43
Definition th_gfx_sdl.h:247
Definition th_gfx.h:598
bool hit_test(const xy_pair &draw_pos, const xy_pair &obj_pos)
Definition th_gfx.cpp:1752
void append_sprite(size_t spr_num, int xpos, int ypos)
Definition th_gfx.cpp:1769
bool is_multiple_frame_animation_fn() override
Definition th_gfx.h:627
void persist(lua_persist_writer *writer) const
Definition th_gfx.cpp:1774
void depersist(lua_persist_reader *reader)
Definition th_gfx.cpp:1813
bool is_dead() const
Definition th_gfx.h:610
void set_use_intermediate_buffer()
Definition th_gfx.cpp:1765
void draw_fn(render_target *canvas, const xy_pair &draw_pos) override
Draw the object at a specific point on a render target.
Definition th_gfx.h:617
bool hit_test_fn(const xy_pair &draw_pos, const xy_pair &obj_pos) override
Perform a hit test against the object.
Definition th_gfx.h:623
void set_speed(int x_speed, int y_speed)
Definition th_gfx.h:603
void set_lifetime(int life_time)
Definition th_gfx.cpp:1758
void tick()
Definition th_gfx.cpp:1712
void set_sheet(sprite_sheet *new_sheet)
Definition th_gfx.h:602
void draw(render_target *canvas, const xy_pair &draw_pos)
Definition th_gfx.cpp:1720
Sheet of sprites.
Definition th_gfx_sdl.h:504
Definition th_gfx.h:195
int tile_size
Size of a tile.
Definition th_gfx.h:197
std::string name
Name of the animations.
Definition th_gfx.h:196
Definition th_gfx.h:215
long north
Animation start frame for the 'north' view.
Definition th_gfx.h:216
long south
Animation start frame for the 'south' view.
Definition th_gfx.h:218
long west
Animation start frame for the 'west' view.
Definition th_gfx.h:219
long east
Animation start frame for the 'east' view.
Definition th_gfx.h:217
Definition th_gfx_sdl.h:43
Definition th_gfx.h:106
virtual void draw_fn(render_target *canvas, const xy_pair &draw_pos)=0
Draw the object at a specific point on a render target.
drawable()=default
virtual bool is_multiple_frame_animation_fn()=0
int get_drawing_layer()
Definition th_gfx.h:127
void set_drawing_layer(int layer)
Definition th_gfx.h:128
virtual bool hit_test_fn(const xy_pair &draw_pos, const xy_pair &obj_pos)=0
Perform a hit test against the object.
uint32_t flags
Drawing flags (zero or more list flags from draw_flags).
Definition th_gfx.h:131
Layer information (see animation_manager::draw_frame)
Definition th_gfx.h:190
uint8_t layer_contents[max_number_of_layers]
Definition th_gfx.h:191
Definition th_map.h:194
Definition th_gfx.h:95
int x
Value of the X coordinate.
Definition th_gfx.h:96
int y
Value of the Y coordinate.
Definition th_gfx.h:97
bool operator<(const animation_key &oK, const animation_key &oL)
Less-than operator for map-sorting.
Definition th_gfx.h:206
std::map< animation_key, animation_start_frames > named_animations_map
Definition th_gfx.h:223
draw_flags
Bitflags for drawing operations.
Definition th_gfx.h:50
@ thdf_alt32_blue_red_swap
Draw the sprite with red and blue colours swapped.
Definition th_gfx.h:80
@ thdf_alt_palette
Draw using a remapped palette.
Definition th_gfx.h:65
@ thdf_flip_horizontal
Draw with the left becoming the right and vice versa.
Definition th_gfx.h:55
@ thdf_alt32_start
Lowest bit of the field.
Definition th_gfx.h:71
@ thdf_bound_box_hit_test
Hit-test using bounding-box precision rather than pixel-perfect.
Definition th_gfx.h:87
@ thdf_flip_vertical
Draw with the top becoming the bottom and vice versa.
Definition th_gfx.h:57
@ thdf_early_list
Attach to the early sprite list (right-to-left pass)
Definition th_gfx.h:84
@ thdf_alpha_50
Definition th_gfx.h:60
@ thdf_alt32_grey_scale
Draw the sprite in grey scale.
Definition th_gfx.h:78
@ thdf_alpha_75
Definition th_gfx.h:63
@ thdf_alt32_plain
Draw the sprite with the normal palette (fallback option).
Definition th_gfx.h:76
@ thdf_nearest
Draw using nearest pixel hinting.
Definition th_gfx.h:91
@ thdf_crop
Apply a cropping operation prior to drawing.
Definition th_gfx.h:89
@ thdf_alt32_mask
Mask for the 32bpp alternative drawing values.
Definition th_gfx.h:73
std::pair< animation_key, animation_start_frames > named_animation_pair
Definition th_gfx.h:226
animation_kind
The kind of animation.
Definition th_gfx.h:495
scaled_items
Definition th_gfx.h:45
const int max_number_of_layers
Number of available layers, must be less or equal to 16 as it is stored in.
Definition th_gfx.h:187
void clip_rect_intersection(clip_rect &rcClip, const clip_rect &rcIntersect)
animation_base * luaT_toanimationbase(lua_State *L, int idx)
Definition th_gfx.h:657
animation_effect
Animation Effect for drawing a sprite with a special effect applied.
Definition th_gfx_common.h:30
@ none
No special effect.