Skip to content

Commit

Permalink
seperate the objectviewer from the debug define, and enable it by def…
Browse files Browse the repository at this point in the history
…ault
  • Loading branch information
robn committed Apr 29, 2011
1 parent 764a1a8 commit 7623e35
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/GeoSphere.h
Expand Up @@ -28,7 +28,7 @@ class GeoSphere {
// only called from fishy thread
void _UpdateLODs();
friend class GeoPatch;
#ifdef DEBUG
#if OBJECTVIEWER
friend class ObjectViewerView;
#endif /* DEBUG */
static void Init();
Expand Down
2 changes: 1 addition & 1 deletion src/ObjectViewerView.cpp
Expand Up @@ -8,7 +8,7 @@
#include "GeoSphereStyle.h"
#include "Planet.h"

#ifdef DEBUG
#if OBJECTVIEWER

ObjectViewerView::ObjectViewerView(): View()
{
Expand Down
4 changes: 2 additions & 2 deletions src/ObjectViewerView.h
@@ -1,12 +1,12 @@
#ifndef _OBJECTVIEWERVIEW_H
#define _OBJECTVIEWERVIEW_H

#ifdef DEBUG

#include "libs.h"
#include "Gui.h"
#include "View.h"

#if OBJECTVIEWER

class Body;

class ObjectViewerView: public View {
Expand Down
10 changes: 6 additions & 4 deletions src/Pi.cpp
Expand Up @@ -130,7 +130,7 @@ const char * const Pi::combatRating[] = {
"ELITE"
};

#ifdef DEBUG
#if OBJECTVIEWER
ObjectViewerView *Pi::objectViewerView;
#endif

Expand Down Expand Up @@ -611,10 +611,12 @@ void Pi::HandleEvents()
}
break;
}
#endif /* DEBUG */
#if OBJECTVIEWER
case SDLK_F10:
Pi::SetView(Pi::objectViewerView);
break;
#endif /* DEBUG */
#endif
case SDLK_F11:
// XXX only works on X11
//SDL_WM_ToggleFullScreen(Pi::scrSurface);
Expand Down Expand Up @@ -820,7 +822,7 @@ void Pi::InitGame()
spaceStationView = new SpaceStationView();
infoView = new InfoView();

#ifdef DEBUG
#if OBJECTVIEWER
objectViewerView = new ObjectViewerView();
#endif

Expand Down Expand Up @@ -860,7 +862,7 @@ void Pi::UninitGame()
AmbientSounds::Uninit();
Sound::DestroyAllEvents();

#ifdef DEBUG
#if OBJECTVIEWER
delete objectViewerView;
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/Pi.h
Expand Up @@ -32,7 +32,7 @@ class SBodyPath;
class GameMenuView;
struct lua_State;

#ifdef DEBUG
#if OBJECTVIEWER
class ObjectViewerView;
#endif

Expand Down Expand Up @@ -144,7 +144,7 @@ class Pi {
static StarSystem *currentSystem;
static lua_State *luaPersistent;

#ifdef DEBUG
#if OBJECTVIEWER
static ObjectViewerView *objectViewerView;
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/Planet.h
Expand Up @@ -27,9 +27,9 @@ class Planet: public Body {
void GetAtmosphericState(double dist, double *outPressure, double *outDensity);
bool IsSuperType(SBody::BodySuperType t) const;
virtual const SBody *GetSBody() const { return sbody; }
#ifdef DEBUG
#if OBJECTVIEWER
friend class ObjectViewerView;
#endif /* DEBUG */
#endif
protected:
virtual void Save(Serializer::Writer &wr);
virtual void Load(Serializer::Reader &rd);
Expand Down
5 changes: 5 additions & 0 deletions src/libs.h
Expand Up @@ -12,6 +12,11 @@
#include <time.h>
#include <stdarg.h>

// define to include the object viewer in the build
#ifndef OBJECTVIEWER
#define OBJECTVIEWER 1
#endif

/* on unix this would probably become $PREFIX/pioneer */
#ifndef PIONEER_DATA_DIR
#define PIONEER_DATA_DIR "data"
Expand Down

0 comments on commit 7623e35

Please sign in to comment.