Changeset 140
- Timestamp:
- Nov 1, 2007, 1:46:09 PM (17 years ago)
- Location:
- code/branches/xml
- Files:
-
- 11 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/xml/bin/run-script
r89 r140 1 1 #!/bin/bash 2 2 cd bin 3 3 if [[ ! -f main ]] ; then 4 4 echo "main does not exist" … … 23 23 fi 24 24 exec ./main 25 cd .. -
code/branches/xml/src/CMakeLists.txt
r89 r140 2 2 3 3 # create a few variables to simplify life 4 SET(SRC_FILES orxonox.cc )5 SET(INC_FILES ExampleApplication.h ExampleFrameListener.h )4 SET(SRC_FILES orxonox.cc loader/LevelLoader.cc xml/xmlParser.cc) 5 SET(INC_FILES ExampleApplication.h ExampleFrameListener.h loader/LevelLoader.h xml/xmlParser.h) 6 6 7 7 #Creates an executable -
code/branches/xml/src/orxonox.cc
r108 r140 29 29 #include "ExampleApplication.h" 30 30 31 #include <string> 32 #include <iostream> 33 34 #include "xml/xmlParser.h" 35 #include "loader/LevelLoader.h" 36 37 38 39 using namespace std; 40 31 41 // TODO: Put creation of SceneNode and implementation of FrameListener into an extern file 32 42 SceneNode *lightNode; 33 43 34 class OrxFrameListener : public ExampleFrameListener44 class FrameListener : public ExampleFrameListener 35 45 { 36 46 public: 37 OrxFrameListener(RenderWindow* win, Camera* cam, SceneManager *sceneMgr)47 FrameListener(RenderWindow* win, Camera* cam, SceneManager *sceneMgr) 38 48 : ExampleFrameListener(win, cam, false, false) 39 49 { … … 81 91 void createScene(void) 82 92 { 93 94 string levelFile = "sp_level_moonstation.oxw"; 95 loader::LevelLoader* loader = new loader::LevelLoader(levelFile); 96 97 /* 98 LightManager* lightman = new LightManager(); 99 loader->loadLights(lightman); 100 CameraManager* cameraman = new CameraManager(); 101 loader->loadCameras(cameraman); 102 ScriptManager* scriptman = new ScriptManager(); 103 loader->loadScripts(scriptman); 104 */ 105 106 83 107 // add tutorial code here: 84 108 // ... 85 mSceneMgr->setAmbientLight( ColourValue( 0.3, 0.3, 0.3 ) ); 86 //Entity* head = mSceneMgr->createEntity("head", "ogrehead.mesh"); 109 110 /* 111 mSceneMgr->setAmbientLight( ColourValue( 1, 1, 0.1 ) ); 112 Entity* head = mSceneMgr->createEntity("head", "ogrehead.mesh"); 87 113 88 //Entity* head2 = mSceneMgr->createEntity("head2", "ogrehead.mesh");114 Entity* head2 = mSceneMgr->createEntity("head2", "ogrehead.mesh"); 89 115 90 116 SceneNode *node = mSceneMgr->getRootSceneNode()->createChildSceneNode( "OgreHeadNode", Vector3( 0, 0, 0 ) ); 91 //node->attachObject( head );117 node->attachObject( head ); 92 118 93 119 SceneNode *node2 = mSceneMgr->getRootSceneNode()->createChildSceneNode( "OgreHeadNode2", Vector3( 50, 0, 0 ) ); 94 //node2->attachObject( head2 );120 node2->attachObject( head2 ); 95 121 96 122 … … 111 137 lightNode->attachObject(light); 112 138 light->setPosition(0.0, 0.0, 0.0); 139 140 */ 113 141 } 114 142 … … 116 144 { 117 145 // create frame listener 118 mFrameListener = new OrxFrameListener(mWindow, mCamera, mSceneMgr);146 mFrameListener = new ExampleFrameListener(mWindow, mCamera, mSceneMgr); 119 147 mRoot->addFrameListener(mFrameListener); 120 148 } … … 124 152 #define WIN32_LEAN_AND_MEAN 125 153 #include "windows.h" 126 127 154 INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT ) 128 155 #else 129 130 156 int main(int argc, char **argv) 131 157 #endif … … 134 160 Orxonox orxonox; 135 161 136 try { 162 try 163 { 137 164 orxonox.go(); 138 } catch( Exception& e ) { 139 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 140 MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL); 141 #else 142 fprintf(stderr, "An exception has occurred: %s\n", 143 e.getFullDescription().c_str()); 144 #endif 165 } 166 catch( Exception& e ) 167 { 168 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 169 MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL); 170 #else 171 fprintf(stderr, "An exception has occurred: %s\n",e.getFullDescription().c_str()); 172 #endif 145 173 } 146 147 174 return 0; 148 175 }
Note: See TracChangeset
for help on using the changeset viewer.