diff --git a/src/lua-engine.cpp b/src/lua-engine.cpp index 2e65b97e..b647831b 100644 --- a/src/lua-engine.cpp +++ b/src/lua-engine.cpp @@ -3436,11 +3436,14 @@ static void gui_prepare() { #define LUA_PIXEL_G(PIX) (((PIX) >> 8) & 0xff) #define LUA_PIXEL_B(PIX) ((PIX) & 0xff) -//template static void swap(T &one, T &two) { -// T temp = one; -// one = two; -// two = temp; -//} +namespace fceu +{ + template static void swap(T &one, T &two) { + T temp = one; + one = two; + two = temp; + } +} // write a pixel to buffer static inline void blend32(uint32 *dstPixel, uint32 colour) @@ -3564,9 +3567,9 @@ static void gui_drawline_internal(int x1, int y1, int x2, int y2, bool lastPixel static void gui_drawbox_internal(int x1, int y1, int x2, int y2, uint32 colour) { if (x1 > x2) - std::swap(x1, x2); + fceu::swap(x1, x2); if (y1 > y2) - std::swap(y1, y2); + fceu::swap(y1, y2); if (x1 < 0) x1 = -1; if (y1 < 0)