8namespace draw_routines {
14 if (size == 0) size = 32;
16 for (
int s = 0; s < size; s++) {
17 if (ctx.
tiles.size() >= 4) {
44 if (size == 0) size = 26;
46 for (
int s = 0; s < size; s++) {
47 if (ctx.
tiles.size() >= 8) {
67 }
else if (ctx.
tiles.size() >= 4) {
96 for (
int s = 0; s < count; s++) {
97 if (ctx.
tiles.size() >= 8) {
100 const int base_y = ctx.
object.
y_ + (s * 6);
112 base_y + 1, ctx.
tiles[5]);
114 base_y + 1, ctx.
tiles[6]);
116 base_y + 1, ctx.
tiles[7]);
126 int count = size + 1;
128 for (
int s = 0; s < count; s++) {
129 if (ctx.
tiles.size() >= 4) {
154 int count = size + 1;
156 if (ctx.
tiles.size() < 3)
return;
161 for (
int s = 0; s < count; s++) {
173 int count = size + 1;
175 for (
int s = 0; s < count; s++) {
176 if (ctx.
tiles.size() >= 1) {
189 int count = size + 10;
191 for (
int s = 0; s < count; s++) {
192 if (ctx.
tiles.size() >= 2) {
207 int count = size + 10;
209 for (
int s = 0; s < count; s++) {
210 if (ctx.
tiles.size() >= 2) {
225 .name =
"Downwards2x2_1to15or32",
227 .draws_to_both_bgs =
false,
231 .category = Category::Downwards});
235 .name =
"Downwards4x2_1to15or26",
240 .draws_to_both_bgs =
false,
244 .category = Category::Downwards});
248 .name =
"Downwards4x2_1to16_BothBG",
250 .draws_to_both_bgs =
true,
254 .category = Category::Downwards});
258 .name =
"DownwardsDecor4x2spaced4_1to16",
260 .draws_to_both_bgs =
false,
264 .category = Category::Downwards});
268 .name =
"Downwards2x2_1to16",
270 .draws_to_both_bgs =
false,
274 .category = Category::Downwards});
278 .name =
"DownwardsHasEdge1x1_1to16_plus3",
280 .draws_to_both_bgs =
false,
284 .category = Category::Downwards});
288 .name =
"DownwardsEdge1x1_1to16",
290 .draws_to_both_bgs =
false,
294 .category = Category::Downwards});
298 .name =
"DownwardsLeftCorners2x1_1to16_plus12",
300 .draws_to_both_bgs =
false,
304 .category = Category::Downwards});
308 .name =
"DownwardsRightCorners2x1_1to16_plus12",
310 .draws_to_both_bgs =
false,
314 .category = Category::Downwards});
void WriteTile8(gfx::BackgroundBuffer &bg, int tile_x, int tile_y, const gfx::TileInfo &tile_info)
Write an 8x8 tile to the background buffer.
void DrawDownwards4x2_1to15or26(const DrawContext &ctx)
Draw 4x2 tiles downward pattern (1-15 or 26 iterations)
void DrawDownwardsEdge1x1_1to16(const DrawContext &ctx)
Draw 1x1 edge tiles downward (1-16 iterations)
void DrawDownwards2x2_1to15or32(const DrawContext &ctx)
Draw 2x2 tiles downward pattern (1-15 or 32 iterations)
void DrawDownwards2x2_1to16(const DrawContext &ctx)
Draw 2x2 tiles downward pattern (1-16 iterations)
void RegisterDownwardsRoutines(std::vector< DrawRoutineInfo > ®istry)
Register all downwards draw routines to the registry.
void DrawDownwardsHasEdge1x1_1to16_plus3(const DrawContext &ctx)
Draw 1x1 tiles with edge detection +3 downward.
void DrawDownwardsLeftCorners2x1_1to16_plus12(const DrawContext &ctx)
Draw left corner 2x1 tiles with +12 offset downward.
void DrawDownwardsRightCorners2x1_1to16_plus12(const DrawContext &ctx)
Draw right corner 2x1 tiles with +12 offset downward.
void DrawDownwardsDecor4x2spaced4_1to16(const DrawContext &ctx)
Draw 4x2 decoration downward with spacing (1-16 iterations)
void DrawDownwards4x2_1to16_BothBG(const DrawContext &ctx)
Draw 4x2 tiles downward pattern for both BG layers.
Context passed to draw routines containing all necessary state.
std::span< const gfx::TileInfo > tiles
gfx::BackgroundBuffer & target_bg
const RoomObject & object
Metadata about a draw routine.