diff --git a/code/__DEFINES/matrices.dm b/code/__DEFINES/matrices.dm new file mode 100644 index 00000000000..b7240751b63 --- /dev/null +++ b/code/__DEFINES/matrices.dm @@ -0,0 +1,2 @@ +/// Helper macro for compile time translation +#define TRANSLATE_MATRIX(offset_x, offset_y) matrix(1, 0, (offset_x), 0, 1, (offset_y)) diff --git a/code/game/turfs/closed/minerals.dm b/code/game/turfs/closed/minerals.dm index df88a56d4ce..bf4545a8106 100644 --- a/code/game/turfs/closed/minerals.dm +++ b/code/game/turfs/closed/minerals.dm @@ -2,8 +2,6 @@ /**********************Mineral deposits**************************/ -#define MINERAL_WALL_OFFSET -4 - /turf/closed/mineral //wall piece name = "rock" icon = MAP_SWITCH('icons/turf/smoothrocks.dmi', 'icons/turf/mining.dmi') @@ -17,10 +15,10 @@ plane = GAME_PLANE_UPPER base_icon_state = "smoothrocks" - base_pixel_x = MINERAL_WALL_OFFSET - base_pixel_y = MINERAL_WALL_OFFSET - pixel_x = MAP_SWITCH(MINERAL_WALL_OFFSET, 0) - pixel_y = MAP_SWITCH(MINERAL_WALL_OFFSET, 0) + // This is static + // Done like this to avoid needing to make it dynamic and save cpu time + // 4 to the left, 4 down + transform = MAP_SWITCH(TRANSLATE_MATRIX(-4, -4), matrix()) temperature = TCMB var/turf/open/floor/plating/turf_type = /turf/open/misc/asteroid/airless @@ -35,7 +33,6 @@ ///How long it takes to mine this turf without tools, if it's weak. var/hand_mine_speed = 15 SECONDS -#undef MINERAL_WALL_OFFSET /turf/closed/mineral/Initialize(mapload) var/static/list/smoothing_groups = list(SMOOTH_GROUP_CLOSED_TURFS, SMOOTH_GROUP_MINERAL_WALLS) diff --git a/tgstation.dme b/tgstation.dme index 3e56ca99bd0..a8d638a602a 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -117,6 +117,7 @@ #include "code\__DEFINES\maps.dm" #include "code\__DEFINES\materials.dm" #include "code\__DEFINES\maths.dm" +#include "code\__DEFINES\matrices.dm" #include "code\__DEFINES\MC.dm" #include "code\__DEFINES\mecha.dm" #include "code\__DEFINES\melee.dm"