Commits

Alex Szpakowski committed 19c2a11

Fixed Geometry:flip when the Geometry was created with newQuad (resolves issue #671)

Comments (0)

Files changed (4)

platform/macosx/love-framework.xcodeproj/project.pbxproj

 		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 */; };
 		FA636D89171B70920065623F /* RandomGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RandomGenerator.h; sourceTree = "<group>"; };
 		FA636D8C171B72A70065623F /* wrap_RandomGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_RandomGenerator.cpp; sourceTree = "<group>"; };
 		FA636D8D171B72A70065623F /* wrap_RandomGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_RandomGenerator.h; sourceTree = "<group>"; };
+		FA7175A9178E8418001FE7FE /* lua.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lua.h; sourceTree = "<group>"; };
 		FA7C937516DCC6C2006F2BEE /* wrap_Math.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Math.cpp; sourceTree = "<group>"; };
 		FA7C937616DCC6C2006F2BEE /* wrap_Math.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Math.h; sourceTree = "<group>"; };
 		FA9FC0AE173D6E3E005027FF /* wrap_Window.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Window.cpp; sourceTree = "<group>"; };
 		1350109F709C227D4AFD423C /* libluasocket */ = {
 			isa = PBXGroup;
 			children = (
+				FA7175A9178E8418001FE7FE /* lua.h */,
 				1CD02D1975803957282F28AB /* auxiliar.c */,
 				1F6F652A57F8098E5CCA6F9A /* auxiliar.h */,
 				21B25A7E333315172B754D4F /* buffer.c */,
 				FA5FDC851788D548002F0ED2 /* utility.h in Headers */,
 				FA5FDC861788D548002F0ED2 /* win32.h in Headers */,
 				FA5FDC8F1788D548002F0ED2 /* lua-enet.h in Headers */,
+				FA7175AA178E8418001FE7FE /* lua.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

src/modules/graphics/Geometry.cpp

 	, 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)
 {

src/modules/graphics/opengl/Shader.cpp

 	{
 		std::string warnings = getProgramWarnings();
 		glDeleteProgram(program);
+		program = 0;
 
 		throw love::Exception("Cannot link shader program object:\n%s", warnings.c_str());
 	}
 		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)
 void Shader::attach(bool temporary)
 {
 	if (current != this)
+	{
 		glUseProgram(program);
-
-	current = this;
+		current = this;
+	}
 
 	if (!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);
 	}
 }

src/modules/graphics/opengl/wrap_Graphics.cpp

 		{
 			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
 		{