From 4a6ac52d8c4c62077cba42a314480a87714870df Mon Sep 17 00:00:00 2001 From: Rubidium Date: Tue, 8 Oct 2024 20:41:24 +0200 Subject: [PATCH] Cleanup: remove some unused #defines --- src/map_type.h | 12 ------------ src/saveload/saveload.h | 11 ----------- src/smallmap_gui.cpp | 4 ---- src/tgp.cpp | 2 -- 4 files changed, 29 deletions(-) diff --git a/src/map_type.h b/src/map_type.h index 246b6c0432..6537e51008 100644 --- a/src/map_type.h +++ b/src/map_type.h @@ -39,18 +39,6 @@ static const uint MAX_MAP_SIZE_BITS = 12; ///< Maximal size static const uint MIN_MAP_SIZE = 1U << MIN_MAP_SIZE_BITS; ///< Minimal map size = 64 static const uint MAX_MAP_SIZE = 1U << MAX_MAP_SIZE_BITS; ///< Maximal map size = 4096 -/** - * Approximation of the length of a straight track, relative to a diagonal - * track (ie the size of a tile side). - * - * \#defined instead of const so it can - * stay integer. (no runtime float operations) Is this needed? - * Watch out! There are _no_ brackets around here, to prevent intermediate - * rounding! Be careful when using this! - * This value should be sqrt(2)/2 ~ 0.7071 - */ -#define STRAIGHT_TRACK_LENGTH 7071/10000 - /** Argument for CmdLevelLand describing what to do. */ enum LevelMode : uint8_t { LM_LEVEL, ///< Level the land. diff --git a/src/saveload/saveload.h b/src/saveload/saveload.h index d12fb00e02..e92373a26c 100644 --- a/src/saveload/saveload.h +++ b/src/saveload/saveload.h @@ -1214,17 +1214,6 @@ inline constexpr bool SlCheckVarSize(SaveLoadType cmd, VarType type, size_t leng */ #define SLC_NULL(length, from, to) {{}, SLE_FILE_U8, length, from, to} -/** - * Empty space in every savegame version that was filled with a string. - * @param length Number of strings in the empty space. - * @param from First savegame version that has the empty space. - * @param to Last savegame version that has the empty space. - */ -#define SLC_NULL_STR(length, from, to) {{}, SLE_FILE_STRING, length, from, to} - -/** End marker of compat variables save or load. */ -#define SLC_END() {{}, 0, 0, SL_MIN_VERSION, SL_MIN_VERSION} - /** * Checks whether the savegame is below \a major.\a minor. * @param major Major number of the version to check against. diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index e3daba039d..9d57eac992 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -259,16 +259,12 @@ static const LegendAndColour * const _legend_table[] = { #define MKCOLOUR(x) TO_LE32X(x) #define MKCOLOUR_XXXX(x) (MKCOLOUR(0x01010101) * (uint)(x)) -#define MKCOLOUR_X0X0(x) (MKCOLOUR(0x01000100) * (uint)(x)) -#define MKCOLOUR_0X0X(x) (MKCOLOUR(0x00010001) * (uint)(x)) #define MKCOLOUR_0XX0(x) (MKCOLOUR(0x00010100) * (uint)(x)) #define MKCOLOUR_X00X(x) (MKCOLOUR(0x01000001) * (uint)(x)) -#define MKCOLOUR_XYXY(x, y) (MKCOLOUR_X0X0(x) | MKCOLOUR_0X0X(y)) #define MKCOLOUR_XYYX(x, y) (MKCOLOUR_X00X(x) | MKCOLOUR_0XX0(y)) #define MKCOLOUR_0000 MKCOLOUR_XXXX(0x00) -#define MKCOLOUR_0FF0 MKCOLOUR_0XX0(0xFF) #define MKCOLOUR_F00F MKCOLOUR_X00X(0xFF) #define MKCOLOUR_FFFF MKCOLOUR_XXXX(0xFF) diff --git a/src/tgp.cpp b/src/tgp.cpp index 578f94e47a..efe3fa96af 100644 --- a/src/tgp.cpp +++ b/src/tgp.cpp @@ -187,8 +187,6 @@ static HeightMap _height_map = { {}, 0, 0, 0 }; /** Conversion: Height to int */ #define H2I(i) ((i) >> height_decimal_bits) -/** Conversion: int to Amplitude */ -#define I2A(i) ((i) << amplitude_decimal_bits) /** Conversion: Amplitude to int */ #define A2I(i) ((i) >> amplitude_decimal_bits)