CorsixTH engine (the C++ part)
Open source implementation of Theme Hospital
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions | Variables
th_gfx.h File Reference
#include "config.h"
#include <map>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include "lua.hpp"
#include "th.h"
#include "th_gfx_common.h"
#include "th_gfx_sdl.h"
#include "th_lua.h"

Go to the source code of this file.

Classes

struct  xy_pair
 
struct  drawable
 
class  chunk_renderer
 
struct  layers
 Layer information (see animation_manager::draw_frame) More...
 
struct  animation_key
 
struct  animation_start_frames
 
class  animation_manager
 Theme Hospital sprite animation manager. More...
 
class  animation_base
 
class  animation
 
class  sprite_render_list
 

Typedefs

typedef std::map< animation_key, animation_start_framesnamed_animations_map
 
typedef std::pair< animation_key, animation_start_framesnamed_animation_pair
 

Enumerations

enum class  scaled_items { none , sprite_sheets , bitmaps , all }
 
enum  draw_flags : uint32_t {
  thdf_flip_horizontal = 1 << 0 , thdf_flip_vertical = 1 << 1 , thdf_alpha_50 = 1 << 2 , thdf_alpha_75 = 1 << 3 ,
  thdf_alt_palette = 1 << 4 , thdf_alt32_start = 5 , thdf_alt32_mask = 0x7 << thdf_alt32_start , thdf_alt32_plain = 0 << thdf_alt32_start ,
  thdf_alt32_grey_scale = 1 << thdf_alt32_start , thdf_alt32_blue_red_swap = 2 << thdf_alt32_start , thdf_early_list = 1 << 10 , thdf_bound_box_hit_test = 1 << 12 ,
  thdf_crop = 1 << 13 , thdf_nearest = 1 << 14
}
 Bitflags for drawing operations. More...
 
enum class  animation_kind { primary_child , secondary_child , normal , morph }
 The kind of animation. More...
 

Functions

void clip_rect_intersection (clip_rect &rcClip, const clip_rect &rcIntersect)
 
bool operator< (const animation_key &oK, const animation_key &oL)
 Less-than operator for map-sorting.
 
animation_baseluaT_toanimationbase (lua_State *L, int idx)
 

Variables

const int max_number_of_layers = 13
 Number of available layers, must be less or equal to 16 as it is stored in.
 

Typedef Documentation

◆ named_animation_pair

Insertion data structure.

◆ named_animations_map

Map holding the custom animations.

Enumeration Type Documentation

◆ animation_kind

The kind of animation.

Enumerator
primary_child 
secondary_child 
normal 
morph 

◆ draw_flags

enum draw_flags : uint32_t

Bitflags for drawing operations.

Enumerator
thdf_flip_horizontal 

Draw with the left becoming the right and vice versa.

Sprite drawing flags

thdf_flip_vertical 

Draw with the top becoming the bottom and vice versa.

thdf_alpha_50 

Draw with 50% transparency. If set together with thdf_alpha_75, don't draw at all.

thdf_alpha_75 

Draw with 75% transparency. If set together with thdf_alpha_50, don't draw at all.

thdf_alt_palette 

Draw using a remapped palette.

thdf_alt32_start 

Lowest bit of the field.

How to draw alternative palette in 32bpp.

thdf_alt32_mask 

Mask for the 32bpp alternative drawing values.

thdf_alt32_plain 

Draw the sprite with the normal palette (fallback option).

thdf_alt32_grey_scale 

Draw the sprite in grey scale.

thdf_alt32_blue_red_swap 

Draw the sprite with red and blue colours swapped.

thdf_early_list 

Attach to the early sprite list (right-to-left pass)

thdf_bound_box_hit_test 

Hit-test using bounding-box precision rather than pixel-perfect.

thdf_crop 

Apply a cropping operation prior to drawing.

thdf_nearest 

Draw using nearest pixel hinting.

◆ scaled_items

Enumerator
none 
sprite_sheets 
bitmaps 
all 

Function Documentation

◆ clip_rect_intersection()

void clip_rect_intersection ( clip_rect rcClip,
const clip_rect rcIntersect 
)

◆ luaT_toanimationbase()

animation_base * luaT_toanimationbase ( lua_State L,
int  idx 
)
inline

◆ operator<()

bool operator< ( const animation_key oK,
const animation_key oL 
)
inline

Less-than operator for map-sorting.

Parameters
oKFirst key value.
oLSecond key value.
Returns
Whether oK should be before oL.

Variable Documentation

◆ max_number_of_layers

const int max_number_of_layers = 13

Number of available layers, must be less or equal to 16 as it is stored in.