瀏覽代碼

love.graphics.newParticleSystem now uses a default buffer size of 1000 (issue #598)

Alex Szpakowski 12 年之前
父節點
當前提交
c7ebb50b70
共有 2 個文件被更改,包括 5 次插入5 次删除
  1. 1 1
      src/modules/graphics/opengl/Shader.cpp
  2. 4 4
      src/modules/graphics/opengl/wrap_Graphics.cpp

+ 1 - 1
src/modules/graphics/opengl/Shader.cpp

@@ -593,7 +593,7 @@ std::string Shader::getGLSLVersion()
 	const char *tmp = 0;
 	const char *tmp = 0;
 
 
 	// GL_SHADING_LANGUAGE_VERSION isn't available in OpenGL < 2.0.
 	// GL_SHADING_LANGUAGE_VERSION isn't available in OpenGL < 2.0.
-	if (GL_VERSION_2_0)
+	if (GL_VERSION_2_0 || GLEE_ARB_shading_language_100)
 		tmp = (const char *) glGetString(GL_SHADING_LANGUAGE_VERSION);
 		tmp = (const char *) glGetString(GL_SHADING_LANGUAGE_VERSION);
 
 
 	if (tmp == 0)
 	if (tmp == 0)

+ 4 - 4
src/modules/graphics/opengl/wrap_Graphics.cpp

@@ -157,7 +157,7 @@ int w_present(lua_State *)
 
 
 int w_setIcon(lua_State *L)
 int w_setIcon(lua_State *L)
 {
 {
-	Image *image = luax_checktype<Image>(L, 1, "Image", GRAPHICS_IMAGE_T);
+	Image *image = luax_checkimage(L, 1);
 	try
 	try
 	{
 	{
 		instance->setIcon(image);
 		instance->setIcon(image);
@@ -543,7 +543,7 @@ int w_newImageFont(lua_State *L)
 
 
 int w_newSpriteBatch(lua_State *L)
 int w_newSpriteBatch(lua_State *L)
 {
 {
-	Image *image = luax_checktype<Image>(L, 1, "Image", GRAPHICS_IMAGE_T);
+	Image *image = luax_checkimage(L, 1);
 	int size = luaL_optint(L, 2, 1000);
 	int size = luaL_optint(L, 2, 1000);
 	SpriteBatch::UsageHint usage = SpriteBatch::USAGE_DYNAMIC;
 	SpriteBatch::UsageHint usage = SpriteBatch::USAGE_DYNAMIC;
 	if (lua_gettop(L) > 2)
 	if (lua_gettop(L) > 2)
@@ -566,8 +566,8 @@ int w_newSpriteBatch(lua_State *L)
 
 
 int w_newParticleSystem(lua_State *L)
 int w_newParticleSystem(lua_State *L)
 {
 {
-	Image *image = luax_checktype<Image>(L, 1, "Image", GRAPHICS_IMAGE_T);
-	int size = luaL_checkint(L, 2);
+	Image *image = luax_checkimage(L, 1);
+	int size = luaL_optint(L, 2, 1000);
 	ParticleSystem *t = instance->newParticleSystem(image, size);
 	ParticleSystem *t = instance->newParticleSystem(image, size);
 	luax_newtype(L, "ParticleSystem", GRAPHICS_PARTICLE_SYSTEM_T, (void *)t);
 	luax_newtype(L, "ParticleSystem", GRAPHICS_PARTICLE_SYSTEM_T, (void *)t);
 	return 1;
 	return 1;