diff --git a/platform/macosx/love-framework.xcodeproj/project.pbxproj b/platform/macosx/love-framework.xcodeproj/project.pbxproj index 6cce644af..812db9cda 100644 --- a/platform/macosx/love-framework.xcodeproj/project.pbxproj +++ b/platform/macosx/love-framework.xcodeproj/project.pbxproj @@ -246,6 +246,7 @@ FA636D8B171B70920065623F /* RandomGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FA636D89171B70920065623F /* RandomGenerator.h */; }; FA636D8E171B72A70065623F /* wrap_RandomGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA636D8C171B72A70065623F /* wrap_RandomGenerator.cpp */; }; FA636D8F171B72A70065623F /* wrap_RandomGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = FA636D8D171B72A70065623F /* wrap_RandomGenerator.h */; }; + FA7175AA178E8418001FE7FE /* lua.h in Headers */ = {isa = PBXBuildFile; fileRef = FA7175A9178E8418001FE7FE /* lua.h */; }; FA7C937A16DCC6C2006F2BEE /* wrap_Math.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA7C937516DCC6C2006F2BEE /* wrap_Math.cpp */; }; FA7C937B16DCC6C2006F2BEE /* wrap_Math.h in Headers */ = {isa = PBXBuildFile; fileRef = FA7C937616DCC6C2006F2BEE /* wrap_Math.h */; }; FA9FC0B0173D6E3E005027FF /* wrap_Window.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FA9FC0AE173D6E3E005027FF /* wrap_Window.cpp */; }; @@ -767,6 +768,7 @@ FA636D89171B70920065623F /* RandomGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RandomGenerator.h; sourceTree = ""; }; FA636D8C171B72A70065623F /* wrap_RandomGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_RandomGenerator.cpp; sourceTree = ""; }; FA636D8D171B72A70065623F /* wrap_RandomGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_RandomGenerator.h; sourceTree = ""; }; + FA7175A9178E8418001FE7FE /* lua.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua.h; sourceTree = ""; }; FA7C937516DCC6C2006F2BEE /* wrap_Math.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Math.cpp; sourceTree = ""; }; FA7C937616DCC6C2006F2BEE /* wrap_Math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Math.h; sourceTree = ""; }; FA9FC0AE173D6E3E005027FF /* wrap_Window.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Window.cpp; sourceTree = ""; }; @@ -960,6 +962,7 @@ 1350109F709C227D4AFD423C /* libluasocket */ = { isa = PBXGroup; children = ( + FA7175A9178E8418001FE7FE /* lua.h */, 1CD02D1975803957282F28AB /* auxiliar.c */, 1F6F652A57F8098E5CCA6F9A /* auxiliar.h */, 21B25A7E333315172B754D4F /* buffer.c */, @@ -1858,6 +1861,7 @@ FA5FDC851788D548002F0ED2 /* utility.h in Headers */, FA5FDC861788D548002F0ED2 /* win32.h in Headers */, FA5FDC8F1788D548002F0ED2 /* lua-enet.h in Headers */, + FA7175AA178E8418001FE7FE /* lua.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/src/modules/graphics/Geometry.cpp b/src/modules/graphics/Geometry.cpp index b31cfbe49..bf69c0505 100644 --- a/src/modules/graphics/Geometry.cpp +++ b/src/modules/graphics/Geometry.cpp @@ -77,10 +77,10 @@ Geometry::Geometry(float x, float y, float w, float h, float sw, float sh) , vertexCount(4) , elementArray(NULL) , elementCount(0) - , x_min(x) - , x_max(x+w) - , y_min(y) - , y_max(y+h) + , x_min(0) + , x_max(w) + , y_min(0) + , y_max(h) , vertexColors(false) , drawMode(DRAW_MODE_FAN) { diff --git a/src/modules/graphics/opengl/Shader.cpp b/src/modules/graphics/opengl/Shader.cpp index d391be507..d4f4e61a9 100644 --- a/src/modules/graphics/opengl/Shader.cpp +++ b/src/modules/graphics/opengl/Shader.cpp @@ -184,6 +184,7 @@ void Shader::createProgram(const std::vector &shaderids) { std::string warnings = getProgramWarnings(); glDeleteProgram(program); + program = 0; throw love::Exception("Cannot link shader program object:\n%s", warnings.c_str()); } @@ -265,9 +266,10 @@ void Shader::unloadVolatile() glUseProgram(0); if (program != 0) + { glDeleteProgram(program); - - program = 0; + program = 0; + } // decrement global texture id counters for texture units which had textures bound from this shader for (size_t i = 0; i < activeTextureUnits.size(); ++i) @@ -324,9 +326,10 @@ std::string Shader::getWarnings() const void Shader::attach(bool temporary) { if (current != this) + { glUseProgram(program); - - current = this; + current = this; + } if (!temporary) { @@ -337,6 +340,8 @@ void Shader::attach(bool temporary) if (activeTextureUnits[i] > 0) gl.bindTextureToUnit(activeTextureUnits[i], i + 1, false); } + + // We always want to use texture unit 0 for everyhing else. gl.setActiveTextureUnit(0); } } diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index a90639be6..d66988fe7 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -319,7 +319,7 @@ int w_newGeometry(lua_State *L) { lua_rawgeti(L, 1, i+1); if (!lua_istable(L, -1)) - return luaL_typerror(L, 1, "table of tables"); + return luax_typerror(L, 1, "table of tables"); } else {