diff --git a/platform/macosx/love-framework.xcodeproj/project.pbxproj b/platform/macosx/love-framework.xcodeproj/project.pbxproj index e0c7e9079..f1c551bf7 100644 --- a/platform/macosx/love-framework.xcodeproj/project.pbxproj +++ b/platform/macosx/love-framework.xcodeproj/project.pbxproj @@ -228,6 +228,8 @@ FA636D8F171B72A70065623F /* wrap_RandomGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FA636D8D171B72A70065623F /* wrap_RandomGenerator.h */; }; FA7C937A16DCC6C2006F2BEE /* wrap_Math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA7C937516DCC6C2006F2BEE /* wrap_Math.cpp */; }; FA7C937B16DCC6C2006F2BEE /* wrap_Math.h in Headers */ = {isa = PBXBuildFile; fileRef = FA7C937616DCC6C2006F2BEE /* wrap_Math.h */; }; + FA9FC0B0173D6E3E005027FF /* wrap_Window.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA9FC0AE173D6E3E005027FF /* wrap_Window.cpp */; }; + FA9FC0B1173D6E3E005027FF /* wrap_Window.h in Headers */ = {isa = PBXBuildFile; fileRef = FA9FC0AF173D6E3E005027FF /* wrap_Window.h */; }; FAAC6B02170A373B008A61C5 /* CompressedData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FAAC6B00170A373A008A61C5 /* CompressedData.cpp */; }; FAAC6B03170A373B008A61C5 /* CompressedData.h in Headers */ = {isa = PBXBuildFile; fileRef = FAAC6B01170A373A008A61C5 /* CompressedData.h */; }; FAAFF04416CB11C700CCDE45 /* OpenAL-Soft.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FAAFF04316CB11C700CCDE45 /* OpenAL-Soft.framework */; }; @@ -723,6 +725,8 @@ FA636D8D171B72A70065623F /* wrap_RandomGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_RandomGenerator.h; sourceTree = ""; }; FA7C937516DCC6C2006F2BEE /* wrap_Math.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Math.cpp; sourceTree = ""; }; FA7C937616DCC6C2006F2BEE /* wrap_Math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Math.h; sourceTree = ""; }; + FA9FC0AE173D6E3E005027FF /* wrap_Window.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Window.cpp; sourceTree = ""; }; + FA9FC0AF173D6E3E005027FF /* wrap_Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Window.h; sourceTree = ""; }; FAAC6B00170A373A008A61C5 /* CompressedData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CompressedData.cpp; sourceTree = ""; }; FAAC6B01170A373A008A61C5 /* CompressedData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompressedData.h; sourceTree = ""; }; FAAFF04316CB11C700CCDE45 /* OpenAL-Soft.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = "OpenAL-Soft.framework"; path = "/Library/Frameworks/OpenAL-Soft.framework"; sourceTree = ""; }; @@ -970,9 +974,11 @@ 153D76205F7A4ACD12FB4C0E /* window */ = { isa = PBXGroup; children = ( + 63082CBA23A6046C60DA1C6F /* sdl */, 351B09E51FDC338622F44624 /* Window.cpp */, 7423362764CF57574BB16CDA /* Window.h */, - 63082CBA23A6046C60DA1C6F /* sdl */, + FA9FC0AE173D6E3E005027FF /* wrap_Window.cpp */, + FA9FC0AF173D6E3E005027FF /* wrap_Window.h */, ); path = window; sourceTree = ""; @@ -1475,8 +1481,8 @@ 6D590DDD41E72A60262E4A4F /* timer */ = { isa = PBXGroup; children = ( - 2D9475890CDA3D3776435622 /* Timer.h */, 5CFF12567FFB5C5166631693 /* sdl */, + 2D9475890CDA3D3776435622 /* Timer.h */, 695E4ED13AA0689E64280573 /* wrap_Timer.cpp */, 7F575BE9573C654B5ED44CC1 /* wrap_Timer.h */, ); @@ -1735,6 +1741,7 @@ FAC86E6A1724555D00EED715 /* DrawGable.h in Headers */, FAC86E6C1724555D00EED715 /* Geometry.h in Headers */, FA03546D1731F3A700284828 /* simplexnoise1234.h in Headers */, + FA9FC0B1173D6E3E005027FF /* wrap_Window.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2018,6 +2025,7 @@ FAC86E691724555D00EED715 /* DrawGable.cpp in Sources */, FAC86E6B1724555D00EED715 /* Geometry.cpp in Sources */, FA03546C1731F3A700284828 /* simplexnoise1234.cpp in Sources */, + FA9FC0B0173D6E3E005027FF /* wrap_Window.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/common/delay.cpp b/src/common/delay.cpp index 95f0c8886..6d8359b5a 100644 --- a/src/common/delay.cpp +++ b/src/common/delay.cpp @@ -19,7 +19,8 @@ **/ #include "delay.h" -#include + +#include namespace love { diff --git a/src/common/runtime.cpp b/src/common/runtime.cpp index 15e7d4e81..3742a32ea 100644 --- a/src/common/runtime.cpp +++ b/src/common/runtime.cpp @@ -135,6 +135,34 @@ void luax_pushstring(lua_State *L, const std::string &str) lua_pushlstring(L, str.data(), str.size()); } +bool luax_boolflag(lua_State *L, int table_index, const char *key, bool defaultValue) +{ + lua_getfield(L, table_index, key); + + bool retval; + if (lua_isnoneornil(L, -1)) + retval = defaultValue; + else + retval = lua_toboolean(L, -1); + + lua_pop(L, 1); + return retval; +} + +int luax_intflag(lua_State *L, int table_index, const char *key, int defaultValue) +{ + lua_getfield(L, table_index, key); + + int retval; + if (!lua_isnumber(L, -1)) + retval = defaultValue; + else + retval = lua_tonumber(L, -1); + + lua_pop(L, 1); + return retval; +} + int luax_assert_argc(lua_State *L, int min) { int argc = lua_gettop(L); diff --git a/src/common/runtime.h b/src/common/runtime.h index 4114eee3d..74ed6595e 100644 --- a/src/common/runtime.h +++ b/src/common/runtime.h @@ -158,6 +158,32 @@ std::string luax_checkstring(lua_State *L, int idx); **/ void luax_pushstring(lua_State *L, const std::string &str); + +bool luax_boolflag(lua_State *L, int table_index, const char *key, bool defaultValue); +int luax_intflag(lua_State *L, int table_index, const char *key, int defaultValue); + +/** + * Convert the value at the specified index to an Lua number, and then + * convert to a float. + * + * @param L The Lua state. + * @param idx The index on the stack. + */ +inline float luax_tofloat(lua_State *L, int idx) +{ + return static_cast(lua_tonumber(L, idx)); +} + +/** + * Like luax_tofloat, but checks that the value is a number. + * + * @see luax_tofloat + */ +inline float luax_checkfloat(lua_State *L, int idx) +{ + return static_cast(luaL_checknumber(L, idx)); +} + /** * Require at least 'min' number of items on the stack. * @param L The Lua state. @@ -312,45 +338,6 @@ int luax_insistlove(lua_State *L, const char *k); **/ int luax_getregistry(lua_State *L, Registry r); -Type luax_type(lua_State *L, int idx); - -/** - * Convert the value at the specified index to an Lua number, and then - * convert to a float. - * - * @param L The Lua state. - * @param idx The index on the stack. - */ -inline float luax_tofloat(lua_State *L, int idx) -{ - return static_cast(lua_tonumber(L, idx)); -} - -/** - * Like luax_tofloat, but checks that the value is a number. - * - * @see luax_tofloat - */ -inline float luax_checkfloat(lua_State *L, int idx) -{ - return static_cast(luaL_checknumber(L, idx)); -} - -/** - * Converts the value at idx to the specified type without checking that - * this conversion is valid. If the type has been previously verified with - * luax_istype, then this can be safely used. Otherwise, use luax_checktype. - * @param L The Lua state. - * @param idx The index on the stack. - * @param name The name of the type. - * @param type The type bit. - **/ -template -T *luax_totype(lua_State *L, int idx, const char *, love::bits) -{ - return (T *)(((Proxy *)lua_touserdata(L, idx))->data); -} - /** * Like luax_totype, but causes an error if the value at idx is not Proxy, * or is not the specified type. @@ -380,7 +367,7 @@ T *luax_getmodule(lua_State *L, const char *k, love::bits type) lua_getfield(L, -1, k); if (!lua_isuserdata(L, -1)) - luaL_error(L, "Tried to get nonexisting module %s.", k); + luaL_error(L, "Tried to get nonexistant module %s.", k); Proxy *u = (Proxy *)lua_touserdata(L, -1); @@ -392,6 +379,45 @@ T *luax_getmodule(lua_State *L, const char *k, love::bits type) return (T *)u->data; } +template +T *luax_optmodule(lua_State *L, const char *k, love::bits type) +{ + luax_getregistry(L, REGISTRY_MODULES); + lua_getfield(L, -1, k); + + if (!lua_isuserdata(L, -1)) + { + lua_pop(L, 2); + return 0; + } + + Proxy *u = (Proxy *)lua_touserdata(L, -1); + + if ((u->flags & type) != type) + luaL_error(L, "Incorrect module %s", k); + + lua_pop(L, 2); + + return (T *) u->data; +} + +/** + * Converts the value at idx to the specified type without checking that + * this conversion is valid. If the type has been previously verified with + * luax_istype, then this can be safely used. Otherwise, use luax_checktype. + * @param L The Lua state. + * @param idx The index on the stack. + * @param name The name of the type. + * @param type The type bit. + **/ +template +T *luax_totype(lua_State *L, int idx, const char *, love::bits) +{ + return (T *)(((Proxy *)lua_touserdata(L, idx))->data); +} + +Type luax_type(lua_State *L, int idx); + } // love #endif // LOVE_RUNTIME_H diff --git a/src/common/types.h b/src/common/types.h index bd8aa2833..af38c2ebc 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -96,6 +96,7 @@ enum Type // The modules themselves. Only add abstracted modules here. MODULE_FILESYSTEM_ID, + MODULE_GRAPHICS_ID, MODULE_IMAGE_ID, MODULE_SOUND_ID, @@ -171,6 +172,7 @@ const bits THREAD_CHANNEL_T = (bits(1) << THREAD_CHANNEL_ID) | OBJECT_T; // Modules. const bits MODULE_FILESYSTEM_T = (bits(1) << MODULE_FILESYSTEM_ID) | MODULE_T; +const bits MODULE_GRAPHICS_T = (bits(1) << MODULE_GRAPHICS_ID) | MODULE_T; const bits MODULE_IMAGE_T = (bits(1) << MODULE_IMAGE_ID) | MODULE_T; const bits MODULE_SOUND_T = (bits(1) << MODULE_SOUND_ID) | MODULE_T; diff --git a/src/modules/graphics/Graphics.h b/src/modules/graphics/Graphics.h index b5ab4fc52..08d9d1160 100644 --- a/src/modules/graphics/Graphics.h +++ b/src/modules/graphics/Graphics.h @@ -112,6 +112,19 @@ public: virtual ~Graphics(); + /** + * Sets the current graphics display viewport and initializes the renderer. + * @param width The viewport width. + * @param height The viewport height. + **/ + virtual bool setMode(int width, int height) = 0; + + /** + * Un-sets the current graphics display mode (uninitializing objects if + * necessary.) + **/ + virtual void unSetMode() = 0; + static bool getConstant(const char *in, DrawMode &out); static bool getConstant(DrawMode in, const char *&out); diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index c64225ee1..616fe35f8 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -46,8 +46,15 @@ Graphics::Graphics() , matrixLimit(0) , userMatrices(0) , colorMask() + , width(0) + , height(0) + , created(false) + , savedState() { currentWindow = love::window::sdl::Window::getSingleton(); + + if (currentWindow->isCreated()) + setMode(currentWindow->getWidth(), currentWindow->getHeight()); } Graphics::~Graphics() @@ -63,11 +70,6 @@ const char *Graphics::getName() const return "love.graphics.opengl"; } -bool Graphics::checkMode(int width, int height, bool fullscreen) const -{ - return currentWindow->checkWindowSize(width, height, fullscreen); -} - DisplayState Graphics::saveState() { DisplayState s; @@ -120,31 +122,14 @@ void Graphics::restoreState(const DisplayState &s) setColorMask(s.colorMask[0], s.colorMask[1], s.colorMask[2], s.colorMask[3]); } -static void APIENTRY myErrorCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char *message, void *ud) +bool Graphics::setMode(int width, int height) { - (void)ud; - std::cerr << "source = " << source << ", type = " << type << ", id = " << id << ", severity = " << severity << ", length = " << length << "\n" << message << std::endl; -} - -bool Graphics::setMode(int width, int height, WindowFlags *flags) -{ - // This operation destroys the OpenGL context, so - // we must save the state. DisplayState tempState; if (isCreated()) - tempState = saveState(); + savedState = saveState(); - // Unload all volatile objects. These must be reloaded after - // the display mode change. - Volatile::unloadAll(); - - gl.deInitContext(); - - bool success = currentWindow->setWindow(width, height, flags); - - // Regardless of failure, we'll have to set up OpenGL once again. - width = currentWindow->getWidth(); - height = currentWindow->getHeight(); + this->width = width; + this->height = height; // Okay, setup OpenGL. gl.initContext(); @@ -201,7 +186,7 @@ bool Graphics::setMode(int width, int height, WindowFlags *flags) std::cerr << "Could not reload all volatile objects." << std::endl; // Restore the display state. - restoreState(tempState); + restoreState(savedState); pixel_size_stack.clear(); pixel_size_stack.reserve(5); pixel_size_stack.push_back(1); @@ -211,30 +196,22 @@ bool Graphics::setMode(int width, int height, WindowFlags *flags) glGetIntegerv(GL_MAX_MODELVIEW_STACK_DEPTH, &matrixLimit); matrixLimit -= 5; - // Debug output is temporarily disabled until we either improve it and make - // it optional or remove it. - if (GLEE_KHR_debug && false) - { - std::cerr << "debug on" << std::endl; - glDebugMessageCallback(myErrorCallback, NULL); - glEnable(GL_DEBUG_OUTPUT); - } + created = true; - return success; + return true; } -void Graphics::getMode(int &width, int &height, WindowFlags &flags) const +void Graphics::unSetMode() { - currentWindow->getWindow(width, height, flags); -} + // Window creation may destroy the OpenGL context, so we must save the state. + if (isCreated()) + savedState = saveState(); -bool Graphics::toggleFullscreen() -{ - int width, height; - WindowFlags flags; - currentWindow->getWindow(width, height, flags); - flags.fullscreen = !flags.fullscreen; - return setMode(width, height, &flags); + // Unload all volatile objects. These must be reloaded after + // the display mode change. + Volatile::unloadAll(); + + gl.deInitContext(); } void Graphics::reset() @@ -259,39 +236,21 @@ void Graphics::present() currentWindow->swapBuffers(); } -void Graphics::setIcon(Image *image) -{ - if (image->isCompressed()) - throw love::Exception("Cannot use compressed image data to set an icon."); - - currentWindow->setIcon(image->getData()); -} - -void Graphics::setCaption(const char *caption) -{ - std::string title(caption); - currentWindow->setWindowTitle(title); -} - -std::string Graphics::getCaption() const -{ - return currentWindow->getWindowTitle(); -} - int Graphics::getWidth() const { - return currentWindow->getWidth(); + return width; } int Graphics::getHeight() const { - return currentWindow->getHeight(); + return height; } int Graphics::getRenderWidth() const { if (Canvas::current) return Canvas::current->getWidth(); + return getWidth(); } @@ -299,44 +258,13 @@ int Graphics::getRenderHeight() const { if (Canvas::current) return Canvas::current->getHeight(); + return getHeight(); } bool Graphics::isCreated() const { - return currentWindow->isCreated(); -} - -int Graphics::getModes(lua_State *L) const -{ - int n; - love::window::Window::WindowSize *modes = currentWindow->getFullscreenSizes(n); - - if (modes == 0) - return 0; - - lua_createtable(L, n, 0); - - for (int i = 0; i < n ; i++) - { - lua_pushinteger(L, i+1); - lua_createtable(L, 0, 2); - - // Inner table attribs. - - lua_pushinteger(L, modes[i].width); - lua_setfield(L, -2, "width"); - - lua_pushinteger(L, modes[i].height); - lua_setfield(L, -2, "height"); - - // Inner table attribs end. - - lua_settable(L, -3); - } - - delete[] modes; - return 1; + return created; } void Graphics::setScissor(int x, int y, int width, int height) @@ -1379,11 +1307,6 @@ void Graphics::origin() pixel_size_stack.push_back(1); } -bool Graphics::hasFocus() const -{ - return currentWindow->hasFocus(); -} - } // opengl } // graphics } // love diff --git a/src/modules/graphics/opengl/Graphics.h b/src/modules/graphics/opengl/Graphics.h index d91071d03..e5f4f96a4 100644 --- a/src/modules/graphics/opengl/Graphics.h +++ b/src/modules/graphics/opengl/Graphics.h @@ -111,40 +111,12 @@ public: // Implements Module. const char *getName() const; - /** - * Checks whether a display mode is supported or not. Note - * that fullscreen is assumed, because windowed modes are - * generally supported regardless of size. - * @param width The window width. - * @param height The window height. - **/ - bool checkMode(int width, int height, bool fullscreen) const; - DisplayState saveState(); void restoreState(const DisplayState &s); - /** - * Sets the current display mode. - * @param width The window width. - * @param height The window height. - * @param flags An optional WindowFlags structure. - **/ - bool setMode(int width, int height, WindowFlags *flags); - - /** - * Gets the current display mode. - * @param width Pointer to an integer for the window width. - * @param height Pointer to an integer for the window height. - * @param flags A WindowFlags structure. - **/ - void getMode(int &width, int &height, WindowFlags &flags) const; - - /** - * Toggles fullscreen. Note that this also needs to reload the - * entire OpenGL context. - **/ - bool toggleFullscreen(); + virtual bool setMode(int width, int height); + virtual void unSetMode(); /** * Resets the current color, background color, @@ -159,56 +131,25 @@ public: void clear(); /** - * Flips buffers. (Rendered geometry is - * presented on screen). + * Flips buffers. (Rendered geometry is presented on screen). **/ void present(); /** - * Sets the window's icon. - **/ - void setIcon(Image *image); - - /** - * Sets the window's caption. - **/ - void setCaption(const char *caption); - - /** - * Gets the window's caption. - **/ - std::string getCaption() const; - - /** - * Gets the width of the current display mode. + * Gets the width of the current graphics viewport. **/ int getWidth() const; /** - * Gets the height of the current display mode. + * Gets the height of the current graphics viewport. **/ int getHeight() const; /** - * True if some display mode is set. + * True if a graphics viewport is set. **/ bool isCreated() const; - /** - * This native Lua function gets available modes - * from SDL and returns them as a table on the following format: - * - * { - * { width = 800, height = 600 }, - * { width = 1024, height = 768 }, - * ... - * } - * - * Only fullscreen modes are returned here, as all - * window sizes are supported (normally). - **/ - int getModes(lua_State *L) const; - /** * Scissor defines a box such that everything outside that box is discarded and not drawn. * Scissoring is automatically enabled. @@ -541,9 +482,11 @@ public: void shear(float kx, float ky); void origin(); - bool hasFocus() const; private: + int getRenderWidth() const; + int getRenderHeight() const; + Font *currentFont; love::window::Window *currentWindow; @@ -554,8 +497,11 @@ private: GLint userMatrices; bool colorMask[4]; - int getRenderWidth() const; - int getRenderHeight() const; + int width; + int height; + bool created; + + DisplayState savedState; }; // Graphics diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index fbff81b55..a2f091fbf 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -38,105 +38,6 @@ namespace opengl static Graphics *instance = 0; -bool luax_boolflag(lua_State *L, int table_index, const char *key, bool defaultValue) -{ - lua_getfield(L, table_index, key); - - bool retval; - if (lua_isnoneornil(L, -1)) - retval = defaultValue; - else - retval = lua_toboolean(L, -1); - - lua_pop(L, 1); - return retval; -} - -int luax_intflag(lua_State *L, int table_index, const char *key, int defaultValue) -{ - lua_getfield(L, table_index, key); - - int retval; - if (!lua_isnumber(L, -1)) - retval = defaultValue; - else - retval = lua_tonumber(L, -1); - - lua_pop(L, 1); - return retval; -} - -int w_checkMode(lua_State *L) -{ - int w = luaL_checkint(L, 1); - int h = luaL_checkint(L, 2); - bool fs = luax_toboolean(L, 3); - luax_pushboolean(L, instance->checkMode(w, h, fs)); - return 1; -} - -int w_setMode(lua_State *L) -{ - int w = luaL_checkint(L, 1); - int h = luaL_checkint(L, 2); - if (lua_isnoneornil(L, 3)) - { - luax_pushboolean(L, instance->setMode(w, h, 0)); - return 1; - } - - luaL_checktype(L, 3, LUA_TTABLE); - - WindowFlags flags; - - flags.fullscreen = luax_boolflag(L, 3, "fullscreen", false); - flags.vsync = luax_boolflag(L, 3, "vsync", true); - flags.fsaa = luax_intflag(L, 3, "fsaa", 0); - flags.resizable = luax_boolflag(L, 3, "resizable", false); - flags.borderless = luax_boolflag(L, 3, "borderless", false); - flags.centered = luax_boolflag(L, 3, "centered", true); - - luax_pushboolean(L, instance->setMode(w, h, &flags)); - return 1; -} - -int w_getMode(lua_State *L) -{ - int w, h; - WindowFlags flags; - instance->getMode(w, h, flags); - lua_pushnumber(L, w); - lua_pushnumber(L, h); - - lua_newtable(L); - - luax_pushboolean(L, flags.fullscreen); - lua_setfield(L, -2, "fullscreen"); - - luax_pushboolean(L, flags.vsync); - lua_setfield(L, -2, "vsync"); - - lua_pushnumber(L, flags.fsaa); - lua_setfield(L, -2, "fsaa"); - - luax_pushboolean(L, flags.resizable); - lua_setfield(L, -2, "resizable"); - - luax_pushboolean(L, flags.borderless); - lua_setfield(L, -2, "borderless"); - - luax_pushboolean(L, flags.centered); - lua_setfield(L, -2, "centered"); - - return 3; -} - -int w_toggleFullscreen(lua_State *L) -{ - luax_pushboolean(L, instance->toggleFullscreen()); - return 1; -} - int w_reset(lua_State *) { instance->reset(); @@ -155,64 +56,12 @@ int w_present(lua_State *) return 0; } -int w_setIcon(lua_State *L) -{ - Image *image = luax_checkimage(L, 1); - try - { - instance->setIcon(image); - } - catch (love::Exception &e) - { - return luaL_error(L, "%s", e.what()); - } - return 0; -} - -int w_setCaption(lua_State *L) -{ - const char *str = luaL_checkstring(L, 1); - instance->setCaption(str); - return 0; -} - -int w_getCaption(lua_State *L) -{ - std::string caption = instance->getCaption(); - lua_pushstring(L, caption.c_str()); - return 1; -} - -int w_getWidth(lua_State *L) -{ - lua_pushnumber(L, instance->getWidth()); - return 1; -} - -int w_getHeight(lua_State *L) -{ - lua_pushnumber(L, instance->getHeight()); - return 1; -} - -int w_getDimensions(lua_State *L) -{ - lua_pushnumber(L, instance->getWidth()); - lua_pushnumber(L, instance->getHeight()); - return 2; -} - int w_isCreated(lua_State *L) { luax_pushboolean(L, instance->isCreated()); return 1; } -int w_getModes(lua_State *L) -{ - return instance->getModes(L); -} - int w_setScissor(lua_State *L) { if (lua_gettop(L) == 0) @@ -1600,20 +1449,10 @@ int w_origin(lua_State * /*L*/) return 0; } -int w_hasFocus(lua_State *L) -{ - luax_pushboolean(L, instance->hasFocus()); - return 1; -} - // List of functions to wrap. static const luaL_Reg functions[] = { - { "checkMode", w_checkMode }, - { "setMode", w_setMode }, - { "getMode", w_getMode }, - { "toggleFullscreen", w_toggleFullscreen }, { "reset", w_reset }, { "clear", w_clear }, { "present", w_present }, @@ -1674,19 +1513,8 @@ static const luaL_Reg functions[] = { "print", w_print }, { "printf", w_printf }, - { "setCaption", w_setCaption }, - { "getCaption", w_getCaption }, - - { "setIcon", w_setIcon }, - - { "getWidth", w_getWidth }, - { "getHeight", w_getHeight }, - { "getDimensions", w_getDimensions }, - { "isCreated", w_isCreated }, - { "getModes", w_getModes }, - { "setScissor", w_setScissor }, { "getScissor", w_getScissor }, @@ -1712,8 +1540,6 @@ static const luaL_Reg functions[] = { "shear", w_shear }, { "origin", w_origin }, - { "hasFocus", w_hasFocus }, - { 0, 0 } }; @@ -1749,7 +1575,7 @@ extern "C" int luaopen_love_graphics(lua_State *L) WrappedModule w; w.module = instance; w.name = "graphics"; - w.flags = MODULE_T; + w.flags = MODULE_GRAPHICS_T; w.functions = functions; w.types = types; diff --git a/src/modules/graphics/opengl/wrap_Graphics.h b/src/modules/graphics/opengl/wrap_Graphics.h index 9a1abc681..dac6c03d3 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.h +++ b/src/modules/graphics/opengl/wrap_Graphics.h @@ -38,19 +38,9 @@ namespace graphics namespace opengl { -int w_checkMode(lua_State *L); -int w_setMode(lua_State *L); -int w_getMode(lua_State *L); -int w_toggleFullscreen(lua_State *L); int w_reset(lua_State *L); int w_clear(lua_State *L); int w_present(lua_State *L); -int w_setIcon(lua_State *L); -int w_setCaption(lua_State *L); -int w_getCaption(lua_State *L); -int w_getWidth(lua_State *L); -int w_getHeight(lua_State *L); -int w_getDimensions(lua_State *L); int w_isCreated(lua_State *L); int w_setScissor(lua_State *L); int w_getScissor(lua_State *L); @@ -115,7 +105,6 @@ int w_scale(lua_State *L); int w_translate(lua_State *L); int w_shear(lua_State *L); int w_origin(lua_State *L); -int w_hasFocus(lua_State *L); extern "C" LOVE_EXPORT int luaopen_love_graphics(lua_State *L); } // opengl diff --git a/src/modules/love/love.cpp b/src/modules/love/love.cpp index a82064571..7dec14662 100644 --- a/src/modules/love/love.cpp +++ b/src/modules/love/love.cpp @@ -98,12 +98,13 @@ extern "C" extern int luaopen_love_image(lua_State*); extern int luaopen_love_joystick(lua_State*); extern int luaopen_love_keyboard(lua_State*); + extern int luaopen_love_math(lua_State*); extern int luaopen_love_mouse(lua_State*); extern int luaopen_love_physics(lua_State*); extern int luaopen_love_sound(lua_State*); extern int luaopen_love_timer(lua_State*); extern int luaopen_love_thread(lua_State*); - extern int luaopen_love_math(lua_State*); + extern int luaopen_love_window(lua_State*); extern int luaopen_love_boot(lua_State*); } @@ -122,6 +123,7 @@ static const luaL_Reg modules[] = { { "love.sound", luaopen_love_sound }, { "love.timer", luaopen_love_timer }, { "love.thread", luaopen_love_thread }, + { "love.window", luaopen_love_window }, { "love.boot", luaopen_love_boot }, { 0, 0 } }; diff --git a/src/modules/timer/sdl/Timer.cpp b/src/modules/timer/sdl/Timer.cpp index 23c797076..75ac877fa 100644 --- a/src/modules/timer/sdl/Timer.cpp +++ b/src/modules/timer/sdl/Timer.cpp @@ -66,7 +66,7 @@ Timer::Timer() , fpsUpdateFrequency(1) , frames(0) , dt(0) - , timerFrequency(getTimerFrequency()) + , timerPeriod(getTimerPeriod()) { // Init the SDL timer system (needed for SDL_Delay.) if (SDL_InitSubSystem(SDL_INIT_TIMER) < 0) @@ -94,7 +94,7 @@ void Timer::step() // "Current" time is previous time by now. prevTime = currTime; - // Get ticks from system. + // Get time from system. currTime = getTime(); // Convert to number of seconds. @@ -132,7 +132,7 @@ double Timer::getAverageDelta() const return averageDelta; } -double Timer::getTimerFrequency() +double Timer::getTimerPeriod() { #if defined(LOVE_MACOSX) mach_timebase_info_data_t info; @@ -166,11 +166,11 @@ double Timer::getTime() const mt = getTimeOfDay(); return mt; #elif defined(LOVE_MACOSX) - return (double) mach_absolute_time() * timerFrequency; + return (double) mach_absolute_time() * timerPeriod; #elif defined(LOVE_WINDOWS) LARGE_INTEGER microTime; QueryPerformanceCounter(µTime); - return (double) microTime.QuadPart * timerFrequency; + return (double) microTime.QuadPart * timerPeriod; #endif } diff --git a/src/modules/timer/sdl/Timer.h b/src/modules/timer/sdl/Timer.h index 5d8e160bb..558c13efc 100644 --- a/src/modules/timer/sdl/Timer.h +++ b/src/modules/timer/sdl/Timer.h @@ -77,11 +77,11 @@ private: // The current timestep. double dt; - // The reciprocal of the timer frequency. - const double timerFrequency; + // The timer period (reciprocal of the frequency.) + const double timerPeriod; - // Returns the timer frequency on some platforms. - static double getTimerFrequency(); + // Returns the timer period on some platforms. + static double getTimerPeriod(); }; // Timer diff --git a/src/modules/timer/wrap_Timer.cpp b/src/modules/timer/wrap_Timer.cpp index fad032340..4968fa6c4 100644 --- a/src/modules/timer/wrap_Timer.cpp +++ b/src/modules/timer/wrap_Timer.cpp @@ -46,7 +46,7 @@ int w_getDelta(lua_State *L) int w_getFPS(lua_State *L) { - lua_pushnumber(L, instance->getFPS()); + lua_pushinteger(L, instance->getFPS()); return 1; } @@ -58,7 +58,7 @@ int w_getAverageDelta(lua_State *L) int w_sleep(lua_State *L) { - instance->sleep((float) luaL_checknumber(L, 1)); + instance->sleep(luaL_checknumber(L, 1)); return 0; } @@ -90,9 +90,9 @@ extern "C" int luaopen_love_timer(lua_State *L) instance = new love::timer::sdl::Timer(); } - catch(Exception &e) + catch (Exception &e) { - return luaL_error(L, e.what()); + return luaL_error(L, "%s", e.what()); } } else diff --git a/src/modules/window/Window.h b/src/modules/window/Window.h index 9c1d551ee..9f0201ac6 100644 --- a/src/modules/window/Window.h +++ b/src/modules/window/Window.h @@ -26,7 +26,8 @@ // LOVE #include "common/Module.h" -#include +#include "image/ImageData.h" +#include "graphics/Graphics.h" namespace love { @@ -55,7 +56,7 @@ public: virtual ~Window(); - virtual bool setWindow(int width = 800, int height = 600, WindowFlags *flags = 0) = 0; + virtual bool setWindow(int width = 800, int height = 600, graphics::Graphics *graphics = 0, WindowFlags *flags = 0) = 0; virtual void getWindow(int &width, int &height, WindowFlags &flags) const = 0; virtual bool checkWindowSize(int width, int height, bool fullscreen) const = 0; diff --git a/src/modules/window/sdl/Window.cpp b/src/modules/window/sdl/Window.cpp index be367d2a2..7546c98c7 100644 --- a/src/modules/window/sdl/Window.cpp +++ b/src/modules/window/sdl/Window.cpp @@ -55,8 +55,12 @@ Window::_currentMode::_currentMode() { } -bool Window::setWindow(int width, int height, WindowFlags *flags) +bool Window::setWindow(int width, int height, graphics::Graphics *graphics, WindowFlags *flags) { + + if (graphics) + graphics->unSetMode(); + bool fullscreen = false; bool vsync = true; int fsaa = 0; @@ -186,6 +190,9 @@ bool Window::setWindow(int width, int height, WindowFlags *flags) currentMode.flags.borderless = ((surface->flags & SDL_NOFRAME) != 0); currentMode.flags.centered = centered; + if (graphics) + graphics->setMode(width, height); + return true; } diff --git a/src/modules/window/sdl/Window.h b/src/modules/window/sdl/Window.h index adcea8ac7..6d9e2742f 100644 --- a/src/modules/window/sdl/Window.h +++ b/src/modules/window/sdl/Window.h @@ -38,7 +38,7 @@ public: Window(); ~Window(); - bool setWindow(int width = 800, int height = 600, WindowFlags *flags = 0); + bool setWindow(int width = 800, int height = 600, graphics::Graphics *graphics = 0, WindowFlags *flags = 0); void getWindow(int &width, int &height, WindowFlags &flags) const; bool checkWindowSize(int width, int height, bool fullscreen) const; diff --git a/src/modules/window/wrap_Window.cpp b/src/modules/window/wrap_Window.cpp new file mode 100644 index 000000000..2626f8c26 --- /dev/null +++ b/src/modules/window/wrap_Window.cpp @@ -0,0 +1,251 @@ +/** + * Copyright (c) 2006-2013 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#include "wrap_Window.h" +#include "sdl/Window.h" + +namespace love +{ +namespace window +{ + +static Window *instance = 0; + +int w_checkMode(lua_State *L) +{ + int w = luaL_checkint(L, 1); + int h = luaL_checkint(L, 2); + bool fs = luax_toboolean(L, 3); + luax_pushboolean(L, instance->checkWindowSize(w, h, fs)); + return 1; +} + +int w_setMode(lua_State *L) +{ + int w = luaL_checkint(L, 1); + int h = luaL_checkint(L, 2); + + graphics::Graphics *g = luax_optmodule(L, "graphics", MODULE_GRAPHICS_T); + + if (lua_isnoneornil(L, 3)) + { + luax_pushboolean(L, instance->setWindow(w, h, g, 0)); + return 1; + } + + luaL_checktype(L, 3, LUA_TTABLE); + + WindowFlags flags; + + flags.fullscreen = luax_boolflag(L, 3, "fullscreen", false); + flags.vsync = luax_boolflag(L, 3, "vsync", true); + flags.fsaa = luax_intflag(L, 3, "fsaa", 0); + flags.resizable = luax_boolflag(L, 3, "resizable", false); + flags.borderless = luax_boolflag(L, 3, "borderless", false); + flags.centered = luax_boolflag(L, 3, "centered", true); + + try + { + luax_pushboolean(L, instance->setWindow(w, h, g, &flags)); + } + catch (love::Exception &e) + { + return luaL_error(L, "%s", e.what()); + } + + return 1; +} + +int w_getMode(lua_State *L) +{ + int w, h; + WindowFlags flags; + instance->getWindow(w, h, flags); + lua_pushnumber(L, w); + lua_pushnumber(L, h); + + lua_newtable(L); + + luax_pushboolean(L, flags.fullscreen); + lua_setfield(L, -2, "fullscreen"); + + luax_pushboolean(L, flags.vsync); + lua_setfield(L, -2, "vsync"); + + lua_pushnumber(L, flags.fsaa); + lua_setfield(L, -2, "fsaa"); + + luax_pushboolean(L, flags.resizable); + lua_setfield(L, -2, "resizable"); + + luax_pushboolean(L, flags.borderless); + lua_setfield(L, -2, "borderless"); + + luax_pushboolean(L, flags.centered); + lua_setfield(L, -2, "centered"); + + return 3; +} + +int w_getModes(lua_State *L) +{ + int n; + Window::WindowSize *modes = instance->getFullscreenSizes(n); + + if (modes == 0) + return 0; + + lua_createtable(L, n, 0); + + for (int i = 0; i < n ; i++) + { + lua_pushinteger(L, i+1); + lua_createtable(L, 0, 2); + + // Inner table attribs. + + lua_pushinteger(L, modes[i].width); + lua_setfield(L, -2, "width"); + + lua_pushinteger(L, modes[i].height); + lua_setfield(L, -2, "height"); + + // Inner table attribs end. + + lua_settable(L, -3); + } + + delete[] modes; + return 1; +} + +int w_toggleFullscreen(lua_State *L) +{ + graphics::Graphics *g = luax_optmodule(L, "graphics", MODULE_GRAPHICS_T); + + int width, height; + WindowFlags flags; + instance->getWindow(width, height, flags); + flags.fullscreen = !flags.fullscreen; + + try + { + luax_pushboolean(L, instance->setWindow(width, height, g, &flags)); + } + catch (love::Exception &e) + { + return luaL_error(L, "%s", e.what()); + } + + return 1; +} + +int w_isCreated(lua_State *L) +{ + luax_pushboolean(L, instance->isCreated()); + return 1; +} + +int w_getWidth(lua_State *L) +{ + lua_pushinteger(L, instance->getWidth()); + return 1; +} + +int w_getHeight(lua_State *L) +{ + lua_pushinteger(L, instance->getHeight()); + return 1; +} + +int w_getDimensions(lua_State *L) +{ + lua_pushinteger(L, instance->getWidth()); + lua_pushinteger(L, instance->getHeight()); + return 2; +} + +int w_setIcon(lua_State *L) +{ + image::ImageData *i = luax_checktype(L, 1, "ImageData", IMAGE_IMAGE_DATA_T); + instance->setIcon(i); + return 0; +} + +int w_setTitle(lua_State *L) +{ + std::string title = luax_checkstring(L, 1); + instance->setWindowTitle(title); + return 0; +} + +int w_getTitle(lua_State *L) +{ + luax_pushstring(L, instance->getWindowTitle()); + return 1; +} + +int w_hasFocus(lua_State *L) +{ + luax_pushboolean(L, instance->hasFocus()); + return 1; +} + +static const luaL_Reg functions[] = +{ + { "checkMode", w_checkMode }, + { "setMode", w_setMode }, + { "getMode", w_getMode }, + { "getModes", w_getModes }, + { "toggleFullscreen", w_toggleFullscreen }, + { "isCreated", w_isCreated }, + { "getWidth", w_getWidth }, + { "getHeight", w_getHeight }, + { "getDimensions", w_getDimensions }, + { "setIcon", w_setIcon }, + { "setTitle", w_setTitle }, + { "getTitle", w_getTitle }, + { "hasFocus", w_hasFocus }, + { 0, 0 } +}; + +extern "C" int luaopen_love_window(lua_State *L) +{ + try + { + instance = sdl::Window::getSingleton(); + } + catch (love::Exception &e) + { + return luaL_error(L, "%s", e.what()); + } + + WrappedModule w; + w.module = instance; + w.name = "window"; + w.flags = MODULE_T; + w.functions = functions; + w.types = 0; + + return luax_register_module(L, w); +} + +} // window +} // love diff --git a/src/modules/window/wrap_Window.h b/src/modules/window/wrap_Window.h new file mode 100644 index 000000000..4d9b507d2 --- /dev/null +++ b/src/modules/window/wrap_Window.h @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2006-2013 LOVE Development Team + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + **/ + +#ifndef LOVE_WINDOW_WRAP_WINDOW_H +#define LOVE_WINDOW_WRAP_WINDOW_H + +#include "common/config.h" +#include "common/runtime.h" + +namespace love +{ +namespace window +{ + +int w_checkMode(lua_State *L); +int w_setMode(lua_State *L); +int w_getMode(lua_State *L); +int w_getModes(lua_State *L); +int w_toggleFullscreen(lua_State *L); +int w_isCreated(lua_State *L); +int w_getWidth(lua_State *L); +int w_getHeight(lua_State *L); +int w_getDimensions(lua_State *L); +int w_setIcon(lua_State *L); +int w_setTitle(lua_State *L); +int w_getTitle(lua_State *L); +int w_hasFocus(lua_State *L); +extern "C" LOVE_EXPORT int luaopen_love_window(lua_State *L); + +} // window +} // love + +#endif // LOVE_WINDOW_WRAP_WINDOW_H diff --git a/src/scripts/boot.lua b/src/scripts/boot.lua index 8b3a452f5..84e4f8942 100644 --- a/src/scripts/boot.lua +++ b/src/scripts/boot.lua @@ -192,9 +192,9 @@ function love.createhandlers() return end, resize = function(w, h) - local ow, oh, flags = love.graphics.getMode() + local ow, oh, flags = love.window.getMode() if flags.resizable then - love.graphics.setMode(w, h, flags) + love.window.setMode(w, h, flags) if love.resize then return love.resize(w, h) end end end, @@ -287,6 +287,7 @@ function love.init() sound = true, font = true, thread = true, + window = true, }, console = false, -- Only relevant for windows. identity = false, @@ -333,6 +334,7 @@ function love.init() "image", "font", "graphics", + "window", "math", "physics", } do @@ -347,9 +349,9 @@ function love.init() -- Setup screen here. local has_window = false - if c.screen and c.modules.graphics then - if love.graphics.checkMode(c.screen.width, c.screen.height, c.screen.fullscreen) or (c.screen.width == 0 and c.screen.height == 0) then - assert(love.graphics.setMode(c.screen.width, c.screen.height, + if c.screen and c.modules.window then + if love.window.checkMode(c.screen.width, c.screen.height, c.screen.fullscreen) or (c.screen.width == 0 and c.screen.height == 0) then + assert(love.window.setMode(c.screen.width, c.screen.height, { fullscreen = c.screen.fullscreen, vsync = c.screen.vsync, @@ -361,7 +363,7 @@ function love.init() else error("Could not set screen mode") end - love.graphics.setCaption(c.title) + love.window.setTitle(c.title) end -- Console hack @@ -454,13 +456,15 @@ function love.run() -- Call update and draw if love.update then love.update(dt) end -- will pass 0 if love.timer is disabled - if love.graphics then + if love.window and love.graphics then love.graphics.clear() love.graphics.origin() if love.draw then love.draw() end end - if love.graphics then love.graphics.present() end + if love.window and love.graphics then + love.graphics.present() + end if love.timer then love.timer.sleep(0.001) end end @@ -630,13 +634,13 @@ function love.nogame() local hearts = {} local rings = {} - + local cx = 400 local cy = 300 - + local pig local heart_image - + local function add_heart_ring(radius, number, speed) local step = math.pi*2/number for i = 1,number do @@ -650,13 +654,13 @@ function love.nogame() end table.insert(rings, radius) end - + local function update_hearts(dt) for i,v in ipairs(hearts) do v.position = v.position + v.speed*dt*0.6 end end - + local function draw_hearts() for i,v in ipairs(hearts) do local x = math.cos(v.position) * v.radius + cx @@ -665,7 +669,7 @@ function love.nogame() love.graphics.draw(heart_image, x, y, v.position+0.4, 1, 1, 32, 32) end end - + local function draw_pig(p) love.graphics.setColor(255, 255, 255, 255) love.graphics.draw(p.img, p.x, p.y, 0, 1, 1, 128, 128) @@ -734,7 +738,7 @@ function love.errhand(msg) error_printer(msg, 2) - if not love.graphics or not love.event or not love.graphics.isCreated() then + if not love.window or not love.graphics or not love.event or not love.window.isCreated() then return end @@ -771,7 +775,7 @@ function love.errhand(msg) local function draw() love.graphics.clear() - love.graphics.printf(p, 70, 70, love.graphics.getWidth() - 70) + love.graphics.printf(p, 70, 70, love.window.getWidth() - 70) love.graphics.present() end @@ -822,7 +826,7 @@ function love.releaseerrhand(msg) local function draw() love.graphics.clear() - love.graphics.printf(p, 70, 70, love.graphics.getWidth() - 70) + love.graphics.printf(p, 70, 70, love.window.getWidth() - 70) love.graphics.present() end diff --git a/src/scripts/boot.lua.h b/src/scripts/boot.lua.h index 25c7f854d..694673b11 100644 --- a/src/scripts/boot.lua.h +++ b/src/scripts/boot.lua.h @@ -343,13 +343,12 @@ const unsigned char boot_lua[] = 0x09, 0x09, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x77, 0x2c, 0x20, 0x68, 0x29, 0x0a, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6f, 0x77, 0x2c, 0x20, 0x6f, 0x68, 0x2c, 0x20, 0x66, - 0x6c, 0x61, 0x67, 0x73, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, - 0x63, 0x73, 0x2e, 0x67, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x29, 0x0a, + 0x6c, 0x61, 0x67, 0x73, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, + 0x2e, 0x67, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x29, 0x0a, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, - 0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, - 0x73, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x77, 0x2c, 0x20, 0x68, 0x2c, 0x20, 0x66, 0x6c, 0x61, 0x67, - 0x73, 0x29, 0x0a, + 0x09, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x73, 0x65, + 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x77, 0x2c, 0x20, 0x68, 0x2c, 0x20, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x29, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x72, 0x65, 0x73, 0x69, 0x7a, 0x65, 0x28, 0x77, 0x2c, 0x20, 0x68, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a, @@ -498,6 +497,7 @@ const unsigned char boot_lua[] = 0x09, 0x09, 0x09, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x0a, 0x09, 0x09, 0x09, 0x66, 0x6f, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x0a, 0x09, 0x09, 0x09, 0x74, 0x68, 0x72, 0x65, 0x61, 0x64, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x0a, + 0x09, 0x09, 0x09, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x2c, 0x0a, 0x09, 0x09, 0x7d, 0x2c, 0x0a, 0x09, 0x09, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x2c, 0x20, 0x2d, 0x2d, 0x20, 0x4f, 0x6e, 0x6c, 0x79, 0x20, 0x72, 0x65, 0x6c, 0x65, 0x76, 0x61, 0x6e, 0x74, 0x20, @@ -566,6 +566,7 @@ const unsigned char boot_lua[] = 0x09, 0x09, 0x22, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x22, 0x2c, 0x0a, 0x09, 0x09, 0x22, 0x66, 0x6f, 0x6e, 0x74, 0x22, 0x2c, 0x0a, 0x09, 0x09, 0x22, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x22, 0x2c, 0x0a, + 0x09, 0x09, 0x22, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x22, 0x2c, 0x0a, 0x09, 0x09, 0x22, 0x6d, 0x61, 0x74, 0x68, 0x22, 0x2c, 0x0a, 0x09, 0x09, 0x22, 0x70, 0x68, 0x79, 0x73, 0x69, 0x63, 0x73, 0x22, 0x2c, 0x0a, 0x09, 0x7d, 0x20, 0x64, 0x6f, 0x0a, @@ -585,20 +586,20 @@ const unsigned char boot_lua[] = 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x68, 0x61, 0x73, 0x5f, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x0a, 0x09, 0x69, 0x66, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, - 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x20, - 0x74, 0x68, 0x65, 0x6e, 0x0a, - 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, - 0x2e, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, - 0x6e, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, - 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2c, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x66, - 0x75, 0x6c, 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x29, 0x20, 0x6f, 0x72, 0x20, 0x28, 0x63, 0x2e, 0x73, - 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x20, 0x61, - 0x6e, 0x64, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, - 0x09, 0x09, 0x09, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x28, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, - 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x63, 0x2e, 0x73, 0x63, - 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, - 0x65, 0x6e, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2c, 0x0a, + 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x74, 0x68, + 0x65, 0x6e, 0x0a, + 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x2c, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x66, 0x75, 0x6c, + 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x29, 0x20, 0x6f, 0x72, 0x20, 0x28, 0x63, 0x2e, 0x73, 0x63, 0x72, + 0x65, 0x65, 0x6e, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x20, 0x3d, 0x3d, 0x20, 0x30, 0x20, 0x61, 0x6e, 0x64, + 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x20, 0x3d, + 0x3d, 0x20, 0x30, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, + 0x09, 0x09, 0x09, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x28, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, + 0x64, 0x6f, 0x77, 0x2e, 0x73, 0x65, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x28, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, + 0x65, 0x6e, 0x2e, 0x77, 0x69, 0x64, 0x74, 0x68, 0x2c, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, + 0x2e, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x2c, 0x0a, 0x09, 0x09, 0x09, 0x7b, 0x0a, 0x09, 0x09, 0x09, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x3d, 0x20, 0x63, 0x2e, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x2e, 0x66, 0x75, 0x6c, 0x6c, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, @@ -621,8 +622,8 @@ const unsigned char boot_lua[] = 0x74, 0x20, 0x73, 0x65, 0x74, 0x20, 0x73, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x20, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x29, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a, - 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, - 0x74, 0x43, 0x61, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x63, 0x2e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x29, 0x0a, + 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x73, 0x65, 0x74, 0x54, + 0x69, 0x74, 0x6c, 0x65, 0x28, 0x63, 0x2e, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x29, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x2d, 0x2d, 0x20, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x20, 0x68, 0x61, 0x63, 0x6b, 0x0a, 0x09, 0x69, 0x66, 0x20, 0x63, 0x2e, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, @@ -795,8 +796,9 @@ const unsigned char boot_lua[] = 0x29, 0x20, 0x65, 0x6e, 0x64, 0x20, 0x2d, 0x2d, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x70, 0x61, 0x73, 0x73, 0x20, 0x30, 0x20, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x20, 0x69, 0x73, 0x20, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x0a, - 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, - 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, + 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x61, + 0x6e, 0x64, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x20, 0x74, + 0x68, 0x65, 0x6e, 0x0a, 0x09, 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, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x6f, @@ -804,9 +806,12 @@ const unsigned char boot_lua[] = 0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x64, 0x72, 0x61, 0x77, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x64, 0x72, 0x61, 0x77, 0x28, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a, - 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, - 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, - 0x73, 0x2e, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x28, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a, + 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x20, 0x61, + 0x6e, 0x64, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x20, 0x74, + 0x68, 0x65, 0x6e, 0x0a, + 0x09, 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, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x72, 0x2e, 0x73, 0x6c, 0x65, 0x65, 0x70, 0x28, 0x30, 0x2e, 0x30, 0x30, 0x31, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a, @@ -1589,13 +1594,10 @@ const unsigned char boot_lua[] = 0x4a, 0x67, 0x67, 0x67, 0x3d, 0x3d, 0x22, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x68, 0x65, 0x61, 0x72, 0x74, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x0a, - 0x09, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x63, 0x78, 0x20, 0x3d, 0x20, 0x34, 0x30, 0x30, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x63, 0x79, 0x20, 0x3d, 0x20, 0x33, 0x30, 0x30, 0x0a, - 0x09, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x70, 0x69, 0x67, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x68, 0x65, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x0a, - 0x09, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x61, 0x64, 0x64, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x5f, 0x72, 0x69, 0x6e, 0x67, 0x28, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x2c, 0x20, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x2c, 0x20, 0x73, 0x70, 0x65, 0x65, 0x64, 0x29, 0x0a, @@ -1618,7 +1620,6 @@ const unsigned char boot_lua[] = 0x09, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x28, 0x72, 0x69, 0x6e, 0x67, 0x73, 0x2c, 0x20, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x29, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a, - 0x09, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x73, 0x28, 0x64, 0x74, 0x29, 0x0a, 0x09, 0x09, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x2c, 0x76, 0x20, 0x69, 0x6e, 0x20, 0x69, 0x70, 0x61, 0x69, 0x72, @@ -1628,7 +1629,6 @@ const unsigned char boot_lua[] = 0x2a, 0x64, 0x74, 0x2a, 0x30, 0x2e, 0x36, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a, - 0x09, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x68, 0x65, 0x61, 0x72, 0x74, 0x73, 0x28, 0x29, 0x0a, 0x09, 0x09, 0x66, 0x6f, 0x72, 0x20, 0x69, 0x2c, 0x76, 0x20, 0x69, 0x6e, 0x20, 0x69, 0x70, 0x61, 0x69, 0x72, @@ -1649,7 +1649,6 @@ const unsigned char boot_lua[] = 0x34, 0x2c, 0x20, 0x31, 0x2c, 0x20, 0x31, 0x2c, 0x20, 0x33, 0x32, 0x2c, 0x20, 0x33, 0x32, 0x29, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a, - 0x09, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x64, 0x72, 0x61, 0x77, 0x5f, 0x70, 0x69, 0x67, 0x28, 0x70, 0x29, 0x0a, 0x09, 0x09, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, @@ -1772,11 +1771,12 @@ const unsigned char boot_lua[] = 0x67, 0x29, 0x0a, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x28, 0x6d, 0x73, 0x67, 0x2c, 0x20, 0x32, 0x29, 0x0a, - 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, - 0x69, 0x63, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, - 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x69, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x28, 0x29, - 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, + 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, + 0x77, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x67, 0x72, 0x61, 0x70, + 0x68, 0x69, 0x63, 0x73, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x77, + 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x69, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x28, 0x29, 0x20, + 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x2d, 0x2d, 0x20, 0x4c, 0x6f, 0x61, 0x64, 0x2e, 0x0a, @@ -1834,8 +1834,8 @@ const unsigned char boot_lua[] = 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, + 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, + 0x28, 0x29, 0x20, 0x2d, 0x20, 0x37, 0x30, 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, @@ -1914,8 +1914,8 @@ const unsigned char boot_lua[] = 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, + 0x76, 0x65, 0x2e, 0x77, 0x69, 0x6e, 0x64, 0x6f, 0x77, 0x2e, 0x67, 0x65, 0x74, 0x57, 0x69, 0x64, 0x74, 0x68, + 0x28, 0x29, 0x20, 0x2d, 0x20, 0x37, 0x30, 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,