Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

void Impala::Application::Videolympics::VidolviWindow::DisplayFunc (  )  [inline, virtual]

Reimplemented from OglGui::Window.

Definition at line 427 of file VidolviWindow.h.

References Impala::Application::Videolympics::GlobalStats::connected, Impala::Application::Videolympics::GlobalStats::contestActive, OglGui::Window::DisplayFunc(), DoFlip(), Impala::Application::Videolympics::PhysicsEngine::DoPhysics(), firstView, FlipDown(), FlipUp(), Impala::Application::Videolympics::PhysicsEngine::FlushStacks(), Impala::Application::Videolympics::ServerConnector::GetGlobalStats(), GetNewImages(), OglGui::OglWindow::GetOGLWND(), mLastTime, mReconnectCount, mServer, mState, mStatusMessage, mTimer, mUpdateNeeded, phys, RemoveAllImages(), RemoveOldImages(), ShowScores(), Impala::Timer::SplitTime(), STATE_ENDED, STATE_GETREADY, STATE_NOTCONNECTED, STATE_RUNNING, and Impala::Application::Videolympics::ServerConnector::Update().

00428     {
00429         Window::DisplayFunc();
00430 
00431         if (firstView) {
00432             view3DSys.SetCamera(GetOGLWND(), 0.0f, -1.0f, +4.0f, 0.0f, 0.0f, 0.0f);
00433             firstView = false;
00434         }
00435         
00436         double nowTime = mTimer.SplitTime();
00437         if (nowTime - mLastTime > 0.2) {
00438             mLastTime = nowTime;
00439 
00440             if (mReconnectCount <= 0) {
00441                 mServer->Update();
00442                 if (!mServer->GetGlobalStats()->connected)
00443                     mReconnectCount = 8;
00444             } else {
00445                 mReconnectCount--;
00446             }
00447 
00448             if (mServer->GetGlobalStats()->connected)
00449             {
00450                 if (mState == STATE_NOTCONNECTED)
00451                     FlipUp();
00452 
00453                 if (mServer->GetGlobalStats()->contestActive == 1)
00454                 {
00455                     mStatusMessage = "Contest running...";
00456                     mState = STATE_RUNNING;
00457                     GetNewImages();
00458                     RemoveOldImages();
00459                 } else {
00460                     if (mServer->GetGlobalStats()->contestActive == 0)
00461                     {
00462                         if (mState == STATE_RUNNING || mState == STATE_ENDED)
00463                         {
00464                             // we are resetting from a previous topic, clear images:
00465                             RemoveAllImages();
00466                             FlipDown();
00467                         }
00468                         mState = STATE_GETREADY;
00469                         mStatusMessage = "Get Ready!!!";
00470                     } else {
00471                         mState = STATE_ENDED;
00472                         mStatusMessage = "Contest ended!";
00473                     }
00474                 }
00475             } else {
00476                 mStatusMessage = "contest server offline";
00477 
00478                 if (mState != STATE_NOTCONNECTED) {
00479                     phys->FlushStacks();
00480                     FlipDown();
00481                     mReconnectCount = 10;
00482                 }
00483                 RemoveOldImages();
00484                 mState = STATE_NOTCONNECTED;
00485             }
00486         }
00487     
00488         DoFlip();
00489         ShowScores();
00490 
00491         if (mUpdateNeeded)
00492             GetOGLWND()->updateScene = 1;
00493 
00494         phys->DoPhysics();
00495     }

Here is the call graph for this function:


Generated on Fri Mar 19 10:55:34 2010 for ImpalaSrc by  doxygen 1.5.1