Changeset 136 for cafu/trunk/Games/VSWM/Code/HumanPlayer.cpp
- Timestamp:
- 08/27/10 11:30:01 (21 months ago)
- Files:
-
- 1 modified
-
cafu/trunk/Games/VSWM/Code/HumanPlayer.cpp (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cafu/trunk/Games/VSWM/Code/HumanPlayer.cpp
r51 r136 23 23 #include "MaterialSystem/Renderer.hpp" 24 24 #include "Math3D/Matrix.hpp" 25 #include "OpenGL/OpenGLWindow.hpp"26 25 #include "TextParser/TextParser.hpp" 27 26 … … 858 857 // is made from a prediction Think()ing, or a real server-side Think()ing. 859 858 // 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! 861 860 862 861 if (FrameTime>=0.0 && LogFile!=NULL) … … 947 946 // is made from a prediction Think()ing, or a real server-side Think()ing. 948 947 // 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! 950 949 951 950 if (FrameTime>=0.0 && LogFile!=NULL) … … 1295 1294 static FontT Font1("Fonts/Arial"); 1296 1295 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! "); 1302 1303 else 1303 1304 { 1304 1305 // 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!"); 1306 1307 1307 1308 static const std::string HudImgMatName="Hud/Ready"; … … 1316 1317 MatSys::Renderer->SetMatrix(MatSys::RendererI::MODEL_TO_WORLD, MatrixT()); 1317 1318 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)); 1319 1320 1320 1321 static MatSys::MeshT TextMesh(MatSys::MeshT::Quads); … … 1325 1326 const unsigned long h=HudImgHeight/2; 1326 1327 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); 1331 1332 1332 1333 MatSys::Renderer->SetCurrentMaterial(HudImgRM);
