Commits

Alex Szpakowski committed c3d6941

Fixed Geometry:getVertexMap to return 1-based vertex indices and made it return the default vertex map instead of nil if no map is set.

Comments (0)

Files changed (2)

src/modules/graphics/opengl/Image.cpp

 	if (texture == 0)
 		return false;
 
-	if (gl.getMaxTextureSize())
-
 	while (glGetError() != GL_NO_ERROR); // clear errors
 
 	// We want this lock to potentially cover mipmap creation as well.
 
 	// A nice friendly checkerboard to signify invalid textures...
 	GLubyte px[] = {0xFF,0xFF,0xFF,0xFF, 0xC0,0xC0,0xC0,0xFF,
-					0xC0,0xC0,0xC0,0xFF, 0xFF,0xFF,0xFF,0xFF};
+	                0xC0,0xC0,0xC0,0xFF, 0xFF,0xFF,0xFF,0xFF};
 
 	glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, px);
 }

src/modules/graphics/opengl/wrap_Geometry.cpp

 	size_t elemcount = g->getElementCount();
 	const uint16 *elements = g->getElementArray();
 
-	if (elemcount == 0 || elements == 0)
-		return 0;
+	if (elemcount == 0)
+		elemcount = g->getVertexCount();
 
 	lua_createtable(L, elemcount, 0);
 	for (size_t i = 0; i < elemcount; i++)
 	{
-		lua_pushinteger(L, elements[i]);
+		if (elements)
+			lua_pushinteger(L, elements[i] + 1);
+		else
+			lua_pushinteger(L, i + 1);
+
 		lua_rawseti(L, -2, i + 1);
 	}
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.