diff options
Diffstat (limited to 'engines/sword25/gfx/graphicengine_script.cpp')
-rw-r--r-- | engines/sword25/gfx/graphicengine_script.cpp | 103 |
1 files changed, 14 insertions, 89 deletions
diff --git a/engines/sword25/gfx/graphicengine_script.cpp b/engines/sword25/gfx/graphicengine_script.cpp index e9a2617d71..d67d0038c3 100644 --- a/engines/sword25/gfx/graphicengine_script.cpp +++ b/engines/sword25/gfx/graphicengine_script.cpp @@ -222,13 +222,10 @@ static int init(lua_State *L) { static_cast<int>(luaL_checknumber(L, 3)))); break; case 4: + default: lua_pushbooleancpp(L, pGE->init(static_cast<int>(luaL_checknumber(L, 1)), static_cast<int>(luaL_checknumber(L, 2)), static_cast<int>(luaL_checknumber(L, 3)), static_cast<int>(luaL_checknumber(L, 4)))); break; - default: - lua_pushbooleancpp(L, pGE->init(static_cast<int>(luaL_checknumber(L, 1)), static_cast<int>(luaL_checknumber(L, 2)), - static_cast<int>(luaL_checknumber(L, 3)), static_cast<int>(luaL_checknumber(L, 4)), - lua_tobooleancpp(L, 5))); } @@ -283,34 +280,6 @@ static int endFrame(lua_State *L) { return 1; } -static int drawDebugLine(lua_State *L) { - GraphicEngine *pGE = getGE(); - - Vertex start; - Vertex end; - Vertex::luaVertexToVertex(L, 1, start); - Vertex::luaVertexToVertex(L, 2, end); - pGE->drawDebugLine(start, end, GraphicEngine::luaColorToARGBColor(L, 3)); - - return 0; -} - -static int getDisplayWidth(lua_State *L) { - GraphicEngine *pGE = getGE(); - - lua_pushnumber(L, pGE->getDisplayWidth()); - - return 1; -} - -static int getDisplayHeight(lua_State *L) { - GraphicEngine *pGE = getGE(); - - lua_pushnumber(L, pGE->getDisplayHeight()); - - return 1; -} - static int getBitDepth(lua_State *L) { GraphicEngine *pGE = getGE(); @@ -335,21 +304,6 @@ static int isVsync(lua_State *L) { return 1; } -static int isWindowed(lua_State *L) { - GraphicEngine *pGE = getGE(); - - lua_pushbooleancpp(L, pGE->isWindowed()); - - return 1; -} - -static int getFPSCount(lua_State *L) { - // Used in a debug function - lua_pushnumber(L, 0); - - return 1; -} - static int getLastFrameDuration(lua_State *L) { GraphicEngine *pGE = getGE(); @@ -378,23 +332,15 @@ static int getSecondaryFrameDuration(lua_State *L) { return 1; } -static int saveScreenshot(lua_State *L) { - // This is used by system/debug.lua only. We do not implement this; support - // for taking screenshots is a backend feature. - lua_pushbooleancpp(L, false); - - return 1; -} - static int saveThumbnailScreenshot(lua_State *L) { GraphicEngine *pGE = getGE(); lua_pushbooleancpp(L, pGE->saveThumbnailScreenshot(luaL_checkstring(L, 1))); return 1; } -static int getRepaintedPixels(lua_State *L) { - // Used in a debug function. - lua_pushnumber(L, 0); +// Marks a function that should never be used +static int dummyFuncError(lua_State *L) { + error("Dummy function invoked by LUA"); return 1; } @@ -402,21 +348,21 @@ static const luaL_reg GFX_FUNCTIONS[] = { {"Init", init}, {"StartFrame", startFrame}, {"EndFrame", endFrame}, - {"DrawDebugLine", drawDebugLine}, + {"DrawDebugLine", dummyFuncError}, {"SetVsync", setVsync}, - {"GetDisplayWidth", getDisplayWidth}, - {"GetDisplayHeight", getDisplayHeight}, + {"GetDisplayWidth", dummyFuncError}, + {"GetDisplayHeight", dummyFuncError}, {"GetBitDepth", getBitDepth}, {"IsVsync", isVsync}, - {"IsWindowed", isWindowed}, - {"GetFPSCount", getFPSCount}, + {"IsWindowed", dummyFuncError}, + {"GetFPSCount", dummyFuncError}, {"GetLastFrameDuration", getLastFrameDuration}, {"StopMainTimer", stopMainTimer}, {"ResumeMainTimer", resumeMainTimer}, {"GetSecondaryFrameDuration", getSecondaryFrameDuration}, - {"SaveScreenshot", saveScreenshot}, + {"SaveScreenshot", dummyFuncError}, {"NewAnimationTemplate", newAnimationTemplate}, - {"GetRepaintedPixels", getRepaintedPixels}, + {"GetRepaintedPixels", dummyFuncError}, {"SaveThumbnailScreenshot", saveThumbnailScreenshot}, {0, 0} }; @@ -812,27 +758,6 @@ static int b_getPixel(lua_State *L) { return 1; } -static int b_isScalingAllowed(lua_State *L) { - RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - assert(bitmapPtr.isValid()); - lua_pushbooleancpp(L, bitmapPtr->isScalingAllowed()); - return 1; -} - -static int b_isAlphaAllowed(lua_State *L) { - RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - assert(bitmapPtr.isValid()); - lua_pushbooleancpp(L, bitmapPtr->isAlphaAllowed()); - return 1; -} - -static int b_isTintingAllowed(lua_State *L) { - RenderObjectPtr<Bitmap> bitmapPtr = checkBitmap(L); - assert(bitmapPtr.isValid()); - lua_pushbooleancpp(L, bitmapPtr->isColorModulationAllowed()); - return 1; -} - static int b_remove(lua_State *L) { RenderObjectPtr<RenderObject> roPtr = checkRenderObject(L); assert(roPtr.isValid()); @@ -855,9 +780,9 @@ static const luaL_reg BITMAP_METHODS[] = { {"IsFlipH", b_isFlipH}, {"IsFlipV", b_isFlipV}, {"GetPixel", b_getPixel}, - {"IsScalingAllowed", b_isScalingAllowed}, - {"IsAlphaAllowed", b_isAlphaAllowed}, - {"IsTintingAllowed", b_isTintingAllowed}, + {"IsScalingAllowed", dummyFuncError}, + {"IsAlphaAllowed", dummyFuncError}, + {"IsTintingAllowed", dummyFuncError}, {"Remove", b_remove}, {0, 0} }; |