Commits

Bart van Strien committed d556de9

Make the default point style to setPoint 'smooth' (issue #543), and fix setPointStyle ignoring normal operation

  • Participants
  • Parent commits 2e57cc4

Comments (0)

Files changed (1)

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

 
 int w_setPointStyle(lua_State *L)
 {
-	Graphics::PointStyle style = Graphics::POINT_SMOOTH;
+	Graphics::PointStyle style;
 
-	if (lua_gettop(L) >= 2)
-	{
-		const char *str = luaL_checkstring(L, 1);
-		if (!Graphics::getConstant(str, style))
-			return luaL_error(L, "Invalid point style: %s", str);
-	}
+	const char *str = luaL_checkstring(L, 1);
+	if (!Graphics::getConstant(str, style))
+		return luaL_error(L, "Invalid point style: %s", str);
 
 	instance->setPointStyle(style);
 	return 0;
 {
 	float size = (float)luaL_checknumber(L, 1);
 
-	Graphics::PointStyle style;
-	const char *str = luaL_checkstring(L, 2);
-	if (!Graphics::getConstant(str, style))
-		return luaL_error(L, "Invalid point style: %s", str);
+	Graphics::PointStyle style = Graphics::POINT_SMOOTH;
+
+	if (lua_gettop(L) >= 2)
+	{
+		const char *str = luaL_checkstring(L, 2);
+		if (!Graphics::getConstant(str, style))
+			return luaL_error(L, "Invalid point style: %s", str);
+	}
 
 	instance->setPoint(size, style);
 	return 0;