[Orxonox-commit 1899] r6616 - code/branches/skybox2/src/modules/designtools
gionc at orxonox.net
gionc at orxonox.net
Thu Mar 25 15:34:01 CET 2010
Author: gionc
Date: 2010-03-25 15:34:00 +0100 (Thu, 25 Mar 2010)
New Revision: 6616
Added:
code/branches/skybox2/src/modules/designtools/SkyboxGenerator.cc
code/branches/skybox2/src/modules/designtools/SkyboxGenerator.h
Modified:
code/branches/skybox2/src/modules/designtools/CMakeLists.txt
Log:
Added SkyboxGenerator class, implemented console command
Modified: code/branches/skybox2/src/modules/designtools/CMakeLists.txt
===================================================================
--- code/branches/skybox2/src/modules/designtools/CMakeLists.txt 2010-03-24 08:39:54 UTC (rev 6615)
+++ code/branches/skybox2/src/modules/designtools/CMakeLists.txt 2010-03-25 14:34:00 UTC (rev 6616)
@@ -1,5 +1,5 @@
SET_SOURCE_FILES(DESIGNTOOLS_SRC_FILES
-#src files
+ SkyboxGenerator.cc
)
ORXONOX_ADD_LIBRARY(designtools
Added: code/branches/skybox2/src/modules/designtools/SkyboxGenerator.cc
===================================================================
--- code/branches/skybox2/src/modules/designtools/SkyboxGenerator.cc (rev 0)
+++ code/branches/skybox2/src/modules/designtools/SkyboxGenerator.cc 2010-03-25 14:34:00 UTC (rev 6616)
@@ -0,0 +1,109 @@
+/*
+ * 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:
+ * Gion-Andri Cantieni
+ * Co-authors:
+ * ...
+ *
+ */
+
+#include "SkyboxGenerator.h"
+
+#include <string>
+#include "core/ConsoleCommand.h"
+#include "core/CoreIncludes.h"
+#include "core/ConfigValueIncludes.h"
+#include "core/ScopedSingletonManager.h"
+
+namespace orxonox
+{
+
+ SetConsoleCommand(SkyboxGenerator, createSkybox, true);
+
+ ManageScopedSingleton(SkyboxGenerator, ScopeID::Graphics, false);
+
+ SkyboxGenerator::SkyboxGenerator()
+ {
+ RegisterRootObject(SkyboxGenerator);
+
+ this->setConfigValues();
+ }
+
+ SkyboxGenerator::~SkyboxGenerator()
+ {
+
+ }
+
+ void SkyboxGenerator::setConfigValues( )
+ {
+ SetConfigValue(skyboxPrefix_, "SkyboxFile_");
+ }
+
+ void SkyboxGenerator::createSkybox( )
+ {
+ //SkyboxGenerator* sbg = SkyboxGenerator::getInstancePtr();
+ //sbg->skyboxPrefix_;
+
+ /*unsigned int indice = 1;
+ char filename[30];
+ char fn[1];
+ // generate new names...
+ //sprintf(filename, "screenshot_%d.png", ++indice);
+ //sprintf(filename, fn, ++indice);
+ */
+
+ /*
+ if(stopper == 1){
+ //sprintf(filename, "stevecube_FR.bmp");
+ mWindow->writeContentsToFile("MySky_FR.bmp");
+ }
+ else if(stopper == 2){
+ //sprintf(filename, "stevecube_LF.bmp");
+ cam->pitch(Ogre::Degree(90));
+ mWindow->writeContentsToFile("MySky_LF.bmp");
+ }
+ else if(stopper == 3){
+ //sprintf(filename, "stevecube_BK.bmp");
+ cam->pitch(Ogre::Degree(90));
+ mWindow->writeContentsToFile("MySky_BK.bmp");
+ }
+ else if(stopper == 4){
+ //sprintf(filename, "stevecube_RT.bmp");
+ cam->pitch(Ogre::Degree(90));
+ mWindow->writeContentsToFile("MySky_RT.bmp");
+ }
+ else if(stopper == 5){
+ //sprintf(filename, "stevecube_UP.bmp");
+ cam->yaw(Ogre::Degree(90));
+ mWindow->writeContentsToFile("MySky_UP.bmp");
+ }
+ else if(stopper == 6){
+ cam->yaw(Ogre::Degree(-90));
+ mWindow->writeContentsToFile("MySky_DN.bmp");
+ }
+
+ stopper+=1;
+ if(stopper >= 7)
+ stopper = 1;
+ */
+ }
+}
Added: code/branches/skybox2/src/modules/designtools/SkyboxGenerator.h
===================================================================
--- code/branches/skybox2/src/modules/designtools/SkyboxGenerator.h (rev 0)
+++ code/branches/skybox2/src/modules/designtools/SkyboxGenerator.h 2010-03-25 14:34:00 UTC (rev 6616)
@@ -0,0 +1,51 @@
+/*
+ * 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:
+ * Gion-Andri Cantieni
+ * Co-authors:
+ * ...
+ *
+ */
+
+
+#include "core/OrxonoxClass.h"
+#include "util/Singleton.h"
+
+
+namespace orxonox
+{
+ class SkyboxGenerator : public virtual OrxonoxClass, public Singleton<SkyboxGenerator>
+ {
+ friend class Singleton<SkyboxGenerator>;
+
+ public:
+ SkyboxGenerator();
+ virtual ~SkyboxGenerator();
+ void createSkybox( );
+ void setConfigValues( );
+
+ private:
+ static SkyboxGenerator* singletonPtr_s;
+ std::string skyboxPrefix_;
+
+ };
+}
More information about the Orxonox-commit
mailing list