DSC Engine
Loading...
Searching...
No Matches
obj_visual.hpp
Go to the documentation of this file.
1
6#pragma once
7
9#include "DSCEngine/types/size.hpp"
11#include "DSCEngine/sprites/obj_size.hpp"
12
13namespace DSC
14{
15 class ObjFrame;
19 {
20 private:
21 Size<char> size;
22
23 Vector<ObjFrame*> frames;
24 unsigned char crt_gfx_id = 0;
25
26 bool gfx_changed = true;
27
29
30 int visual_stat = 0;
31
32 bool anim_enabled = false;
33 int anim_frameset = 0;
34 int anim_crt_frame = 0;
35
36 int anim_ticks = 1;
37 int crt_anim_ticks = 0;
38
39 bool auto_delete_frames = true;
40 public:
41 ObjVisual(DSC::ObjSize obj_size);
42
43 Size<char> get_size() const;
44
48 int add_frame(ObjFrame* frame);
49
50
54 void* get_crt_gfx() const;
55
60 int set_crt_gfx(int gfx_index);
61
62 int get_crt_color_depth() const;
63
64 void update();
65
66 int add_frameset(int frame_id, ...);
67
68 void set_animation(int frameset_id, bool reset_current_frame = false);
69
70 void set_animation_ticks(int ticks);
71
72 inline static constexpr int FRAMESET_END = -1;
73
74 ~ObjVisual();
75 };
76}
Definition: obj_frame.hpp:14
OAM Object graphics handler class
Definition: obj_visual.hpp:19
int add_frame(ObjFrame *frame)
adds a new frame to the visual
void * get_crt_gfx() const
gets the current graphics from VRAM
int set_crt_gfx(int gfx_index)
sets the id of the current (displayed) frame
Generic dynamic vector.
Definition: vector.hpp:23
Generic size of two coordinates.
Definition: size.hpp:10
Generic dynamic vector definition.