Porytiles
Loading...
Searching...
No Matches
anim_params.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <string>
5#include <vector>
6
9
10namespace porytiles {
11
12namespace anim {
13
14inline constexpr std::size_t default_frame_factor = 16;
15inline constexpr std::size_t default_frame_offset = 0;
16inline constexpr std::size_t default_counter_max = 256;
17
18} // namespace anim
19
35 public:
36 AnimParams() = default;
37
50 [[nodiscard]] const DynamicCasedName &cased_name() const
51 {
52 return cased_name_;
53 }
54
56 {
57 cased_name_ = std::move(value);
58 }
59
71 [[nodiscard]] const std::string &frame_array_identifier() const
72 {
73 return frame_array_identifier_;
74 }
75
76 void frame_array_identifier(std::string value)
77 {
78 frame_array_identifier_ = std::move(value);
79 }
80
88 [[nodiscard]] std::size_t frame_factor() const
89 {
90 return frame_factor_;
91 }
92
93 void frame_factor(std::size_t value)
94 {
95 frame_factor_ = value;
96 }
97
105 [[nodiscard]] std::size_t frame_offset() const
106 {
107 return frame_offset_;
108 }
109
110 void frame_offset(std::size_t value)
111 {
112 frame_offset_ = value;
113 }
114
126 [[nodiscard]] const std::vector<DynamicCasedName> &frame_names() const
127 {
128 return frame_names_;
129 }
130
131 void frame_names(std::vector<DynamicCasedName> value)
132 {
133 frame_names_ = std::move(value);
134 }
135
147 [[nodiscard]] const std::vector<DynamicCasedName> &frame_order() const
148 {
149 return frame_order_;
150 }
151
152 void frame_order(std::vector<DynamicCasedName> value)
153 {
154 frame_order_ = std::move(value);
155 }
156
164 [[nodiscard]] std::size_t tile_offset() const
165 {
166 return tile_offset_;
167 }
168
169 void tile_offset(std::size_t value)
170 {
171 tile_offset_ = value;
172 }
173
181 [[nodiscard]] std::size_t tile_count() const
182 {
183 return tile_count_;
184 }
185
186 void tile_count(std::size_t value)
187 {
188 tile_count_ = value;
189 }
190
199 [[nodiscard]] std::size_t width_tiles() const
200 {
201 return width_tiles_;
202 }
203
204 void width_tiles(std::size_t value)
205 {
206 width_tiles_ = value;
207 }
208
217 [[nodiscard]] std::size_t height_tiles() const
218 {
219 return height_tiles_;
220 }
221
222 void height_tiles(std::size_t value)
223 {
224 height_tiles_ = value;
225 }
226
234 [[nodiscard]] std::size_t counter_max() const
235 {
236 return counter_max_;
237 }
238
239 void counter_max(std::size_t value)
240 {
241 counter_max_ = value;
242 }
243
251 [[nodiscard]] const std::vector<AnimOverrideEntry> &overrides() const
252 {
253 return overrides_;
254 }
255
256 void overrides(std::vector<AnimOverrideEntry> value)
257 {
258 overrides_ = std::move(value);
259 }
260
261 private:
262 DynamicCasedName cased_name_;
263 std::string frame_array_identifier_;
264 std::size_t frame_factor_{anim::default_frame_factor};
265 std::size_t frame_offset_{anim::default_frame_offset};
266 std::vector<DynamicCasedName> frame_names_{DynamicCasedName{"0"}};
267 std::vector<DynamicCasedName> frame_order_{DynamicCasedName{"0"}};
268 std::size_t tile_offset_{0};
269 std::size_t tile_count_{0};
270 std::size_t width_tiles_{0};
271 std::size_t height_tiles_{0};
272 std::size_t counter_max_{anim::default_counter_max};
273 std::vector<AnimOverrideEntry> overrides_;
274};
275
276} // namespace porytiles
Configuration parameters for a single tileset animation.
void height_tiles(std::size_t value)
void width_tiles(std::size_t value)
const std::string & frame_array_identifier() const
Returns the C identifier of the frame pointer array backing this animation.
const DynamicCasedName & cased_name() const
Returns the structured name for this animation, preserving case format information.
const std::vector< AnimOverrideEntry > & overrides() const
Returns the manual override entries for this animation.
void frame_factor(std::size_t value)
const std::vector< DynamicCasedName > & frame_order() const
Returns the playback sequence.
std::size_t frame_offset() const
Returns the frame offset (remainder value for timer modulo check).
void cased_name(DynamicCasedName value)
std::size_t height_tiles() const
Returns the height of animation frames in tiles.
void frame_array_identifier(std::string value)
void frame_offset(std::size_t value)
std::size_t width_tiles() const
Returns the width of animation frames in tiles.
void tile_offset(std::size_t value)
void frame_names(std::vector< DynamicCasedName > value)
void frame_order(std::vector< DynamicCasedName > value)
void tile_count(std::size_t value)
std::size_t tile_offset() const
Returns the VRAM tile offset for this animation.
const std::vector< DynamicCasedName > & frame_names() const
Returns the unique frame definitions.
std::size_t frame_factor() const
Returns the frame factor (modulus divisor for timer).
std::size_t counter_max() const
Returns the animation counter maximum value.
void overrides(std::vector< AnimOverrideEntry > value)
void counter_max(std::size_t value)
std::size_t tile_count() const
Returns the number of tiles per animation frame.
A smart string wrapper that preserves word structure for lossless case format conversion.
constexpr std::size_t default_counter_max
constexpr std::size_t default_frame_offset
constexpr std::size_t default_frame_factor