[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/games/astrododge/src
From:       Rivo Laks <rivolaks () hot ! ee>
Date:       2009-08-09 18:38:41
Message-ID: 1249843121.337974.15027.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1009331 by rivol:

- Show ship's position, direction and velocity in renderinfo.
- Renderinfo is now drawn with monospace font.

 M  +13 -1     gameguiview.cpp  


--- trunk/playground/games/astrododge/src/gameguiview.cpp #1009330:1009331
@@ -270,12 +270,24 @@
 
     if (mShowRenderInfo) {
         QString statistics;
+        Vector3f shipPos = mWorld->ship()->position();
+        statistics += QString("Ship pos: (%1; %2; %3)\n")
+                .arg(shipPos.x(), 7, 'f', 1).arg(shipPos.y(), 7, 'f', \
1).arg(shipPos.z(), 7, 'f', 1); +        Vector3f shipDir = \
mWorld->ship()->direction(); +        statistics += QString("Ship dir: (%1; %2; \
%3)\n") +                .arg(shipDir.x(), 5, 'f', 2).arg(shipDir.y(), 5, 'f', \
2).arg(shipDir.z(), 5, 'f', 2); +        Vector3f shipVeloN = \
mWorld->ship()->velocity().normalized(); +        statistics += QString("Ship dir: \
(%1; %2; %3) * %4\n") +                .arg(shipVeloN.x(), 5, 'f', \
2).arg(shipVeloN.y(), 5, 'f', 1).arg(shipVeloN.z(), 5, 'f', 1) +                \
.arg(mWorld->ship()->velocity().norm(), 5, 'f', 1); +
         statistics += QString("Objects: %1\n").arg(mWorld->objects()->count());
         statistics += QString("Lights: %1  batches: %2  faces: %3\n")
                 .arg(renderInfo->lights()).arg(renderInfo->batches()).arg(renderInfo->faces());
  statistics += QString("State changes:\n");
         statistics += QString("buf: %1  mat: %2  tex: %3\n")
                 .arg(renderInfo->bufferChanges()).arg(renderInfo->materialChanges()).arg(renderInfo->textureChanges());
 +
         DisplayWidget* w = static_cast<DisplayWidget*>(glWidget());
         statistics += QString("HDR: %1\n").arg(w->hdrRenderingActive());
         if (w->hdrRenderingActive()) {
@@ -284,7 +296,7 @@
 
         glColor3f(0.8, 0.8, 0.8);
         QRect statsRect(10, 30, 300, 100);
-        textRenderer()->draw(statsRect, statistics, Qt::AlignTop | Qt::AlignLeft, \
QFont("Arial", 10)); +        textRenderer()->draw(statsRect, statistics, \
Qt::AlignTop | Qt::AlignLeft, QFont("Courier New", 10));  }
 
     textRenderer()->end();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic