Changeset 4139 in orxonox.OLD for orxonox/branches/md2_loader
- Timestamp:
- May 10, 2005, 10:39:01 AM (20 years ago)
- Location:
- orxonox/branches/md2_loader/src
- Files:
-
- 1 deleted
- 64 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/md2_loader/src/Makefile.am
r4127 r4139 22 22 AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/animation 23 23 AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/common 24 AM_CXXFLAGS+=-I$(MAINSRCDIR)/subprojects 24 25 25 26 … … 90 91 lib/xmlparser/tinystr.cc \ 91 92 lib/xmlparser/tinyxmlerror.cc \ 92 lib/xmlparser/tinyxmlparser.cc 93 lib/xmlparser/tinyxmlparser.cc \ 94 subprojects/benchmark.cc 93 95 94 96 noinst_HEADERS = orxonox.h \ … … 134 136 defs/error.h \ 135 137 defs/debug.h \ 138 defs/globals.h \ 136 139 lib/coord/p_node.h \ 137 140 lib/coord/null_parent.h \ … … 170 173 lib/gui/gui/gui_banner.h \ 171 174 lib/gui/gui/gui_keys.h \ 172 lib/gui/gui/gui_update.h 175 lib/gui/gui/gui_update.h \ 176 subprojects/benchmark.h 173 177 174 178 libORXgui_a_CPPFLAGS=$(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS) -
orxonox/branches/md2_loader/src/Makefile.in
r4138 r4139 91 91 vector.$(OBJEXT) curve.$(OBJEXT) glmenu_imagescreen.$(OBJEXT) \ 92 92 tinyxml.$(OBJEXT) tinystr.$(OBJEXT) tinyxmlerror.$(OBJEXT) \ 93 tinyxmlparser.$(OBJEXT) 93 tinyxmlparser.$(OBJEXT) benchmark.$(OBJEXT) 94 94 orxonox_OBJECTS = $(am_orxonox_OBJECTS) 95 95 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) … … 100 100 @AMDEP_TRUE@ ./$(DEPDIR)/animation_player.Po \ 101 101 @AMDEP_TRUE@ ./$(DEPDIR)/array.Po ./$(DEPDIR)/base_entity.Po \ 102 @AMDEP_TRUE@ ./$(DEPDIR)/base_object.Po ./$(DEPDIR)/camera.Po \ 102 @AMDEP_TRUE@ ./$(DEPDIR)/base_object.Po \ 103 @AMDEP_TRUE@ ./$(DEPDIR)/benchmark.Po ./$(DEPDIR)/camera.Po \ 103 104 @AMDEP_TRUE@ ./$(DEPDIR)/campaign.Po \ 104 105 @AMDEP_TRUE@ ./$(DEPDIR)/character_attributes.Po \ … … 222 223 PACKAGE_VERSION = @PACKAGE_VERSION@ 223 224 PATH_SEPARATOR = @PATH_SEPARATOR@ 225 PKG_CONFIG = @PKG_CONFIG@ 224 226 RANLIB = @RANLIB@ 225 227 SET_MAKE = @SET_MAKE@ … … 273 275 target_vendor = @target_vendor@ 274 276 MAINSRCDIR = . 275 AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/graphics/particles -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/gui/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common 277 AM_CXXFLAGS = -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/graphics/particles -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/gui/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common -I$(MAINSRCDIR)/subprojects 276 278 noinst_LIBRARIES = libORXgui.a 277 279 orxonox_DEPENDENCIES = libORXgui.a … … 334 336 lib/xmlparser/tinystr.cc \ 335 337 lib/xmlparser/tinyxmlerror.cc \ 336 lib/xmlparser/tinyxmlparser.cc 338 lib/xmlparser/tinyxmlparser.cc \ 339 subprojects/benchmark.cc 337 340 338 341 noinst_HEADERS = orxonox.h \ … … 378 381 defs/error.h \ 379 382 defs/debug.h \ 383 defs/globals.h \ 380 384 lib/coord/p_node.h \ 381 385 lib/coord/null_parent.h \ … … 414 418 lib/gui/gui/gui_banner.h \ 415 419 lib/gui/gui/gui_keys.h \ 416 lib/gui/gui/gui_update.h 420 lib/gui/gui/gui_update.h \ 421 subprojects/benchmark.h 417 422 418 423 libORXgui_a_CPPFLAGS = $(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS) … … 522 527 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_entity.Po@am__quote@ 523 528 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_object.Po@am__quote@ 529 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/benchmark.Po@am__quote@ 524 530 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/camera.Po@am__quote@ 525 531 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/campaign.Po@am__quote@ … … 1559 1565 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1560 1566 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o tinyxmlparser.obj `if test -f 'lib/xmlparser/tinyxmlparser.cc'; then $(CYGPATH_W) 'lib/xmlparser/tinyxmlparser.cc'; else $(CYGPATH_W) '$(srcdir)/lib/xmlparser/tinyxmlparser.cc'; fi` 1567 1568 benchmark.o: subprojects/benchmark.cc 1569 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT benchmark.o -MD -MP -MF "$(DEPDIR)/benchmark.Tpo" -c -o benchmark.o `test -f 'subprojects/benchmark.cc' || echo '$(srcdir)/'`subprojects/benchmark.cc; \ 1570 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/benchmark.Tpo" "$(DEPDIR)/benchmark.Po"; else rm -f "$(DEPDIR)/benchmark.Tpo"; exit 1; fi 1571 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='subprojects/benchmark.cc' object='benchmark.o' libtool=no @AMDEPBACKSLASH@ 1572 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/benchmark.Po' tmpdepfile='$(DEPDIR)/benchmark.TPo' @AMDEPBACKSLASH@ 1573 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1574 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o benchmark.o `test -f 'subprojects/benchmark.cc' || echo '$(srcdir)/'`subprojects/benchmark.cc 1575 1576 benchmark.obj: subprojects/benchmark.cc 1577 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT benchmark.obj -MD -MP -MF "$(DEPDIR)/benchmark.Tpo" -c -o benchmark.obj `if test -f 'subprojects/benchmark.cc'; then $(CYGPATH_W) 'subprojects/benchmark.cc'; else $(CYGPATH_W) '$(srcdir)/subprojects/benchmark.cc'; fi`; \ 1578 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/benchmark.Tpo" "$(DEPDIR)/benchmark.Po"; else rm -f "$(DEPDIR)/benchmark.Tpo"; exit 1; fi 1579 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='subprojects/benchmark.cc' object='benchmark.obj' libtool=no @AMDEPBACKSLASH@ 1580 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/benchmark.Po' tmpdepfile='$(DEPDIR)/benchmark.TPo' @AMDEPBACKSLASH@ 1581 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 1582 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o benchmark.obj `if test -f 'subprojects/benchmark.cc'; then $(CYGPATH_W) 'subprojects/benchmark.cc'; else $(CYGPATH_W) '$(srcdir)/subprojects/benchmark.cc'; fi` 1561 1583 uninstall-info-am: 1562 1584 … … 1682 1704 1683 1705 distdir: $(DISTFILES) 1684 $(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/graphics/importer $(distdir)/lib/graphics/particles $(distdir)/lib/gui/gui $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/ util $(distdir)/util/animation $(distdir)/util/common $(distdir)/world_entities1706 $(mkdir_p) $(distdir)/ai $(distdir)/defs $(distdir)/glmenu $(distdir)/lib/coord $(distdir)/lib/data $(distdir)/lib/graphics $(distdir)/lib/graphics/importer $(distdir)/lib/graphics/particles $(distdir)/lib/gui/gui $(distdir)/lib/lang $(distdir)/lib/math $(distdir)/lib/util $(distdir)/network $(distdir)/proto $(distdir)/story_entities $(distdir)/subprojects $(distdir)/util $(distdir)/util/animation $(distdir)/util/common $(distdir)/world_entities 1685 1707 @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ 1686 1708 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ -
orxonox/branches/md2_loader/src/command_node.cc
r3654 r4139 57 57 this->bEnabled = true; 58 58 this->world = NULL; 59 this->loadBindings 59 this->loadBindings(filename); 60 60 } 61 61 … … 111 111 \param filename: The path and name of the file to load the bindings from 112 112 */ 113 void CommandNode::loadBindings (char* filename )113 void CommandNode::loadBindings (char* filename = DEFAULT_KEYBIND_FILE) 114 114 { 115 115 FILE* stream; 116 116 117 117 PRINTF(4)("Loading key bindings from %s\n", filename); 118 119 if( filename == NULL) filename = DEFAULT_KEYBIND_FILE;120 118 121 119 // remove old bindings if present … … 128 126 // create parser 129 127 IniParser parser (filename); 130 if( parser.getSection ( "Bindings") == -1)131 { 132 PRINTF(1)("Could not find key bindings in %s\n", filename);128 if( parser.getSection (CONFIG_SECTION_PLAYER "1") == -1) 129 { 130 PRINTF(1)("Could not find key bindings " CONFIG_SECTION_PLAYER"1 in %s\n", filename); 133 131 return; 134 132 } … … 144 142 while( parser.nextVar (namebuf, valuebuf) != -1) 145 143 { 146 index = nameToIndex ( namebuf);144 index = nameToIndex (valuebuf); 147 145 switch( index[0]) 148 146 { 149 147 case 0: 150 PRINTF(4)("Key binding %d(%s) set to %s\n", index[1], SDLKToKeyname( index[1]), valuebuf);151 strcpy (aliases->keys[index[1]], valuebuf);148 PRINTF(4)("Key binding %d(%s) set to %s\n", index[1], SDLKToKeyname( index[1]), namebuf); 149 strcpy (aliases->keys[index[1]], namebuf); 152 150 break; 153 151 case 1: 154 PRINTF(4)("Button binding %d(%s) set to %s\n", index[1], SDLBToButtonname( index[1]), valuebuf);155 strcpy (aliases->buttons[index[1]], valuebuf);152 PRINTF(4)("Button binding %d(%s) set to %s\n", index[1], SDLBToButtonname( index[1]), namebuf); 153 strcpy (aliases->buttons[index[1]], namebuf); 156 154 break; 157 155 default: … … 161 159 memset (valuebuf, 0, 256); 162 160 } 161 162 163 // PARSE MISC SECTION 164 if( parser.getSection (CONFIG_SECTION_MISC_KEYS) == -1) 165 { 166 PRINTF(1)("Could not find key bindings in %s\n", filename); 167 return; 168 } 169 170 while( parser.nextVar (namebuf, valuebuf) != -1) 171 { 172 index = nameToIndex (valuebuf); 173 switch( index[0]) 174 { 175 case 0: 176 PRINTF(4)("Key binding %d(%s) set to %s\n", index[1], SDLKToKeyname( index[1]), namebuf); 177 strcpy (aliases->keys[index[1]], namebuf); 178 break; 179 case 1: 180 PRINTF(4)("Button binding %d(%s) set to %s\n", index[1], SDLBToButtonname( index[1]), namebuf); 181 strcpy (aliases->buttons[index[1]], namebuf); 182 break; 183 default: 184 break; 185 } 186 memset (namebuf, 0, 256); 187 memset (valuebuf, 0, 256); 188 } 189 163 190 } 164 191 -
orxonox/branches/md2_loader/src/command_node.h
r3608 r4139 18 18 #define N_STD_KEYS SDLK_LAST 19 19 #define N_BUTTONS 6 20 #define DEFAULT_KEYBIND_FILE " default.ini"20 #define DEFAULT_KEYBIND_FILE "~/.orxonox/orxonox.conf" 21 21 22 22 //! Key aliasing structure -
orxonox/branches/md2_loader/src/defs/debug.h
r4072 r4139 59 59 #define DEBUG_MODULE_PNODE 0 60 60 #define DEBUG_MODULE_WORLD_ENTITY 0 61 #define DEBUG_MODULE_COMMAND_NODE 061 #define DEBUG_MODULE_COMMAND_NODE 4 62 62 #define DEBUG_MODULE_GRAPHICS 0 63 #define DEBUG_MODULE_LOAD 063 #define DEBUG_MODULE_LOAD 2 64 64 65 65 #define DEBUG_MODULE_IMPORTER 2 -
orxonox/branches/md2_loader/src/defs/stdincl.h
r4010 r4139 25 25 #include "error.h" 26 26 #include "debug.h" 27 #include "globals.h" 27 28 28 29 #include "compiler.h" -
orxonox/branches/md2_loader/src/factory.h
r4020 r4139 57 57 tFactory<T>::tFactory(const char* name) : Factory(name) 58 58 { 59 printf("fileName: %s\n", name);59 PRINTF(5)("fileName: %s\n", name); 60 60 } 61 61 … … 80 80 const char* grabParameter( TiXmlElement* root, const char* name); 81 81 82 83 84 85 82 #endif /* _FACTORY_H */ 86 83 -
orxonox/branches/md2_loader/src/game_loader.cc
r4020 r4139 25 25 #include "command_node.h" 26 26 #include "vector.h" 27 #include "resource_manager.h" 27 28 #include "factory.h" 28 29 … … 76 77 { 77 78 ErrorMessage errorCode; 78 79 this->currentCampaign = this->fileToCampaign(name); 79 char* campaignName; 80 if (ResourceManager::isFile(name)) 81 { 82 this->currentCampaign = this->fileToCampaign(name); 83 } 84 else 85 { 86 campaignName = new char[strlen(ResourceManager::getInstance()->getDataDir())+strlen(name)]; 87 sprintf(campaignName, "%s%s", ResourceManager::getInstance()->getDataDir(), name); 88 this->currentCampaign = this->fileToCampaign(campaignName); 89 delete campaignName; 90 } 80 91 } 81 92 … … 162 173 this will interprete the map/campaign files and recursivly load a tree of worlds/campaigns 163 174 */ 164 Campaign* GameLoader::fileToCampaign(c har *name)175 Campaign* GameLoader::fileToCampaign(const char *name) 165 176 { 166 177 /* do not entirely load the campaign. just the current world … … 171 182 if( name == NULL) 172 183 { 173 PRINTF 0("No filename specified for loading");184 PRINTF(2)("No filename specified for loading"); 174 185 return NULL; 175 186 } … … 180 191 { 181 192 // report an error 182 PRINTF 0("Error loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());193 PRINTF(1)("Could not load XML File %s: %s @ %d:%d\n", name, XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol()); 183 194 delete XMLDoc; 184 195 return NULL; … … 192 203 { 193 204 // report an error 194 PRINTF( 0)("Specified XML File is not an orxonox campaign file (Campaign element missing)\n");205 PRINTF(2)("Specified XML File is not an orxonox campaign file (Campaign element missing)\n"); 195 206 delete XMLDoc; 196 207 return NULL; … … 214 225 bool GameLoader::worldCommand (Command* cmd) 215 226 { 216 if( !strcmp( cmd->cmd, "up_world"))227 if( !strcmp( cmd->cmd, CONFIG_NAME_NEXT_WORLD)) 217 228 { 218 229 if( !cmd->bUp) … … 222 233 return true; 223 234 } 224 else if( !strcmp( cmd->cmd, "down_world"))235 else if( !strcmp( cmd->cmd, CONFIG_NAME_PREV_WORLD)) 225 236 { 226 237 if( !cmd->bUp) … … 230 241 return true; 231 242 } 232 else if( !strcmp( cmd->cmd, "pause"))243 else if( !strcmp( cmd->cmd, CONFIG_NAME_PAUSE)) 233 244 { 234 245 if( !cmd->bUp) … … 241 252 return true; 242 253 } 243 else if( !strcmp( cmd->cmd, "quit"))254 else if( !strcmp( cmd->cmd, CONFIG_NAME_QUIT)) 244 255 { 245 256 if( !cmd->bUp) this->stop(); … … 279 290 assert( factory != NULL); 280 291 281 PRINTF 0("Registered factory for '%s'\n", factory->getFactoryName());292 PRINTF(4)("Registered factory for '%s'\n", factory->getFactoryName()); 282 293 283 294 if( first == NULL) first = factory; … … 291 302 BaseObject* GameLoader::fabricate( TiXmlElement* element) 292 303 { 293 assert( element != NULL); 294 295 if( first == NULL) 296 { 297 PRINTF0("GameLoader does not know any factories, fabricate() failed\n"); 298 return NULL; 299 } 300 301 if( element->Value() != NULL) 302 { 303 PRINTF0("Attempting fabrication of a '%s'\n", element->Value()); 304 BaseObject* b = first->fabricate( element); 305 if( b == NULL) PRINTF0("Failed to fabricate a '%s'\n", element->Value()); 306 else PRINTF0("Successfully fabricated a '%s'\n", element->Value()); 307 return b; 308 } 309 310 PRINTF0("Fabricate failed, TiXmlElement did not contain a value\n"); 311 312 return NULL; 313 } 304 assert( element != NULL); 305 306 if( first == NULL) 307 { 308 PRINTF(1)("GameLoader does not know any factories, fabricate() failed\n"); 309 return NULL; 310 } 311 312 if( element->Value() != NULL) 313 { 314 PRINTF(4)("Attempting fabrication of a '%s'\n", element->Value()); 315 BaseObject* b = first->fabricate( element); 316 if( b == NULL) 317 PRINTF(2)("Failed to fabricate a '%s'\n", element->Value()); 318 else 319 PRINTF(4)("Successfully fabricated a '%s'\n", element->Value()); 320 return b; 321 } 322 323 PRINTF(2)("Fabricate failed, TiXmlElement did not contain a value\n"); 324 325 return NULL; 326 } -
orxonox/branches/md2_loader/src/game_loader.h
r4010 r4139 64 64 Campaign* currentCampaign; //!> the current campaign playing 65 65 66 Campaign* fileToCampaign(c har* name);66 Campaign* fileToCampaign(const char* name); 67 67 68 68 Factory* first; -
orxonox/branches/md2_loader/src/glmenu/glmenu_imagescreen.cc
r3729 r4139 20 20 21 21 #include "stdincl.h" 22 #include "graphics_engine.h" 22 23 #include "material.h" 23 24 25 CREATE_FACTORY(GLMenuImageScreen); 26 27 24 28 using namespace std; 25 26 GLMenuImageScreen* GLMenuImageScreen::singletonRef = 0;27 28 GLMenuImageScreen* GLMenuImageScreen::getInstance()29 {30 if(!singletonRef)31 singletonRef = new GLMenuImageScreen ();32 return singletonRef;33 }34 35 29 /** 36 30 \brief standard constructor 37 38 \todo this constructor is not jet implemented - do it39 31 */ 40 32 GLMenuImageScreen::GLMenuImageScreen () 41 33 { 42 this->setClassName ("GLMenuImageScreen");43 34 this->init(); 44 35 } 45 36 37 /** 38 \param root The Element to load the GLMenu from 39 */ 40 GLMenuImageScreen::GLMenuImageScreen (TiXmlElement* root) 41 { 42 this->init(); 43 this->load(root); 44 45 } 46 47 /** 48 \brief Loads a GLMenu from an inputElement 49 \param root The Element to load the GLMenu from 50 51 Tags are: 52 \li BackgroundImage STRING: the background Image 53 \li BarImage: STRING: the Image on the Bar 54 \li BackgroundPS: FLOAT FLOAT FLOAT FLOAT: posX posY scaleX scaleY 55 \li BarPS: FLOAT FLOAT FLOAT FLOAT: posX posY scaleX scaleY 56 \li ElementCount: INT: how many elements will be loaded 57 */ 58 void GLMenuImageScreen::load(TiXmlElement* root) 59 { 60 const char* string; 61 62 // Model Loading 63 string = grabParameter( root, "BackgroundImage"); 64 if( string != NULL) 65 this->setBackgroundImage(string); 66 67 string = grabParameter(root, "BackgroundPS"); 68 if (string != NULL) 69 { 70 float f1, f2, f3, f4; 71 sscanf (string, "%f %f %f %f", &f1, &f2, &f3, &f4); 72 this->setPosition(f1,f2); 73 this->setScale(f3,f4); 74 } 75 76 string = grabParameter( root, "BarImage"); 77 if (string != NULL) 78 this->setBarImage(string); 79 string = grabParameter(root, "BarPS"); 80 if (string != NULL) 81 { 82 float f1, f2, f3, f4; 83 sscanf (string, "%f %f %f %f", &f1, &f2, &f3, &f4); 84 this->setBarPosScale(f1,f2,f3,f4); 85 } 86 87 string = grabParameter( root, "ElementCount"); 88 if (string != NULL) 89 this->setMaximum(atoi(string)); 90 } 46 91 47 92 /** … … 51 96 GLMenuImageScreen::~GLMenuImageScreen() 52 97 { 53 if (this->backMat)54 delete this->backMat;98 delete this->backMat; 99 delete this->barMat; 55 100 } 56 101 … … 60 105 void GLMenuImageScreen::init () 61 106 { 62 /* 63 int w = 680; 64 int h = 480; 65 66 glViewport(0,0,w,h); 67 68 glMatrixMode(GL_PROJECTION); 69 glLoadIdentity(); 70 gluPerspective(45.0f,(GLfloat)w/(GLfloat)h, .5f ,150.0f); 71 glMatrixMode(GL_MODELVIEW); 72 73 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 74 glLoadIdentity(); 75 gluLookAt(0, 0, 6, 0, 0, 0, 0, 1, 0); 76 77 // Bind the texture stored at the zero index of g_Texture[] 78 //glBindTexture(GL_TEXTURE_2D, g_Texture[0]); 79 */ 80 81 107 this->setClassName ("GLMenuImageScreen"); 108 82 109 // Select Our VU Meter Background Texture 83 110 this->backMat = new Material("load_screen"); 84 this->ba ckMat->setDiffuseMap("pictures/load_screen.jpg");111 this->barMat = new Material("bar"); 85 112 this->maxValue = 10; 86 113 this->currentValue = 0; 87 114 this->setPosition(0,0); 115 this->setScale(1,1); 116 this->setBarPosScale( .6, .75, .3, .1); 88 117 // End of Background image code. 89 118 } 90 91 92 /**93 \brief function to innit screen with all attributes set94 \param name of the background-image file95 \param height of the ImageScreen96 \param width of the Image Screen97 \param x offset from (0, 0)98 \param y offset from (0, 0)99 100 GLMenu uses its own coordinating system: upper left corner is (0, 0). x-axis is down=height,101 right axis is right direction (=width)102 */103 void GLMenuImageScreen::init (char* backImageName, float height, float width,104 float offsetX, float offsetY)105 {}106 107 108 /**109 \brief draws the ImageScreen to the screenbuffer110 */111 void GLMenuImageScreen::draw ()112 {113 114 glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);115 116 PRINTF(4)("GLMenuImagEscreen::draw() - drawing step %i/%i\n",117 this->currentValue, this->maxValue);118 119 /* screen size */120 int screenWidth = 640;121 int screenHeight = 480;122 123 /* set image size */124 int imageWidth = 640;125 int imageHeight = 480;126 127 /* start pos of image */128 int offsetX = (screenWidth - imageWidth)/2;129 int offsetY = (screenHeight - imageHeight)/2;130 131 /* loadbar pos */132 int barX = 390;133 int barY = 50;134 int barWidth = 230;135 int barHeight = 30;136 137 float val = ((float)this->currentValue/(float)this->maxValue) * barWidth;138 if( val > (float)barWidth)139 val = (float)barWidth;140 141 glMatrixMode(GL_PROJECTION);142 glPushMatrix();143 glLoadIdentity();144 /* set up an ortho screen */145 glOrtho(0, screenWidth, 0, screenHeight, -1, 1);146 glMatrixMode(GL_MODELVIEW);147 glLoadIdentity();148 glPushMatrix();149 150 glEnable(GL_BLEND);151 glPushAttrib(GL_LIGHTING_BIT | GL_TRANSFORM_BIT);152 glDisable(GL_LIGHTING);153 154 /* draw the progress bar */155 glBegin(GL_QUADS);156 glColor3f(0.96, 0.84, 0.34);157 glVertex2i(barX, barY);158 glVertex2i(barX + (int)val, barY);159 glVertex2i(barX + (int)val, barY + barHeight);160 glVertex2i(barX, barY + barHeight);161 glColor3f(1.0, 1.0, 1.0);162 glEnd();163 164 glBegin(GL_QUADS);165 glColor3f(0.0, 0.0, 0.0);166 glVertex2i(barX, barY);167 glVertex2i(barX + barWidth, barY);168 glVertex2i(barX + barWidth, barY + barHeight);169 glVertex2i(barX, barY + barHeight);170 glColor3f(1.0, 1.0, 1.0);171 glEnd();172 173 /* draw black border */174 glBegin(GL_QUADS);175 glColor3f(0.0, 0.0, 0.0);176 glVertex2i(barX-1, barY-1);177 glVertex2i(barX + barWidth +1, barY-1);178 glVertex2i(barX + barWidth+1, barY + barHeight+1);179 glVertex2i(barX - 1, barY + barHeight +1);180 glColor3f(1.0, 1.0, 1.0);181 glEnd();182 183 /* draw white border */184 glBegin(GL_QUADS);185 glColor3f(1.0, 1.0, 1.0);186 glVertex2i(barX-2, barY-2);187 glVertex2i(barX + barWidth +2, barY-2);188 glVertex2i(barX + barWidth+2, barY + barHeight+2);189 glVertex2i(barX - 2, barY + barHeight +2);190 glColor3f(1.0, 1.0, 1.0);191 glEnd();192 193 backMat->select();194 glBegin(GL_QUADS);195 glTexCoord2i(0, 0); glVertex2i(offsetX, offsetY);196 glTexCoord2i(1, 0); glVertex2i(offsetX + imageWidth, offsetY);197 glTexCoord2i(1, 1); glVertex2i(offsetX + imageWidth, offsetY + imageHeight);198 glTexCoord2i(0, 1); glVertex2i(offsetX, offsetY + imageHeight);199 glEnd();200 glDisable(GL_TEXTURE_2D);201 202 glDisable(GL_BLEND);203 glPopMatrix();204 glMatrixMode(GL_PROJECTION);205 glPopMatrix();206 glPopAttrib();207 208 SDL_GL_SwapBuffers();209 }210 211 119 212 120 /** … … 214 122 \param file name of the backgroun-image 215 123 */ 216 void GLMenuImageScreen::setBackImageName (char* backImageName) 217 {} 124 void GLMenuImageScreen::setBackgroundImage (const char* backImageName) 125 { 126 this->backMat->setDiffuseMap(backImageName); 127 } 218 128 219 129 220 130 /** 221 131 \brief sets position of the ImageScreen 222 \param x offset from (0, 0)223 \param y offset from (0, 0)132 \param x offset from the top left corner in percent(0-1) of the screensize 133 \param y offset from the top left corner in percent(0-1) of the screensize 224 134 */ 225 135 void GLMenuImageScreen::setPosition(float offsetX, float offsetY) 226 {} 136 { 137 this->offsetX = offsetX; 138 this->offsetY = offsetY; 139 } 227 140 228 141 229 142 /* 230 143 \brief sets size of the ImageScreen 231 \param height of the ImageScreen 232 \param width of the Image Screen 233 */ 234 void GLMenuImageScreen::setSize(float height, float width) 235 {} 144 \param scaleX the scaleing of the image into the x-direction (in percent (0-1)) 145 \param scaleY the scaleing of the image into the y-direction (in percent (0-1)) 146 */ 147 void GLMenuImageScreen::setScale(float scaleX, float scaleY) 148 { 149 this->scaleX = scaleX; 150 this->scaleY = scaleY; 151 } 152 153 /** 154 \param barImage An image for the Bar 155 */ 156 void GLMenuImageScreen::setBarImage(const char* barImage) 157 { 158 this->barMat->setDiffuseMap(barImage); 159 } 160 161 /** 162 \brief sets the Position and the Size of the bar 163 \param barX The Position in the x-direction in percent of the screen (0-1) 164 \param barY The Position in the y-direction in percent of the screen (0-1) 165 \param barW The Size in the x-direction in percent of the screen (0-1) 166 \param barH The Size in the y-direction in percent of the screen (0-1) 167 */ 168 void GLMenuImageScreen::setBarPosScale(float barX, float barY, float barW, float barH) 169 { 170 this->barX = barX; 171 this->barY = barY; 172 this->barW = barW; 173 this->barH = barH; 174 } 236 175 237 176 … … 285 224 this->draw(); 286 225 } 226 227 228 229 /** 230 \brief draws the ImageScreen to the screenbuffer 231 */ 232 void GLMenuImageScreen::draw () 233 { 234 glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); 235 236 PRINTF(4)("GLMenuImagEscreen::draw() - drawing step %i/%i\n", 237 this->currentValue, this->maxValue); 238 239 /* screen size */ 240 int screenWidth = GraphicsEngine::getInstance()->getResolutionX(); 241 int screenHeight = GraphicsEngine::getInstance()->getResolutionY(); 242 243 int imageWidth = (int)(screenWidth * this->scaleX); 244 int imageHeight = (int)(screenHeight * this->scaleY); 245 246 int offsetX = (int)(this->offsetX * screenWidth); 247 int offsetY = (int)(this->offsetY * screenHeight); 248 249 /* loadbar pos */ 250 int barX = (int)(this->barX *screenWidth); 251 int barY = (int)(this->barY *screenHeight); 252 int barW = (int)(this->barW *screenWidth); 253 int barH = (int)(this->barH *screenHeight); 254 255 float val = (float)this->currentValue/(float)this->maxValue; 256 257 if( val > barW) 258 val = barW; 259 260 GraphicsEngine::enter2DMode(); 261 262 /* draw the BackGround */ 263 backMat->select(); 264 glBegin(GL_TRIANGLE_STRIP); 265 glTexCoord2i(0, 0); glVertex2i(offsetX, offsetY + imageHeight); 266 glTexCoord2i(1, 0); glVertex2i(offsetX +imageWidth, offsetY + imageHeight); 267 glTexCoord2i(0, 1); glVertex2i(offsetX, offsetY); 268 glTexCoord2i(1, 1); glVertex2i(offsetX + imageWidth, offsetY); 269 glEnd(); 270 271 glDisable(GL_TEXTURE_2D); 272 /* draw white border */ 273 glBegin(GL_LINE_LOOP); 274 glColor3f(1.0, 1.0, 1.0); 275 glVertex2i(barX - 2, barY - 2); 276 glVertex2i(barX + barW + 2, barY - 2); 277 glVertex2i(barX + barW + 2, barY + barH + 2); 278 glVertex2i(barX - 2, barY + barH + 2); 279 glColor3f(1.0, 1.0, 1.0); 280 glEnd(); 281 282 /* draw the progress bar */ 283 barMat->select(); 284 glBegin(GL_TRIANGLE_STRIP); 285 glTexCoord2f(0, 0); glVertex2i(barX, barY + barH); 286 glTexCoord2f(val, 0); glVertex2i(barX + (int)(val * this->barW * (float)screenWidth), barY + barH); 287 glTexCoord2f(0, 1); glVertex2i(barX, barY); 288 glTexCoord2f(val, 1); glVertex2i(barX + (int)(val * this->barW * (float)screenWidth), barY); 289 glEnd(); 290 291 /* 292 glBegin(GL_QUADS); 293 glColor3f(0.0, 0.0, 0.0); 294 glVertex2i(barX, barY); 295 glVertex2i(barX + barWidth, barY); 296 glVertex2i(barX + barWidth, barY + barHeight); 297 glVertex2i(barX, barY + barHeight); 298 glColor3f(1.0, 1.0, 1.0); 299 glEnd(); 300 301 /* draw black border 302 glBegin(GL_QUADS); 303 glColor3f(0.0, 0.0, 0.0); 304 glVertex2i(barX-1, barY-1); 305 glVertex2i(barX + barWidth +1, barY-1); 306 glVertex2i(barX + barWidth+1, barY + barHeight+1); 307 glVertex2i(barX - 1, barY + barHeight +1); 308 glColor3f(1.0, 1.0, 1.0); 309 glEnd(); 310 311 */ 312 313 GraphicsEngine::leave2DMode(); 314 315 SDL_GL_SwapBuffers(); 316 } 317 318 -
orxonox/branches/md2_loader/src/glmenu/glmenu_imagescreen.h
r3675 r4139 11 11 12 12 class Material; 13 class TiXmlElement; 13 14 14 15 class GLMenuImageScreen : public BaseObject { 15 16 16 p rivate:17 public: 17 18 GLMenuImageScreen (); 18 19 public:19 GLMenuImageScreen (TiXmlElement* root); 20 void load(TiXmlElement* root); 20 21 virtual ~GLMenuImageScreen (); 21 22 static GLMenuImageScreen* getInstance();23 24 static GLMenuImageScreen* singletonRef;25 22 26 23 void init (); 27 void init (char* backImageName, float height, float width,28 float offsetX, float offsetY);29 24 30 25 void draw (); 31 26 32 void setBackImageName (char* backImageName); 33 void setPosition (float offsetX, float offsetY); 34 void setSize (float height, float width); 35 27 void setBackgroundImage(const char* backImageName); 28 void setPosition(float offsetX, float offsetY); 29 void setScale (float scaleX, float scaleY); 30 31 void setBarImage(const char* barImage); 32 void setBarPosScale(float barX, float barY, float barW, float barH); 33 36 34 void setMaximum (int maxValue); 37 35 int getMaximum (); … … 42 40 private: 43 41 char* backImageName; //!< the name of the file of the background image 44 float height, width;//!< hight and width of the image42 float scaleX, scaleY; //!< hight and width of the image 45 43 float offsetX, offsetY; //!< offset of the image from left and up 46 44 Material* backMat; //!< Background Material. 45 float barX, barY, barW, barH; //!< Position and Scale of the bar. 46 Material* barMat; //!< A Material for the Loading-Bar 47 47 48 48 /* progress bar values */ -
orxonox/branches/md2_loader/src/lib/Makefile.in
r4063 r4139 113 113 PACKAGE_VERSION = @PACKAGE_VERSION@ 114 114 PATH_SEPARATOR = @PATH_SEPARATOR@ 115 PKG_CONFIG = @PKG_CONFIG@ 115 116 RANLIB = @RANLIB@ 116 117 SET_MAKE = @SET_MAKE@ -
orxonox/branches/md2_loader/src/lib/graphics/Makefile.in
r4063 r4139 113 113 PACKAGE_VERSION = @PACKAGE_VERSION@ 114 114 PATH_SEPARATOR = @PATH_SEPARATOR@ 115 PKG_CONFIG = @PKG_CONFIG@ 115 116 RANLIB = @RANLIB@ 116 117 SET_MAKE = @SET_MAKE@ -
orxonox/branches/md2_loader/src/lib/graphics/graphics_engine.cc
r4126 r4139 17 17 18 18 #include "graphics_engine.h" 19 #include "resource_manager.h" 19 20 20 21 #include "debug.h" … … 34 35 this->maxFPS = 0; 35 36 this->setClassName ("GraphicsEngine"); 37 38 this->fullscreen = false; 39 36 40 this->initVideo(); 37 41 … … 105 109 106 110 // TO DO: Create a cool icon and use it here 107 SDL_WM_SetIcon(SDL_LoadBMP("../data/pictures/orxonox-icon32x32.bmp"), NULL); 108 111 char* loadPic = new char[strlen(ResourceManager::getInstance()->getDataDir())+ 100]; 112 sprintf(loadPic, "%s%s", ResourceManager::getInstance()->getDataDir(), "pictures/orxonox-icon32x32.bmp"); 113 SDL_WM_SetIcon(SDL_LoadBMP(loadPic), NULL); 114 delete loadPic; 109 115 // Enable default GL stuff 110 116 glEnable(GL_DEPTH_TEST); … … 141 147 int GraphicsEngine::setResolution(int width, int height, int bpp) 142 148 { 149 Uint32 fullscreenFlag; 143 150 this->resolutionX = width; 144 151 this->resolutionY = height; 145 152 this->bitsPerPixel = bpp; 153 if (this->fullscreen) 154 fullscreenFlag = SDL_FULLSCREEN; 155 else 156 fullscreenFlag = 0; 146 157 147 158 printf ("ok\n"); 148 if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags )) == NULL)159 if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags | fullscreenFlag)) == NULL) 149 160 { 150 161 PRINTF(1)("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags, SDL_GetError()); … … 152 163 // return -1; 153 164 } 154 165 } 166 167 void GraphicsEngine::setFullscreen(bool fullscreen) 168 { 169 this->fullscreen = fullscreen; 170 this->setResolution(this->resolutionX, this->resolutionY, this->bitsPerPixel); 155 171 } 156 172 … … 258 274 /* Check if our resolution is restricted */ 259 275 if(this->videoModes == (SDL_Rect **)-1){ 260 PRINTF( 1)("All resolutions available.\n");276 PRINTF(2)("All resolutions available.\n"); 261 277 } 262 278 else{ … … 264 280 PRINT(0)("Available Resoulution Modes are\n"); 265 281 for(int i = 0; this->videoModes[i]; ++i) 266 PRINT( 0)(" | %d x %d\n", this->videoModes[i]->w, this->videoModes[i]->h);282 PRINT(4)(" | %d x %d\n", this->videoModes[i]->w, this->videoModes[i]->h); 267 283 } 268 284 } -
orxonox/branches/md2_loader/src/lib/graphics/graphics_engine.h
r4070 r4139 26 26 int setGLattribs(void); 27 27 int setResolution(int width, int height, int bpp); 28 void setFullscreen(bool fullscreen = false); 28 29 /** \returns the x resolution */ 29 30 inline int getResolutionX(void) {return this->resolutionX;} -
orxonox/branches/md2_loader/src/lib/graphics/importer/Makefile.in
r4078 r4139 42 42 subdir = src/lib/graphics/importer 43 43 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ 44 $(srcdir)/Makefile.in TODO44 $(srcdir)/Makefile.in 45 45 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 46 46 am__aclocal_m4_deps = $(top_srcdir)/configure.ac … … 144 144 PACKAGE_VERSION = @PACKAGE_VERSION@ 145 145 PATH_SEPARATOR = @PATH_SEPARATOR@ 146 PKG_CONFIG = @PKG_CONFIG@ 146 147 RANLIB = @RANLIB@ 147 148 SET_MAKE = @SET_MAKE@ -
orxonox/branches/md2_loader/src/lib/graphics/importer/array.cc
r3590 r4139 112 112 113 113 /** 114 \brief Gives back the array !! MUST be executed AFTER finalize.115 \returns The created array.116 */117 GLfloat* Array::getArray ()118 {119 return this->array;120 }121 122 /**123 \returns The Count of entries in the Array124 */125 int Array::getCount()126 {127 return this->entryCount;128 }129 130 /**131 114 \brief Simple debug info about the Array 132 115 */ 133 void Array::debug ( )116 void Array::debug (void) const 134 117 { 135 118 PRINT(0)("entryCount=%i, address=%p\n", this->entryCount, this->array); -
orxonox/branches/md2_loader/src/lib/graphics/importer/array.h
r3590 r4139 23 23 void addEntry(GLfloat entry0, GLfloat entry1, GLfloat entry2); 24 24 25 GLfloat* getArray (); 26 int getCount(); 27 void debug(void); 25 /** \returns The array */ 26 inline const GLfloat* getArray () const {return this->array;} 27 /** \returns The Count of entries in the Array*/ 28 inline int getCount(void)const {return this->entryCount;} 29 void debug(void) const ; 28 30 private: 29 31 //! One entry of the Array -
orxonox/branches/md2_loader/src/lib/graphics/importer/framework.cc
r3910 r4139 79 79 obj = new OBJModel(argv[1]); 80 80 else 81 obj = new PrimitiveModel( SPHERE);81 obj = new PrimitiveModel(CYLINDER); 82 82 83 83 M = Vector(wHandler.screen->w/2, wHandler.screen->h/2, 0); -
orxonox/branches/md2_loader/src/lib/graphics/importer/material.cc
r3966 r4139 45 45 this->setTransparency(1.0); 46 46 47 48 47 this->diffuseTexture = NULL; 49 48 this->ambientTexture = NULL; 50 49 this->specularTexture = NULL; 51 52 this->diffuseTextureSet = false;53 this->ambientTextureSet = false;54 this->specularTextureSet = false;55 50 56 51 this->setName(mtlName); … … 107 102 glShadeModel(GL_SMOOTH); 108 103 109 if (this->diffuseTexture Set)104 if (this->diffuseTexture) 110 105 { 111 106 glEnable(GL_TEXTURE_2D); … … 300 295 { 301 296 PRINTF(4)("setting Diffuse Map %s\n", dMap); 302 // diffuseTexture = new Texture();303 // this->diffuseTextureSet = diffuseTexture->loadImage(dMap);304 297 305 298 //! \todo check if RESOURCE MANAGER is availiable 306 299 //! \todo Textures from .mtl-file need special care. 307 this->diffuseTexture Set = this->diffuseTexture= (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE);300 this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE); 308 301 } 309 302 -
orxonox/branches/md2_loader/src/lib/graphics/importer/material.h
r3914 r4139 67 67 Texture* ambientTexture; //!< The ambient texture of the Material. 68 68 Texture* specularTexture;//!< The specular texture of the Material. 69 70 bool diffuseTextureSet; //!< Chekcs if the diffuse texture is Set.71 bool ambientTextureSet; //!< Chekcs if the ambient texture is Set.72 bool specularTextureSet;//!< Chekcs if the specular texture is Set.73 74 69 }; 75 70 #endif -
orxonox/branches/md2_loader/src/lib/graphics/importer/model.cc
r4063 r4139 36 36 ModelFaceElement::ModelFaceElement() 37 37 { 38 this->vertexNumber = -1; 39 this->normalNumber = -1; 40 this->texCoordNumber = -1; 41 38 42 this->next = NULL; 39 43 } … … 140 144 this->currentGroup = this->firstGroup = new ModelGroup; 141 145 this->groupCount = 0; 146 this->vertexCount = 0; 147 this->normalCount = 0; 148 this->texCoordCount = 0; 142 149 143 150 this->scaleFactor = 1; … … 355 362 Material* Model::addMaterial(const char* materialName) 356 363 { 357 358 364 Material* newMat = new Material(); 359 365 newMat->setName(materialName); … … 424 430 PRINTF(5)("reading in a vertex: %f %f %f\n", &subbuffer1, &subbuffer2, &subbuffer3); 425 431 this->vertices->addEntry(subbuffer1*scaleFactor, subbuffer2*scaleFactor, subbuffer3*scaleFactor); 432 this->vertexCount++; 426 433 return true; 427 434 } … … 438 445 PRINTF(5)("reading in a vertex: %f %f %f\n", x, y, z); 439 446 this->vertices->addEntry(x*scaleFactor, y*scaleFactor, z*scaleFactor); 447 this->vertexCount++; 440 448 return true; 441 449 } … … 455 463 PRINTF(5)("found vertex-Normal %f, %f, %f\n", &subbuffer1,&subbuffer2,&subbuffer3); 456 464 this->normals->addEntry(subbuffer1, subbuffer2, subbuffer3); 465 this->normalCount++; 457 466 return true; 458 467 } … … 470 479 PRINTF(5)("found vertex-Normal %f, %f, %f\n", x, y, z); 471 480 this->normals->addEntry(x, y, z); 481 this->normalCount++; 482 return true; 472 483 } 473 484 … … 487 498 this->vTexture->addEntry(subbuffer1); 488 499 this->vTexture->addEntry(subbuffer2); 500 this->texCoordCount++; 489 501 return true; 490 502 } … … 502 514 this->vTexture->addEntry(u); 503 515 this->vTexture->addEntry(v); 516 this->texCoordCount++; 517 return true; 504 518 } 505 519 … … 509 523 510 524 If a face line is found this function will add it to the glList. 525 526 String is different from the argument addFace, in this that the first Vertex/Normal/Texcoord is 1 instead of 0 511 527 */ 512 528 bool Model::addFace (const char* faceString) … … 546 562 if (vertex) 547 563 tmpElem->vertexNumber = atoi(vertex)-1; 548 else549 tmpElem->vertexNumber = -1;550 564 if (texture) 551 565 tmpElem->texCoordNumber = atoi(texture)-1; 552 else553 tmpElem->texCoordNumber = -1;554 566 if (normal) 555 567 tmpElem->normalNumber = atoi(normal)-1; 556 else557 tmpElem->normalNumber = -1;558 568 559 569 faceString += tmpLen; … … 569 579 \brief adds a new Face 570 580 \param faceElemCount the number of Vertices to add to the Face. 571 \param type 0: vertex only, 1: vertex and normal, 2: vertex and Texture, 3 vertex, normal and texture581 \param type The information Passed with each Vertex 572 582 */ 573 583 bool Model::addFace(int faceElemCount, VERTEX_FORMAT type, ...) … … 583 593 for (int i = 0; i < faceElemCount; i++) 584 594 { 585 if (this->currentGroup->currentFace->vertexCount >0)595 if (this->currentGroup->currentFace->vertexCount > 0) 586 596 tmpElem = tmpElem->next = new ModelFaceElement; 587 597 588 tmpElem->vertexNumber = va_arg (itemlist, int) -1;598 tmpElem->vertexNumber = va_arg (itemlist, int); 589 599 if (type & TEXCOORD) 590 tmpElem->texCoordNumber = va_arg (itemlist, int) -1;600 tmpElem->texCoordNumber = va_arg (itemlist, int); 591 601 if (type & NORMAL) 592 tmpElem->normalNumber = va_arg(itemlist, int) -1;602 tmpElem->normalNumber = va_arg(itemlist, int); 593 603 this->currentGroup->currentFace->vertexCount++; 594 604 } … … 693 703 } 694 704 695 for (int i=0; i <vertices->getCount()/3;i++)705 for (int i=0; i < vertices->getCount()/3;i++) 696 706 { 697 707 normArray[i].normalize(); 698 708 PRINTF(5)("Found Normale number %d: (%f; %f, %f).\n", i, normArray[i].x, normArray[i].y, normArray[i].z); 699 709 700 this-> normals->addEntry(normArray[i].x, normArray[i].y, normArray[i].z);710 this->addVertexNormal(normArray[i].x, normArray[i].y, normArray[i].z); 701 711 702 712 } … … 834 844 835 845 if (elem->texCoordNumber != -1) 836 glTexCoord2fv(this->vTexture->getArray() + elem->texCoordNumber * 2); 846 { 847 if (likely(elem->texCoordNumber < this->texCoordCount)) 848 glTexCoord2fv(this->vTexture->getArray() + elem->texCoordNumber * 2); 849 else 850 PRINTF(2)("TextureCoordinate %d is not in the List (max: %d)\nThe Model might be incomplete\n", 851 elem->texCoordNumber, this->texCoordCount); 852 } 837 853 if (elem->normalNumber != -1) 838 glNormal3fv(this->normals->getArray() + elem->normalNumber * 3); 854 { 855 if (likely(elem->normalNumber < this->normalCount)) 856 glNormal3fv(this->normals->getArray() + elem->normalNumber * 3); 857 else 858 PRINTF(2)("Normal %d is not in the List (max: %d)\nThe Model might be incomplete", 859 elem->normalNumber, this->normalCount); 860 } 839 861 if (elem->vertexNumber != -1) 840 glVertex3fv(this->vertices->getArray() + elem->vertexNumber * 3); 862 { 863 if (likely(elem->vertexNumber < this->vertexCount)) 864 glVertex3fv(this->vertices->getArray() + elem->vertexNumber * 3); 865 else 866 PRINTF(2)("Vertex %d is not in the List (max: %d)\nThe Model might be incomplete", 867 elem->vertexNumber, this->vertexCount); 868 } 869 841 870 } 842 871 … … 897 926 this->addVertexNormal (-1.0, 0.0, 0.0); 898 927 899 /* normaleLess-testingMode 900 this->addFace ("1 2 4 3"); 901 this->addFace ("3 4 6 5"); 902 this->addFace ("5 6 8 7"); 903 this->addFace ("7 8 2 1"); 904 this->addFace ("2 8 6 4"); 905 this->addFace ("7 1 3 5"); 906 */ 907 908 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,1,1, 2,2,2, 4,4,3, 3,3,4); 909 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 3,3,5, 4,4,6, 6,6,7, 5,5,8); 910 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 5,5,9, 6,6,10, 8,8,11, 7,7,12); 911 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,7,13, 8,8,14, 2,10,15, 1,9,16); 912 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,2,17, 8,11,18, 6,12,19, 4,4,20); 913 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,13,21, 1,1,22, 3,3,23, 5,14,24); 914 915 } 928 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,0, 1,1,1, 3,3,2, 2,2,3); 929 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,2,4, 3,3,5, 5,5,6, 4,4,7); 930 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,4,8, 5,5,9, 7,7,10, 6,6,11); 931 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,6,12, 7,7,13, 1,9,14, 0,8,15); 932 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,1,16, 7,10,17, 5,11,18, 3,3,19); 933 this->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,12,20, 0,0,21, 2,2,22, 4,13,23); 934 935 } -
orxonox/branches/md2_loader/src/lib/graphics/importer/model.h
r4065 r4139 100 100 bool finalized; //!< Sets the Object to be finalized. 101 101 102 int vertexCount; //!< A modelwide Counter for vertices. 103 int normalCount; //!< A modelwide Counter for the normals. 104 int texCoordCount; //!< A modelwide Counter for the texCoord. 102 105 Array* vertices; //!< The Array that handles the Vertices. 103 int verticesCount; //!< A global Counter for vertices.104 106 Array* normals; //!< The Array that handles the Normals. 105 107 Array* vTexture; //!< The Array that handles the VertexTextureCoordinates. … … 159 161 bool setMaterial(Material* mtl); 160 162 void finalize(void); 163 164 /** \returns The number of Vertices of the Model */ 165 inline int getVertexCount(void) const {return this->vertexCount;} 166 /** \returns The number of Normals of the Model */ 167 inline int getNormalCount(void) const {return this->normalCount;} 168 /** \returns The number of Texture Coordinates of the Model*/ 169 inline int getTexCoordCount(void) const {return this->texCoordCount;} 161 170 }; 162 171 -
orxonox/branches/md2_loader/src/lib/graphics/importer/objModel.cc
r4063 r4139 34 34 OBJModel::OBJModel(const char* fileName, float scaling) : Model(fileName) 35 35 { 36 this->initializeOBJ(); 36 this->objPath = "./"; 37 37 38 this->scaleFactor = scaling; 38 39 … … 52 53 if (this->objPath) 53 54 delete []this->objPath; 54 if (this->objFileName)55 delete []this->objFileName;56 if (this->mtlFileName)57 delete []this->mtlFileName;58 }59 60 /**61 \brief Initializes an obj-model62 */63 void OBJModel::initializeOBJ(void)64 {65 this->objPath = NULL;66 this->objFileName = NULL;67 this->mtlFileName = NULL;68 55 } 69 56 … … 71 58 \brief Imports a obj file and handles the the relative location 72 59 \param fileName The file to import 60 61 Splits the FileName from the DirectoryName 73 62 */ 74 63 bool OBJModel::importFile (const char* fileName) 75 64 { 76 65 PRINTF(4)("preparing to read in file: %s\n", fileName); 77 78 79 #ifdef __WIN32__ 80 // win32 path reading 81 char pathSplitter= '\\'; 82 #else /* __WIN32__ */ 83 // unix path reading 84 char pathSplitter='/'; 85 #endif /* __WIN32__ */ 86 char* tmpName; 87 strcpy(tmpName, fileName); 88 if (tmpName[0] == pathSplitter) 89 tmpName++; 90 char* name = tmpName; 91 while (( tmpName = strchr (tmpName+1, pathSplitter))) 92 { 93 name = tmpName+1; 94 } 95 this->objPath = new char[name-fileName+1]; 96 strncpy(this->objPath, fileName, name-fileName); 97 this->objPath[name-fileName] = '\0'; 98 if (strlen(objPath)> 0) 99 PRINTF(5)("Resolved file %s to folder: %s.\n", name, objPath); 100 else 101 PRINTF(5)("Resolved file %s.\n", name); 102 103 this->setName(name); 104 105 this->objFileName = new char[strlen(name)+1]; 106 strcpy (this->objFileName, name); 107 this->readFromObjFile (); 66 // splitting the 67 char* split = NULL; 68 69 if (!(split = strrchr(fileName, '/'))) 70 split = strrchr(fileName, '\\'); // windows Case 71 if (split) 72 { 73 int len = split - fileName+1; 74 this->objPath = new char[len +2]; 75 strncpy(this->objPath, fileName, len); 76 this->objPath[len] = '\0'; 77 PRINTF(1)("Resolved file %s to Path %s.\n", fileName, this->objPath); 78 } 79 this->readFromObjFile (fileName); 108 80 return true; 109 81 } … … 113 85 This function does read the file, parses it for the occurence of things like vertices, faces and so on, and executes the specific tasks 114 86 */ 115 bool OBJModel::readFromObjFile (void) 116 { 117 char* fileName = new char [strlen(objPath)+strlen(objFileName)+1]; 118 if (this->objFileName != NULL && !strcmp(this->objFileName, "")) 119 return false; 120 strcpy(fileName, this->objPath); 121 strcat(fileName, this->objFileName); 122 87 bool OBJModel::readFromObjFile(const char* fileName) 88 { 123 89 FILE* stream; 124 90 if( (stream = fopen (fileName, "r")) == NULL) 125 91 { 126 printf(" IniParser could not open%s\n", fileName);92 printf("Object File Could not be Opened %s\n", fileName); 127 93 return false; 128 94 } … … 179 145 } 180 146 fclose (stream); 181 delete []fileName;182 147 return true; 183 148 } … … 194 159 bool OBJModel::readMtlLib (const char* mtlFile) 195 160 { 196 this->mtlFileName = new char [strlen(mtlFile)+1]; 197 strcpy(this->mtlFileName, mtlFile); 198 char* fileName = new char [strlen(this->objPath) + strlen(this->mtlFileName)+1]; 199 sprintf(fileName, "%s%s", this->objPath, this->mtlFileName); 200 161 char* fileName = new char [strlen(this->objPath) + strlen(mtlFile)+1]; 162 sprintf(fileName, "%s%s", this->objPath, mtlFile); 201 163 202 164 FILE* stream; 203 165 if( (stream = fopen (fileName, "r")) == NULL) 204 166 { 205 printf("IniParser could not open %s\n", fileName); 167 PRINTF(2)("MaterialLibrary could not be opened %s\n", fileName); 168 delete []fileName; 206 169 return false; 207 170 } -
orxonox/branches/md2_loader/src/lib/graphics/importer/objModel.h
r3916 r4139 15 15 OBJModel(const char* fileName, float scaling = 1.0); 16 16 virtual ~OBJModel(); 17 void initializeOBJ(void);18 17 19 18 private: 20 19 // Variables 21 20 char* objPath; //!< The Path where the obj and mtl-file are located. 22 char* objFileName; //!< The Name of the obj-file.23 char* mtlFileName; //!< The Name of the mtl-file (parsed out of the obj-file)24 21 25 22 ///// readin ///// 26 23 bool importFile (const char* fileName); 27 bool readFromObjFile ( void);24 bool readFromObjFile (const char* fileName); 28 25 bool readMtlLib (const char* matFile); 29 26 }; -
orxonox/branches/md2_loader/src/lib/graphics/importer/primitive_model.cc
r3911 r4139 71 71 void PrimitiveModel::sphereModel(float size, unsigned int detail) 72 72 { 73 int vertexCount = 0;74 73 if (detail <= 0) 75 74 detail = 1; … … 89 88 size * sin(vi) * cos(vj)); 90 89 this->addVertexTexture(i / (df *2.0), (j-1.0)/(df)+.5); 91 vertexCount++;92 90 } 93 91 } 94 92 this->addVertex(0, -size, 0); 93 this->addVertexTexture(0,0); 95 94 this->addVertex(0, size, 0); 95 this->addVertexTexture(0 ,1); 96 96 97 97 // defining the binding Faces. … … 102 102 { 103 103 104 v1 = i*detail + j ;105 v4 = i*detail + (j+1);104 v1 = i*detail + j-1; 105 v4 = i*detail + j; 106 106 107 107 if (i == detail*2 -1) 108 108 { 109 v2 = j ;110 v3 = j +1;109 v2 = j-1; 110 v3 = j; 111 111 } 112 112 else 113 113 { 114 v2 = (i+1)*detail + j ;115 v3 = (i+1)*detail + (j+1);116 } 117 114 v2 = (i+1)*detail + j-1; 115 v3 = (i+1)*detail + j; 116 } 117 118 118 if (j == 0) 119 119 { 120 v1 = vertexCount+1;120 v1 = this->getVertexCount()-2; 121 121 this->addFace(3, VERTEX_TEXCOORD, v1, v1, v3, v3, v4, v4); 122 122 } 123 123 else if (j == detail) 124 124 { 125 v3 = vertexCount+2;125 v3 = this->getVertexCount()-1; 126 126 this->addFace(3, VERTEX_TEXCOORD, v1, v1, v2, v2, v3, v3); 127 127 } … … 157 157 { 158 158 int p1, p2, p3, p4; 159 p1 = 2*i +1;160 p2 = 2*i+ 2;161 p3 = 2*i+ 4;162 p4 = 2*i+ 3;159 p1 = 2*i; 160 p2 = 2*i+1; 161 p3 = 2*i+3; 162 p4 = 2*i+2; 163 163 // something is wrong here 164 164 this->addFace(4, VERTEX_ONLY, p1, p2, p3, p4); 165 this->addFace(3, VERTEX_ONLY, p4, p1, 2*detail +1);166 this->addFace(3, VERTEX_ONLY, p2, p3, 2*detail+ 2);165 this->addFace(3, VERTEX_ONLY, p4, p1, 2*detail); 166 this->addFace(3, VERTEX_ONLY, p2, p3, 2*detail+1); 167 167 } 168 168 // caps 169 this->addFace(4, VERTEX_ONLY, 2*detail- 1, 2*detail, 2, 1);170 this->addFace(3, VERTEX_ONLY, 1, 2*detail-1, 2*detail+1);171 this->addFace(3, VERTEX_ONLY, 2*detail , 2, 2*detail+2);169 this->addFace(4, VERTEX_ONLY, 2*detail-2, 2*detail-1, 1, 0); 170 this->addFace(3, VERTEX_ONLY, 0, 2*detail-2, 2*detail); 171 this->addFace(3, VERTEX_ONLY, 2*detail-1, 1, 2*detail+1); 172 172 } 173 173 … … 198 198 { 199 199 unsigned int v1, v2; 200 v1 = i+ 3;200 v1 = i+2; 201 201 if (i == detail -1) 202 v2 = 3;202 v2 = 2; 203 203 else 204 v2 = i+ 4;205 this->addFace(3, VERTEX_ONLY, 1, v1, v2);206 this->addFace(3, VERTEX_ONLY, 2, v1, v2);204 v2 = i+3; 205 this->addFace(3, VERTEX_ONLY, 0, v1, v2); 206 this->addFace(3, VERTEX_ONLY, 1, v1, v2); 207 207 } 208 208 } … … 228 228 unsigned int v1, v2, v3, v4; 229 229 for (int i = 0; i < detail-1; i++) 230 for (int j = 1; j < detail; j++)230 for (int j = 0; j < detail-1; j++) 231 231 { 232 232 v1 = i*detail + j; -
orxonox/branches/md2_loader/src/lib/graphics/particles/particle_system.cc
r4017 r4139 40 40 this->particleType = type; 41 41 this->particles = NULL; 42 this->deadList = NULL; 42 43 this->setConserve(.8); 43 44 this->setLifeSpan(.1); … … 57 58 // delete what has to be deleted here 58 59 ParticleEngine::getInstance()->removeSystem(this); 60 61 // deleting all the living Particles 62 while (this->particles) 63 { 64 Particle* tmpDelPart = this->particles; 65 this->particles = this->particles->next; 66 delete tmpDelPart; 67 } 68 69 // deleting all the dead particles 70 while (this->deadList) 71 { 72 Particle* tmpDelPart = this->deadList; 73 this->deadList = this->deadList->next; 74 delete tmpDelPart; 75 } 59 76 } 60 77 … … 199 216 { 200 217 prevPart->next = tickPart->next; 201 delete tickPart; 218 tickPart->next = this->deadList; 219 this->deadList = tickPart; 202 220 tickPart = prevPart->next; 203 221 } … … 206 224 prevPart = NULL; 207 225 this->particles = tickPart->next; 208 delete tickPart; 226 tickPart->next = this->deadList; 227 this->deadList = tickPart; 209 228 tickPart = this->particles; 210 229 } … … 266 285 if (unlikely(particles == NULL)) 267 286 { 268 this->particles = new Particle; 287 if (likely(deadList != NULL)) 288 { 289 this->particles = this->deadList; 290 deadList = deadList->next; 291 } 292 else 293 this->particles = new Particle; 269 294 this->particles->next = NULL; 270 295 } … … 272 297 else 273 298 { 274 Particle* tmpPart = new Particle; 299 Particle* tmpPart; 300 if (likely(deadList != NULL)) 301 { 302 tmpPart = this->deadList; 303 deadList = deadList->next; 304 } 305 else 306 tmpPart = new Particle; 275 307 tmpPart->next = this->particles; 276 308 this->particles = tmpPart; … … 300 332 PRINT(0)(" ParticleSystem %s\n", this->name); 301 333 PRINT(0)(" ParticleCount: %d, maximumCount: %d :: filled %d%%\n", this->count, this->maxCount, 100*this->count/this->maxCount); 302 } 334 if (deadList) 335 { 336 PRINT(0)(" - ParticleDeadList is used: "); 337 int i = 1; 338 Particle* tmpPart = this->deadList; 339 while (tmpPart = tmpPart->next) ++i; 340 PRINT(0)("count: %d\n", i); 341 } 342 } -
orxonox/branches/md2_loader/src/lib/graphics/particles/particle_system.h
r4017 r4139 92 92 Material* material; //!< A Material for all the Particles. 93 93 Particle* particles; //!< A list of particles of this System. 94 Particle* deadList; //!< A list of dead Particles in the System. 94 95 95 96 GLuint* glID; //!< A List of different gl-List-ID's -
orxonox/branches/md2_loader/src/lib/gui/Makefile.in
r4063 r4139 113 113 PACKAGE_VERSION = @PACKAGE_VERSION@ 114 114 PATH_SEPARATOR = @PATH_SEPARATOR@ 115 PKG_CONFIG = @PKG_CONFIG@ 115 116 RANLIB = @RANLIB@ 116 117 SET_MAKE = @SET_MAKE@ -
orxonox/branches/md2_loader/src/lib/gui/console/Makefile.in
r4063 r4139 132 132 PACKAGE_VERSION = @PACKAGE_VERSION@ 133 133 PATH_SEPARATOR = @PATH_SEPARATOR@ 134 PKG_CONFIG = @PKG_CONFIG@ 134 135 RANLIB = @RANLIB@ 135 136 SET_MAKE = @SET_MAKE@ -
orxonox/branches/md2_loader/src/lib/gui/gui/Makefile.am
r4063 r4139 7 7 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/coord 8 8 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/data 9 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gaphics 10 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/font 9 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics 11 10 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/graphics/importer 12 11 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gui 13 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/gui/gui14 12 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/lang 15 13 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib/util … … 20 18 AM_CXXFLAGS+=-I$(MAINSRCDIR)/glmenu 21 19 AM_CXXFLAGS+=-I$(MAINSRCDIR)/ai 20 AM_CXXFLAGS+=-I$(MAINSRCDIR)/util 21 AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/animation 22 AM_CXXFLAGS+=-I$(MAINSRCDIR)/util/common 22 23 23 24 #AM_LDFLAGS=$(GTK2_LIBS) $(GTHREAD_LIBS) … … 35 36 gui_banner.cc \ 36 37 gui_keys.cc \ 37 gui_update.cc 38 gui_update.cc \ 39 $(MAINSRCDIR)/lib/graphics/graphics_engine.cc \ 40 $(MAINSRCDIR)/lib/lang/base_object.cc \ 41 $(MAINSRCDIR)/lib/math/vector.cc \ 42 $(MAINSRCDIR)/util/resource_manager.cc \ 43 $(MAINSRCDIR)/lib/graphics/text_engine.cc \ 44 $(MAINSRCDIR)/lib/coord/p_node.cc \ 45 $(MAINSRCDIR)/lib/coord/null_parent.cc \ 46 $(MAINSRCDIR)/lib/graphics/importer/array.cc \ 47 $(MAINSRCDIR)/lib/graphics/importer/model.cc \ 48 $(MAINSRCDIR)/lib/graphics/importer/objModel.cc \ 49 $(MAINSRCDIR)/lib/graphics/importer/material.cc \ 50 $(MAINSRCDIR)/lib/graphics/importer/texture.cc \ 51 $(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc 38 52 39 53 noinst_HEADERS=gui.h \ -
orxonox/branches/md2_loader/src/lib/gui/gui/Makefile.in
r4063 r4139 56 56 gui_element.$(OBJEXT) gui_video.$(OBJEXT) gui_audio.$(OBJEXT) \ 57 57 gui_exec.$(OBJEXT) gui_flags.$(OBJEXT) gui_banner.$(OBJEXT) \ 58 gui_keys.$(OBJEXT) gui_update.$(OBJEXT) 58 gui_keys.$(OBJEXT) gui_update.$(OBJEXT) \ 59 graphics_engine.$(OBJEXT) base_object.$(OBJEXT) \ 60 vector.$(OBJEXT) resource_manager.$(OBJEXT) \ 61 text_engine.$(OBJEXT) p_node.$(OBJEXT) null_parent.$(OBJEXT) \ 62 array.$(OBJEXT) model.$(OBJEXT) objModel.$(OBJEXT) \ 63 material.$(OBJEXT) texture.$(OBJEXT) primitive_model.$(OBJEXT) 59 64 gui_OBJECTS = $(am_gui_OBJECTS) 60 65 gui_LDADD = $(LDADD) … … 62 67 depcomp = $(SHELL) $(top_srcdir)/depcomp 63 68 am__depfiles_maybe = depfiles 64 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/gui.Po ./$(DEPDIR)/gui_audio.Po \ 65 @AMDEP_TRUE@ ./$(DEPDIR)/gui_banner.Po \ 69 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/array.Po \ 70 @AMDEP_TRUE@ ./$(DEPDIR)/base_object.Po \ 71 @AMDEP_TRUE@ ./$(DEPDIR)/graphics_engine.Po ./$(DEPDIR)/gui.Po \ 72 @AMDEP_TRUE@ ./$(DEPDIR)/gui_audio.Po ./$(DEPDIR)/gui_banner.Po \ 66 73 @AMDEP_TRUE@ ./$(DEPDIR)/gui_element.Po ./$(DEPDIR)/gui_exec.Po \ 67 74 @AMDEP_TRUE@ ./$(DEPDIR)/gui_flags.Po ./$(DEPDIR)/gui_gtk.Po \ 68 75 @AMDEP_TRUE@ ./$(DEPDIR)/gui_keys.Po ./$(DEPDIR)/gui_main.Po \ 69 @AMDEP_TRUE@ ./$(DEPDIR)/gui_update.Po ./$(DEPDIR)/gui_video.Po 76 @AMDEP_TRUE@ ./$(DEPDIR)/gui_update.Po ./$(DEPDIR)/gui_video.Po \ 77 @AMDEP_TRUE@ ./$(DEPDIR)/material.Po ./$(DEPDIR)/model.Po \ 78 @AMDEP_TRUE@ ./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/objModel.Po \ 79 @AMDEP_TRUE@ ./$(DEPDIR)/p_node.Po \ 80 @AMDEP_TRUE@ ./$(DEPDIR)/primitive_model.Po \ 81 @AMDEP_TRUE@ ./$(DEPDIR)/resource_manager.Po \ 82 @AMDEP_TRUE@ ./$(DEPDIR)/text_engine.Po ./$(DEPDIR)/texture.Po \ 83 @AMDEP_TRUE@ ./$(DEPDIR)/vector.Po 70 84 CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 71 85 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) … … 136 150 PACKAGE_VERSION = @PACKAGE_VERSION@ 137 151 PATH_SEPARATOR = @PATH_SEPARATOR@ 152 PKG_CONFIG = @PKG_CONFIG@ 138 153 RANLIB = @RANLIB@ 139 154 SET_MAKE = @SET_MAKE@ … … 187 202 target_vendor = @target_vendor@ 188 203 MAINSRCDIR = ../../.. 189 AM_CXXFLAGS = $(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS) -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/g aphics -I$(MAINSRCDIR)/lib/graphics/font -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/gui/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai204 AM_CXXFLAGS = $(GTK2_CFLAGS) $(GTHREAD_CFLAGS) $(CURL_CFLAGS) $(MSBITFIELDS) -I$(MAINSRCDIR) -I$(MAINSRCDIR)/world_entities -I$(MAINSRCDIR)/story_entities -I$(MAINSRCDIR)/lib -I$(MAINSRCDIR)/lib/coord -I$(MAINSRCDIR)/lib/data -I$(MAINSRCDIR)/lib/graphics -I$(MAINSRCDIR)/lib/graphics/importer -I$(MAINSRCDIR)/lib/gui -I$(MAINSRCDIR)/lib/lang -I$(MAINSRCDIR)/lib/util -I$(MAINSRCDIR)/lib/math -I$(MAINSRCDIR)/defs -I$(MAINSRCDIR)/font -I$(MAINSRCDIR)/network -I$(MAINSRCDIR)/glmenu -I$(MAINSRCDIR)/ai -I$(MAINSRCDIR)/util -I$(MAINSRCDIR)/util/animation -I$(MAINSRCDIR)/util/common 190 205 191 206 #AM_LDFLAGS=$(GTK2_LIBS) $(GTHREAD_LIBS) … … 201 216 gui_banner.cc \ 202 217 gui_keys.cc \ 203 gui_update.cc 218 gui_update.cc \ 219 $(MAINSRCDIR)/lib/graphics/graphics_engine.cc \ 220 $(MAINSRCDIR)/lib/lang/base_object.cc \ 221 $(MAINSRCDIR)/lib/math/vector.cc \ 222 $(MAINSRCDIR)/util/resource_manager.cc \ 223 $(MAINSRCDIR)/lib/graphics/text_engine.cc \ 224 $(MAINSRCDIR)/lib/coord/p_node.cc \ 225 $(MAINSRCDIR)/lib/coord/null_parent.cc \ 226 $(MAINSRCDIR)/lib/graphics/importer/array.cc \ 227 $(MAINSRCDIR)/lib/graphics/importer/model.cc \ 228 $(MAINSRCDIR)/lib/graphics/importer/objModel.cc \ 229 $(MAINSRCDIR)/lib/graphics/importer/material.cc \ 230 $(MAINSRCDIR)/lib/graphics/importer/texture.cc \ 231 $(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc 204 232 205 233 noinst_HEADERS = gui.h \ … … 290 318 -rm -f *.tab.c 291 319 320 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@ 321 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_object.Po@am__quote@ 322 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graphics_engine.Po@am__quote@ 292 323 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui.Po@am__quote@ 293 324 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_audio.Po@am__quote@ … … 301 332 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_update.Po@am__quote@ 302 333 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gui_video.Po@am__quote@ 334 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@ 335 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/model.Po@am__quote@ 336 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/null_parent.Po@am__quote@ 337 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/objModel.Po@am__quote@ 338 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/p_node.Po@am__quote@ 339 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/primitive_model.Po@am__quote@ 340 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resource_manager.Po@am__quote@ 341 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/text_engine.Po@am__quote@ 342 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/texture.Po@am__quote@ 343 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@ 303 344 304 345 .cc.o: … … 317 358 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 318 359 @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` 360 361 graphics_engine.o: $(MAINSRCDIR)/lib/graphics/graphics_engine.cc 362 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT graphics_engine.o -MD -MP -MF "$(DEPDIR)/graphics_engine.Tpo" -c -o graphics_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/graphics_engine.cc; \ 363 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/graphics_engine.Tpo" "$(DEPDIR)/graphics_engine.Po"; else rm -f "$(DEPDIR)/graphics_engine.Tpo"; exit 1; fi 364 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' object='graphics_engine.o' libtool=no @AMDEPBACKSLASH@ 365 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/graphics_engine.Po' tmpdepfile='$(DEPDIR)/graphics_engine.TPo' @AMDEPBACKSLASH@ 366 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 367 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o graphics_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/graphics_engine.cc 368 369 graphics_engine.obj: $(MAINSRCDIR)/lib/graphics/graphics_engine.cc 370 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT graphics_engine.obj -MD -MP -MF "$(DEPDIR)/graphics_engine.Tpo" -c -o graphics_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; fi`; \ 371 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/graphics_engine.Tpo" "$(DEPDIR)/graphics_engine.Po"; else rm -f "$(DEPDIR)/graphics_engine.Tpo"; exit 1; fi 372 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/graphics_engine.cc' object='graphics_engine.obj' libtool=no @AMDEPBACKSLASH@ 373 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/graphics_engine.Po' tmpdepfile='$(DEPDIR)/graphics_engine.TPo' @AMDEPBACKSLASH@ 374 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 375 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o graphics_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/graphics_engine.cc'; fi` 376 377 base_object.o: $(MAINSRCDIR)/lib/lang/base_object.cc 378 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT base_object.o -MD -MP -MF "$(DEPDIR)/base_object.Tpo" -c -o base_object.o `test -f '$(MAINSRCDIR)/lib/lang/base_object.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/lang/base_object.cc; \ 379 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/base_object.Tpo" "$(DEPDIR)/base_object.Po"; else rm -f "$(DEPDIR)/base_object.Tpo"; exit 1; fi 380 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/lang/base_object.cc' object='base_object.o' libtool=no @AMDEPBACKSLASH@ 381 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/base_object.Po' tmpdepfile='$(DEPDIR)/base_object.TPo' @AMDEPBACKSLASH@ 382 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 383 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o base_object.o `test -f '$(MAINSRCDIR)/lib/lang/base_object.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/lang/base_object.cc 384 385 base_object.obj: $(MAINSRCDIR)/lib/lang/base_object.cc 386 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT base_object.obj -MD -MP -MF "$(DEPDIR)/base_object.Tpo" -c -o base_object.obj `if test -f '$(MAINSRCDIR)/lib/lang/base_object.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/lang/base_object.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/lang/base_object.cc'; fi`; \ 387 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/base_object.Tpo" "$(DEPDIR)/base_object.Po"; else rm -f "$(DEPDIR)/base_object.Tpo"; exit 1; fi 388 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/lang/base_object.cc' object='base_object.obj' libtool=no @AMDEPBACKSLASH@ 389 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/base_object.Po' tmpdepfile='$(DEPDIR)/base_object.TPo' @AMDEPBACKSLASH@ 390 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 391 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o base_object.obj `if test -f '$(MAINSRCDIR)/lib/lang/base_object.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/lang/base_object.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/lang/base_object.cc'; fi` 392 393 vector.o: $(MAINSRCDIR)/lib/math/vector.cc 394 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vector.o -MD -MP -MF "$(DEPDIR)/vector.Tpo" -c -o vector.o `test -f '$(MAINSRCDIR)/lib/math/vector.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/math/vector.cc; \ 395 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/vector.Tpo" "$(DEPDIR)/vector.Po"; else rm -f "$(DEPDIR)/vector.Tpo"; exit 1; fi 396 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/math/vector.cc' object='vector.o' libtool=no @AMDEPBACKSLASH@ 397 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/vector.Po' tmpdepfile='$(DEPDIR)/vector.TPo' @AMDEPBACKSLASH@ 398 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 399 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vector.o `test -f '$(MAINSRCDIR)/lib/math/vector.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/math/vector.cc 400 401 vector.obj: $(MAINSRCDIR)/lib/math/vector.cc 402 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT vector.obj -MD -MP -MF "$(DEPDIR)/vector.Tpo" -c -o vector.obj `if test -f '$(MAINSRCDIR)/lib/math/vector.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/math/vector.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/math/vector.cc'; fi`; \ 403 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/vector.Tpo" "$(DEPDIR)/vector.Po"; else rm -f "$(DEPDIR)/vector.Tpo"; exit 1; fi 404 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/math/vector.cc' object='vector.obj' libtool=no @AMDEPBACKSLASH@ 405 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/vector.Po' tmpdepfile='$(DEPDIR)/vector.TPo' @AMDEPBACKSLASH@ 406 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 407 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o vector.obj `if test -f '$(MAINSRCDIR)/lib/math/vector.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/math/vector.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/math/vector.cc'; fi` 408 409 resource_manager.o: $(MAINSRCDIR)/util/resource_manager.cc 410 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.o -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.o `test -f '$(MAINSRCDIR)/util/resource_manager.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/util/resource_manager.cc; \ 411 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/resource_manager.Tpo" "$(DEPDIR)/resource_manager.Po"; else rm -f "$(DEPDIR)/resource_manager.Tpo"; exit 1; fi 412 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/util/resource_manager.cc' object='resource_manager.o' libtool=no @AMDEPBACKSLASH@ 413 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/resource_manager.Po' tmpdepfile='$(DEPDIR)/resource_manager.TPo' @AMDEPBACKSLASH@ 414 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 415 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.o `test -f '$(MAINSRCDIR)/util/resource_manager.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/util/resource_manager.cc 416 417 resource_manager.obj: $(MAINSRCDIR)/util/resource_manager.cc 418 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT resource_manager.obj -MD -MP -MF "$(DEPDIR)/resource_manager.Tpo" -c -o resource_manager.obj `if test -f '$(MAINSRCDIR)/util/resource_manager.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/util/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/util/resource_manager.cc'; fi`; \ 419 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/resource_manager.Tpo" "$(DEPDIR)/resource_manager.Po"; else rm -f "$(DEPDIR)/resource_manager.Tpo"; exit 1; fi 420 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/util/resource_manager.cc' object='resource_manager.obj' libtool=no @AMDEPBACKSLASH@ 421 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/resource_manager.Po' tmpdepfile='$(DEPDIR)/resource_manager.TPo' @AMDEPBACKSLASH@ 422 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 423 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o resource_manager.obj `if test -f '$(MAINSRCDIR)/util/resource_manager.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/util/resource_manager.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/util/resource_manager.cc'; fi` 424 425 text_engine.o: $(MAINSRCDIR)/lib/graphics/text_engine.cc 426 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT text_engine.o -MD -MP -MF "$(DEPDIR)/text_engine.Tpo" -c -o text_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/text_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/text_engine.cc; \ 427 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/text_engine.Tpo" "$(DEPDIR)/text_engine.Po"; else rm -f "$(DEPDIR)/text_engine.Tpo"; exit 1; fi 428 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/text_engine.cc' object='text_engine.o' libtool=no @AMDEPBACKSLASH@ 429 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/text_engine.Po' tmpdepfile='$(DEPDIR)/text_engine.TPo' @AMDEPBACKSLASH@ 430 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 431 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o text_engine.o `test -f '$(MAINSRCDIR)/lib/graphics/text_engine.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/text_engine.cc 432 433 text_engine.obj: $(MAINSRCDIR)/lib/graphics/text_engine.cc 434 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT text_engine.obj -MD -MP -MF "$(DEPDIR)/text_engine.Tpo" -c -o text_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/text_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/text_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/text_engine.cc'; fi`; \ 435 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/text_engine.Tpo" "$(DEPDIR)/text_engine.Po"; else rm -f "$(DEPDIR)/text_engine.Tpo"; exit 1; fi 436 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/text_engine.cc' object='text_engine.obj' libtool=no @AMDEPBACKSLASH@ 437 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/text_engine.Po' tmpdepfile='$(DEPDIR)/text_engine.TPo' @AMDEPBACKSLASH@ 438 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 439 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o text_engine.obj `if test -f '$(MAINSRCDIR)/lib/graphics/text_engine.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/text_engine.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/text_engine.cc'; fi` 440 441 p_node.o: $(MAINSRCDIR)/lib/coord/p_node.cc 442 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT p_node.o -MD -MP -MF "$(DEPDIR)/p_node.Tpo" -c -o p_node.o `test -f '$(MAINSRCDIR)/lib/coord/p_node.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/coord/p_node.cc; \ 443 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/p_node.Tpo" "$(DEPDIR)/p_node.Po"; else rm -f "$(DEPDIR)/p_node.Tpo"; exit 1; fi 444 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/coord/p_node.cc' object='p_node.o' libtool=no @AMDEPBACKSLASH@ 445 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/p_node.Po' tmpdepfile='$(DEPDIR)/p_node.TPo' @AMDEPBACKSLASH@ 446 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 447 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o p_node.o `test -f '$(MAINSRCDIR)/lib/coord/p_node.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/coord/p_node.cc 448 449 p_node.obj: $(MAINSRCDIR)/lib/coord/p_node.cc 450 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT p_node.obj -MD -MP -MF "$(DEPDIR)/p_node.Tpo" -c -o p_node.obj `if test -f '$(MAINSRCDIR)/lib/coord/p_node.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/coord/p_node.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/coord/p_node.cc'; fi`; \ 451 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/p_node.Tpo" "$(DEPDIR)/p_node.Po"; else rm -f "$(DEPDIR)/p_node.Tpo"; exit 1; fi 452 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/coord/p_node.cc' object='p_node.obj' libtool=no @AMDEPBACKSLASH@ 453 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/p_node.Po' tmpdepfile='$(DEPDIR)/p_node.TPo' @AMDEPBACKSLASH@ 454 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 455 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o p_node.obj `if test -f '$(MAINSRCDIR)/lib/coord/p_node.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/coord/p_node.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/coord/p_node.cc'; fi` 456 457 null_parent.o: $(MAINSRCDIR)/lib/coord/null_parent.cc 458 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT null_parent.o -MD -MP -MF "$(DEPDIR)/null_parent.Tpo" -c -o null_parent.o `test -f '$(MAINSRCDIR)/lib/coord/null_parent.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/coord/null_parent.cc; \ 459 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/null_parent.Tpo" "$(DEPDIR)/null_parent.Po"; else rm -f "$(DEPDIR)/null_parent.Tpo"; exit 1; fi 460 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/coord/null_parent.cc' object='null_parent.o' libtool=no @AMDEPBACKSLASH@ 461 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/null_parent.Po' tmpdepfile='$(DEPDIR)/null_parent.TPo' @AMDEPBACKSLASH@ 462 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 463 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o null_parent.o `test -f '$(MAINSRCDIR)/lib/coord/null_parent.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/coord/null_parent.cc 464 465 null_parent.obj: $(MAINSRCDIR)/lib/coord/null_parent.cc 466 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT null_parent.obj -MD -MP -MF "$(DEPDIR)/null_parent.Tpo" -c -o null_parent.obj `if test -f '$(MAINSRCDIR)/lib/coord/null_parent.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/coord/null_parent.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/coord/null_parent.cc'; fi`; \ 467 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/null_parent.Tpo" "$(DEPDIR)/null_parent.Po"; else rm -f "$(DEPDIR)/null_parent.Tpo"; exit 1; fi 468 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/coord/null_parent.cc' object='null_parent.obj' libtool=no @AMDEPBACKSLASH@ 469 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/null_parent.Po' tmpdepfile='$(DEPDIR)/null_parent.TPo' @AMDEPBACKSLASH@ 470 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 471 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o null_parent.obj `if test -f '$(MAINSRCDIR)/lib/coord/null_parent.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/coord/null_parent.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/coord/null_parent.cc'; fi` 472 473 array.o: $(MAINSRCDIR)/lib/graphics/importer/array.cc 474 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT array.o -MD -MP -MF "$(DEPDIR)/array.Tpo" -c -o array.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/array.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/array.cc; \ 475 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/array.Tpo" "$(DEPDIR)/array.Po"; else rm -f "$(DEPDIR)/array.Tpo"; exit 1; fi 476 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/importer/array.cc' object='array.o' libtool=no @AMDEPBACKSLASH@ 477 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/array.Po' tmpdepfile='$(DEPDIR)/array.TPo' @AMDEPBACKSLASH@ 478 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 479 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o array.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/array.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/array.cc 480 481 array.obj: $(MAINSRCDIR)/lib/graphics/importer/array.cc 482 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT array.obj -MD -MP -MF "$(DEPDIR)/array.Tpo" -c -o array.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/array.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/array.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/array.cc'; fi`; \ 483 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/array.Tpo" "$(DEPDIR)/array.Po"; else rm -f "$(DEPDIR)/array.Tpo"; exit 1; fi 484 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/importer/array.cc' object='array.obj' libtool=no @AMDEPBACKSLASH@ 485 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/array.Po' tmpdepfile='$(DEPDIR)/array.TPo' @AMDEPBACKSLASH@ 486 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 487 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o array.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/array.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/array.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/array.cc'; fi` 488 489 model.o: $(MAINSRCDIR)/lib/graphics/importer/model.cc 490 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT model.o -MD -MP -MF "$(DEPDIR)/model.Tpo" -c -o model.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/model.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/model.cc; \ 491 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/model.Tpo" "$(DEPDIR)/model.Po"; else rm -f "$(DEPDIR)/model.Tpo"; exit 1; fi 492 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/importer/model.cc' object='model.o' libtool=no @AMDEPBACKSLASH@ 493 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/model.Po' tmpdepfile='$(DEPDIR)/model.TPo' @AMDEPBACKSLASH@ 494 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 495 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o model.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/model.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/model.cc 496 497 model.obj: $(MAINSRCDIR)/lib/graphics/importer/model.cc 498 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT model.obj -MD -MP -MF "$(DEPDIR)/model.Tpo" -c -o model.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/model.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/model.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/model.cc'; fi`; \ 499 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/model.Tpo" "$(DEPDIR)/model.Po"; else rm -f "$(DEPDIR)/model.Tpo"; exit 1; fi 500 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/importer/model.cc' object='model.obj' libtool=no @AMDEPBACKSLASH@ 501 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/model.Po' tmpdepfile='$(DEPDIR)/model.TPo' @AMDEPBACKSLASH@ 502 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 503 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o model.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/model.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/model.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/model.cc'; fi` 504 505 objModel.o: $(MAINSRCDIR)/lib/graphics/importer/objModel.cc 506 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT objModel.o -MD -MP -MF "$(DEPDIR)/objModel.Tpo" -c -o objModel.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/objModel.cc; \ 507 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/objModel.Tpo" "$(DEPDIR)/objModel.Po"; else rm -f "$(DEPDIR)/objModel.Tpo"; exit 1; fi 508 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/importer/objModel.cc' object='objModel.o' libtool=no @AMDEPBACKSLASH@ 509 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/objModel.Po' tmpdepfile='$(DEPDIR)/objModel.TPo' @AMDEPBACKSLASH@ 510 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 511 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o objModel.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/objModel.cc 512 513 objModel.obj: $(MAINSRCDIR)/lib/graphics/importer/objModel.cc 514 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT objModel.obj -MD -MP -MF "$(DEPDIR)/objModel.Tpo" -c -o objModel.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; fi`; \ 515 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/objModel.Tpo" "$(DEPDIR)/objModel.Po"; else rm -f "$(DEPDIR)/objModel.Tpo"; exit 1; fi 516 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/importer/objModel.cc' object='objModel.obj' libtool=no @AMDEPBACKSLASH@ 517 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/objModel.Po' tmpdepfile='$(DEPDIR)/objModel.TPo' @AMDEPBACKSLASH@ 518 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 519 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o objModel.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/objModel.cc'; fi` 520 521 material.o: $(MAINSRCDIR)/lib/graphics/importer/material.cc 522 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT material.o -MD -MP -MF "$(DEPDIR)/material.Tpo" -c -o material.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/material.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/material.cc; \ 523 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/material.Tpo" "$(DEPDIR)/material.Po"; else rm -f "$(DEPDIR)/material.Tpo"; exit 1; fi 524 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/importer/material.cc' object='material.o' libtool=no @AMDEPBACKSLASH@ 525 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/material.Po' tmpdepfile='$(DEPDIR)/material.TPo' @AMDEPBACKSLASH@ 526 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 527 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o material.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/material.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/material.cc 528 529 material.obj: $(MAINSRCDIR)/lib/graphics/importer/material.cc 530 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT material.obj -MD -MP -MF "$(DEPDIR)/material.Tpo" -c -o material.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/material.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/material.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/material.cc'; fi`; \ 531 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/material.Tpo" "$(DEPDIR)/material.Po"; else rm -f "$(DEPDIR)/material.Tpo"; exit 1; fi 532 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/importer/material.cc' object='material.obj' libtool=no @AMDEPBACKSLASH@ 533 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/material.Po' tmpdepfile='$(DEPDIR)/material.TPo' @AMDEPBACKSLASH@ 534 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 535 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o material.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/material.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/material.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/material.cc'; fi` 536 537 texture.o: $(MAINSRCDIR)/lib/graphics/importer/texture.cc 538 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT texture.o -MD -MP -MF "$(DEPDIR)/texture.Tpo" -c -o texture.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/texture.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/texture.cc; \ 539 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/texture.Tpo" "$(DEPDIR)/texture.Po"; else rm -f "$(DEPDIR)/texture.Tpo"; exit 1; fi 540 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/importer/texture.cc' object='texture.o' libtool=no @AMDEPBACKSLASH@ 541 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/texture.Po' tmpdepfile='$(DEPDIR)/texture.TPo' @AMDEPBACKSLASH@ 542 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 543 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o texture.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/texture.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/texture.cc 544 545 texture.obj: $(MAINSRCDIR)/lib/graphics/importer/texture.cc 546 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT texture.obj -MD -MP -MF "$(DEPDIR)/texture.Tpo" -c -o texture.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; fi`; \ 547 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/texture.Tpo" "$(DEPDIR)/texture.Po"; else rm -f "$(DEPDIR)/texture.Tpo"; exit 1; fi 548 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/importer/texture.cc' object='texture.obj' libtool=no @AMDEPBACKSLASH@ 549 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/texture.Po' tmpdepfile='$(DEPDIR)/texture.TPo' @AMDEPBACKSLASH@ 550 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 551 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o texture.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/texture.cc'; fi` 552 553 primitive_model.o: $(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc 554 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT primitive_model.o -MD -MP -MF "$(DEPDIR)/primitive_model.Tpo" -c -o primitive_model.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc; \ 555 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/primitive_model.Tpo" "$(DEPDIR)/primitive_model.Po"; else rm -f "$(DEPDIR)/primitive_model.Tpo"; exit 1; fi 556 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc' object='primitive_model.o' libtool=no @AMDEPBACKSLASH@ 557 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/primitive_model.Po' tmpdepfile='$(DEPDIR)/primitive_model.TPo' @AMDEPBACKSLASH@ 558 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 559 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o primitive_model.o `test -f '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc 560 561 primitive_model.obj: $(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc 562 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT primitive_model.obj -MD -MP -MF "$(DEPDIR)/primitive_model.Tpo" -c -o primitive_model.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; fi`; \ 563 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/primitive_model.Tpo" "$(DEPDIR)/primitive_model.Po"; else rm -f "$(DEPDIR)/primitive_model.Tpo"; exit 1; fi 564 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc' object='primitive_model.obj' libtool=no @AMDEPBACKSLASH@ 565 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ depfile='$(DEPDIR)/primitive_model.Po' tmpdepfile='$(DEPDIR)/primitive_model.TPo' @AMDEPBACKSLASH@ 566 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 567 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o primitive_model.obj `if test -f '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/importer/primitive_model.cc'; fi` 319 568 uninstall-info-am: 320 569 -
orxonox/branches/md2_loader/src/lib/gui/gui/gui.cc
r4063 r4139 53 53 { 54 54 Window* orxonoxGUI = NULL; 55 55 executable = NULL; 56 56 57 initGUI(argc, argv); 57 58 … … 94 95 orxonoxGUI->fill(windowBox); 95 96 } 97 98 96 99 // Reading Values from File 97 100 exec->setConfDir(GUI_DEFAULT_CONF_DIR); … … 111 114 // case update // 112 115 #ifdef HAVE_CURL 113 if (static_cast<Option*>(Window::mainWindow->findWidgetByName( "auto update", 0))->value == 1)116 if (static_cast<Option*>(Window::mainWindow->findWidgetByName(CONFIG_NAME_AUTO_UPDATE, 0))->value == 1) 114 117 { 115 118 update->checkForUpdates(); 116 119 } 117 120 #endif /* HAVE_CURL */ 121 } 118 122 123 /** 124 \brief starts the OrxonoxGUI 125 */ 126 void Gui::startGui(void) 127 { 119 128 mainloopGUI(); 129 120 130 #ifndef HAVE_GTK2 121 131 GuiExec::startOrxonox(NULL, exec); … … 123 133 } 124 134 135 void Gui::printHelp() 136 { 137 Window::mainWindow->walkThrough(Widget::printHelp, 1); 138 } 139 140 /** 141 \brief a bool that knows if orxonox should be started 142 */ 125 143 bool Gui::startOrxonox = false; 126 144 -
orxonox/branches/md2_loader/src/lib/gui/gui/gui.h
r4063 r4139 26 26 ~Gui(void); 27 27 28 void startGui(void); 29 void printHelp(void); 30 28 31 static bool startOrxonox; 29 32 }; -
orxonox/branches/md2_loader/src/lib/gui/gui/gui_audio.cc
r4063 r4139 36 36 37 37 audioFrame = new Frame("Audio-Options:"); 38 audioFrame->setGroupName( "audio");38 audioFrame->setGroupName(CONFIG_SECTION_AUDIO); 39 39 { 40 40 Box* audioBox; //!< The Box that holds the audio Options. … … 45 45 Slider* effectsVolume; //!< A Slider for effects volume. 46 46 47 enableSound = new CheckButton( "Disable Sound");47 enableSound = new CheckButton(CONFIG_NAME_DISABLE_AUDIO); 48 48 enableSound->setFlagName ("no-sound", 0); 49 enableSound->setDescription("Disables Sound", "Check this to disable Sound in Orxonox"); 50 enableSound->setDefaultValue(0); 49 51 enableSound->saveability(); 50 52 audioBox->fill(enableSound); 51 Label* musicVolumeLabel = new Label( "Music Volume");53 Label* musicVolumeLabel = new Label(CONFIG_NAME_MUSIC_VOLUME); 52 54 audioBox->fill(musicVolumeLabel); 53 55 musicVolume = new Slider("Music Volume", 0, 100); 54 56 musicVolume->setFlagName("music-volume", "m", 80); 57 musicVolume->setDescription("Sets the volume of the ingame music"); 55 58 musicVolume->saveability(); 56 59 audioBox->fill (musicVolume); 57 Label* effectsVolumeLabel = new Label ( "Effects Volume");60 Label* effectsVolumeLabel = new Label (CONFIG_NAME_EFFECTS_VOLUME); 58 61 audioBox->fill (effectsVolumeLabel); 59 62 effectsVolume = new Slider ("Effects Volume", 0, 100); 60 63 effectsVolume->setFlagName ("effects-volume", "e", 80); 64 effectsVolume->setDescription("Sets the volune of the ingame SoundEffects"); 61 65 effectsVolume->saveability(); 62 66 audioBox->fill (effectsVolume); -
orxonox/branches/md2_loader/src/lib/gui/gui/gui_banner.cc
r4063 r4139 76 76 77 77 //! \todo add the names of all the guys working on orxonox 78 orxIsLabel = new Label( PACKAGE_NAME " is:\nPatrick Boenzli - main Developer\nBenjamin Grauer - right Hand\n....");78 orxIsLabel = new Label(" " PACKAGE_NAME " is:\n" ORXONOX_STAFF); 79 79 logoBox->fill(orxIsLabel); 80 80 logoEventBox->fill(logoBox); -
orxonox/branches/md2_loader/src/lib/gui/gui/gui_exec.cc
r4063 r4139 53 53 54 54 execBox = new Box('v'); 55 execFrame->setGroupName( "misc");55 execFrame->setGroupName(CONFIG_SECTION_MISC); 56 56 { 57 57 Button* start; //!< The start Button of orxonox. … … 65 65 #endif /* HAVE_GTK2 */ 66 66 execBox->fill(start); 67 this->saveSettings = new CheckButton( "Save Settings");67 this->saveSettings = new CheckButton(CONFIG_NAME_SAVE_SETTINGS); 68 68 this->saveSettings->value = 1; 69 69 this->saveSettings->saveability(); 70 70 execBox->fill(this->saveSettings); 71 verboseMode = new Menu("verbose mode", "nothing", "error", "warning", "info", "lastItem"); 71 72 #ifdef DEBUG 73 verboseMode = new Menu(CONFIG_NAME_VERBOSE_MODE, "nothing", 74 #if DEBUG >=1 75 "error", 76 #endif 77 #if DEBUG >=2 78 "warning", 79 #endif 80 #if DEBUG >=3 81 "info", 82 #endif 83 #if DEBUG >=4 84 "debug", 85 #endif 86 #if DEBUG >=5 87 "heavydebug", 88 #endif 89 "lastItem"); 72 90 verboseMode->setFlagName("verbose", "v", 2); 91 verboseMode->setDescription("Sets the Output Mode", "This Enables Outbug messages\n" 92 "0: nothing will be displayed, but stuff one cannot do without (eg.GUI)\n" 93 #if DEBUG >=1 94 "1: error: outputs all the above and errors" 95 #endif 96 #if DEBUG >=2 97 "2: warning: outputs all the above plus warnings" 98 #endif 99 #if DEBUG >=3 100 "3: info: outputs all the above plus Information" 101 #endif 102 #if DEBUG >=4 103 "4: debug: displays all the above plus debug information" 104 #endif 105 #if DEBUG >=5 106 "5: heavydebug: displays all the above plus heavy debug information: WARNING: the game will run very slow with this." 107 #endif 108 ); 73 109 verboseMode->saveability(); 74 110 execBox->fill(verboseMode); 75 alwaysShow = new CheckButton("Always Show this Menu"); 111 #endif 112 113 alwaysShow = new CheckButton(CONFIG_NAME_ALWAYS_SHOW_GUI); 76 114 alwaysShow->setFlagName("gui", "g", 0); 115 alwaysShow->setDescription("shows the gui when starting orxonox"); 77 116 alwaysShow->saveability(); 78 117 execBox->fill(alwaysShow); 118 79 119 quit = new Button("Quit"); 80 120 #ifdef HAVE_GTK2 … … 111 151 this->confDir = ResourceManager::homeDirCheck(confDir); 112 152 113 PRINTF( 3)("Config Directory is: %s.\n", this->confDir);153 PRINTF(5)("Config Directory is: %s.\n", this->confDir); 114 154 //! \todo F** Windows-support 115 155 #ifndef __WIN32__ … … 132 172 this->confFile = new char[strlen(this->confDir)+strlen(fileName)+2]; 133 173 sprintf(this->confFile, "%s/%s", this->confDir, fileName); 134 PRINTF( 3)("ConfigurationFile is %s.\n", this->confFile);174 PRINTF(5)("ConfigurationFile is %s.\n", this->confFile); 135 175 } 136 176 … … 174 214 { 175 215 int counter = 0; 176 while(counter < depth &&((widget-> isOption>0216 while(counter < depth &&((widget->optionType > GUI_NOTHING 177 217 &&(static_cast<Option*>(widget)->isSaveable())) 178 ||(widget-> isOption<0218 ||(widget->optionType < GUI_NOTHING 179 219 && static_cast<Packer*>(widget)->getGroupName()))) 180 220 { … … 184 224 185 225 // check if it is a Packer, and if it is, check if it has a name and if there is something in it. 186 if(widget-> isOption <0)226 if(widget->optionType < GUI_NOTHING) 187 227 { 188 228 if(static_cast<Packer*>(widget)->getGroupName()) … … 197 237 } 198 238 } 199 // if(widget->isOption == 0) 200 // printf("%s\n",widget->title); 201 if(widget->isOption >= 1) 239 240 if(widget->optionType > GUI_NOTHING) 202 241 if (static_cast<Option*>(widget)->isSaveable()) 203 242 { … … 277 316 { 278 317 PRINT(5)("Located Option %s.\n", widget->title); 279 if(widget-> isOption >= 1)318 if(widget->optionType > GUI_NOTHING) 280 319 static_cast<Option*>(widget)->load(info->variableValue); 281 320 } … … 302 341 } 303 342 304 if(widget-> isOption < 0)343 if(widget->optionType < GUI_NOTHING) 305 344 { 306 345 if(static_cast<Packer*>(widget)->getGroupName() && -
orxonox/branches/md2_loader/src/lib/gui/gui/gui_flags.cc
r4063 r4139 38 38 this->flagsBox->fill(flagsLabel); 39 39 this->shortFlags = new CheckButton("shortFlags"); 40 this->shortFlags->setDefaultValue(0); 40 41 this->flagsBox->fill(shortFlags); 41 42 … … 76 77 { 77 78 FlagInfo* info =(FlagInfo*)flagInfo; 78 if(widget-> isOption >= 1)79 if(widget->optionType > GUI_NOTHING) 79 80 if (static_cast<Option*>(widget)->value != static_cast<Option*>(widget)->defaultValue ) 80 81 { … … 90 91 } 91 92 92 if(static_cast<Option*>(widget)-> isOption == 2)93 if(static_cast<Option*>(widget)->optionType > GUI_BOOL) 93 94 { 94 95 info->flagsLabel->appendText("="); -
orxonox/branches/md2_loader/src/lib/gui/gui/gui_gtk.cc
r4063 r4139 222 222 return this; 223 223 224 if (this-> isOption < 0&& static_cast<Packer*>(this)->down)224 if (this->optionType < GUI_NOTHING && static_cast<Packer*>(this)->down) 225 225 { 226 226 Widget* tmp = static_cast<Packer*>(this)->down->findWidgetByName(name, depth+1); … … 243 243 { 244 244 function(this); 245 if (this-> isOption < 0)245 if (this->optionType < GUI_NOTHING) 246 246 { 247 247 static_cast<Packer*>(this)->down->walkThrough(function, depth+1); … … 261 261 { 262 262 function(this, data); 263 if (this-> isOption < 0)263 if (this->optionType < GUI_NOTHING) 264 264 { 265 265 static_cast<Packer*>(this)->down->walkThrough(function, data, depth+1); … … 275 275 void Widget::listOptionsAndGroups(Widget* widget) 276 276 { 277 if (widget-> isOption < 0&& static_cast<Packer*>(widget)->groupName)277 if (widget->optionType < GUI_NOTHING && static_cast<Packer*>(widget)->groupName) 278 278 PRINT(0)("[%s]\n", static_cast<Packer*>(widget)->groupName); 279 if (widget-> isOption >= 1)279 if (widget->optionType > GUI_NOTHING) 280 280 { 281 281 Widget::listOptions(widget); … … 289 289 void Widget::listOptions(Widget* widget) 290 290 { 291 if(widget-> isOption >= 1)291 if(widget->optionType > GUI_NOTHING) 292 292 PRINT(0)(" %s is %s\n", static_cast<Option*>(widget)->title, static_cast<Option*>(widget)->save()); 293 293 } … … 301 301 { 302 302 303 if (widget-> isOption >= 1)303 if (widget->optionType > GUI_NOTHING) 304 304 { 305 305 int* count =(int*)data; … … 308 308 static_cast<Option*>(widget)->title, 309 309 static_cast<Option*>(widget)->save()); 310 } 311 } 312 313 /** 314 \brief This is for listing the options of "widget" 315 \param widget specifies the widget that should be listed 316 \param data A Counter, that always knows how many Options have been found yet. 317 */ 318 void Widget::printHelp(Widget* widget) 319 { 320 int helpLen=0; 321 322 if (widget->optionType > GUI_NOTHING) 323 { 324 Option* option = (Option*)widget; 325 if (option->flagName || option->flagNameShort) 326 { 327 PRINT(0)(" "); 328 if (option->flagNameShort) 329 { 330 PRINT(0)("-%s", option->flagNameShort); 331 helpLen += strlen(option->flagNameShort)+1; 332 } 333 if (option->flagName) 334 { 335 if (helpLen > 0) 336 { 337 PRINT(0)("|"); 338 helpLen++; 339 } 340 PRINT(0)("--%s:", option->flagName); 341 helpLen += strlen(option->flagName)+2; 342 } 343 while ((helpLen ++) < 29) 344 PRINT(0)(" "); 345 if (option->shortDescription) 346 PRINT(0)("%s\n", option->shortDescription); 347 else 348 PRINT(0)("\n"); 349 } 310 350 } 311 351 } … … 320 360 Widget* Widget::findOptionByNumber(int* number, unsigned int depth) 321 361 { 322 if ( isOption > 0)362 if (optionType > GUI_NOTHING) 323 363 { 324 364 --*number; … … 328 368 } 329 369 } 330 if (this-> isOption < 0&& static_cast<Packer*>(this)->down)370 if (this->optionType < GUI_NOTHING && static_cast<Packer*>(this)->down) 331 371 { 332 372 Widget* tmp = static_cast<Packer*>(this)->down->findOptionByNumber(number, depth+1); … … 346 386 void Widget::listGroups(Widget* widget) 347 387 { 348 if (widget-> isOption < 0&& static_cast<Packer*>(widget)->groupName)388 if (widget->optionType < GUI_NOTHING && static_cast<Packer*>(widget)->groupName) 349 389 PRINT(0)("[%s]\n", static_cast<Packer*>(widget)->groupName); 350 390 } … … 358 398 { 359 399 int* count = (int*)data; 360 if (widget-> isOption < 0&& static_cast<Packer*>(widget)->groupName)400 if (widget->optionType < GUI_NOTHING && static_cast<Packer*>(widget)->groupName) 361 401 PRINT(0)("%d: [%s]\n", ++*count, static_cast<Packer*>(widget)->groupName); 362 402 } … … 369 409 Widget* Widget::findGroupByNumber(int* number, unsigned int depth) 370 410 { 371 if ( isOption < 0&& static_cast<Packer*>(this)->groupName)411 if (optionType < GUI_NOTHING && static_cast<Packer*>(this)->groupName) 372 412 { 373 413 --*number; … … 377 417 } 378 418 } 379 if (this-> isOption < 0&& static_cast<Packer*>(this)->down)419 if (this->optionType < GUI_NOTHING && static_cast<Packer*>(this)->down) 380 420 { 381 421 Widget* tmp = static_cast<Packer*>(this)->down->findGroupByNumber(number, depth+1); … … 395 435 void Widget::setOptions(Widget* widget) 396 436 { 397 if (widget-> isOption >= 1)437 if (widget->optionType > GUI_NOTHING) 398 438 static_cast<Option*>(widget)->redraw(); 399 439 } … … 406 446 void Widget::redrawOptions(Widget* widget) 407 447 { 408 if (widget-> isOption >= 1)448 if (widget->optionType > GUI_NOTHING) 409 449 static_cast<Option*>(widget)->redraw(); 410 450 } … … 415 455 void Widget::flagCheck(Widget* widget, void* flagName) 416 456 { 417 if (widget-> isOption>=1)457 if (widget->optionType > GUI_NOTHING) 418 458 { 419 459 Option* option =(Option*)widget; … … 567 607 Container::Container(void) 568 608 { 569 this-> isOption = -1;609 this->optionType = GUI_CONTAINER; 570 610 } 571 611 … … 595 635 } 596 636 else 597 PRINTF( 1)("You tried to put more than one Widget into a Container. \nNot including this item.\nThis is only possible with Boxes.\n");637 PRINTF(2)("You tried to put more than one Widget into a Container. \nNot including this item.\nThis is only possible with Boxes.\n"); 598 638 } 599 639 … … 772 812 \brief Creates a new Frame with name title 773 813 */ 774 Frame::Frame(c har* frameName)814 Frame::Frame(const char* frameName) 775 815 { 776 816 #ifdef HAVE_GTK2 … … 778 818 gtk_container_set_border_width(GTK_CONTAINER(this->widget), 3); 779 819 #endif /* HAVE_GTK2 */ 780 if ( title)820 if (frameName) 781 821 this->setTitle(frameName); 782 822 } … … 801 841 strcpy(this->title, title); 802 842 #ifdef HAVE_GTK2 803 gtk_frame_set_label(GTK_FRAME(widget), t itle);843 gtk_frame_set_label(GTK_FRAME(widget), this->title); 804 844 #endif /* HAVE_GTK2 */ 805 845 } … … 814 854 EventBox::EventBox(const char* eventBoxName) 815 855 { 816 this->isOption = -1;817 818 856 #ifdef HAVE_GTK2 819 857 this->widget = gtk_event_box_new(); … … 842 880 Box::Box(char boxtype) 843 881 { 844 this-> isOption = -2;882 this->optionType = GUI_BOX; 845 883 846 884 #ifdef HAVE_GTK2 … … 1053 1091 \param buttonName sets the Name of the Button 1054 1092 */ 1055 Button::Button(c har* buttonName)1056 { 1057 isOption = 0;1093 Button::Button(const char* buttonName) 1094 { 1095 this->optionType = GUI_NOTHING; 1058 1096 1059 1097 #ifdef HAVE_GTK2 … … 1115 1153 CheckButton::CheckButton(const char* buttonName) 1116 1154 { 1117 this-> isOption = 1;1155 this->optionType = GUI_BOOL; 1118 1156 1119 1157 #ifdef HAVE_GTK2 … … 1179 1217 if ((this->value = atoi(tmpChar))=!0) 1180 1218 this->value = 1; 1181 #endif /* HAVE_GTK2 */ 1219 1182 1220 PRINT(0)("%s set to: %d\n", this->title, this->value); 1221 #endif /* HAVE_GTK2 */ 1183 1222 } 1184 1223 … … 1205 1244 Slider::Slider(const char* slidername, int start, int end) 1206 1245 { 1207 this-> isOption = 2;1246 this->optionType = GUI_INT; 1208 1247 1209 1248 this->start = start; … … 1264 1303 if (this->value <= this->start) 1265 1304 this->value = this->start; 1266 #endif /* HAVE_GTK2 */ 1305 1267 1306 PRINT(0)("%s set to: %d\n",this->title, this->value); 1307 #endif /* HAVE_GTK2 */ 1268 1308 } 1269 1309 … … 1329 1369 void Menu::init(void) 1330 1370 { 1331 this-> isOption = 2;1371 this->optionType = GUI_INT; 1332 1372 this->firstItem = NULL; 1333 1373 … … 1372 1412 { 1373 1413 this->value = 0; 1374 PRINTF(2)(" Sorry, but%s has not been found in the Itemlist of %s\n", loadString, this->title);1375 } 1376 PRINTF( 4)( "Loading %s: setting to %d\n", this->title, this->value);1414 PRINTF(2)("%s has not been found in the Itemlist of %s\n", loadString, this->title); 1415 } 1416 PRINTF(5)( "Loading %s: setting to %d\n", this->title, this->value); 1377 1417 this->redraw(); 1378 1418 } … … 1431 1471 1432 1472 #endif /* HAVE_GTK2 */ 1433 PRINT( 4)("%s set to: %d\n", this->title, this->value);1473 PRINT(5)("%s set to: %d\n", this->title, this->value); 1434 1474 } 1435 1475 … … 1443 1483 OptionLabel::OptionLabel(const char* label, const char* value) 1444 1484 { 1445 this-> isOption = 5;1485 this->optionType = GUI_CHAR_ARRAY; 1446 1486 cValue = NULL; 1447 1487 … … 1474 1514 this->cValue = new char [strlen(newValue)+1]; 1475 1515 strcpy(this->cValue, newValue); 1476 #ifdef HAVE_GTK2 1477 gtk_label_set_text(GTK_LABEL(this->widget), this->cValue); 1478 #endif /* HAVE_GTK2 */ 1516 1517 this->redraw(); 1479 1518 } 1480 1519 … … 1485 1524 { 1486 1525 #ifdef HAVE_GTK2 1487 gtk_label_set_text(GTK_LABEL(widget), title);1526 gtk_label_set_text(GTK_LABEL(widget), cValue); 1488 1527 #endif /* HAVE_GTK2 */ 1489 1528 } … … 1495 1534 { 1496 1535 #ifdef HAVE_GTK2 1497 this->cValue = (char*)gtk_label_get_text(GTK_LABEL(this->widget));1536 this->cValue = (char*)gtk_label_get_text(GTK_LABEL(this->widget)); 1498 1537 #else /* HAVE_GTK2 */ 1499 1538 PRINT(0)("\nPlease give me a new input for %s: ", this->title); … … 1521 1560 void OptionLabel::load(char* loadString) 1522 1561 { 1523 PRINTF( 4)("Loading %s: setting to %s\n", this->title, loadString);1562 PRINTF(5)("Loading %s: setting to %s\n", this->title, loadString); 1524 1563 this->setValue(loadString); 1525 1564 } … … 1534 1573 Label:: Label(const char* text) 1535 1574 { 1536 this-> isOption = 0;1575 this->optionType = GUI_NOTHING; 1537 1576 1538 1577 #ifdef HAVE_GTK2 … … 1630 1669 ProgressBar::ProgressBar(const char* label) 1631 1670 { 1632 this-> isOption = 0;1671 this->optionType = GUI_NOTHING; 1633 1672 this->progress = 0.0; 1634 1673 this->totalSize = 0.0; … … 1671 1710 #ifdef HAVE_GTK2 1672 1711 gtk_progress_set_value(GTK_PROGRESS(widget), this->progress*100.0/this->totalSize); 1673 PRINTF( 4)("Progress: %f%%\n", this->progress*100.0/this->totalSize);1712 PRINTF(5)("Progress: %f%%\n", this->progress*100.0/this->totalSize); 1674 1713 #else /* HVE_GTK2 */ 1675 1714 PRINT(0)("Progress: %f%%\n", this->progress*100.0/this->totalSize); … … 1729 1768 void Image::init(const char* name) 1730 1769 { 1731 isOption = 0;1770 optionType = GUI_NOTHING; 1732 1771 1733 1772 if (this->title) … … 1736 1775 strcpy(this->title, name); 1737 1776 } 1777 1778 1779 ///////////////// 1780 /* FILE DIALOG */ 1781 ///////////////// 1782 /** 1783 \brief Creates a new FileDialog 1784 \param fileDialogName a Name for the Dialog 1785 */ 1786 FileDialog::FileDialog(const char* fileDialogName) 1787 { 1788 this->optionType = GUI_NOTHING; 1789 this->isOpen = false; 1790 this->changeOption = NULL; 1791 this->openUpButton = NULL; 1792 this->okObject = NULL; 1793 this->okFunc = NULL; 1794 1795 #ifdef HAVE_GTK2 1796 this->widget = gtk_file_selection_new(fileDialogName); 1797 1798 gtk_file_selection_set_select_multiple(GTK_FILE_SELECTION (this->widget), FALSE); 1799 1800 g_signal_connect(GTK_FILE_SELECTION (this->widget)->cancel_button, 1801 "button_release_event", 1802 G_CALLBACK (FileDialog::dialogClose), 1803 this); 1804 g_signal_connect(GTK_FILE_SELECTION (this->widget), 1805 "delete_event", 1806 G_CALLBACK (FileDialog::dialogClose), 1807 this); 1808 g_signal_connect(GTK_FILE_SELECTION (this->widget)->ok_button, 1809 "button_release_event", 1810 G_CALLBACK (FileDialog::dialogOK), 1811 this); 1812 #endif /* HAVE_GTK2 */ 1813 if (fileDialogName) 1814 this->setTitle(fileDialogName); 1815 } 1816 1817 /** 1818 \brief destructs a FileDialog 1819 */ 1820 FileDialog::~FileDialog(void) 1821 { 1822 PRINTF(5)("deleting FileDialog %s\n", this->title); 1823 } 1824 1825 void FileDialog::setChangeOption(OptionLabel* changeOption) 1826 { 1827 this->changeOption = changeOption; 1828 } 1829 1830 void FileDialog::setOKFunc(void* okObject, bool(*function)(const char* , void*)) 1831 { 1832 this->okObject = okObject; 1833 this->okFunc = function; 1834 } 1835 1836 1837 void FileDialog::setOpenUpButton(Button* openUpButton) 1838 { 1839 this->openUpButton = openUpButton; 1840 1841 openUpButton->connectSignal("button_release_event", this, FileDialog::dialogOpen); 1842 } 1843 1844 1845 void FileDialog::setDefaultFileName(const char* defaultFileName) 1846 { 1847 #ifdef HAVE_GTK2 1848 gtk_file_selection_set_filename (GTK_FILE_SELECTION(this->widget), defaultFileName); 1849 #endif /* HAVE_GTK2 */ 1850 } 1851 1852 void FileDialog::setMask(const char* mask) 1853 { 1854 #ifdef HAVE_GTK2 1855 gtk_file_selection_complete(GTK_FILE_SELECTION(this->widget), mask); 1856 #endif /* HAVE_GTK2 */ 1857 } 1858 1859 /** 1860 \brief disables the File Operator Buttons 1861 */ 1862 void FileDialog::disableFileOpts(void) 1863 { 1864 #ifdef HAVE_GTK2 1865 gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(this->widget)); 1866 #endif /* HAVE_GTK2 */ 1867 } 1868 1869 /** 1870 \brief The ok-button has been pressed 1871 */ 1872 void FileDialog::okEvent(void) 1873 { 1874 if (this->okFunc) 1875 { 1876 #ifdef HAVE_GTK2 1877 if(this->okFunc((const char*)gtk_file_selection_get_filename(GTK_FILE_SELECTION(this->widget)), this->okObject)) 1878 this->close(); 1879 #endif /* HAVE_GTK2 */ 1880 } 1881 else if (this->changeOption) 1882 { 1883 #ifdef HAVE_GTK2 1884 changeOption->setValue(gtk_file_selection_get_filename(GTK_FILE_SELECTION(this->widget))); 1885 #endif /* HAVE_GTK2 */ 1886 this->close(); 1887 } 1888 else 1889 this->close(); 1890 } 1891 1892 /** 1893 \biref opens up the FileDialog-Window 1894 */ 1895 void FileDialog::open(void) 1896 { 1897 isOpen = true; 1898 #ifdef HAVE_GTK2 1899 gtk_widget_show_all(this->widget); 1900 gtk_grab_add(this->widget); 1901 #endif /* HAVE_GTK2 */ 1902 } 1903 1904 /** 1905 \closes the FileDialog-Window 1906 */ 1907 void FileDialog::close(void) 1908 { 1909 this->isOpen = false; 1910 #ifdef HAVE_GTK2 1911 gtk_grab_remove(this->widget); 1912 gtk_widget_hide(this->widget); 1913 #endif /* HAVE_GTK2 */ 1914 } 1915 1916 #ifdef HAVE_GTK2 1917 gint FileDialog::dialogOK(GtkWidget* widget, GdkEvent* event, void* dialog) 1918 { 1919 static_cast<FileDialog*>(dialog)->okEvent(); 1920 } 1921 #else /* HAVE_GTK2 */ 1922 int FileDialog::dialogOK(void* widget, void* event, void* dialog){} 1923 #endif /* HAVE_GTK2 */ 1924 1925 #ifdef HAVE_GTK2 1926 gint FileDialog::dialogOpen(GtkWidget* widget, GdkEvent* event, void* dialog) 1927 { 1928 static_cast<FileDialog*>(dialog)->open(); 1929 } 1930 #else /* HAVE_GTK2 */ 1931 int FileDialog::dialogOpen(void* widget, void* event, void* dialog){} 1932 #endif /* HAVE_GTK2 */ 1933 1934 #ifdef HAVE_GTK2 1935 gint FileDialog::dialogClose(GtkWidget* widget, GdkEvent* event, void* dialog) 1936 { 1937 static_cast<FileDialog*>(dialog)->close(); 1938 } 1939 #else /* HAVE_GTK2 */ 1940 int FileDialog::dialogClose(void* widget, void* event, void* dialog){} 1941 #endif /* HAVE_GTK2 */ -
orxonox/branches/md2_loader/src/lib/gui/gui/gui_gtk.h
r4063 r4139 11 11 12 12 #include "debug.h" 13 #include "globals.h" 13 14 14 15 #ifdef HAVE_GTK2 … … 28 29 #include <gtk/gtkeventbox.h> 29 30 #include <gtk/gtkprogressbar.h> 31 #include <gtk/gtkfilesel.h> 30 32 #endif /* HAVE_GTK2 */ 31 33 32 34 // enumerator for different GuiOption-Types 33 enum GUI_OPTION {GUI_ CONTAINER= -2,34 GUI_ BOX= -1,35 enum GUI_OPTION {GUI_BOX = -2, 36 GUI_CONTAINER = -1, 35 37 GUI_NOTHING = 0, 36 38 GUI_BOOL = 1, … … 63 65 void walkThrough(void(*function)(Widget*), unsigned int depth); 64 66 void walkThrough(void(*function)(Widget*, void*), void* data, unsigned int depth); 65 static void listOptionsAndGroups(Widget* widget); 66 static void listOptions(Widget* widget); 67 static void listOptions(Widget* widget, void* data); 68 Widget* findOptionByNumber(int* number, unsigned int depth); 69 static void listGroups(Widget* widget); 70 static void listGroups(Widget* widget, void* data); 71 Widget* findGroupByNumber(int* number, unsigned int depth); 72 static void setOptions(Widget* widget); 73 static void redrawOptions(Widget* widget); 74 static void flagCheck(Widget* widget, void* flagName); 67 static void listOptionsAndGroups(Widget* widget); 68 static void listOptions(Widget* widget); 69 static void listOptions(Widget* widget, void* data); 70 Widget* findOptionByNumber(int* number, unsigned int depth); 71 static void listGroups(Widget* widget); 72 static void listGroups(Widget* widget, void* data); 73 static void printHelp(Widget* widget); 74 Widget* findGroupByNumber(int* number, unsigned int depth); 75 static void setOptions(Widget* widget); 76 static void redrawOptions(Widget* widget); 77 static void flagCheck(Widget* widget, void* flagName); 75 78 76 79 #ifdef HAVE_GTK2 … … 103 106 #endif /* HAVE_GTK2 */ 104 107 105 int isOption; //!< with this Paramenter one can set the option-type: -2:Container, -1: Box, 0: not an Option, 1: Bool-option, 2: int-option, 3: float option, 4:char option, 5: char* option 106 108 GUI_OPTION optionType; //!< The Type of the Widget. 107 109 char* title; //!< The name of the Widget. Some do display it, Options need it to save; 108 110 }; … … 141 143 Container(void); 142 144 virtual ~Container(void); 145 143 146 void setBorderWidth(int borderwidth); 144 147 void fill(Widget* lowerWidget); … … 184 187 { 185 188 public: 186 Frame(c har* frameName = NULL);189 Frame(const char* frameName = NULL); 187 190 virtual ~Frame(void); 188 191 … … 262 265 { 263 266 public: 264 Button(c har* buttonName = NULL);267 Button(const char* buttonName = NULL); 265 268 virtual ~Button(void); 266 269 … … 358 361 }; 359 362 363 //! A EntryField is a TextEntry field, for putting some text into. 364 class EntryField : public Option 365 { 366 public: 367 EntryField(const char* name = NULL); 368 virtual ~EntryField(void); 369 370 void setValue(const char* newValue); 371 virtual char* save(void); 372 virtual void load(char* loadString); 373 374 virtual void redraw(void); 375 virtual void changeOption(void); 376 }; 377 360 378 //! A label is a Widget, that displays a text 361 379 class Label : public Widget … … 405 423 }; 406 424 407 //gint orxonox_gui_quit(GtkWidget* widget, GdkEvent* event, gpointer data); 425 //! A FileDialog is a window with wich one can select a File 426 class FileDialog : public Widget 427 { 428 private: 429 OptionLabel* changeOption; 430 Button* openUpButton; 431 bool isOpen; 432 bool (*okFunc)(const char* , void*); 433 void* okObject; 434 435 public: 436 FileDialog(const char* fileDialogName); 437 virtual ~FileDialog(void); 438 439 void setChangeOption(OptionLabel* changeOption); 440 void setOKFunc(void* okObject, bool(*function)(const char* , void*)); 441 void setOpenUpButton(Button* openUpButton); 442 void setDefaultFileName(const char* defaultFileName); 443 void setMask(const char* mask); 444 void disableFileOpts(void); 445 446 void okEvent(); 447 void open(); 448 void close(); 449 450 #ifdef HAVE_GTK2 451 static gint dialogOK(GtkWidget* widget, GdkEvent* event, void* dialog); 452 static gint dialogOpen(GtkWidget* widget, GdkEvent* event, void* dialog); 453 static gint dialogClose(GtkWidget* widget, GdkEvent* event, void* dialog); 454 #else /* HAVE_GTK2 */ 455 static int dialogOK(void* widget, void* event, void* dialog); 456 static int dialogOpen(void* widget, void* event, void* dialog); 457 static int dialogClose(void* widget, void* event, void* dialog); 458 #endif /* HAVE_GTK2 */ 459 }; 408 460 409 461 #endif /* _GUI_GTK_H */ -
orxonox/branches/md2_loader/src/lib/gui/gui/gui_keys.cc
r4063 r4139 33 33 GuiKeys::GuiKeys(void) 34 34 { 35 this->keysFrame = new Frame("Keyboard-Options:"); 36 // keysFrame->setGroupName("Keyboard"); 37 this->keysBox = new Box('h'); 38 this->player1 = new Player("player1"); 39 this->player2 = new Player("player2"); 40 41 this->keysBox->fill(this->player1->getOpenButton()); 42 this->keysBox->fill(this->player2->getOpenButton()); 43 44 this->keysFrame->fill(this->keysBox); 35 Frame* keysFrame; //!< The Frame that holds the keyOptions. 36 37 keysFrame = new Frame("Keyboard-Options:"); 38 { 39 Box* keysBox0; //!< The Frame that holds the keyOptions. 40 41 // keysFrame->setGroupName("Keyboard"); 42 keysBox0 = new Box('v'); 43 { 44 Box* keysBox1; 45 MiscKeys* misc; //!< The Misc Keys 46 47 keysBox1 = new Box('h'); 48 { 49 PlayerKeys* player1; //!< The first Player's keys. 50 PlayerKeys* player2; //!< The seconds Player's keys. 51 52 player1 = new PlayerKeys(CONFIG_SECTION_PLAYER "1"); 53 player2 = new PlayerKeys(CONFIG_SECTION_PLAYER "2"); 54 55 keysBox1->fill(player1->getOpenButton()); 56 keysBox1->fill(player2->getOpenButton()); 57 } 58 keysBox0->fill(keysBox1); 59 60 misc = new MiscKeys(); 61 keysBox0->fill(misc->getOpenButton()); 62 } 63 keysFrame->fill(keysBox0); 64 } 65 66 // setting up the Input Windows that receives keystrokes. 67 this->inputWindow = new Window("inputWindow"); 68 this->inputButton = new Button("test"); 69 #ifdef HAVE_GTK2 70 this->inputWindow->connectSignal("destroy", Widget::doNothingSignal); 71 this->inputWindow->connectSignal("delete_event", Widget::doNothingSignal); 72 #endif /* HAVE_GTK2 */ 73 this->inputWindow->fill(inputButton); 74 45 75 this->setMainWidget(keysFrame); 46 76 } … … 54 84 } 55 85 86 87 Window* GuiKeys::inputWindow = NULL; 88 Button* GuiKeys::inputButton = NULL; 89 long GuiKeys::keySignal = 0; 90 91 //////////// 56 92 /* PLAYER */ 57 93 //////////// 58 94 /** 59 95 \brief Creates new inputs for a player 60 96 \param player the name of the Player 61 97 */ 62 Player::Player(char* player) 63 { 64 char* windowName = new char[strlen(player)+25]; 65 strcpy(windowName, "Keyboard settings of "); 98 PlayerKeys::PlayerKeys(char* player) 99 { 100 Window* pKeyWindow; //!< The Window for a new Key-setting. 101 102 char* windowName = new char[strlen(player)+12]; 103 strcpy(windowName, "KeySets: "); 66 104 strcat(windowName, player); 67 this->pKeyWindow = new Window(windowName); 68 this->pKeyFrame = new Frame(windowName); 69 this->pKeysBox = new Box('v'); 70 this->pKeysBox->setGroupName(player); 71 this->pKeysBox->fill(addKey(UP, "up")); 72 this->pKeysBox->fill(addKey(DOWN, "down")); 73 this->pKeysBox->fill(addKey(LEFT, "left")); 74 this->pKeysBox->fill(addKey(RIGHT, "right")); 75 this->pKeysBox->fill(addKey(SHOOT, "shoot")); 76 delete windowName; 77 closeButton = new Button("close"); 78 #ifdef HAVE_GTK2 79 this->closeButton->connectSignal("button_press_event", this->pKeyWindow, Window::windowClose); 80 #endif /* HAVE_GTK2 */ 81 82 this->pKeysBox->fill(this->closeButton); 83 this->pKeyFrame->fill(this->pKeysBox); 84 this->pKeyWindow->fill(this->pKeyFrame); 85 Window::addWindow(this->pKeyWindow); 86 #ifdef HAVE_GTK2 87 this->pKeyWindow->connectSignal("destroy", this->pKeyWindow, Window::windowClose); 88 this->pKeyWindow->connectSignal("delete_event", this->pKeyWindow, Window::windowClose); 89 #endif /* HAVE_GTK2 */ 90 105 pKeyWindow = new Window(windowName); 106 { 107 Frame* pKeyFrame; //!< The Frame for a new Key-setting. 108 109 pKeyFrame = new Frame(windowName); 110 { 111 Box* pKeysBox; //!< The Box that holds the Key-settings. 112 pKeysBox = new Box('v'); 113 { 114 Button* closeButton; //!< The CloseButton for this key-settings. 115 116 pKeysBox->setGroupName(player); 117 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_UP, "UP")); 118 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_DOWN, "DOWN")); 119 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_LEFT, "LEFT")); 120 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_RIGHT, "RIGHT")); 121 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_FIRE, "SPACE")); 122 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_NEXT_WEAPON, "m")); 123 pKeysBox->fill(addKey(CONFIG_NAME_PLAYER_PREV_WEAPON, "n")); 124 closeButton = new Button("close"); 125 #ifdef HAVE_GTK2 126 closeButton->connectSignal("button_press_event", pKeyWindow, Window::windowClose); 127 #endif /* HAVE_GTK2 */ 128 129 pKeysBox->fill(closeButton); 130 } 131 pKeyFrame->fill(pKeysBox); 132 } 133 pKeyWindow->fill(pKeyFrame); 134 } 135 delete windowName; 136 Window::addWindow(pKeyWindow); 137 #ifdef HAVE_GTK2 138 pKeyWindow->connectSignal("destroy", pKeyWindow, Window::windowClose); 139 pKeyWindow->connectSignal("delete_event", pKeyWindow, Window::windowClose); 140 #endif /* HAVE_GTK2 */ 141 91 142 this->openButton = new Button(player); 92 143 #ifdef HAVE_GTK2 93 this->openButton->connectSignal("button_press_event", this->pKeyWindow, Window::windowOpen); 94 #endif /* HAVE_GTK2 */ 95 96 this->inputWindow = new Window("inputWindow"); 97 98 this->inputButton = new Button("test"); 99 this->inputWindow->fill(inputButton); 100 #ifdef HAVE_GTK2 101 this->inputWindow->connectSignal("destroy", Widget::doNothingSignal); 102 this->inputWindow->connectSignal("delete_event", Widget::doNothingSignal); 103 #endif /* HAVE_GTK2 */ 104 105 } 144 this->openButton->connectSignal("button_press_event", pKeyWindow, Window::windowOpen); 145 #endif /* HAVE_GTK2 */ 146 } 147 148 /** 149 \returns the OpenButton of a Player 150 */ 151 Button* PlayerKeys::getOpenButton(void) 152 { 153 return this->openButton; 154 } 155 156 ////////////////// 157 /* MISC_OPTIONS */ 158 ////////////////// 159 /** 160 \brief Creates new inputs for a misc 161 \param player the name of the Misc 162 */ 163 MiscKeys::MiscKeys() 164 { 165 Window* keyWindow; //!< The Window for a new Key-setting. 166 167 keyWindow = new Window("misc Keys"); 168 { 169 Frame* keyFrame; //!< The Frame for a new Key-setting. 170 171 keyFrame = new Frame("misc Keys:"); 172 { 173 Box* keysBox; //!< The Box that holds the Key-settings. 174 keysBox = new Box('v'); 175 { 176 Button* closeButton; //!< The CloseButton for this key-settings. 177 178 keysBox->setGroupName(CONFIG_SECTION_MISC_KEYS); 179 keysBox->fill(addKey(CONFIG_NAME_QUIT , "ESCAPE")); 180 keysBox->fill(addKey(CONFIG_NAME_PAUSE, "PAUSE")); 181 keysBox->fill(addKey(CONFIG_NAME_NEXT_WORLD, "x")); 182 keysBox->fill(addKey(CONFIG_NAME_PREV_WORLD, "z")); 183 keysBox->fill(addKey(CONFIG_NAME_VIEW0, "1")); 184 keysBox->fill(addKey(CONFIG_NAME_VIEW1, "2")); 185 keysBox->fill(addKey(CONFIG_NAME_VIEW2, "3")); 186 keysBox->fill(addKey(CONFIG_NAME_VIEW3, "4")); 187 keysBox->fill(addKey(CONFIG_NAME_VIEW4, "5")); 188 keysBox->fill(addKey(CONFIG_NAME_VIEW5, "6")); 189 190 closeButton = new Button("close"); 191 #ifdef HAVE_GTK2 192 closeButton->connectSignal("button_press_event", keyWindow, Window::windowClose); 193 #endif /* HAVE_GTK2 */ 194 195 keysBox->fill(closeButton); 196 } 197 keyFrame->fill(keysBox); 198 } 199 keyWindow->fill(keyFrame); 200 } 201 Window::addWindow(keyWindow); 202 #ifdef HAVE_GTK2 203 keyWindow->connectSignal("destroy", keyWindow, Window::windowClose); 204 keyWindow->connectSignal("delete_event", keyWindow, Window::windowClose); 205 #endif /* HAVE_GTK2 */ 206 207 this->openButton = new Button("misc"); 208 #ifdef HAVE_GTK2 209 this->openButton->connectSignal("button_press_event", keyWindow, Window::windowOpen); 210 #endif /* HAVE_GTK2 */ 211 } 212 213 /** 214 \returns the OpenButton of a Misc 215 */ 216 Button* MiscKeys::getOpenButton(void) 217 { 218 return this->openButton; 219 } 220 106 221 107 222 /** … … 111 226 \returns A widget that has the Key-Box 112 227 */ 113 Widget* Player::addKey(KEYS key, char* name) 114 { 115 this->inputKey[key] = new InputKey; 116 this->inputKey[key]->pKeyBox = new Box(); 117 this->inputKey[key]->pKeyButton = new Button(name); 118 this->inputKey[key]->pKeyOLabel = new OptionLabel(name, name); 119 this->inputKey[key]->pKeyOLabel->saveability(); 120 121 #ifdef HAVE_GTK2 122 //inputKey[key]->pKeyButton->connectSignal("key_press_event", inputKey[key]->pKeyButton, key_cb); 123 this->inputKey[key]->pKeyButton->connectSignal("button_press_event", this->inputKey[key], inputWindowEvent); 124 #endif /* HAVE_GTK2 */ 125 this->inputKey[key]->pKeyBox->fill(this->inputKey[key]->pKeyButton); 126 this->inputKey[key]->pKeyBox->fill(this->inputKey[key]->pKeyOLabel); 127 return this->inputKey[key]->pKeyBox; 128 } 129 130 /** 131 \returns the OpenButton of a Player 132 */ 133 Button* Player::getOpenButton(void) 134 { 135 return this->openButton; 136 } 137 138 /** 139 \brief sets a new Key(only output) 140 \param key the new Key. 141 */ 142 void Player::setkey(KEYS key) 143 { 144 PRINT(4)("setting up Key: %d\n", key); 145 } 146 147 Window* Player::inputWindow = NULL; 148 Button* Player::inputButton = NULL; 149 long Player::keySignal = 0; 150 151 #ifdef HAVE_GTK2 152 gint Player::inputWindowEvent(GtkWidget* w, GdkEventKey* event, void* inputKey) 153 { 154 inputButton->setTitle("press a Key"); 155 keySignal = inputButton->connectSignal("key_press_event", inputKey, key_cb); 156 inputWindow->open(); 228 Widget* addKey(const char* name, const char* defaultVal) 229 { 230 InputKey* inputKey = new InputKey; 231 inputKey->keyBox = new Box(); 232 inputKey->keyButton = new Button(name); 233 if (defaultVal) 234 inputKey->keyOLabel = new OptionLabel(name, defaultVal); 235 else 236 inputKey->keyOLabel = new OptionLabel(name, name); 237 inputKey->keyOLabel->saveability(); 238 239 #ifdef HAVE_GTK2 240 //inputKey->keyButton->connectSignal("key_press_event", inputKey->keyButton, key_cb); 241 inputKey->keyButton->connectSignal("button_press_event", inputKey, inputWindowEvent); 242 #endif /* HAVE_GTK2 */ 243 inputKey->keyBox->fill(inputKey->keyButton); 244 inputKey->keyBox->fill(inputKey->keyOLabel); 245 return inputKey->keyBox; 246 } 247 248 249 #ifdef HAVE_GTK2 250 gint inputWindowEvent(GtkWidget* w, GdkEventKey* event, void* inputKey) 251 { 252 GuiKeys::inputButton->setTitle("press a Key"); 253 GuiKeys::keySignal = GuiKeys::inputButton->connectSignal("key_press_event", inputKey, key_cb); 254 GuiKeys::inputWindow->open(); 157 255 } 158 256 … … 164 262 \returns Nothing 165 263 */ 166 gint Player::key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey)264 gint key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey) 167 265 { 168 266 InputKey* inputkey =(InputKey*) inputKey; 169 char title [ 20];170 171 switch(event->keyval) 267 char title [50]; 268 269 switch(event->keyval) 172 270 { 173 271 case GDK_Up: 174 strcpy(title, " up");272 strcpy(title, "UP"); 175 273 break; 176 274 case GDK_Down: 177 strcpy(title, " down");275 strcpy(title, "DOWN"); 178 276 break; 179 277 case GDK_Left: 180 strcpy(title, " left");278 strcpy(title, "LEFT"); 181 279 break; 182 280 case GDK_Right: 183 strcpy(title, " right");281 strcpy(title, "RIGHT"); 184 282 break; 185 283 186 284 case GDK_space: 187 strcpy(title, " space");188 break; 189 190 case 65293:191 strcpy(title, " enter");285 strcpy(title, "SPACE"); 286 break; 287 288 case GDK_Return: 289 strcpy(title, "RETURN"); 192 290 break; 193 291 194 292 // Special Keys // 293 case GDK_BackSpace: 294 strcpy(title, "BACKSPACE"); 295 break; 296 case GDK_Scroll_Lock: 297 strcpy(title, "SCROLLOCK"); 298 break; 299 case GDK_minus: 300 strcpy(title, "MINUS"); 301 break; 302 case GDK_plus: 303 strcpy(title, "PLUS"); 304 break; 305 case GDK_slash: 306 strcpy(title, "SLASH"); 307 break; 308 case GDK_period: 309 strcpy(title, "PERIOD"); 310 break; 311 case GDK_comma: 312 strcpy(title, "COMMA"); 313 break; 314 case GDK_colon: 315 strcpy(title, "COLON"); 316 break; 317 case GDK_semicolon: 318 strcpy(title, "SEMICOLON"); 319 break; 320 case GDK_less: 321 strcpy(title, "LESS"); 322 break; 323 case GDK_equal: 324 strcpy(title, "EQUALS"); 325 break; 326 case GDK_greater: 327 strcpy(title, "GREATER"); 328 break; 329 case GDK_question: 330 strcpy(title, "QUESTION"); 331 break; 332 case GDK_at: 333 strcpy(title, "AT"); 334 break; 335 case GDK_bracketleft: 336 strcpy(title, "LEFTBRACKET"); 337 break; 338 case GDK_bracketright: 339 strcpy(title, "RIGHTBRACKET"); 340 break; 341 case GDK_backslash: 342 strcpy(title, "BACKSLASH"); 343 break; 344 case GDK_underscore: 345 strcpy(title, "UNDERSCORE"); 346 break; 347 case GDK_quoteleft: 348 strcpy(title, "BACKQUOTE"); 349 break; 350 351 case GDK_Page_Up: 352 strcpy(title, "PAGEUP"); 353 break; 354 case GDK_Page_Down: 355 strcpy(title, "PAGEDOWN"); 356 break; 357 case GDK_Home: 358 strcpy(title, "HOME"); 359 break; 360 case GDK_Insert: 361 strcpy(title, "INSERT"); 362 break; 363 195 364 case GDK_Escape: 196 strcpy(title, " esc");365 strcpy(title, "ESCAPE"); 197 366 break; 198 367 case GDK_Tab: 199 strcpy(title, " tab");368 strcpy(title, "TAB"); 200 369 break; 201 370 case GDK_Shift_L: 202 strcpy(title, " l_shift");371 strcpy(title, "LSHIFT"); 203 372 break; 204 373 case GDK_Shift_R: 205 strcpy(title, " r_shift");374 strcpy(title, "R_SHIFT"); 206 375 break; 207 376 case GDK_Control_L: 208 strcpy(title, " l_ctrl");377 strcpy(title, "LCTRL"); 209 378 break; 210 379 case GDK_Control_R: 211 strcpy(title, " r_ctrl");380 strcpy(title, "RCTRL"); 212 381 break; 213 382 case GDK_Alt_L: 214 strcpy(title, " l_alt");383 strcpy(title, "LALT"); 215 384 break; 216 385 case GDK_Alt_R: 217 strcpy(title, " r_alt");386 strcpy(title, "RALT"); 218 387 break; 219 388 // FXX KEYS // 220 389 case GDK_F1: 221 strcpy(title, " f1");390 strcpy(title, "F1"); 222 391 break; 223 392 case GDK_F2: 224 strcpy(title, " f2");393 strcpy(title, "F2"); 225 394 break; 226 395 case GDK_F3: 227 strcpy(title, " f3");396 strcpy(title, "F3"); 228 397 break; 229 398 case GDK_F4: 230 strcpy(title, " f4");399 strcpy(title, "F4"); 231 400 break; 232 401 case GDK_F5: 233 strcpy(title, " f5");402 strcpy(title, "F5"); 234 403 break; 235 404 case GDK_F6: 236 strcpy(title, " f6");405 strcpy(title, "F6"); 237 406 break; 238 407 case GDK_F7: 239 strcpy(title, " f7");408 strcpy(title, "F7"); 240 409 break; 241 410 case GDK_F8: 242 strcpy(title, " f8");411 strcpy(title, "F8"); 243 412 break; 244 413 case GDK_F9: 245 strcpy(title, " f9");414 strcpy(title, "F9"); 246 415 break; 247 416 case GDK_F10: 248 strcpy(title, " f10");417 strcpy(title, "F10"); 249 418 break; 250 419 case GDK_F11: 251 strcpy(title, " f11");420 strcpy(title, "F11"); 252 421 break; 253 422 case GDK_F12: 254 strcpy(title, " f12");423 strcpy(title, "F12"); 255 424 break; 256 425 … … 264 433 } 265 434 266 inputkey-> pKeyOLabel->setValue(title);267 inputButton->disconnectSignal(keySignal);268 inputWindow->close();269 } 270 #endif /* HAVE_GTK2 */ 435 inputkey->keyOLabel->setValue(title); 436 GuiKeys::inputButton->disconnectSignal(GuiKeys::keySignal); 437 GuiKeys::inputWindow->close(); 438 } 439 #endif /* HAVE_GTK2 */ -
orxonox/branches/md2_loader/src/lib/gui/gui/gui_keys.h
r4063 r4139 15 15 #endif /* HAVE_GTK2 */ 16 16 17 /** 18 \brief defines the Possible Player Keys 19 */ 20 enum KEYS {UP, DOWN, LEFT, RIGHT, SHOOT}; 17 //! One KeyOption has one InputKey 18 struct InputKey 19 { 20 Box* keyBox; //!< One Box that holds the Keys 21 Button* keyButton; //!< The Button for changing the Key. 22 OptionLabel* keyOLabel;//!< The Label for displaying the Key-setting. 23 }; 21 24 22 class Player;23 25 //! Class that creates the Keys-Options. 24 26 class GuiKeys : public GuiElement 25 27 { 26 private:27 Frame* keysFrame; //!< The Frame that holds the keyOptions.28 Box* keysBox; //!< The Frame that holds the keyOptions.29 Player* player1; //!< The first Player's keys.30 Player* player2; //!< The seconds Player's keys.31 Button* misc; //!< Other keyboeard options come here. \todo include some like pause, quit and so on.32 33 28 public: 34 29 GuiKeys(void); 35 30 ~GuiKeys(void); 36 };37 38 //! Class to hold infos about a Player39 /**40 \todo split into subclass and superclass ButtonConfigurator41 */42 class Player43 {44 private:45 Window* pKeyWindow; //!< The Window for a new Key-setting.46 Frame* pKeyFrame; //!< The Frame for a new Key-setting.47 Button* openButton; //!< The OpenButton for this key-settings.48 Button* closeButton; //!< The CloseButton for this key-settings.49 Box* pKeysBox; //!< The Box that holds the Key-settings.50 51 //! One KeyOption has one InputKey52 struct InputKey53 {54 Box* pKeyBox; //!< One Box that holds the Keys55 Button* pKeyButton; //!< The Button for changing the Key.56 OptionLabel* pKeyOLabel;//!< The Label for displaying the Key-setting.57 };58 59 InputKey* inputKey[10]; //!< Buttons-array. \todo make it dynamic.60 31 61 32 static Window* inputWindow; //!< A Window that gets keyboard clicks. Static, because only one needed. 62 33 static Button* inputButton; //!< A Button that gets keyboard clicks. Static, because only one needed. 63 34 static long keySignal; //!< A keySignal that handles keyboard clicks. Static, because only one needed. 35 }; 36 37 //! Class to hold infos about a Player 38 class PlayerKeys 39 { 40 private: 41 Button* openButton; //!< The OpenButton for this key-settings. 42 64 43 public: 65 Player(char* player); 66 67 Widget* addKey(KEYS key, char* name); 44 PlayerKeys(char* player); 68 45 69 46 Button* getOpenButton(void); 70 71 #ifdef HAVE_GTK272 static gint inputWindowEvent(GtkWidget* w, GdkEventKey* event, void* widget);73 static gint key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey);74 #endif /* HAVE_GTK2 */75 void setkey(KEYS key);76 77 47 }; 78 48 49 class MiscKeys 50 { 51 private: 52 Button* openButton; //!< The OpenButton for this key-settings. 53 54 public: 55 MiscKeys(); 56 57 Button* getOpenButton(void); 58 }; 59 60 Widget* addKey(const char* name, const char* defaultValue = NULL); 61 #ifdef HAVE_GTK2 62 gint inputWindowEvent(GtkWidget* w, GdkEventKey* event, void* widget); 63 gint key_cb(GtkWidget* w, GdkEventKey* event, void* inputKey); 64 #endif /* HAVE_GTK2 */ 79 65 80 66 -
orxonox/branches/md2_loader/src/lib/gui/gui/gui_update.cc
r4063 r4139 37 37 GuiUpdate::GuiUpdate(void) 38 38 { 39 FileDialog* dataDirDialog; //!< A FileDialog for the selection of the DataRepos 40 Button* dataDirButton; //!< A Button for the selection of the DataRepos 41 OptionLabel* dataDirLabel; //!< A Label fot the selection of the DataRepos 42 43 39 44 this->tmpDir = NULL; 40 45 this->homeDir = NULL; … … 45 50 46 51 this->updateFrame = new Frame("Update-Options:"); 47 this->updateFrame->setGroupName( "update");52 this->updateFrame->setGroupName(CONFIG_SECTION_DATA); 48 53 this->updateBox = new Box('v'); 54 55 dataDirButton = new Button(CONFIG_NAME_DATADIR); 56 dataDirLabel = new OptionLabel(CONFIG_NAME_DATADIR, "unknown"); 57 dataDirLabel->setFlagName("data-dir", "d", 0); 58 dataDirLabel->setDescription("Sets the location of the orxonox' Data-Directory"); 59 dataDirLabel->saveability(); 60 dataDirDialog = new FileDialog("data-Repos-location"); 61 dataDirDialog->setDefaultFileName("data"); 62 dataDirDialog->setMask(DATA_IDENTIFIER); 63 this->checkDataDir("../data/" DATA_IDENTIFIER, dataDirLabel); 64 dataDirDialog->disableFileOpts(); 65 dataDirDialog->setOpenUpButton(dataDirButton); 66 //dataDirDialog->setChangeOption(dataDirLabel); 67 dataDirDialog->setOKFunc(dataDirLabel, GuiUpdate::checkDataDir); 68 updateBox->fill(dataDirButton); 69 updateBox->fill(dataDirLabel); 70 49 71 #ifdef HAVE_CURL 50 72 51 73 // the Button for autoUpdating 52 this->autoUpdate = new CheckButton( "auto update");74 this->autoUpdate = new CheckButton(CONFIG_NAME_AUTO_UPDATE); 53 75 this->updateBox->fill(this->autoUpdate); 54 76 this->autoUpdate->setFlagName("update", "u", 0); 77 this->autoUpdate->setDescription("Updates orxonox", "When this option is selected orxonox automatically searches for updates, and if found installs them"); 55 78 this->autoUpdate->saveability(); 79 80 81 56 82 57 83 this->updateSourceWindowCreate(); … … 62 88 63 89 #else /* HAVE_CURL */ 64 Label* noCurlLabel = new Label("since you do not have cURL ,\nthis option isnot availible");90 Label* noCurlLabel = new Label("since you do not have cURL-support,\nupdate options are not availible"); 65 91 this->updateBox->fill(noCurlLabel); 66 92 #endif /* HAVE_CURL */ 67 93 this->updateFrame->fill(this->updateBox); 68 94 this->setMainWidget(this->updateFrame); 95 96 69 97 } 70 98 … … 76 104 77 105 } 106 107 /** 108 \brief checks if the Folder containing selected File is data.oxd, and if so sets it. 109 \param 110 */ 111 bool GuiUpdate::checkDataDir(const char* fileName, void* object) 112 { 113 if (!strcmp(fileName+(strlen(fileName)-strlen(DATA_IDENTIFIER)), DATA_IDENTIFIER)) 114 { 115 char* tmpName = new char[strlen(fileName)-strlen(DATA_IDENTIFIER)+1]; 116 strncpy(tmpName, fileName, strlen(fileName)-strlen(DATA_IDENTIFIER)); 117 tmpName[strlen(fileName)-strlen(DATA_IDENTIFIER)] = '\0'; 118 static_cast<OptionLabel*>(object)->setValue(tmpName); 119 delete tmpName; 120 return true; 121 } 122 else 123 return false; 124 } 125 78 126 79 127 /** … … 82 130 bool GuiUpdate::getSystemInfo(void) 83 131 { 84 PRINTF( 3)("Grabbing system information\n");132 PRINTF(5)("Grabbing system information\n"); 85 133 this->tmpDir = getenv("TMPDIR"); 86 134 if(!tmpDir) 87 135 this->tmpDir = "/tmp"; 88 PRINTF( 4)("Temporary directory is: %s\n", this->tmpDir);136 PRINTF(5)("Temporary directory is: %s\n", this->tmpDir); 89 137 90 138 #ifdef __WIN32__ … … 93 141 this->homeDir = getenv("HOME"); 94 142 #endif 95 PRINTF(4)("Home directory is %s\n", homeDir); 96 97 this->installDataDir = "/usr/share/games/orxonox"; 98 PRINTF(4)("Installation of orxonox-data will go to this directory: %s\n", this->installDataDir); 143 PRINTF(5)("Home directory is %s\n", homeDir); 144 145 146 this->installDataDir = DEFAULT_DATA_DIR; 147 PRINTF(5)("Installation of orxonox-data will go to this directory: %s\n", this->installDataDir); 99 148 100 149 this->installSourceDir = "/usr/games/bin"; 101 PRINTF( 4)("Installation of orxonox-source will go to this directory: %s\n", this->installSourceDir);150 PRINTF(5)("Installation of orxonox-source will go to this directory: %s\n", this->installSourceDir); 102 151 103 152 this->userName = getenv("USER"); 104 PRINTF( 4)("Logged in username is: %s\n", this->userName);153 PRINTF(5)("Logged in username is: %s\n", this->userName); 105 154 } 106 155 … … 108 157 bool* GuiUpdate::checkForUpdates(void) 109 158 { 110 PRINTF( 3)("checking for new version of orxonox\n");159 PRINTF(4)("checking for new version of orxonox\n"); 111 160 FileInfo updateFileInfo; 112 161 updateFileInfo.fileName = "update_info"; … … 218 267 dataInfo->webRoot = "http://www.orxonox.ethz.ch/files/"; 219 268 dataInfo->localRoot = "./"; 220 PRINTF( 3)("Preparing to download file %s.\n", dataInfo->fileName);269 PRINTF(4)("Preparing to download file %s.\n", dataInfo->fileName); 221 270 downloadWithStyle(dataInfo); 222 271 } … … 284 333 CURL* GuiUpdate::curlHandle = NULL; 285 334 286 /** 287 \brief A bool parameter that shows if we are downloading. 288 */ 335 //! A bool parameter that shows if we are downloading. 289 336 bool GuiUpdate::isDownloading = false; 290 337 338 //! A parameter to see, if downloading has been canceled 339 bool GuiUpdate::downloadCanceled = false; 291 340 292 341 /** … … 303 352 return false; 304 353 } 305 PRINTF( 3)("Downloading.\n");354 PRINTF(4)("Downloading.\n"); 306 355 FileInfo* info =(FileInfo*)fileInfo; 307 356 CURLcode res; … … 351 400 return false; 352 401 } 353 PRINTF( 3)("Downloading.\n");402 PRINTF(4)("Downloading.\n"); 354 403 FileInfo* info =(FileInfo*)fileInfo; 355 404 CURLcode res; … … 419 468 curl_easy_cleanup(curlHandle); 420 469 421 PRINTF( 3)("Closing the downloaded file.\n");470 PRINTF(4)("Closing the downloaded file.\n"); 422 471 fclose(info->fileHandle); 423 472 … … 445 494 gint GuiUpdate::cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar) 446 495 { 447 PRINTF( 4)("Cannot cancle the Downloading process until after this File\n");496 PRINTF(3)("Cannot cancle the Downloading process until after this File\n"); 448 497 } 449 498 #endif /* HAVE_GTK2 */ -
orxonox/branches/md2_loader/src/lib/gui/gui/gui_update.h
r4063 r4139 10 10 #include "gui_element.h" 11 11 #include "gui_gtk.h" 12 13 14 #define DATA_IDENTIFIER "data.oxd" 12 15 13 16 #include <stdio.h> … … 59 62 static gint updateSourceFunc(GtkWidget* w, GdkEventKey* event, void* info); 60 63 #endif /* HAVE_GTK2 */ 64 65 static bool checkDataDir(const char* fileName, void* object); 61 66 62 67 #ifdef HAVE_CURL -
orxonox/branches/md2_loader/src/lib/gui/gui/gui_video.cc
r4063 r4139 27 27 #include "gui_video.h" 28 28 29 #include "gui_gtk.h" 29 30 #include "glincl.h" 30 31 #include <stdlib.h> … … 35 36 GuiVideo::GuiVideo(void) 36 37 { 37 this->videoFrame = new Frame("Video-Options:"); 38 this->videoBox = new Box('v'); 39 this->videoFrame->setGroupName("video"); 40 41 this->fullscreen = new CheckButton("Fullscreen-mode"); 42 this->fullscreen->setFlagName("windowed", "q", 1); 43 this->fullscreen->saveability(); 44 this->videoBox->fill(this->fullscreen); 45 this->resolution = new Menu("Resolution"); 46 this->getResolutions(this->resolution); 47 this->resolution->saveability(); 48 this->resolution->setFlagName("resolution", "r", 0); 49 this->videoBox->fill(this->resolution); 50 this->wireframe = new CheckButton("WireFrame-mode"); 51 this->wireframe->setFlagName("wireframe", "w", 0); 52 this->wireframe->saveability(); 53 this->videoBox->fill(this->wireframe); 54 55 this->advancedWindowCreate(); 56 this->videoBox->fill(this->advancedWindowGetButton()); 57 58 this->videoFrame->fill(videoBox); 59 this->setMainWidget(this->videoFrame); 38 Frame* videoFrame; //!< The Frame that holds the video options. 39 40 videoFrame = new Frame("Video-Options:"); 41 videoFrame->setGroupName("video"); 42 { 43 Box* videoBox; //!< The Box that holds the video options. 44 45 videoBox = new Box('v'); 46 { 47 CheckButton* fullscreen; //!< CheckButton for fullscreen-mode 48 Menu* resolution; //!< Menu for the resolution 49 CheckButton* wireframe; //!< CheckButton for wireframe Mode. 50 51 fullscreen = new CheckButton(CONFIG_NAME_FULLSCREEN); 52 fullscreen->setFlagName("windowed", "q", 1); 53 fullscreen->setDescription("Starts orxonox in windowed mode"); 54 fullscreen->saveability(); 55 videoBox->fill(fullscreen); 56 resolution = new Menu(CONFIG_NAME_RESOLUTION); 57 getResolutions(resolution); 58 resolution->saveability(); 59 resolution->setFlagName("resolution", "r", 0); 60 resolution->setDescription("Sets the resolution of orxonox"); 61 videoBox->fill(resolution); 62 wireframe = new CheckButton(CONFIG_NAME_WIREFRAME); 63 wireframe->setFlagName("wireframe", "w", 0); 64 wireframe->setDescription("Starts orxonox in wireframe mode"); 65 wireframe->saveability(); 66 videoBox->fill(wireframe); 67 68 videoBox->fill(advancedWindowCreate()); 69 } 70 videoFrame->fill(videoBox); 71 } 72 setMainWidget(videoFrame); 60 73 } 61 74 … … 71 84 \brief Creates a window, and all it contains for the Source-update. 72 85 */ 73 void GuiVideo::advancedWindowCreate(void) 74 { 86 Widget* GuiVideo::advancedWindowCreate(void) 87 { 88 // advanced-Performance-Options 89 Window* advancedWindow; //!< A Window to display advanced options. 90 Button* advancedButton; //!< A Button to open the Advanced Video Performance Window. 75 91 // the button, that opens this Window. 76 this->advancedButton = new Button("advanced");92 advancedButton = new Button("advanced"); 77 93 78 94 // the Window itself 79 this->advancedWindow = new Window("Advanced Video Options"); 80 this->advancedWindow->setGroupName("advancedVideoOptions"); 81 82 this->advancedBox = new Box('v'); 83 84 // Advanced Performance Options 85 this->shadows = new CheckButton("Shadows"); 86 this->shadows->saveability(); 87 this->advancedBox->fill(this->shadows); 88 89 this->fog = new CheckButton("Fog"); 90 this->fog->saveability(); 91 this->advancedBox->fill(this->fog); 92 93 this->reflections = new CheckButton("Reflections"); 94 this->reflections->saveability(); 95 this->advancedBox->fill(this->reflections); 96 97 this->textures = new CheckButton("Textures"); 98 this->textures->saveability(); 99 this->advancedBox->fill(this->textures); 100 101 this->textureDetail = new Menu("Texture Detail", "low", "medium", "high", "lastItem"); 102 this->textureDetail->setDefaultValue(1); 103 this->textureDetail->saveability(); 104 this->advancedBox->fill(this->textureDetail); 105 106 this->modelDetailLabel = new Label("Model Detail"); 107 this->advancedBox->fill(this->modelDetailLabel); 108 this->modelDetail = new Menu("Model Detail", "low", "high", "lastItem"); 109 this->modelDetail->setDefaultValue(1); 110 this->modelDetail->saveability(); 111 this->advancedBox->fill(this->modelDetail); 112 113 this->antiAliasingLabel = new Label("Anti-Aliasing-depth:"); 114 this->advancedBox->fill(this->antiAliasingLabel); 115 this->antiAliasing = new Menu("Anti Aliasing", "0", "1", "2", "4", "8", "lastItem"); 116 this->antiAliasing->setDefaultValue(2); 117 this->antiAliasing->saveability(); 118 this->advancedBox->fill(this->antiAliasing); 119 120 this->filterMethodLabel = new Label("Filtering Method:"); 121 this->advancedBox->fill(this->filterMethodLabel); 122 this->filterMethod = new Menu("Filtering Method", "none", "linear", "bilinear", "trilinear", "anisortopic", "lastItem"); 123 this->filterMethod->setDefaultValue(1); 124 this->filterMethod->saveability(); 125 this->advancedBox->fill(this->filterMethod); 126 127 this->closeButton = new Button("close"); 128 this->advancedBox->fill(this->closeButton); 129 130 this->advancedWindow->fill(advancedBox); 131 #ifdef HAVE_GTK2 132 this->advancedButton->connectSignal("button_press_event", this->advancedWindow, Window::windowOpen); 133 this->closeButton->connectSignal("button_press_event", this->advancedWindow, Window::windowClose); 134 this->advancedWindow->connectSignal("destroy", this->advancedWindow, Window::windowClose); 135 this->advancedWindow->connectSignal("delete_event", this->advancedWindow, Window::windowClose); 95 advancedWindow = new Window("Advanced Video Options"); 96 advancedWindow->setGroupName(CONFIG_SECTION_VIDEO_ADVANCED); 97 { 98 Box* advancedBox; //!< A Box to pack the options into. 99 100 advancedBox = new Box('v'); 101 { 102 CheckButton* shadows; //!< CheckButton for shadows 103 CheckButton* fog; //!< CheckButton for fog. 104 CheckButton* reflections; //!< CheckButton for reflections 105 CheckButton* textures; //!< CheckButton for textures 106 Menu* textureDetail; //!< Menu for the Texture-Detail. 107 Label* modelDetailLabel; //!< Label for model-detail. 108 Menu* modelDetail; //!< model-detail. 109 Label* antiAliasingLabel; //!< Label for the anti-aliasing mode. 110 Menu* antiAliasing; //!< Menu for the Antialiasing-mode. 111 Label* filterMethodLabel; //!< Label for filtering-Method. 112 Menu* filterMethod; //!< Menu for filtering Method. 113 Button* closeButton; //!< A Button to close the Advanced-settingsWindow. 114 115 // Advanced Performance Options 116 shadows = new CheckButton(CONFIG_NAME_SHADOWS); 117 shadows->saveability(); 118 advancedBox->fill(shadows); 119 120 fog = new CheckButton(CONFIG_NAME_FOG); 121 fog->saveability(); 122 advancedBox->fill(fog); 123 124 reflections = new CheckButton(CONFIG_NAME_REFLECTIONS); 125 reflections->saveability(); 126 advancedBox->fill(reflections); 127 128 textures = new CheckButton(CONFIG_NAME_TEXTURES); 129 textures->saveability(); 130 advancedBox->fill(textures); 131 132 textureDetail = new Menu(CONFIG_NAME_TEXTURE_DETAIL, "low", "medium", "high", "lastItem"); 133 textureDetail->setDefaultValue(1); 134 textureDetail->saveability(); 135 advancedBox->fill(textureDetail); 136 137 modelDetailLabel = new Label(CONFIG_NAME_MODEL_DETAIL); 138 advancedBox->fill(modelDetailLabel); 139 modelDetail = new Menu(CONFIG_NAME_MODEL_DETAIL, "low", "high", "lastItem"); 140 modelDetail->setDefaultValue(1); 141 modelDetail->saveability(); 142 advancedBox->fill(modelDetail); 143 144 antiAliasingLabel = new Label("Anti-Aliasing-depth:"); 145 advancedBox->fill(antiAliasingLabel); 146 antiAliasing = new Menu(CONFIG_NAME_ANTI_ALIASING, "0", "1", "2", "4", "8", "lastItem"); 147 antiAliasing->setDefaultValue(2); 148 antiAliasing->saveability(); 149 advancedBox->fill(antiAliasing); 150 151 filterMethodLabel = new Label("Filtering Method:"); 152 advancedBox->fill(filterMethodLabel); 153 filterMethod = new Menu(CONFIG_NAME_FILTER_METHOD, "none", "linear", "bilinear", "trilinear", "anisortopic", "lastItem"); 154 filterMethod->setDefaultValue(1); 155 filterMethod->saveability(); 156 advancedBox->fill(filterMethod); 157 158 closeButton = new Button("close"); 159 #ifdef HAVE_GTK2 160 closeButton->connectSignal("button_press_event", advancedWindow, Window::windowClose); 136 161 #endif /* HAVE_GTK2 */ 137 Window::addWindow(this->advancedWindow); 138 139 } 140 141 /** 142 \returns A Pointer to the Button of the UpdaterSourceWindow 143 */ 144 Button* GuiVideo::advancedWindowGetButton(void) 145 { 146 return this->advancedButton; 147 } 148 162 163 advancedBox->fill(closeButton); 164 } 165 advancedWindow->fill(advancedBox); 166 } 167 #ifdef HAVE_GTK2 168 advancedButton->connectSignal("button_press_event", advancedWindow, Window::windowOpen); 169 advancedWindow->connectSignal("destroy", advancedWindow, Window::windowClose); 170 advancedWindow->connectSignal("delete_event", advancedWindow, Window::windowClose); 171 #endif /* HAVE_GTK2 */ 172 Window::addWindow(advancedWindow); 173 174 return advancedButton; 175 } 176 177 /** 178 \brief sets all resolutions to the menu 179 \param menu the Menu to set The resolutions to. 180 */ 149 181 void GuiVideo::getResolutions(Menu* menu) 150 182 { … … 170 202 else{ 171 203 /* Print valid modes */ 172 PRINT( 4)("Available Modes\n");204 PRINT(5)("Available Modes\n"); 173 205 for(i = 0; modes[i] ;++i) 174 206 { 175 207 if (x != modes[i]->w || y != modes[i]->h) 176 208 { 177 PRINT (4)(" %d x %d\n", modes[i]->w, modes[i]->h);209 PRINTF(5)(" %d x %d\n", modes[i]->w, modes[i]->h); 178 210 sprintf(tmpChar, "%dx%d", modes[i]->w, modes[i]->h); 179 211 menu->addItem(tmpChar); -
orxonox/branches/md2_loader/src/lib/gui/gui/gui_video.h
r4063 r4139 8 8 #include "gui.h" 9 9 #include "gui_element.h" 10 #include "gui_gtk.h" 10 11 // FORWARD DECLARATIONS 12 class Widget; 13 class Menu; 11 14 12 15 //! Class that creates the Video-Options. … … 14 17 { 15 18 private: 16 Frame* videoFrame; //!< The Frame that holds the video options. 17 Box* videoBox; //!< The Box that holds the video options. 18 CheckButton* fullscreen; //!< CheckButton for fullscreen-mode 19 Menu* resolution; //!< Menu for the resolution 20 CheckButton* wireframe; //!< CheckButton for wireframe Mode. 21 22 // advanced-Performance-Options 23 Window* advancedWindow; //!< A Window to display advanced options. 24 Button* advancedButton; //!< A Button to open the Advanced Video Performance Window. 25 Box* advancedBox; //!< A Box to pack the options into. 26 CheckButton* shadows; //!< CheckButton for shadows 27 CheckButton* fog; //!< CheckButton for fog. 28 CheckButton* reflections; //!< CheckButton for reflections 29 CheckButton* textures; //!< CheckButton for textures 30 Menu* textureDetail; //!< Menu for the Texture-Detail. 31 32 Label* modelDetailLabel; //!< Label for model-detail. 33 Menu* modelDetail; //!< model-detail. 34 35 Label* antiAliasingLabel; //!< Label for the anti-aliasing mode. 36 Menu* antiAliasing; //!< Menu for the Antialiasing-mode. 37 38 Label* filterMethodLabel; //!< Label for filtering-Method. 39 Menu* filterMethod; //!< Menu for filtering Method. 40 41 Button* closeButton; //!< A Button to close the Advanced-settingsWindow. 42 43 Button* advancedWindowGetButton(void); 44 void advancedWindowCreate(void); 19 // Button* advancedWindowGetButton(void); 45 20 46 21 public: … … 48 23 ~GuiVideo(void); 49 24 25 private: 50 26 void getResolutions(Menu* menu); 51 52 27 Widget* advancedWindowCreate(void); 53 28 }; 54 29 #endif /* _GUI_VIDEO_H */ -
orxonox/branches/md2_loader/src/lib/gui/gui/rc
r4063 r4139 1 /* 2 * style <name> [= <name>] 3 * { 4 * <option> 5 * } 6 * 7 * widget <widget_set> style <style_name> 8 * widget_class <widget_class_set> style <style_name> 9 * 10 * Here is a list of all the possible states. Note that some do not apply to 11 * certain widgets. 12 * 13 * NORMAL - The normal state of a widget, without the mouse over top of 14 * it, and not being pressed, etc. 15 * 16 * PRELIGHT - When the mouse is over top of the widget, colors defined 17 * using this state will be in effect. 18 * 19 * ACTIVE - When the widget is pressed or clicked it will be active, and 20 * the attributes assigned by this tag will be in effect. 21 * 22 * INSENSITIVE - When a widget is set insensitive, and cannot be 23 * activated, it will take these attributes. 24 * 25 * SELECTED - When an object is selected, it takes these attributes. 26 * 27 * Given these states, we can set the attributes of the widgets in each of 28 * these states using the following directives. 29 * 30 * fg - Sets the foreground color of a widget. 31 * bg - Sets the background color of a widget. 32 * bg_pixmap - Sets the background of a widget to a tiled pixmap. 33 * base - Sets the base of Widgets 34 * font - Sets the font to be used with the given widget. 35 */ 36 37 38 1 39 static const gchar* rc_string = 2 ( 40 ( 41 "style'orxonox'" 42 "{" 43 "fg[NORMAL] = { 0.0, 1.0, 0.0 }" 44 "fg[PRELIGHT] = { 0.0, 1.0, 0.0 }" 45 "fg[ACTIVE] = { 0.0, 1.0, 0.0 }" 46 "fg[INSENSITIVE] = { 0.0, 0.8, 0.0 }" 47 "fg[SELECTED] = { 0.0, 1.0, 0.0 }" 48 49 "bg[NORMAL] = { 0.0, 0.0, 0.0 }" 50 "bg[PRELIGHT] = { 0.0, 1.0, 0.0 }" 51 "bg[ACTIVE] = { 0.0, 0.3, 0.0 }" 52 "bg[INSENSITIVE] = { 0.0, 0.1, 0.0 }" 53 "bg[SELECTED] = { 0.0, 0.1, 0.0 }" 54 55 "base[NORMAL] = { 0.0, 1.0, 0.0 }" 56 "base[PRELIGHT] = { 0.0, 1.0, 0.0 }" 57 "base[ACTIVE] = { 0.0, 1.0, 0.0 }" 58 "base[INSENSITIVE] = { 0.0, 1.0, 0.0 }" 59 "base[SELECTED] = { 0.0, 1.0, 0.0 }" 60 61 "font = '-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-*-*'" 62 "}" 63 3 64 "style'window'" 4 65 "{" … … 7 68 "base[NORMAL] = { 0, 0, 0 }" 8 69 "base[INSENSITIVE] = { 0, 0, 0 }" 70 "}" 71 72 "style'frame'" 73 "{" 74 "bg[NORMAL] = { 0.0, 0.4, 0.0 }" 9 75 "}" 10 76 … … 26 92 "bg[NORMAL] = { 0, 0, 0 }" 27 93 "fg[NORMAL] = { 0, 1.0, 0 }" 28 "bg[INSENSITIVE] = { 1.0, 0, 1.0 }"29 "fg[INSENSITIVE] = { 1.0, 0, 1.0 }"94 "bg[INSENSITIVE] = { 0.0, 0.2, 0.0 }" 95 "fg[INSENSITIVE] = { 0.0, 0.8, 0.0 }" 30 96 "base[NORMAL] = { 0, 1.0, 0 }" 31 97 "base[PRELIGHT] = { 0, 1.0, 0 }" … … 55 121 "}" 56 122 123 "widget'Gtk*' style'orxonox'" 124 "widget'*Gtk*Frame*' style'frame'" 57 125 "widget'GtkWindow' style'window'" 58 "widget'GtkFrame' style'window'"59 "widget'Gtk*EventBox' style'window'"60 "widget'GtkDialog' style'window'"61 126 "widget'GtkFileSelection' style'window'" 62 127 "widget'*Gtk*Scale' style'scale'" -
orxonox/branches/md2_loader/src/lib/util/ini_parser.cc
r4063 r4139 16 16 17 17 #include "ini_parser.h" 18 #include "resource_manager.h" 18 19 19 20 using namespace std; 20 21 21 22 /** 22 23 23 \brief constructs an IniParser using a file 24 \param filename: the path and name of the file to parse 24 25 */ 25 26 IniParser::IniParser (const char* filename) … … 27 28 stream = NULL; 28 29 bInSection = false; 29 openFile(filename);30 this->openFile(filename); 30 31 } 31 32 32 33 /** 33 34 \brief removes the IniParser from memory 34 35 */ 35 36 IniParser::~IniParser () … … 45 46 int IniParser::openFile(const char* filename) 46 47 { 48 char* tmpName = ResourceManager::homeDirCheck(filename); 47 49 if( filename == NULL) return -1; 48 50 if( stream != NULL) fclose (stream); 49 if( (stream = fopen ( filename, "r")) == NULL)51 if( (stream = fopen (tmpName, "r")) == NULL) 50 52 { 51 printf("IniParser could not open %s\n", filename); 53 PRINTF(1)("IniParser could not open %s\n", filename); 54 delete tmpName; 52 55 return -1; 53 56 } 54 57 bInSection = false; 58 delete tmpName; 55 59 return 0; 56 60 } … … 123 127 return -1; 124 128 } 125 if( (ptr = strchr( linebuffer, '=')) != NULL) 129 sscanf(linebuffer, "%s = %s", name, value); 130 return 0; 131 /* 132 if( (ptr = strchr( tmpBuffer, '=')) != NULL) 126 133 { 127 if( ptr == linebuffer) continue; 128 strcpy (value, &ptr[1]); 129 strncpy (name, linebuffer, strlen (linebuffer) - strlen (value) - 1); 130 return 0; 134 if( ptr == linebuffer) continue; 135 strcpy (value, &ptr[1]); 136 strncpy (name, linebuffer, strlen (linebuffer) - strlen (value) - 1); 137 printf ("%s, %s\n", value, name); 138 return 0; 131 139 } 140 */ 132 141 } 133 142 return -1; -
orxonox/branches/md2_loader/src/orxonox.cc
r4072 r4139 32 32 #include "data_tank.h" 33 33 #include "command_node.h" 34 #include "ini_parser.h" 34 35 #include "game_loader.h" 35 36 #include "graphics_engine.h" … … 37 38 #include "text_engine.h" 38 39 #include "factory.h" 40 #include "benchmark.h" 39 41 40 42 #include <string.h> … … 46 48 /** 47 49 \brief create a new Orxonox 50 51 In this funcitons only global values are set. The game will not be started here. 48 52 */ 49 53 Orxonox::Orxonox () … … 54 58 this->resources = NULL; 55 59 this->localinput = NULL; 60 61 this->argc = 0; 62 this->argv = NULL; 56 63 } 57 64 … … 93 100 void Orxonox::getConfigFile (int argc, char** argv) 94 101 { 95 strcpy (configfilename, " orxonox.conf");102 strcpy (configfilename, "~/.orxonox/orxonox.conf"); 96 103 } 97 104 … … 101 108 int Orxonox::init (int argc, char** argv) 102 109 { 110 this->argc = argc; 111 this->argv = argv; 103 112 // parse command line 104 113 // config file … … 107 116 SDL_Init (SDL_INIT_TIMER); 108 117 // initialize everything 118 printf("> Initializing resources\n"); 119 if( initResources () == -1) return -1; 120 109 121 if( initVideo() == -1) return -1; 110 122 if( initSound() == -1) return -1; … … 113 125 printf("> Initializing networking\n"); 114 126 if( initNetworking () == -1) return -1; 115 printf("> Initializing resources\n");116 if( initResources () == -1) return -1;117 127 //printf("> Initializing world\n"); 118 128 //if( init_world () == -1) return -1; PB: world will be initialized when started … … 129 139 130 140 GraphicsEngine::getInstance(); 131 141 132 142 return 0; 133 143 } … … 152 162 { 153 163 // create localinput 154 localinput = new CommandNode( 164 localinput = new CommandNode(configfilename); 155 165 156 166 return 0; … … 173 183 int Orxonox::initResources() 174 184 { 175 // printf("Not yet implemented\n");176 185 PRINT(3)("initializing ResourceManager\n"); 177 186 resourceManager = ResourceManager::getInstance(); 178 if (!resourceManager->setDataDir("../data/")) 179 { 180 PRINTF(1)("Data Could not be located\n"); 187 188 // create parser 189 IniParser parser (DEFAULT_CONFIG_FILE); 190 if( parser.getSection (CONFIG_SECTION_DATA) == -1) 191 { 192 PRINTF(1)("Could not find Section %s in %s\n", CONFIG_SECTION_DATA, DEFAULT_CONFIG_FILE); 193 return -1; 194 } 195 char namebuf[256]; 196 char valuebuf[256]; 197 memset (namebuf, 0, 256); 198 memset (valuebuf, 0, 256); 199 200 while( parser.nextVar (namebuf, valuebuf) != -1) 201 { 202 if (!strcmp(namebuf, CONFIG_NAME_DATADIR)) 203 { 204 // printf("Not yet implemented\n"); 205 if (!resourceManager->setDataDir(valuebuf)) 206 { 207 PRINTF(1)("Data Could not be located\n"); 208 exit(-1); 209 } 210 } 211 212 memset (namebuf, 0, 256); 213 memset (valuebuf, 0, 256); 214 } 215 216 if (!resourceManager->checkDataDir(DEFAULT_DATA_DIR_CHECKFILE)) 217 { 218 PRINTF(1)("The DataDirectory %s could not be verified\nPlease Change in File %s Section %s Entry %s to a suitable value\n", 219 resourceManager->getDataDir(), 220 DEFAULT_CONFIG_FILE, 221 CONFIG_SECTION_DATA, 222 CONFIG_NAME_DATADIR); 181 223 exit(-1); 182 224 } 225 183 226 184 227 PRINT(3)("initializing TextEngine\n"); 185 228 TextEngine::getInstance(); 229 230 return 0; 186 231 } 187 232 … … 213 258 214 259 this->gameLoader = GameLoader::getInstance(); 215 this->gameLoader->loadCampaign(" ../data/worlds/DefaultCampaign.oxc");260 this->gameLoader->loadCampaign("worlds/DefaultCampaign.oxc"); 216 261 // this->gameLoader->loadDebugCampaign(DEBUG_CAMPAIGN_0); 217 262 this->gameLoader->init(); … … 301 346 */ 302 347 int main(int argc, char** argv) 303 { 304 305 /* reading arguments 306 307 currently supported arguments are: 308 <no args> :: just starts orxonox 309 --benchmark :: start the benchmark without starting orxonox 310 311 this is a preselection: it matches to one of the start* functions, the 312 finetuning is made in those functions. 313 */ 314 315 printf("++INFO++++++++++++++++++++++++++++++++++++++++++++++++\n"); 348 { 349 316 350 printf("+ This version of orxonox is for testing purposes +\n"); 317 351 printf("+ In order to run it, you will need some files for +\n"); … … 326 360 for(i = 1; i < argc; ++i) 327 361 { 328 if(! strcmp( "--help", argv[i]) ) return startHelp();329 else if(! strcmp( "--benchmark", argv[i])) return startBenchmarks();330 else if(! 331 else PRINTF(2)("Orxonox does not understand the arguments %s\n", argv[i]);362 if(! strcmp( "--help", argv[i]) || !strcmp("-h", argv[i])) return startHelp(argc, argv); 363 else if(!strcmp( "--benchmark", argv[i]) || !strcmp("-b", argv[i])) return startBenchmarks(); 364 else if(!strcmp( "--gui", argv[i]) || !strcmp("-g", argv[i])) showGui = true; 365 // else PRINTF(2)("Orxonox does not understand the arguments %s\n", argv[i]); 332 366 } 333 367 … … 337 371 338 372 339 int startHelp( )373 int startHelp(int argc, char** argv) 340 374 { 341 375 PRINT(0)("orxonox: starts the orxonox game - rules\n"); 342 PRINT(0)("usage: orxonox [arg ]\n\n");376 PRINT(0)("usage: orxonox [arg [arg...]]\n\n"); 343 377 PRINT(0)("valid options:\n"); 344 PRINT(0)(" --benchmark\tstarts the orxonox benchmark\n"); 345 PRINT(0)(" --help \tshows this menu\n"); 346 PRINT(0)(" --gui/-g \tDisplays the Gui on startup\n"); 378 { 379 Gui* gui = new Gui(argc, argv); 380 gui->printHelp(); 381 delete gui; 382 } 383 PRINT(0)(" -b|--benchmark:\t\tstarts the orxonox benchmark\n"); 384 PRINT(0)(" -h|--help:\t\t\tshows this help\n"); 347 385 } 348 386 … … 357 395 if (ResourceManager::isFile("~/.orxonox/orxonox.lock")) 358 396 ResourceManager::deleteFile("~/.orxonox/orxonox.lock"); 359 // char* guiExec = new char[strlen(argv[0])+20];360 // sprintf(guiExec,"%sGui --gui", argv[0]);397 398 // starting the GUI 361 399 Gui* gui = new Gui(argc, argv); 400 gui->startGui(); 401 362 402 if (! gui->startOrxonox) 363 403 return 0; … … 384 424 385 425 } 386 387 #if defined __linux__388 389 #include "list.h"390 #include "world_entity.h"391 #include "vector.h"392 #include "player.h"393 #include "base_object.h"394 395 #include <asm/msr.h>396 #include <linux/timex.h>397 398 399 #define LIST_MAX 1000400 #define VECTOR_MAX 1000000401 #define ITERATIONS 10000402 403 404 int startBenchmarks()405 {406 407 printf("===========================================================\n");408 printf("= BENCHMARKS =\n");409 printf("===========================================================\n");410 printf(" the author is not paying any attention to cacheing effects\n");411 printf(" of the CPU.\n\n");412 printf("[title]\t\t\t\t\t [cycles]\t[loops]\n\n");413 // printf("------------------------------------------------------------\n\n");414 415 // first measure the time overhead:416 unsigned long ini, end, dt, tmp;417 rdtscl(ini); rdtscl(end);418 dt = end - ini;419 420 int type = -1;421 /* type -1 == all422 type 0 == framework423 type 1 == vector424 type 2 == quaternion425 type 3 == lists426 */427 if(type == 0 || type == -1)428 {429 /* framework test*/430 431 printf("Generating Objects:\t\t\t\t\t%i\n", ITERATIONS);432 /* ************WorldEntity class test************** */433 WorldEntity* w = NULL;434 int i = 0;435 unsigned long mittel = 0;436 437 for(i = 0; i < ITERATIONS; ++i)438 {439 rdtscl(ini);440 441 WorldEntity* w = new WorldEntity();442 443 rdtscl(end);444 delete w;445 mittel += (end - ini - dt);446 }447 float mi = mittel / (float)ITERATIONS;448 printf(" Generate a WorldEntity object:\t\t%11.2f\n", mi);449 450 /*451 mittel = 0;452 for(i = 0; i < ITERATIONS; ++i)453 {454 rdtscl(ini);455 456 WorldEntity* w = new Primitive(P_SPHERE);457 458 rdtscl(end);459 delete w;460 mittel += (end - ini - dt);461 }462 mi = mittel / (float)ITERATIONS;463 printf(" Generate a Primitive object:\t\t%11.2f\n", mi);464 */465 466 mittel = 0;467 for(i = 0; i < ITERATIONS; ++i)468 {469 rdtscl(ini);470 471 Vector* v = new Vector();472 473 rdtscl(end);474 delete v;475 mittel += (end - ini - dt);476 }477 mi = mittel / (float)ITERATIONS;478 printf(" Generate a Vector object:\t\t%11.2f\n", mi);479 480 481 mittel = 0;482 for(i = 0; i < ITERATIONS; ++i)483 {484 rdtscl(ini);485 486 Quaternion* q = new Quaternion();487 488 rdtscl(end);489 delete q;490 mittel += (end - ini - dt);491 }492 mi = mittel / (float)ITERATIONS;493 printf(" Generate a Quaternion object:\t\t%11.2f\n", mi);494 495 496 497 498 printf("\nCalling function inline &| virtual, \t\t\t%i\n", ITERATIONS);499 mittel = 0;500 w = new WorldEntity();501 for(i = 0; i < ITERATIONS; ++i)502 {503 rdtscl(ini);504 505 w->tick(0.0f);506 507 rdtscl(end);508 mittel += (end - ini - dt);509 }510 //delete w;511 mi = mittel / (float)ITERATIONS;512 printf(" Virt funct tick() of WE: \t\t%11.2f\n", mi);513 514 515 mittel = 0;516 WorldEntity wo;517 for(i = 0; i < ITERATIONS; ++i)518 {519 rdtscl(ini);520 521 wo.tick(0.0f);522 523 rdtscl(end);524 mittel += (end - ini - dt);525 }526 //delete w;527 mi = mittel / (float)ITERATIONS;528 printf(" Inl virt funct tick() of WE v2: \t%11.2f\n", mi);529 530 531 mittel = 0;532 BaseObject* bo = new BaseObject();533 for(i = 0; i < ITERATIONS; ++i)534 {535 rdtscl(ini);536 537 bo->isFinalized();538 539 rdtscl(end);540 mittel += (end - ini - dt);541 }542 //delete w;543 mi = mittel / (float)ITERATIONS;544 printf(" Inl funct BaseObject::isFinazlized(): \t%11.2f\n", mi);545 546 547 tList<WorldEntity>* list = new tList<WorldEntity>();548 549 550 /* ************Primitvie class test************** */551 list = new tList<WorldEntity>();552 553 554 /*555 mittel = 0;556 w = new Primitive(P_SPHERE);557 for(i = 0; i < ITERATIONS; ++i)558 {559 rdtscl(ini);560 561 w->tick(0.0f);562 563 rdtscl(end);564 mittel += (end - ini - dt);565 }566 mi = mittel / (float)ITERATIONS;567 printf(" Call function tick() of Prim:\t\t%11.2f\n", mi);568 */569 570 }571 572 if(type == 1 || type == -1)573 {574 printf("\nDoing some simple vector operations: \t\t\t%i\n", VECTOR_MAX);575 /* vector test */576 Vector* a = new Vector(1.3, 5.3, 4.1);577 Vector* b = new Vector(0.4, 2.5, 6.2);578 Vector* c = new Vector();579 580 unsigned long mittel, ini, end;581 float mi;582 int i = 0;583 // addition584 mittel = 0;585 for(i = 0; i < VECTOR_MAX; ++i)586 {587 rdtscl(ini);588 589 *c = *a + *b;590 591 rdtscl(end);592 mittel += (end - ini - dt);593 }594 mi = mittel / (float)VECTOR_MAX;595 printf(" Addition of two vectors:\t\t%11.2f\n", mi);596 597 // multiplikation598 599 mittel = 0;600 for(i = 0; i < VECTOR_MAX; ++i)601 {602 rdtscl(ini);603 604 *c = a->cross( *b);605 606 rdtscl(end);607 mittel += (end - ini - dt);608 }609 mi = mittel / (float)VECTOR_MAX;610 printf(" CrossMult of two vectors:\t\t%11.2f\n", mi);611 612 }613 if( type == 2 || type == -1)614 {615 /* quaternion test */616 printf("\nDoing some simple quaternion operations: \t\t%i\n", VECTOR_MAX);617 /* vector test */618 Quaternion* a = new Quaternion();619 Quaternion* b = new Quaternion();620 Quaternion* c = new Quaternion();621 622 unsigned long mittel, ini, end;623 float mi;624 int i = 0;625 // quaternion generieren mit spez konstruktor626 mittel = 0;627 Vector* qa = new Vector(4.6, 9.3, 0.4);628 Vector* qb = new Vector(3.5, 6.1, 4.3);629 for(i = 0; i < VECTOR_MAX; ++i)630 {631 rdtscl(ini);632 633 Quaternion* qu = new Quaternion(*qa, *qb);634 635 rdtscl(end);636 delete qu;637 mittel += (end - ini - dt);638 }639 delete a;640 delete b;641 mi = mittel / (float)VECTOR_MAX;642 printf(" Gen. quatern. betw. two vectors:\t%11.2f\n", mi);643 644 645 // multiplication646 mittel = 0;647 for(i = 0; i < VECTOR_MAX; ++i)648 {649 rdtscl(ini);650 651 *c = *a * *b;652 653 rdtscl(end);654 mittel += (end - ini - dt);655 }656 mi = mittel / (float)VECTOR_MAX;657 printf(" Multiplying two quat.(=rot): a * b\t%11.2f\n", mi);658 659 660 661 // rotating a vector by a quaternion662 mittel = 0;663 for(i = 0; i < VECTOR_MAX; ++i)664 {665 rdtscl(ini);666 667 *qa = a->apply(*qb);668 669 rdtscl(end);670 mittel += (end - ini - dt);671 }672 mi = mittel / (float)VECTOR_MAX;673 printf(" Rot a vec by a quat: q->apply(v)\t%11.2f\n", mi);674 675 676 677 // generate rotation matrix678 mittel = 0;679 float matrix[4][4];680 for(i = 0; i < VECTOR_MAX; ++i)681 {682 rdtscl(ini);683 684 a->matrix(matrix);685 686 rdtscl(end);687 mittel += (end - ini - dt);688 }689 mi = mittel / (float)VECTOR_MAX;690 printf(" Generate rot matrix: q->matrix(m)\t%11.2f\n", mi);691 }692 if( type == 3 || type == -1)693 {694 /* list tests*/695 printf("\nList operations tests: \t\t\t\t\t%i\n", LIST_MAX);696 tList<char>* list = new tList<char>();697 char* name;698 699 printf(" Adding[1..10] elements to list, found:\n");700 list->add("1");701 list->add("2");702 list->add("3");703 list->add("4");704 list->add("5");705 list->add("6");706 list->add("7");707 list->add("8");708 list->add("9");709 list->add("10");710 711 /*give list out */712 tIterator<char>* iterator = list->getIterator();713 name = iterator->nextElement();714 printf(" List Elements: \t\t");715 while( name != NULL)716 {717 printf("%s,", name);718 name = iterator->nextElement();719 }720 delete iterator;721 printf("\n");722 723 724 /*removing some elements from the list*/725 printf(" Removing elements [2,3,6,8,10], adding [11] now found:\n");726 list->remove("2");727 list->remove("3");728 list->remove("6");729 list->remove("8");730 list->remove("10");731 list->add("11");732 /*give list out */733 iterator = list->getIterator();734 name = iterator->nextElement();735 printf(" List Elements: \t\t");736 while( name != NULL)737 {738 printf("%s,", name);739 name = iterator->nextElement();740 }741 delete iterator;742 printf("\n");743 744 delete list;745 printf("\nChecking list performance:\t\t\t\t%i\n", LIST_MAX);746 747 tList<int>* plist = new tList<int>();748 unsigned long mittel, ini, end;749 float mi;750 int i = 0;751 mittel = 0;752 for(i = 0; i < LIST_MAX; ++i)753 {754 rdtscl(ini);755 756 plist->add(&i);757 758 rdtscl(end);759 mittel += (end - ini - dt);760 }761 mi = mittel / (float)LIST_MAX;762 printf(" Adding reference to list:\t\t%11.2f\n", mi);763 764 mittel = 0;765 for(i = 0; i < LIST_MAX; ++i)766 {767 rdtscl(ini);768 769 plist->remove(&i);770 771 rdtscl(end);772 mittel += (end - ini - dt);773 }774 mi = mittel / (float)LIST_MAX;775 printf(" Removing 1st reference from list:\t%11.2f\n", mi);776 777 778 printf("\nList operations tests: \t\t\t\t\t%i\n", LIST_MAX);779 list = new tList<char>();780 printf(" Adding[1..10] elements to list, found:\n");781 list->add("1");782 list->add("2");783 list->add("3");784 list->add("4");785 list->add("5");786 list->add("6");787 list->add("7");788 list->add("8");789 list->add("9");790 list->add("10");791 792 /*give list out */793 iterator = list->getIterator();794 name = iterator->nextElement();795 printf(" List Elements: \t\t");796 while( name != NULL)797 {798 printf("%s,", name);799 name = iterator->nextElement();800 }801 delete iterator;802 printf("\n");803 804 805 int c = 0;806 printf(" Going trough list with nextElement(el) func: ");807 name = list->firstElement();808 while(c < 20)809 {810 printf("%s,", name);811 name = list->nextElement(name);812 c++;813 }814 printf("\n");815 816 817 818 }819 820 }821 822 #else823 824 int startBenchmarks()825 {826 PRINTF(1)("Benchmark is not implemented in this system\n");827 }828 829 #endif -
orxonox/branches/md2_loader/src/orxonox.h
r3660 r4139 39 39 Uint32 lastframe; //!< Time of the last Frame 40 40 41 unsigned int argc; //!< Count of Arguments of orxonox 42 char** argv; //!< Values of th Arguments of orxonox. 43 41 44 void getConfigFile (int argc, char** argv); 42 45 43 // main loop functions 44 // void synchronize (); 45 //void handle_input (); 46 //void time_slice (); 47 //void collision (); 48 //void display (); 49 50 // subsystem initialization 46 // subsystem initialization 51 47 int initVideo (); 52 48 int initSound (); … … 75 71 }; 76 72 77 int startHelp( void);73 int startHelp(int argc, char** argv); 78 74 int startOrxonox(int argc, char** argv); 79 int startBenchmarks(void);80 75 81 76 #endif /* _ORXONOX_H */ -
orxonox/branches/md2_loader/src/story_entities/campaign.cc
r4010 r4139 41 41 int id; 42 42 43 PRINTF 0("Loading Campaign...\n");43 PRINTF(3)("Loading Campaign...\n"); 44 44 45 45 assert( root != NULL); … … 53 53 if( string == NULL || sscanf(string, "%d", &id) != 1) 54 54 { 55 PRINTF 0("Campaign is missing a proper 'identifier'\n");55 PRINTF(2)("Campaign is missing a proper 'identifier'\n"); 56 56 this->setStoryID( -1); 57 57 } … … 62 62 if( element == NULL) 63 63 { 64 PRINTF 0("Campaign is missing a proper 'WorldList'\n");64 PRINTF(2)("Campaign is missing a proper 'WorldList'\n"); 65 65 } 66 66 else -
orxonox/branches/md2_loader/src/story_entities/world.cc
r4138 r4139 124 124 { 125 125 this->constuctorInit("", -1); 126 126 this->path = NULL; 127 127 const char *string; 128 128 char *name; … … 172 172 World::World (char* name) 173 173 { 174 this->path = NULL; 174 175 this->constuctorInit(name, -1); 175 176 //NullParent* np = NullParent::getInstance(); … … 182 183 World::World (int worldID) 183 184 { 185 this->path = NULL; 184 186 this->constuctorInit(NULL, worldID); 185 187 } … … 198 200 cn->reset(); 199 201 200 //ResourceManager::getInstance()->debug();201 202 ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL); 202 //ResourceManager::getInstance()->debug();203 204 203 delete WorldInterface::getInstance(); 205 206 204 delete this->nullParent; 207 205 delete this->entities; … … 209 207 delete this->trackManager; 210 208 TextEngine::getInstance()->flush(); 211 212 //AnimationPlayer::getInstance()->debug();213 209 delete AnimationPlayer::getInstance(); // this should be at the end of the unloading sequence. 214 //delete garbagecollecor 215 //delete animator 216 217 210 ResourceManager::getInstance()->unloadAllByPriority(RP_LEVEL); 218 211 } 219 212 … … 271 264 ErrorMessage World::load() 272 265 { 273 PRINTF 0("> Loading world: '%s'\n", getPath());274 266 PRINTF(3)("> Loading world: '%s'\n", getPath()); 267 TiXmlElement* element; 275 268 GameLoader* loader = GameLoader::getInstance(); 276 269 277 270 if( getPath() == NULL) 278 271 { 279 PRINTF 0("World has no path specified for loading");272 PRINTF(1)("World has no path specified for loading"); 280 273 return (ErrorMessage){213,"Path not specified","World::load()"}; 281 274 } … … 283 276 TiXmlDocument* XMLDoc = new TiXmlDocument( path); 284 277 // load the campaign document 285 if( !XMLDoc->LoadFile()) 286 //this->glmis->step(); 287 278 if( !XMLDoc->LoadFile()) 288 279 { 289 280 // report an error 290 PRINTF 0("Errorloading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol());281 PRINTF(1)("loading XML File: %s @ %d:%d\n", XMLDoc->ErrorDesc(), XMLDoc->ErrorRow(), XMLDoc->ErrorCol()); 291 282 delete XMLDoc; 292 283 return (ErrorMessage){213,"XML File parsing error","World::load()"}; … … 300 291 { 301 292 // report an error 302 PRINTF 0("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n");293 PRINTF(1)("Specified XML File is not an orxonox world data file (WorldDataFile element missing)\n"); 303 294 delete XMLDoc; 304 295 return (ErrorMessage){213,"Path not a WorldDataFile","World::load()"}; … … 311 302 if( string == NULL) 312 303 { 313 PRINTF 0("World is missing a proper 'name'\n");304 PRINTF(2)("World is missing a proper 'name'\n"); 314 305 string = "Unknown"; 315 306 temp = new char[strlen(string + 2)]; … … 323 314 this->worldName = temp; 324 315 } 325 326 316 //////////////// 317 // LOADSCREEN // 318 //////////////// 319 element = root->FirstChildElement("LoadScreen"); 320 if (element == NULL) 321 { 322 PRINTF(2)("no LoadScreen specified, loading default\n"); 323 324 glmis->setBackgroundImage("pictures/load_screen.jpg"); 325 this->glmis->setMaximum(8); 326 this->glmis->draw(); 327 } 328 else 329 { 330 this->glmis->load(element); 331 this->glmis->draw(); 332 } 333 this->glmis->draw(); 327 334 // find WorldEntities 328 TiXmlElement* element = root->FirstChildElement("WorldEntities");335 element = root->FirstChildElement("WorldEntities"); 329 336 330 337 if( element == NULL) 331 338 { 332 PRINTF 0("World is missing 'WorldEntities'\n");339 PRINTF(1)("World is missing 'WorldEntities'\n"); 333 340 } 334 341 else … … 336 343 element = element->FirstChildElement(); 337 344 // load Players/Objects/Whatever 338 PRINTF 0("Loading WorldEntities\n");345 PRINTF(4)("Loading WorldEntities\n"); 339 346 while( element != NULL) 340 347 { … … 346 353 if( element->Value() != NULL && !strcmp( element->Value(), "SkyBox")) sky = (SkyBox*) created; 347 354 element = element->NextSiblingElement(); 355 glmis->step(); //! \todo temporary 348 356 } 349 PRINTF 0("Done loading WorldEntities\n");357 PRINTF(4)("Done loading WorldEntities\n"); 350 358 } 351 359 … … 458 466 tn->addChild(this->localCamera); 459 467 localCamera->lookAt(tn); 468 localCamera->setMode(PNODE_MOVEMENT); 460 469 this->localPlayer->setMode(PNODE_ALL); 461 470 Vector* cameraOffset = new Vector (0, 5, -10); … … 472 481 glEndList(); 473 482 474 terrain = new Terrain(" ../data/worlds/newGround.obj");483 terrain = new Terrain("worlds/newGround.obj"); 475 484 terrain->setRelCoor(Vector(0,-10,0)); 476 485 this->spawn(terrain); … … 604 613 605 614 // Create SkySphere 606 sky = new Skysphere(" ../data/pictures/sky-replace.jpg");615 sky = new Skysphere("pictures/sky-replace.jpg"); 607 616 this->localPlayer->addChild(this->sky); 608 617 this->spawn(this->sky); … … 649 658 650 659 // Create SkySphere 651 this->sky = new Skysphere(" ../data/pictures/sky-replace.jpg");660 this->sky = new Skysphere("pictures/sky-replace.jpg"); 652 661 this->sky->setName("SkySphere"); 653 662 this->spawn(this->sky); … … 838 847 839 848 //GLMenuImageScreen* 840 this->glmis = GLMenuImageScreen::getInstance();849 this->glmis = new GLMenuImageScreen(); 841 850 this->glmis->init(); 842 851 this->glmis->setMaximum(8); 843 this->glmis->draw();852 // this->glmis->draw(); 844 853 845 854 PRINTF(3)("World::displayLoadScreen - end\n"); … … 855 864 PRINTF(3)("World::releaseLoadScreen - start\n"); 856 865 this->glmis->setValue(this->glmis->getMaximum()); 857 //SDL_Delay(500);858 866 PRINTF(3)("World::releaseLoadScreen - end\n"); 867 delete this->glmis; 859 868 } 860 869 … … 1242 1251 bool World::command(Command* cmd) 1243 1252 { 1244 if( !strcmp( cmd->cmd, "view0")) this->localCamera->setViewMode(VIEW_NORMAL);1245 else if( !strcmp( cmd->cmd, "view1")) this->localCamera->setViewMode(VIEW_BEHIND);1246 else if( !strcmp( cmd->cmd, "view2")) this->localCamera->setViewMode(VIEW_FRONT);1247 else if( !strcmp( cmd->cmd, "view3")) this->localCamera->setViewMode(VIEW_LEFT);1248 else if( !strcmp( cmd->cmd, "view4")) this->localCamera->setViewMode(VIEW_RIGHT);1249 else if( !strcmp( cmd->cmd, "view5")) this->localCamera->setViewMode(VIEW_TOP);1253 if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW0)) this->localCamera->setViewMode(VIEW_NORMAL); 1254 else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW1)) this->localCamera->setViewMode(VIEW_BEHIND); 1255 else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW2)) this->localCamera->setViewMode(VIEW_FRONT); 1256 else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW3)) this->localCamera->setViewMode(VIEW_LEFT); 1257 else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW4)) this->localCamera->setViewMode(VIEW_RIGHT); 1258 else if( !strcmp( cmd->cmd, CONFIG_NAME_VIEW5)) this->localCamera->setViewMode(VIEW_TOP); 1250 1259 1251 1260 return false; … … 1254 1263 void World::setPath( const char* name) 1255 1264 { 1256 this->path = new char[strlen(name)+1]; 1257 strcpy(this->path, name); 1265 if (this->path) 1266 delete this->path; 1267 if (ResourceManager::isFile(name)) 1268 { 1269 this->path = new char[strlen(name)+1]; 1270 strcpy(this->path, name); 1271 } 1272 else 1273 { 1274 this->path = new char[strlen(ResourceManager::getInstance()->getDataDir()) + strlen(name) +1]; 1275 sprintf(this->path, "%s%s", ResourceManager::getInstance()->getDataDir(), name); 1276 } 1258 1277 } 1259 1278 -
orxonox/branches/md2_loader/src/subprojects/Makefile.in
r4063 r4139 113 113 PACKAGE_VERSION = @PACKAGE_VERSION@ 114 114 PATH_SEPARATOR = @PATH_SEPARATOR@ 115 PKG_CONFIG = @PKG_CONFIG@ 115 116 RANLIB = @RANLIB@ 116 117 SET_MAKE = @SET_MAKE@ -
orxonox/branches/md2_loader/src/subprojects/testmain/Makefile.in
r4063 r4139 128 128 PACKAGE_VERSION = @PACKAGE_VERSION@ 129 129 PATH_SEPARATOR = @PATH_SEPARATOR@ 130 PKG_CONFIG = @PKG_CONFIG@ 130 131 RANLIB = @RANLIB@ 131 132 SET_MAKE = @SET_MAKE@ -
orxonox/branches/md2_loader/src/util/object_manager.h
r4127 r4139 16 16 #include "base_object.h" 17 17 18 #define OM_ 19 20 class WorldEntity; 21 22 23 template<class T> class tList; 18 24 19 25 //! the object manager itself … … 24 30 virtual ~ObjectManager(void); 25 31 32 void preLoad(); 33 26 34 private: 27 35 ObjectManager(void); 28 36 static ObjectManager* singletonRef; 37 38 tList<WorldEntity>* projectileBuffer; //!< a list of projectiles that is generated at the beginning to make orx faster 39 40 29 41 }; 30 42 -
orxonox/branches/md2_loader/src/util/resource_manager.cc
r4065 r4139 100 100 return false; 101 101 } 102 } 103 104 /** 105 \brief checks for the DataDirectory, by looking if 106 \param fileInside is inisde?? 107 */ 108 bool ResourceManager::checkDataDir(const char* fileInside) 109 { 110 bool retVal; 111 if (!isDir(this->dataDir)) 112 { 113 PRINTF(1)("%s is not a directory\n", this->dataDir); 114 return false; 115 } 116 117 char* testFile = new char[strlen(this->dataDir)+strlen(fileInside)+1]; 118 sprintf(testFile, "%s%s", this->dataDir, fileInside); 119 retVal = isFile(testFile); 120 delete testFile; 121 return retVal; 102 122 } 103 123 … … 183 203 // searching if the resource was loaded before. 184 204 Resource* tmpResource = this->locateResourceByInfo(fileName, type, param1, param2,param3); 185 if (tmpResource) // if the resource was notloaded before.205 if (tmpResource) // if the resource was loaded before. 186 206 { 187 207 PRINTF(4)("not loading cached resource %s\n", tmpResource->name); … … 202 222 203 223 // creating the full name. (directoryName + FileName) 204 char* fullName = new char[strlen(dataDir)+strlen(fileName)+1]; 205 sprintf(fullName, "%s%s", this->dataDir, fileName); 206 224 char* fullName = new char[strlen(this->getDataDir())+strlen(fileName)+1]; 225 sprintf(fullName, "%s%s", this->getDataDir(), fileName); 207 226 // Checking for the type of resource \see ResourceType 208 227 switch(type) … … 214 233 tmpResource->modelSize = 1.0; 215 234 216 if( isFile(fullName))235 if(ResourceManager::isFile(fullName)) 217 236 tmpResource->pointer = new OBJModel(fullName, tmpResource->modelSize); 218 237 else -
orxonox/branches/md2_loader/src/util/resource_manager.h
r4063 r4139 65 65 66 66 bool setDataDir(const char* dataDir); 67 /** \returns the Name of the data directory */ 68 inline const char* getDataDir(void) {return this->dataDir;} 69 bool checkDataDir(const char* fileInside); 67 70 bool addImageDir(char* imageDir); 68 71 void* load(const char* fileName, ResourcePriority prio = RP_NO, -
orxonox/branches/md2_loader/src/world_entities/environment.cc
r3986 r4139 30 30 { 31 31 this->model = (Model*) ResourceManager::getInstance()->load("cube", RP_LEVEL); 32 // this->model = new OBJModel("../data/models/fighter.obj");33 32 } 34 33 -
orxonox/branches/md2_loader/src/world_entities/player.cc
r4010 r4139 82 82 Player::Player(TiXmlElement* root) : WorldEntity(root) 83 83 { 84 /*85 char* temp;86 const char* string;87 string = grabParameter( root, "name");88 if( string == NULL)89 {90 PRINTF0("Player is missing a proper 'name'\n");91 string = "Unknown";92 temp = new char[strlen(string + 2)];93 strcpy( temp, string);94 this->setName( temp);95 }96 else97 {98 temp = new char[strlen(string + 2)];99 strcpy( temp, string);100 this->setName( temp);101 }102 103 this->model = NULL;104 string = grabParameter( root, "model");105 if( string != NULL)106 this->model = (Model*)ResourceManager::getInstance()->load(string, OBJ, RP_CAMPAIGN);107 else108 {109 PRINTF0("Player is missing a proper 'model'\n");110 this->model = (Model*)ResourceManager::getInstance()->load("models/reaplow.obj", OBJ, RP_CAMPAIGN);111 }112 if( this->model == NULL)113 {114 PRINTF0("Player model '%s' could not be loaded\n", string);115 }116 */117 84 this->weapons = new tList<Weapon>(); 118 85 this->activeWeapon = NULL; … … 294 261 { 295 262 PRINTF(3)("recieved command [%s]\n", cmd->cmd); 296 if( !strcmp( cmd->cmd, "up")) this->bUp = !cmd->bUp;297 if( !strcmp( cmd->cmd, "down")) this->bDown = !cmd->bUp;298 if( !strcmp( cmd->cmd, "left")) this->bLeft = !cmd->bUp;299 if( !strcmp( cmd->cmd, "right")) this->bRight = !cmd->bUp;300 if( !strcmp( cmd->cmd, "fire")) this->bFire = !cmd->bUp;301 if( !strcmp( cmd->cmd, "mode")) if(cmd->bUp) this->bWeaponChange = !this->bWeaponChange;302 } 263 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_UP)) this->bUp = !cmd->bUp; 264 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_DOWN)) this->bDown = !cmd->bUp; 265 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_LEFT)) this->bLeft = !cmd->bUp; 266 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_RIGHT)) this->bRight = !cmd->bUp; 267 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_FIRE)) this->bFire = !cmd->bUp; 268 if( !strcmp( cmd->cmd, CONFIG_NAME_PLAYER_NEXT_WEAPON)) if(cmd->bUp) this->bWeaponChange = !this->bWeaponChange; 269 } -
orxonox/branches/md2_loader/src/world_entities/skybox.cc
r4012 r4139 66 66 PRINTF(0)("SkyBox is missing a proper 'MaterialSet'\n"); 67 67 } 68 if( this-> model == NULL)68 if( this->skyModel == NULL) 69 69 { 70 70 PRINTF(0)("SkyBox model '%s' could not be loaded\n", string); … … 76 76 { 77 77 this->setClassName("SkyBox"); 78 this->skyModel = NULL; 78 79 this->material = new Material*[6]; 79 for (int i = 0; i < 6; i++)80 for (int i = 0; i < 6; i++) 80 81 { 81 82 this->material[i] = new Material(); … … 100 101 SkyBox::~SkyBox() 101 102 { 102 PRINTF(5)("Deleting theSkyBox\n");103 PRINTF(5)("Deleting SkyBox\n"); 103 104 for (int i = 0; i < 6; i++) 104 105 delete this->material[i]; … … 179 180 glTranslatef(r.x, r.y, r.z); 180 181 181 this-> model->draw();182 this->skyModel->draw(); 182 183 183 184 glPopMatrix(); … … 192 193 void SkyBox::rebuild() 193 194 { 194 if (this-> model)195 delete model;196 model = new Model();197 198 model->addVertex (-0.5*size, -0.5*size, 0.5*size);199 model->addVertex (0.5*size, -0.5*size, 0.5*size);200 model->addVertex (-0.5*size, 0.5*size, 0.5*size);201 model->addVertex (0.5*size, 0.5*size, 0.5*size);202 model->addVertex (-0.5*size, 0.5*size, -0.5*size);203 model->addVertex (0.5*size, 0.5*size, -0.5*size);204 model->addVertex (-0.5*size, -0.5*size, -0.5*size);205 model->addVertex (0.5*size, -0.5*size, -0.5*size);206 207 model->addVertexTexture (0.0, 0.0);208 model->addVertexTexture (1.0, 0.0);209 model->addVertexTexture (1.0, 1.0);210 model->addVertexTexture (0.0, 1.0);211 212 model->addVertexNormal (0.0, 0.0, 1.0);213 model->addVertexNormal (0.0, 1.0, 0.0);214 model->addVertexNormal (0.0, 0.0, -1.0);215 model->addVertexNormal (0.0, -1.0, 0.0);216 model->addVertexNormal (1.0, 0.0, 0.0);217 model->addVertexNormal (-1.0, 0.0, 0.0);218 219 model->setMaterial(material[0]);220 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 3,2,4, 4,3,4, 6,4,4, 5,1,4); // top221 model->setMaterial(material[1]);222 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,4,2, 8,1,2, 2,2,2, 1,3,2); // bottom223 model->setMaterial(material[2]);224 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,1,3, 2,2,3, 4,3,3, 3,4,3); // left225 model->setMaterial(material[3]);226 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 5,3,1, 6,4,1, 8,1,1, 7,2,1); // right227 model->setMaterial(material[4]);228 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,1,6, 8,2,6, 6,3,6, 4,4,6); // front229 model->setMaterial(material[5]);230 model->addFace (4, VERTEX_TEXCOORD_NORMAL, 7,1,5, 1,2,5, 3,3,5, 5,4,5); // back195 if (this->skyModel) 196 delete skyModel; 197 skyModel = new Model(); 198 199 this->skyModel->addVertex (-0.5*size, -0.5*size, 0.5*size); 200 this->skyModel->addVertex (0.5*size, -0.5*size, 0.5*size); 201 this->skyModel->addVertex (-0.5*size, 0.5*size, 0.5*size); 202 this->skyModel->addVertex (0.5*size, 0.5*size, 0.5*size); 203 this->skyModel->addVertex (-0.5*size, 0.5*size, -0.5*size); 204 this->skyModel->addVertex (0.5*size, 0.5*size, -0.5*size); 205 this->skyModel->addVertex (-0.5*size, -0.5*size, -0.5*size); 206 this->skyModel->addVertex (0.5*size, -0.5*size, -0.5*size); 207 208 this->skyModel->addVertexTexture (0.0, 0.0); 209 this->skyModel->addVertexTexture (1.0, 0.0); 210 this->skyModel->addVertexTexture (1.0, 1.0); 211 this->skyModel->addVertexTexture (0.0, 1.0); 212 213 this->skyModel->addVertexNormal (0.0, 0.0, 1.0); 214 this->skyModel->addVertexNormal (0.0, 1.0, 0.0); 215 this->skyModel->addVertexNormal (0.0, 0.0, -1.0); 216 this->skyModel->addVertexNormal (0.0, -1.0, 0.0); 217 this->skyModel->addVertexNormal (1.0, 0.0, 0.0); 218 this->skyModel->addVertexNormal (-1.0, 0.0, 0.0); 219 220 this->skyModel->setMaterial(material[0]); 221 this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 2,1,3, 3,2,3, 5,3,3, 4,0,3); // top 222 this->skyModel->setMaterial(material[1]); 223 this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,3,1, 7,0,1, 1,1,1, 0,2,1); // bottom 224 this->skyModel->setMaterial(material[2]); 225 this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 0,0,2, 1,1,2, 3,2,2, 2,3,2); // left 226 this->skyModel->setMaterial(material[3]); 227 this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 4,2,0, 5,3,0, 7,0,0, 6,1,0); // right 228 this->skyModel->setMaterial(material[4]); 229 this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 1,0,5, 7,1,5, 5,2,5, 3,3,6); // front 230 this->skyModel->setMaterial(material[5]); 231 this->skyModel->addFace (4, VERTEX_TEXCOORD_NORMAL, 6,0,4, 0,1,4, 2,2,4, 4,3,4); // back 231 232 232 model->finalize();233 } 233 this->skyModel->finalize(); 234 } -
orxonox/branches/md2_loader/src/world_entities/skybox.h
r4012 r4139 39 39 void rebuild(); 40 40 41 Model* skyModel; //!< A Model for the Sky. This must not be the same as the Model from WorldEntity, because it is not alocated through the ResourceManager. 41 42 Material **material; //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back 42 43 float size; //!< Size of the SkyBox. This should match the frustum maximum range. -
orxonox/branches/md2_loader/src/world_entities/skysphere.cc
r3763 r4139 44 44 { 45 45 if (fileName == NULL) 46 this->initialize(" ../data/pictures/sky-replace.jpg");46 this->initialize("pictures/sky-replace.jpg"); 47 47 else 48 48 this->initialize(fileName); -
orxonox/branches/md2_loader/src/world_entities/terrain.cc
r3677 r4139 77 77 void Terrain::init(void) 78 78 { 79 80 81 79 this->setClassName ("Terrain"); 80 81 this->objectList = 0; 82 82 } 83 83 … … 98 98 glMultMatrixf((float*)matrix); 99 99 100 if (objectList) 101 glCallList(objectList); 102 else if (model) 103 model->draw(); 104 // this->model->draw(); 100 if (this->objectList) 101 glCallList(this->objectList); 102 else if (this->model) 103 this->model->draw(); 105 104 glPopMatrix(); 106 105 } -
orxonox/branches/md2_loader/src/world_entities/world_entity.cc
r4013 r4139 30 30 /** 31 31 \brief standard constructor 32 33 Every derived contructor HAS to call the previous one supplying the isFree parameter. This is necessary to distunguish34 between free and bound entities. The difference between them is simply the fact that the movement of a free entity is35 not bound to the track of a world. Use this to implement projectile or effect classes that do not have to travel along the track.36 To specify an entity to be free or bound set the default parameter in the declaration of the constructor.37 Theoretically you should never have to call the constructor of an Entity directly, for it is called by the spawn() function of the World38 class. So if you want to create a new entity at any time, call World::spawn(). It will handle everything that is necessary.39 32 */ 40 33 WorldEntity::WorldEntity () … … 46 39 } 47 40 41 /** 42 \brief Loads the WordEntity-specific Part of any derived Class 43 */ 48 44 WorldEntity::WorldEntity(TiXmlElement* root) 49 45 { … … 54 50 if( string == NULL) 55 51 { 56 PRINTF( 0)("WorldEntity is missing a proper 'name'\n");52 PRINTF(2)("WorldEntity is missing a proper 'name'\n"); 57 53 string = "Unknown"; 58 54 temp = new char[strlen(string + 2)]; … … 73 69 else 74 70 { 75 PRINTF( 0)("WorldEntity is missing a proper 'model'\n");71 PRINTF(2)("WorldEntity is missing a proper 'model'\n"); 76 72 this->model = NULL; 77 73 } 78 74 if( this->model == NULL) 79 75 { 80 PRINTF(0)("WorldEntity model '%s' could not be loaded\n", string); 81 } 82 76 PRINTF(2)("WorldEntity model '%s' could not be loaded\n", string); 77 } 83 78 this->bDraw = true; 84 79 }
Note: See TracChangeset
for help on using the changeset viewer.