Changeset 114
- Timestamp:
- 08/12/10 16:39:08 (18 months ago)
- Location:
- cafu/branches/cafu_to_wx
- Files:
-
- 2 removed
- 10 modified
-
Ca3DE/Client/ScrlInfo.cpp (modified) (1 diff)
-
Ca3DE/Client/ScrlInfo.hpp (modified) (1 diff)
-
CaTools/MaterialViewer.cpp (modified) (1 diff)
-
Games/DeathMatch/Code/DeathMatch.cpp (modified) (3 diffs)
-
Games/DeathMatch/Code/HumanPlayer.cpp (modified) (1 diff)
-
Games/VSWM/Code/HumanPlayer.cpp (modified) (6 diffs)
-
Games/VSWM/Code/VSWM.cpp (modified) (3 diffs)
-
Libs/Fonts/Font.cpp (modified) (5 diffs)
-
Libs/Fonts/Font.hpp (modified) (1 diff)
-
Libs/OpenGL/OpenGLWindowOO.cpp (deleted)
-
Libs/OpenGL/OpenGLWindowOO.hpp (deleted)
-
Libs/SConscript (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cafu/branches/cafu_to_wx/Ca3DE/Client/ScrlInfo.cpp
r36 r114 85 85 86 86 87 void ScrollInfoT::Draw(FontT& Font, unsigned long PosX, unsigned long PosY ) const87 void ScrollInfoT::Draw(FontT& Font, unsigned long PosX, unsigned long PosY, float FrameWidth, float FrameHeight) const 88 88 { 89 89 if (NrOfLines==0) return; 90 90 91 Font.AccPrintBegin( );91 Font.AccPrintBegin(FrameWidth, FrameHeight); 92 92 93 93 for (char LineNr=0; LineNr<NrOfLines; LineNr++) -
cafu/branches/cafu_to_wx/Ca3DE/Client/ScrlInfo.hpp
r36 r114 50 50 ScrollInfoT(); 51 51 void Print(const char* PrintString, ...); 52 void Draw(FontT& Font, unsigned long PosX, unsigned long PosY ) const;52 void Draw(FontT& Font, unsigned long PosX, unsigned long PosY, float FrameWidth, float FrameHeight) const; 53 53 void AdvanceTime(float FrameTime); 54 54 }; -
cafu/branches/cafu_to_wx/CaTools/MaterialViewer.cpp
r113 r114 504 504 505 505 506 MyFont->Print(SingleOpenGLWindow->GetWidth()-100, SingleOpenGLWindow->GetHeight()-18, 0x00FFFFFF, "%5.1f FPS", 1.0/DeltaTime);506 MyFont->Print(SingleOpenGLWindow->GetWidth()-100, SingleOpenGLWindow->GetHeight()-18, float(SingleOpenGLWindow->GetWidth()), float(SingleOpenGLWindow->GetHeight()), 0x00FFFFFF, "%5.1f FPS", 1.0/DeltaTime); 507 507 } 508 508 MatSys::Renderer->EndFrame(); -
cafu/branches/cafu_to_wx/Games/DeathMatch/Code/DeathMatch.cpp
r113 r114 36 36 #include "MaterialSystem/Renderer.hpp" 37 37 #include "MaterialSystem/TextureMap.hpp" 38 #include "OpenGL/OpenGLWindow.hpp"39 38 #include "TypeSys.hpp" 40 39 #include "SoundSystem/SoundShaderManager.hpp" … … 92 91 #ifdef _WIN32 93 92 // Under Linux (where DLLs are shared objects), these all resolve to their counterparts in the main executable. 94 SingleOpenGLWindowT* SingleOpenGLWindow=NULL;95 93 cf::GuiSys::GuiManI* cf::GuiSys::GuiMan=NULL; // Define the global GuiMan pointer instance -- see GuiMan.hpp for more details. 96 94 MaterialManagerI* MaterialManager =NULL; … … 106 104 // WARNING: When the signature of GetGame() is changed here (e.g. by adding more interface pointer parameters), 107 105 // grep all C++ source code files for "GetGame@", because the number of parameter bytes must be updated there! 108 DLL_EXPORT cf::GameSys::GameI* __stdcall GetGame( SingleOpenGLWindowT* SingleWin,MatSys::RendererI* Renderer, MatSys::TextureMapManagerI* TexMapMan, MaterialManagerI* MatMan, cf::GuiSys::GuiManI* GuiMan_, cf::ConsoleI* Console_, ConsoleInterpreterI* ConInterpreter_, cf::ClipSys::CollModelManI* CollModelMan_, SoundSysI* SoundSystem_, SoundShaderManagerI* SoundShaderManager_)106 DLL_EXPORT cf::GameSys::GameI* __stdcall GetGame(MatSys::RendererI* Renderer, MatSys::TextureMapManagerI* TexMapMan, MaterialManagerI* MatMan, cf::GuiSys::GuiManI* GuiMan_, cf::ConsoleI* Console_, ConsoleInterpreterI* ConInterpreter_, cf::ClipSys::CollModelManI* CollModelMan_, SoundSysI* SoundSystem_, SoundShaderManagerI* SoundShaderManager_) 109 107 { 110 108 #ifdef _WIN32 111 109 // Under Linux (where DLLs are shared objects), these all resolve to their counterparts in the main executable. 112 SingleOpenGLWindow =SingleWin;113 110 MatSys::Renderer =Renderer; 114 111 MatSys::TextureMapManager=TexMapMan; -
cafu/branches/cafu_to_wx/Games/DeathMatch/Code/HumanPlayer.cpp
r91 r114 1024 1024 { 1025 1025 case StateOfExistance_Dead: 1026 HUD_Font1.Print(50, SingleOpenGLWindow->GetHeight()/2-4, 0x00FF0000, "You're dead.");1026 HUD_Font1.Print(50, 1024/2-4, 800.0f, 600.0f, 0x00FF0000, "You're dead."); 1027 1027 break; 1028 1028 1029 1029 case StateOfExistance_FrozenSpectator: 1030 HUD_Font1.Print(50, SingleOpenGLWindow->GetHeight()/2+16, 0x00FF0000, "Press FIRE (left mouse button) to respawn!");1030 HUD_Font1.Print(50, 1024/2+16, 800.0f, 600.0f, 0x00FF0000, "Press FIRE (left mouse button) to respawn!"); 1031 1031 break; 1032 1032 } -
cafu/branches/cafu_to_wx/Games/VSWM/Code/HumanPlayer.cpp
r51 r114 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); -
cafu/branches/cafu_to_wx/Games/VSWM/Code/VSWM.cpp
r113 r114 13 13 #include "MaterialSystem/Renderer.hpp" 14 14 #include "MaterialSystem/TextureMap.hpp" 15 #include "OpenGL/OpenGLWindow.hpp"16 15 17 16 #include "EntityCreateParams.hpp" … … 249 248 // by the client. The parameters to this function however are always non-volatile, they don't change over multiple calls. 250 249 // In future implementations I'll possibly change this and load and init the DLL only once, even before the client or server gets instantiated. 251 SingleOpenGLWindowT* SingleOpenGLWindow=NULL;252 250 cf::GuiSys::GuiManI* cf::GuiSys::GuiMan=NULL; // Define the global GuiMan pointer instance -- see GuiMan.hpp for more details. 253 251 MaterialManagerI* MaterialManager =NULL; … … 256 254 cf::FileSys::FileManI* cf::FileSys::FileMan=NULL; 257 255 258 DLL_EXPORT void __stdcall InitInterfaces(SingleOpenGLWindowT* SingleWin, MatSys::RendererI* Renderer, MatSys::TextureMapManagerI* TexMapMan, MaterialManagerI* MatMan, cf::GuiSys::GuiManI* GuiMan_, cf::ConsoleI* Console_, ConsoleInterpreterI* ConInterpreter_) 259 { 260 SingleOpenGLWindow =SingleWin; 256 DLL_EXPORT void __stdcall InitInterfaces(MatSys::RendererI* Renderer, MatSys::TextureMapManagerI* TexMapMan, MaterialManagerI* MatMan, cf::GuiSys::GuiManI* GuiMan_, cf::ConsoleI* Console_, ConsoleInterpreterI* ConInterpreter_) 257 { 261 258 MatSys::Renderer =Renderer; 262 259 MatSys::TextureMapManager=TexMapMan; -
cafu/branches/cafu_to_wx/Libs/Fonts/Font.cpp
r101 r114 36 36 #include "MaterialSystem/Renderer.hpp" 37 37 #include "Math3D/Matrix.hpp" 38 #include "OpenGL/OpenGLWindow.hpp"39 38 40 39 #if defined(_WIN32) … … 76 75 77 76 78 void FontT::Print(int PosX, int PosY, unsigned long Color, const char* PrintString, ...)77 void FontT::Print(int PosX, int PosY, float FrameWidth, float FrameHeight, unsigned long Color, const char* PrintString, ...) 79 78 { 80 79 if (!PrintString) return; … … 87 86 va_end(ArgList); 88 87 89 AccPrintBegin( );88 AccPrintBegin(FrameWidth, FrameHeight); 90 89 AccPrint(PosX, PosY, Color, PrintBuffer); 91 90 AccPrintEnd(); … … 93 92 94 93 95 void FontT::AccPrintBegin( )94 void FontT::AccPrintBegin(float FrameWidth, float FrameHeight) 96 95 { 97 96 // Save the current matrices. … … 100 99 MatSys::Renderer->PushMatrix(MatSys::RendererI::WORLD_TO_VIEW ); 101 100 102 MatSys::Renderer->SetMatrix(MatSys::RendererI::PROJECTION, MatrixT::GetProjOrthoMatrix(0.0f, float(SingleOpenGLWindow->GetWidth()), float(SingleOpenGLWindow->GetHeight()), 0.0f, -1.0f, 1.0f));101 MatSys::Renderer->SetMatrix(MatSys::RendererI::PROJECTION, MatrixT::GetProjOrthoMatrix(0.0f, FrameWidth, FrameHeight, 0.0f, -1.0f, 1.0f)); 103 102 // MatSys::Renderer->SetMatrix(MatSys::RendererI::MODEL_TO_WORLD, MatrixT()); // Set below, in AccPrint(). 104 103 MatSys::Renderer->SetMatrix(MatSys::RendererI::WORLD_TO_VIEW, MatrixT()); -
cafu/branches/cafu_to_wx/Libs/Fonts/Font.hpp
r36 r114 55 55 56 56 /// Prints PrintString at (PosX, PosY) in color Color. 57 void Print(int PosX, int PosY, unsigned long Color, const char* PrintString, ...);57 void Print(int PosX, int PosY, float FrameWidth, float FrameHeight, unsigned long Color, const char* PrintString, ...); 58 58 59 59 /// Accumulative printing functions. Faster if you have to call Print() a lot. 60 void AccPrintBegin( );60 void AccPrintBegin(float FrameWidth, float FrameHeight); 61 61 void AccPrint(int PosX, int PosY, unsigned long Color, const char* PrintString, ...); 62 62 void AccPrintEnd(); -
cafu/branches/cafu_to_wx/Libs/SConscript
r113 r114 25 25 26 26 27 if sys.platform=="win32":28 Win32Objects=env.Object("DirectX/DirectInput.cpp", CPPPATH=env['CPPPATH']+["#/ExtLibs/DirectX7/include"])29 else:30 Win32Objects=[]31 32 27 env.StaticLibrary( 33 28 target="cfsCoreLib", … … 36 31 GuiSys/ConsoleByWindow.cpp GuiSys/Coroutines.cpp GuiSys/InitWindowTypes.cpp GuiSys/GuiImpl.cpp GuiSys/GuiManImpl.cpp 37 32 GuiSys/Window.cpp GuiSys/WindowCreateParams.cpp GuiSys/WindowChoice.cpp GuiSys/WindowEdit.cpp GuiSys/WindowListBox.cpp GuiSys/WindowModel.cpp GuiSys/WindowPtr.cpp GuiSys/EditorData.cpp 38 FileSys/FileManImpl.cpp FileSys/FileSys_LocalPath.cpp FileSys/FileSys_ZipArchive_GV.cpp FileSys/File_local.cpp FileSys/File_memory.cpp FileSys/Password.cpp""") + 39 env.Object("OpenGL/OpenGLWindow.cpp", CPPPATH=env['CPPPATH']+["#/ExtLibs/DirectX7/include"]) + 40 Win32Objects, 33 FileSys/FileManImpl.cpp FileSys/FileSys_LocalPath.cpp FileSys/FileSys_ZipArchive_GV.cpp FileSys/File_local.cpp FileSys/File_memory.cpp FileSys/Password.cpp"""), 41 34 CPPPATH=env['CPPPATH']+["#/ExtLibs/bullet/src", # For the BulletAdapterT classes. 42 35 "#/ExtLibs/lua/src", "#/ExtLibs/zlib"]) 36 37 38 39 # This library is obsolete, and only used for our legacy programs in CaTools. 40 if sys.platform=="win32": 41 env.StaticLibrary(target="cfsOpenGL", 42 source=["OpenGL/OpenGLWindow.cpp", "DirectX/DirectInput.cpp"], 43 CPPPATH=env['CPPPATH']+["#/ExtLibs/DirectX7/include"]) 44 else: 45 env.StaticLibrary(target="cfsOpenGL", source="OpenGL/OpenGLWindow.cpp") 43 46 44 47
