Changeset 119
- Timestamp:
- 08/16/10 21:15:24 (18 months ago)
- Location:
- cafu/branches/cafu_to_wx
- Files:
-
- 7 modified
-
Ca3DE/Client/ClientStateInGame.cpp (modified) (3 diffs)
-
Ca3DE/Client/ClientWindow.cpp (modified) (1 diff)
-
Ca3DE/MainCanvas.cpp (modified) (10 diffs)
-
Ca3DE/MainCanvas.hpp (modified) (1 diff)
-
Libs/GuiSys/GuiManImpl.cpp (modified) (1 diff)
-
Libs/Math3D/Matrix.cpp (modified) (1 diff)
-
SConscript (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cafu/branches/cafu_to_wx/Ca3DE/Client/ClientStateInGame.cpp
r116 r119 383 383 Graphs.PosZ [ClientFrameNr & (512-1)]=((unsigned short)(OurEntityCurrentState->Origin.z/20.0)) & 511; 384 384 385 MatSys::Renderer->PushMatrix(MatSys::RendererI::PROJECTION ); 386 MatSys::Renderer->PushMatrix(MatSys::RendererI::MODEL_TO_WORLD); 387 MatSys::Renderer->PushMatrix(MatSys::RendererI::WORLD_TO_VIEW ); 388 389 MatSys::Renderer->SetMatrix(MatSys::RendererI::PROJECTION, 390 // Note that the far plane is located at infinity for our stencil shadows implementation! 391 // A fovY of 67.5 corresponds to a fovX of 90.0 when the aspect ratio is 4:3. 392 MatrixT::GetProjPerspectiveMatrix(67.5f, float(FrameSize.GetWidth())/float(FrameSize.GetHeight()), 100.0f, -1.0f)); 393 394 MatSys::Renderer->SetMatrix(MatSys::RendererI::MODEL_TO_WORLD, MatrixT()); 395 MatSys::Renderer->SetMatrix(MatSys::RendererI::WORLD_TO_VIEW, MatrixT()); 396 385 397 World->Draw(FrameTime, OurEntityCurrentState); 398 399 MatSys::Renderer->PopMatrix(MatSys::RendererI::PROJECTION ); 400 MatSys::Renderer->PopMatrix(MatSys::RendererI::MODEL_TO_WORLD); 401 MatSys::Renderer->PopMatrix(MatSys::RendererI::WORLD_TO_VIEW ); 386 402 387 403 // Die Framerate ist zwar World-unabhängig, ihre Anzeige hier aber besser aufgehoben (aus rein kosmetischen Gründen). … … 811 827 if (World) 812 828 { 813 cf::GuiSys::GuiI* ActiveGui=cf::GuiSys::GuiMan->GetTopmostActiveAndInteractive(); 829 cf::GuiSys::GuiI* ActiveGui =cf::GuiSys::GuiMan->GetTopmostActiveAndInteractive(); 830 const wxMouseState MouseState=wxGetMouseState(); 814 831 assert(ActiveGui!=NULL); // The GUI of the client for the world output must always be there. 815 832 816 833 // This is unfortunately needed, because the users last click (in the GUI) that brought us here may still have the "LMB up" event pending. 817 #if 0 818 WasLMBOnceUp|=(SingleOpenGLWindow->GetMouseButtonState() & 0x1)==0; 834 WasLMBOnceUp=WasLMBOnceUp || !MouseState.LeftIsDown(); 819 835 820 836 // FIXME: Should test for ActiveGui==ClientGui instead of ActiveGui->GetScriptName()=="". 821 837 if (ActiveGui->GetScriptName()=="" && WasLMBOnceUp) 822 838 { 823 if ( SingleOpenGLWindow->GetMouseButtonState() & 0x1) PlayerCommand.Keys|=PCK_Fire1; // Button 0824 if ( SingleOpenGLWindow->GetMouseButtonState() & 0x6) PlayerCommand.Keys|=PCK_Fire2; // Button 1 oder 2839 if (MouseState.LeftIsDown()) PlayerCommand.Keys|=PCK_Fire1; 840 if (MouseState.MiddleIsDown() || MouseState.RightIsDown()) PlayerCommand.Keys|=PCK_Fire2; 825 841 826 842 // Alle anderen Keys via KeyboardState bestimmen und über die volle Frametime anwenden. … … 828 844 // Mit anderen Worten: Diesen Kram mit in die obige Buffer-Schleife nehmen! 829 845 // Player movement / state 830 // if (SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_RCONTROL ]) ; // R_Strg Run 831 if (SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_RSHIFT ] || // R_Shift Stealth 832 SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_LSHIFT ]) PlayerCommand.Keys|=PCK_Walk; // L_Shift Stealth 833 if (SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_UP ] || // Up Walk forward 834 SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_W ]) PlayerCommand.Keys|=PCK_MoveForward; // W Walk forward 835 if (SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_DOWN ] || // Down Walk backward 836 SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_S ]) PlayerCommand.Keys|=PCK_MoveBackward; // S Walk backward 837 if (SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_A ] || // A Strafe left 838 SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_COMMA ]) PlayerCommand.Keys|=PCK_StrafeLeft; // , Strafe left 839 if (SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_D ] || // D Strafe right 840 SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_PERIOD ]) PlayerCommand.Keys|=PCK_StrafeRight; // . Strafe right 841 if (SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_R ]) PlayerCommand.Keys|=PCK_Fire1; // R Fire/Respawn 842 if (SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_RETURN ] || // RETURN Use 843 SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_NUMPADENTER]) PlayerCommand.Keys|=PCK_Use; // ENTER Use 844 if (SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_LEFT ]) PlayerCommand.Keys|=PCK_TurnLeft; // Left Turn left 845 if (SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_RIGHT ]) PlayerCommand.Keys|=PCK_TurnRight; // Right Turn right 846 if (SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_PGDN ]) PlayerCommand.Keys|=PCK_LookUp; // Look up 847 if (SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_PGUP ]) PlayerCommand.Keys|=PCK_LookDown; // Look down 848 // if (SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_HOME ]) PlayerCommand.Keys|=PCK_BankCW // Bank CW 849 // if (SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_INSERT ]) PlayerCommand.Keys|=PCK_BankCCW; // Bank CCW 850 if (SingleOpenGLWindow->GetKeyboardState()[CaKeyboardEventT::CK_END ]) PlayerCommand.Keys|=PCK_CenterView; 851 } 852 #endif 846 // if (wxGetKeyState(WXK_CONTROL) ) ; // R_Strg Run 847 if (wxGetKeyState(WXK_SHIFT) ) PlayerCommand.Keys|=PCK_Walk; // Shift Stealth 848 if (wxGetKeyState(WXK_UP) || // Up Walk forward 849 wxGetKeyState(wxKeyCode('W')) ) PlayerCommand.Keys|=PCK_MoveForward; // W Walk forward 850 if (wxGetKeyState(WXK_DOWN) || // Down Walk backward 851 wxGetKeyState(wxKeyCode('S')) ) PlayerCommand.Keys|=PCK_MoveBackward; // S Walk backward 852 if (wxGetKeyState(wxKeyCode('A')) || // A Strafe left 853 wxGetKeyState(wxKeyCode(',')) ) PlayerCommand.Keys|=PCK_StrafeLeft; // , Strafe left 854 if (wxGetKeyState(wxKeyCode('D')) || // D Strafe right 855 wxGetKeyState(wxKeyCode('.')) ) PlayerCommand.Keys|=PCK_StrafeRight; // . Strafe right 856 if (wxGetKeyState(wxKeyCode('R')) ) PlayerCommand.Keys|=PCK_Fire1; // R Fire/Respawn 857 if (wxGetKeyState(WXK_RETURN) || // RETURN Use 858 wxGetKeyState(WXK_NUMPAD_ENTER)) PlayerCommand.Keys|=PCK_Use; // ENTER Use 859 if (wxGetKeyState(WXK_LEFT )) PlayerCommand.Keys|=PCK_TurnLeft; // Left Turn left 860 if (wxGetKeyState(WXK_RIGHT )) PlayerCommand.Keys|=PCK_TurnRight; // Right Turn right 861 if (wxGetKeyState(WXK_PAGEDOWN )) PlayerCommand.Keys|=PCK_LookUp; // Look up 862 if (wxGetKeyState(WXK_PAGEUP )) PlayerCommand.Keys|=PCK_LookDown; // Look down 863 // if (wxGetKeyState(WXK_HOME )) PlayerCommand.Keys|=PCK_BankCW // Bank CW 864 // if (wxGetKeyState(WXK_INSERT )) PlayerCommand.Keys|=PCK_BankCCW; // Bank CCW 865 if (wxGetKeyState(WXK_END )) PlayerCommand.Keys|=PCK_CenterView; 866 } 853 867 854 868 -
cafu/branches/cafu_to_wx/Ca3DE/Client/ClientWindow.cpp
r36 r119 77 77 { 78 78 // Call the clients render methods here. 79 80 // We don't want want ortho rendering here, so setup a perspective projection matrix.81 // TODO 1: Move this into the world rendering code??82 // TODO 2: Should actually *push* the matrices, properly *set* them and below *pop* them!!83 // Also see the TODO in GuiManImplT::RenderAll() for more details!!84 MatSys::Renderer->PopMatrix(MatSys::RendererI::PROJECTION );85 MatSys::Renderer->PopMatrix(MatSys::RendererI::MODEL_TO_WORLD);86 MatSys::Renderer->PopMatrix(MatSys::RendererI::WORLD_TO_VIEW );87 88 79 Client->Render(LastFrameTime); 89 90 MatSys::Renderer->PushMatrix(MatSys::RendererI::PROJECTION );91 MatSys::Renderer->PushMatrix(MatSys::RendererI::MODEL_TO_WORLD);92 MatSys::Renderer->PushMatrix(MatSys::RendererI::WORLD_TO_VIEW );93 80 } 94 81 -
cafu/branches/cafu_to_wx/Ca3DE/MainCanvas.cpp
r116 r119 28 28 #include "Server/Server.hpp" 29 29 30 #include "Bitmap/Bitmap.hpp" 30 31 #include "ClipSys/CollisionModelMan.hpp" 31 32 #include "ConsoleCommands/Console.hpp" … … 70 71 EVT_IDLE(MainCanvasT::OnIdle) 71 72 EVT_SIZE(MainCanvasT::OnSize) 72 // EVT_SHOW(MainCanvasT::OnShow)73 73 74 74 EVT_MOTION (MainCanvasT::OnMouseMove ) … … 433 433 434 434 435 static const char* ScreenShotSuffixTypes[] = { "jpg", "png", "bmp", NULL }; 436 static ConVarT ScreenShotSuffix("screenSuffix", "jpg", ConVarT::FLAG_MAIN_EXE, "The suffix to be used for screen-shot image files. Only \"jpg\", \"png\" and \"bmp\" are allowed.", ScreenShotSuffixTypes); 437 438 439 void MainCanvasT::TakeScreenshot() const 440 { 441 const unsigned int Width =GetClientSize().GetWidth(); 442 const unsigned int Height=GetClientSize().GetHeight(); 443 static ArrayT<uint32_t> FrameBuffer; 444 445 FrameBuffer.Overwrite(); 446 FrameBuffer.PushBackEmpty(Width*Height); 447 448 // Read the pixels fromt the OpenGL back buffer into FrameBuffer. 449 // Note that the first two parameters (0, 0) specify the left BOTTOM corner of the desired rectangle! 450 glReadPixels(0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, &FrameBuffer[0]); 451 452 // As mentioned above is the data in the FrameBuffer bottom-up. 453 // Thus now swap all lines (vertical mirroring). 454 for (unsigned int y=0; y<Height/2; y++) 455 { 456 uint32_t* UpperRow=&FrameBuffer[0]+ y *Width; 457 uint32_t* LowerRow=&FrameBuffer[0]+(Height-y-1)*Width; 458 459 for (unsigned int x=0; x<Width; x++) 460 { 461 const uint32_t Swap=*UpperRow; 462 463 *UpperRow=*LowerRow; 464 *LowerRow=Swap; 465 466 UpperRow++; 467 LowerRow++; 468 } 469 } 470 471 // Find the next free image name and save the file. 472 for (unsigned int Nr=0; Nr<100000; Nr++) 473 { 474 const wxString FileName=wxString::Format("pic%04u", Nr) + "." + ScreenShotSuffix.GetValueString(); 475 476 if (!wxFileExists(FileName)) 477 { 478 if (BitmapT(Width, Height, &FrameBuffer[0]).SaveToDisk(FileName)) 479 { 480 Console->Print(std::string("Screenshot \"")+FileName.ToStdString()+"\" saved.\n"); 481 } 482 else 483 { 484 Console->Warning(std::string("Screenshot \"")+FileName.ToStdString()+"\" could not be saved.\n"); 485 } 486 return; 487 } 488 } 489 } 490 491 435 492 void MainCanvasT::OnPaint(wxPaintEvent& PE) 436 493 { 437 494 wxPaintDC dc(this); // It is VERY important not to omit this, or otherwise everything goes havoc. 438 495 439 if (m_InitState==INIT_REQUIRED) Initialize(); 496 if (m_InitState==INIT_REQUIRED) 497 { 498 // This code is in this place due to a few peculiarities of OpenGL under GTK that do not exist under MSW: 499 // - An OpenGL context can only be made current with a canvas that is shown on the screen. 500 // - Relying on EVT_SHOW however is not a good approach, see the discussions at 501 // <http://thread.gmane.org/gmane.comp.lib.wxwidgets.general/68490> and 502 // <http://thread.gmane.org/gmane.comp.lib.wxwidgets.general/70607> for details. 503 // Consequently, the first and best opportunity for initialization is here. 504 Initialize(); 505 } 440 506 } 441 507 … … 457 523 458 524 // Beende das Programm, wenn das letzte aktive GUI geschlossen wurde. 459 // if (cf::GuiSys::GuiMan->GetNumberOfActiveGUIs()==0) Close();525 // if (cf::GuiSys::GuiMan->GetNumberOfActiveGUIs()==0) m_Parent->Close(); 460 526 461 527 static ConVarT quit("quit", false, ConVarT::FLAG_MAIN_EXE, "The program quits if this variable is set to 1 (true)."); … … 463 529 { 464 530 quit.SetValue(false); // Immediately reset the value, so that we're able to restart the game from a loop that governs the master loop... 465 Close();531 m_Parent->Close(); 466 532 } 467 533 … … 503 569 if (m_Server) m_Server->MainLoop(); 504 570 } 505 506 507 // void MainCanvasT::OnShow(wxShowEvent& SE)508 // {509 // wxMessageBox(wxString::Format("%i %i", SE.IsShown(), m_IsInited));510 // if (SE.IsShown() && !m_IsInited)511 // {512 // // This code is in this place due to a few peculiarities of OpenGL under GTK that do not exist under MSW:513 // // - First, an OpenGL context can only be made current with a canvas that is shown on the screen.514 // // - Second, calling Show() in the ctor above doesn't show the frame immediately - that requires515 // // getting back to the main event loop first.516 // // Consequently, the first and best opportunity for initializing the MatSys is here.517 // Initialize();518 // }519 // }520 571 521 572 … … 745 796 void MainCanvasT::OnKeyDown(wxKeyEvent& KE) 746 797 { 798 if (m_InitState!=INIT_SUCCESS) return; 799 800 switch (KE.GetKeyCode()) 801 { 802 case WXK_F1: 803 { 804 // Activate the in-game console GUI (it's "F1" now, not CK_GRAVE ("^", accent grave) any longer). 805 extern ConVarT Options_ServerGameName; 806 cf::GuiSys::GuiI* ConsoleGui=cf::GuiSys::GuiMan->Find("Games/"+Options_ServerGameName.GetValueString()+"/GUIs/Console.cgui"); 807 808 // ConsoleGui should be the same as in Initialize(), but could be NULL on file not found, parse error, etc. 809 if (ConsoleGui!=NULL && !ConsoleGui->GetIsActive()) 810 { 811 ConsoleGui->Activate(); 812 cf::GuiSys::GuiMan->BringToFront(ConsoleGui); 813 814 static bool InitialHelpMsgPrinted=false; 815 816 if (!InitialHelpMsgPrinted) 817 { 818 Console->Print("\n"); 819 Console->Print("Welcome to the Cafu console!\n"); 820 Console->Print("Enter help() to obtain more information.\n"); 821 Console->Print("\n"); 822 InitialHelpMsgPrinted=true; 823 } 824 825 // Handled the key. 826 return; 827 } 828 829 // Let the active GUI handle the key below (e.g. for closing the console again). 830 break; 831 } 832 833 case WXK_F5: 834 { 835 TakeScreenshot(); 836 return; 837 } 838 } 839 747 840 // Look for the pressed keys keycode in the table and translate it to a CaKeyCode if found. 748 841 for (int KeyCodeNr=0; KeyCodes[KeyCodeNr].wxKC!=0; KeyCodeNr++) … … 756 849 757 850 cf::GuiSys::GuiMan->ProcessDeviceEvent(KeyboardEvent); 758 return; 851 // We should probably return here if the GuiMan handled the key, break (only when unhandled) for calling KE.Skip() otherwise. 852 break; 759 853 } 760 854 } … … 766 860 void MainCanvasT::OnKeyUp(wxKeyEvent& KE) 767 861 { 862 if (m_InitState!=INIT_SUCCESS) return; 863 768 864 // Look for the released keys keycode in the table and translate it to a CaKeyCode if found. 769 865 for (int KeyCodeNr=0; KeyCodes[KeyCodeNr].wxKC!=0; KeyCodeNr++) … … 787 883 void MainCanvasT::OnKeyChar(wxKeyEvent& KE) 788 884 { 885 if (m_InitState!=INIT_SUCCESS) return; 886 789 887 CaKeyboardEventT KeyboardEvent; 790 888 -
cafu/branches/cafu_to_wx/Ca3DE/MainCanvas.hpp
r116 r119 59 59 60 60 void Initialize(); 61 void TakeScreenshot() const; 61 62 62 63 void OnPaint(wxPaintEvent& PE); 63 64 void OnSize(wxSizeEvent& SE); 64 65 void OnIdle(wxIdleEvent& IE); ///< The idle event handler runs one frame of the Cafu Engine (client and/or server). 65 // void OnShow(wxShowEvent& SE); ///< Event handler for "has been shown" events.66 66 67 67 void OnMouseMove (wxMouseEvent& ME); -
cafu/branches/cafu_to_wx/Libs/GuiSys/GuiManImpl.cpp
r36 r119 174 174 } 175 175 176 // Render the GUIs in back-to-front order. 176 // We assume that the caller doesn't expect us to preserve (push/pop) the matrices... 177 const float zNear=0.0f; 178 const float zFar =1.0f; 179 MatSys::Renderer->SetMatrix(MatSys::RendererI::PROJECTION, MatrixT::GetProjOrthoMatrix(0.0f, VIRTUAL_SCREEN_SIZE_X, VIRTUAL_SCREEN_SIZE_Y, 0.0f, zNear, zFar)); 180 MatSys::Renderer->SetMatrix(MatSys::RendererI::MODEL_TO_WORLD, MatrixT()); 181 MatSys::Renderer->SetMatrix(MatSys::RendererI::WORLD_TO_VIEW, MatrixT()); 182 183 // Render the active GUIs in back-to-front order. 177 184 for (unsigned long GuiNr=StartGuiNr; GuiNr<Guis.Size(); GuiNr++) 178 185 { 179 // TODO: 180 // 1) Remove the next (no-comment-) line. 181 // 2) Move the matrix push, set and pop code out of this loop! 182 // 3) Fix the clients ClientWindowT::Render() method by fixing the matrix setup code inside it 183 // (it probably belongs into the world rendering method anyway)!! 184 if (!Guis[GuiNr]->GetIsActive()) continue; 185 186 // Setup the matrices. 187 MatSys::Renderer->PushMatrix(MatSys::RendererI::PROJECTION ); 188 MatSys::Renderer->PushMatrix(MatSys::RendererI::MODEL_TO_WORLD); 189 MatSys::Renderer->PushMatrix(MatSys::RendererI::WORLD_TO_VIEW ); 190 191 const float zNear=0.0f; 192 const float zFar =1.0f; 193 MatSys::Renderer->SetMatrix(MatSys::RendererI::PROJECTION, MatrixT::GetProjOrthoMatrix(0.0f, VIRTUAL_SCREEN_SIZE_X, VIRTUAL_SCREEN_SIZE_Y, 0.0f, zNear, zFar)); 194 MatSys::Renderer->SetMatrix(MatSys::RendererI::MODEL_TO_WORLD, MatrixT()); 195 MatSys::Renderer->SetMatrix(MatSys::RendererI::WORLD_TO_VIEW, MatrixT()); 196 197 if (Guis[GuiNr]->GetIsActive()) Guis[GuiNr]->Render(); 198 199 // Restore the previously active matrices. 200 MatSys::Renderer->PopMatrix(MatSys::RendererI::PROJECTION ); 201 MatSys::Renderer->PopMatrix(MatSys::RendererI::MODEL_TO_WORLD); 202 MatSys::Renderer->PopMatrix(MatSys::RendererI::WORLD_TO_VIEW ); 186 if (Guis[GuiNr]->GetIsActive()) 187 Guis[GuiNr]->Render(); 203 188 } 204 189 } -
cafu/branches/cafu_to_wx/Libs/Math3D/Matrix.cpp
r96 r119 66 66 MatrixT MatrixT::GetProjPerspectiveMatrix(float fovY, float aspect, float zNear, float zFar) 67 67 { 68 if (zFar<=zNear) 69 { 70 // If zFar <= zNear, the far plane is assumed to be at infinity (a useful special case for stencil shadow projections). 71 // This code is also used in <http://trac.cafu.de/browser/cafu/trunk/Libs/OpenGL/OpenGLWindow.cpp?rev=100#L137>. 72 const float cotanFovY=1.0f/tan(fovY*3.14159265358979323846f/360.0f); 73 74 return MatrixT( 75 cotanFovY/aspect, 0.0f, 0.0f, 0.0f, 76 0.0f, cotanFovY, 0.0f, 0.0f, 77 0.0f, 0.0f, -1.0f, -2.0f*zNear, 78 0.0f, 0.0f, -1.0f, 0.0f); 79 } 80 68 81 const float ymax= zNear*float(tan(fovY*3.14159265358979323846f/360.0f)); 69 82 const float ymin=-ymax; -
cafu/branches/cafu_to_wx/SConscript
r116 r119 51 51 + Split("gdi32 glu32 opengl32 user32") + ['cfsOpenGL', 'dinput', 'dxguid']) 52 52 elif sys.platform=="linux2": 53 # envTools.Append(LINKFLAGS = ['-Wl,--export-dynamic'])# Not needed any more, .so libs now link to the required .a libs directly, just as under Windows.53 # envTools.Append(LINKFLAGS=['-Wl,--export-dynamic']) # Not needed any more, .so libs now link to the required .a libs directly, just as under Windows. 54 54 # GLU is needed for the TerrainViewerOld *and* for e.g. gluBuild2DMipmaps() in the renderers... 55 55 envTools.Append(CPPPATH=['/usr/include/freetype2']) # As of 2009-09-10, this line is to become unnecessary in the future, see /usr/include/ftbuild.h for details. … … 82 82 wxPath="#/ExtLibs/wxWidgets"; 83 83 84 wxEnv.Append(CPPPATH = [wxPath+'/include']) 84 wxEnv.Append(CPPPATH=[wxPath+'/include']) 85 wxEnv.Append(LIBS=Split("advapi32 comctl32 comdlg32 gdi32 ole32 oleaut32 opengl32 rpcrt4 shell32 user32 winspool wsock32")) 85 86 86 87 # TODO: Move this into the SConstruct file (including the wx include path above). … … 96 97 LibPath += "_lib" 97 98 98 wxEnv.Append(LIBPATH =[wxPath+LibPath])99 wxEnv.Append(LIBPATH=[wxPath+LibPath]) 99 100 100 101 if buildMode=="dbg": 101 wxEnv.Append(CPPPATH =[wxPath+LibPath+"/mswud"])102 wxEnv.Append(LIBS =Split("wxbase29ud wxbase29ud_net wxjpegd wxmsw29ud_adv wxmsw29ud_core wxmsw29ud_gl wxmsw29ud_aui wxmsw29ud_propgrid wxregexud"))102 wxEnv.Append(CPPPATH=[wxPath+LibPath+"/mswud"]) 103 wxEnv.Append(LIBS=Split("wxbase29ud wxbase29ud_net wxjpegd wxmsw29ud_adv wxmsw29ud_core wxmsw29ud_gl wxmsw29ud_aui wxmsw29ud_propgrid wxregexud")) 103 104 else: 104 wxEnv.Append(CPPPATH =[wxPath+LibPath+"/mswu"])105 wxEnv.Append(LIBS =Split("wxbase29u wxbase29u_net wxjpeg wxmsw29u_adv wxmsw29u_core wxmsw29u_gl wxmsw29u_aui wxmsw29u_propgrid wxregexu"))105 wxEnv.Append(CPPPATH=[wxPath+LibPath+"/mswu"]) 106 wxEnv.Append(LIBS=Split("wxbase29u wxbase29u_net wxjpeg wxmsw29u_adv wxmsw29u_core wxmsw29u_gl wxmsw29u_aui wxmsw29u_propgrid wxregexu")) 106 107 107 108 elif sys.platform=="linux2": 108 109 # Geht es auch ohne die naechste Zeile? Woher weiss es, dass es freetype linken soll??? 109 wxEnv.Append(LIBS =Split("wx_gtk2u_gl-2.9 wx_gtk2u_aui-2.9 wx_gtk2u_propgrid-2.9 wx_gtk2u_xrc-2.9 wx_gtk2u_qa-2.9 wx_gtk2u_html-2.9 wx_gtk2u_adv-2.9 wx_gtk2u_core-2.9 wx_baseu_xml-2.9 wx_baseu_net-2.9 wx_baseu-2.9"))110 wxEnv.Append(LIBS=Split("wx_gtk2u_gl-2.9 wx_gtk2u_aui-2.9 wx_gtk2u_propgrid-2.9 wx_gtk2u_xrc-2.9 wx_gtk2u_qa-2.9 wx_gtk2u_html-2.9 wx_gtk2u_adv-2.9 wx_gtk2u_core-2.9 wx_baseu_xml-2.9 wx_baseu_net-2.9 wx_baseu-2.9")) 110 111 wxEnv.ParseConfig(Dir("#/ExtLibs/wxWidgets").abspath + "/build-gtk/wx-config --cxxflags --libs std,gl") 111 112 … … 117 118 if sys.platform=="win32": 118 119 envCafu.Append(LIBS=Split("SceneGraph MatSys SoundSys cfsLib cfsCoreLib cfs_png cfs_jpeg bulletcollision minizip z lua ClipSys GuiSysNullEditor")) 119 envCafu.Append(LIBS=Split("lightwave")) # For the GuiSys::ModelWindowT class. 120 envCafu.Append(LIBS=Split("advapi32 comctl32 comdlg32 gdi32 ole32 oleaut32 opengl32 rpcrt4 shell32 user32 winspool wsock32")) 120 envCafu.Append(LIBS=Split("lightwave")) # For the GuiSys::ModelWindowT class. 121 121 122 WinResource =envCafu.RES("Ca3DE/Cafu.rc")# + envCafu.RES("Ca3DE/Dialog1.rc")122 WinResource = envCafu.RES("Ca3DE/Cafu.rc") # + envCafu.RES("Ca3DE/Dialog1.rc") 123 123 124 124 elif sys.platform=="linux2": 125 125 # -Wl,-rpath,. is so that also the . directory is searched for dynamic libraries when they're opened. 126 126 # -Wl,--export-dynamic is so that the exe exports its symbols so that the MatSys, SoundSys and game .so libs can in turn resolve theirs. 127 envCafu.Append(LINKFLAGS =['-Wl,-rpath,.', '-Wl,--export-dynamic'])127 envCafu.Append(LINKFLAGS=['-Wl,-rpath,.', '-Wl,--export-dynamic']) 128 128 envCafu.Append(LIBS=Split("MatSys SoundSys SceneGraph cfsLib cfsCoreLib cfs_png cfs_jpeg bulletdynamics bulletcollision bulletmath openal alut mpg123 ogg vorbis vorbisfile minizip z lua lightwave ClipSys GuiSysNullEditor")) 129 129 … … 152 152 envCafu.Append(LINKCOM=" -Wl,--allow-multiple-definition -Wl,--whole-archive -lcfsLib -lbulletdynamics -lbulletcollision -lbulletmath -lopenal -lalut -lmpg123 -logg -lvorbis -lvorbisfile -Wl,--no-whole-archive -llightwave -lz") 153 153 154 WinResource =[]154 WinResource = [] 155 155 156 156 EngineCommonAndServerObjs = envCafu.StaticObject(Split("""Ca3DE/AppCafu.cpp Ca3DE/MainCanvas.cpp Ca3DE/MainFrame.cpp Ca3DE/ConDefs.cpp … … 166 166 envCaWE = wxEnv.Clone() 167 167 envCaWE.Append(CPPPATH=['ExtLibs/lua/src', 'ExtLibs/noise/src']) 168 envCaWE.Append(LIBS =Split("SceneGraph MatSys cfsCoreLib cfsLib ClipSys cfs_png cfs_jpeg bulletcollision noise lua minizip lightwave z"))168 envCaWE.Append(LIBS=Split("SceneGraph MatSys cfsCoreLib cfsLib ClipSys cfs_png cfs_jpeg bulletcollision noise lua minizip lightwave z")) 169 169 170 170 if sys.platform=="win32": 171 171 envCaWE.Append(CPPPATH=['ExtLibs/freetype/include']) # Windows builds use our local copy, Linux builds (must) use the systems freetype library instead. 172 envCaWE.Append(LIBS = Split("freetype")) 173 envCaWE.Append(LIBS = Split("advapi32 comctl32 comdlg32 gdi32 ole32 oleaut32 opengl32 rpcrt4 shell32 user32 winspool wsock32")) 172 envCaWE.Append(LIBS=Split("freetype")) 174 173 175 WinResource =envCaWE.RES("CaWE/CaWE.rc")174 WinResource = envCaWE.RES("CaWE/CaWE.rc") 176 175 177 176 elif sys.platform=="linux2": 178 envCaWE.Append(CPPPATH=['/usr/include/freetype2']) # As of 2009-09-10, this line is to become unnecessary in the future, see /usr/include/ftbuild.h for details.179 envCaWE.Append(LINKFLAGS = ['-Wl,--export-dynamic'])# Need this so that the Renderer DLLs can have their unresolved symbols dynamically resolved at load time.177 envCaWE.Append(CPPPATH=['/usr/include/freetype2']) # As of 2009-09-10, this line is to become unnecessary in the future, see /usr/include/ftbuild.h for details. 178 envCaWE.Append(LINKFLAGS=['-Wl,--export-dynamic']) # Need this so that the Renderer DLLs can have their unresolved symbols dynamically resolved at load time. 180 179 181 WinResource =[]180 WinResource = [] 182 181 183 SourceFilesList =(Glob("CaWE/*.cpp")182 SourceFilesList = (Glob("CaWE/*.cpp") 184 183 +Glob("CaWE/FontWizard/*.cpp") 185 184 +Glob("CaWE/GuiEditor/*.cpp")+Glob("CaWE/GuiEditor/Commands/*.cpp")+Glob("CaWE/GuiEditor/EditorData/*.cpp")
