- Timestamp:
- Apr 29, 2007, 6:51:28 PM (18 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/graphics_engine.cc
r10618 r10643 480 480 void GraphicsEngine::wireframe() 481 481 { 482 glPolygonMode(GL_FRONT, GL_LINE); 482 State::showWireframe(!State::showWireframe()); 483 /* 484 if (State::showWireframe()){} 485 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); 486 else 487 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); 488 */ 483 489 } 484 490 -
trunk/src/lib/graphics/importer/bsp/bsp_manager.cc
r10618 r10643 504 504 // glDisable(GL_BLEND); 505 505 } 506 507 if (State::showWireframe()) 508 { 509 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); 510 glBindTexture(GL_TEXTURE_2D, this->bspFile->whiteLightMap ); 511 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); 512 } 506 513 507 514 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 508 515 509 // glColor4f(3.0,3.0,3.0,1.0);510 516 glEnableClientState(GL_VERTEX_ARRAY ); 511 517 glEnableClientState(GL_TEXTURE_COORD_ARRAY ); … … 536 542 glDisableClientState(GL_NORMAL_ARRAY ); 537 543 // glDisableClientState(GL_COLOR_ARRAY); 538 544 545 if (State::showWireframe()) 546 { 547 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); 548 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 549 } 539 550 } 540 551 … … 592 603 if (Face->effect != -1) return; 593 604 594 595 605 if(Face->lm_index < 0) { 596 606 glActiveTextureARB(GL_TEXTURE1_ARB); … … 602 612 glEnable(GL_TEXTURE_2D); 603 613 } 604 //glColor4f(3.0,3.0,3.0,1.0); 614 615 if (State::showWireframe()) 616 { 617 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); 618 glBindTexture(GL_TEXTURE_2D, this->bspFile->whiteLightMap ); 619 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); 620 } 621 605 622 606 623 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); … … 646 663 glDisableClientState(GL_VERTEX_ARRAY ); 647 664 glDisableClientState(GL_TEXTURE_COORD_ARRAY ); 648 649 665 666 if (State::showWireframe()) 667 { 668 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); 669 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 670 } 650 671 } 651 672 -
trunk/src/util/state.cc
r10618 r10643 52 52 53 53 bool State::bOnline = false; 54 bool State::bWireframe = false; 54 55 55 56 int State::menuID = -1; -
trunk/src/util/state.h
r10379 r10643 93 93 /** @returns the local player*/ 94 94 static inline Player* getPlayer() { return State::player; }; 95 /** @param sets wireframemode */ 96 static inline void showWireframe(bool wireframe) { State::bWireframe = wireframe; } 97 /** @retirms the wireframemode */ 98 static inline bool showWireframe() { return State::bWireframe; } 95 99 96 100 … … 151 155 static int menuID; //!< -1 on default, otherwise orxonox's Menu ID 152 156 static bool bOnline; //!< Is true if this node is in multiplayer mode (via network) 157 158 static bool bWireframe; //!< The Wireframemode 153 159 }; 154 160 -
trunk/src/world_entities/environments/rotor.cc
r10554 r10643 56 56 void Rotor::initRotation(float x, float y, float z) 57 57 { 58 this->updateNode(0.001); 58 59 this->mainDir = this->getAbsDir(); 59 60 this->rotation = Vector(x,y,z); … … 71 72 72 73 73 this->setAbsDir( /*this->mainDir**/Quaternion(rotation.x*this->totalTime, Vector(1,0,0)) *74 this->setAbsDir(this->mainDir*Quaternion(rotation.x*this->totalTime, Vector(1,0,0)) * 74 75 Quaternion(rotation.y*this->totalTime, Vector(0,1,0)) * 75 76 Quaternion(rotation.z*this->totalTime, Vector(0,0,1))); -
trunk/src/world_entities/npcs/mover.cc
r10618 r10643 82 82 .describe("sets the action time of the door") 83 83 .defaultValues(1.0); 84 LoadParam(root, "stay-open-time", this, Mover, setStayOpenTime) 85 .describe("sets the time, the door must stay open") 86 .defaultValues(0.0); 84 87 LoadParam(root, "opening-sound", this, Mover, setOpeningSoundFile) 85 88 .describe("Sets the file of the opening sound source"); … … 146 149 this->soundSource_moving.stop(); 147 150 } 151 this->openTime = 0; 148 152 } 149 153 else if (this->state == Open) 150 154 { 151 if (!this->checkPlayerInActionRadius()) 152 { 153 this->state = Closing; 154 if (this->soundBuffer_closing.loaded()) 155 this->soundSource_starting.play(this->soundBuffer_closing); 156 if (this->soundBuffer_moving.loaded()) 157 this->soundSource_moving.play(this->soundBuffer_moving, 1.0, true); 155 this->openTime += dt; 156 if (this->openTime >= this->stayOpenTime) 157 { 158 if (!this->checkPlayerInActionRadius()) 159 { 160 this->state = Closing; 161 if (this->soundBuffer_closing.loaded()) 162 this->soundSource_starting.play(this->soundBuffer_closing); 163 if (this->soundBuffer_moving.loaded()) 164 this->soundSource_moving.play(this->soundBuffer_moving, 1.0, true); 165 } 158 166 } 159 167 } -
trunk/src/world_entities/npcs/mover.h
r10487 r10643 35 35 void setActionRadius(float radius) { this->actionRadius = radius; } 36 36 void setActionTime(float time) { this->actionTime = time; } 37 void setStayOpenTime(float time) { this->stayOpenTime = time; } 37 38 void setOpeningSoundFile(const std::string& fileName); 38 39 void setOpenedSoundFile(const std::string& fileName); … … 62 63 float actionTime; //!< the action-time 63 64 int state; //!< the state of the mover 65 float stayOpenTime; //!< waiting time while opened 66 float openTime; //!< time since opened 64 67 }; 65 68
Note: See TracChangeset
for help on using the changeset viewer.