added WITHOUT_ODE make and compile flag

git-svn-id: svn://anubis/dwscr/trunk@87 5bef9df8-b654-44bb-925b-0ff18baa8f8c
This commit is contained in:
josh 2008-09-22 17:47:10 +00:00
parent ebb866d662
commit c2d694aa73
4 changed files with 31 additions and 2 deletions

View File

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

View File

@ -8,7 +8,9 @@
*/
#include <GL/gl.h>
#ifndef WITHOUT_ODE
#include <ode/ode.h>
#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()

View File

@ -8,24 +8,32 @@
#define LOGOBOX_H
#include <GL/gl.h>
#ifndef WITHOUT_ODE
#include <ode/ode.h>
#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

View File

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