]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - libs/entitylib.h
Fix/add grayscale-to-RGB in PNG loader
[xonotic/netradiant.git] / libs / entitylib.h
index 6b63174dcfd6f8bab4db59fe9f5203fe51038d5f..667adf7267cb8ad2360d360ee224822e25891ec5 100644 (file)
@@ -104,18 +104,19 @@ inline void aabb_testselect(const AABB& aabb, SelectionTest& test, SelectionInte
 
 inline void aabb_draw_wire(const Vector3 points[8])
 {
-  typedef std::size_t index_t;
-  index_t indices[24] = {
+  unsigned int indices[26] = {
     0, 1, 1, 2, 2, 3, 3, 0,
     4, 5, 5, 6, 6, 7, 7, 4,
     0, 4, 1, 5, 2, 6, 3, 7,
+    // 0, 6, 1, 7, 2, 4, 3, 5 // X cross
+    1, 7 // diagonal line (connect mins to maxs corner)
   };
 #if 1
   glVertexPointer(3, GL_FLOAT, 0, points);
-  glDrawElements(GL_LINES, sizeof(indices)/sizeof(index_t), GL_UNSIGNED_INT, indices);
+  glDrawElements(GL_LINES, sizeof(indices)/sizeof(indices[0]), GL_UNSIGNED_INT, indices);
 #else
   glBegin(GL_LINES);
-  for(std::size_t i = 0; i < sizeof(indices)/sizeof(index_t); ++i)
+  for(std::size_t i = 0; i < sizeof(indices)/sizeof(indices[0]); ++i)
   {
     glVertex3fv(points[indices[i]]);
   }