You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
Indentation conventions, use C99 variable length arrays
This commit is contained in:
14
tools/gfx.c
14
tools/gfx.c
@@ -103,8 +103,8 @@ void remove_whitespace(struct Graphic *graphic) {
|
|||||||
int tile_size = Options.depth * 8;
|
int tile_size = Options.depth * 8;
|
||||||
if (Options.interleave) tile_size *= 2;
|
if (Options.interleave) tile_size *= 2;
|
||||||
|
|
||||||
// Make sure we have a whole number of tiles, round down if required
|
// Make sure we have a whole number of tiles, round down if required
|
||||||
graphic->size &= tile_size - 1;
|
graphic->size &= tile_size - 1;
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (int j = 0; i < graphic->size && j < graphic->size; i += tile_size, j += tile_size) {
|
for (int j = 0; i < graphic->size && j < graphic->size; i += tile_size, j += tile_size) {
|
||||||
@@ -141,8 +141,8 @@ void remove_duplicates(struct Graphic *graphic) {
|
|||||||
if (Options.interleave) tile_size *= 2;
|
if (Options.interleave) tile_size *= 2;
|
||||||
int num_tiles = 0;
|
int num_tiles = 0;
|
||||||
|
|
||||||
// Make sure we have a whole number of tiles, round down if required
|
// Make sure we have a whole number of tiles, round down if required
|
||||||
graphic->size &= tile_size - 1;
|
graphic->size &= tile_size - 1;
|
||||||
|
|
||||||
for (int i = 0, j = 0; i < graphic->size && j < graphic->size; i += tile_size, j += tile_size) {
|
for (int i = 0, j = 0; i < graphic->size && j < graphic->size; i += tile_size, j += tile_size) {
|
||||||
while (j < graphic->size && tile_exists(&graphic->data[j], graphic->data, tile_size, num_tiles)) {
|
while (j < graphic->size && tile_exists(&graphic->data[j], graphic->data, tile_size, num_tiles)) {
|
||||||
@@ -163,7 +163,7 @@ void remove_duplicates(struct Graphic *graphic) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool flip_exists(uint8_t *tile, uint8_t *tiles, int tile_size, int num_tiles, bool xflip, bool yflip) {
|
bool flip_exists(uint8_t *tile, uint8_t *tiles, int tile_size, int num_tiles, bool xflip, bool yflip) {
|
||||||
uint8_t *flip = alloca(tile_size);
|
uint8_t flip[tile_size];
|
||||||
int half_size = tile_size / 2;
|
int half_size = tile_size / 2;
|
||||||
for (int i = 0; i < tile_size; i++) {
|
for (int i = 0; i < tile_size; i++) {
|
||||||
int byte = i;
|
int byte = i;
|
||||||
@@ -192,8 +192,8 @@ void remove_flip(struct Graphic *graphic, bool xflip, bool yflip) {
|
|||||||
if (Options.interleave) tile_size *= 2;
|
if (Options.interleave) tile_size *= 2;
|
||||||
int num_tiles = 0;
|
int num_tiles = 0;
|
||||||
|
|
||||||
// Make sure we have a whole number of tiles, round down if required
|
// Make sure we have a whole number of tiles, round down if required
|
||||||
graphic->size &= tile_size - 1;
|
graphic->size &= tile_size - 1;
|
||||||
|
|
||||||
for (int i = 0, j = 0; i < graphic->size && j < graphic->size; i += tile_size, j += tile_size) {
|
for (int i = 0, j = 0; i < graphic->size && j < graphic->size; i += tile_size, j += tile_size) {
|
||||||
while (j < graphic->size && flip_exists(&graphic->data[j], graphic->data, tile_size, num_tiles, xflip, yflip)) {
|
while (j < graphic->size && flip_exists(&graphic->data[j], graphic->data, tile_size, num_tiles, xflip, yflip)) {
|
||||||
|
Reference in New Issue
Block a user