From cea79f239d912f75398ece6fc60271b53b85c531 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 23 Nov 2015 07:44:16 +0100 Subject: [PATCH] CLuaInstance: Fix transfer of color values in... ...PaintBox() and RenderString() for coolstream hardware - Set Lua api version to 1.11 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/45569a736ab9cb98f240281ece41d0a290753565 Author: Michael Liebmann Date: 2015-11-23 (Mon, 23 Nov 2015) ------------------ This commit was generated by Migit --- src/gui/luainstance.cpp | 8 ++++++++ src/gui/luainstance.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 94423a1e5..54bdb4eb2 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -660,8 +660,12 @@ int CLuaInstance::PaintBox(lua_State *L) y = luaL_checkint(L, 3); w = luaL_checkint(L, 4); h = luaL_checkint(L, 5); +#if HAVE_COOL_HARDWARE + c = luaL_checkunsigned(L, 6); +#else /* luaL_checkint does not like e.g. 0xffcc0000 on powerpc (returns INT_MAX) instead */ c = (unsigned int)luaL_checknumber(L, 6); +#endif if (count > 6) radius = luaL_checkint(L, 7); if (count > 7) @@ -874,7 +878,11 @@ int CLuaInstance::RenderString(lua_State *L) x = luaL_checkint(L, 4); y = luaL_checkint(L, 5); if (numargs > 5) +#if HAVE_COOL_HARDWARE + c = luaL_checkunsigned(L, 6); +#else c = luaL_checkint(L, 6); +#endif if (numargs > 6) w = luaL_checkint(L, 7); else diff --git a/src/gui/luainstance.h b/src/gui/luainstance.h index 346177367..ef7006ac3 100644 --- a/src/gui/luainstance.h +++ b/src/gui/luainstance.h @@ -34,7 +34,7 @@ extern "C" { #include #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 10 +#define LUA_API_VERSION_MINOR 11 /* this is stored as userdata in the lua_State */ struct CLuaData