Changeset 1258 for GTP/trunk/App/Demos/Vis
- Timestamp:
- 08/22/06 14:27:13 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/include/TestKdTreeAppListener.h
r1250 r1258 41 41 #include <OgreStringConverter.h> 42 42 #include <OgreException.h> 43 #include <OgreTextAreaOverlayElement.h> 43 44 44 45 #include <OgreKdTree.h> … … 239 240 240 241 OverlayElement *mDemoStatus; 242 TextAreaOverlayElement *mDemoTime; 241 243 242 244 -
GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTree.cpp
r1250 r1258 37 37 .addOpt("s","scenemgr", ARGUMENT_REQUIRED) 38 38 .addOpt("","comment", ARGUMENT_REQUIRED) 39 .addOpt("e","enhancevis", ARGUMENT_NONE) 40 .addOpt("","logint",ARGUMENT_REQUIRED); 39 .addOpt("e","enhancevis", ARGUMENT_NONE); 41 40 42 41 … … 88 87 s << tmp; 89 88 s >> options.mKI; 90 s.clear();91 }92 93 if (cmdparser.getOpt("logint", tmp))94 {95 s << tmp;96 s >> options.mDemoInterval;97 89 s.clear(); 98 90 } -
GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/src/TestKdTreeAppListener.cpp
r1250 r1258 164 164 mDemoOverlay = 0; 165 165 mDemoStatus = 0; 166 mDemoTime = 0; 166 167 167 168 initKdTreeOverlay(); … … 1069 1070 mDemoStats.mTotalEllapsedTime += evt.timeSinceLastFrame; 1070 1071 1072 // set time display 1073 int m = (int)mDemoStats.mTotalEllapsedTime / 60; 1074 int s = (int)mDemoStats.mTotalEllapsedTime % 60; 1075 1076 mDemoTime->setCaption( 1077 StringConverter::toString(m, 2, '0') + ":" + 1078 StringConverter::toString(s, 2, '0')); 1079 1071 1080 // store fps when in demo mode 1072 1081 if (mOptions.mDemoMode) … … 1154 1163 if (mAppState == AS_RECORD) 1155 1164 { 1165 // update stats 1166 ++ mDemoStats.mTotalNumFrames; 1167 mDemoStats.mTotalEllapsedTime += evt.timeSinceLastFrame; 1168 1169 // set time display 1170 int m = (int)mDemoStats.mTotalEllapsedTime / 60; 1171 int s = (int)mDemoStats.mTotalEllapsedTime % 60; 1172 1173 mDemoTime->setCaption( 1174 StringConverter::toString(m, 2, '0') + ":" + 1175 StringConverter::toString(s, 2, '0')); 1176 1156 1177 mFrameList.push_back(FrameInfo(mCamNode->getPosition(), mCamNode->getOrientation(), evt.timeSinceLastFrame)); 1157 1178 } … … 1234 1255 // clear old recording 1235 1256 mFrameList.clear(); 1257 1258 // reset stats 1259 mDemoStats.mNumFrames = 0; 1260 mDemoStats.mTotalNumFrames = 0; 1261 mDemoStats.mEllapsedTime = 0.0f; 1262 mDemoStats.mTotalEllapsedTime = 0.0f; 1236 1263 } 1237 1264 // stop recording … … 1572 1599 { 1573 1600 // init overlay if not present 1574 if (!mDemoOverlay || !mDemoStatus )1601 if (!mDemoOverlay || !mDemoStatus || !mDemoTime) 1575 1602 { 1576 1603 OGRE_DELETE(mDemoOverlay); 1577 1604 OGRE_DELETE(mDemoStatus); 1605 OGRE_DELETE(mDemoTime); 1578 1606 1579 1607 mDemoStatus = OverlayManager::getSingleton().createOverlayElement("Panel", "KdTree/DemoStatus"); … … 1585 1613 mDemoStatus->setDimensions(32, 32); 1586 1614 1615 //mDemoTime = static_cast<TextAreaOverlayElement *> 1616 // (OverlayManager::getSingleton().createOverlayElementFromTemplate( 1617 // "KdTree/Templates/BasicText", "TextArea", "KdTree/DemoTime")); 1618 mDemoTime = static_cast<TextAreaOverlayElement *> 1619 (OverlayManager::getSingleton().createOverlayElement("TextArea", "KdTree/DemoTime")); 1620 mDemoTime->setMetricsMode(GMM_PIXELS); 1621 mDemoTime->setTop(6); 1622 mDemoTime->setLeft(8); 1623 mDemoTime->setFontName("TrebuchetMSBold"); 1624 mDemoTime->setCharHeight(24.0); 1625 mDemoTime->setCaption("00:00"); 1626 1627 PanelOverlayElement *timeCont = static_cast<PanelOverlayElement *> 1628 (OverlayManager::getSingleton().createOverlayElement("Panel", "KdTree/DemoTimePanel")); 1629 timeCont->setMetricsMode(GMM_PIXELS); 1630 timeCont->setHorizontalAlignment(GHA_CENTER); 1631 timeCont->setVerticalAlignment(GVA_TOP); 1632 timeCont->setTop(5); 1633 timeCont->setLeft(16); 1634 timeCont->setDimensions(64, 32); 1635 timeCont->addChild(mDemoTime); 1636 1587 1637 mDemoOverlay = OverlayManager::getSingleton().create("KdTree/DemoOverlay"); 1588 1638 mDemoOverlay->setZOrder(500); 1589 1639 mDemoOverlay->add2D(static_cast<PanelOverlayElement *>(mDemoStatus)); 1640 mDemoOverlay->add2D(timeCont); 1590 1641 } 1591 1642 … … 1597 1648 case AS_PLAYBACK: 1598 1649 mDemoStatus->setMaterialName("KdTree/DemoPlayButton"); 1650 mDemoTime->setColourTop(ColourValue(0.5, 0.7, 0.5)); 1651 mDemoTime->setColourBottom(ColourValue(0.3, 0.5, 0.3)); 1599 1652 mDemoOverlay->show(); 1600 1653 break; 1601 1654 case AS_RECORD: 1602 1655 mDemoStatus->setMaterialName("KdTree/DemoRecordButton"); 1656 mDemoTime->setColourTop(ColourValue(0.7, 0.5, 0.5)); 1657 mDemoTime->setColourBottom(ColourValue(0.5, 0.3, 0.3)); 1603 1658 mDemoOverlay->show(); 1604 1659 break;
Note: See TracChangeset
for help on using the changeset viewer.