Browse Source

Change default segments for l.g.circle to max(10, r)

Bart van Strien 14 years ago
parent
commit
cc7b6431eb
2 changed files with 6 additions and 1 deletions
  1. 1 0
      changes.txt
  2. 5 1
      src/modules/graphics/opengl/wrap_Graphics.cpp

+ 1 - 0
changes.txt

@@ -54,6 +54,7 @@ LOVE 0.8.0 [Rubber Piggy]
   * Updated font engine.
   * Updated line drawing to a custom system.
   * Updated love.timer.sleep to use seconds, like the rest of love.
+  * Updated love.graphics.circle to have max(10, r) as default for segments.
 
   * Removed canvas auto-clearing.
   * Removed EncodedImageData.

+ 5 - 1
src/modules/graphics/opengl/wrap_Graphics.cpp

@@ -995,7 +995,11 @@ namespace opengl
 		float x = (float)luaL_checknumber(L, 2);
 		float y = (float)luaL_checknumber(L, 3);
 		float radius = (float)luaL_checknumber(L, 4);
-		int points = luaL_optint(L, 5, 10);
+		int points;
+		if (lua_gettop(L) > 4)
+			points = lua_tointeger(L, 5);
+		else
+			points = radius > 10 ? radius : 10;
 		instance->circle(mode, x, y, radius, points);
 		return 0;
 	}