Skip to content

Commit

Permalink
[Decompilation] [th01] Line loop blitting
Browse files Browse the repository at this point in the history
Wait, so if this is only used for the rotating white squares around
Mima, that must mean that the white star in the YuugenMagan fight got a
completely redundant reimplementation…

Part of P0121, funded by Yanga.
  • Loading branch information
nmlgc committed Sep 28, 2020
1 parent 3c008b6 commit 6038947
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 146 deletions.
6 changes: 6 additions & 0 deletions th01/hardware/graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ void graph_r_line_unput(
void graph_r_box(
screen_x_t left, vram_y_t top, screen_x_t right, vram_y_t bottom, int col
);

// Draws lines in the given [col] from each of the given X/Y points to the
// next one, and then back from the last point to the first one.
void graph_r_lineloop_put(
const screen_x_t x[], const vram_y_t y[], int point_count, int col
);
/// -----------------------

/// Text
Expand Down
13 changes: 13 additions & 0 deletions th01/main/shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,16 @@ void shape_invincibility_put_with_mask_from_B_plane(
}
grcg_off();
}

// Why is this here?
void graph_r_lineloop_put(
const screen_x_t x[], const vram_y_t y[], int point_count, int col
)
{
int i = 0;
while((point_count - 1) > i) {
graph_r_line(x[i], y[i], x[i + 1], y[i + 1], col);
i++;
}
graph_r_line(x[i], y[i], x[0], y[0], col);
}
Loading

0 comments on commit 6038947

Please sign in to comment.