diff --git a/platform/macosx/love.xcodeproj/project.pbxproj b/platform/macosx/love.xcodeproj/project.pbxproj index 5399671bd..3192411f8 100644 --- a/platform/macosx/love.xcodeproj/project.pbxproj +++ b/platform/macosx/love.xcodeproj/project.pbxproj @@ -23,7 +23,6 @@ A9255F52104324D700BA1496 /* Ogg.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9255F51104324D700BA1496 /* Ogg.framework */; }; A9255F58104324E100BA1496 /* Ogg.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = A9255F51104324D700BA1496 /* Ogg.framework */; }; A9255F8210432C3E00BA1496 /* libltdl.3.dylib in CopyFiles */ = {isa = PBXBuildFile; fileRef = A9255F8110432C3E00BA1496 /* libltdl.3.dylib */; }; - A93E6D8410420B3D007D418B /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A93E6D8310420B3D007D418B /* Carbon.framework */; }; A93E6E4910420B4A007D418B /* OpenAL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A93E6E4610420B4A007D418B /* OpenAL.framework */; }; A93E6E4A10420B4A007D418B /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A93E6E4710420B4A007D418B /* OpenGL.framework */; }; A93E6E4B10420B4A007D418B /* FreeType.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A93E6E4810420B4A007D418B /* FreeType.framework */; }; @@ -634,7 +633,6 @@ A93E6B9810420ACC007D418B /* boot.lua.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = boot.lua.h; sourceTree = ""; }; A93E6B9910420ACC007D418B /* graphics.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.lua; path = graphics.lua; sourceTree = ""; }; A93E6B9A10420ACC007D418B /* graphics.lua.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = graphics.lua.h; sourceTree = ""; }; - A93E6D8310420B3D007D418B /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; A93E6E4610420B4A007D418B /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; }; A93E6E4710420B4A007D418B /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = ""; }; A93E6E4810420B4A007D418B /* FreeType.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FreeType.framework; path = /Library/Frameworks/FreeType.framework; sourceTree = ""; }; @@ -655,7 +653,6 @@ A9255F461043247300BA1496 /* IL.framework in Frameworks */, A9255EE810431BD000BA1496 /* Vorbis.framework in Frameworks */, 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, - A93E6D8410420B3D007D418B /* Carbon.framework in Frameworks */, A93E6E4910420B4A007D418B /* OpenAL.framework in Frameworks */, A93E6E4A10420B4A007D418B /* OpenGL.framework in Frameworks */, A93E6E4B10420B4A007D418B /* FreeType.framework in Frameworks */, @@ -683,7 +680,6 @@ A93E6E4610420B4A007D418B /* OpenAL.framework */, A93E6E4710420B4A007D418B /* OpenGL.framework */, A93E6E4810420B4A007D418B /* FreeType.framework */, - A93E6D8310420B3D007D418B /* Carbon.framework */, 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */, A93E6E5210420B57007D418B /* SDL.framework */, A93E6E5310420B57007D418B /* Lua.framework */, diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index 35270dd07..6250b5664 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -438,6 +438,11 @@ namespace opengl return new SpriteBatch(image, size, usage); } + ParticleSystem * Graphics::newParticleSystem(Image * image, int size) + { + return new ParticleSystem(image, size); + } + void Graphics::setColor(Color c) { glColor4ubv(&c.r); diff --git a/src/modules/graphics/opengl/Graphics.h b/src/modules/graphics/opengl/Graphics.h index 279085d70..78b176c43 100644 --- a/src/modules/graphics/opengl/Graphics.h +++ b/src/modules/graphics/opengl/Graphics.h @@ -38,6 +38,7 @@ #include "ImageFont.h" #include "Quad.h" #include "SpriteBatch.h" +#include "ParticleSystem.h" namespace love { @@ -252,6 +253,8 @@ namespace opengl Font * newImageFont(Image * image, const char * glyphs, float spacing = 1); SpriteBatch * newSpriteBatch(Image * image, int size, int usage); + + ParticleSystem * newParticleSystem(Image * image, int size); /** * Sets the foreground color. diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index c273e2578..d20976ac6 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -254,6 +254,15 @@ namespace opengl return 1; } + int w_newParticleSystem(lua_State * L) + { + Image * image = luax_checktype(L, 1, "Image", GRAPHICS_IMAGE_T); + int size = luaL_checkint(L, 2); + ParticleSystem * t = instance->newParticleSystem(image, size); + luax_newtype(L, "ParticleSystem", GRAPHICS_PARTICLE_SYSTEM_T, (void*)t); + return 1; + } + int w_setColor(lua_State * L) { Color c; @@ -686,6 +695,7 @@ namespace opengl { "newFont", w_newFont }, { "newImageFont", w_newImageFont }, { "newSpriteBatch", w_newSpriteBatch }, + { "newParticleSystem", w_newParticleSystem }, { "setColor", w_setColor }, { "getColor", w_getColor }, diff --git a/src/modules/graphics/opengl/wrap_Graphics.h b/src/modules/graphics/opengl/wrap_Graphics.h index 604ab6a20..23d332435 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.h +++ b/src/modules/graphics/opengl/wrap_Graphics.h @@ -55,6 +55,7 @@ namespace opengl int w_newFont(lua_State * L); int w_newImageFont(lua_State * L); int w_newSpriteBatch(lua_State * L); + int w_newParticleSystem(lua_State * L); int w_setColor(lua_State * L); int w_getColor(lua_State * L); int w_setBackgroundColor(lua_State * L); diff --git a/src/modules/graphics/opengl/wrap_ParticleSystem.cpp b/src/modules/graphics/opengl/wrap_ParticleSystem.cpp index 3193e92f8..6b611e9eb 100644 --- a/src/modules/graphics/opengl/wrap_ParticleSystem.cpp +++ b/src/modules/graphics/opengl/wrap_ParticleSystem.cpp @@ -69,7 +69,7 @@ namespace opengl { ParticleSystem * t = luax_checkparticlesystem(L, 1); float arg1 = (float)luaL_checknumber(L, 2); - float arg2 = (float)luaL_checknumber(L, 3); + float arg2 = (float)luaL_optnumber(L, 3, arg1); t->setParticleLife(arg1, arg2); return 0; } @@ -310,7 +310,7 @@ namespace opengl { "setSprite", w_ParticleSystem_setSprite }, { "setBufferSize", w_ParticleSystem_setBufferSize }, { "setEmissionRate", w_ParticleSystem_setEmissionRate }, - { "setLifeTime", w_ParticleSystem_setLifetime }, + { "setLifetime", w_ParticleSystem_setLifetime }, { "setParticleLife", w_ParticleSystem_setParticleLife }, { "setPosition", w_ParticleSystem_setPosition }, { "setDirection", w_ParticleSystem_setDirection }, diff --git a/src/scripts/boot.lua b/src/scripts/boot.lua index 7f3fef460..ff1458e9e 100644 --- a/src/scripts/boot.lua +++ b/src/scripts/boot.lua @@ -636,8 +636,8 @@ function love.errhand(msg) love.graphics.setBackgroundColor(89, 157, 220) local font = love.graphics.newFont(love._vera_ttf, 14) love.graphics.setFont(font) + love.graphics.setColor(255, 255, 255, 255) - if love.audio then love.audio.stop() end local trace = debug.traceback() @@ -664,8 +664,6 @@ function love.errhand(msg) love.graphics.present() - local finish = false - while true do e, a, b, c = love.event.wait() diff --git a/src/scripts/boot.lua.h b/src/scripts/boot.lua.h index dea1daf0b..6e0d8d69a 100644 --- a/src/scripts/boot.lua.h +++ b/src/scripts/boot.lua.h @@ -683,68 +683,64 @@ static const unsigned char B1[]={ 97,112,104,105, 99,115, 46,110,101,119, 70,111,110,116, 40,108,111,118,101, 46, 95,118,101,114, 97, 95,116,116,102, 44, 32, 49, 52, 41, 13, 10, 9,108,111,118, 101, 46,103,114, 97,112,104,105, 99,115, 46,115,101,116, 70,111,110,116, 40,102, -111,110,116, 41, 13, 10, 9,108,111,118,101, 46,103,114, 97,112,104,105, 99,115, - 46,115,101,116, 67,111,108,111,114, 40, 50, 53, 53, 44, 32, 50, 53, 53, 44, 32, - 50, 53, 53, 44, 32, 50, 53, 53, 41, 13, 10, 9,105,102, 32,108,111,118,101, 46, - 97,117,100,105,111, 32,116,104,101,110, 32,108,111,118,101, 46, 97,117,100,105, -111, 46,115,116,111,112, 40, 41, 32,101,110,100, 9, 13, 10, 13, 10, 9,108,111, - 99, 97,108, 32,116,114, 97, 99,101, 32, 61, 32,100,101, 98,117,103, 46,116,114, - 97, 99,101, 98, 97, 99,107, 40, 41, 13, 10, 9, 13, 10, 9,108,111,118,101, 46, -103,114, 97,112,104,105, 99,115, 46, 99,108,101, 97,114, 40, 41, 13, 10, 9, 13, - 10, 9,108,111, 99, 97,108, 32,101,114,114, 32, 61, 32,123,125, 13, 10, 9, 13, - 10, 9,116, 97, 98,108,101, 46,105,110,115,101,114,116, 40,101,114,114, 44, 32, - 34, 69,114,114,111,114, 92,110, 34, 41, 13, 10, 9,116, 97, 98,108,101, 46,105, -110,115,101,114,116, 40,101,114,114, 44, 32,109,115,103, 46, 46, 34, 92,110, 92, -110, 34, 41, 13, 10, 9, 13, 10, 9,102,111,114, 32,108, 32,105,110, 32,115,116, -114,105,110,103, 46,103,109, 97,116, 99,104, 40,116,114, 97, 99,101, 44, 32, 34, - 40, 46, 45, 41, 92,110, 34, 41, 32,100,111, 13, 10, 9, 9,105,102, 32,110,111, -116, 32,115,116,114,105,110,103, 46,109, 97,116, 99,104, 40,108, 44, 32, 34, 98, -111,111,116, 46,108,117, 97, 34, 41, 32,116,104,101,110, 13, 10, 9, 9, 9,108, - 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,108, 44, 32, 34,115, -116, 97, 99,107, 32,116,114, 97, 99,101, 98, 97, 99,107, 58, 34, 44, 32, 34, 84, -114, 97, 99,101, 98, 97, 99,107, 92,110, 34, 41, 13, 10, 9, 9, 9,116, 97, 98, -108,101, 46,105,110,115,101,114,116, 40,101,114,114, 44, 32,108, 41, 13, 10, 9, - 9,101,110,100, 13, 10, 9,101,110,100, 13, 10, 9, 13, 10, 9,108,111, 99, 97, -108, 32,112, 32, 61, 32,116, 97, 98,108,101, 46, 99,111,110, 99, 97,116, 40,101, -114,114, 44, 32, 34, 92,110, 34, 41, 13, 10, 9, 9, 13, 10, 9,112, 32, 61, 32, -115,116,114,105,110,103, 46,103,115,117, 98, 40,112, 44, 32, 34, 92,116, 34, 44, - 32, 34, 34, 41, 13, 10, 9,112, 32, 61, 32,115,116,114,105,110,103, 46,103,115, -117, 98, 40,112, 44, 32, 34, 37, 91,115,116,114,105,110,103, 32, 92, 34, 40, 46, - 45, 41, 92, 34, 37, 93, 34, 44, 32, 34, 37, 49, 34, 41, 13, 10, 9, 13, 10, 9, -108,111,118,101, 46,103,114, 97,112,104,105, 99,115, 46,112,114,105,110,116, 40, -112, 44, 32, 55, 48, 44, 32, 55, 48, 41, 9, 13, 10, 9, 13, 10, 9,108,111,118, -101, 46,103,114, 97,112,104,105, 99,115, 46,112,114,101,115,101,110,116, 40, 41, - 13, 10, 9, 9, 13, 10, 9,108,111, 99, 97,108, 32,102,105,110,105,115,104, 32, - 61, 32,102, 97,108,115,101, 13, 10, 9, 13, 10, 9,119,104,105,108,101, 32,116, -114,117,101, 32,100,111, 13, 10, 9, 9,101, 44, 32, 97, 44, 32, 98, 44, 32, 99, - 32, 61, 32,108,111,118,101, 46,101,118,101,110,116, 46,119, 97,105,116, 40, 41, - 13, 10, 9, 9, 13, 10, 9, 9,105,102, 32,101, 32, 61, 61, 32,108,111,118,101, - 46,101,118,101,110,116, 95,113,117,105,116, 32,116,104,101,110, 32,114,101,116, -117,114,110, 32,101,110,100, 13, 10, 9, 9,105,102, 32,101, 32, 61, 61, 32,108, -111,118,101, 46,101,118,101,110,116, 95,107,101,121,112,114,101,115,115,101,100, - 32, 97,110,100, 32, 97, 32, 61, 61, 32,108,111,118,101, 46,107,101,121, 95,101, -115, 99, 97,112,101, 32,116,104,101,110, 13, 10, 9, 9, 9,114,101,116,117,114, -110, 13, 10, 9, 9,101,110,100, 13, 10, 13, 10, 9,101,110,100, 13, 10, 9, 13, - 10,101,110,100, 13, 10, 13, 10, 13, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, +111,110,116, 41, 13, 10, 9, 13, 10, 9,108,111,118,101, 46,103,114, 97,112,104, +105, 99,115, 46,115,101,116, 67,111,108,111,114, 40, 50, 53, 53, 44, 32, 50, 53, + 53, 44, 32, 50, 53, 53, 44, 32, 50, 53, 53, 41, 13, 10, 13, 10, 9,108,111, 99, + 97,108, 32,116,114, 97, 99,101, 32, 61, 32,100,101, 98,117,103, 46,116,114, 97, + 99,101, 98, 97, 99,107, 40, 41, 13, 10, 9, 13, 10, 9,108,111,118,101, 46,103, +114, 97,112,104,105, 99,115, 46, 99,108,101, 97,114, 40, 41, 13, 10, 9, 13, 10, + 9,108,111, 99, 97,108, 32,101,114,114, 32, 61, 32,123,125, 13, 10, 9, 13, 10, + 9,116, 97, 98,108,101, 46,105,110,115,101,114,116, 40,101,114,114, 44, 32, 34, + 69,114,114,111,114, 92,110, 34, 41, 13, 10, 9,116, 97, 98,108,101, 46,105,110, +115,101,114,116, 40,101,114,114, 44, 32,109,115,103, 46, 46, 34, 92,110, 92,110, + 34, 41, 13, 10, 9, 13, 10, 9,102,111,114, 32,108, 32,105,110, 32,115,116,114, +105,110,103, 46,103,109, 97,116, 99,104, 40,116,114, 97, 99,101, 44, 32, 34, 40, + 46, 45, 41, 92,110, 34, 41, 32,100,111, 13, 10, 9, 9,105,102, 32,110,111,116, + 32,115,116,114,105,110,103, 46,109, 97,116, 99,104, 40,108, 44, 32, 34, 98,111, +111,116, 46,108,117, 97, 34, 41, 32,116,104,101,110, 13, 10, 9, 9, 9,108, 32, + 61, 32,115,116,114,105,110,103, 46,103,115,117, 98, 40,108, 44, 32, 34,115,116, + 97, 99,107, 32,116,114, 97, 99,101, 98, 97, 99,107, 58, 34, 44, 32, 34, 84,114, + 97, 99,101, 98, 97, 99,107, 92,110, 34, 41, 13, 10, 9, 9, 9,116, 97, 98,108, +101, 46,105,110,115,101,114,116, 40,101,114,114, 44, 32,108, 41, 13, 10, 9, 9, +101,110,100, 13, 10, 9,101,110,100, 13, 10, 9, 13, 10, 9,108,111, 99, 97,108, + 32,112, 32, 61, 32,116, 97, 98,108,101, 46, 99,111,110, 99, 97,116, 40,101,114, +114, 44, 32, 34, 92,110, 34, 41, 13, 10, 9, 9, 13, 10, 9,112, 32, 61, 32,115, +116,114,105,110,103, 46,103,115,117, 98, 40,112, 44, 32, 34, 92,116, 34, 44, 32, + 34, 34, 41, 13, 10, 9,112, 32, 61, 32,115,116,114,105,110,103, 46,103,115,117, + 98, 40,112, 44, 32, 34, 37, 91,115,116,114,105,110,103, 32, 92, 34, 40, 46, 45, + 41, 92, 34, 37, 93, 34, 44, 32, 34, 37, 49, 34, 41, 13, 10, 9, 13, 10, 9,108, +111,118,101, 46,103,114, 97,112,104,105, 99,115, 46,112,114,105,110,116, 40,112, + 44, 32, 55, 48, 44, 32, 55, 48, 41, 9, 13, 10, 9, 13, 10, 9,108,111,118,101, + 46,103,114, 97,112,104,105, 99,115, 46,112,114,101,115,101,110,116, 40, 41, 13, + 10, 9, 9, 13, 10, 9,119,104,105,108,101, 32,116,114,117,101, 32,100,111, 13, + 10, 9, 9,101, 44, 32, 97, 44, 32, 98, 44, 32, 99, 32, 61, 32,108,111,118,101, + 46,101,118,101,110,116, 46,119, 97,105,116, 40, 41, 13, 10, 9, 9, 13, 10, 9, + 9,105,102, 32,101, 32, 61, 61, 32,108,111,118,101, 46,101,118,101,110,116, 95, +113,117,105,116, 32,116,104,101,110, 32,114,101,116,117,114,110, 32,101,110,100, + 13, 10, 9, 9,105,102, 32,101, 32, 61, 61, 32,108,111,118,101, 46,101,118,101, +110,116, 95,107,101,121,112,114,101,115,115,101,100, 32, 97,110,100, 32, 97, 32, + 61, 61, 32,108,111,118,101, 46,107,101,121, 95,101,115, 99, 97,112,101, 32,116, +104,101,110, 13, 10, 9, 9, 9,114,101,116,117,114,110, 13, 10, 9, 9,101,110, +100, 13, 10, 13, 10, 9,101,110,100, 13, 10, 9, 13, 10,101,110,100, 13, 10, 13, + 10, 13, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 13, 10, 45, 45, 32, 84,104,101, 32,114,111, -111,116, 32,111,102, 32, 97,108,108, 32, 99, 97,108,108,115, 46, 13, 10, 45, 45, + 45, 45, 13, 10, 45, 45, 32, 84,104,101, 32,114,111,111,116, 32,111,102, 32, 97, +108,108, 32, 99, 97,108,108,115, 46, 13, 10, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 13, 10, 13, - 10,102,117,110, 99,116,105,111,110, 32,101,114,114,111,114, 95,112,114,105,110, -116,101,114, 40,109,115,103, 41, 13, 10, 9,112,114,105,110,116, 40, 34, 98,111, -111,116, 34, 44, 32,109,115,103, 44, 32,100,101, 98,117,103, 46,116,114, 97, 99, -101, 98, 97, 99,107, 40, 41, 41, 13, 10,101,110,100, 13, 10, 13, 10,114,101,115, -117,108,116, 32, 61, 32,120,112, 99, 97,108,108, 40,108,111,118,101, 46, 98,111, -111,116, 44, 32,101,114,114,111,114, 95,112,114,105,110,116,101,114, 41, 13, 10, -114,101,115,117,108,116, 32, 61, 32,120,112, 99, 97,108,108, 40,108,111,118,101, - 46,105,110,105,116, 44, 32,101,114,114,111,114, 95,112,114,105,110,116,101,114, - 41, 13, 10,114,101,115,117,108,116, 32, 61, 32,120,112, 99, 97,108,108, 40,108, -111,118,101, 46,114,117,110, 44, 32,108,111,118,101, 46,101,114,114,104, 97,110, -100, 41, 13, 10, 13, 10,112,114,105,110,116, 40, 34, 68,111,110,101, 46, 34, 41, - + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 13, 10, 13, 10,102,117,110, 99,116,105, +111,110, 32,101,114,114,111,114, 95,112,114,105,110,116,101,114, 40,109,115,103, + 41, 13, 10, 9,112,114,105,110,116, 40, 34, 98,111,111,116, 34, 44, 32,109,115, +103, 44, 32,100,101, 98,117,103, 46,116,114, 97, 99,101, 98, 97, 99,107, 40, 41, + 41, 13, 10,101,110,100, 13, 10, 13, 10,114,101,115,117,108,116, 32, 61, 32,120, +112, 99, 97,108,108, 40,108,111,118,101, 46, 98,111,111,116, 44, 32,101,114,114, +111,114, 95,112,114,105,110,116,101,114, 41, 13, 10,114,101,115,117,108,116, 32, + 61, 32,120,112, 99, 97,108,108, 40,108,111,118,101, 46,105,110,105,116, 44, 32, +101,114,114,111,114, 95,112,114,105,110,116,101,114, 41, 13, 10,114,101,115,117, +108,116, 32, 61, 32,120,112, 99, 97,108,108, 40,108,111,118,101, 46,114,117,110, + 44, 32,108,111,118,101, 46,101,114,114,104, 97,110,100, 41, 13, 10, 13, 10,112, +114,105,110,116, 40, 34, 68,111,110,101, 46, 34, 41, }; if (luaL_loadbuffer(L,(const char*)B1,sizeof(B1),"boot.lua")==0) lua_call(L, 0, 0);