Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/gui/src/story_entities/simple_game_menu.cc @ 8595

Last change on this file since 8595 was 8583, checked in by bensch, 19 years ago

gui: using style.

File size: 20.1 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11### File Specific:
12   main-programmer: Patrick Boenzli
13
14*/
15
16#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD
17
18
19#include "simple_game_menu.h"
20
21#include "event_handler.h"
22
23#include "state.h"
24#include "class_list.h"
25
26#include "util/loading/load_param.h"
27#include "fast_factory.h"
28#include "util/loading/factory.h"
29#include "loading/resource_manager.h"
30
31#include "world_entity.h"
32#include "elements/image_entity.h"
33#include "terrain.h"
34#include "camera.h"
35
36#include "graphics_engine.h"
37#include "object_manager.h"
38#include "sound_engine.h"
39#include "sound_source.h"
40
41#include "cd_engine.h"
42
43#include "glgui.h"
44#include "gui/gl/specials/glgui_notifier.h"
45
46//! This creates a Factory to fabricate a SimpleGameMenu
47CREATE_FACTORY(SimpleGameMenu, CL_SIMPLE_GAME_MENU);
48
49
50
51SimpleGameMenu::SimpleGameMenu(const TiXmlElement* root)
52    : GameWorld()
53{
54  this->setClassID(CL_SIMPLE_GAME_MENU, "SimpleGameMenu");
55  this->setName("SimpleGameMenu uninitialized");
56
57  this->dataTank = new SimpleGameMenuData();
58
59  this->cameraVector = Vector(50.0, 0.0, 0.0);
60  this->menuLayers.push_back(MenuLayer());
61  this->menuLayers.push_back(MenuLayer());
62
63  this->layerIndex = 0;
64  this->menuSelectedIndex = 0;
65  this->selectorSource = NULL;
66
67
68  /// GUI
69  ///(this is as modular as it is possible).
70  OrxGui::GLGuiPushButton* pb = new OrxGui::GLGuiPushButton("PUSH ME");
71  //pb->connectSignal(OrxGui::Signal_release, this, createExecutor<SimpleGameMenu>(&SimpleGameMenu::enterGui));
72  pb->connect(SIGNAL(pb, released), this, SLOT(SimpleGameMenu, enterGui));
73  pb->show();
74  pb->setAbsCoor2D(50, 50);
75
76  OrxGui::GLGuiHandler::getInstance()->activateCursor();
77  OrxGui::GLGuiHandler::getInstance()->activate();
78  OrxGui::GLGuiHandler::getInstance()->cursor()->loadTextureSequence(ResourceManager::getInstance()->getDataDir() + "/" + "maps/reap_mouse/reap_mouse_##.png", 1, 49);
79  /////
80
81  if (root != NULL)
82    this->loadParams(root);
83
84  State::setMenuID(this->getNextStoryID());
85}
86
87/// HACK only for testing.
88void SimpleGameMenu::enterGui()
89{
90
91  OrxGui::GLGuiNotifier* notifier = new OrxGui::GLGuiNotifier();
92  notifier->show();
93  notifier->setAbsCoor2D(300, 300);
94
95
96
97  OrxGui::GLGuiBox* box = new OrxGui::GLGuiBox();
98  {
99    ///
100    OrxGui::GLGuiButton* dnpb = new OrxGui::GLGuiCheckButton("Push the button");
101
102    box->pack(dnpb);
103
104    OrxGui::GLGuiPushButton* rdnpb = new OrxGui::GLGuiPushButton("Quit ORXONOX!!");
105    rdnpb->connect(SIGNAL(rdnpb, released), this, SLOT(SimpleGameMenu, quitMenu));
106
107    box->pack(rdnpb);
108
109    OrxGui::GLGuiCheckButton* fullscreen = new OrxGui::GLGuiCheckButton("Fullscreen");
110    fullscreen->connect(SIGNAL(fullscreen, toggled), GraphicsEngine::getInstance(), SLOT(GraphicsEngine, setFullscreen));
111
112    box->pack(fullscreen);
113
114    OrxGui::GLGuiInputLine* input = new OrxGui::GLGuiInputLine();
115    input->setText("input some text here");
116    input->connect(SIGNAL(input, textChanged), notifier, SLOT(OrxGui::GLGuiNotifier, pushNotifyMessage));
117
118    box->pack(input);
119
120    OrxGui::GLGuiSlider* slider = new OrxGui::GLGuiSlider();
121    slider->connect(SIGNAL(slider, valueChanged), this, SLOT(SimpleGameMenu, TEST));
122    slider->setRange(0, 1);
123    slider->setValue(slider->min());
124    box->pack(slider);
125  }
126  box->setAbsCoor2D(50, 200);
127
128  box->showAll();
129
130
131  OrxGui::GLGuiBox* imageSelector = new OrxGui::GLGuiBox();
132  {
133    image = new OrxGui::GLGuiImage();
134    image->setWidgetSize(300, 300);
135    image->setAbsCoor2D(300, 300);
136    imageSelector->pack(image);
137
138    imageName = new OrxGui::GLGuiInputLine();
139    imageSelector->pack(imageName);
140
141    OrxGui::GLGuiSlider* slider = new OrxGui::GLGuiSlider();
142    slider->setWidgetSize(200, 30);
143    slider->setRange(0, 100);
144    slider->setStep(1);
145    slider->setValue(slider->min());
146    slider->connect(SIGNAL(slider, valueChanged), this, SLOT(SimpleGameMenu, setImage));
147
148    imageSelector->pack(slider);
149    slider->setValue(0);
150  }
151  imageSelector->showAll();
152  imageSelector->setAbsCoor2D(400, 30);
153
154
155  /////
156}
157
158
159#include "class_list.h"
160void SimpleGameMenu::setImage(int i)
161{
162  const std::list<BaseObject*>* textures = ClassList::getList(CL_TEXTURE);
163
164  if(textures)
165  {
166    std::list<BaseObject*>::const_iterator test = textures->begin();
167    std::list<BaseObject*>::const_iterator lastOK = textures->begin();
168    while (true)
169    {
170      if (--i == 0 || test == textures->end())
171        break;
172      if (dynamic_cast<Texture*>(*test)->getTexture() != 0)
173        lastOK = test;
174      test++;
175    }
176    this->image->loadImageFromTexture(*dynamic_cast<Texture*>(*lastOK));
177    this->imageName->setText((*lastOK)->getName());
178  }
179}
180
181
182#include "threading.h"
183void SimpleGameMenu::execURL() const
184{
185  std::string URL = "http://www.orxonox.net";
186  SDL_CreateThread(startURL, (void*)&URL);
187}
188
189#ifdef __OSX__
190#include <ApplicationServices/ApplicationServices.h>
191#elif defined __WIN32__
192#include <shellapi.h>
193#endif
194
195int SimpleGameMenu::startURL(void* url)
196{
197  std::string URL = *(std::string*)url;
198#ifdef __linux__
199  system ((std::string("firefox ") + URL).c_str());
200#elif defined __OSX__
201  CFURLRef url_handle = CFURLCreateWithBytes (NULL, (UInt8 *)URL.c_str(), URL.size(),
202                        kCFStringEncodingASCII, NULL);
203  LSOpenCFURLRef (url_handle, NULL);
204  CFRelease (url_handle);
205#elif defined __WIN32__
206  ShellExecute(GetActiveWindow(),
207               "open", URL.c_str(), NULL, NULL, SW_SHOWNORMAL);
208}
209#endif
210  PRINTF(3)("loaded external webpage %s\n", URL.c_str());
211}
212
213/**
214*  @brief remove the SimpleGameMenu from memory
215*
216*  delete everything explicitly, that isn't contained in the parenting tree!
217*  things contained in the tree are deleted automaticaly
218*/
219SimpleGameMenu::~SimpleGameMenu ()
220{
221  PRINTF(3)("SimpleGameMenu::~SimpleGameMenu() - deleting current world\n");
222
223  if( this->dataTank)
224    delete this->dataTank;
225  delete OrxGui::GLGuiHandler::getInstance( );
226}
227
228
229/**
230* @brief loads the parameters of a SimpleGameMenu from an XML-element
231* @param root the XML-element to load from
232*/
233void SimpleGameMenu::loadParams(const TiXmlElement* root)
234{
235  /* skip the GameWorld, since it does not define any useful loadParams for this class */
236  //static_cast<GameWorld*>(this)->loadParams(root);
237  GameWorld::loadParams(root);
238
239  PRINTF(4)("Loaded SimpleGameMenu specific stuff\n");
240}
241
242
243/**
244* @brief this is executed just before load
245*
246* since the load function sometimes needs data, that has been initialized
247* before the load and after the proceeding storyentity has finished
248*/
249ErrorMessage SimpleGameMenu::init()
250{
251  /* call underlying init funciton */
252  GameWorld::init();
253
254  this->subscribeEvent(ES_MENU, SDLK_UP);
255  this->subscribeEvent(ES_MENU, SDLK_DOWN);
256  this->subscribeEvent(ES_MENU, SDLK_RETURN);
257  this->subscribeEvent(ES_MENU, SDLK_SPACE);
258  this->subscribeEvent(ES_MENU, SDLK_ESCAPE);
259
260  this->dataTank->localCamera->setRelCoor(this->cameraVector);
261
262  GraphicsEngine::getInstance()->displayFPS(false);
263
264  this->layerIndex = 0;
265  this->menuSelectedIndex = 0;
266}
267
268
269/**
270* @brief load the data
271*/
272ErrorMessage SimpleGameMenu::loadData()
273{
274  GameWorld::loadData();
275
276  if (this->dataXML != NULL)
277  {
278    LoadParam(dataXML, "selector-sound", this, SimpleGameMenu, setSelectorSound);
279
280    TiXmlElement* element = this->dataXML->FirstChildElement("Elements");
281
282
283    if( element == NULL)
284    {
285      PRINTF(1)("SimpleGameMenu is missing 'Elements'\n");
286    }
287    else
288    {
289      element = element->FirstChildElement();
290      // load Players/Objects/Whatever
291      PRINTF(4)("Loading Elements\n");
292      while( element != NULL)
293      {
294        BaseObject* created = Factory::fabricate(element);
295        if( created != NULL )
296        {
297          PRINTF(4)("Created a %s::%s\n", created->getClassName(), created->getName());
298          if (!created->isA(CL_ELEMENT_2D))
299            PRINTF(2)("Error the Created Entity is not an Element2D but an %s::%s\n", created->getClassName(), created->getName());
300        }
301        element = element->NextSiblingElement();
302      }
303      PRINTF(4)("Done loading Elements\n");
304    }
305  }
306
307  /* get the menu list */
308  const std::list<BaseObject*>* imageEntityList = ClassList::getList(CL_IMAGE_ENTITY);
309  std::list<BaseObject*>::const_iterator entity;
310  for (entity = imageEntityList->begin(); entity != imageEntityList->end(); entity++)
311  {
312
313    if( !strcmp("Selector_Menu", (*entity)->getName()))
314    {
315      this->menuSelector = dynamic_cast<ImageEntity*>(*entity);
316      this->menuSelector->setBindNode((const PNode*)NULL);
317    }
318  }
319
320  imageEntityList = ClassList::getList(CL_TEXT_ELEMENT);
321  for (entity = imageEntityList->begin(); entity != imageEntityList->end(); entity++)
322  {
323    if( !strcmp( "StartGame_Menu", (*entity)->getName()))
324    {
325      this->menuStartGame = dynamic_cast<TextElement*>(*entity);
326      this->menuStartGame->setBindNode((const PNode*)NULL);
327      this->menuStartGame->setRelCoor2D(State::getResX() / 2.0f,
328                                        State::getResY() / 2.0f - 60.0f);
329      this->menuLayers[0].menuList.push_back(dynamic_cast<TextElement*>(*entity));
330
331    }
332    else if( !strcmp( "Multiplayer_Menu", (*entity)->getName()))
333    {
334      this->menuStartMultiplayerGame = dynamic_cast<TextElement*>(*entity);
335      this->menuStartMultiplayerGame->setBindNode((const PNode*)NULL);
336      this->menuStartMultiplayerGame->setRelCoor2D(State::getResX() / 2.0f,
337          State::getResY() / 2.0f + ((this->menuLayers[0].menuList.size() -1 ) * 60.0f));
338      this->menuLayers[0].menuList.push_back(dynamic_cast<TextElement*>(*entity));
339    }
340    else if( !strcmp( "Quit_Menu", (*entity)->getName()))
341    {
342      this->menuQuitGame = dynamic_cast<TextElement*>(*entity);
343      this->menuQuitGame->setBindNode((const PNode*)NULL);
344      this->menuQuitGame->setRelCoor2D(State::getResX() / 2.0f,
345                                       State::getResY() / 2.0f + ((this->menuLayers[0].menuList.size() -1 )* 60.0f));
346      this->menuLayers[0].menuList.push_back(dynamic_cast<TextElement*>(*entity));
347    }
348  }
349  this->menuSelected->getNullElement()->update2D(0.1f);
350  this->menuSelectedIndex = 0;
351  this->menuSelected = this->menuLayers[0].menuList[this->menuSelectedIndex];
352  this->sliderTo(this->menuSelected, 0.0f);
353
354
355  // loading the storyentities submenu (singleplayer)
356  const std::list<BaseObject*>* storyEntities = ClassList::getList(CL_STORY_ENTITY);
357  std::list<BaseObject*>::const_iterator it;
358  for( it = storyEntities->begin(); it != storyEntities->end(); it++)
359  {
360    StoryEntity* se = dynamic_cast<StoryEntity*>(*it);
361    if( se->isContainedInMenu())
362    {
363      this->menuLayers[1].storyList.push_back(se);
364
365      // generating menu item
366      TextElement* te = new TextElement();
367      te->setVisibility(false);
368      te->setText(se->getName());
369      te->setRelCoor2D(State::getResX() / 2.0f - 200.0f, State::getResY() / 2.0f + ((this->menuLayers[1].menuList.size() - 2.0f) * 60.0f));
370      this->menuLayers[1].menuList.push_back(te);
371
372      // generating screenshoot item
373      ImageEntity* ie = new ImageEntity();
374      ie->setVisibility(false);
375      ie->setBindNode((const PNode*)NULL);
376      ie->setTexture(se->getMenuScreenshoot());
377      ie->setRelCoor2D(State::getResX() / 2.0f + 250.0f, State::getResY() / 2.0f);
378      ie->setSize2D(140.0f, 105.0f);
379      this->menuLayers[1].screenshootList.push_back(ie);
380    }
381  }
382}
383
384/**
385* @brief set the Sound to play when switching menu entry.
386* @param selectorSound the sound to load.
387*/
388void SimpleGameMenu::setSelectorSound(const std::string& selectorSound)
389{
390  this->selectorSource = OrxSound::SoundEngine::getInstance()->createSource(selectorSound, NULL);
391}
392
393ErrorMessage SimpleGameMenu::unloadData()
394{
395  this->unsubscribeEvents(ES_MENU);
396
397  std::vector<MenuLayer>::iterator mit;
398  for(mit = this->menuLayers.begin(); mit != this->menuLayers.end(); mit++)
399  {
400    while(!(*mit).menuList.empty())
401    {
402      delete (*mit).menuList.back();
403      (*mit).menuList.pop_back();
404    }
405
406    (*mit).menuList.clear();
407    (*mit).storyList.clear();
408    (*mit).screenshootList.clear();
409  }
410
411  // delete the SoundSource.
412  if (this->selectorSource != NULL)
413    delete this->selectorSource;
414  this->selectorSource = NULL;
415
416  GameWorld::unloadData();
417}
418
419
420/**
421* @brief start the menu
422*/
423bool SimpleGameMenu::start()
424{
425  EventHandler::getInstance()->pushState(ES_MENU);
426
427  /* now call the underlying*/
428  GameWorld::start();
429}
430
431
432
433/**
434* stop the menu
435*/
436bool SimpleGameMenu::stop()
437{
438  EventHandler::getInstance()->popState();
439
440  /* now call the underlying*/
441  GameWorld::stop();
442}
443
444
445/**
446*  override the standard tick for more functionality
447*/
448void SimpleGameMenu::tick()
449{
450  GameWorld::tick();
451
452  // Make the GLGui tick.
453  OrxGui::GLGuiHandler::getInstance()->tick(this->dtS);
454
455  this->animateScene(this->dtS);
456}
457
458
459/**
460* @brief no collision detection in the menu
461*/
462void SimpleGameMenu::collide()
463{
464  //   this->dataTank->localCamera->
465}
466
467
468/**
469* @brief animate the scene
470*/
471void SimpleGameMenu::animateScene(float dt)
472{
473  Quaternion q(/*0.00005*/ dt * .1, Vector(0.0, 1.0, 0.0));
474  this->cameraVector = q.apply(this->cameraVector);
475  this->dataTank->localCamera->setRelCoor(this->cameraVector);
476  this->dataTank->localCamera->getTarget()->setRelCoorSoft(0,0,0);
477}
478
479void SimpleGameMenu::quitMenu()
480{
481  this->setNextStoryID(WORLD_ID_GAMEEND);
482  this->stop();
483}
484
485
486/**
487* @brief event dispatcher funciton
488* @param event the incoming event
489*/
490void SimpleGameMenu::process(const Event &event)
491{
492  /* ----------------- LAYER 1 ---------------*/
493  if( this->layerIndex == 0)
494  {
495    if( event.type == SDLK_RETURN && event.bPressed == true)
496    {
497      if( this->menuSelected == this->menuQuitGame)
498      {
499        this->setNextStoryID(WORLD_ID_GAMEEND);
500        this->stop();
501      }
502      if( this->menuSelected == this->menuStartGame)
503      {
504        // switch to first submenu
505        if( this->menuLayers[1].menuList.size() == 0)
506        {
507          PRINTF(1)("Haven't got any StoryEntities to play!\n");
508          return;
509        }
510
511        this->switchMenuLayer(this->layerIndex, 1);
512      }
513    }
514    if( event.type == SDLK_ESCAPE && event.bPressed == true)
515    {
516      this->setNextStoryID(WORLD_ID_GAMEEND);
517      this->stop();
518    }
519  }  /* ----------------- LAYER 2 ---------------*/
520  else if( this->layerIndex == 1)
521  {
522    if( event.type == SDLK_RETURN && event.bPressed == true)
523    {
524      this->setNextStoryID( this->menuLayers[1].storyList[this->menuSelectedIndex]->getStoryID());
525      this->stop();
526    }
527    if( event.type == SDLK_ESCAPE && event.bPressed == true)
528    {
529      this->switchMenuLayer(this->layerIndex, 0);
530    }
531  }
532
533
534
535  // The menu selction cursor
536  if( event.type == SDLK_DOWN && event.bPressed == true)
537  {
538    if(this->menuSelectedIndex < (this->menuLayers[this->layerIndex].menuList.size() - 1))
539    {
540      this->menuSelected = this->menuLayers[this->layerIndex].menuList[++this->menuSelectedIndex];
541      this->sliderTo(this->menuSelected, 5.0f);
542      if (this->selectorSource != NULL)
543        this->selectorSource->play();
544
545      if( this->layerIndex == 1)
546      {
547        this->menuLayers[1].screenshootList[this->menuSelectedIndex]->setVisibility(true);
548        this->menuLayers[1].screenshootList[this->menuSelectedIndex-1]->setVisibility(false);
549      }
550    }
551  }
552  else if( event.type == SDLK_UP && event.bPressed == true)
553  {
554    if(this->menuSelectedIndex > 0)
555    {
556      this->menuSelected = this->menuLayers[this->layerIndex].menuList[--this->menuSelectedIndex];
557      this->sliderTo(this->menuSelected, 5.0f);
558      if (this->selectorSource != NULL)
559        this->selectorSource->play();
560
561      if( this->layerIndex == 1)
562      {
563        this->menuLayers[1].screenshootList[this->menuSelectedIndex]->setVisibility(true);
564        this->menuLayers[1].screenshootList[this->menuSelectedIndex+1]->setVisibility(false);
565      }
566    }
567  }
568}
569
570
571/**
572* @brief switches to from one meny layer to an other
573* @param layer1 from layer
574* @param layer2 to layer
575*/
576void SimpleGameMenu::switchMenuLayer(int layer1, int layer2)
577{
578  // wrong sizes
579  if(layer1 >= this->menuLayers.size() || layer2 >= this->menuLayers.size())
580    return;
581
582
583  PRINTF(0)("Removing layer %i\n", layer1);
584  std::vector<TextElement*>::iterator te;
585  // fade old menu
586  for( te = this->menuLayers[layer1].menuList.begin(); te != this->menuLayers[layer1].menuList.end(); te++)
587  {
588    (*te)->setVisibility(false);
589  }
590
591  std::vector<ImageEntity*>::iterator it;
592
593  //also fade the screenshots if in level choosement mode
594  for( it = this->menuLayers[layer1].screenshootList.begin(); it != this->menuLayers[layer1].screenshootList.end(); it++)
595  {
596    (*it)->setVisibility(false);
597  }
598
599
600  PRINTF(0)("Showing layer %i\n", layer1);
601  // beam here the new menu
602  for( te = this->menuLayers[layer2].menuList.begin(); te != this->menuLayers[layer2].menuList.end(); te++ )
603  {
604    (*te)->setVisibility(true);
605  }
606
607
608  this->layerIndex = layer2;
609  this->menuSelected = this->menuLayers[layer2].menuList[0];
610  this->menuSelector->setAbsCoor2D(this->menuSelected->getAbsCoor2D() + Vector2D(0, this->menuSelected->getSizeY2D() *.5));
611  this->menuSelector->setSize2D(this->menuSelected->getSizeX2D()*.7, this->menuSelected->getSizeY2D());
612  this->menuSelectedIndex = 0;
613
614  if( layer2 == 1)
615    this->menuLayers[layer2].screenshootList[0]->setVisibility(true);
616}
617
618void SimpleGameMenu::sliderTo(const Element2D* element, float bias)
619{
620  if (bias > 0.0)
621  {
622    this->menuSelector->setAbsCoorSoft2D(element->getAbsCoor2D() + Vector2D(0, element->getSizeY2D() *.5), bias);
623    this->menuSelector->setSizeSoft2D(element->getSizeX2D()*.7, element->getSizeY2D(), bias);
624  }
625  else
626  {
627    this->menuSelector->setAbsCoor2D(element->getAbsCoor2D() + Vector2D(0, element->getSizeY2D() *.5));
628    this->menuSelector->setSize2D(element->getSizeX2D()*.7, element->getSizeY2D());
629  }
630}
631
632
633
634/**********************************************************************************************
635SimpleGameMenuData
636**********************************************************************************************/
637
638
639/**
640* SimpleGameMenuData constructor
641*/
642SimpleGameMenuData::SimpleGameMenuData()
643{}
644
645/**
646* SimpleGameMenuData decontructor
647*/
648SimpleGameMenuData::~SimpleGameMenuData()
649{}
650
651
652/**
653*  initialize the GameWorldDataData
654*/
655ErrorMessage SimpleGameMenuData::init()
656{
657  /* call underlying function */
658  GameWorldData::init();
659}
660
661
662/**
663*  loads the GUI data
664* @param root reference to the xml root element
665*/
666ErrorMessage SimpleGameMenuData::loadGUI(const TiXmlElement* root)
667{
668  /* call underlying function */
669  GameWorldData::loadGUI(root);
670}
671
672
673/**
674*  unloads the GUI data
675*/
676ErrorMessage SimpleGameMenuData::unloadGUI()
677{
678  /* call underlying function */
679  GameWorldData::unloadGUI();
680}
681
682
683/**
684*  overloads the GameWorld::loadWorldEntities(...) class since the menu WorldEntity loading is different (less loading stuff)
685* @param root reference to the xml root parameter
686*/
687ErrorMessage SimpleGameMenuData::loadWorldEntities(const TiXmlElement* root)
688{
689  GameWorldData::loadWorldEntities(root);
690  /*
691  const TiXmlElement* element = root->FirstChildElement("WorldEntities");
692
693  if( element != NULL)
694  {
695  element = element->FirstChildElement();
696  PRINTF(4)("Loading WorldEntities\n");
697  while(element != NULL)
698  {
699  BaseObject* created = Factory::fabricate(element);
700  if( created != NULL )
701  printf("Created a %s: %s\n", created->getClassName(), created->getName());
702
703  if( element->Value() == "SkyBox")
704  this->sky = dynamic_cast<WorldEntity*>(created);
705  if( element->Value() == "Terrain")
706  this->terrain = dynamic_cast<Terrain*>(created);
707  element = element->NextSiblingElement();
708  }
709
710  PRINTF(4)("Done loading WorldEntities\n");
711  }
712
713  // init the pnode tree
714  PNode::getNullParent()->init();
715  */
716}
717
718
719/**
720*  unloads the world entities from the xml file
721*/
722ErrorMessage SimpleGameMenuData::unloadWorldEntities()
723{
724  /* call underlying function */
725  GameWorldData::unloadWorldEntities();
726}
727
728
729/**
730*  loads the scene data
731* @param root reference to the xml root element
732*/
733ErrorMessage SimpleGameMenuData::loadScene(const TiXmlElement* root)
734{
735  /* call underlying function */
736  GameWorldData::loadScene(root);
737}
738
739
740/**
741*  unloads the scene data
742*/
743ErrorMessage SimpleGameMenuData::unloadScene()
744{
745  /* call underlying function */
746  GameWorldData::unloadScene();
747}
748
749
750
Note: See TracBrowser for help on using the repository browser.