Commits

Alex Szpakowski committed 3051616

Removed internal code for love.graphics.triangle and love.graphics.quad

  • Participants
  • Parent commits baba702

Comments (0)

Files changed (4)

File src/modules/graphics/opengl/Graphics.cpp

 		delete[] overdraw;
 }
 
-void Graphics::triangle(DrawMode mode, float x1, float y1, float x2, float y2, float x3, float y3)
-{
-	float coords[] = { x1,y1, x2,y2, x3,y3, x1,y1 };
-	polygon(mode, coords, 4 * 2);
-}
-
 void Graphics::rectangle(DrawMode mode, float x, float y, float w, float h)
 {
-	quad(mode, x,y, x,y+h, x+w,y+h, x+w,y);
-}
-
-void Graphics::quad(DrawMode mode, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4)
-{
-	float coords[] = { x1,y1, x2,y2, x3,y3, x4,y4, x1,y1 };
-	polygon(mode, coords, 5 * 2);
+	float coords[] = {x,y, x,y+h, x+w,y+h, x+w,y};
+	polygon(mode, coords, 4 * 2);
 }
 
 void Graphics::circle(DrawMode mode, float x, float y, float radius, int points)

File src/modules/graphics/opengl/Graphics.h

 	void polyline(const float *coords, size_t count);
 
 	/**
-	 * Draws a triangle using the three coordinates passed.
-	 * @param mode The mode of drawing (line/filled).
-	 * @param x1 First x-coordinate.
-	 * @param y1 First y-coordinate.
-	 * @param x2 Second x-coordinate.
-	 * @param y2 Second y-coordinate.
-	 * @param x3 Third x-coordinate.
-	 * @param y3 Third y-coordinate.
-	 **/
-	void triangle(DrawMode mode, float x1, float y1, float x2, float y2, float x3, float y3);
-
-	/**
 	 * Draws a rectangle.
 	 * @param x Position along x-axis for top-left corner.
 	 * @param y Position along y-axis for top-left corner.
 	void rectangle(DrawMode mode, float x, float y, float w, float h);
 
 	/**
-	 * Draws a quadrilateral using the four coordinates passed.
-	 * @param mode The mode of drawing (line/filled).
-	 * @param x1 First x-coordinate.
-	 * @param y1 First y-coordinate.
-	 * @param x2 Second x-coordinate.
-	 * @param y2 Second y-coordinate.
-	 * @param x3 Third x-coordinate.
-	 * @param y3 Third y-coordinate.
-	 * @param x4 Fourth x-coordinate.
-	 * @param y4 Fourth y-coordinate.
-	 **/
-	void quad(DrawMode mode, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4);
-
-	/**
 	 * Draws a circle using the specified arguments.
 	 * @param mode The mode of drawing (line/filled).
 	 * @param x X-coordinate.

File src/modules/graphics/opengl/wrap_Graphics.cpp

 	return 0;
 }
 
-int w_triangle(lua_State *L)
-{
-	Graphics::DrawMode mode;
-	const char *str = luaL_checkstring(L, 1);
-	if (!Graphics::getConstant(str, mode))
-		return luaL_error(L, "Incorrect draw mode %s", str);
-
-	float x1 = (float)luaL_checknumber(L, 2);
-	float y1 = (float)luaL_checknumber(L, 3);
-	float x2 = (float)luaL_checknumber(L, 4);
-	float y2 = (float)luaL_checknumber(L, 5);
-	float x3 = (float)luaL_checknumber(L, 6);
-	float y3 = (float)luaL_checknumber(L, 7);
-	instance->triangle(mode, x1, y1, x2, y2, x3, y3);
-	return 0;
-}
-
 int w_rectangle(lua_State *L)
 {
 	Graphics::DrawMode mode;
 	return 0;
 }
 
-int w_quad(lua_State *L)
-{
-	Graphics::DrawMode mode;
-	const char *str = luaL_checkstring(L, 1);
-	if (!Graphics::getConstant(str, mode))
-		return luaL_error(L, "Incorrect draw mode %s", str);
-
-	float x1 = (float)luaL_checknumber(L, 2);
-	float y1 = (float)luaL_checknumber(L, 3);
-	float x2 = (float)luaL_checknumber(L, 4);
-	float y2 = (float)luaL_checknumber(L, 5);
-	float x3 = (float)luaL_checknumber(L, 6);
-	float y3 = (float)luaL_checknumber(L, 7);
-	float x4 = (float)luaL_checknumber(L, 8);
-	float y4 = (float)luaL_checknumber(L, 9);
-	instance->quad(mode, x1, y1, x2, y2, x3, y3, x4, y4);
-	return 0;
-}
-
 int w_circle(lua_State *L)
 {
 	Graphics::DrawMode mode;
 
 	{ "point", w_point },
 	{ "line", w_line },
-	//{ "triangle", w_triangle },
 	{ "rectangle", w_rectangle },
-	//{ "quad", w_quad },
 	{ "circle", w_circle },
 	{ "arc", w_arc },
 

File src/modules/graphics/opengl/wrap_Graphics.h

 int w_printf(lua_State *L);
 int w_point(lua_State *L);
 int w_line(lua_State *L);
-int w_triangle(lua_State *L);
 int w_rectangle(lua_State *L);
-int w_quad(lua_State *L);
 int w_circle(lua_State *L);
 int w_arc(lua_State *L);
 int w_push(lua_State *L);