Cleaned up the box2d patch a bit so that it should be ok to upstream now.

This commit is contained in:
Scott McCreary
2010-09-21 21:06:10 +00:00
parent c1a6f708d8
commit e95118f7fc
2 changed files with 37 additions and 32 deletions

View File

@@ -17,4 +17,4 @@ INSTALL {
make install
}
LICENSE="MIT"
#COPYRIGHT=""
COPYRIGHT="2007-2009 Erin Catto"

View File

@@ -1,56 +1,61 @@
diff -urN Box2D_v2.1.2/Box2D/CMakeLists.txt Box2D_v2.1.2-haiku/Box2D/CMakeLists.txt
--- Box2D_v2.1.2/Box2D/CMakeLists.txt 2010-04-03 11:10:30.046661632 +0000
+++ Box2D_v2.1.2-haiku/Box2D/CMakeLists.txt 2010-09-21 12:18:05.000000000 +0000
@@ -26,11 +26,15 @@
@@ -26,7 +26,9 @@
# Testbed and dependencies.
find_package(OpenGL REQUIRED)
+if(HAIKU)
+ # Haiku has glut, so no need for freeglut
+else(HAIKU)
+if(NOT HAIKU) # Haiku has glut, so no need for freeglut
add_subdirectory(freeglut)
+endif(HAIKU)
+endif(NOT HAIKU)
add_subdirectory(glui)
add_subdirectory(Testbed)
endif(BOX2D_BUILD_EXAMPLES)
if(BOX2D_INSTALL_DOC)
install(DIRECTORY Documentation DESTINATION share/doc/Box2D PATTERN ".svn" EXCLUDE)
-endif(BOX2D_INSTALL_DOC)
\ No newline at end of file
+endif(BOX2D_INSTALL_DOC)
diff -urN Box2D_v2.1.2/Box2D/Testbed/CMakeLists.txt Box2D_v2.1.2-haiku/Box2D/Testbed/CMakeLists.txt
--- Box2D_v2.1.2/Box2D/Testbed/CMakeLists.txt 2010-04-04 11:07:26.031457280 +0000
+++ Box2D_v2.1.2-haiku/Box2D/Testbed/CMakeLists.txt 2010-09-21 11:32:14.000000000 +0000
@@ -75,7 +75,6 @@
target_link_libraries (
Testbed
Box2D
--- Box2D_v2.1.2/Box2D/Testbed/CMakeLists.txt 2010-04-04 11:07:26.007077888 +0000
+++ Box2D_v2.1.2-haiku/Box2D/Testbed/CMakeLists.txt 2010-09-21 13:44:55.000000000 +0000
@@ -72,10 +72,19 @@
${Testbed_Tests_SRCS}
)
-target_link_libraries (
- Testbed
- Box2D
- freeglut_static
glui
${OPENGL_LIBRARIES}
- glui
- ${OPENGL_LIBRARIES}
+if(HAIKU) # Haiku has glut, so no need for freeglut
+ target_link_libraries (
+ Testbed
+ Box2D
+ glui
+ ${OPENGL_LIBRARIES}
+)
+else(HAIKU)
+ target_link_libraries (
+ Testbed
+ Box2D
+ freeglut_static
+ glui
+ ${OPENGL_LIBRARIES}
)
+endif(HAIKU)
\ No newline at end of file
diff -urN Box2D_v2.1.2/Box2D/Testbed/Framework/Render.cpp Box2D_v2.1.2-haiku/Box2D/Testbed/Framework/Render.cpp
--- Box2D_v2.1.2/Box2D/Testbed/Framework/Render.cpp 2010-02-01 02:12:46.031719424 +0000
+++ Box2D_v2.1.2-haiku/Box2D/Testbed/Framework/Render.cpp 2010-09-21 11:29:02.000000000 +0000
@@ -18,12 +18,16 @@
@@ -18,7 +18,11 @@
#include "Render.h"
+#ifdef __HAIKU__
+#include "GL/glut.h"
+#include <GL/glut.h>
+#else
#include "freeglut/GL/glut.h"
+#endif
#include <cstdio>
#include <cstdarg>
-#include <cstring>
+#include <cstring>
void DebugDraw::DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color)
{
diff -urN Box2D_v2.1.2/Box2D/Testbed/Framework/Test.cpp Box2D_v2.1.2-haiku/Box2D/Testbed/Framework/Test.cpp
--- Box2D_v2.1.2/Box2D/Testbed/Framework/Test.cpp 2010-02-14 12:15:52.031719424 +0000
+++ Box2D_v2.1.2-haiku/Box2D/Testbed/Framework/Test.cpp 2010-09-21 11:28:49.000000000 +0000
@@ -59,8 +64,8 @@ diff -urN Box2D_v2.1.2/Box2D/Testbed/Framework/Test.cpp Box2D_v2.1.2-haiku/Box2D
#include "Render.h"
+#ifdef __HAIKU__
+#include "GL/glut.h"
+#elif
+#include <GL/glut.h>
+#else
#include "freeglut/GL/glut.h"
+#endif
@@ -74,8 +79,8 @@ diff -urN Box2D_v2.1.2/Box2D/Testbed/Tests/TestEntries.cpp Box2D_v2.1.2-haiku/Bo
#include "../Framework/Test.h"
#include "../Framework/Render.h"
+#ifdef __HAIKU__
+#include "GL/glut.h"
+#elif
+#include <GL/glut.h>
+#else
#include "../../freeglut/GL/glut.h"
+#endif
#include <cstring>