From c2d694aa7389988996d4d6efb9f2ee034f6357a0 Mon Sep 17 00:00:00 2001 From: josh Date: Mon, 22 Sep 2008 17:47:10 +0000 Subject: [PATCH] added WITHOUT_ODE make and compile flag git-svn-id: svn://anubis/dwscr/trunk@87 5bef9df8-b654-44bb-925b-0ff18baa8f8c --- Makefile | 13 +++++++++++-- ss/LogoBox.cpp | 10 ++++++++++ ss/LogoBox.h | 8 ++++++++ ss/Makefile | 2 ++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 64a535b..a394d6d 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,9 @@ endif ifdef WINDOW_MODE CPPFLAGS += -DWINDOW_MODE endif +ifdef WITHOUT_ODE +CPPFLAGS += -DWITHOUT_ODE +endif ifdef WIN32 export CP := copy export MV := rename @@ -25,8 +28,14 @@ export CC := mingw32-gcc export CXX := mingw32-g++ SDL_BASE := C:\apps\SDL-1.2.13 ODE_BASE := C:\apps\ode-0.9 -export CPPFLAGS += -I$(SDL_BASE)\include -I$(ODE_BASE)\include -D_GNU_SOURCE=1 -Dmain=SDL_main -LDFLAGS += -L$(SDL_BASE)\lib -L$(ODE_BASE)\lib\releasedll -lopengl32 -lglu32 -lmingw32 -mwindows -lSDLmain -lSDL -lode +export CPPFLAGS += -I$(SDL_BASE)\include -D_GNU_SOURCE=1 -Dmain=SDL_main +ifndef WITHOUT_ODE +export CPPFLAGS += -i$(ODE_BASE)\include +endif +LDFLAGS += -L$(SDL_BASE)\lib -lopengl32 -lglu32 -lmingw32 -mwindows -lSDLmain -lSDL +ifndef WITHOUT_ODE +LDFLAGS += -L$(ODE_BASE)\lib\releasedll -lode +endif TARGET := $(TARGET).exe SSNAME := dwscr.scr INSTALLDIR := C:\WINDOWS diff --git a/ss/LogoBox.cpp b/ss/LogoBox.cpp index 05d9671..fc766a9 100644 --- a/ss/LogoBox.cpp +++ b/ss/LogoBox.cpp @@ -8,7 +8,9 @@ */ #include +#ifndef WITHOUT_ODE #include +#endif #include "../wfobj/WFObj.hh" #include "LogoBox.h" #include "../LoadFile/LoadFile.h" @@ -28,7 +30,11 @@ static GLuint _drawList; * initializes an ODE body and geometry for each * constructed logo. */ +#ifndef WITHOUT_ODE LogoBox::LogoBox(dWorldID world, dSpaceID space) +#else +LogoBox::LogoBox() +#endif { if (_logoList == 0) { @@ -52,6 +58,7 @@ LogoBox::LogoBox(dWorldID world, dSpaceID space) } } +#ifndef WITHOUT_ODE m_body = 0; m_geom = 0; @@ -69,11 +76,13 @@ LogoBox::LogoBox(dWorldID world, dSpaceID space) dGeomSetBody(m_geom, m_body); } } +#endif } /* Clean up ODE resources */ LogoBox::~LogoBox() { +#ifndef WITHOUT_ODE if (m_geom) { dGeomDestroy(m_geom); @@ -82,6 +91,7 @@ LogoBox::~LogoBox() { dBodyDestroy(m_body); } +#endif } void LogoBox::draw() diff --git a/ss/LogoBox.h b/ss/LogoBox.h index 07bc93f..1391545 100644 --- a/ss/LogoBox.h +++ b/ss/LogoBox.h @@ -8,24 +8,32 @@ #define LOGOBOX_H #include +#ifndef WITHOUT_ODE #include +#endif class LogoBox { public: +#ifndef WITHOUT_ODE LogoBox(dWorldID world = 0, dSpaceID space = 0); +#else + LogoBox(); +#endif ~LogoBox(); void draw(); const float * const getAABB() const; float getWidth() const; float getHeight() const; float getDepth() const; +#ifndef WITHOUT_ODE dBodyID getBody() { return m_body; } dGeomID getGeom() { return m_geom; } protected: dBodyID m_body; dGeomID m_geom; +#endif }; #endif diff --git a/ss/Makefile b/ss/Makefile index 156aa1b..9755a2d 100644 --- a/ss/Makefile +++ b/ss/Makefile @@ -3,8 +3,10 @@ OBJS := SSMain.o OBJS += SSMode.o OBJS += LogoBox.o OBJS += PlainSpin.o +ifndef WITHOUT_ODE OBJS += TumblingLogos.o OBJS += Towers.o +endif AROBJS := $(foreach o,$(OBJS),ss.a($(o))) all: ss.a