[Orxonox-commit 169] r2848 - in branches/gui/src: core network network/packet network/synchronisable orxonox orxonox/gamestates orxonox/objects orxonox/objects/controllers orxonox/objects/gametypes orxonox/objects/infos orxonox/objects/items orxonox/objects/weaponSystem/projectiles orxonox/objects/worldentities orxonox/objects/worldentities/pawns orxonox/objects/worldentities/triggers orxonox/overlays orxonox/tools
rgrieder at orxonox.net
rgrieder at orxonox.net
Wed Mar 25 19:37:01 CET 2009
Author: rgrieder
Date: 2009-03-25 18:37:00 +0000 (Wed, 25 Mar 2009)
New Revision: 2848
Added:
branches/gui/src/core/GameMode.cc
branches/gui/src/core/GameMode.h
Modified:
branches/gui/src/core/CMakeLists.txt
branches/gui/src/core/Core.cc
branches/gui/src/core/Core.h
branches/gui/src/network/ClientConnectionListener.cc
branches/gui/src/network/packet/Gamestate.cc
branches/gui/src/network/synchronisable/SynchronisableVariable.cc
branches/gui/src/orxonox/CameraManager.cc
branches/gui/src/orxonox/GraphicsManager.cc
branches/gui/src/orxonox/PlayerManager.cc
branches/gui/src/orxonox/gamestates/GSClient.cc
branches/gui/src/orxonox/gamestates/GSDedicated.cc
branches/gui/src/orxonox/gamestates/GSGUI.cc
branches/gui/src/orxonox/gamestates/GSGraphics.cc
branches/gui/src/orxonox/gamestates/GSLevel.cc
branches/gui/src/orxonox/gamestates/GSRoot.cc
branches/gui/src/orxonox/gamestates/GSServer.cc
branches/gui/src/orxonox/gamestates/GSStandalone.cc
branches/gui/src/orxonox/objects/Scene.cc
branches/gui/src/orxonox/objects/controllers/AIController.cc
branches/gui/src/orxonox/objects/gametypes/Gametype.cc
branches/gui/src/orxonox/objects/infos/Bot.cc
branches/gui/src/orxonox/objects/infos/HumanPlayer.cc
branches/gui/src/orxonox/objects/items/MultiStateEngine.cc
branches/gui/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.cc
branches/gui/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.cc
branches/gui/src/orxonox/objects/weaponSystem/projectiles/Projectile.cc
branches/gui/src/orxonox/objects/worldentities/Backlight.cc
branches/gui/src/orxonox/objects/worldentities/Billboard.cc
branches/gui/src/orxonox/objects/worldentities/BlinkingBillboard.cc
branches/gui/src/orxonox/objects/worldentities/ControllableEntity.cc
branches/gui/src/orxonox/objects/worldentities/ExplosionChunk.cc
branches/gui/src/orxonox/objects/worldentities/Light.cc
branches/gui/src/orxonox/objects/worldentities/Model.cc
branches/gui/src/orxonox/objects/worldentities/MovableEntity.cc
branches/gui/src/orxonox/objects/worldentities/ParticleEmitter.cc
branches/gui/src/orxonox/objects/worldentities/pawns/Pawn.cc
branches/gui/src/orxonox/objects/worldentities/pawns/Spectator.cc
branches/gui/src/orxonox/objects/worldentities/triggers/Trigger.cc
branches/gui/src/orxonox/overlays/OrxonoxOverlay.cc
branches/gui/src/orxonox/tools/BillboardSet.cc
branches/gui/src/orxonox/tools/Mesh.cc
branches/gui/src/orxonox/tools/ParticleInterface.cc
branches/gui/src/orxonox/tools/Shader.cc
Log:
Exported showsGraphics, etc. to a new class named GameMode in the core.
Modified: branches/gui/src/core/CMakeLists.txt
===================================================================
--- branches/gui/src/core/CMakeLists.txt 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/core/CMakeLists.txt 2009-03-25 18:37:00 UTC (rev 2848)
@@ -24,6 +24,7 @@
Core.cc
Event.cc
Game.cc
+ GameMode.cc
GameState.cc
Language.cc
LuaBind.cc
Modified: branches/gui/src/core/Core.cc
===================================================================
--- branches/gui/src/core/Core.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/core/Core.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -80,12 +80,6 @@
static boost::filesystem::path configPath_g; //!< Path to the config file folder
static boost::filesystem::path logPath_g; //!< Path to the log file folder
- bool Core::bShowsGraphics_s = false;
- bool Core::bHasServer_s = false;
- bool Core::bIsClient_s = false;
- bool Core::bIsStandalone_s = false;
- bool Core::bIsMaster_s = false;
-
Core* Core::singletonRef_s = 0;
SetCommandLineArgument(mediaPath, "").information("PATH");
Modified: branches/gui/src/core/Core.h
===================================================================
--- branches/gui/src/core/Core.h 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/core/Core.h 2009-03-25 18:37:00 UTC (rev 2848)
@@ -82,18 +82,6 @@
static std::string getConfigPathString();
static std::string getLogPathString();
- // fast access global variables.
- static bool showsGraphics() { return bShowsGraphics_s; }
- static bool hasServer() { return bHasServer_s; }
- static bool isClient() { return bIsClient_s; }
- static bool isStandalone() { return bIsStandalone_s; }
- static bool isMaster() { return bIsMaster_s; }
- static void setShowsGraphics(bool val) { bShowsGraphics_s = val; updateIsMaster(); }
- static void setHasServer (bool val) { bHasServer_s = val; updateIsMaster(); }
- static void setIsClient (bool val) { bIsClient_s = val; updateIsMaster(); }
- static void setIsStandalone (bool val) { bIsStandalone_s = val; updateIsMaster(); }
- static void updateIsMaster () { bIsMaster_s = (bHasServer_s || bIsStandalone_s); }
-
private:
Core(const Core&);
@@ -128,12 +116,6 @@
bool isDevBuild_; //!< True for builds in the build directory (not installed)
bool loaded_; //!< Only true if constructor was interrupted
- static bool bShowsGraphics_s; //!< global variable that tells whether to show graphics
- static bool bHasServer_s; //!< global variable that tells whether this is a server
- static bool bIsClient_s;
- static bool bIsStandalone_s;
- static bool bIsMaster_s;
-
static Core* singletonRef_s;
};
}
Copied: branches/gui/src/core/GameMode.cc (from rev 2843, branches/gui/src/core/Core.cc)
===================================================================
--- branches/gui/src/core/GameMode.cc (rev 0)
+++ branches/gui/src/core/GameMode.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -0,0 +1,43 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Reto Grieder
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file
+ @brief Implementation of the GameMode class.
+*/
+
+#include "GameMode.h"
+
+namespace orxonox
+{
+ bool GameMode::bShowsGraphics_s = false;
+ bool GameMode::bHasServer_s = false;
+ bool GameMode::bIsClient_s = false;
+ bool GameMode::bIsStandalone_s = false;
+ bool GameMode::bIsMaster_s = false;
+}
Copied: branches/gui/src/core/GameMode.h (from rev 2843, branches/gui/src/core/Core.h)
===================================================================
--- branches/gui/src/core/GameMode.h (rev 0)
+++ branches/gui/src/core/GameMode.h 2009-03-25 18:37:00 UTC (rev 2848)
@@ -0,0 +1,68 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Reto Grieder
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file
+ @brief Declaration of the GameMode class.
+*/
+
+#ifndef _GameMode_H__
+#define _GameMode_H__
+
+#include "CorePrereqs.h"
+
+namespace orxonox
+{
+ class _CoreExport GameMode
+ {
+ public:
+ static bool showsGraphics() { return bShowsGraphics_s; }
+ static bool hasServer() { return bHasServer_s; }
+ static bool isClient() { return bIsClient_s; }
+ static bool isStandalone() { return bIsStandalone_s; }
+ static bool isMaster() { return bIsMaster_s; }
+ static void setShowsGraphics(bool val) { bShowsGraphics_s = val; updateIsMaster(); }
+ static void setHasServer (bool val) { bHasServer_s = val; updateIsMaster(); }
+ static void setIsClient (bool val) { bIsClient_s = val; updateIsMaster(); }
+ static void setIsStandalone (bool val) { bIsStandalone_s = val; updateIsMaster(); }
+ static void updateIsMaster () { bIsMaster_s = (bHasServer_s || bIsStandalone_s); }
+
+ private:
+ GameMode();
+ GameMode(const GameMode& inst);
+ ~GameMode();
+
+ static bool bShowsGraphics_s; //!< global variable that tells whether to show graphics
+ static bool bHasServer_s; //!< global variable that tells whether this is a server
+ static bool bIsClient_s;
+ static bool bIsStandalone_s;
+ static bool bIsMaster_s;
+ };
+}
+
+#endif /* _GameMode_H__ */
Modified: branches/gui/src/network/ClientConnectionListener.cc
===================================================================
--- branches/gui/src/network/ClientConnectionListener.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/network/ClientConnectionListener.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -28,7 +28,7 @@
#include "ClientConnectionListener.h"
#include "core/CoreIncludes.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
namespace orxonox{
@@ -38,7 +38,7 @@
}
void ClientConnectionListener::getConnectedClients(){
- if(Core::showsGraphics())
+ if(GameMode::showsGraphics())
this->clientConnected(0); //server client id
ClientInformation *client = ClientInformation::getBegin();
while(client){
Modified: branches/gui/src/network/packet/Gamestate.cc
===================================================================
--- branches/gui/src/network/packet/Gamestate.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/network/packet/Gamestate.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -33,7 +33,7 @@
#include "../GamestateHandler.h"
#include "../synchronisable/Synchronisable.h"
#include "../TrafficControl.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "core/Iterator.h"
@@ -161,7 +161,7 @@
s = Synchronisable::getSynchronisable( objectheader.getObjectID() );
if(!s)
{
- if (!Core::isMaster())
+ if (!GameMode::isMaster())
{
Synchronisable::fabricate(mem, mode);
}
Modified: branches/gui/src/network/synchronisable/SynchronisableVariable.cc
===================================================================
--- branches/gui/src/network/synchronisable/SynchronisableVariable.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/network/synchronisable/SynchronisableVariable.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -29,7 +29,7 @@
#include "SynchronisableVariable.h"
#include <cstring>
#include "util/Math.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
namespace orxonox{
@@ -40,7 +40,7 @@
{
if ( state_ == 0x0 )
{
- state_ = Core::isMaster() ? 0x1 : 0x2; // set the appropriate mode here
+ state_ = GameMode::isMaster() ? 0x1 : 0x2; // set the appropriate mode here
}
}
Modified: branches/gui/src/orxonox/CameraManager.cc
===================================================================
--- branches/gui/src/orxonox/CameraManager.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/CameraManager.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -34,7 +34,7 @@
#include <OgreCompositorManager.h>
#include <OgreResource.h>
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/Iterator.h"
#include "objects/worldentities/Camera.h"
#include "objects/Scene.h"
@@ -74,7 +74,7 @@
void CameraManager::requestFocus(Camera* camera)
{
- if (!Core::showsGraphics())
+ if (!GameMode::showsGraphics())
return;
// notify old camera (if it exists)
@@ -99,7 +99,7 @@
void CameraManager::releaseFocus(Camera* camera)
{
- if (!Core::showsGraphics())
+ if (!GameMode::showsGraphics())
return;
// notify the cam of releasing the focus
Modified: branches/gui/src/orxonox/GraphicsManager.cc
===================================================================
--- branches/gui/src/orxonox/GraphicsManager.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/GraphicsManager.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -61,6 +61,7 @@
#include "core/ConfigValueIncludes.h"
#include "core/CoreIncludes.h"
#include "core/Core.h"
+#include "core/GameMode.h"
#include "tools/WindowEventListener.h"
#include "tools/ParticleInterface.h"
@@ -101,8 +102,6 @@
void GraphicsManager::initialise()
{
- Core::setShowsGraphics(true);
-
// Ogre setup procedure
setupOgre();
// load all the required plugins for Ogre
@@ -155,9 +154,6 @@
this->ogreLogger_->getDefaultLog()->removeListener(this);
this->ogreLogger_->destroyLog(Ogre::LogManager::getSingleton().getDefaultLog());
delete this->ogreLogger_;
-
- // Don't showing graphics anymore
- Core::setShowsGraphics(false);
}
assert(singletonRef_s);
Modified: branches/gui/src/orxonox/PlayerManager.cc
===================================================================
--- branches/gui/src/orxonox/PlayerManager.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/PlayerManager.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -30,7 +30,7 @@
#include "PlayerManager.h"
#include "LevelManager.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "objects/Level.h"
#include "objects/infos/HumanPlayer.h"
@@ -57,7 +57,7 @@
void PlayerManager::clientConnected(unsigned int clientID)
{
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
COUT(3) << "client connected" << std::endl;
@@ -76,7 +76,7 @@
void PlayerManager::clientDisconnected(unsigned int clientID)
{
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
COUT(3) << "client disconnected" << std::endl;
@@ -96,7 +96,7 @@
PlayerInfo* PlayerManager::getClient(unsigned int clientID) const
{
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
std::map<unsigned int, PlayerInfo*>::const_iterator it = this->clients_.find(clientID);
if (it != this->clients_.end())
Modified: branches/gui/src/orxonox/gamestates/GSClient.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSClient.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/gamestates/GSClient.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -32,9 +32,9 @@
#include "core/input/InputManager.h"
#include "core/Clock.h"
#include "core/CommandLine.h"
-#include "core/Core.h"
+#include "core/Game.h"
+#include "core/GameMode.h"
#include "network/Client.h"
-#include "core/Game.h"
namespace orxonox
{
@@ -54,7 +54,7 @@
void GSClient::activate()
{
- Core::setIsClient(true);
+ GameMode::setIsClient(true);
this->client_ = new Client(CommandLine::getValue("ip").getString(), CommandLine::getValue("port"));
@@ -71,7 +71,7 @@
// destroy client
delete this->client_;
- Core::setIsClient(false);
+ GameMode::setIsClient(false);
}
void GSClient::update(const Clock& time)
Modified: branches/gui/src/orxonox/gamestates/GSDedicated.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSDedicated.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/gamestates/GSDedicated.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -31,12 +31,12 @@
#include "core/Clock.h"
#include "core/CommandLine.h"
-#include "core/Core.h"
+#include "core/Game.h"
+#include "core/GameMode.h"
#include "core/Iterator.h"
#include "network/Server.h"
#include "objects/Tickable.h"
#include "util/Sleep.h"
-#include "core/Game.h"
namespace orxonox
{
@@ -55,7 +55,7 @@
void GSDedicated::activate()
{
- Core::setHasServer(true);
+ GameMode::setHasServer(true);
this->server_ = new Server(CommandLine::getValue("port"));
COUT(0) << "Loading scene in server mode" << std::endl;
@@ -68,7 +68,7 @@
this->server_->close();
delete this->server_;
- Core::setHasServer(false);
+ GameMode::setHasServer(false);
}
void GSDedicated::update(const Clock& time)
Modified: branches/gui/src/orxonox/gamestates/GSGUI.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSGUI.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/gamestates/GSGUI.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -32,11 +32,11 @@
#include <OgreViewport.h>
#include "core/Clock.h"
#include "core/ConsoleCommand.h"
+#include "core/Game.h"
#include "core/input/InputManager.h"
#include "core/input/SimpleInputState.h"
#include "gui/GUIManager.h"
#include "GraphicsManager.h"
-#include "core/Game.h"
namespace orxonox
{
Modified: branches/gui/src/orxonox/gamestates/GSGraphics.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSGraphics.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/gamestates/GSGraphics.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -37,6 +37,7 @@
#include "core/Core.h"
#include "core/CoreIncludes.h"
#include "core/Game.h"
+#include "core/GameMode.h"
#include "core/input/InputManager.h"
#include "core/input/KeyBinder.h"
#include "core/input/SimpleInputState.h"
@@ -73,7 +74,7 @@
void GSGraphics::activate()
{
- Core::setShowsGraphics(true);
+ GameMode::setShowsGraphics(true);
setConfigValues();
@@ -127,7 +128,7 @@
delete graphicsManager_;
- Core::setShowsGraphics(false);
+ GameMode::setShowsGraphics(false);
}
/**
Modified: branches/gui/src/orxonox/gamestates/GSLevel.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSLevel.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/gamestates/GSLevel.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -38,15 +38,16 @@
#include "core/ConsoleCommand.h"
#include "core/CommandLine.h"
#include "core/ConfigValueIncludes.h"
+#include "core/Core.h"
#include "core/CoreIncludes.h"
-#include "core/Core.h"
+#include "core/Game.h"
+#include "core/GameMode.h"
#include "objects/Tickable.h"
#include "objects/Radar.h"
#include "CameraManager.h"
#include "GraphicsManager.h"
#include "LevelManager.h"
#include "PlayerManager.h"
-#include "core/Game.h"
namespace orxonox
{
@@ -82,7 +83,7 @@
{
setConfigValues();
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
{
inputState_ = InputManager::getInstance().createInputState<SimpleInputState>("game");
keyBinder_ = new KeyBinder();
@@ -98,7 +99,7 @@
this->playerManager_ = new PlayerManager();
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
// create the global LevelManager
this->levelManager_ = new LevelManager();
@@ -106,7 +107,7 @@
this->loadLevel();
}
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
{
// TODO: insert slomo console command with
// .accessLevel(AccessLevel::Offline).defaultValue(0, 1.0).axisParamIndex(0).isAxisRelative(false);
@@ -148,10 +149,10 @@
// and call a sceneNode method that has already been destroy by the corresponding space ship.
//Loader::close();
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
InputManager::getInstance().requestLeaveState("game");
- if (Core::isMaster())
+ if (GameMode::isMaster())
this->unloadLevel();
if (this->radar_)
@@ -178,7 +179,7 @@
this->playerManager_ = 0;
}
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
{
inputState_->setHandler(0);
InputManager::getInstance().requestDestroyState("game");
@@ -239,7 +240,7 @@
*/
void GSLevel::keybindInternal(const std::string& command, bool bTemporary)
{
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
{
static std::string bindingString = "";
static bool bTemporarySaved = false;
Modified: branches/gui/src/orxonox/gamestates/GSRoot.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSRoot.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/gamestates/GSRoot.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -32,13 +32,13 @@
#include "util/Exception.h"
#include "util/Debug.h"
#include "core/Clock.h"
-#include "core/Core.h"
+#include "core/Game.h"
+#include "core/GameMode.h"
#include "core/CommandLine.h"
#include "core/ConsoleCommand.h"
#include "tools/TimeFactorListener.h"
#include "tools/Timer.h"
#include "objects/Tickable.h"
-#include "core/Game.h"
namespace orxonox
{
@@ -141,7 +141,7 @@
*/
void GSRoot::setTimeFactor(float factor)
{
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
if (!this->bPaused_)
{
@@ -159,7 +159,7 @@
void GSRoot::pause()
{
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
if (!this->bPaused_)
{
Modified: branches/gui/src/orxonox/gamestates/GSServer.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSServer.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/gamestates/GSServer.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -30,9 +30,9 @@
#include "GSServer.h"
#include "core/CommandLine.h"
-#include "core/Core.h"
+#include "core/Game.h"
+#include "core/GameMode.h"
#include "network/Server.h"
-#include "core/Game.h"
namespace orxonox
{
@@ -52,7 +52,7 @@
void GSServer::activate()
{
- Core::setHasServer(true);
+ GameMode::setHasServer(true);
this->server_ = new Server(CommandLine::getValue("port"));
COUT(0) << "Loading scene in server mode" << std::endl;
@@ -65,7 +65,7 @@
this->server_->close();
delete this->server_;
- Core::setHasServer(false);
+ GameMode::setHasServer(false);
}
void GSServer::update(const Clock& time)
Modified: branches/gui/src/orxonox/gamestates/GSStandalone.cc
===================================================================
--- branches/gui/src/orxonox/gamestates/GSStandalone.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/gamestates/GSStandalone.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -31,11 +31,11 @@
#include <OgreViewport.h>
#include <OgreCamera.h>
-#include "core/Core.h"
+#include "core/Game.h"
+#include "core/GameMode.h"
#include "core/ConsoleCommand.h"
#include "gui/GUIManager.h"
#include "GraphicsManager.h"
-#include "core/Game.h"
namespace orxonox
{
@@ -53,7 +53,7 @@
void GSStandalone::activate()
{
- Core::setIsStandalone(true);
+ GameMode::setIsStandalone(true);
guiManager_ = GUIManager::getInstancePtr();
// not sure if necessary
@@ -62,7 +62,7 @@
void GSStandalone::deactivate()
{
- Core::setIsStandalone(false);
+ GameMode::setIsStandalone(false);
}
void GSStandalone::update(const Clock& time)
Modified: branches/gui/src/orxonox/objects/Scene.cc
===================================================================
--- branches/gui/src/orxonox/objects/Scene.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/Scene.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -40,7 +40,7 @@
#include "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.h"
#include "core/CoreIncludes.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/XMLPort.h"
#include "tools/BulletConversions.h"
#include "objects/worldentities/WorldEntity.h"
@@ -56,7 +56,7 @@
this->setScene(this);
this->bShadows_ = true;
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
{
if (Ogre::Root::getSingletonPtr())
{
@@ -98,7 +98,7 @@
{
Ogre::Root::getSingleton().destroySceneManager(this->sceneManager_);
}
- else if (!Core::showsGraphics())
+ else if (!GameMode::showsGraphics())
{
delete this->sceneManager_;
}
@@ -226,7 +226,7 @@
void Scene::tick(float dt)
{
- if (!Core::showsGraphics())
+ if (!GameMode::showsGraphics())
{
// We need to update the scene nodes if we don't render
this->rootSceneNode_->_update(true, false);
@@ -255,7 +255,7 @@
void Scene::setSkybox(const std::string& skybox)
{
- if (Core::showsGraphics() && this->sceneManager_)
+ if (GameMode::showsGraphics() && this->sceneManager_)
this->sceneManager_->setSkyBox(true, skybox);
this->skybox_ = skybox;
@@ -263,7 +263,7 @@
void Scene::setAmbientLight(const ColourValue& colour)
{
- if (Core::showsGraphics() && this->sceneManager_)
+ if (GameMode::showsGraphics() && this->sceneManager_)
this->sceneManager_->setAmbientLight(colour);
this->ambientLight_ = colour;
@@ -271,7 +271,7 @@
void Scene::setShadow(bool bShadow)
{
- if (Core::showsGraphics() && this->sceneManager_)
+ if (GameMode::showsGraphics() && this->sceneManager_)
{
if (bShadow)
this->sceneManager_->setShadowTechnique(Ogre::SHADOWTYPE_STENCIL_ADDITIVE);
Modified: branches/gui/src/orxonox/objects/controllers/AIController.cc
===================================================================
--- branches/gui/src/orxonox/objects/controllers/AIController.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/controllers/AIController.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -29,7 +29,7 @@
#include "OrxonoxStableHeaders.h"
#include "AIController.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "core/Executor.h"
#include "objects/worldentities/ControllableEntity.h"
@@ -44,7 +44,7 @@
{
RegisterObject(AIController);
- if (Core::isMaster())
+ if (GameMode::isMaster())
this->actionTimer_.setTimer(ACTION_INTERVAL, true, this, createExecutor(createFunctor(&AIController::action)));
}
Modified: branches/gui/src/orxonox/objects/gametypes/Gametype.cc
===================================================================
--- branches/gui/src/orxonox/objects/gametypes/Gametype.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/gametypes/Gametype.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -35,7 +35,7 @@
#include "core/CoreIncludes.h"
#include "core/ConfigValueIncludes.h"
#include "core/Template.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "overlays/OverlayGroup.h"
#include "objects/infos/PlayerInfo.h"
#include "objects/infos/Bot.h"
@@ -68,7 +68,7 @@
this->addBots(this->numberOfBots_);
// load the corresponding score board
- if (Core::showsGraphics() && this->scoreboardTemplate_ != "")
+ if (GameMode::showsGraphics() && this->scoreboardTemplate_ != "")
{
this->scoreboard_ = new OverlayGroup(this);
this->scoreboard_->addTemplate(this->scoreboardTemplate_);
Modified: branches/gui/src/orxonox/objects/infos/Bot.cc
===================================================================
--- branches/gui/src/orxonox/objects/infos/Bot.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/infos/Bot.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -29,7 +29,7 @@
#include "OrxonoxStableHeaders.h"
#include "Bot.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "core/ConfigValueIncludes.h"
#include "objects/gametypes/Gametype.h"
@@ -45,7 +45,7 @@
RegisterObject(Bot);
this->bHumanPlayer_ = false;
- this->bLocalPlayer_ = Core::isMaster();
+ this->bLocalPlayer_ = GameMode::isMaster();
this->bSetUnreadyAfterSpawn_ = false;
this->setReadyToSpawn(true);
this->defaultController_ = Class(AIController);
Modified: branches/gui/src/orxonox/objects/infos/HumanPlayer.cc
===================================================================
--- branches/gui/src/orxonox/objects/infos/HumanPlayer.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/infos/HumanPlayer.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -29,7 +29,7 @@
#include "OrxonoxStableHeaders.h"
#include "HumanPlayer.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "core/ConfigValueIncludes.h"
#include "network/ClientInformation.h"
@@ -46,7 +46,7 @@
{
RegisterObject(HumanPlayer);
- this->server_initialized_ = Core::isMaster();
+ this->server_initialized_ = GameMode::isMaster();
this->client_initialized_ = false;
this->bHumanPlayer_ = true;
@@ -81,7 +81,7 @@
{
this->synchronize_nick_ = this->nick_;
- if (Core::isMaster())
+ if (GameMode::isMaster())
this->setName(this->nick_);
}
}
@@ -104,7 +104,7 @@
this->synchronize_nick_ = this->nick_;
this->client_initialized_ = true;
- if (!Core::isMaster())
+ if (!GameMode::isMaster())
this->setObjectMode(objectDirection::bidirectional);
else
this->setName(this->nick_);
Modified: branches/gui/src/orxonox/objects/items/MultiStateEngine.cc
===================================================================
--- branches/gui/src/orxonox/objects/items/MultiStateEngine.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/items/MultiStateEngine.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -29,7 +29,7 @@
#include "OrxonoxStableHeaders.h"
#include "MultiStateEngine.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
#include "objects/worldentities/pawns/SpaceShip.h"
@@ -122,7 +122,7 @@
this->state_ &= ~STATE_BRAKE;
}
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
for (std::list<WorldEntity*>::const_iterator it = this->activeEffects_.begin(); it != this->activeEffects_.end(); ++it)
(*it)->setMainState(this->state_ & STATE_ACTIVE);
Modified: branches/gui/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.cc
===================================================================
--- branches/gui/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/weaponSystem/projectiles/BillboardProjectile.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -31,7 +31,7 @@
#include <OgreBillboardSet.h>
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "objects/Scene.h"
@@ -43,7 +43,7 @@
{
RegisterObject(BillboardProjectile);
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
{
assert(this->getScene()->getSceneManager()); // getScene() was already checked by WorldEntity
this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(0.5, 0.5, 0.7, 0.8), 1);
@@ -55,7 +55,7 @@
BillboardProjectile::~BillboardProjectile()
{
- if (this->isInitialized() && Core::showsGraphics() && this->billboard_.getBillboardSet())
+ if (this->isInitialized() && GameMode::showsGraphics() && this->billboard_.getBillboardSet())
this->detachOgreObject(this->billboard_.getBillboardSet());
}
Modified: branches/gui/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.cc
===================================================================
--- branches/gui/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/weaponSystem/projectiles/ParticleProjectile.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -32,7 +32,7 @@
#include <OgreParticleSystem.h>
#include <OgreParticleEmitter.h>
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "core/ConfigValueIncludes.h"
#include "objects/Scene.h"
@@ -45,7 +45,7 @@
{
RegisterObject(ParticleProjectile);
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
{
this->particles_ = new ParticleInterface(this->getScene()->getSceneManager(), "Orxonox/shot3_small", LODParticle::normal);
this->attachOgreObject(this->particles_->getParticleSystem());
Modified: branches/gui/src/orxonox/objects/weaponSystem/projectiles/Projectile.cc
===================================================================
--- branches/gui/src/orxonox/objects/weaponSystem/projectiles/Projectile.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/weaponSystem/projectiles/Projectile.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -40,7 +40,7 @@
#include "objects/worldentities/Model.h"
#include "objects/worldentities/ParticleSpawner.h"
#include "objects/collisionshapes/SphereCollisionShape.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
namespace orxonox
{
@@ -54,7 +54,7 @@
// Get notification about collisions
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
this->enableCollisionCallback();
@@ -92,13 +92,13 @@
void Projectile::destroyObject()
{
- if (Core::isMaster())
+ if (GameMode::isMaster())
delete this;
}
bool Projectile::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
{
- if (!this->bDestroy_ && Core::isMaster())
+ if (!this->bDestroy_ && GameMode::isMaster())
{
this->bDestroy_ = true;
Modified: branches/gui/src/orxonox/objects/worldentities/Backlight.cc
===================================================================
--- branches/gui/src/orxonox/objects/worldentities/Backlight.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/worldentities/Backlight.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -32,7 +32,7 @@
#include <OgreRibbonTrail.h>
#include <OgreSceneManager.h>
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "core/Executor.h"
#include "core/XMLPort.h"
@@ -57,7 +57,7 @@
this->tickcount_ = 0;
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
{
if (!this->getScene())
ThrowException(AbortLoading, "Can't create Backlight, no scene given.");
Modified: branches/gui/src/orxonox/objects/worldentities/Billboard.cc
===================================================================
--- branches/gui/src/orxonox/objects/worldentities/Billboard.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/worldentities/Billboard.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -33,7 +33,7 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "objects/Scene.h"
namespace orxonox
@@ -80,7 +80,7 @@
if (!this->billboard_.getBillboardSet())
{
- if (this->getScene() && Core::showsGraphics())
+ if (this->getScene() && GameMode::showsGraphics())
{
this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
if (this->billboard_.getBillboardSet())
@@ -97,7 +97,7 @@
if (!this->billboard_.getBillboardSet())
{
/*
- if (this->getScene() && Core::showsGraphics() && (this->material_ != ""))
+ if (this->getScene() && GameMode::showsGraphics() && (this->material_ != ""))
{
this->billboard_.setBillboardSet(this->getScene()->getSceneManager(), this->material_, this->colour_, 1);
if (this->billboard_.getBillboardSet())
Modified: branches/gui/src/orxonox/objects/worldentities/BlinkingBillboard.cc
===================================================================
--- branches/gui/src/orxonox/objects/worldentities/BlinkingBillboard.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/worldentities/BlinkingBillboard.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -29,7 +29,7 @@
#include "OrxonoxStableHeaders.h"
#include "BlinkingBillboard.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
#include "util/Math.h"
@@ -76,7 +76,7 @@
{
SUPER(BlinkingBillboard, tick, dt);
- if (Core::isMaster() && this->isActive())
+ if (GameMode::isMaster() && this->isActive())
{
this->time_ += dt;
if (this->bQuadratic_)
Modified: branches/gui/src/orxonox/objects/worldentities/ControllableEntity.cc
===================================================================
--- branches/gui/src/orxonox/objects/worldentities/ControllableEntity.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/worldentities/ControllableEntity.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -33,7 +33,7 @@
#include "core/CoreIncludes.h"
#include "core/ConfigValueIncludes.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/XMLPort.h"
#include "core/Template.h"
@@ -235,7 +235,7 @@
{
this->startLocalHumanControl();
- if (!Core::isMaster())
+ if (!GameMode::isMaster())
{
this->client_overwrite_ = this->server_overwrite_;
this->setObjectMode(objectDirection::bidirectional);
@@ -330,7 +330,7 @@
// Check whether Bullet doesn't do the physics for us
if (!this->isDynamic())
{
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
this->server_position_ = this->getPosition();
this->server_orientation_ = this->getOrientation();
@@ -445,7 +445,7 @@
void ControllableEntity::setPosition(const Vector3& position)
{
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
MobileEntity::setPosition(position);
this->server_position_ = this->getPosition();
@@ -460,7 +460,7 @@
void ControllableEntity::setOrientation(const Quaternion& orientation)
{
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
MobileEntity::setOrientation(orientation);
this->server_orientation_ = this->getOrientation();
@@ -475,7 +475,7 @@
void ControllableEntity::setVelocity(const Vector3& velocity)
{
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
MobileEntity::setVelocity(velocity);
this->server_linear_velocity_ = this->getVelocity();
@@ -490,7 +490,7 @@
void ControllableEntity::setAngularVelocity(const Vector3& velocity)
{
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
MobileEntity::setAngularVelocity(velocity);
this->server_angular_velocity_ = this->getAngularVelocity();
@@ -506,7 +506,7 @@
void ControllableEntity::setWorldTransform(const btTransform& worldTrans)
{
MobileEntity::setWorldTransform(worldTrans);
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
this->server_position_ = this->getPosition();
this->server_orientation_ = this->getOrientation();
Modified: branches/gui/src/orxonox/objects/worldentities/ExplosionChunk.cc
===================================================================
--- branches/gui/src/orxonox/objects/worldentities/ExplosionChunk.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/worldentities/ExplosionChunk.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -31,7 +31,7 @@
#include <OgreParticleSystem.h>
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "core/Executor.h"
#include "objects/Scene.h"
@@ -46,13 +46,13 @@
{
RegisterObject(ExplosionChunk);
- if ( Core::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
+ if ( GameMode::showsGraphics() && ( !this->getScene() || !this->getScene()->getSceneManager() ) )
ThrowException(AbortLoading, "Can't create ExplosionChunk, no scene or no scene manager given.");
this->bStop_ = false;
this->LOD_ = LODParticle::normal;
- if ( Core::showsGraphics() )
+ if ( GameMode::showsGraphics() )
{
try
{
@@ -74,7 +74,7 @@
this->smoke_ = 0;
}
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
Vector3 velocity(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1));
velocity.normalise();
@@ -131,7 +131,7 @@
if (this->smoke_)
this->smoke_->setEnabled(false);
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
this->bStop_ = true;
this->destroyTimer_.setTimer(1.0f, false, this, createExecutor(createFunctor(&ExplosionChunk::destroy)));
@@ -147,7 +147,7 @@
{
static const unsigned int CHANGES_PER_SECOND = 5;
- if (Core::isMaster() && rnd() < dt*CHANGES_PER_SECOND)
+ if (GameMode::isMaster() && rnd() < dt*CHANGES_PER_SECOND)
{
float length = this->getVelocity().length();
Modified: branches/gui/src/orxonox/objects/worldentities/Light.cc
===================================================================
--- branches/gui/src/orxonox/objects/worldentities/Light.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/worldentities/Light.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -36,7 +36,7 @@
#include "util/String.h"
#include "util/Exception.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
#include "objects/Scene.h"
@@ -56,7 +56,7 @@
this->attenuation_ = Vector4(100000, 1, 0, 0);
this->spotlightRange_ = Vector3(40.0f, 30.0f, 1.0f);
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
{
if (!this->getScene())
ThrowException(AbortLoading, "Can't create Light, no scene given.");
Modified: branches/gui/src/orxonox/objects/worldentities/Model.cc
===================================================================
--- branches/gui/src/orxonox/objects/worldentities/Model.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/worldentities/Model.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -30,7 +30,7 @@
#include <OgreEntity.h>
#include "Model.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
#include "objects/Scene.h"
@@ -70,7 +70,7 @@
void Model::changedMesh()
{
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
{
if (this->mesh_.getEntity())
this->detachOgreObject(this->mesh_.getEntity());
Modified: branches/gui/src/orxonox/objects/worldentities/MovableEntity.cc
===================================================================
--- branches/gui/src/orxonox/objects/worldentities/MovableEntity.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/worldentities/MovableEntity.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -33,7 +33,7 @@
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
#include "core/Executor.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
namespace orxonox
{
@@ -88,7 +88,7 @@
void MovableEntity::resynchronize()
{
- if (Core::isMaster() && !this->continuousResynchroTimer_)
+ if (GameMode::isMaster() && !this->continuousResynchroTimer_)
{
// Resynchronise every few seconds because we only work with velocities (no positions)
continuousResynchroTimer_ = new Timer<MovableEntity>(CONTINUOUS_SYNCHRONIZATION_TIME + rnd(-1, 1),
Modified: branches/gui/src/orxonox/objects/worldentities/ParticleEmitter.cc
===================================================================
--- branches/gui/src/orxonox/objects/worldentities/ParticleEmitter.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/worldentities/ParticleEmitter.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -38,7 +38,7 @@
#include "tools/ParticleInterface.h"
#include "util/Exception.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
#include "objects/Scene.h"
@@ -51,7 +51,7 @@
{
RegisterObject(ParticleEmitter);
- if (Core::showsGraphics() && (!this->getScene() || !this->getScene()->getSceneManager()))
+ if (GameMode::showsGraphics() && (!this->getScene() || !this->getScene()->getSceneManager()))
ThrowException(AbortLoading, "Can't create ParticleEmitter, no scene or no scene manager given.");
this->particles_ = 0;
@@ -107,7 +107,7 @@
this->particles_ = 0;
}
- if (Core::showsGraphics() && this->getScene() && this->getScene()->getSceneManager())
+ if (GameMode::showsGraphics() && this->getScene() && this->getScene()->getSceneManager())
{
try
{
Modified: branches/gui/src/orxonox/objects/worldentities/pawns/Pawn.cc
===================================================================
--- branches/gui/src/orxonox/objects/worldentities/pawns/Pawn.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/worldentities/pawns/Pawn.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -29,7 +29,7 @@
#include "OrxonoxStableHeaders.h"
#include "Pawn.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
#include "util/Math.h"
@@ -62,7 +62,7 @@
this->getPickUp().setPlayer(this);
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
this->weaponSystem_ = new WeaponSystem(this);
this->weaponSystem_->setParentPawn(this);
@@ -186,7 +186,7 @@
if (this->getPlayer())
this->getPlayer()->stopControl(this);
- if (Core::isMaster())
+ if (GameMode::isMaster())
this->deatheffect();
}
@@ -233,7 +233,7 @@
void Pawn::postSpawn()
{
this->setHealth(this->initialHealth_);
- if (Core::isMaster())
+ if (GameMode::isMaster())
this->spawneffect();
}
Modified: branches/gui/src/orxonox/objects/worldentities/pawns/Spectator.cc
===================================================================
--- branches/gui/src/orxonox/objects/worldentities/pawns/Spectator.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/worldentities/pawns/Spectator.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -33,7 +33,7 @@
#include "core/CoreIncludes.h"
#include "core/ConfigValueIncludes.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "objects/worldentities/Model.h"
#include "objects/Scene.h"
#include "objects/infos/PlayerInfo.h"
@@ -62,7 +62,7 @@
this->setDestroyWhenPlayerLeft(true);
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
{
this->greetingFlare_ = new BillboardSet();
this->greetingFlare_->setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 1.0, 0.8), Vector3(0, 20, 0), 1);
@@ -205,7 +205,7 @@
{
this->bGreeting_ = !this->bGreeting_;
- if (Core::isMaster())
+ if (GameMode::isMaster())
{
this->bGreetingFlareVisible_ = this->bGreeting_;
this->changedFlareVisibility();
Modified: branches/gui/src/orxonox/objects/worldentities/triggers/Trigger.cc
===================================================================
--- branches/gui/src/orxonox/objects/worldentities/triggers/Trigger.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/objects/worldentities/triggers/Trigger.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -35,7 +35,7 @@
#include "core/CoreIncludes.h"
#include "core/ConsoleCommand.h"
#include "core/XMLPort.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "objects/Scene.h"
namespace orxonox
@@ -66,7 +66,7 @@
// this->bUpdating_ = false;
- if (this->getScene() && Core::showsGraphics())
+ if (this->getScene() && GameMode::showsGraphics())
{
this->debugBillboard_.setBillboardSet(this->getScene()->getSceneManager(), "Examples/Flare", ColourValue(1.0, 0.0, 0.0), 1);
this->debugBillboard_.setVisible(false);
Modified: branches/gui/src/orxonox/overlays/OrxonoxOverlay.cc
===================================================================
--- branches/gui/src/orxonox/overlays/OrxonoxOverlay.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/overlays/OrxonoxOverlay.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -43,7 +43,7 @@
#include "util/Convert.h"
#include "util/Exception.h"
#include "util/String.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "core/XMLPort.h"
#include "core/ConsoleCommand.h"
@@ -66,7 +66,7 @@
this->owner_ = 0;
this->group_ = 0;
- if (!Core::showsGraphics())
+ if (!GameMode::showsGraphics())
ThrowException(NoGraphics, "Can't create OrxonoxOverlay, graphics engine not initialized");
// create the Ogre::Overlay
Modified: branches/gui/src/orxonox/tools/BillboardSet.cc
===================================================================
--- branches/gui/src/orxonox/tools/BillboardSet.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/tools/BillboardSet.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -36,7 +36,7 @@
#include <OgreBillboardSet.h>
#include <OgreBillboard.h>
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "util/Convert.h"
#include "util/String.h"
@@ -71,7 +71,7 @@
try
{
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
{
this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + convertToString(BillboardSet::billboardSetCounter_s++), count);
this->billboardSet_->createBillboard(position);
@@ -94,7 +94,7 @@
try
{
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
{
this->billboardSet_ = scenemanager->createBillboardSet("Billboard" + convertToString(BillboardSet::billboardSetCounter_s++), count);
this->billboardSet_->createBillboard(position, colour);
Modified: branches/gui/src/orxonox/tools/Mesh.cc
===================================================================
--- branches/gui/src/orxonox/tools/Mesh.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/tools/Mesh.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -34,7 +34,7 @@
#include <OgreSceneManager.h>
#include <cassert>
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "util/Convert.h"
#include "util/String.h"
@@ -63,7 +63,7 @@
if (this->entity_)
this->scenemanager_->destroyEntity(this->entity_);
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
{
try
{
Modified: branches/gui/src/orxonox/tools/ParticleInterface.cc
===================================================================
--- branches/gui/src/orxonox/tools/ParticleInterface.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/tools/ParticleInterface.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -40,7 +40,7 @@
#include <cassert>
#include "GraphicsManager.h"
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "util/Convert.h"
@@ -63,7 +63,7 @@
this->bAllowedByLOD_ = true;
this->speedFactor_ = 1.0f;
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
{
try
{
@@ -177,7 +177,7 @@
void ParticleInterface::setDetailLevel(unsigned int level)
{
this->detaillevel_ = level;
- if (Core::showsGraphics())
+ if (GameMode::showsGraphics())
this->detailLevelChanged(GraphicsManager::getInstance().getDetailLevelParticle());
}
Modified: branches/gui/src/orxonox/tools/Shader.cc
===================================================================
--- branches/gui/src/orxonox/tools/Shader.cc 2009-03-25 18:36:23 UTC (rev 2847)
+++ branches/gui/src/orxonox/tools/Shader.cc 2009-03-25 18:37:00 UTC (rev 2848)
@@ -35,7 +35,7 @@
#include <OgreRoot.h>
#include <OgrePlugin.h>
-#include "core/Core.h"
+#include "core/GameMode.h"
#include "core/CoreIncludes.h"
#include "core/Executor.h"
#include "GraphicsManager.h"
@@ -58,7 +58,7 @@
this->scenemanager_ = scenemanager;
this->compositorInstance_ = 0;
this->bVisible_ = true;
- this->bLoadCompositor_ = Core::showsGraphics();
+ this->bLoadCompositor_ = GameMode::showsGraphics();
this->bViewportInitialized_ = false;
this->compositor_ = "";
this->oldcompositor_ = "";
@@ -245,7 +245,7 @@
Shader::ParameterPointer* Shader::getParameterPointer(const std::string& material, size_t technique, size_t pass, const std::string& parameter)
{
- if (!Core::showsGraphics() || !Shader::bLoadedCgPlugin_s)
+ if (!GameMode::showsGraphics() || !Shader::bLoadedCgPlugin_s)
return 0;
MaterialMap::iterator material_iterator = Shader::parameters_s.find(material);
More information about the Orxonox-commit
mailing list