summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/tilemap.h
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2020-03-11 15:47:30 +1100
committer Vas Crabb <vas@vastheman.com>2020-03-11 15:47:30 +1100
commit9733f5cf3df1255566dc147540a8d6ceab4adb6d (patch)
tree637f1e69a2b520771888635337ea4e051d7fa797 /src/emu/tilemap.h
parente7b33bd5e22adfc7422c969a0a2b6400c6563394 (diff)
tilemap: that macro has contributed nothing but obfuscation since we moved to C++
Diffstat (limited to 'src/emu/tilemap.h')
-rw-r--r--src/emu/tilemap.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/emu/tilemap.h b/src/emu/tilemap.h
index e9ed1a3b66d..13293a46823 100644
--- a/src/emu/tilemap.h
+++ b/src/emu/tilemap.h
@@ -793,14 +793,11 @@ private:
// function definition for a logical-to-memory mapper
#define TILEMAP_MAPPER_MEMBER(_name) tilemap_memory_index _name(u32 col, u32 row, u32 num_cols, u32 num_rows)
-// useful macro inside of a TILE_GET_INFO callback to set tile information
-#define SET_TILE_INFO_MEMBER(GFX,CODE,COLOR,FLAGS) tileinfo.set(GFX, CODE, COLOR, FLAGS)
-
-// Macros for setting tile attributes in the TILE_GET_INFO callback:
+// Helpers for setting tile attributes in the TILE_GET_INFO callback:
// TILE_FLIP_YX assumes that flipy is in bit 1 and flipx is in bit 0
// TILE_FLIP_XY assumes that flipy is in bit 0 and flipx is in bit 1
-#define TILE_FLIPYX(YX) ((YX) & 3)
-#define TILE_FLIPXY(XY) ((((XY) & 2) >> 1) | (((XY) & 1) << 1))
+template <typename T> constexpr u8 TILE_FLIPYX(T yx) { return u8(yx & 3); }
+template <typename T> constexpr u8 TILE_FLIPXY(T xy) { return u8(((xy & 2) >> 1) | ((xy & 1) << 1)); }