diff --git a/.git_archival b/.git_archival new file mode 100644 index 000000000..ff4124fe6 --- /dev/null +++ b/.git_archival @@ -0,0 +1 @@ +node: $Format:%H$ diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..c16855571 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +.git_archival export-subst +.gitattributes export-ignore +.gitignore export-ignore diff --git a/.hgignore b/.gitignore similarity index 92% rename from .hgignore rename to .gitignore index 95d5e8c83..f04734c50 100644 --- a/.hgignore +++ b/.gitignore @@ -1,14 +1,13 @@ -syntax: glob - autom4te.cache *~ *.bak .deps deps *.o -./clonk -./netpuncher -./c4group +/clonk +/netpuncher +/c4group +/c4script .dirstamp *.a *.c4p @@ -33,6 +32,7 @@ autotools/missing configure intermediate build* +CMakeScripts CMakeFiles CMakeCache.txt planet/CMakeFiles @@ -121,11 +121,12 @@ planet/nohg* planet/.project # Code::Blocks files -clonk.layout -clonk.sdf -clonk.cbp +openclonk.layout +openclonk.sdf +openclonk.cbp # MacOSX saved searches *.savedSearch planet/OpenClonk.bat planet/openclonk.sln +WindowsGamesExplorer.xml diff --git a/.hgeol b/.hgeol deleted file mode 100644 index 475255608..000000000 --- a/.hgeol +++ /dev/null @@ -1,3 +0,0 @@ -[patterns] -planet/** = LF -** = native diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f9e697b0..297f7c62d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,13 +35,15 @@ set(OC_CXX_FLAGS ${CMAKE_CXX_FLAGS}) separate_arguments(OC_CXX_FLAGS) set(OC_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}) separate_arguments(OC_CXX_FLAGS_DEBUG) +set(OC_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS}) +separate_arguments(OC_EXE_LINKER_FLAGS) set(OC_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG}) separate_arguments(OC_EXE_LINKER_FLAGS_DEBUG) ############################################################################ # User selectable options ############################################################################ -option(PROJECT_FOLDERS "Put source files into subfolders in project file" ON) +option(PROJECT_FOLDERS "Put source files into subfolders in project file" ON) option(USE_GL "Enable OpenGL support" ON) SET(INITIAL_USE_SDL_MAINLOOP_VALUE OFF) SET(INITIAL_USE_OPEN_AL OFF) @@ -56,7 +58,7 @@ if(WIN32 AND FALSE) # disable DX option while it doesn't work anyway list(APPEND CMAKE_LIBRARY_PATH $ENV{DXSDK_DIR}/Lib/x86) endif() else() - + endif() else() SET(USE_DIRECTX OFF) @@ -65,6 +67,8 @@ endif() if(NOT USE_GL AND NOT USE_DIRECTX) message(STATUS "No graphics display enabled; building dedicated server") SET(USE_CONSOLE ON CACHE INTERNAL "Build dedicated server") +else() + SET(USE_CONSOLE OFF) endif() if(UNIX AND NOT USE_SDL_MAINLOOP AND NOT APPLE AND NOT USE_CONSOLE) option(USE_X11 "Use X11 to create windows etc." ON) @@ -77,6 +81,7 @@ else() endif() if(APPLE) option(USE_COCOA "Use Apple Cocoa for the developer mode and the windows." ON) + option(USE_APPLE_CLANG "Use Apple Clang Compiler as C++ compiler." ON) SET(INITIAL_USE_OPEN_AL ON) else() option(USE_COCOA OFF) @@ -142,7 +147,12 @@ if(MSVC_VERSION) endif() if(CMAKE_COMPILER_IS_GNUCXX) - list(APPEND OC_CXX_FLAGS "-Wall -Wextra -Wredundant-decls -Wendif-labels -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Winit-self -Wsign-promo -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo") + list(APPEND OC_CXX_FLAGS "-Wall -Wextra -Wredundant-decls -Wendif-labels -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Winit-self -Wsign-promo -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual") +endif() + +if(WIN32 AND MINGW) + # Activate DEP and ASLR + list(APPEND OC_EXE_LINKER_FLAGS "-Wl,--nxcompat -Wl,--dynamicbase") endif() ############################################################################ # List target source files. Don't directly create a target since we condi- @@ -151,16 +161,10 @@ endif() # OC_CLONK_SOURCES: Sources for OpenClonk that are needed by every build. # OC_SYSTEM_SOURCES: Sources for OpenClonk that are only needed by specific # configurations. +# OC_MAIN_SOURCES: The file with the executable's entry point, not to be added +# to libclonk set(OC_CLONK_SOURCES - src/C4Application.cpp - src/C4Application.h - src/C4FullScreen.cpp - src/C4FullScreen.h - src/C4Game.cpp - src/C4Game.h src/C4Globals.cpp - src/C4GraphicsSystem.cpp - src/C4GraphicsSystem.h src/c4group/C4ComponentHost.cpp src/c4group/C4ComponentHost.h src/c4group/C4Components.h @@ -186,8 +190,6 @@ set(OC_CLONK_SOURCES src/config/C4Constants.h src/config/C4Reloc.cpp src/config/C4Reloc.h - src/config/C4SecurityCertificates.cpp - src/config/C4SecurityCertificates.h src/control/C4Control.cpp src/control/C4Control.h src/control/C4GameControl.cpp @@ -211,102 +213,62 @@ set(OC_CLONK_SOURCES src/editor/C4ConsoleGUICommon.h src/editor/C4ConsoleGUI.h src/editor/C4Console.h - src/editor/C4DevmodeDlg.cpp - src/editor/C4DevmodeDlg.h src/editor/C4EditCursor.cpp src/editor/C4EditCursor.h src/editor/C4ObjectListDlg.cpp src/editor/C4ObjectListDlg.h src/editor/C4ToolsDlg.cpp src/editor/C4ToolsDlg.h + src/editor/C4ViewportWindow.cpp + src/editor/C4ViewportWindow.h + src/game/C4Application.cpp + src/game/C4Application.h + src/game/C4FullScreen.cpp + src/game/C4FullScreen.h + src/game/C4Game.cpp + src/game/C4Game.h src/game/C4GameVersion.h + src/game/C4GraphicsSystem.cpp + src/game/C4GraphicsSystem.h src/game/C4Physics.h - src/game/landscape/C4Landscape.cpp - src/game/landscape/C4Landscape.h - src/game/landscape/C4LandscapeRenderClassic.cpp - src/game/landscape/C4LandscapeRender.cpp - src/game/landscape/C4LandscapeRender.h - src/game/landscape/C4Map.cpp - src/game/landscape/C4MapCreatorS2.cpp - src/game/landscape/C4MapCreatorS2.h - src/game/landscape/C4Map.h - src/game/landscape/C4MassMover.cpp - src/game/landscape/C4MassMover.h - src/game/landscape/C4Material.cpp - src/game/landscape/C4Material.h - src/game/landscape/C4MaterialList.cpp - src/game/landscape/C4MaterialList.h - src/game/landscape/C4Particles.cpp - src/game/landscape/C4Particles.h - src/game/landscape/C4PathFinder.cpp - src/game/landscape/C4PathFinder.h - src/game/landscape/C4PXS.cpp - src/game/landscape/C4PXS.h - src/game/landscape/C4Region.cpp - src/game/landscape/C4Region.h - src/game/landscape/C4Scenario.cpp - src/game/landscape/C4Scenario.h - src/game/landscape/C4Sky.cpp - src/game/landscape/C4Sky.h - src/game/landscape/C4SolidMask.cpp - src/game/landscape/C4SolidMask.h - src/game/landscape/C4Texture.cpp - src/game/landscape/C4Texture.h - src/game/landscape/C4Weather.cpp - src/game/landscape/C4Weather.h - src/game/object/C4Action.cpp - src/game/object/C4Command.cpp - src/game/object/C4Command.h - src/game/object/C4Def.cpp - src/game/object/C4DefGraphics.cpp - src/game/object/C4DefGraphics.h - src/game/object/C4Def.h - src/game/object/C4DefList.cpp - src/game/object/C4DefList.h - src/game/object/C4GameObjects.cpp - src/game/object/C4GameObjects.h - src/game/object/C4Id.cpp - src/game/object/C4Id.h - src/game/object/C4IDList.cpp - src/game/object/C4IDList.h - src/game/object/C4InfoCore.cpp - src/game/object/C4InfoCore.h - src/game/object/C4MeshAnimation.cpp - src/game/object/C4MeshAnimation.h - src/game/object/C4Movement.cpp - src/game/object/C4ObjectCom.cpp - src/game/object/C4ObjectCom.h - src/game/object/C4Object.cpp - src/game/object/C4Object.h - src/game/object/C4ObjectInfo.cpp - src/game/object/C4ObjectInfo.h - src/game/object/C4ObjectInfoList.cpp - src/game/object/C4ObjectInfoList.h - src/game/object/C4ObjectList.cpp - src/game/object/C4ObjectList.h - src/game/object/C4ObjectMenu.cpp - src/game/object/C4ObjectMenu.h - src/game/object/C4ObjectPtr.cpp - src/game/object/C4ObjectPtr.h - src/game/object/C4ObjectScript.cpp - src/game/object/C4Sector.cpp - src/game/object/C4Sector.h - src/game/object/C4Shape.cpp - src/game/object/C4Shape.h - src/game/player/C4Player.cpp - src/game/player/C4Player.h - src/game/player/C4PlayerList.cpp - src/game/player/C4PlayerList.h - src/game/player/C4RankSystem.cpp - src/game/player/C4RankSystem.h - src/game/script/C4Effect.cpp - src/game/script/C4Effects.h - src/game/script/C4FindObject.cpp - src/game/script/C4FindObject.h - src/game/script/C4GameScript.cpp - src/game/script/C4Script.h - src/game/script/C4TransferZone.cpp - src/game/script/C4TransferZone.h + src/game/C4Viewport.cpp + src/game/C4Viewport.h + src/gamescript/C4Effect.cpp + src/gamescript/C4Effect.h + src/gamescript/C4FindObject.cpp + src/gamescript/C4FindObject.h + src/gamescript/C4GameScript.cpp + src/gamescript/C4Script.h + src/gamescript/C4TransferZone.cpp + src/gamescript/C4TransferZone.h + src/graphics/Bitmap256.cpp + src/graphics/Bitmap256.h + src/graphics/C4Draw.cpp + src/graphics/C4DrawD3D.cpp + src/graphics/C4DrawD3D.h + src/graphics/C4DrawD3DShader.cpp + src/graphics/C4DrawD3DShader.h + src/graphics/C4DrawGL.cpp + src/graphics/C4DrawGLCtx.cpp + src/graphics/C4DrawGL.h + src/graphics/C4DrawT.cpp + src/graphics/C4DrawT.h + src/graphics/C4Draw.h + src/graphics/C4Facet.cpp + src/graphics/C4FacetEx.cpp + src/graphics/C4FacetEx.h + src/graphics/C4Facet.h + src/graphics/C4FontLoader.cpp + src/graphics/C4FontLoader.h + src/graphics/C4GraphicsResource.cpp + src/graphics/C4GraphicsResource.h + src/graphics/C4Surface.cpp + src/graphics/C4Surface.h + src/graphics/C4SurfaceLoaders.cpp + src/graphics/CSurface8.cpp + src/graphics/CSurface8.h + src/graphics/StdPNG.cpp + src/graphics/StdPNG.h src/gui/C4ChatDlg.cpp src/gui/C4ChatDlg.h src/gui/C4DownloadDlg.cpp @@ -325,6 +287,8 @@ set(OC_CLONK_SOURCES src/gui/C4GameOptions.h src/gui/C4GameOverDlg.cpp src/gui/C4GameOverDlg.h + src/gui/C4GfxErrorDlg.cpp + src/gui/C4GfxErrorDlg.h src/gui/C4GuiButton.cpp src/gui/C4GuiCheckBox.cpp src/gui/C4GuiComboBox.cpp @@ -369,13 +333,39 @@ set(OC_CLONK_SOURCES src/gui/C4StartupPlrSelDlg.h src/gui/C4StartupScenSelDlg.cpp src/gui/C4StartupScenSelDlg.h - src/gui/C4UpdateDlg.cpp - src/gui/C4UpdateDlg.h src/gui/C4UpperBoard.cpp src/gui/C4UpperBoard.h - src/gui/C4UserMessages.h - src/gui/C4Viewport.cpp - src/gui/C4Viewport.h + src/landscape/C4Landscape.cpp + src/landscape/C4Landscape.h + src/landscape/C4LandscapeRenderClassic.cpp + src/landscape/C4LandscapeRender.cpp + src/landscape/C4LandscapeRender.h + src/landscape/C4Map.cpp + src/landscape/C4MapCreatorS2.cpp + src/landscape/C4MapCreatorS2.h + src/landscape/C4Map.h + src/landscape/C4MassMover.cpp + src/landscape/C4MassMover.h + src/landscape/C4Material.cpp + src/landscape/C4Material.h + src/landscape/C4MaterialList.cpp + src/landscape/C4MaterialList.h + src/landscape/C4Particles.cpp + src/landscape/C4Particles.h + src/landscape/C4PathFinder.cpp + src/landscape/C4PathFinder.h + src/landscape/C4PXS.cpp + src/landscape/C4PXS.h + src/landscape/C4Scenario.cpp + src/landscape/C4Scenario.h + src/landscape/C4Sky.cpp + src/landscape/C4Sky.h + src/landscape/C4SolidMask.cpp + src/landscape/C4SolidMask.h + src/landscape/C4Texture.cpp + src/landscape/C4Texture.h + src/landscape/C4Weather.cpp + src/landscape/C4Weather.h src/lib/C4InputValidation.cpp src/lib/C4InputValidation.h src/lib/C4LogBuf.cpp @@ -426,15 +416,6 @@ set(OC_CLONK_SOURCES src/lib/StdResStr2.cpp src/lib/StdResStr2.h src/lib/StdResStr.h - src/lib/texture/C4Facet.cpp - src/lib/texture/C4FacetEx.cpp - src/lib/texture/C4FacetEx.h - src/lib/texture/C4Facet.h - src/lib/texture/C4GraphicsResource.cpp - src/lib/texture/C4GraphicsResource.h - src/lib/texture/C4SurfaceLoaders.cpp - src/lib/texture/StdPNG.cpp - src/lib/texture/StdPNG.h src/network/C4Client.cpp src/network/C4Client.h src/network/C4GameControlNetwork.cpp @@ -469,15 +450,50 @@ set(OC_CLONK_SOURCES src/network/C4Network2UPnP.h src/network/C4Packet2.cpp src/network/C4PacketBase.h - src/platform/Bitmap256.cpp - src/platform/Bitmap256.h + src/object/C4Action.cpp + src/object/C4Command.cpp + src/object/C4Command.h + src/object/C4Def.cpp + src/object/C4DefGraphics.cpp + src/object/C4DefGraphics.h + src/object/C4Def.h + src/object/C4DefList.cpp + src/object/C4DefList.h + src/object/C4GameObjects.cpp + src/object/C4GameObjects.h + src/object/C4Id.cpp + src/object/C4Id.h + src/object/C4IDList.cpp + src/object/C4IDList.h + src/object/C4InfoCore.cpp + src/object/C4InfoCore.h + src/object/C4MeshAnimation.cpp + src/object/C4MeshAnimation.h + src/object/C4Movement.cpp + src/object/C4ObjectCom.cpp + src/object/C4ObjectCom.h + src/object/C4Object.cpp + src/object/C4Object.h + src/object/C4ObjectInfo.cpp + src/object/C4ObjectInfo.h + src/object/C4ObjectInfoList.cpp + src/object/C4ObjectInfoList.h + src/object/C4ObjectList.cpp + src/object/C4ObjectList.h + src/object/C4ObjectMenu.cpp + src/object/C4ObjectMenu.h + src/object/C4ObjectPtr.cpp + src/object/C4ObjectPtr.h + src/object/C4ObjectScript.cpp + src/object/C4Sector.cpp + src/object/C4Sector.h + src/object/C4Shape.cpp + src/object/C4Shape.h src/platform/C4App.cpp src/platform/C4App.h - src/platform/C4AppT.cpp + src/platform/C4AppWin32Impl.h src/platform/C4FileMonitor.cpp src/platform/C4FileMonitor.h - src/platform/C4Fonts.cpp - src/platform/C4Fonts.h src/platform/C4GamePadCon.cpp src/platform/C4GamePadCon.h src/platform/C4MusicFile.cpp @@ -488,48 +504,38 @@ set(OC_CLONK_SOURCES src/platform/C4SoundLoaders.h src/platform/C4SoundSystem.cpp src/platform/C4SoundSystem.h - src/platform/C4Surface.cpp - src/platform/C4Surface.h + src/platform/C4StdInProc.cpp + src/platform/C4StdInProc.h src/platform/C4Video.cpp src/platform/C4Video.h - src/platform/C4VideoPlayback.cpp - src/platform/C4VideoPlayback.h - src/platform/C4ViewportWindow.cpp - src/platform/C4ViewportWindow.h src/platform/C4Window.h src/platform/C4windowswrapper.h src/platform/GetTime.cpp + src/platform/PlatformAbstraction.cpp src/platform/PlatformAbstraction.h - src/platform/StdD3D.cpp - src/platform/StdD3D.h - src/platform/StdD3DShader.cpp - src/platform/StdD3DShader.h - src/platform/StdDDraw2.cpp - src/platform/StdDDraw2.h src/platform/StdFile.cpp src/platform/StdFile.h - src/platform/StdFont.cpp - src/platform/StdFont.h - src/platform/StdGL.cpp - src/platform/StdGLCtx.cpp - src/platform/StdGL.h - src/platform/StdNoGfx.cpp - src/platform/StdNoGfx.h src/platform/StdRegistry.cpp src/platform/StdRegistry.h src/platform/StdScheduler.cpp src/platform/StdScheduler.h - src/platform/StdSurface8.cpp - src/platform/StdSurface8.h src/platform/StdSync.h src/platform/StdVideo.cpp src/platform/StdVideo.h + src/player/C4Player.cpp + src/player/C4Player.h + src/player/C4PlayerList.cpp + src/player/C4PlayerList.h + src/player/C4RankSystem.cpp + src/player/C4RankSystem.h src/script/C4Aul.cpp src/script/C4AulDebug.cpp src/script/C4AulDebug.h src/script/C4AulDefFunc.h src/script/C4AulExec.cpp src/script/C4AulExec.h + src/script/C4AulFunc.cpp + src/script/C4AulFunc.h src/script/C4Aul.h src/script/C4AulLink.cpp src/script/C4AulParse.cpp @@ -546,8 +552,8 @@ set(OC_CLONK_SOURCES src/script/C4Value.h src/script/C4ValueMap.cpp src/script/C4ValueMap.h - src/zlib/gzio.h src/zlib/gzio.c + src/zlib/gzio.h src/zlib/zutil.h thirdparty/timsort/sort.h ) @@ -606,15 +612,27 @@ set(MAPE_SOURCES mark_as_advanced(OC_CLONK_SOURCES) mark_as_advanced(OC_SYSTEM_SOURCES) +mark_as_advanced(OC_MAIN_SOURCES) mark_as_advanced(MAPE_SOURCES) +# source files specific to an operating system +if(APPLE) + list(APPEND OC_SYSTEM_SOURCES + src/platform/C4FileMonitorMac.mm + ) + + list(APPEND OC_MAIN_SOURCES + src/platform/C4AppDelegate.h + src/platform/C4AppDelegate.mm + ) +else() + list(APPEND OC_MAIN_SOURCES + src/game/ClonkMain.cpp + ) +endif() if(WIN32) list(APPEND OC_SYSTEM_SOURCES - src/platform/C4WindowWin32.cpp - src/platform/StdJoystick.cpp - src/platform/StdJoystick.h src/platform/C4CrashHandlerWin32.cpp - src/editor/C4ConsoleWin32.cpp src/res/resource.h ) @@ -640,45 +658,9 @@ if(WIN32) src/res/engine.rc ) endif(MINGW) -elseif(USE_SDL_MAINLOOP) - list(APPEND OC_SYSTEM_SOURCES - src/platform/C4AppSDL.cpp - src/platform/C4WindowSDL.cpp - ) -elseif(USE_X11) - list(APPEND OC_SYSTEM_SOURCES - src/platform/C4AppX.cpp - src/platform/C4WindowX.cpp - src/platform/C4AppXImpl.h - ) endif() -if(NOT APPLE) - list(APPEND OC_SYSTEM_SOURCES src/C4WinMain.cpp) -endif() - -if(APPLE) - list(APPEND OC_SYSTEM_SOURCES - src/platform/C4AppMac.mm - src/platform/C4FileMonitorMac.mm - src/platform/C4WindowMac.mm - src/platform/ClonkAppDelegate.h - src/platform/ClonkAppDelegate.mm - ) - if(USE_COCOA) - list(APPEND OC_SYSTEM_SOURCES - src/platform/ConsoleWindowController.h - src/platform/ConsoleWindowController.mm - src/platform/ClonkWindowController.h - src/platform/ClonkWindowController.mm - src/platform/ClonkOpenGLView.h - src/platform/ClonkOpenGLView.mm - src/platform/CocoaKeycodeMap.h - src/editor/C4ConsoleCocoa.mm - src/platform/ClonkMainMenuActions.mm - ) - endif() -endif() +# source files specific to a GUI library if(USE_GTK) list(APPEND OC_CLONK_SOURCES src/res/Brush.h @@ -699,25 +681,65 @@ if(USE_GTK) ) list(APPEND OC_SYSTEM_SOURCES - src/platform/C4WindowGTK.cpp - src/platform/C4WindowGTK.h src/editor/C4ConsoleGTK.cpp + src/editor/C4ConsoleGTKDlg.cpp + src/editor/C4ConsoleGTKDlg.h + src/platform/C4AppGTK.cpp + src/platform/C4AppGTKImpl.h + src/platform/C4WindowGTK.cpp + ) +elseif(USE_SDL_MAINLOOP) + list(APPEND OC_SYSTEM_SOURCES + src/platform/C4AppSDL.cpp + src/platform/C4WindowSDL.cpp + ) +elseif(USE_CONSOLE) + list(APPEND OC_SYSTEM_SOURCES + src/platform/C4AppT.cpp + ) +elseif(WIN32) + list(APPEND OC_SYSTEM_SOURCES + src/editor/C4ConsoleWin32.cpp + src/platform/C4WindowWin32.cpp + src/platform/StdJoystick.cpp + src/platform/StdJoystick.h + ) +elseif(USE_COCOA) + list(APPEND OC_SYSTEM_SOURCES + src/editor/C4ConsoleCocoa.mm + src/platform/C4AppMac.mm + src/platform/C4WindowMac.mm + src/platform/C4AppDelegate+MainMenuActions.h + src/platform/C4AppDelegate+MainMenuActions.mm + src/graphics/C4DrawGLMac.h + src/graphics/C4DrawGLMac.mm + src/platform/C4WindowController.h + src/platform/C4WindowController.mm + src/platform/CocoaKeycodeMap.h + src/editor/C4EditorWindowController.h + src/editor/C4EditorWindowController.mm + src/platform/ObjectiveCAssociated.h + ) +endif() +if(WITH_AUTOMATIC_UPDATE) + list(APPEND OC_CLONK_SOURCES + src/gui/C4UpdateDlg.cpp + src/gui/C4UpdateDlg.h ) endif() if(PROJECT_FOLDERS) - source_group("Unsorted" .*) - source_group("Library\\Platform abstraction" src/platform/.*) - source_group("Library\\Utility" src/lib/.*) - source_group("Library\\C4Group" src/c4group/.*) - source_group("Library\\Graphics" src/lib/texture/.*) + source_group("Core" src/.*) + source_group("Platform abstraction" src/platform/.*) + source_group("Utility" src/lib/.*) + source_group("C4Group" src/c4group/.*) + source_group("Graphics" src/graphics/.*) source_group("GUI" src/gui/.*) source_group("Network" src/network/.*) - source_group("Game\\Objects" src/game/object/.*) - source_group("Game\\Scenario" src/game/landscape/.*) - source_group("Game\\Player" src/game/player/.*) - source_group("Game\\Script" src/game/script/.*) - source_group("Scripting" src/script/.*) + source_group("Object" src/object/.*) + source_group("Landscape" src/landscape/.*) + source_group("Player" src/player/.*) + source_group("Script" REGULAR_EXPRESSION .*script/.*) source_group("Config" src/config/.*) source_group("Control" src/control/.*) source_group("Editing" src/editor/.*) @@ -728,20 +750,20 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/c4group - ${CMAKE_CURRENT_SOURCE_DIR}/src/network - ${CMAKE_CURRENT_SOURCE_DIR}/src/lib - ${CMAKE_CURRENT_SOURCE_DIR}/src/platform ${CMAKE_CURRENT_SOURCE_DIR}/src/config - ${CMAKE_CURRENT_SOURCE_DIR}/src/res ${CMAKE_CURRENT_SOURCE_DIR}/src/control - ${CMAKE_CURRENT_SOURCE_DIR}/src/gui ${CMAKE_CURRENT_SOURCE_DIR}/src/editor - ${CMAKE_CURRENT_SOURCE_DIR}/src/game/landscape - ${CMAKE_CURRENT_SOURCE_DIR}/src/game/player - ${CMAKE_CURRENT_SOURCE_DIR}/src/game/script ${CMAKE_CURRENT_SOURCE_DIR}/src/game - ${CMAKE_CURRENT_SOURCE_DIR}/src/game/object - ${CMAKE_CURRENT_SOURCE_DIR}/src/lib/texture + ${CMAKE_CURRENT_SOURCE_DIR}/src/gamescript + ${CMAKE_CURRENT_SOURCE_DIR}/src/graphics + ${CMAKE_CURRENT_SOURCE_DIR}/src/gui + ${CMAKE_CURRENT_SOURCE_DIR}/src/landscape + ${CMAKE_CURRENT_SOURCE_DIR}/src/lib + ${CMAKE_CURRENT_SOURCE_DIR}/src/network + ${CMAKE_CURRENT_SOURCE_DIR}/src/object + ${CMAKE_CURRENT_SOURCE_DIR}/src/platform + ${CMAKE_CURRENT_SOURCE_DIR}/src/player + ${CMAKE_CURRENT_SOURCE_DIR}/src/res ${CMAKE_CURRENT_SOURCE_DIR}/src/script ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty ) @@ -777,10 +799,8 @@ CHECK_INCLUDE_FILE_CXX(natupnp.h HAVE_NATUPNP_H) # 'Bool' and 'Window' to be defined. Unfortunately, this doesn't exist # as a CXX version (yet?). include(CheckIncludeFiles) -CHECK_INCLUDE_FILES(X11/Xlib.h X11/extensions/xf86vmode.h HAVE_X11_EXTENSIONS_XF86VMODE_H) CHECK_INCLUDE_FILES(X11/Xlib.h X11/extensions/Xrandr.h HAVE_X11_EXTENSIONS_XRANDR_H) CHECK_INCLUDE_FILES(X11/Xlib.h X11/keysym.h HAVE_X11_KEYSYM_H) -CHECK_INCLUDE_FILES(X11/Xlib.h X11/xpm.h HAVE_X11_XPM_H) CHECK_INCLUDE_FILE_CXX(iconv.h HAVE_ICONV) if(HAVE_ICONV) @@ -886,9 +906,23 @@ if(USE_GTK) endif() if(USE_OPEN_AL) - FINDLIB(VORBIS_LIBRARY NAMES vorbis) - FINDLIB(VORBISFILE_LIBRARY NAMES vorbisfile) - FINDLIB(OGG_LIBRARY NAMES ogg) + if(MSVC) + if(${FIND_LIBRARY_USE_LIB64_PATHS}) + FINDLIB(OPENAL_LIBRARY NAMES OpenAL64) + else() + FINDLIB(OPENAL_LIBRARY NAMES OpenAL32) + endif() + FINDLIB(OGG_LIBRARY NAMES libogg_static) + FINDLIB(VORBIS_LIBRARY NAMES libvorbis_static) + FINDLIB(VORBISFILE_LIBRARY NAMES libvorbisfile_static) + else() + FINDLIB(VORBIS_LIBRARY NAMES vorbis) + FINDLIB(VORBISFILE_LIBRARY NAMES vorbisfile) + FINDLIB(OGG_LIBRARY NAMES ogg) + endif() + if(NOT APPLE) + FINDLIB(ALUT_LIBRARY NAMES alut) + endif() endif() ############################################################################ @@ -911,10 +945,10 @@ if(APPLE) src/res/ocd.icns src/res/ocf.icns src/res/ocg.icns src/res/C4P.icns src/res/ocs.icns src/res/ocu.icns src/res/MainMenu.xib - src/res/FullscreenWindow.xib - src/res/ConsoleGUIWindow.xib - src/res/ClonkWindow.xib - src/res/ConsoleWindow.xib + src/res/FullScreen.xib + src/res/EditorGUIWindow.xib + src/res/EditorViewport.xib + src/res/Editor.xib src/res/Mouse_Trans.png src/res/Cursor_Trans.png src/res/Brush_Trans.png @@ -930,14 +964,14 @@ if(APPLE) src/res/Ift_Trans.png src/res/NoIft_Trans.png ) - + # Add icon resources set_source_files_properties( ${OC_BUNDLE_RESOURCES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources ) list(APPEND OC_SYSTEM_SOURCES ${OC_BUNDLE_RESOURCES}) - + endif() ############################################################################ @@ -951,7 +985,7 @@ add_library(libclonk STATIC ) add_executable(clonk WIN32 MACOSX_BUNDLE - src/C4WinMain.cpp + ${OC_MAIN_SOURCES} ) #target_link_libraries(clonk) @@ -960,10 +994,9 @@ if(WITH_MAPE) endif() add_executable(c4group - src/c4group/c4group_ng.cpp + src/c4group/C4GroupMain.cpp src/c4group/C4Group.cpp src/lib/C4InputValidation.cpp - src/config/C4SecurityCertificates.cpp src/c4group/C4Update.cpp src/lib/Standard.cpp src/c4group/CStdFile.cpp @@ -991,6 +1024,7 @@ add_executable(netpuncher EXCLUDE_FROM_ALL ) add_executable(c4script + include/c4script/c4script.h src/c4group/C4Group.cpp src/c4group/C4Group.h src/c4group/CStdFile.cpp @@ -1013,18 +1047,20 @@ add_executable(c4script src/platform/StdFile.h src/lib/C4Real.cpp src/lib/C4Random.cpp - src/script/shell.cpp src/script/C4Aul.cpp src/script/C4AulExec.cpp + src/script/C4AulFunc.cpp src/script/C4AulLink.cpp src/script/C4AulParse.cpp src/script/C4StringTable.cpp src/script/C4PropList.cpp src/script/C4ScriptHost.cpp + src/script/C4ScriptMain.cpp + src/script/C4ScriptStandalone.cpp src/script/C4ValueArray.cpp src/script/C4Value.cpp src/script/C4ValueMap.cpp - src/game/object/C4Id.cpp + src/object/C4Id.cpp src/script/C4Script.cpp src/c4group/C4GroupSet.cpp src/c4group/C4ComponentHost.cpp @@ -1039,10 +1075,18 @@ target_link_libraries(clonk ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${ICONV_LIBRARY} - ${VORBIS_LIBRARY} - ${VORBISFILE_LIBRARY} - ${OGG_LIBRARY} ) + +if(USE_OPEN_AL) + target_link_libraries(clonk + ${OPENAL_LIBRARY} + ${ALUT_LIBRARY} + ${VORBIS_LIBRARY} + ${VORBISFILE_LIBRARY} + ${OGG_LIBRARY} + ) +endif() + if(WITH_MAPE) target_link_libraries(mape ${FREETYPE_LIBRARIES} @@ -1050,11 +1094,9 @@ if(WITH_MAPE) ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${ICONV_LIBRARY} - ${VORBIS_LIBRARY} - ${VORBISFILE_LIBRARY} - ${OGG_LIBRARY} ) endif() + target_link_libraries(c4group ${ZLIB_LIBRARIES} ) @@ -1066,7 +1108,7 @@ if(HAVE_PTHREAD) pthread ) target_link_libraries(c4script - pthread + pthread ) endif() if(USE_CONSOLE) @@ -1076,6 +1118,15 @@ if(USE_CONSOLE) ) endif() +if(UNIX AND NOT APPLE) + target_link_libraries(c4group rt) + target_link_libraries(c4script rt) + target_link_libraries(netpuncher rt) + target_link_libraries(clonk rt) + target_link_libraries(mape rt) +endif() +set_property(TARGET clonk APPEND PROPERTY COMPILE_DEFINITIONS GLEW_STATIC) + set(OC_CLONK_LIBRARIES libclonk) #set_property(TARGET clonk APPEND PROPERTY COMPILE_DEFINITIONS GLEW_STATIC) @@ -1083,18 +1134,6 @@ set(OC_CLONK_LIBRARIES libclonk) set_property(TARGET libclonk APPEND PROPERTY COMPILE_DEFINITIONS GLEW_STATIC) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG _DEBUG) -if (APPLE) - add_custom_command(TARGET clonk - POST_BUILD COMMAND "/bin/sh" "${CMAKE_CURRENT_SOURCE_DIR}/tools/osx_bundle_libs.sh" - ) - SET_TARGET_PROPERTIES(clonk PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER YES) - SET_TARGET_PROPERTIES(clonk PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/C4Include.h") - SET_TARGET_PROPERTIES(clonk PROPERTIES XCODE_ATTRIBUTE_GCC_PFE_FILE_C_DIALECTS "c++ objective-c++") - SET_TARGET_PROPERTIES(c4group PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER YES) - SET_TARGET_PROPERTIES(c4group PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/C4Include.h") - SET_TARGET_PROPERTIES(c4group PROPERTIES XCODE_ATTRIBUTE_GCC_PFE_FILE_C_DIALECTS "c++ objective-c++") -endif() - # This expands some variables in Info.plist as a side-effect. XCode might then # expand a second time, using the same syntax. Try not to get confused by this! set_target_properties(clonk PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/src/res/Info.plist") @@ -1143,7 +1182,7 @@ if(UNIX) # Don't put this into CMAKE_CXX_FLAGS because otherwise it is cached, # and when the path is changed both the old and new definition appears # in the list of flags. - add_definitions("-DOC_SYSTEM_DATA_DIR=\"${CMAKE_INSTALL_PREFIX}/share/openclonk\"") + add_definitions("-DOC_SYSTEM_DATA_DIR=\"${CMAKE_INSTALL_PREFIX}/share/games/openclonk\"") endif() if(OC_CXX_FLAGS) list(REMOVE_DUPLICATES OC_CXX_FLAGS) @@ -1159,8 +1198,15 @@ set(CMAKE_CXX_FLAGS_DEBUG "" CACHE STRING "Flags used by the compiler during deb foreach(FLAG ${OC_CXX_FLAGS_DEBUG}) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${FLAG}" CACHE STRING "Flags used by the compiler during debug builds." FORCE) endforeach() +if(OC_EXE_LINKER_FLAGS) + list(REMOVE_DUPLICATES OC_EXE_LINKER_FLAGS) +endif() +set(CMAKE_EXE_LINKER_FLAGS "" CACHE STRING "Flags used by the linker." FORCE) +foreach(FLAG ${OC_EXE_LINKER_FLAGS}) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLAG}" CACHE STRING "Flags used by the linker." FORCE) +endforeach() if(OC_EXE_LINKER_FLAGS_DEBUG) - list(REMOVE_DUPLICATES OC_CXX_FLAGS_DEBUG) + list(REMOVE_DUPLICATES OC_EXE_LINKER_FLAGS_DEBUG) endif() set(CMAKE_EXE_LINKER_FLAGS_DEBUG "" CACHE STRING "Flags used by the linker during debug builds." FORCE) foreach(FLAG ${OC_EXE_LINKER_FLAGS_DEBUG}) @@ -1171,16 +1217,48 @@ endforeach() # Precompiled header support, gcc part (it needs the cxx flags) ############################################################################ -include(GccPchSupport) if(CMAKE_COMPILER_IS_GNUCXX) - if(NOT DEFINED USE_GCC_PCH) - message("Using GCC precompiled headers! USE_GCC_PCH=Off to disable.") - endif() + include(GccPchSupport) option(USE_GCC_PCH "Use GCC precompiled headers" ON) endif() if(USE_GCC_PCH) add_precompiled_header(libclonk src/C4Include.h) add_precompiled_header(c4group src/C4Include.h) + add_precompiled_header(c4script src/C4Include.h) +endif() + +############################################################################ +# Some Xcode/OSX specific settings involving building with clang, precompiled headers... +############################################################################ + +if (APPLE) + add_custom_command(TARGET clonk + POST_BUILD COMMAND "/usr/bin/ruby" "${CMAKE_CURRENT_SOURCE_DIR}/tools/osx_bundle_libs" + ) + + set(CMAKE_XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER YES) + set(CMAKE_XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/C4Include.h") + + SET_TARGET_PROPERTIES(clonk PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER YES) + SET_TARGET_PROPERTIES(clonk PROPERTIES XCODE_ATTRIBUTE_GCC_PFE_FILE_C_DIALECTS "c++ objective-c++") + SET_TARGET_PROPERTIES(clonk PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/C4Include.h") + SET_TARGET_PROPERTIES(c4group PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER YES) + SET_TARGET_PROPERTIES(c4group PROPERTIES XCODE_ATTRIBUTE_GCC_PFE_FILE_C_DIALECTS "c++ objective-c++") + SET_TARGET_PROPERTIES(c4group PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/src/C4Include.h") + SET_TARGET_PROPERTIES(clonk PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES) + + if (USE_APPLE_CLANG) + set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++0x") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") + set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++0x -stdlib=libc++ -g -Wall") + SET_TARGET_PROPERTIES(c4group PROPERTIES XCODE_ATTRIBUTE_GCC_PFE_FILE_C_DIALECTS "c++0x objective-c++0x") + SET_TARGET_PROPERTIES(clonk PROPERTIES XCODE_ATTRIBUTE_GCC_PFE_FILE_C_DIALECTS "c++0x objective-c++0x") + + set(HAVE_RVALUE_REF ON) + else() + set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42") + endif() endif() ############################################################################ @@ -1255,10 +1333,8 @@ if(WITH_MAPE) endif() if(USE_X11) FINDLIB(X11_LIBRARIES X11) - FINDLIB(XPM_LIBRARIES Xpm) - FINDLIB(XXF86VM_LIBRARIES Xxf86vm) FINDLIB(XRANDR_LIBRARIES Xrandr) - set(OC_CLONK_LIBRARIES ${OC_CLONK_LIBRARIES} ${X11_LIBRARIES} ${XPM_LIBRARIES} ${XXF86VM_LIBRARIES} ${XRANDR_LIBRARIES}) + set(OC_CLONK_LIBRARIES ${OC_CLONK_LIBRARIES} ${X11_LIBRARIES} ${XRANDR_LIBRARIES}) endif() if(USE_COCOA) #stupid fix: just link to iconv that way @@ -1340,6 +1416,14 @@ endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) +# CMake support for MSVC 2010 is broken. Change the .sln file to avoid +# millions of "reload X project?" dialog boxes. +# For best results, also change CMake's ReloadProjects macro to only +# call StopBuild(). +if(MSVC_VERSION EQUAL 1600) + file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}.sln" "\n# reload me\n") +endif() + ############################################################################ # installation ############################################################################ @@ -1353,15 +1437,29 @@ IF(WITH_AUTOMATIC_UPDATE) INSTALL(CODE "MESSAGE(SEND_ERROR \"Installation is only supported for WITH_AUTOMATIC_UPDATE disabled\")") ENDIF() +# hack to build the data on install, see +# http://public.kitware.com/Bug/view.php?id=8438 +add_custom_target(data) +install( + CODE + "execute_process( + COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target data + )" + ) + # TODO: Check for convert at configure step? -install(DIRECTORY DESTINATION share/icons/hicolor/48x48/apps) -install(CODE " -EXECUTE_PROCESS(COMMAND \"convert\" \"${CMAKE_CURRENT_SOURCE_DIR}/src/res/oc.ico[2]\" \"${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/48x48/apps/clonk.png\" RESULT_VARIABLE CONVERT_RESULT) -IF(NOT \${CONVERT_RESULT} EQUAL 0) - MESSAGE(SEND_ERROR \"Creating icon failed\") -ENDIF() -FILE(MAKE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/share/openclonk) -") +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/clonk.png + COMMAND convert "${CMAKE_CURRENT_SOURCE_DIR}/src/res/oc.ico[2]" "${CMAKE_CURRENT_BINARY_DIR}/clonk.png" + MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/src/res/oc.ico + VERBATIM + ) +add_custom_target(icon DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clonk.png) +add_dependencies(data icon) +install( + FILES ${CMAKE_CURRENT_BINARY_DIR}/clonk.png + DESTINATION share/icons/hicolor/48x48/apps + ) set(OC_C4GROUPS Graphics.ocg @@ -1370,7 +1468,9 @@ set(OC_C4GROUPS Sound.ocg System.ocg Objects.ocd - BackToTheRocks.ocf + Arena.ocf + Parkour.ocf + Settlement.ocf Tutorial.ocf ) @@ -1385,15 +1485,20 @@ foreach(group ${OC_C4GROUPS}) DEPENDS c4group ) else() - INSTALL(CODE " - MESSAGE(\"Packing and installing ${group}...\") - EXECUTE_PROCESS(COMMAND \"${CMAKE_CURRENT_BINARY_DIR}/c4group\" \"${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}\" -t \"${CMAKE_INSTALL_PREFIX}/share/openclonk/${group}\" RESULT_VARIABLE PACK_RESULT) - IF(NOT \${PACK_RESULT} EQUAL 0) - MESSAGE(SEND_ERROR \"Packing ${group} failed\") - ENDIF() - ") + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${group} + COMMAND c4group ARGS "${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}" -t "${CMAKE_CURRENT_BINARY_DIR}/${group}" + MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/planet/${group} + DEPENDS c4group + VERBATIM + ) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${group} DESTINATION share/games/openclonk) endif() endforeach() +if (NOT APPLE) + add_custom_target(groups DEPENDS ${OC_C4GROUPS}) + add_dependencies(data groups) +endif() # Install new files install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/clonk.desktop DESTINATION share/applications) @@ -1410,16 +1515,6 @@ find_program(MAKENSIS makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS]) string(REPLACE / \\ C4GROUP_LOCATION ${C4GROUP_LOCATION}) string(REPLACE / \\ CLONK_LOCATION ${CLONK_LOCATION}) -foreach(group ${OC_C4GROUPS}) - add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${group}" - COMMAND c4group ARGS "${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}" -t "${CMAKE_CURRENT_BINARY_DIR}/${group}" - MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/planet/${group} - DEPENDS c4group - VERBATIM - ) -endforeach() - add_custom_command( OUTPUT setup_openclonk.exe COMMAND ${MAKENSIS} -NOCD -DSRCDIR=${CMAKE_CURRENT_SOURCE_DIR} -DPROGRAMFILES=$PROGRAMFILES "-DPRODUCT_NAME=${C4ENGINENAME}${C4VERSIONBUILDNAME}" "-DPRODUCT_COMPANY=${C4PROJECT}" "-DCLONK=${CLONK_LOCATION}" "-DC4GROUP=${C4GROUP_LOCATION}" ${CMAKE_CURRENT_SOURCE_DIR}/tools/install/oc.nsi "-XOutFile setup_openclonk.exe" diff --git a/Credits.txt b/Credits.txt index efe1d9b09..2c09384c7 100644 --- a/Credits.txt +++ b/Credits.txt @@ -1,20 +1,25 @@ - + Armin Burgmeier (Clonk-Karl) Günther Brammer (Günther) -Sven Eberhardt (Sven2) Nicolas Hake (Isilkor) -Peter Wortmann (PeterW) +Sven Eberhardt (Sven2) Martin Plicht (Mortimer) +Peter Wortmann (PeterW) +Julius Michaelis (Caesar) + + +Charles Spurrill (Ringwaul) +Richard Gerum (Randrian) +Timo Stabbert (Mimmo) + + +Maikel de Vries (Maikel) +Bernhard Bonigl (Boni) +Felix Wagner (Clonkonaut) +David Dormagen (Zapper) Tobias Zwick (Newton) - -Charles Spurrill (Ringwaul) -Maikel de Vries (Maikel) -Timo Stabbert (Mimmo) -Richard Gerum (Randrian) -David Dormagen (Zapper) - -Benjamin Herr (Loriel), Julius Michaelis (Caesar), Felix Wagner (Clonkonaut), Manuel Riecke (MrBeast), Benedict Etzel (B_E), Carl-Philip Hänsch (Carli), Alexander Semeniuk (AlteredARMOR), Asmageddon, Florian Graier (Nachtfalter), Merten Ehmig (pluto), Mark Haßelbusch (Marky), Luchs, Peewee, Lauri Niskanen (Ape), Dominik Bayerl (Kanibal), Matthias Rottländer (Matthi), Faby, Checkmaty, TomyLobo, Stan, Gurkenglas, Clonkine, mizipzor, RedWolf Design GmbH and all those who contributed to previous Clonk titles for the passion they put into the game and for agreeing to make Clonk open source. \ No newline at end of file +Benjamin Herr (Loriel), Matthias Rottländer (Matthi), Felix Riese (Fungiform), Manuel Riecke (MrBeast), Benedict Etzel (B_E), Carl-Philip Hänsch (Carli), Alexander Semeniuk (AlteredARMOR), Florian Graier (Nachtfalter), Daniel Theuke (ST-DDT), Asmageddon, Merten Ehmig (Pluto), Mark Haßelbusch (Marky), Luchs, Peewee, Lauri Niskanen (Ape), Dominik Bayerl (Kanibal), Faby, Checkmaty, Gurkenglas, Clonkine, mizipzor, mixi, Pyrit, grgecko, Koronis, RedWolf Design GmbH and all those who contributed to previous Clonk titles for the passion they put into the game and for agreeing to make Clonk open source. \ No newline at end of file diff --git a/Makefile.am b/Makefile.am index c04a28526..95fda6be1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -27,9 +27,9 @@ noinst_LIBRARIES = lib.a if RECENT_GCC WARNING_FLAGS = -Wall -Wextra -Wredundant-decls -Wendif-labels -Wpointer-arith \ -Wcast-qual -Wcast-align -Wwrite-strings -Winit-self -Wsign-promo \ --Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo +-Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual ##-Wmissing-format-attribute -Wdisabled-optimization -Wlogical-op -##-Weffc++ -Wold-style-cast -Woverloaded-virtual -Wunsafe-loop-optimizations +##-Weffc++ -Wold-style-cast -Wunsafe-loop-optimizations else WARNING_FLAGS = -Wall endif @@ -42,34 +42,23 @@ AM_CPPFLAGS = \ -I$(builddir) \ -I$(srcdir)/src \ -I$(srcdir)/src/c4group \ --I$(srcdir)/src/network \ --I$(srcdir)/src/lib \ --I$(srcdir)/src/platform \ -I$(srcdir)/src/config \ --I$(srcdir)/src/res \ -I$(srcdir)/src/control \ --I$(srcdir)/src/gui \ -I$(srcdir)/src/editor \ --I$(srcdir)/src/game/landscape \ --I$(srcdir)/src/game/player \ --I$(srcdir)/src/game/script \ -I$(srcdir)/src/game \ --I$(srcdir)/src/game/object \ --I$(srcdir)/src/lib/texture \ +-I$(srcdir)/src/gamescript \ +-I$(srcdir)/src/graphics \ +-I$(srcdir)/src/gui \ +-I$(srcdir)/src/landscape \ +-I$(srcdir)/src/lib \ +-I$(srcdir)/src/network \ +-I$(srcdir)/src/object \ +-I$(srcdir)/src/platform \ +-I$(srcdir)/src/player \ +-I$(srcdir)/src/res \ -I$(srcdir)/src/script \ -I$(srcdir)/thirdparty \ -$(GLEW_CFLAGS) \ -$(GTK_CFLAGS) \ -$(OPENAL_CFLAGS) \ -$(FREETYPE_CFLAGS) \ -$(SDL_CFLAGS) \ -$(BOOST_CPPFLAGS) \ -$(LIBUPNP_CFLAGS) - -##BUILT_SOURCES = hgrevision.h -##hgrevision.h: $(srcdir)/.hg/dirstate -## $(srcdir)/tools/get_hg_revision.sh > hgrevision.h -##$(srcdir)/.hg/dirstate: +$(BOOST_CPPFLAGS) BUILT_SOURCES = C4Version.h CLEANFILES = @@ -125,8 +114,6 @@ src/c4group/C4Update.cpp \ src/c4group/C4Update.h \ src/c4group/CStdFile.cpp \ src/c4group/CStdFile.h \ -src/config/C4SecurityCertificates.cpp \ -src/config/C4SecurityCertificates.h \ src/lib/C4InputValidation.cpp \ src/lib/C4InputValidation.h \ src/lib/SHA1.h \ @@ -149,18 +136,11 @@ src/platform/StdRegistry.h \ src/platform/StdScheduler.cpp \ src/platform/StdScheduler.h \ src/zlib/gzio.c \ +src/zlib/gzio.h \ src/zlib/zutil.h clonk_SOURCES = \ -src/C4Application.cpp \ -src/C4Application.h \ -src/C4FullScreen.cpp \ -src/C4FullScreen.h \ -src/C4Game.cpp \ -src/C4Game.h \ src/C4Globals.cpp \ -src/C4GraphicsSystem.cpp \ -src/C4GraphicsSystem.h \ src/c4group/C4ComponentHost.cpp \ src/c4group/C4ComponentHost.h \ src/c4group/C4Components.h \ @@ -175,7 +155,6 @@ src/c4group/C4Language.h \ src/C4Include.h \ src/C4Prototypes.h \ src/C4Version.h.in \ -src/C4WinMain.cpp \ src/config/C4Config.cpp \ src/config/C4Config.h \ src/config/C4Constants.h \ @@ -204,102 +183,62 @@ src/editor/C4Console.cpp \ src/editor/C4ConsoleGUICommon.h \ src/editor/C4ConsoleGUI.h \ src/editor/C4Console.h \ -src/editor/C4DevmodeDlg.cpp \ -src/editor/C4DevmodeDlg.h \ src/editor/C4EditCursor.cpp \ src/editor/C4EditCursor.h \ src/editor/C4ObjectListDlg.cpp \ src/editor/C4ObjectListDlg.h \ src/editor/C4ToolsDlg.cpp \ src/editor/C4ToolsDlg.h \ +src/editor/C4ViewportWindow.cpp \ +src/editor/C4ViewportWindow.h \ +src/game/C4Application.cpp \ +src/game/C4Application.h \ +src/game/C4FullScreen.cpp \ +src/game/C4FullScreen.h \ +src/game/C4Game.cpp \ +src/game/C4Game.h \ src/game/C4GameVersion.h \ +src/game/C4GraphicsSystem.cpp \ +src/game/C4GraphicsSystem.h \ src/game/C4Physics.h \ -src/game/landscape/C4Landscape.cpp \ -src/game/landscape/C4Landscape.h \ -src/game/landscape/C4LandscapeRender.cpp \ -src/game/landscape/C4LandscapeRenderClassic.cpp \ -src/game/landscape/C4LandscapeRender.h \ -src/game/landscape/C4Map.cpp \ -src/game/landscape/C4MapCreatorS2.cpp \ -src/game/landscape/C4MapCreatorS2.h \ -src/game/landscape/C4Map.h \ -src/game/landscape/C4MassMover.cpp \ -src/game/landscape/C4MassMover.h \ -src/game/landscape/C4Material.cpp \ -src/game/landscape/C4Material.h \ -src/game/landscape/C4MaterialList.cpp \ -src/game/landscape/C4MaterialList.h \ -src/game/landscape/C4Particles.cpp \ -src/game/landscape/C4Particles.h \ -src/game/landscape/C4PathFinder.cpp \ -src/game/landscape/C4PathFinder.h \ -src/game/landscape/C4PXS.cpp \ -src/game/landscape/C4PXS.h \ -src/game/landscape/C4Region.cpp \ -src/game/landscape/C4Region.h \ -src/game/landscape/C4Scenario.cpp \ -src/game/landscape/C4Scenario.h \ -src/game/landscape/C4Sky.cpp \ -src/game/landscape/C4Sky.h \ -src/game/landscape/C4SolidMask.cpp \ -src/game/landscape/C4SolidMask.h \ -src/game/landscape/C4Texture.cpp \ -src/game/landscape/C4Texture.h \ -src/game/landscape/C4Weather.cpp \ -src/game/landscape/C4Weather.h \ -src/game/object/C4Action.cpp \ -src/game/object/C4Command.cpp \ -src/game/object/C4Command.h \ -src/game/object/C4Def.cpp \ -src/game/object/C4DefGraphics.cpp \ -src/game/object/C4DefGraphics.h \ -src/game/object/C4DefList.cpp \ -src/game/object/C4DefList.h \ -src/game/object/C4Def.h \ -src/game/object/C4GameObjects.cpp \ -src/game/object/C4GameObjects.h \ -src/game/object/C4Id.cpp \ -src/game/object/C4Id.h \ -src/game/object/C4IDList.cpp \ -src/game/object/C4IDList.h \ -src/game/object/C4InfoCore.cpp \ -src/game/object/C4InfoCore.h \ -src/game/object/C4MeshAnimation.cpp \ -src/game/object/C4MeshAnimation.h \ -src/game/object/C4Movement.cpp \ -src/game/object/C4ObjectCom.cpp \ -src/game/object/C4ObjectCom.h \ -src/game/object/C4Object.cpp \ -src/game/object/C4Object.h \ -src/game/object/C4ObjectInfo.cpp \ -src/game/object/C4ObjectInfo.h \ -src/game/object/C4ObjectInfoList.cpp \ -src/game/object/C4ObjectInfoList.h \ -src/game/object/C4ObjectList.cpp \ -src/game/object/C4ObjectList.h \ -src/game/object/C4ObjectMenu.cpp \ -src/game/object/C4ObjectMenu.h \ -src/game/object/C4ObjectScript.cpp \ -src/game/object/C4ObjectPtr.cpp \ -src/game/object/C4ObjectPtr.h \ -src/game/object/C4Sector.cpp \ -src/game/object/C4Sector.h \ -src/game/object/C4Shape.cpp \ -src/game/object/C4Shape.h \ -src/game/player/C4Player.cpp \ -src/game/player/C4Player.h \ -src/game/player/C4PlayerList.cpp \ -src/game/player/C4PlayerList.h \ -src/game/player/C4RankSystem.cpp \ -src/game/player/C4RankSystem.h \ -src/game/script/C4Effect.cpp \ -src/game/script/C4Effects.h \ -src/game/script/C4FindObject.cpp \ -src/game/script/C4FindObject.h \ -src/game/script/C4GameScript.cpp \ -src/game/script/C4Script.h \ -src/game/script/C4TransferZone.cpp \ -src/game/script/C4TransferZone.h \ +src/game/C4Viewport.cpp \ +src/game/C4Viewport.h \ +src/gamescript/C4Effect.cpp \ +src/gamescript/C4Effects.h \ +src/gamescript/C4FindObject.cpp \ +src/gamescript/C4FindObject.h \ +src/gamescript/C4GameScript.cpp \ +src/gamescript/C4Script.h \ +src/gamescript/C4TransferZone.cpp \ +src/gamescript/C4TransferZone.h \ +src/graphics/Bitmap256.cpp \ +src/graphics/Bitmap256.h \ +src/graphics/C4Draw.cpp \ +src/graphics/C4DrawD3D.cpp \ +src/graphics/C4DrawD3D.h \ +src/graphics/C4DrawD3DShader.cpp \ +src/graphics/C4DrawD3DShader.h \ +src/graphics/C4DrawGL.cpp \ +src/graphics/C4DrawGLCtx.cpp \ +src/graphics/C4DrawGL.h \ +src/graphics/C4DrawT.cpp \ +src/graphics/C4DrawT.h \ +src/graphics/C4Draw.h \ +src/graphics/C4Facet.cpp \ +src/graphics/C4FacetEx.cpp \ +src/graphics/C4FacetEx.h \ +src/graphics/C4Facet.h \ +src/graphics/C4FontLoader.cpp \ +src/graphics/C4FontLoader.h \ +src/graphics/C4GraphicsResource.cpp \ +src/graphics/C4GraphicsResource.h \ +src/graphics/C4Surface.cpp \ +src/graphics/C4Surface.h \ +src/graphics/C4SurfaceLoaders.cpp \ +src/graphics/CSurface8.cpp \ +src/graphics/CSurface8.h \ +src/graphics/StdPNG.cpp \ +src/graphics/StdPNG.h \ src/gui/C4ChatDlg.cpp \ src/gui/C4ChatDlg.h \ src/gui/C4DownloadDlg.cpp \ @@ -318,6 +257,8 @@ src/gui/C4GameOptions.cpp \ src/gui/C4GameOptions.h \ src/gui/C4GameOverDlg.cpp \ src/gui/C4GameOverDlg.h \ +src/gui/C4GfxErrorDlg.cpp \ +src/gui/C4GfxErrorDlg.h \ src/gui/C4GuiButton.cpp \ src/gui/C4GuiCheckBox.cpp \ src/gui/C4GuiComboBox.cpp \ @@ -362,13 +303,39 @@ src/gui/C4StartupPlrSelDlg.cpp \ src/gui/C4StartupPlrSelDlg.h \ src/gui/C4StartupScenSelDlg.cpp \ src/gui/C4StartupScenSelDlg.h \ -src/gui/C4UpdateDlg.cpp \ -src/gui/C4UpdateDlg.h \ src/gui/C4UpperBoard.cpp \ src/gui/C4UpperBoard.h \ -src/gui/C4UserMessages.h \ -src/gui/C4Viewport.cpp \ -src/gui/C4Viewport.h \ +src/landscape/C4Landscape.cpp \ +src/landscape/C4Landscape.h \ +src/landscape/C4LandscapeRenderClassic.cpp \ +src/landscape/C4LandscapeRender.cpp \ +src/landscape/C4LandscapeRender.h \ +src/landscape/C4Map.cpp \ +src/landscape/C4MapCreatorS2.cpp \ +src/landscape/C4MapCreatorS2.h \ +src/landscape/C4Map.h \ +src/landscape/C4MassMover.cpp \ +src/landscape/C4MassMover.h \ +src/landscape/C4Material.cpp \ +src/landscape/C4Material.h \ +src/landscape/C4MaterialList.cpp \ +src/landscape/C4MaterialList.h \ +src/landscape/C4Particles.cpp \ +src/landscape/C4Particles.h \ +src/landscape/C4PathFinder.cpp \ +src/landscape/C4PathFinder.h \ +src/landscape/C4PXS.cpp \ +src/landscape/C4PXS.h \ +src/landscape/C4Scenario.cpp \ +src/landscape/C4Scenario.h \ +src/landscape/C4Sky.cpp \ +src/landscape/C4Sky.h \ +src/landscape/C4SolidMask.cpp \ +src/landscape/C4SolidMask.h \ +src/landscape/C4Texture.cpp \ +src/landscape/C4Texture.h \ +src/landscape/C4Weather.cpp \ +src/landscape/C4Weather.h \ src/lib/C4LogBuf.cpp \ src/lib/C4LogBuf.h \ src/lib/C4Log.cpp \ @@ -406,15 +373,6 @@ src/lib/StdMeshMath.h \ src/lib/StdMeshUpdate.cpp \ src/lib/StdMeshUpdate.h \ src/lib/StdResStr.h \ -src/lib/texture/C4Facet.cpp \ -src/lib/texture/C4FacetEx.cpp \ -src/lib/texture/C4FacetEx.h \ -src/lib/texture/C4Facet.h \ -src/lib/texture/C4GraphicsResource.cpp \ -src/lib/texture/C4GraphicsResource.h \ -src/lib/texture/C4SurfaceLoaders.cpp \ -src/lib/texture/StdPNG.cpp \ -src/lib/texture/StdPNG.h \ src/network/C4Client.cpp \ src/network/C4Client.h \ src/network/C4GameControlNetwork.cpp \ @@ -448,12 +406,50 @@ src/network/C4Network2Stats.h \ src/network/C4Network2UPnP.h \ src/network/C4Packet2.cpp \ src/network/C4PacketBase.h \ -src/platform/Bitmap256.cpp \ -src/platform/Bitmap256.h \ +src/object/C4Action.cpp \ +src/object/C4Command.cpp \ +src/object/C4Command.h \ +src/object/C4Def.cpp \ +src/object/C4DefGraphics.cpp \ +src/object/C4DefGraphics.h \ +src/object/C4Def.h \ +src/object/C4DefList.cpp \ +src/object/C4DefList.h \ +src/object/C4GameObjects.cpp \ +src/object/C4GameObjects.h \ +src/object/C4Id.cpp \ +src/object/C4Id.h \ +src/object/C4IDList.cpp \ +src/object/C4IDList.h \ +src/object/C4InfoCore.cpp \ +src/object/C4InfoCore.h \ +src/object/C4MeshAnimation.cpp \ +src/object/C4MeshAnimation.h \ +src/object/C4Movement.cpp \ +src/object/C4ObjectCom.cpp \ +src/object/C4ObjectCom.h \ +src/object/C4Object.cpp \ +src/object/C4Object.h \ +src/object/C4ObjectInfo.cpp \ +src/object/C4ObjectInfo.h \ +src/object/C4ObjectInfoList.cpp \ +src/object/C4ObjectInfoList.h \ +src/object/C4ObjectList.cpp \ +src/object/C4ObjectList.h \ +src/object/C4ObjectMenu.cpp \ +src/object/C4ObjectMenu.h \ +src/object/C4ObjectPtr.cpp \ +src/object/C4ObjectPtr.h \ +src/object/C4ObjectScript.cpp \ +src/object/C4Sector.cpp \ +src/object/C4Sector.h \ +src/object/C4Shape.cpp \ +src/object/C4Shape.h \ +src/platform/C4App.cpp \ +src/platform/C4App.h \ +src/platform/C4AppWin32Impl.h \ src/platform/C4FileMonitor.cpp \ src/platform/C4FileMonitor.h \ -src/platform/C4Fonts.cpp \ -src/platform/C4Fonts.h \ src/platform/C4GamePadCon.cpp \ src/platform/C4GamePadCon.h \ src/platform/C4MusicFile.cpp \ @@ -464,38 +460,23 @@ src/platform/C4SoundLoaders.cpp \ src/platform/C4SoundLoaders.h \ src/platform/C4SoundSystem.cpp \ src/platform/C4SoundSystem.h \ +src/platform/C4StdInProc.cpp \ +src/platform/C4StdInProc.h \ src/platform/C4Video.cpp \ src/platform/C4Video.h \ -src/platform/C4VideoPlayback.cpp \ -src/platform/C4VideoPlayback.h \ -src/platform/C4ViewportWindow.cpp \ -src/platform/C4ViewportWindow.h \ +src/platform/C4Window.h \ src/platform/C4windowswrapper.h \ +src/platform/PlatformAbstraction.cpp \ src/platform/PlatformAbstraction.h \ -src/platform/C4App.h \ -src/platform/C4App.cpp \ -src/platform/StdD3D.cpp \ -src/platform/StdD3D.h \ -src/platform/StdD3DShader.cpp \ -src/platform/StdD3DShader.h \ -src/platform/StdDDraw2.cpp \ -src/platform/StdDDraw2.h \ -src/platform/StdFont.cpp \ -src/platform/StdFont.h \ -src/platform/StdGL.cpp \ -src/platform/StdGLCtx.cpp \ -src/platform/StdGL.h \ -src/platform/StdNoGfx.cpp \ -src/platform/StdNoGfx.h \ -src/platform/C4Surface.cpp \ -src/platform/C4Surface.h \ -src/platform/StdSurface8.cpp \ -src/platform/StdSurface8.h \ src/platform/StdSync.h \ -src/platform/C4AppT.cpp \ src/platform/StdVideo.cpp \ src/platform/StdVideo.h \ -src/platform/C4Window.h \ +src/player/C4Player.cpp \ +src/player/C4Player.h \ +src/player/C4PlayerList.cpp \ +src/player/C4PlayerList.h \ +src/player/C4RankSystem.cpp \ +src/player/C4RankSystem.h \ src/res/Brush.h \ src/res/Cursor.h \ src/res/Dynamic.h \ @@ -517,6 +498,8 @@ src/script/C4AulDebug.h \ src/script/C4AulDefFunc.h \ src/script/C4AulExec.cpp \ src/script/C4AulExec.h \ +src/script/C4AulFunc.cpp \ +src/script/C4AulFunc.h \ src/script/C4Aul.h \ src/script/C4AulLink.cpp \ src/script/C4AulParse.cpp \ @@ -533,52 +516,82 @@ src/script/C4Value.cpp \ src/script/C4Value.h \ src/script/C4ValueMap.cpp \ src/script/C4ValueMap.h \ +thirdparty/timsort/sort.h \ thirdparty/tinyxml/tinystr.cpp \ thirdparty/tinyxml/tinystr.h \ thirdparty/tinyxml/tinyxml.cpp \ -thirdparty/tinyxml/tinyxml.h \ thirdparty/tinyxml/tinyxmlerror.cpp \ +thirdparty/tinyxml/tinyxml.h \ thirdparty/tinyxml/tinyxmlparser.cpp if WIN32 clonk_SOURCES += \ -src/editor/C4ConsoleWin32.cpp \ src/platform/C4CrashHandlerWin32.cpp \ src/res/engine.rc \ -src/res/resource.h \ +src/res/resource.h +endif + +if MACOSX +clonk_SOURCES += \ +src/platform/C4AppDelegate.h \ +src/platform/C4AppDelegate.mm \ +src/platform/C4FileMonitorMac.mm +else +clonk_SOURCES += \ +src/game/ClonkMain.cpp +endif + +if SDL_MAIN_LOOP +clonk_SOURCES += \ +src/platform/C4AppSDL.cpp \ +src/platform/C4WindowSDL.cpp +else +if GTK +clonk_SOURCES += \ +src/editor/C4ConsoleGTK.cpp \ +src/editor/C4ConsoleGTKDlg.cpp \ +src/editor/C4ConsoleGTKDlg.h \ +src/platform/C4AppGTK.cpp \ +src/platform/C4AppGTKImpl.h \ +src/platform/C4WindowGTK.cpp +else +if CONSOLE +clonk_SOURCES += \ +src/platform/C4AppT.cpp +else +if WIN32 +clonk_SOURCES += \ +src/editor/C4ConsoleWin32.cpp \ +src/platform/C4WindowWin32.cpp \ src/platform/StdJoystick.cpp \ src/platform/StdJoystick.h endif if MACOSX clonk_SOURCES += \ -src/platform/C4AppMac.mm \ -src/platform/C4FileMonitorMac.mm \ -src/platform/C4WindowMac.mm \ -src/platform/ClonkAppDelegate.h \ -src/platform/ClonkAppDelegate.mm \ -src/platform/ConsoleWindowController.h \ -src/platform/ConsoleWindowController.mm \ -src/platform/ClonkWindowController.h \ -src/platform/ClonkWindowController.mm \ -src/platform/ClonkOpenGLView.h \ -src/platform/ClonkOpenGLView.mm \ -src/platform/CocoaKeycodeMap.h \ src/editor/C4ConsoleCocoa.mm \ -src/platform/ClonkMainMenuActions.h \ -src/platform/ClonkMainMenuActions.mm -endif -if SDL_MAIN_LOOP -clonk_SOURCES += src/platform/C4AppSDL.cpp src/platform/C4WindowSDL.cpp -else -if WIN32 -clonk_SOURCES += src/platform/C4WindowWin32.cpp -else -clonk_SOURCES += src/platform/C4AppX.cpp src/platform/C4WindowX.cpp src/platform/C4AppXImpl.h +src/editor/C4EditorWindowController.h \ +src/editor/C4EditorWindowController.mm \ +src/graphics/C4DrawGLMac.h \ +src/graphics/C4DrawGLMac.mm \ +src/platform/C4AppDelegate+MainMenuActions.h \ +src/platform/C4AppDelegate+MainMenuActions.mm \ +src/platform/C4AppMac.mm \ +src/platform/C4WindowController.h \ +src/platform/C4WindowController.mm \ +src/platform/C4WindowMac.mm \ +src/platform/CocoaKeycodeMap.h \ +src/platform/ObjectiveCAssociated.h endif endif -if DEVELOPER_MODE -clonk_SOURCES += src/platform/C4WindowGTK.cpp src/platform/C4WindowGTK.h src/editor/C4ConsoleGTK.cpp endif +endif + +if AUTOUPDATE +clonk_SOURCES += \ +src/gui/C4UpdateDlg.cpp \ +src/gui/C4UpdateDlg.h +endif + if LIBUPNP clonk_SOURCES += src/network/C4Network2UPnPLinux.cpp else @@ -589,8 +602,18 @@ clonk_SOURCES += src/network/C4Network2UPnPDummy.cpp endif endif +clonk_CPPFLAGS = \ +$(AM_CPPFLAGS) \ +$(GLEW_CFLAGS) \ +$(GTK_CFLAGS) \ +$(OPENAL_CFLAGS) \ +$(FREETYPE_CFLAGS) \ +$(SDL_CFLAGS) \ +$(LIBUPNP_CFLAGS) + clonk_LDADD = \ lib.a \ + $(LDADD) \ $(LIBICONV) \ $(GTK_LIBS) \ $(OPENAL_LIBS) \ @@ -605,29 +628,9 @@ clonk_LDADD = \ .rc.o: $(WINDRES) -I $(srcdir)/src/res -I $(builddir) -i $< -o $@ -c4group_CPPFLAGS = \ - -I$(builddir) \ - -I$(srcdir)/src \ - -I$(srcdir)/src/c4group \ - -I$(srcdir)/src/network \ - -I$(srcdir)/src/lib \ - -I$(srcdir)/src/platform \ - -I$(srcdir)/src/config \ - -I$(srcdir)/src/res \ - -I$(srcdir)/src/control \ - -I$(srcdir)/src/gui \ - -I$(srcdir)/src/editor \ - -I$(srcdir)/src/game/landscape \ - -I$(srcdir)/src/game/player \ - -I$(srcdir)/src/game/script \ - -I$(srcdir)/src/game \ - -I$(srcdir)/src/game/object \ - -I$(srcdir)/src/lib/texture \ - -I$(srcdir)/src/script - c4group_SOURCES = \ src/lib/C4SimpleLog.cpp \ -src/c4group/c4group_ng.cpp +src/c4group/C4GroupMain.cpp if WIN32 c4group_SOURCES += src/c4group/Resource.rc @@ -635,6 +638,7 @@ endif c4group_LDADD = \ lib.a \ + $(LDADD) \ $(LIBICONV) \ $(Z_LIBS) \ $(PTHREAD_LIBS) @@ -647,6 +651,7 @@ src/c4group/gunzip4c4group.cpp gunzip4c4group_LDADD = \ lib.a \ + $(LDADD) \ $(Z_LIBS) \ $(PTHREAD_LIBS) @@ -658,10 +663,11 @@ src/netpuncher/main.cpp puncher_LDADD = \ lib.a \ + $(LDADD) \ $(PTHREAD_LIBS) if WIN32 -puncher_LDADD += -lwinmm -lws2_32 +puncher_LDADD += -lws2_32 endif ## tstc4netio @@ -672,30 +678,34 @@ src/netio/TstC4NetIO.cpp tstc4netio_LDADD = \ lib.a \ + $(LDADD) \ $(Z_LIBS) \ $(PTHREAD_LIBS) if WIN32 -tstc4netio_LDADD += -lwinmm -lws2_32 +tstc4netio_LDADD += -lws2_32 endif ## c4script shell c4script_SOURCES = \ +include/c4script/c4script.h \ src/lib/C4SimpleLog.cpp \ src/lib/C4Real.cpp \ src/lib/C4Random.cpp \ -src/script/shell.cpp \ src/script/C4Aul.cpp \ src/script/C4AulExec.cpp \ +src/script/C4AulFunc.cpp \ src/script/C4AulLink.cpp \ src/script/C4AulParse.cpp \ src/script/C4StringTable.cpp \ src/script/C4PropList.cpp \ src/script/C4ScriptHost.cpp \ +src/script/C4ScriptMain.cpp \ +src/script/C4ScriptStandalone.cpp \ src/script/C4ValueArray.cpp \ src/script/C4Value.cpp \ src/script/C4ValueMap.cpp \ -src/game/object/C4Id.cpp \ +src/object/C4Id.cpp \ src/script/C4Script.cpp \ src/c4group/C4GroupSet.cpp \ src/c4group/C4ComponentHost.cpp \ @@ -703,6 +713,7 @@ src/c4group/C4LangStringTable.cpp c4script_LDADD = \ lib.a \ + $(LDADD) \ $(Z_LIBS) if WIN32 @@ -720,7 +731,9 @@ c4groups = \ Sound.ocg \ System.ocg \ Objects.ocd \ - BackToTheRocks.ocf \ + Arena.ocf \ + Parkour.ocf \ + Settlement.ocf \ Tutorial.ocf CLEANFILES += $(c4groups) diff --git a/README.mac.txt b/README.mac.txt index 0ddc2e9d9..0df4ebce3 100644 --- a/README.mac.txt +++ b/README.mac.txt @@ -32,3 +32,16 @@ Additional CMake hints FREETYPE_LIBRARY should be set to /usr/X11/lib/libfreetype.6.dylib ZLIB_LIBRARY to /usr/lib/libz.dylib ZLIB_INCLUDE_DIR to /usr/include + +Situation with Xcode 4.3+ +======================== + +[This applies only to CMake versions prior to 2.8-8, later versions should deal with Xcode 4.3+ just fine] +Xcode is now a self-contained application bundle which confuses CMake. +The CMake git repo contains necessary fixes but those haven't been incorporated into a new CMake release yet so to use those you have to build the cmake command line tool yourself by + * cloning git://cmake.org/cmake.git + * running git checkout next + * running ./configure, make and sudo make install +The project generation command I (Mortimer) used was `cmake -G Xcode -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++`, obviously specifying clang as the compiler. There is a related CMake option called USE_APPLE_CLANG which should be ON by default. +After that I had a proper Xcode 4.3 project. +To use the CMake GUI for setting some library paths I put the self-built cmake command from /usr/local/bin into CMake 2.8-7.app/Contents/bin/ but one could have probably done that by editing CMakeCache.txt or setting via however the cli syntax for setting variables is. diff --git a/Version.txt b/Version.txt index e1bce26bd..bed80390f 100644 --- a/Version.txt +++ b/Version.txt @@ -7,6 +7,29 @@ SET(C4PROJECT "OpenClonk Project") SET(C4PROJECT_DOMAIN "openclonk") SET(C4PROJECT_TLD "org") SET(C4PROJECT_URL "http://${C4PROJECT_DOMAIN}.${C4PROJECT_TLD}") +SET(C4ENGINENAME "OpenClonk") +SET(C4ENGINENICK "openclonk") +SET(C4ENGINEID "${C4PROJECT_TLD}.${C4PROJECT_DOMAIN}.${C4ENGINENICK}") + +SET(C4XVER1 5) +SET(C4XVER2 3) +SET(C4XVER3 90) + +# C4VERSIONBUILDNAME should be witty and somewhat frequently changing +# for alpha and beta releases, and meaningful and stable for stable releases. +# Both variables need to start with a space if they aren't empty. +SET(C4VERSIONBUILDNAME " Beyond the Rocks") +SET(C4VERSIONEXTRA " Delta") + +############################################################################ +# Get revision from Git +############################################################################ +include(GitGetChangesetID) +git_get_changeset_id(C4REVISION) + +############################################################################ +# Get year +############################################################################ IF(CMAKE_HOST_UNIX) EXECUTE_PROCESS(COMMAND "date" "+%Y" OUTPUT_VARIABLE DATE) @@ -16,69 +39,36 @@ ENDIF() STRING(REGEX REPLACE "(.+)\n" "\\1" YEARFIXED "${DATE}") SET(C4COPYRIGHT_YEAR ${YEARFIXED}) -SET(C4ENGINENAME "OpenClonk") -SET(C4ENGINENICK "openclonk") -SET(C4ENGINECAPTION ${C4ENGINENAME}) -SET(C4ENGINEID "${C4PROJECT_TLD}.${C4PROJECT_DOMAIN}.${C4ENGINENICK}") - -SET(C4XVER1 5) -SET(C4XVER2 2) -SET(C4XVER3 90) -SET(C4XVER4 20) - -# C4VERSIONBUILDNAME should be witty and somewhat frequently changing -# for alpha and beta releases, and meaningful and stable for stable releases. -# Both variables need to start with a space if they aren't empty. -SET(C4VERSIONBUILDNAME " Beyond the Rocks") -SET(C4VERSIONEXTRA " Alpha") - -############################################################################ -# Get revision from Mercurial -############################################################################ -if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg_archival.txt") - # Archives generated by hg archive - file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/.hg_archival.txt" C4REVISION - LIMIT_COUNT 1 - REGEX "node: [0-9a-f]+" - ) - string(SUBSTRING "${C4REVISION}" 6 12 C4REVISION) -else() - # Working copies - execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} - COMMAND "hg" "id" "--id" - OUTPUT_VARIABLE C4REVISION - OUTPUT_STRIP_TRAILING_WHITESPACE) -endif() - ############################################################################ # Build version strings ############################################################################ -set(C4ENGINEINFO "${C4ENGINENAME}") -set(C4SHORTVERSION "${C4XVER1}.${C4XVER2}.${C4XVER3}.${C4XVER4}") -set(C4VERSION "${C4SHORTVERSION}") +SET(C4ENGINECAPTION "${C4ENGINENAME}{$C4VERSIONBUILDNAME}") +set(C4ENGINEINFO "${C4ENGINENAME}") -if(C4XVERBUILD LESS 10) - set(C4VERSION "${C4VERSION} [00${C4XVERBUILD}]") +set(C4VERSION "${C4XVER1}.${C4XVER2}.${C4XVER3}") + +if(C4XVER4 LESS 10) + set(C4VERSION "${C4VERSION} [00${C4XVER4}]") elseif(C4XVERBUILD LESS 100) - set(C4VERSION "${C4VERSION} [0${C4XVERBUILD}]") + set(C4VERSION "${C4VERSION} [0${C4XVER4}]") else() - set(C4VERSION "${C4VERSION} [${C4XVERBUILD}]") + set(C4VERSION "${C4VERSION} [${C4XVER4}]") endif() if(NOT ${C4VERSIONEXTRA} STREQUAL "") - set(C4ENGINEINFO "${C4ENGINENAME} ${C4VERSIONEXTRA}") - set(C4VERSION "${C4VERSION} ${C4VERSIONEXTRA}") + set(C4ENGINEINFO "${C4ENGINENAME} ${C4VERSIONEXTRA}") + set(C4VERSION "${C4VERSION} ${C4VERSIONEXTRA}") endif() if(WIN32) - set(C4VERSION "${C4VERSION} win") + set(C4VERSION "${C4VERSION} win") elseif(APPLE) - set(C4VERSION "${C4VERSION} mac") + set(C4VERSION "${C4VERSION} mac") elseif(UNIX) - set(C4VERSION "${C4VERSION} unix") + set(C4VERSION "${C4VERSION} unix") else() - set(C4VERSION "${C4VERSION} strange") + set(C4VERSION "${C4VERSION} strange") endif() configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/C4Version.h.in ${CMAKE_CURRENT_BINARY_DIR}/C4Version.h ESCAPE_QUOTES) diff --git a/autotools/sdl.m4 b/autotools/sdl.m4 index a7f1a4927..639eb8517 100644 --- a/autotools/sdl.m4 +++ b/autotools/sdl.m4 @@ -5,11 +5,13 @@ # stolen from Manish Singh # Shamelessly stolen from Owen Taylor +# serial 1 + dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS dnl AC_DEFUN([AM_PATH_SDL], -[dnl +[dnl dnl Get the cflags and libraries from the sdl-config script dnl AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], @@ -20,34 +22,36 @@ AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run , enable_sdltest=yes) if test x$sdl_exec_prefix != x ; then - sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" + sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix" if test x${SDL_CONFIG+set} != xset ; then SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config fi fi if test x$sdl_prefix != x ; then - sdl_args="$sdl_args --prefix=$sdl_prefix" + sdl_config_args="$sdl_config_args --prefix=$sdl_prefix" if test x${SDL_CONFIG+set} != xset ; then SDL_CONFIG=$sdl_prefix/bin/sdl-config fi fi + as_save_PATH="$PATH" if test "x$prefix" != xNONE; then PATH="$prefix/bin:$prefix/usr/bin:$PATH" fi AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH]) + PATH="$as_save_PATH" min_sdl_version=ifelse([$1], ,0.11.0,$1) AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) no_sdl="" if test "$SDL_CONFIG" = "no" ; then no_sdl=yes else - SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` - SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` + SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags` + SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs` - sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ + sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ + sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` @@ -73,7 +77,7 @@ char* my_strdup (char *str) { char *new_str; - + if (str) { new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); @@ -81,7 +85,7 @@ my_strdup (char *str) } else new_str = NULL; - + return new_str; } @@ -128,7 +132,7 @@ int main (int argc, char *argv[]) fi if test "x$no_sdl" = x ; then AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) + ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$SDL_CONFIG" = "no" ; then diff --git a/cmake/FindUpnp.cmake b/cmake/FindUpnp.cmake index f8615a0b8..facf56922 100644 --- a/cmake/FindUpnp.cmake +++ b/cmake/FindUpnp.cmake @@ -24,15 +24,17 @@ find_path(UPNP_INCLUDE_DIR NAMES upnp.h PATH_SUFFIXES upnp) set(UPNP_NAMES ${UPNP_NAMES} upnp) +set(THREADUTIL_NAMES ${THREADUTIL_NAMES} threadutil) set(IXML_NAMES ${IXML_NAMES} ixml) find_library(UPNP_LIBRARY NAMES ${UPNP_NAMES}) +find_library(THREADUTIL_LIBRARY NAMES ${THREADUTIL_NAMES}) find_library(IXML_LIBRARY NAMES ${IXML_NAMES}) include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(UPNP DEFAULT_MSG UPNP_LIBRARY IXML_LIBRARY UPNP_INCLUDE_DIR) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(UPNP DEFAULT_MSG UPNP_LIBRARY THREADUTIL_LIBRARY IXML_LIBRARY UPNP_INCLUDE_DIR) if(UPNP_FOUND) - set(UPNP_LIBRARIES ${UPNP_LIBRARY} ${IXML_LIBRARY}) + set(UPNP_LIBRARIES ${UPNP_LIBRARY} ${THREADUTIL_LIBRARY} ${IXML_LIBRARY}) set(UPNP_INCLUDE_DIR ${UPNP_INCLUDE_DIR}) endif() diff --git a/cmake/GccPchSupport.cmake b/cmake/GccPchSupport.cmake index 47a6f2dfe..8f9c665fc 100644 --- a/cmake/GccPchSupport.cmake +++ b/cmake/GccPchSupport.cmake @@ -1,22 +1,15 @@ #Copied from http://www.mail-archive.com/cmake@cmake.org/msg04394.html which copied it from the rosengarden project #see also: http://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/Precompiled-Headers.html -MACRO(ADD_PRECOMPILED_HEADER _targetName _input ) +MACRO(ADD_PRECOMPILED_HEADER _targetName _input) # Prepare environment - if(CMAKE_BUILD_TYPE) - SET(_proper_build_type ${CMAKE_BUILD_TYPE}) - else() - SET(_proper_build_type Standard) - endif() GET_FILENAME_COMPONENT(_name ${_input} NAME) - SET(_pchdir "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/pch.custom.dir") + SET(_pchdir "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_targetName}_pch.dir") + MAKE_DIRECTORY(${_pchdir}) SET(_source "${CMAKE_CURRENT_SOURCE_DIR}/${_input}") - SET(_outdir "${_pchdir}/${_name}.gch") - MAKE_DIRECTORY(${_outdir}) - string(REPLACE "/" "_" _inputescaped ${_input}) - SET(_output "${_outdir}/${_inputescaped}_${_targetName}_${_proper_build_type}.o") - #FILE(WRITE "${_pchdir}/${_name}" "\#error Precompiled header not used") + SET(_includeput "${_pchdir}/${_name}") + SET(_output "${_includeput}.gch") # Assemble the compiler command with which future stuff will be built STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name) # Don't worry: CMake won't use any of the R/D/RWDI/MSR vars if the build type is not defined @@ -75,9 +68,9 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _input ) ${_compiler_FLAGS} -x c++-header -o ${_output} ${_source} IMPLICIT_DEPENDS CXX ${_source} ) + FILE(WRITE "${_pchdir}/${_name}" "#ifdef __cplusplus\n#warning Precompiled header not used. Turn off or fix!\n#endif") # This file is added so the cc-units don't stumble over not being able to include the file ADD_CUSTOM_TARGET(${_targetName}_pch DEPENDS ${_output}) ADD_DEPENDENCIES(${_targetName} ${_targetName}_pch) - INCLUDE_DIRECTORIES(BEFORE ${_pchdir}) - #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Winvalid-pch" CACHE STRING "C++ compiler flags" FORCE) + SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "-include ${_includeput}") ENDMACRO(ADD_PRECOMPILED_HEADER) diff --git a/cmake/GitGetChangesetID.cmake b/cmake/GitGetChangesetID.cmake new file mode 100644 index 000000000..35ac882d6 --- /dev/null +++ b/cmake/GitGetChangesetID.cmake @@ -0,0 +1,39 @@ +function(git_get_changeset_id VAR) + find_package(Git QUIET) + if (GIT_FOUND) + execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND "${GIT_EXECUTABLE}" "rev-parse" "HEAD" + RESULT_VARIABLE GIT_RESULT + OUTPUT_VARIABLE C4REVISION + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET) + + if(GIT_RESULT EQUAL 0) + string(SUBSTRING "${C4REVISION}" 0 12 C4REVISION) + execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND "${GIT_EXECUTABLE}" "status" "--porcelain" + OUTPUT_VARIABLE GIT_STATUS + ) + string(REGEX MATCH "^[MADRC ][MD ]" WORKDIR_DIRTY "${GIT_STATUS}") + endif() + endif() + if (NOT C4REVISION) + # Git not found or not a git workdir + file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/.git_archival" C4REVISION + LIMIT_COUNT 1 + REGEX "node: [0-9a-f]+" + ) + string(LENGTH "${C4REVISION}" revlength) + if(revlength LESS 18) + set(C4REVISION "unknown") + message(WARNING "Could not retrieve git revision. Please set GIT_EXECUTABLE!") + else() + string(SUBSTRING "${C4REVISION}" 6 12 C4REVISION) + endif() + unset(revlength) + endif() + if(WORKDIR_DIRTY) + set(C4REVISION "${C4REVISION}+") + endif() + set(${VAR} "${C4REVISION}" PARENT_SCOPE) +endfunction() diff --git a/config.h.cmake b/config.h.cmake index d6c4d98b2..9a86e1e0a 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -1,12 +1,18 @@ /* Activate DebugRecs */ #cmakedefine DEBUGREC 1 +/* Generate minidumps on crash */ +#cmakedefine HAVE_DBGHELP 1 + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_DIRECT_H 1 -/* Define to 1 if you have the header file. */ +/* The backtrace function is declared in execinfo.h and works */ #cmakedefine HAVE_EXECINFO_H 1 +/* Whether FMOD shall be used */ +#cmakedefine HAVE_FMOD 1 + /* Define to 1 if you have FreeType2. */ #cmakedefine HAVE_FREETYPE 1 @@ -31,20 +37,14 @@ /* Define to 1 if you have SDL_mixer. */ #cmakedefine HAVE_LIBSDL_MIXER 1 -/* Define to 1 if FMOD is available */ -#cmakedefine HAVE_FMOD 1 - -/* Use OpenAL for playing sounds */ -#cmakedefine USE_OPEN_AL 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LOCALE_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_MEMORY_H 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_MULTIMON_H 1 +/* Define to 1 if you have support for nullptr. */ +#cmakedefine HAVE_NULLPTR 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_POLL_H 1 @@ -64,6 +64,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_READLINE_READLINE_H 1 +/* C++ Compiler has rvalue references, a C++0x feature. */ +#cmakedefine HAVE_RVALUE_REF 1 + /* Define to 1 if you have SDL. */ #cmakedefine HAVE_SDL 1 @@ -73,6 +76,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SIGNAL_H 1 +/* Define to 1 if your compiler supports static_assert */ +#cmakedefine HAVE_STATIC_ASSERT 1 + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDINT_H 1 @@ -85,15 +91,15 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRING_H 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_INOTIFY_H 1 - /* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_EVENTFD_H +#cmakedefine HAVE_SYS_EVENTFD_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_FILE_H 1 +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SYS_INOTIFY_H 1 + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_SOCKET_H 1 @@ -114,18 +120,12 @@ #cmakedefine HAVE_VFW32 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_X11_EXTENSIONS_XF86VMODE_H 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_X11_EXTENSIONS_XRANDR_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_X11_KEYSYM_H 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_X11_XPM_H 1 - /* Define as const if the declaration of iconv() needs const. */ #cmakedefine ICONV_CONST @@ -169,44 +169,32 @@ /* MP3 music */ #cmakedefine USE_MP3 1 +/* OpenAL sound */ +#cmakedefine USE_OPEN_AL 1 + /* Define to 1 if SDL is used for the main loop */ #cmakedefine USE_SDL_MAINLOOP 1 /* Define to 1 if the X Window System is used */ #cmakedefine USE_X11 1 +/* Enable automatic update system */ +#cmakedefine WITH_AUTOMATIC_UPDATE 1 + /* Developer mode */ #cmakedefine WITH_DEVELOPER_MODE 1 /* Glib */ #cmakedefine WITH_GLIB 1 -/* Use GTK+3 for the developer mode */ -#cmakedefine WITH_GTK3 1 - -/* Enable the automatic update system */ -#cmakedefine WITH_AUTOMATIC_UPDATE 1 - /* Define to 1 if the X Window System is missing or not being used. */ #cmakedefine X_DISPLAY_MISSING 1 /* compile with debug options */ -#cmakedefine _DEBUG - -/* Define to 1 if rvalue references are supported */ -#cmakedefine HAVE_RVALUE_REF 1 +#cmakedefine _DEBUG 1 /* Define to 1 if you have support for precompiled headers */ #cmakedefine HAVE_PRECOMPILED_HEADERS 1 -/* Define to 1 if you have support for nullptr. */ -#cmakedefine HAVE_NULLPTR 1 - /* Use Apple Cocoa for the UI */ #cmakedefine USE_COCOA 1 - -/* Define to 1 if your compiler supports static_assert */ -#cmakedefine HAVE_STATIC_ASSERT 1 - -/* Generate minidumps on crash */ -#cmakedefine HAVE_DBGHELP 1 diff --git a/config.h.in b/config.h.in index 756b02b66..af5f9de3d 100644 --- a/config.h.in +++ b/config.h.in @@ -6,6 +6,12 @@ /* define if the Boost library is available */ #undef HAVE_BOOST +/* Generate minidumps on crash */ +#undef HAVE_DBGHELP + +/* Define to 1 if you have the header file. */ +#undef HAVE_DBGHELP_H + /* Define to 1 if you have the header file. */ #undef HAVE_DIRECT_H @@ -42,12 +48,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H -/* Define to 1 if you have the header file. */ -#undef HAVE_MULTIMON_H - /* Define to 1 if you have the header file. */ #undef HAVE_NATUPNP_H +/* Define to 1 if you have support for nullptr. */ +#undef HAVE_NULLPTR + /* Define to 1 if you have the header file. */ #undef HAVE_POLL_H @@ -81,6 +87,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SIGNAL_H +/* Define to 1 if your compiler supports static_assert */ +#undef HAVE_STATIC_ASSERT + /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H @@ -123,18 +132,12 @@ /* */ #undef HAVE_VFW32 -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XF86VMODE_H - /* Define to 1 if you have the header file. */ #undef HAVE_X11_EXTENSIONS_XRANDR_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_KEYSYM_H -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_XPM_H - /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST @@ -175,9 +178,6 @@ /* DirectX graphics */ #undef USE_DIRECTX -/* Whether FMOD shall be used */ -#undef USE_FMOD - /* OpenGL graphics */ #undef USE_GL diff --git a/configure.ac b/configure.ac index deb9e1ea8..58a84fef2 100644 --- a/configure.ac +++ b/configure.ac @@ -20,11 +20,13 @@ dnl Process this file with autoconf to produce a configure script. # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_PREREQ([2.67]) -AC_INIT([clonk], [5]) +AC_INIT([clonk], [m4_esyscmd([sed -n 's/SET(C4XVER1\s\+\(.\+\))/\1/ p' Version.txt | tr -d '\n' | tr -d '\r' + ]).m4_esyscmd([sed -n 's/SET(C4XVER2\s\+\(.\+\))/\1/ p' Version.txt | tr -d '\n' | tr -d '\r' + ]).m4_esyscmd([sed -n 's/SET(C4XVER3\s\+\(.\+\))/\1/ p' Version.txt | tr -d '\n' | tr -d '\r'])]) AC_COPYRIGHT([©2005-2011 Günther Brammer]) -AC_CONFIG_SRCDIR([/src/C4Game.cpp]) +AC_CONFIG_SRCDIR([/src/C4Include.h]) AC_CONFIG_AUX_DIR([autotools]) -AC_CONFIG_HEADER([config.h]) +AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile]) AC_CANONICAL_HOST dnl foreign to tell automake to shut up, @@ -36,20 +38,39 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) AC_PROG_CXX AC_LANG([C++]) AX_CHECK_COMPILE_FLAG([-std=gnu++0x], [CXX="${CXX} -std=gnu++0x"], []) -AC_COMPILE_IFELSE([ -void f(struct D&&); int main() { return 0; } -], [AC_DEFINE([HAVE_RVALUE_REF], [], [C++ Compiler has rvalue references, a C++0x feature.])], [AX_PROG_CXX_REFTOTEMP]) + +AC_MSG_CHECKING([for rvalue references]) +AC_COMPILE_IFELSE([void f(struct D&&); int main() { return 0; }], [ + AC_DEFINE([HAVE_RVALUE_REF], [], [C++ Compiler has rvalue references, a C++0x feature.]) + AC_MSG_RESULT([yes]) + ], [ + AC_MSG_RESULT([no]) + AX_PROG_CXX_REFTOTEMP + ]) + +AC_MSG_CHECKING([for nullptr]) +AC_COMPILE_IFELSE([int main() { void *d = nullptr; }], [ + AC_DEFINE([HAVE_NULLPTR], [], [Define to 1 if you have support for nullptr.]) + AC_MSG_RESULT([yes]) + ], [AC_MSG_RESULT([no])]) + +AC_MSG_CHECKING([for static_assert]) +AC_COMPILE_IFELSE([int main() { static_assert(true, \"\"); }], [ + AC_DEFINE([HAVE_STATIC_ASSERT], [], [Define to 1 if your compiler supports static_assert]) + AC_MSG_RESULT([yes]) + ], [AC_MSG_RESULT([no])]) + AC_PROG_CC AM_PROG_CC_C_O AC_PROG_RANLIB +# Automake 1.12 breaks if this isn't run unconditionally +AC_PROG_OBJCXX case $host in *-*-mingw32* | *-*-cygwin* | *-*-windows*) win32=true; osx=false;; *-*-darwin*) - win32=false; osx=true; - m4_ifdef([AC_PROG_OBJCXX], [AC_PROG_OBJCXX], [AC_MSG_ERROR([this configure script was created with an autoconf version older than 2.65 and does not support macosx.])]) - ;; + win32=false; osx=true;; *) win32=false; osx=false;; esac @@ -63,8 +84,7 @@ AM_CONDITIONAL(MACOSX, [test $osx = true]) # various used headers dnl the whitespace is there to prevent AC_INCLUDES_DEFAULT AC_CHECK_HEADERS([stdint.h unistd.h poll.h sys/file.h sys/stat.h sys/types.h locale.h sys/socket.h signal.h langinfo.h sys/eventfd.h sys/timerfd.h sys/inotify.h], , , [[ ]]) -# Mingw does not ship with multimon.h -AC_CHECK_HEADERS([multimon.h io.h direct.h share.h natupnp.h], [], [], [[#include ]]) +AC_CHECK_HEADERS([io.h direct.h share.h natupnp.h dbghelp.h], [], [], [[#include ]]) # iconv AX_ICONV # vasprintf is a GNU extension @@ -106,7 +126,7 @@ AC_ARG_ENABLE([console], AC_ARG_ENABLE([sound], [AS_HELP_STRING([--enable-sound],[compile with sound support [default=yes]])], - , [if test $enable_console = yes; then enable_sound=no; else if test $win32 = true; then enable_sound=no; else enable_sound=yes; fi; fi]) + , [if test $enable_console = yes; then enable_sound=no; else enable_sound=yes; fi]) # GTK+ GTK2_REQUIRED="glib-2.0 >= 2.8 gtk+-2.0 >= 2.8" @@ -139,14 +159,14 @@ AS_IF([test $with_gtk != no],[ AC_DEFINE([WITH_GLIB], 1, [Glib]) AC_DEFINE([WITH_DEVELOPER_MODE], 1, [Developer mode]) ]) -AM_CONDITIONAL(DEVELOPER_MODE, [test $with_gtk != no]) +AM_CONDITIONAL(GTK, [test $with_gtk != no]) # OpenAL AC_ARG_WITH([openal], [AS_HELP_STRING([--with-openal],[compile with openal support [default=no]])], , [with_openal=no]) if test $with_openal = yes; then - PKG_CHECK_MODULES(OPENAL, [vorbis vorbisfile openal]) + PKG_CHECK_MODULES(OPENAL, [vorbis vorbisfile openal freealut]) AC_DEFINE([USE_OPEN_AL], 1, [OpenAL sound]) if test $enable_sound = no; then AC_MSG_ERROR([--with-openal cannot be used with --disable-sound.]) @@ -207,6 +227,7 @@ else enable_sdlmainloop=no VL_LIB_READLINE fi +AM_CONDITIONAL([CONSOLE], [test $enable_console = yes]) # Check for boost AX_BOOST_BASE([1.40.0], [], [ @@ -234,33 +255,36 @@ AC_CHECK_LIB(z, deflate, [ AC_MSG_ERROR([libz not found.]) ]) +# Check for librt +AC_CHECK_LIB(rt, clock_gettime, [ + LDADD="-lrt $LDADD" +], []) + # Check for libfreetype if test $enable_console = no; then - if test "$cross_compiling" = no; then - AC_CHECK_PROG(FREETYPE_CONFIG, freetype-config, freetype-config) - fi - if test $FREETYPE_CONFIG; then - AC_SUBST(FREETYPE_CFLAGS, [`$FREETYPE_CONFIG --cflags`]) - AC_SUBST(FREETYPE_LIBS, [`$FREETYPE_CONFIG --libs`]) - else - PKG_CHECK_MODULES(FREETYPE, freetype2) - fi + PKG_CHECK_MODULES(FREETYPE, freetype2, ,[ + if test "$cross_compiling" = no; then + AC_CHECK_PROG(FREETYPE_CONFIG, freetype-config, freetype-config) + fi + if test $FREETYPE_CONFIG; then + AC_SUBST(FREETYPE_CFLAGS, [`$FREETYPE_CONFIG --cflags`]) + AC_SUBST(FREETYPE_LIBS, [`$FREETYPE_CONFIG --libs`]) + else + AC_MSG_ERROR([Freetype not found.]) + fi + ]) AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if you have FreeType2.]) fi -# X11, Xpm, Xrandr +# X11, Xrandr AC_PATH_XTRA if test $have_x = yes; then AC_DEFINE(USE_X11, 1, [Define to 1 if the X Window System is used]) CLONK_LIBS="$X_LIBS $CLONK_LIBS" - AC_CHECK_HEADERS([X11/keysym.h X11/extensions/xf86vmode.h X11/xpm.h X11/extensions/Xrandr.h], , + AC_CHECK_HEADERS([X11/keysym.h X11/extensions/Xrandr.h], , [AC_MSG_ERROR([A required X11 header was not found.])], [[#include ]]) AC_CHECK_LIB(X11, XOpenDisplay, [CLONK_LIBS="-lX11 $CLONK_LIBS"], [AC_MSG_ERROR([libX11 not found.])], [$X_LIBS]) - AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [CLONK_LIBS="-lXpm $CLONK_LIBS"], - [AC_MSG_ERROR([libXpm not found.])], [$X_LIBS]) - AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, [CLONK_LIBS="-lXxf86vm $CLONK_LIBS"], - [AC_MSG_ERROR([XF86VidMode not found.])], [$X_LIBS]) AC_CHECK_LIB(Xrandr, XRRQueryExtension, [CLONK_LIBS="-lXrandr $CLONK_LIBS"], [AC_MSG_ERROR([libXrandr not found.])], [$X_LIBS]) fi @@ -272,8 +296,7 @@ AC_ARG_WITH([gl], if test $with_gl = yes; then if test $osx = true; then CLONK_LIBS="-framework OpenGL $CLONK_LIBS" - AC_CHECK_LIB(GLEW, glewInit, [CLONK_LIBS="-lGLEW $CLONK_LIBS"], - [AC_MSG_ERROR([glew not found.])]) + PKG_CHECK_MODULES(GLEW, [glew], [CLONK_LIBS="$GLEW_LIBS $CLONK_LIBS"], [AC_MSG_ERROR([glew not found.])]) elif test $win32 = true; then AC_CHECK_LIB(opengl32, main, [CLONK_LIBS="-lopengl32 $CLONK_LIBS"], [AC_MSG_ERROR([opengl32 not found.])]) @@ -317,46 +340,49 @@ AS_IF([test $with_upnp = yes], [ AM_CONDITIONAL(LIBUPNP, [test "$have_libupnp" = yes]) # Automatic Update -AC_ARG_WITH([automatic-update], - [AS_HELP_STRING([--with-automatic-update],[enable support for automatic engine updates [default=yes]])], - , [with_automatic_update="yes"]) -if test "$with_automatic_update" = "yes"; then +AC_ARG_ENABLE([autoupdate], + [AS_HELP_STRING([--disable-autoupdate],[support for automatic engine updates [default=yes]])], + , [enable_autoupdate="yes"]) +AS_IF([test "$enable_autoupdate" = yes], [ AC_DEFINE([WITH_AUTOMATIC_UPDATE], 1, [Enable automatic update system]) -fi +]) +AM_CONDITIONAL(AUTOUPDATE, [test "$enable_autoupdate" = yes]) if test $win32 = false; then # pthread AX_PTHREAD( , [AC_MSG_ERROR([No pthread support.])]) AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) - - # FMod is used for windows only - AM_CONDITIONAL(USE_FMOD, false) else # Windows - for WIN32LIB in gdi32 comdlg32 winmm ws2_32 + for WIN32LIB in gdi32 comdlg32 ws2_32 do AC_CHECK_LIB([$WIN32LIB], main, [CLONK_LIBS="-l$WIN32LIB $CLONK_LIBS"], [AC_MSG_ERROR([$WIN32LIB not found.])]) done + AC_CHECK_LIB([winmm], main, [LDADD="-lwinmm $LDADD"], [AC_MSG_ERROR([winmm not found.])]) + AC_CHECK_LIB([vfw32], main, [ CLONK_LIBS="-lvfw32 $CLONK_LIBS" AC_DEFINE([HAVE_VFW32], 1, [ ]) ], []) - # FMod (Library comes with standard) - if test "$enable_sound" = yes; then - AC_DEFINE([USE_FMOD], 1, [Whether FMOD shall be used]) - fi - AM_CONDITIONAL(USE_FMOD, test "$enable_sound" = yes) + AC_CHECK_LIB([dbghelp], main, [AS_IF([test "x$ac_cv_header_dbghelp_h" = xyes], [ + CLONK_LIBS="-ldbghelp $CLONK_LIBS" + AC_DEFINE([HAVE_DBGHELP], 1, [Generate minidumps on crash]) + ])], []) # windres AC_CHECK_TOOL(WINDRES, windres, no) if test $WINDRES = no; then AC_MSG_ERROR([windres not found.]) fi + + # ASLR/DEP + LDADD="-Wl,--nxcompat -Wl,--dynamicbase $LDADD" fi +AC_SUBST(LDADD) AC_SUBST(CLONK_LIBS) AC_SUBST(Z_LIBS) @@ -374,17 +400,20 @@ AM_CONDITIONAL(RECENT_GCC, [test $RECENT_GCC = yes]) AC_OUTPUT echo "Configuration: + CFLAGS: $CFLAGS + CXXFLAGS: $CXXFLAGS Debug: $enable_debug Debugrec: $enable_debugrec Pure console: $enable_console + Autoupdate: $enable_autoupdate DirectX: $with_directx OpenGL: $with_gl + Nat/LibUPnP: $ac_cv_header_natupnp_h/$have_libupnp Sound: $enable_sound SDL_Mixer: $with_sdl_mixer OpenAL: $with_openal GTK+: $with_gtk - X11: $have_x - Nat/LibUPnP: $ac_cv_header_natupnp_h/$have_libupnp" + X11: $have_x" if test "$enable_sdlmainloop" = yes; then echo " SDL: mainloop"; else echo " SDL: $with_sdl"; fi diff --git a/docs/Makefile b/docs/Makefile index 514ef1719..3d5ff679e 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -20,13 +20,13 @@ stylesheet = clonk.xsl # find all directories neither beginning nor contained within a directory beginning with a dot sdk-dirs := $(shell find sdk -name '.*' -prune -o -type d -print) +# find all *.xml files recursively in sdk/ +xmlfiles := $(sort $(shell find sdk -name '.*' -prune -o -name 'content.xml' -prune -o -name \*.xml -print)) + # misc extra-files := $(sort $(wildcard *.css *.php *.js images/*.*)) extra-files-chm := $(sort $(wildcard *.css *.js images/*.*)) -# find all *.xml files recursively in sdk/ -xmlfiles := $(sort $(shell find sdk -name '.*' -prune -o -name 'content.xml' -prune -o -name \*.xml -print)) - # Targets: # strip from all files the .xml, and add a .html @@ -36,8 +36,8 @@ htmlfiles := $(addsuffix .html, $(basename $(xmlfiles))) sdk-de-dirs := $(subst sdk, sdk-de, $(sdk-dirs)) # For openclonk.org -online-sdk-files := $(foreach lang, en de, $(addprefix online/$(lang)/, $(htmlfiles) sdk/content.html)) online-dirs := $(foreach lang, en de, $(addprefix online/$(lang)/, $(sdk-dirs) images)) +online-sdk-files := $(foreach lang, en de, $(addprefix online/$(lang)/, $(htmlfiles) sdk/content.html)) online-extra-files := $(foreach lang, en de, $(addprefix online/$(lang)/, $(extra-files))) # For Entwickler.chm @@ -45,21 +45,21 @@ chm-dirs := $(foreach lang, en de, $(addprefix chm/$(lang)/, . $(sdk-dirs) image .PHONY: all online-en chm install check clean -all: $(online-dirs) $(sdk-de-dirs) $(online-extra-files) $(online-sdk-files) +all: $(sdk-de-dirs) $(online-dirs) $(online-sdk-files) $(online-extra-files) online-en: $(addprefix online/en/, $(sdk-dirs) images $(htmlfiles) sdk/content.html $(extra-files)) -chm: $(chm-dirs) $(sdk-de-dirs) chm/en/Developer.chm chm/de/Entwickler.chm +chm: $(sdk-de-dirs) $(chm-dirs) chm/en/Developer.chm chm/de/Entwickler.chm install: all $(MKDIR_P) $(prefix) - $(CP_R) $(PWD)/online/* $(prefix) + $(CP_R) online/* $(prefix) check: xmllint --noblanks --noout --valid $(xmlfiles) clean: - rm -f *.mo Entwickler.chm Developer.chm doku.pot + rm -f *.mo Entwickler.chm Developer.chm doku.pot sdk/content.xml rm -rf online sdk-de chm sdk/content.xml: sdk/content.xml.in $(xmlfiles) build_contents.py experimental.py diff --git a/docs/clonk.xsl b/docs/clonk.xsl index 7b09d5e2d..178f61a4f 100644 --- a/docs/clonk.xsl +++ b/docs/clonk.xsl @@ -14,9 +14,6 @@ doku.css - - -