diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/constants/pokemon.h | 4 | ||||
-rw-r--r-- | include/data.h | 4 | ||||
-rw-r--r-- | include/global.h | 8 |
3 files changed, 12 insertions, 4 deletions
diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 827725fc2..5b6b8cb5e 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -337,7 +337,9 @@ #define NUM_MALE_LINK_FACILITY_CLASSES 8 #define NUM_FEMALE_LINK_FACILITY_CLASSES 8 -#define MON_PIC_SIZE (64 * 64 / 2) +#define MON_PIC_WIDTH 64 +#define MON_PIC_HEIGHT 64 +#define MON_PIC_SIZE (MON_PIC_WIDTH * MON_PIC_HEIGHT / 2) #define BATTLE_ALIVE_EXCEPT_ACTIVE 0 #define BATTLE_ALIVE_ATK_SIDE 1 diff --git a/include/data.h b/include/data.h index 374435cba..2d3619e67 100644 --- a/include/data.h +++ b/include/data.h @@ -21,6 +21,10 @@ struct MonCoords u8 y_offset; }; +#define MON_COORDS_SIZE(width, height)(DIV_ROUND_UP(width, 8) << 4 | DIV_ROUND_UP(height, 8)) +#define GET_MON_COORDS_WIDTH(size)((size >> 4) * 8) +#define GET_MON_COORDS_HEIGHT(size)((size & 0xF) * 8) + struct TrainerMonNoItemDefaultMoves { u16 iv; diff --git a/include/global.h b/include/global.h index dd02a1790..53e9ba134 100644 --- a/include/global.h +++ b/include/global.h @@ -120,10 +120,12 @@ f; \ }) -#define ROUND_BITS_TO_BYTES(numBits)(((numBits) / 8) + (((numBits) % 8) ? 1 : 0)) +#define DIV_ROUND_UP(val, roundBy)(((val) / (roundBy)) + (((val) % (roundBy)) ? 1 : 0)) -#define DEX_FLAGS_NO (ROUND_BITS_TO_BYTES(NUM_SPECIES)) -#define NUM_FLAG_BYTES (ROUND_BITS_TO_BYTES(FLAGS_COUNT)) +#define ROUND_BITS_TO_BYTES(numBits) DIV_ROUND_UP(numBits, 8) + +#define DEX_FLAGS_NO ROUND_BITS_TO_BYTES(NUM_SPECIES) +#define NUM_FLAG_BYTES ROUND_BITS_TO_BYTES(FLAGS_COUNT) struct Coords8 { |