CorsixTH engine (the C++ part)
Open source implementation of Theme Hospital
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
drawable Struct Referenceabstract

#include <th_gfx.h>

Inheritance diagram for drawable:
link_list animation_base animation sprite_render_list

Public Member Functions

 drawable ()=default
 
virtual void draw_fn (render_target *canvas, const xy_pair &draw_pos)=0
 Draw the object at a specific point on a render target.
 
virtual bool hit_test_fn (const xy_pair &draw_pos, const xy_pair &obj_pos)=0
 Perform a hit test against the object.
 
virtual bool is_multiple_frame_animation_fn ()=0
 
int get_drawing_layer ()
 
void set_drawing_layer (int layer)
 

Public Attributes

uint32_t flags {0}
 Drawing flags (zero or more list flags from draw_flags).
 

Detailed Description

Base class for a linked list of drawable objects. Note that "object" is used as a generic term, not in specific reference to game objects (though they are the most common thing in drawing lists).

Constructor & Destructor Documentation

◆ drawable()

drawable::drawable ( )
default

Member Function Documentation

◆ draw_fn()

virtual void drawable::draw_fn ( render_target canvas,
const xy_pair draw_pos 
)
pure virtual

Draw the object at a specific point on a render target.

Can also "draw" the object to the speakers, i.e. play sounds.

Implemented in animation, and sprite_render_list.

◆ get_drawing_layer()

int drawable::get_drawing_layer ( )
inline

◆ hit_test_fn()

virtual bool drawable::hit_test_fn ( const xy_pair draw_pos,
const xy_pair obj_pos 
)
pure virtual

Perform a hit test against the object.

Should return true if when the object is drawn at draw_pos on a canvas, the point obj_pos is within / on the object.

Implemented in animation, and sprite_render_list.

◆ is_multiple_frame_animation_fn()

virtual bool drawable::is_multiple_frame_animation_fn ( )
pure virtual

Returns true if instance is a multiple frame animation. Should be overloaded in derived class.

Implemented in animation, and sprite_render_list.

◆ set_drawing_layer()

void drawable::set_drawing_layer ( int  layer)
inline

Member Data Documentation

◆ flags

uint32_t drawable::flags {0}

Drawing flags (zero or more list flags from draw_flags).


The documentation for this struct was generated from the following file: