Show
Ignore:
Timestamp:
08/27/10 11:30:01 (21 months ago)
Author:
Carsten
Message:

Reintegrated branches/cafu_to_wx back into trunk!

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cafu/trunk/Games/VSWM/Code/HumanPlayer.cpp

    r51 r136  
    2323#include "MaterialSystem/Renderer.hpp" 
    2424#include "Math3D/Matrix.hpp" 
    25 #include "OpenGL/OpenGLWindow.hpp" 
    2625#include "TextParser/TextParser.hpp" 
    2726 
     
    858857                    // is made from a prediction Think()ing, or a real server-side Think()ing. 
    859858                    // In the worst case (with prediction), the quit message is posted multiple times. 
    860                     if (SingleOpenGLWindow) SingleOpenGLWindow->PostQuitMessage(); 
     859                    // if (SingleOpenGLWindow) SingleOpenGLWindow->PostQuitMessage();   // FIXME: Set ConVar "quit" to true instead! 
    861860 
    862861                    if (FrameTime>=0.0 && LogFile!=NULL) 
     
    947946                    // is made from a prediction Think()ing, or a real server-side Think()ing. 
    948947                    // In the worst case (with prediction), the quit message is posted multiple times. 
    949                     if (SingleOpenGLWindow) SingleOpenGLWindow->PostQuitMessage(); 
     948                    // if (SingleOpenGLWindow) SingleOpenGLWindow->PostQuitMessage();   // FIXME: Set ConVar "quit" to true instead! 
    950949 
    951950                    if (FrameTime>=0.0 && LogFile!=NULL) 
     
    12951294                static FontT Font1("Fonts/Arial"); 
    12961295                const float  TimeRemaining=3.0f-float(State.Velocity.x); 
    1297  
    1298                      if (TimeRemaining>=2.0) Font1.Print(SingleOpenGLWindow->GetWidth()/2-47, SingleOpenGLWindow->GetHeight()/2, 0x00FF0000, "   3   "); 
    1299                 else if (TimeRemaining>=1.0) Font1.Print(SingleOpenGLWindow->GetWidth()/2-47, SingleOpenGLWindow->GetHeight()/2, 0x00FF0000, "   2   "); 
    1300                 else if (TimeRemaining>=0.0) Font1.Print(SingleOpenGLWindow->GetWidth()/2-47, SingleOpenGLWindow->GetHeight()/2, 0x00FF0000, "   1   "); 
    1301              // else if (TimeRemaining>=0.0) Font1.Print(SingleOpenGLWindow->GetWidth()/2-47, SingleOpenGLWindow->GetHeight()/2, 0x00FF0000, "  Go!  "); 
     1296                const int FrameWidth =1024; 
     1297                const int FrameHeight= 786; 
     1298 
     1299                     if (TimeRemaining>=2.0) Font1.Print(FrameWidth/2-47, FrameHeight/2, float(FrameWidth), float(FrameHeight), 0x00FF0000, "   3   "); 
     1300                else if (TimeRemaining>=1.0) Font1.Print(FrameWidth/2-47, FrameHeight/2, float(FrameWidth), float(FrameHeight), 0x00FF0000, "   2   "); 
     1301                else if (TimeRemaining>=0.0) Font1.Print(FrameWidth/2-47, FrameHeight/2, float(FrameWidth), float(FrameHeight), 0x00FF0000, "   1   "); 
     1302             // else if (TimeRemaining>=0.0) Font1.Print(FrameWidth/2-47, FrameHeight/2, float(FrameWidth), float(FrameHeight), 0x00FF0000, "  Go!  "); 
    13021303                else 
    13031304                { 
    13041305                    // OLD CODE (yes, it was only one line): 
    1305                     // Font1.Print(SingleOpenGLWindow->GetWidth()/2-75, SingleOpenGLWindow->GetHeight()/2, 0x00FF0000, "Ready!"); 
     1306                    // Font1.Print(FrameWidth/2-75, FrameHeight/2, float(FrameWidth), float(FrameHeight), 0x00FF0000, "Ready!"); 
    13061307 
    13071308                    static const std::string        HudImgMatName="Hud/Ready"; 
     
    13161317                    MatSys::Renderer->SetMatrix(MatSys::RendererI::MODEL_TO_WORLD, MatrixT()); 
    13171318                    MatSys::Renderer->SetMatrix(MatSys::RendererI::WORLD_TO_VIEW,  MatrixT()); 
    1318                     MatSys::Renderer->SetMatrix(MatSys::RendererI::PROJECTION,     MatrixT::GetProjOrthoMatrix(0.0f, float(SingleOpenGLWindow->GetWidth()), float(SingleOpenGLWindow->GetHeight()), 0.0f, -1.0f, 1.0f)); 
     1319                    MatSys::Renderer->SetMatrix(MatSys::RendererI::PROJECTION,     MatrixT::GetProjOrthoMatrix(0.0f, float(FrameWidth), float(FrameHeight), 0.0f, -1.0f, 1.0f)); 
    13191320 
    13201321                    static MatSys::MeshT TextMesh(MatSys::MeshT::Quads); 
     
    13251326                    const unsigned long h=HudImgHeight/2; 
    13261327 
    1327                     TextMesh.Vertices[0].SetOrigin(SingleOpenGLWindow->GetWidth()/2-w, SingleOpenGLWindow->GetHeight()/2-h); TextMesh.Vertices[0].SetTextureCoord(0.0f, 0.0f); 
    1328                     TextMesh.Vertices[1].SetOrigin(SingleOpenGLWindow->GetWidth()/2+w, SingleOpenGLWindow->GetHeight()/2-h); TextMesh.Vertices[1].SetTextureCoord(1.0f, 0.0f); 
    1329                     TextMesh.Vertices[2].SetOrigin(SingleOpenGLWindow->GetWidth()/2+w, SingleOpenGLWindow->GetHeight()/2+h); TextMesh.Vertices[2].SetTextureCoord(1.0f, 1.0f); 
    1330                     TextMesh.Vertices[3].SetOrigin(SingleOpenGLWindow->GetWidth()/2-w, SingleOpenGLWindow->GetHeight()/2+h); TextMesh.Vertices[3].SetTextureCoord(0.0f, 1.0f); 
     1328                    TextMesh.Vertices[0].SetOrigin(FrameWidth/2-w, FrameHeight/2-h); TextMesh.Vertices[0].SetTextureCoord(0.0f, 0.0f); 
     1329                    TextMesh.Vertices[1].SetOrigin(FrameWidth/2+w, FrameHeight/2-h); TextMesh.Vertices[1].SetTextureCoord(1.0f, 0.0f); 
     1330                    TextMesh.Vertices[2].SetOrigin(FrameWidth/2+w, FrameHeight/2+h); TextMesh.Vertices[2].SetTextureCoord(1.0f, 1.0f); 
     1331                    TextMesh.Vertices[3].SetOrigin(FrameWidth/2-w, FrameHeight/2+h); TextMesh.Vertices[3].SetTextureCoord(0.0f, 1.0f); 
    13311332 
    13321333                    MatSys::Renderer->SetCurrentMaterial(HudImgRM);