Changeset 8089 in orxonox.OLD for branches/water/src/story_entities/game_world.cc
- Timestamp:
- Jun 1, 2006, 5:24:57 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/water/src/story_entities/game_world.cc
r8037 r8089 107 107 108 108 109 110 111 /// HACK only for testing. 112 void GameWorld::enterGui() 113 { 114 OrxGui::GLGuiBox* imageSelector = new OrxGui::GLGuiBox(); 115 { 116 image = new OrxGui::GLGuiImage(); 117 image->setWidgetSize(300, 300); 118 image->setAbsCoor2D(300, 300); 119 imageSelector->pack(image); 120 121 imageName = new OrxGui::GLGuiInputLine(); 122 imageSelector->pack(imageName); 123 124 OrxGui::GLGuiSlider* slider = new OrxGui::GLGuiSlider(); 125 slider->setWidgetSize(200, 30); 126 slider->setRange(0, 200); 127 slider->setStep(1); 128 129 130 slider->setValue(slider->min()); 131 slider->connect(SIGNAL(slider, valueChanged), this, SLOT(GameWorld, setImage)); 132 133 imageSelector->pack(slider); 134 slider->setValue(getImage("/home/stefalie/svn/orxonox/data/trunk/pictures/dudvmap.bmp")); 135 } 136 imageSelector->showAll(); 137 imageSelector->setAbsCoor2D(400, 30); 138 OrxGui::GLGuiHandler::getInstance()->activateCursor(); 139 140 ///// 141 } 142 143 144 #include "class_list.h" 145 void GameWorld::setImage(int i) 146 { 147 const std::list<BaseObject*>* textures = ClassList::getList(CL_TEXTURE); 148 149 if(textures) 150 { 151 std::list<BaseObject*>::const_iterator test = textures->begin(); 152 std::list<BaseObject*>::const_iterator lastOK = textures->begin(); 153 while (true) 154 { 155 if (--i == 0 || test == textures->end()) 156 break; 157 if (dynamic_cast<Texture*>(*test)->getTexture() != 0) 158 lastOK = test; 159 test++; 160 } 161 this->image->loadImageFromTexture(*dynamic_cast<Texture*>(*lastOK)); 162 this->imageName->setText((*lastOK)->getName()); 163 printf(">>>>> %d\n", dynamic_cast<Texture*>(*lastOK)->getTexture()); 164 } 165 } 166 167 int GameWorld::getImage(const std::string& name) 168 { 169 const std::list<BaseObject*>* textures = ClassList::getList(CL_TEXTURE); 170 171 172 if(textures) 173 { 174 int number = 0; 175 std::list<BaseObject*>::const_iterator test = textures->begin(); 176 std::list<BaseObject*>::const_iterator lastOK = textures->begin(); 177 while (true) 178 { 179 if (test == textures->end()) 180 return 0; 181 if ((*test)->getName() == name) 182 return number; 183 number++; 184 test++; 185 } 186 } 187 } 188 189 190 109 191 /** 110 192 * loads the parameters of a GameWorld from an XML-element … … 225 307 PRINTF(3)("GameWorld::stop() - got stop signal\n"); 226 308 this->bRunning = false; 309 310 OrxGui::GLGuiHandler::getInstance()->deactivateCursor(true); 311 delete OrxGui::GLGuiHandler::getInstance(); 227 312 } 228 313 … … 256 341 { 257 342 PRINTF(3)("GameWorld::mainLoop() - Entering main loop\n"); 343 344 this->enterGui(); 345 258 346 259 347 // initialize Timing … … 387 475 if( likely(this->dataTank->gameRule != NULL)) 388 476 this->dataTank->gameRule->tick(this->dtS); 477 478 479 OrxGui::GLGuiHandler::getInstance()->tick(this->dtS); 480 389 481 } 390 482 } … … 446 538 this->renderPassReflection(); 447 539 // redner the refraction texture 448 this->renderPassRefraction();540 //this->renderPassRefraction(); 449 541 // render all 450 542 this->renderPassAll(); … … 559 651 AtmosphericEngine::getInstance()->draw(); 560 652 561 //glEnable(GL_DEPTH_TEST);562 //glEnable(GL_LIGHTING);653 glEnable(GL_DEPTH_TEST); 654 glEnable(GL_LIGHTING); 563 655 564 656 // set camera
Note: See TracChangeset
for help on using the changeset viewer.