From 42670975acf72ca52bbf73c0f0c0295b07c0a50a Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 28 Jan 2011 20:52:52 +0000 Subject: SWORD25: Removed a lot of debug/unimplemented/unused functions svn-id: r55600 --- engines/sword25/math/geometry_script.cpp | 47 +++++--------------------------- 1 file changed, 7 insertions(+), 40 deletions(-) (limited to 'engines/sword25/math') diff --git a/engines/sword25/math/geometry_script.cpp b/engines/sword25/math/geometry_script.cpp index 15b1aadac1..6562a0f0a5 100644 --- a/engines/sword25/math/geometry_script.cpp +++ b/engines/sword25/math/geometry_script.cpp @@ -359,45 +359,6 @@ static int r_setY(lua_State *L) { return 0; } -static void drawPolygon(const Polygon &polygon, uint color, const Vertex &offset) { - GraphicEngine *pGE = Kernel::getInstance()->getGfx(); - assert(pGE); - - for (int i = 0; i < polygon.vertexCount - 1; i++) - pGE->drawDebugLine(polygon.vertices[i] + offset, polygon.vertices[i + 1] + offset, color); - - pGE->drawDebugLine(polygon.vertices[polygon.vertexCount - 1] + offset, polygon.vertices[0] + offset, color); -} - -static void drawRegion(const Region ®ion, uint color, const Vertex &offset) { - drawPolygon(region.getContour(), color, offset); - for (int i = 0; i < region.getHoleCount(); i++) - drawPolygon(region.getHole(i), color, offset); -} - -static int r_draw(lua_State *L) { - Region *pR = checkRegion(L); - assert(pR); - - switch (lua_gettop(L)) { - case 3: { - Vertex offset; - Vertex::luaVertexToVertex(L, 3, offset); - drawRegion(*pR, GraphicEngine::luaColorToARGBColor(L, 2), offset); - } - break; - - case 2: - drawRegion(*pR, GraphicEngine::luaColorToARGBColor(L, 2), Vertex(0, 0)); - break; - - default: - drawRegion(*pR, BS_RGB(255, 255, 255), Vertex(0, 0)); - } - - return 0; -} - static int r_getCentroid(lua_State *L) { Region *RPtr = checkRegion(L); assert(RPtr); @@ -414,6 +375,12 @@ static int r_delete(lua_State *L) { return 0; } +// Marks a function that should never be used +static int dummyFuncError(lua_State *L) { + error("Dummy function invoked by LUA"); + return 1; +} + static const luaL_reg REGION_METHODS[] = { {"SetPos", r_setPos}, {"SetX", r_setX}, @@ -423,7 +390,7 @@ static const luaL_reg REGION_METHODS[] = { {"GetX", r_getX}, {"GetY", r_getY}, {"IsValid", r_isValid}, - {"Draw", r_draw}, + {"Draw", dummyFuncError}, {"GetCentroid", r_getCentroid}, {0, 0} }; -- cgit v1.2.3