actual update to latest mobile-common

This commit is contained in:
fysx
2014-08-27 23:23:26 +02:00
parent abb819335b
commit c6ac06c366
992 changed files with 169762 additions and 177 deletions
+5 -7
View File
@@ -6,7 +6,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := liblove
LOCAL_CFLAGS := -fexceptions -g -Dlinux -Dunix \
-DHAVE_GCC_DESTRUCTOR=1 -DOPT_GENERIC -DREAL_IS_FLOAT \
-DGL_GLEXT_PROTOTYPES
-DGL_GLEXT_PROTOTYPES -DLOVE_TURBO_JPEG -DLOVE_NO_DEVIL
LOCAL_CPPFLAGS := ${LOCAL_CFLAGS}
@@ -16,12 +16,9 @@ LOCAL_C_INCLUDES := \
${LOCAL_PATH}/src/libraries/ \
${LOCAL_PATH}/src/libraries/enet/libenet/include \
${LOCAL_PATH}/../SDL2-2.0.3/include \
${LOCAL_PATH}/../devil-1.7.8/include \
${LOCAL_PATH}/../devil-1.7.8/src-IL/include \
${LOCAL_PATH}/../jasper-1.900.1/src/libjasper/include \
${LOCAL_PATH}/../libpng-1.6.8/ \
${LOCAL_PATH}/../libmng-1.0.10/ \
${LOCAL_PATH}/../jpeg-8d/ \
${LOCAL_PATH}/../libjpeg-turbo-1.3.1/ \
${LOCAL_PATH}/../lcms2-2.5/include \
${LOCAL_PATH}/../tiff-3.9.5/libtiff \
${LOCAL_PATH}/../openal-soft-android/include \
@@ -93,13 +90,14 @@ LOCAL_SRC_FILES := \
$(wildcard ${LOCAL_PATH}/src/libraries/luasocket/libluasocket/*.c) \
$(wildcard ${LOCAL_PATH}/src/libraries/noise1234/*.cpp) \
$(wildcard ${LOCAL_PATH}/src/libraries/Wuff/*.c) \
$(wildcard ${LOCAL_PATH}/src/libraries/lodepng/*.cpp) \
))
LOCAL_CXXFLAGS := -std=c++0x
LOCAL_SHARED_LIBRARIES := libphysfs libvorbis libogg libopenal libmpg123 libmodplug libdevil libtiff libmng libfreetype liblcms libjasper libpng libjpeg
LOCAL_SHARED_LIBRARIES := libopenal libmpg123
LOCAL_STATIC_LIBRARIES := libluajit SDL2_static
LOCAL_STATIC_LIBRARIES := libphysfs libvorbis libogg libmodplug libfreetype libturbo-jpeg libluajit SDL2_static
# $(info liblove: include dirs $(LOCAL_C_INCLUDES))
# $(info liblove: src files $(LOCAL_SRC_FILES))
+19 -13
View File
@@ -58,6 +58,8 @@ namespace
namespace love
{
Module *Module::instances[] = {};
Module::~Module()
{
ModuleRegistry &registry = registryInstance();
@@ -72,6 +74,13 @@ Module::~Module()
}
}
// Same deal with Module::getModuleType().
for (int i = 0; i < (int) M_MAX_ENUM; i++)
{
if (instances[i] == this)
instances[i] = nullptr;
}
freeEmptyRegistry();
}
@@ -94,6 +103,16 @@ void Module::registerInstance(Module *instance)
}
registry.insert(make_pair(name, instance));
ModuleType moduletype = instance->getModuleType();
if (instances[moduletype] != nullptr)
{
printf("Warning: overwriting module instance %s with new instance %s\n",
instances[moduletype]->getName(), instance->getName());
}
instances[moduletype] = instance;
}
Module *Module::getInstance(const std::string &name)
@@ -108,17 +127,4 @@ Module *Module::getInstance(const std::string &name)
return it->second;
}
Module *Module::findInstance(const std::string &name)
{
ModuleRegistry &registry = registryInstance();
for (auto it = registry.begin(); it != registry.end(); ++it)
{
if (it->first.find(name) == 0)
return it->second;
}
return nullptr;
}
} // love
+39 -9
View File
@@ -34,11 +34,35 @@ class Module : public Object
{
public:
/**
* Destructor.
**/
enum ModuleType
{
M_AUDIO,
M_EVENT,
M_FILESYSTEM,
M_FONT,
M_GRAPHICS,
M_IMAGE,
M_JOYSTICK,
M_KEYBOARD,
M_MATH,
M_MOUSE,
M_PHYSICS,
M_SOUND,
M_SYSTEM,
M_THREAD,
M_TIMER,
M_TOUCH,
M_WINDOW,
M_MAX_ENUM
};
virtual ~Module();
/**
* Gets the base type of the module.
**/
virtual ModuleType getModuleType() const = 0;
/**
* Gets the name of the module. This is used in case of errors
* and other messages.
@@ -63,13 +87,19 @@ public:
static Module *getInstance(const std::string &name);
/**
* Find the first module instance from the internal registry whose name
* starts with the supplied name. May return NULL if module is not
* registered or the supplied name is not part of any module name.
* @param name The partial name of the module.
* @return Module instance or NULL if the module is not registered.
* Retrieve module instance from the internal registry using the base
* module type. May return null if the module is not registered.
* @param type The base type of the module.
**/
static Module *findInstance(const std::string &name);
template <typename T>
static T *getInstance(ModuleType type)
{
return (T *) instances[type];
}
private:
static Module *instances[M_MAX_ENUM];
}; // Module
+2
View File
@@ -21,6 +21,8 @@
// LOVE
#include "Object.h"
#include <stdio.h>
namespace love
{
+62
View File
@@ -92,11 +92,73 @@ public:
}; // AutoRelease
/**
* Partial re-implementation + specialization of std::shared_ptr. We can't
* use C++11's stdlib yet...
**/
template <typename T>
class StrongRef
{
public:
StrongRef()
: object(nullptr)
{
}
StrongRef(T *obj)
: object(obj)
{
if (object) object->retain();
}
StrongRef(const StrongRef &other)
: object(other.get())
{
if (object) object->retain();
}
~StrongRef()
{
if (object) object->release();
}
StrongRef &operator = (const StrongRef &other)
{
set(other.get());
return *this;
}
T *operator->() const
{
return object;
}
void set(T *obj)
{
if (obj) obj->retain();
if (object) object->release();
object = obj;
}
T *get() const
{
return object;
}
private:
T *object;
}; // StrongRef
private:
// The reference count.
int count;
}; // Object
} // love
#endif // LOVE_OBJECT_H
-1
View File
@@ -226,7 +226,6 @@ void Variant::toLua(lua_State *L)
{
const char *name = NULL;
love::types.find(udatatype, name);
((love::Object *) data.userdata)->retain();
luax_pushtype(L, name, flags, (love::Object *) data.userdata);
}
else
+4
View File
@@ -78,6 +78,10 @@
# define LOVE_LEGENDARY_APP_ARGV_HACK
#endif
#if defined(LOVE_ANDROID) || defined(LOVE_IOS)
# define LOVE_LEGENDARY_ACCELEROMETER_AS_JOYSTICK_HACK
#endif
// Autotools config.h
#ifdef HAVE_CONFIG_H
# include <../config.h>
+22 -46
View File
@@ -36,8 +36,7 @@
namespace love
{
static thread::Mutex *gcmutex = 0;
void *_gcmutex = 0;
static thread::Mutex *gcmutex = nullptr;
/**
* Called when an object is collected. The object is released
@@ -46,25 +45,15 @@ void *_gcmutex = 0;
static int w__gc(lua_State *L)
{
if (!gcmutex)
{
gcmutex = thread::newMutex();
_gcmutex = (void *) gcmutex;
}
Proxy *p = (Proxy *)lua_touserdata(L, 1);
Object *t = (Object *)p->data;
Proxy *p = (Proxy *) lua_touserdata(L, 1);
Object *object = (Object *) p->data;
thread::Lock lock(gcmutex);
int numretains = p->retains;
if (numretains >= 0)
numretains = std::min(numretains, t->getReferenceCount());
object->release();
for (int i = numretains; i > 0; i--)
t->release();
// Signal that this Proxy is dead.
p->retains = -1;
return 0;
}
@@ -228,7 +217,6 @@ int luax_register_module(lua_State *L, const WrappedModule &m)
luax_insistregistry(L, REGISTRY_MODULES);
Proxy *p = (Proxy *)lua_newuserdata(L, sizeof(Proxy));
p->retains = 1;
p->data = m.module;
p->flags = m.flags;
@@ -394,20 +382,24 @@ int luax_register_searcher(lua_State *L, lua_CFunction f, int pos)
return 0;
}
void luax_rawnewtype(lua_State *L, const char *name, bits flags, love::Object *data, bool own)
void luax_rawnewtype(lua_State *L, const char *name, bits flags, love::Object *object)
{
Proxy *u = (Proxy *)lua_newuserdata(L, sizeof(Proxy));
u->data = (void *) data;
object->retain();
u->data = (void *) object;
u->flags = flags;
u->retains = own ? 1 : 0;
luaL_newmetatable(L, name);
lua_setmetatable(L, -2);
}
void luax_pushtype(lua_State *L, const char *name, bits flags, love::Object *data, bool own)
void luax_pushtype(lua_State *L, const char *name, bits flags, love::Object *object)
{
if (object == nullptr)
lua_pushnil(L);
// Fetch the registry table of instantiated types.
luax_getregistry(L, REGISTRY_TYPES);
@@ -415,11 +407,11 @@ void luax_pushtype(lua_State *L, const char *name, bits flags, love::Object *dat
if (!lua_istable(L, -1))
{
lua_pop(L, 1);
return luax_rawnewtype(L, name, flags, data, own);
return luax_rawnewtype(L, name, flags, object);
}
// Get the value of lovetypes[data] on the stack.
lua_pushlightuserdata(L, (void *) data);
// Get the value of lovetypes[object] on the stack.
lua_pushlightuserdata(L, (void *) object);
lua_gettable(L, -2);
// If the Proxy userdata isn't in the instantiated types table yet, add it.
@@ -427,38 +419,18 @@ void luax_pushtype(lua_State *L, const char *name, bits flags, love::Object *dat
{
lua_pop(L, 1);
luax_rawnewtype(L, name, flags, data, own);
luax_rawnewtype(L, name, flags, object);
lua_pushlightuserdata(L, (void *) data);
lua_pushlightuserdata(L, (void *) object);
lua_pushvalue(L, -2);
// lovetypes[data] = Proxy.
// lovetypes[object] = Proxy.
lua_settable(L, -4);
// Remove the lovetypes table from the stack.
lua_remove(L, -2);
// The Proxy userdata remains at the top of the stack.
return;
}
// Remove the lovetypes table from the stack.
lua_remove(L, -2);
// If the object should be released on GC and we already have a stored
// Proxy, we should tell the Proxy that the object was retained again.
if (own)
{
Proxy *p = (Proxy *) lua_touserdata(L, -1);
thread::EmptyLock lock;
if (gcmutex)
lock.setLock(gcmutex);
if (p->retains >= 0)
++(p->retains);
}
// Keep the Proxy userdata on the stack.
}
@@ -486,6 +458,10 @@ int luax_getfunction(lua_State *L, const char *mod, const char *fn)
int luax_convobj(lua_State *L, int idx, const char *mod, const char *fn)
{
// Convert to absolute index if necessary.
if (idx < 0 && idx > LUA_REGISTRYINDEX)
idx += lua_gettop(L) + 1;
// Convert string to a file.
luax_getfunction(L, mod, fn);
lua_pushvalue(L, idx); // The initial argument.
+59 -26
View File
@@ -33,6 +33,9 @@ extern "C" {
#include <lauxlib.h>
}
// C++
#include <exception>
namespace love
{
@@ -40,16 +43,13 @@ namespace love
class Module;
class Reference;
// Exposed mutex of the GC
extern void *_gcmutex;
/**
* Registries represent special tables which can be accessed with
* luax_insistregistry and luax_getregistry.
**/
enum Registry
{
REGISTRY_GC = 1,
REGISTRY_GC,
REGISTRY_MODULES,
REGISTRY_TYPES
};
@@ -67,9 +67,6 @@ struct Proxy
// The light userdata (pointer to the love::Object).
void *data;
// The number of times release() should be called on GC.
int retains;
};
/**
@@ -228,6 +225,9 @@ void luax_setfuncs(lua_State *L, const luaL_Reg *l);
/**
* Register a module in the love table. The love table will be created if it does not exist.
* NOTE: The module-object is expected to have a +1 reference count before calling
* this function, as it doesn't retain the object itself but Lua will release it
* upon garbage collection.
* @param L The Lua state.
**/
int luax_register_module(lua_State *L, const WrappedModule &m);
@@ -268,27 +268,27 @@ int luax_register_searcher(lua_State *L, lua_CFunction f, int pos = -1);
/**
* Pushes a Lua representation of the given object onto the stack, creating and
* storing the Lua representation in a weak table if it doesn't exist yet.
* NOTE: The object will be retained by Lua and released upon garbage collection.
* @param L The Lua state.
* @param name The name of the type. This must match the name used with luax_register_type.
* @param flags The type information of the object.
* @param data The pointer to the actual object.
* @param own Set this to true (default) if the object should be released upon garbage collection.
* @param object The pointer to the actual object.
**/
void luax_pushtype(lua_State *L, const char *name, bits flags, love::Object *data, bool own = true);
void luax_pushtype(lua_State *L, const char *name, bits flags, love::Object *object);
/**
* Creates a new Lua representation of the given object *without* checking if it
* exists yet, and *without* storing it in a weak table.
* This should only be used when performance is an extreme concern and the
* object is not ever expected to be pushed to Lua again, as it prevents the
* Lua-side objects from working in all cases when used as keys in tables.
* Lua-side objects from working in some cases when used as keys in tables.
* NOTE: The object will be retained by Lua and released upon garbage collection.
* @param L The Lua state.
* @param name The name of the type. This must match the name used with luax_register_type.
* @param flags The type information of the object.
* @param data The pointer to the actual object.
* @param own Set this to true (default) if the object should be released upon garbage collection.
* @param object The pointer to the actual object.
**/
void luax_rawnewtype(lua_State *L, const char *name, bits flags, love::Object *data, bool own = true);
void luax_rawnewtype(lua_State *L, const char *name, bits flags, love::Object *object);
/**
* Checks whether the value at idx is a certain type.
@@ -471,22 +471,55 @@ T *luax_totype(lua_State *L, int idx, const char * /* name */, love::bits /* typ
Type luax_type(lua_State *L, int idx);
/**
* Macro for converting a LOVE exception into a Lua error.
* Converts any exceptions thrown by the passed lambda function into a Lua error.
* lua_error (and luaL_error) cannot be called from inside the exception handler
* because they use longjmp, which causes undefined behaviour when the
* destructor of the exception would have been called.
**/
#define EXCEPT_GUARD(A) \
{ \
bool should_error = false; \
try { A } \
catch (love::Exception &e) \
{ \
should_error = true; \
lua_pushstring(L, e.what()); \
} \
if (should_error) \
return luaL_error(L, "%s", lua_tostring(L, -1)); \
template <typename T>
int luax_catchexcept(lua_State *L, const T& func)
{
bool should_error = false;
try
{
func();
}
catch (const std::exception &e)
{
should_error = true;
lua_pushstring(L, e.what());
}
if (should_error)
return luaL_error(L, "%s", lua_tostring(L, -1));
return 0;
}
template <typename T, typename F>
int luax_catchexcept(lua_State *L, const T& func, const F& finallyfunc)
{
bool should_error = false;
try
{
func();
}
catch (const std::exception &e)
{
should_error = true;
lua_pushstring(L, e.what());
}
finallyfunc();
if (should_error)
return luaL_error(L, "%s", lua_tostring(L, -1));
return 0;
}
} // love
+3 -3
View File
@@ -27,9 +27,9 @@ namespace love
// Version stuff.
const int VERSION_MAJOR = 0;
const int VERSION_MINOR = 9;
const int VERSION_REV = 1;
const char *VERSION = "0.9.1";
const char *VERSION_COMPATIBILITY[] = { VERSION, "0.9.0", 0 };
const int VERSION_REV = 2;
const char *VERSION = "0.9.2";
const char *VERSION_COMPATIBILITY[] = { VERSION, "0.9.1", "0.9.0", 0 };
const char *VERSION_CODENAME = "Baby Inspector";
} // love
+14 -5
View File
@@ -228,6 +228,7 @@ function love.createhandlers()
if love.resize then return love.resize(w, h) end
end,
lowmemory = function()
collectgarbage("collect")
collectgarbage("collect")
if love.lowmemory then return love.lowmemory() end
end,
@@ -251,7 +252,6 @@ local no_game_code = false
function love.boot()
-- This is absolutely needed.
require("love")
require("love.filesystem")
love.arg.parse_options()
@@ -321,7 +321,8 @@ function love.init()
fullscreentype = "normal",
display = 1,
vsync = true,
fsaa = 0,
msaa = 0,
fsaa = 0, -- For backward-compatibility. TODO: remove!
borderless = false,
resizable = false,
centered = true,
@@ -349,6 +350,7 @@ function love.init()
console = false, -- Only relevant for windows.
identity = false,
appendidentity = false,
accelerometerjoystick = true, -- Only relevant for Android / iOS.
}
-- If config file exists, load it and allow it to update config table.
@@ -375,6 +377,11 @@ function love.init()
love._openConsole()
end
-- Hack for disabling accelerometer-as-joystick on Android / iOS.
if love._setAccelerometerAsJoystick then
love._setAccelerometerAsJoystick(c.accelerometerjoystick)
end
-- Gets desired modules.
for k,v in ipairs{
"thread",
@@ -410,7 +417,8 @@ function love.init()
fullscreen = c.window.fullscreen,
fullscreentype = c.window.fullscreentype,
vsync = c.window.vsync,
fsaa = c.window.fsaa,
fsaa = c.window.fsaa, -- For backward-compatibility. TODO: remove!
msaa = c.window.msaa,
resizable = c.window.resizable,
minwidth = c.window.minwidth,
minheight = c.window.minheight,
@@ -1580,7 +1588,7 @@ function love.errhand(msg)
if love.audio then love.audio.stop() end
love.graphics.reset()
love.graphics.setBackgroundColor(89, 157, 220)
local font = love.graphics.setNewFont(14)
local font = love.graphics.setNewFont(math.floor(14 * love.window.getPixelScale()))
love.graphics.setColor(255, 255, 255, 255)
@@ -1607,8 +1615,9 @@ function love.errhand(msg)
p = string.gsub(p, "%[string \"(.-)\"%]", "%1")
local function draw()
local pos = 70 * love.window.getPixelScale()
love.graphics.clear()
love.graphics.printf(p, 70, 70, love.graphics.getWidth() - 70)
love.graphics.printf(p, pos, pos, love.graphics.getWidth() - pos)
love.graphics.present()
end
+37 -7
View File
@@ -431,6 +431,8 @@ const unsigned char boot_lua[] =
0x74, 0x69, 0x6f, 0x6e, 0x28, 0x29, 0x0a,
0x09, 0x09, 0x09, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x67, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x28,
0x22, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x22, 0x29, 0x0a,
0x09, 0x09, 0x09, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x67, 0x61, 0x72, 0x62, 0x61, 0x67, 0x65, 0x28,
0x22, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x22, 0x29, 0x0a,
0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x6c, 0x6f, 0x77, 0x6d, 0x65, 0x6d, 0x6f,
0x72, 0x79, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x6f, 0x76,
0x65, 0x2e, 0x6c, 0x6f, 0x77, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x28, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a,
@@ -461,7 +463,6 @@ const unsigned char boot_lua[] =
0x28, 0x29, 0x0a,
0x09, 0x2d, 0x2d, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x62, 0x73, 0x6f, 0x6c, 0x75,
0x74, 0x65, 0x6c, 0x79, 0x20, 0x6e, 0x65, 0x65, 0x64, 0x65, 0x64, 0x2e, 0x0a,
0x09, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x22, 0x6c, 0x6f, 0x76, 0x65, 0x22, 0x29, 0x0a,
0x09, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x22, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x66, 0x69, 0x6c,
0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x22, 0x29, 0x0a,
0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x61, 0x72, 0x67, 0x2e, 0x70, 0x61, 0x72, 0x73, 0x65, 0x5f, 0x6f, 0x70,
@@ -592,7 +593,11 @@ const unsigned char boot_lua[] =
0x3d, 0x20, 0x22, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x22, 0x2c, 0x0a,
0x09, 0x09, 0x09, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x3d, 0x20, 0x31, 0x2c, 0x0a,
0x09, 0x09, 0x09, 0x76, 0x73, 0x79, 0x6e, 0x63, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x0a,
0x09, 0x09, 0x09, 0x66, 0x73, 0x61, 0x61, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x0a,
0x09, 0x09, 0x09, 0x6d, 0x73, 0x61, 0x61, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x0a,
0x09, 0x09, 0x09, 0x66, 0x73, 0x61, 0x61, 0x20, 0x3d, 0x20, 0x30, 0x2c, 0x20, 0x2d, 0x2d, 0x20, 0x46, 0x6f,
0x72, 0x20, 0x62, 0x61, 0x63, 0x6b, 0x77, 0x61, 0x72, 0x64, 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69,
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x20, 0x54, 0x4f, 0x44, 0x4f, 0x3a, 0x20, 0x72, 0x65, 0x6d, 0x6f,
0x76, 0x65, 0x21, 0x0a,
0x09, 0x09, 0x09, 0x62, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x6c, 0x65, 0x73, 0x73, 0x20, 0x3d, 0x20, 0x66, 0x61,
0x6c, 0x73, 0x65, 0x2c, 0x0a,
0x09, 0x09, 0x09, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c,
@@ -631,6 +636,10 @@ const unsigned char boot_lua[] =
0x2c, 0x0a,
0x09, 0x09, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x20, 0x3d,
0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x0a,
0x09, 0x09, 0x61, 0x63, 0x63, 0x65, 0x6c, 0x65, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x6a, 0x6f, 0x79,
0x73, 0x74, 0x69, 0x63, 0x6b, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x20, 0x2d, 0x2d, 0x20, 0x4f,
0x6e, 0x6c, 0x79, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x41,
0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x2f, 0x20, 0x69, 0x4f, 0x53, 0x2e, 0x0a,
0x09, 0x7d, 0x0a,
0x09, 0x2d, 0x2d, 0x20, 0x49, 0x66, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x20, 0x66, 0x69, 0x6c, 0x65,
0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x2c, 0x20, 0x6c, 0x6f, 0x61, 0x64, 0x20, 0x69, 0x74, 0x20, 0x61,
@@ -672,6 +681,18 @@ const unsigned char boot_lua[] =
0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x5f, 0x6f, 0x70, 0x65, 0x6e, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c,
0x65, 0x28, 0x29, 0x0a,
0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x2d, 0x2d, 0x20, 0x48, 0x61, 0x63, 0x6b, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x64, 0x69, 0x73, 0x61, 0x62,
0x6c, 0x69, 0x6e, 0x67, 0x20, 0x61, 0x63, 0x63, 0x65, 0x6c, 0x65, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72,
0x2d, 0x61, 0x73, 0x2d, 0x6a, 0x6f, 0x79, 0x73, 0x74, 0x69, 0x63, 0x6b, 0x20, 0x6f, 0x6e, 0x20, 0x41, 0x6e,
0x64, 0x72, 0x6f, 0x69, 0x64, 0x20, 0x2f, 0x20, 0x69, 0x4f, 0x53, 0x2e, 0x0a,
0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x5f, 0x73, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x6c,
0x65, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x41, 0x73, 0x4a, 0x6f, 0x79, 0x73, 0x74, 0x69, 0x63, 0x6b,
0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x5f, 0x73, 0x65, 0x74, 0x41, 0x63, 0x63, 0x65, 0x6c, 0x65, 0x72,
0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x41, 0x73, 0x4a, 0x6f, 0x79, 0x73, 0x74, 0x69, 0x63, 0x6b, 0x28, 0x63,
0x2e, 0x61, 0x63, 0x63, 0x65, 0x6c, 0x65, 0x72, 0x6f, 0x6d, 0x65, 0x74, 0x65, 0x72, 0x6a, 0x6f, 0x79, 0x73,
0x74, 0x69, 0x63, 0x6b, 0x29, 0x0a,
0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x2d, 0x2d, 0x20, 0x47, 0x65, 0x74, 0x73, 0x20, 0x64, 0x65, 0x73, 0x69, 0x72, 0x65, 0x64, 0x20, 0x6d,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x0a,
0x09, 0x66, 0x6f, 0x72, 0x20, 0x6b, 0x2c, 0x76, 0x20, 0x69, 0x6e, 0x20, 0x69, 0x70, 0x61, 0x69, 0x72, 0x73,
@@ -722,7 +743,11 @@ const unsigned char boot_lua[] =
0x09, 0x09, 0x09, 0x76, 0x73, 0x79, 0x6e, 0x63, 0x20, 0x3d, 0x20, 0x63, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f,
0x77, 0x2e, 0x76, 0x73, 0x79, 0x6e, 0x63, 0x2c, 0x0a,
0x09, 0x09, 0x09, 0x66, 0x73, 0x61, 0x61, 0x20, 0x3d, 0x20, 0x63, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77,
0x2e, 0x66, 0x73, 0x61, 0x61, 0x2c, 0x0a,
0x2e, 0x66, 0x73, 0x61, 0x61, 0x2c, 0x20, 0x2d, 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x62, 0x61, 0x63, 0x6b,
0x77, 0x61, 0x72, 0x64, 0x2d, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79,
0x2e, 0x20, 0x54, 0x4f, 0x44, 0x4f, 0x3a, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x21, 0x0a,
0x09, 0x09, 0x09, 0x6d, 0x73, 0x61, 0x61, 0x20, 0x3d, 0x20, 0x63, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77,
0x2e, 0x6d, 0x73, 0x61, 0x61, 0x2c, 0x0a,
0x09, 0x09, 0x09, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0x63, 0x2e, 0x77,
0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x61, 0x62, 0x6c, 0x65, 0x2c, 0x0a,
0x09, 0x09, 0x09, 0x6d, 0x69, 0x6e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x3d, 0x20, 0x63, 0x2e, 0x77, 0x69,
@@ -5320,7 +5345,9 @@ const unsigned char boot_lua[] =
0x2c, 0x20, 0x31, 0x35, 0x37, 0x2c, 0x20, 0x32, 0x32, 0x30, 0x29, 0x0a,
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x6f, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x76, 0x65,
0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x4e, 0x65, 0x77, 0x46, 0x6f,
0x6e, 0x74, 0x28, 0x31, 0x34, 0x29, 0x0a,
0x6e, 0x74, 0x28, 0x6d, 0x61, 0x74, 0x68, 0x2e, 0x66, 0x6c, 0x6f, 0x6f, 0x72, 0x28, 0x31, 0x34, 0x20, 0x2a,
0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x50, 0x69,
0x78, 0x65, 0x6c, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x28, 0x29, 0x29, 0x29, 0x0a,
0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x74,
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x28, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x2c, 0x20, 0x32, 0x35,
0x35, 0x2c, 0x20, 0x32, 0x35, 0x35, 0x29, 0x0a,
@@ -5358,12 +5385,15 @@ const unsigned char boot_lua[] =
0x5c, 0x22, 0x25, 0x5d, 0x22, 0x2c, 0x20, 0x22, 0x25, 0x31, 0x22, 0x29, 0x0a,
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x72,
0x61, 0x77, 0x28, 0x29, 0x0a,
0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x70, 0x6f, 0x73, 0x20, 0x3d, 0x20, 0x37, 0x30, 0x20, 0x2a,
0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x50, 0x69,
0x78, 0x65, 0x6c, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x28, 0x29, 0x0a,
0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x63, 0x6c,
0x65, 0x61, 0x72, 0x28, 0x29, 0x0a,
0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72,
0x69, 0x6e, 0x74, 0x66, 0x28, 0x70, 0x2c, 0x20, 0x37, 0x30, 0x2c, 0x20, 0x37, 0x30, 0x2c, 0x20, 0x6c, 0x6f,
0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x57, 0x69, 0x64,
0x74, 0x68, 0x28, 0x29, 0x20, 0x2d, 0x20, 0x37, 0x30, 0x29, 0x0a,
0x69, 0x6e, 0x74, 0x66, 0x28, 0x70, 0x2c, 0x20, 0x70, 0x6f, 0x73, 0x2c, 0x20, 0x70, 0x6f, 0x73, 0x2c, 0x20,
0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x57,
0x69, 0x64, 0x74, 0x68, 0x28, 0x29, 0x20, 0x2d, 0x20, 0x70, 0x6f, 0x73, 0x29, 0x0a,
0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72,
0x65, 0x73, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x0a,
0x09, 0x65, 0x6e, 0x64, 0x0a,
+12 -17
View File
@@ -1357,8 +1357,8 @@ attribute vec4 VertexPosition;
attribute vec4 VertexTexCoord;
attribute vec4 VertexColor;
varying mediump vec4 VaryingTexCoord;
varying lowp vec4 VaryingColor;
varying vec4 VaryingTexCoord;
varying vec4 VaryingColor;
//#if defined(GL_EXT_draw_instanced)
// #extension GL_EXT_draw_instanced : enable
@@ -1465,13 +1465,14 @@ varying lowp vec4 VaryingColor;]],
end
local function isVertexCode(code)
return code:match("vec4%s*position%(") ~= nil
return code:match("vec4%s+position%s*%(") ~= nil
end
local function isPixelCode(code)
if code:match("vec4%s*effect%(") then
return true, false
elseif code:match("void%s*effects%(") then -- render to multiple canvases simultaniously
if code:match("vec4%s+effect%s*%(") then
return true
elseif code:match("void%s+effects%s*%(") then
-- function for rendering to multiple canvases simultaneously
return true, true
else
return false, false
@@ -1488,14 +1489,11 @@ varying lowp vec4 VaryingColor;]],
end
if arg1 then
local s = arg1:gsub("\r\n\t", " ") -- convert whitespace to spaces for parsing
s = s:gsub("(%w+)(%s+)%(", "%1(") -- convert "func ()" to "func()"
if isVertexCode(s) then
if isVertexCode(arg1) then
vertexcode = arg1 -- first arg contains vertex shader code
end
local ispixel, isMultiCanvas = isPixelCode(s)
local ispixel, isMultiCanvas = isPixelCode(arg1)
if ispixel then
pixelcode = arg1 -- first arg contains pixel shader code
is_multicanvas = isMultiCanvas
@@ -1503,14 +1501,11 @@ varying lowp vec4 VaryingColor;]],
end
if arg2 then
local s = arg2:gsub("\r\n\t", " ") -- convert whitespace to spaces for parsing
s = s:gsub("(%w+)(%s+)%(", "%1(") -- convert "func ()" to "func()"
if isVertexCode(s) then
if isVertexCode(arg2) then
vertexcode = arg2 -- second arg contains vertex shader code
end
local ispixel, isMultiCanvas = isPixelCode(s)
local ispixel, isMultiCanvas = isPixelCode(arg2)
if ispixel then
pixelcode = arg2 -- second arg contains pixel shader code
is_multicanvas = isMultiCanvas
@@ -1560,7 +1555,7 @@ vec4 position(mat4 transform_proj, vec4 vertpos) {
return transform_proj * vertpos;
}]],
pixel = [[
lowp vec4 effect(lowp vec4 vcolor, Image texture, vec2 texcoord, vec2 pixcoord) {
vec4 effect(lowp vec4 vcolor, Image texture, vec2 texcoord, vec2 pixcoord) {
return Texel(texture, texcoord) * vcolor;
}]]
}
+24 -42
View File
@@ -6375,11 +6375,10 @@ const unsigned char graphics_lua[] =
0x74, 0x65, 0x78, 0x54, 0x65, 0x78, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x3b, 0x0a,
0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x56, 0x65, 0x72,
0x74, 0x65, 0x78, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a,
0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6d, 0x65, 0x64, 0x69, 0x75, 0x6d, 0x70, 0x20, 0x76, 0x65,
0x63, 0x34, 0x20, 0x56, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x54, 0x65, 0x78, 0x43, 0x6f, 0x6f, 0x72, 0x64,
0x3b, 0x0a,
0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20,
0x56, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a,
0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x56, 0x61, 0x72, 0x79, 0x69,
0x6e, 0x67, 0x54, 0x65, 0x78, 0x43, 0x6f, 0x6f, 0x72, 0x64, 0x3b, 0x0a,
0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x56, 0x61, 0x72, 0x79, 0x69,
0x6e, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a,
0x2f, 0x2f, 0x23, 0x69, 0x66, 0x20, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x64, 0x28, 0x47, 0x4c, 0x5f, 0x45,
0x58, 0x54, 0x5f, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x64, 0x29, 0x0a,
0x2f, 0x2f, 0x09, 0x23, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x47, 0x4c, 0x5f, 0x45,
@@ -6585,21 +6584,22 @@ const unsigned char graphics_lua[] =
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73,
0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x64, 0x65, 0x28, 0x63, 0x6f, 0x64, 0x65, 0x29, 0x0a,
0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3a, 0x6d, 0x61, 0x74, 0x63,
0x68, 0x28, 0x22, 0x76, 0x65, 0x63, 0x34, 0x25, 0x73, 0x2a, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e,
0x25, 0x28, 0x22, 0x29, 0x20, 0x7e, 0x3d, 0x20, 0x6e, 0x69, 0x6c, 0x0a,
0x68, 0x28, 0x22, 0x76, 0x65, 0x63, 0x34, 0x25, 0x73, 0x2b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e,
0x25, 0x73, 0x2a, 0x25, 0x28, 0x22, 0x29, 0x20, 0x7e, 0x3d, 0x20, 0x6e, 0x69, 0x6c, 0x0a,
0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73,
0x50, 0x69, 0x78, 0x65, 0x6c, 0x43, 0x6f, 0x64, 0x65, 0x28, 0x63, 0x6f, 0x64, 0x65, 0x29, 0x0a,
0x09, 0x09, 0x69, 0x66, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28, 0x22, 0x76,
0x65, 0x63, 0x34, 0x25, 0x73, 0x2a, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x25, 0x28, 0x22, 0x29, 0x20, 0x74,
0x68, 0x65, 0x6e, 0x0a,
0x09, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x20, 0x66, 0x61,
0x6c, 0x73, 0x65, 0x0a,
0x65, 0x63, 0x34, 0x25, 0x73, 0x2b, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x25, 0x73, 0x2a, 0x25, 0x28, 0x22,
0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x09, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x72, 0x75, 0x65, 0x0a,
0x09, 0x09, 0x65, 0x6c, 0x73, 0x65, 0x69, 0x66, 0x20, 0x63, 0x6f, 0x64, 0x65, 0x3a, 0x6d, 0x61, 0x74, 0x63,
0x68, 0x28, 0x22, 0x76, 0x6f, 0x69, 0x64, 0x25, 0x73, 0x2a, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x73, 0x25,
0x28, 0x22, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x2d, 0x2d, 0x20, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72,
0x20, 0x74, 0x6f, 0x20, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x76, 0x61,
0x73, 0x65, 0x73, 0x20, 0x73, 0x69, 0x6d, 0x75, 0x6c, 0x74, 0x61, 0x6e, 0x69, 0x6f, 0x75, 0x73, 0x6c, 0x79, 0x0a,
0x68, 0x28, 0x22, 0x76, 0x6f, 0x69, 0x64, 0x25, 0x73, 0x2b, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x73, 0x25,
0x73, 0x2a, 0x25, 0x28, 0x22, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x09, 0x09, 0x09, 0x2d, 0x2d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x66, 0x6f, 0x72,
0x20, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x75, 0x6c, 0x74,
0x69, 0x70, 0x6c, 0x65, 0x20, 0x63, 0x61, 0x6e, 0x76, 0x61, 0x73, 0x65, 0x73, 0x20, 0x73, 0x69, 0x6d, 0x75,
0x6c, 0x74, 0x61, 0x6e, 0x65, 0x6f, 0x75, 0x73, 0x6c, 0x79, 0x0a,
0x09, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x20, 0x74, 0x72,
0x75, 0x65, 0x0a,
0x09, 0x09, 0x65, 0x6c, 0x73, 0x65, 0x0a,
@@ -6628,17 +6628,8 @@ const unsigned char graphics_lua[] =
0x09, 0x09, 0x09, 0x6c, 0x61, 0x6e, 0x67, 0x20, 0x3d, 0x20, 0x47, 0x4c, 0x53, 0x4c, 0x45, 0x53, 0x0a,
0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x09, 0x69, 0x66, 0x20, 0x61, 0x72, 0x67, 0x31, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x20, 0x3d, 0x20, 0x61, 0x72, 0x67, 0x31, 0x3a,
0x67, 0x73, 0x75, 0x62, 0x28, 0x22, 0x5c, 0x72, 0x5c, 0x6e, 0x5c, 0x74, 0x22, 0x2c, 0x20, 0x22, 0x20, 0x22,
0x29, 0x20, 0x2d, 0x2d, 0x20, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x20, 0x77, 0x68, 0x69, 0x74, 0x65,
0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x20, 0x66, 0x6f,
0x72, 0x20, 0x70, 0x61, 0x72, 0x73, 0x69, 0x6e, 0x67, 0x0a,
0x09, 0x09, 0x09, 0x73, 0x20, 0x3d, 0x20, 0x73, 0x3a, 0x67, 0x73, 0x75, 0x62, 0x28, 0x22, 0x28, 0x25, 0x77,
0x2b, 0x29, 0x28, 0x25, 0x73, 0x2b, 0x29, 0x25, 0x28, 0x22, 0x2c, 0x20, 0x22, 0x25, 0x31, 0x28, 0x22, 0x29,
0x20, 0x2d, 0x2d, 0x20, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x20, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x20,
0x28, 0x29, 0x22, 0x20, 0x74, 0x6f, 0x20, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x28, 0x29, 0x22, 0x0a,
0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x69, 0x73, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x64, 0x65,
0x28, 0x73, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x28, 0x61, 0x72, 0x67, 0x31, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x09, 0x09, 0x09, 0x09, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x61,
0x72, 0x67, 0x31, 0x20, 0x2d, 0x2d, 0x20, 0x66, 0x69, 0x72, 0x73, 0x74, 0x20, 0x61, 0x72, 0x67, 0x20, 0x63,
0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x20, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, 0x73, 0x68, 0x61,
@@ -6646,7 +6637,7 @@ const unsigned char graphics_lua[] =
0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x69, 0x73, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x2c, 0x20,
0x69, 0x73, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x43, 0x61, 0x6e, 0x76, 0x61, 0x73, 0x20, 0x3d, 0x20, 0x69, 0x73,
0x50, 0x69, 0x78, 0x65, 0x6c, 0x43, 0x6f, 0x64, 0x65, 0x28, 0x73, 0x29, 0x0a,
0x50, 0x69, 0x78, 0x65, 0x6c, 0x43, 0x6f, 0x64, 0x65, 0x28, 0x61, 0x72, 0x67, 0x31, 0x29, 0x0a,
0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x69, 0x73, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x09, 0x09, 0x09, 0x09, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x61, 0x72,
0x67, 0x31, 0x20, 0x2d, 0x2d, 0x20, 0x66, 0x69, 0x72, 0x73, 0x74, 0x20, 0x61, 0x72, 0x67, 0x20, 0x63, 0x6f,
@@ -6657,17 +6648,8 @@ const unsigned char graphics_lua[] =
0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x09, 0x69, 0x66, 0x20, 0x61, 0x72, 0x67, 0x32, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x73, 0x20, 0x3d, 0x20, 0x61, 0x72, 0x67, 0x32, 0x3a,
0x67, 0x73, 0x75, 0x62, 0x28, 0x22, 0x5c, 0x72, 0x5c, 0x6e, 0x5c, 0x74, 0x22, 0x2c, 0x20, 0x22, 0x20, 0x22,
0x29, 0x20, 0x2d, 0x2d, 0x20, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x20, 0x77, 0x68, 0x69, 0x74, 0x65,
0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x73, 0x70, 0x61, 0x63, 0x65, 0x73, 0x20, 0x66, 0x6f,
0x72, 0x20, 0x70, 0x61, 0x72, 0x73, 0x69, 0x6e, 0x67, 0x0a,
0x09, 0x09, 0x09, 0x73, 0x20, 0x3d, 0x20, 0x73, 0x3a, 0x67, 0x73, 0x75, 0x62, 0x28, 0x22, 0x28, 0x25, 0x77,
0x2b, 0x29, 0x28, 0x25, 0x73, 0x2b, 0x29, 0x25, 0x28, 0x22, 0x2c, 0x20, 0x22, 0x25, 0x31, 0x28, 0x22, 0x29,
0x20, 0x2d, 0x2d, 0x20, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x20, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x20,
0x28, 0x29, 0x22, 0x20, 0x74, 0x6f, 0x20, 0x22, 0x66, 0x75, 0x6e, 0x63, 0x28, 0x29, 0x22, 0x0a,
0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x69, 0x73, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x43, 0x6f, 0x64, 0x65,
0x28, 0x73, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x28, 0x61, 0x72, 0x67, 0x32, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x09, 0x09, 0x09, 0x09, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x61,
0x72, 0x67, 0x32, 0x20, 0x2d, 0x2d, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x61, 0x72, 0x67, 0x20,
0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x20, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x20, 0x73, 0x68,
@@ -6675,7 +6657,7 @@ const unsigned char graphics_lua[] =
0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x69, 0x73, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x2c, 0x20,
0x69, 0x73, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x43, 0x61, 0x6e, 0x76, 0x61, 0x73, 0x20, 0x3d, 0x20, 0x69, 0x73,
0x50, 0x69, 0x78, 0x65, 0x6c, 0x43, 0x6f, 0x64, 0x65, 0x28, 0x73, 0x29, 0x0a,
0x50, 0x69, 0x78, 0x65, 0x6c, 0x43, 0x6f, 0x64, 0x65, 0x28, 0x61, 0x72, 0x67, 0x32, 0x29, 0x0a,
0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x69, 0x73, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x09, 0x09, 0x09, 0x09, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x61, 0x72,
0x67, 0x32, 0x20, 0x2d, 0x2d, 0x20, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x20, 0x61, 0x72, 0x67, 0x20, 0x63,
@@ -6786,11 +6768,11 @@ const unsigned char graphics_lua[] =
0x70, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x76, 0x65, 0x72, 0x74, 0x70, 0x6f, 0x73, 0x3b, 0x09, 0x0a,
0x7d, 0x5d, 0x5d, 0x2c, 0x0a,
0x09, 0x09, 0x70, 0x69, 0x78, 0x65, 0x6c, 0x20, 0x3d, 0x20, 0x5b, 0x5b, 0x0a,
0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x28, 0x6c,
0x6f, 0x77, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x76, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x49,
0x6d, 0x61, 0x67, 0x65, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x32,
0x20, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x70, 0x69,
0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x29, 0x20, 0x7b, 0x0a,
0x76, 0x65, 0x63, 0x34, 0x20, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x28, 0x6c, 0x6f, 0x77, 0x70, 0x20, 0x76,
0x65, 0x63, 0x34, 0x20, 0x76, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x20,
0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x74, 0x65, 0x78, 0x63,
0x6f, 0x6f, 0x72, 0x64, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x32, 0x20, 0x70, 0x69, 0x78, 0x63, 0x6f, 0x6f, 0x72,
0x64, 0x29, 0x20, 0x7b, 0x0a,
0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x54, 0x65, 0x78, 0x65, 0x6c, 0x28, 0x74, 0x65, 0x78, 0x74,
0x75, 0x72, 0x65, 0x2c, 0x20, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x29, 0x20, 0x2a, 0x20, 0x76,
0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x09, 0x0a,