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

void Impala::Application::Videolympics::VidolviWindow::ShowScores (  )  [inline]

Definition at line 261 of file VidolviWindow.h.

References Impala::Application::Videolympics::GlobalStats::connected, FlipUp(), Impala::Visualization::FontHandler::GetFontBase(), Impala::Application::Videolympics::ServerConnector::GetGlobalStats(), Impala::Application::Videolympics::ServerConnector::GetStats(), mCountDownLastCount, mCountFloater, mFontHandler, mIsCountDown, mNrTeams, mScoreLocation, mServer, mStatusMessage, Impala::Application::Videolympics::StatsPacket::negative, Impala::Application::Videolympics::GlobalStats::negative, Impala::Application::Videolympics::StatsPacket::positive, Impala::Application::Videolympics::GlobalStats::positive, Impala::Application::Videolympics::GlobalStats::timeSinceStart, topshift, Impala::Application::Videolympics::StatsPacket::unjudged, Impala::Application::Videolympics::Point::x, Impala::Application::Videolympics::Point::y, and Impala::Application::Videolympics::Point::z.

Referenced by DisplayFunc().

00262     {
00263         glPushMatrix();
00264         OGC         oldOGC;
00265         INT         oldBlendInfo[3];
00266         OGCSave( &oldOGC );
00267         oglSys.StartBlend( &oldBlendInfo[0] );
00268         //SetFillColors( 0xff330066, 0xff330066, 0x66000000, 0x66000000, 0xee000000 );
00269         //FillRoundRectExt3D(-10.0f, +4.0f, -15.75f, 20.0f, 2.7f, 0.0f, 0.0f, 0.0f, 0.0f);
00270         //glColor3f(0.9f, 0.9f, 0.0f);
00271         //oglSys.Printf3D(mFontHandler->GetFontBase(this), -2.6f, 5.0f, -13.0f,  0.5f, 0.5f, 0.1f, "VideOlympics Scoreboard");
00272 
00273 
00274         if (!mServer->GetGlobalStats()->connected)
00275         {
00276             oglSys.EndBlend( &oldBlendInfo[0] );
00277             OGCRestore( &oldOGC );
00278             glPopMatrix();
00279             return;
00280         }
00281 
00282         if (mServer->GetGlobalStats()->timeSinceStart < 0)
00283         {
00284             // counting down for the start:
00285             int countdown = -(int)mServer->GetGlobalStats()->timeSinceStart + 1;
00286 
00287             if (mIsCountDown) {
00288                 if (mCountDownLastCount != countdown) {
00289                     mCountFloater = -0.02f;
00290                     mCountDownLastCount = 0.0f;
00291                     mCountDownLastCount = countdown;
00292                 } else {
00293                     mCountFloater = mCountFloater * 1.1;
00294                     if (mCountFloater < -4.0f)
00295                         mCountFloater = -4.0f;
00296                 }
00297             } else {
00298                 mIsCountDown = true;
00299                 mCountFloater = -0.02f;
00300                 mCountDownLastCount = countdown;
00301                 FlipUp();
00302             }
00303             
00304             float z = mCountFloater; //-mServer->GetGlobalStats()->timeSinceStart - countdown;
00305 
00306             glColor3f(1.0f, 1.0f, 0.0f);
00307             oglSys.Printf3D(mFontHandler->GetFontBase(this), -2.2f, topshift+6.5f, -13.0f,  0.5f, 0.5f, 0.1f, "Contest starting in ... ");
00308 
00309             glColor3f(0.8f, 0.8f, 0.2f);
00310             ostringstream s;
00311             s << countdown;
00312             oglSys.Printf3D(mFontHandler->GetFontBase(this), -0.8f, -0.9f, -5.0f - z * 2.0f,  2.5f, 2.5f, 0.5f, s.str().c_str());
00313 
00314             
00315         } else {
00316             mIsCountDown = false;
00317 
00318             glColor3f(0.9f, 0.6f, 0.6f);
00319             oglSys.Printf3D(mFontHandler->GetFontBase(this), -2.2f, topshift+6.5f, -13.0f,  0.5f, 0.5f, 0.1f, mStatusMessage.c_str());
00320 
00321             glColor3f(0.9f, 0.9f, 0.9f);
00322             ostringstream s;
00323             s << "Time: ";
00324             s << (int)mServer->GetGlobalStats()->timeSinceStart;
00325             oglSys.Printf3D(mFontHandler->GetFontBase(this), +5.5f, topshift+7.5f, -13.0f,  0.5f, 0.5f, 0.1f, s.str().c_str());
00326 
00327             glColor3f(0.4f, 1.0f, 0.4f);
00328             ostringstream sp;
00329             sp << "Positive: ";
00330             sp << mServer->GetGlobalStats()->positive;
00331             oglSys.Printf3D(mFontHandler->GetFontBase(this), +5.5f, topshift+7.0f, -13.0f,  0.5f, 0.5f, 0.1f, sp.str().c_str());
00332 
00333             glColor3f(1.0f, 0.4f, 0.4f);
00334             ostringstream sn;
00335             sn << "Negative: ";
00336             sn << mServer->GetGlobalStats()->negative;
00337             oglSys.Printf3D(mFontHandler->GetFontBase(this), +5.5f, topshift+6.5f, -13.0f,  0.5f, 0.5f, 0.1f, sn.str().c_str());
00338         }
00339 
00340         oglSys.EndBlend( &oldBlendInfo[0] );
00341         OGCRestore( &oldOGC );
00342 
00343         glPopMatrix();
00344 
00345         for (int teamno=1; teamno <= mNrTeams; teamno++)
00346         {
00347             glPushMatrix();
00348             Point *sp = mScoreLocation[teamno];
00349             if (sp)
00350             {
00351                 glTranslatef(sp->x - 0.7f, sp->y, sp->z);
00352                 glColor3f(0.4f, 0.4f, 1.0f);
00353                 std::ostringstream unj, pos, neg;
00354 //                f << teamno;
00355 //                oglSys.Printf3D(mFontHandler->GetFontBase(this), 0.0f, 0.0f, 0.0f, 0.4f, 0.4f, 0.1f, f.str().c_str());
00356 
00357                 StatsPacket *stats = mServer->GetStats(teamno);
00358 
00359                 if (stats)
00360                 {
00361                     unj << stats->unjudged;
00362                     pos << stats->positive;
00363                     neg << stats->negative;
00364     
00365                     glTranslatef(0.0f, 0.00f, 0.0f); glColor3f(1.0f, 0.4f, 0.4f);
00366                     oglSys.Printf3D(mFontHandler->GetFontBase(this), 0.0f, 0.0f, 0.0f, 0.4f, 0.4f, 0.1f,
00367                                     neg.str().c_str());
00368                     glTranslatef(0.5f, 0.0f, 0.0f); glColor3f(0.4f, 1.0f, 0.4f);
00369                     oglSys.Printf3D(mFontHandler->GetFontBase(this), 0.0f, 0.0f, 0.0f, 0.4f, 0.4f, 0.1f,
00370                                     pos.str().c_str());
00371                     glTranslatef(0.5f, 0.0f, 0.0f); glColor3f(0.6f, 0.6f, 0.6f);
00372                     oglSys.Printf3D(mFontHandler->GetFontBase(this), 0.0f, 0.0f, 0.0f, 0.4f, 0.4f, 0.1f,
00373                                     unj.str().c_str());
00374                 }
00375             }
00376             glPopMatrix();
00377         }
00378 
00379     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:16:56 2011 for ImpalaSrc by  doxygen 1.5.1