Merge remote-tracking branch 'new/master' into mape
Conflicts: CMakeLists.txt src/graphics/C4Draw.hscancodes-fix
|
@ -0,0 +1 @@
|
|||
node: $Format:%H$
|
|
@ -0,0 +1,3 @@
|
|||
.git_archival export-subst
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
|
@ -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
|
645
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"
|
||||
|
|
27
Credits.txt
|
@ -1,20 +1,25 @@
|
|||
<Engine Development>
|
||||
<Engine and Tools>
|
||||
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)
|
||||
|
||||
<Art and Content>
|
||||
Charles Spurrill (Ringwaul)
|
||||
Richard Gerum (Randrian)
|
||||
Timo Stabbert (Mimmo)
|
||||
|
||||
<Scripting and Content>
|
||||
Maikel de Vries (Maikel)
|
||||
Bernhard Bonigl (Boni)
|
||||
Felix Wagner (Clonkonaut)
|
||||
David Dormagen (Zapper)
|
||||
|
||||
<Coordination, Administration>
|
||||
Tobias Zwick (Newton)
|
||||
|
||||
<Content, Art and Scripting>
|
||||
Charles Spurrill (Ringwaul)
|
||||
Maikel de Vries (Maikel)
|
||||
Timo Stabbert (Mimmo)
|
||||
Richard Gerum (Randrian)
|
||||
David Dormagen (Zapper)
|
||||
|
||||
<Thanks to Contributors>
|
||||
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.
|
||||
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.
|
451
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)
|
||||
|
|
|
@ -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.
|
||||
|
|
84
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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()
|
|
@ -1,12 +1,18 @@
|
|||
/* Activate DebugRecs */
|
||||
#cmakedefine DEBUGREC 1
|
||||
|
||||
/* Generate minidumps on crash */
|
||||
#cmakedefine HAVE_DBGHELP 1
|
||||
|
||||
/* Define to 1 if you have the <direct.h> header file. */
|
||||
#cmakedefine HAVE_DIRECT_H 1
|
||||
|
||||
/* Define to 1 if you have the <execinfo.h> 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 <locale.h> header file. */
|
||||
#cmakedefine HAVE_LOCALE_H 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#cmakedefine HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the <multimon.h> 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 <poll.h> header file. */
|
||||
#cmakedefine HAVE_POLL_H 1
|
||||
|
@ -64,6 +64,9 @@
|
|||
/* Define to 1 if you have the <readline/readline.h> 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 <signal.h> 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 <stdint.h> header file. */
|
||||
#cmakedefine HAVE_STDINT_H 1
|
||||
|
||||
|
@ -85,15 +91,15 @@
|
|||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#cmakedefine HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/inotify.h> header file. */
|
||||
#cmakedefine HAVE_SYS_INOTIFY_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/eventfd.h> header file. */
|
||||
#cmakedefine HAVE_SYS_EVENTFD_H
|
||||
#cmakedefine HAVE_SYS_EVENTFD_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/file.h> header file. */
|
||||
#cmakedefine HAVE_SYS_FILE_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/inotify.h> header file. */
|
||||
#cmakedefine HAVE_SYS_INOTIFY_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#cmakedefine HAVE_SYS_SOCKET_H 1
|
||||
|
||||
|
@ -114,18 +120,12 @@
|
|||
|
||||
#cmakedefine HAVE_VFW32
|
||||
|
||||
/* Define to 1 if you have the <X11/extensions/xf86vmode.h> header file. */
|
||||
#cmakedefine HAVE_X11_EXTENSIONS_XF86VMODE_H 1
|
||||
|
||||
/* Define to 1 if you have the <X11/extensions/Xrandr.h> header file. */
|
||||
#cmakedefine HAVE_X11_EXTENSIONS_XRANDR_H 1
|
||||
|
||||
/* Define to 1 if you have the <X11/keysym.h> header file. */
|
||||
#cmakedefine HAVE_X11_KEYSYM_H 1
|
||||
|
||||
/* Define to 1 if you have the <X11/xpm.h> 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
|
||||
|
|
24
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 <dbghelp.h> header file. */
|
||||
#undef HAVE_DBGHELP_H
|
||||
|
||||
/* Define to 1 if you have the <direct.h> header file. */
|
||||
#undef HAVE_DIRECT_H
|
||||
|
||||
|
@ -42,12 +48,12 @@
|
|||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the <multimon.h> header file. */
|
||||
#undef HAVE_MULTIMON_H
|
||||
|
||||
/* Define to 1 if you have the <natupnp.h> 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 <poll.h> header file. */
|
||||
#undef HAVE_POLL_H
|
||||
|
||||
|
@ -81,6 +87,9 @@
|
|||
/* Define to 1 if you have the <signal.h> 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 <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
|
@ -123,18 +132,12 @@
|
|||
/* */
|
||||
#undef HAVE_VFW32
|
||||
|
||||
/* Define to 1 if you have the <X11/extensions/xf86vmode.h> header file. */
|
||||
#undef HAVE_X11_EXTENSIONS_XF86VMODE_H
|
||||
|
||||
/* Define to 1 if you have the <X11/extensions/Xrandr.h> header file. */
|
||||
#undef HAVE_X11_EXTENSIONS_XRANDR_H
|
||||
|
||||
/* Define to 1 if you have the <X11/keysym.h> header file. */
|
||||
#undef HAVE_X11_KEYSYM_H
|
||||
|
||||
/* Define to 1 if you have the <X11/xpm.h> 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
|
||||
|
||||
|
|
123
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 <windows.h>]])
|
||||
AC_CHECK_HEADERS([io.h direct.h share.h natupnp.h dbghelp.h], [], [], [[#include <windows.h>]])
|
||||
# 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 <X11/Xlib.h>]])
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -14,9 +14,6 @@
|
|||
<link rel="stylesheet">
|
||||
<xsl:attribute name="href"><xsl:value-of select="$relpath" />doku.css</xsl:attribute>
|
||||
</link>
|
||||
<xsl:if test="not($chm)">
|
||||
<link rel="stylesheet" href="http://www.openclonk.org/header/header.css" />
|
||||
</xsl:if>
|
||||
<xsl:if test="descendant::table[bitmask]">
|
||||
<script>
|
||||
<xsl:attribute name="src"><xsl:value-of select="$relpath" />bitmasks.js</xsl:attribute>
|
||||
|
@ -517,7 +514,7 @@
|
|||
<xsl:template name="color2">
|
||||
<xsl:param name="s" select="." />
|
||||
<!-- the list of keywords -->
|
||||
<xsl:param name="t" select="'#include|#appendto|public|private|protected|global|static|var|local|const|int|proplist|object|array|string|bool|any|return|if|else|break|continue|while|for|func|true|false|nil|'" />
|
||||
<xsl:param name="t" select="'#include|#appendto|public|private|protected|global|static|var|local|const|any|int|bool|def|effect|object|proplist|string|array|func|return|if|else|break|continue|while|for|true|false|nil|'" />
|
||||
<xsl:param name="w" select="substring-before($t, '|')" />
|
||||
<!-- text before the keyword -->
|
||||
<xsl:variable name="l" select="substring-before($s, $w)" />
|
||||
|
|
21418
docs/de.po
|
@ -74,6 +74,7 @@ color:#222222;
|
|||
}
|
||||
|
||||
h1 {
|
||||
font-family: Endeavour, Verdana, Sans-serif;
|
||||
font-size: 2em;
|
||||
font-weight: normal;
|
||||
margin-top: 1.32em;
|
||||
|
|
|
@ -3,37 +3,23 @@ Unfortunately, xml documents can only have one root, so there needs to be a dumm
|
|||
header is an appropiate html element, so it's arbitrarily chosen.
|
||||
clonk.xsl also uses it to match the processing for it. -->
|
||||
<header>
|
||||
<!-- header -->
|
||||
<style type="text/css">@import url("http://www.openclonk.org/header/header.css");</style>
|
||||
<div id="nav_header">
|
||||
|
||||
<!-- logo -->
|
||||
<div id="nav_logo">
|
||||
<a href="http://wiki.openclonk.org/"><img src="http://www.openclonk.org/header/logo.png" alt="OpenClonk"/></a>
|
||||
<a href="http://www.openclonk.org/" target="_top"><img src="http://www.openclonk.org/header/logo.png" alt="OpenClonk"/></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Navigation Menu -->
|
||||
<div id="nav_navigation">
|
||||
|
||||
<!-- search -->
|
||||
<div id="nav_search">
|
||||
|
||||
<form action="http://www.openclonk.org/header/search.php" id="searchform" method="get"><div>
|
||||
<form action="http://www.openclonk.org/header/search.php" id="searchform" method="get" target="_top"><div>
|
||||
search <input id="searchInput" name="s" type="text" value="" /> in the
|
||||
<select name="p">
|
||||
|
||||
<option value="blog">blog</option>
|
||||
<option selected="selected" value="functions">c4script function list</option>
|
||||
<option value="docs">c4script reference</option>
|
||||
<option value="functionsDE">c4script function list (DE)</option>
|
||||
<option value="docsDE">c4script reference (DE)</option>
|
||||
<option selected="selected" value="docs">c4script documentation</option>
|
||||
<option value="bugtrack">bugtracker</option>
|
||||
<option value="forum">forum</option>
|
||||
<option value="hg">hg changelog</option>
|
||||
|
||||
<option value="hg-resources">hg resources changelog</option>
|
||||
<option value="git">repository</option>
|
||||
<option value="git-resources">resources repository</option>
|
||||
<option value="wiki">website</option>
|
||||
</select>
|
||||
<input type='submit' class="nav_searchButton" id="searchButton" value="Go" title="Search" />
|
||||
|
@ -52,31 +38,29 @@ clonk.xsl also uses it to match the processing for it. -->
|
|||
</div>
|
||||
|
||||
<ul>
|
||||
<li><!--[if lt IE 9]><span><![endif]--><a href="http://www.openclonk.org/">Home</a><!--[if lt IE 9]></span><![endif]--> <ul>
|
||||
|
||||
<li><a href="http://wiki.openclonk.org/w/FAQ">FAQ</a></li>
|
||||
<li><a href="http://wiki.openclonk.org/w/About">About</a></li>
|
||||
<li><a class="current" href="http://www.openclonk.org/" target="_top">Home</a> <ul>
|
||||
<li><a href="http://wiki.openclonk.org/w/FAQ" target="_top">FAQ</a></li>
|
||||
<li><a href="http://wiki.openclonk.org/w/About" target="_top">About</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><!--[if lt IE 9]><span><![endif]--><a href="http://www.openclonk.org/download/">Download</a><!--[if lt IE 9]></span><![endif]--> <ul>
|
||||
<li><a href="http://www.openclonk.org/download/">Latest Release</a></li>
|
||||
<li><a href="http://www.openclonk.org/nightly-builds">Nightly builds</a></li>
|
||||
<li><!--[if lt IE 9]><span><![endif]--><a href="http://www.openclonk.org/download/" target="_top">Download</a><!--[if lt IE 9]></span><![endif]--> <ul>
|
||||
<li><a href="http://www.openclonk.org/download/" target="_top">Latest Release</a></li>
|
||||
<li><a href="http://www.openclonk.org/nightly-builds" target="_top">Development Snapshot</a></li>
|
||||
<li><a href="http://www.openclonk.org/builds/release/" target="_top">Archive</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><!--[if lt IE 9]><span><![endif]--><a href="http://forum.openclonk.org/">Forum</a><!--[if lt IE 9]></span><![endif]--></li>
|
||||
<li><!--[if lt IE 9]><span><![endif]--><a href="http://wiki.openclonk.org/w/Development">Development</a><!--[if lt IE 9]></span><![endif]--> <ul>
|
||||
<li><a href="http://bugs.openclonk.org">Bugtracker</a></li>
|
||||
|
||||
<li><a href="http://hg.openclonk.org/openclonk/">Repository</a></li>
|
||||
<li><a href="http://hg.openclonk.org/openclonk-resources/">Resource Repository</a></li>
|
||||
<li><!--[if lt IE 9]><span><![endif]--><a href="http://forum.openclonk.org/" target="_top">Forum</a><!--[if lt IE 9]></span><![endif]--></li>
|
||||
<li><!--[if lt IE 9]><span><![endif]--><a href="http://wiki.openclonk.org/w/Development" target="_top">Development</a><!--[if lt IE 9]></span><![endif]--> <ul>
|
||||
<li><a href="http://bugs.openclonk.org" target="_top">Bugtracker</a></li>
|
||||
<li><a href="http://git.openclonk.org/openclonk.git" target="_top">Repository</a></li>
|
||||
<li><a href="http://git.openclonk.org/openclonk-resources.git" target="_top">Resource Repository</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="current" href="http://wiki.openclonk.org/w/C4Script_Documentation">Documentation</a> <ul>
|
||||
<li><a href="http://docs.openclonk.org/en/sdk/">C4Script reference</a></li>
|
||||
|
||||
<li><!--[if lt IE 9]><span><![endif]--><a class="current" href="http://wiki.openclonk.org/w/C4Script_Documentation" target="_top">Documentation</a><!--[if lt IE 9]></span><![endif]--> <ul>
|
||||
<li><a href="http://docs.openclonk.org/en/sdk/" target="_top">C4Script Reference</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><!--[if lt IE 9]><span><![endif]--><a href="http://blog.openclonk.org/">Blog</a><!--[if lt IE 9]></span><![endif]--></li>
|
||||
<li><!--[if lt IE 9]><span><![endif]--><a href="http://blog.openclonk.org/" target="_top">Blog</a><!--[if lt IE 9]></span><![endif]--></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE doc
|
||||
SYSTEM '../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
|
||||
|
@ -71,9 +71,24 @@
|
|||
<col>Attachment to surfaces: <emlink href="definition/cnat.html">CNAT Value</emlink>, e.g. value 8 if the object should attach to the floor like a walking clonk does; or 4 for attachment to the ceiling like a hangling clonk. Only evaluated if the procedure is NONE.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Facet</literal_col>
|
||||
<col>6 integers</col>
|
||||
<col>Animation graphics: Target rectangle from Graphics.png relative to upper left corner of unrotated object shape.</col>
|
||||
<literal_col>X</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Animation graphics: X coordinate from Graphics.png.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Y</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Animation graphics: Y coordinate from Graphics.png.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Wdt</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Width of the animation graphic from Graphics.png.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Hgt</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Height of the animation graphic from Graphics.png.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>FacetBase</literal_col>
|
||||
|
|
|
@ -40,6 +40,10 @@
|
|||
<col><funclink>Anim_Y</funclink></col>
|
||||
<col>Linear with Y position. When the object moves upwards the animation plays backwards. Can be used if the animation of an object should be synchronized to its vertical movement.</col>
|
||||
</row>
|
||||
<row>
|
||||
<col><funclink>Anim_R</funclink></col>
|
||||
<col>Linear with rotation. When the object rotates counter-clockwise the animation plays backwards. Can be used if the animation of an object should be synchronized to its rotation.</col>
|
||||
</row>
|
||||
<row>
|
||||
<col><funclink>Anim_AbsX</funclink></col>
|
||||
<col>Linear with X position. However, the animation is always played in the same direction, not taking into account whether the object moves left or right.</col>
|
||||
|
|
|
@ -40,16 +40,6 @@
|
|||
<col>Integer</col>
|
||||
<col>Maximal allowed count when placed in the menu system.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>TimerCall</literal_col>
|
||||
<col>String (max. 30 chars)</col>
|
||||
<col>Regularly called timer function in the <emlink href="definition/script.html">object script</emlink>.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Timer</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Time interval between TimerCalls in frames. Default is 35.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>ContactCalls</literal_col>
|
||||
<col>Integer</col>
|
||||
|
@ -140,31 +130,11 @@
|
|||
<col>Integer</col>
|
||||
<col>Flame distance to the object's bottom line.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Placement</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Placement: 0 land surface, 1 in liquid, 2 in mid-air, 3 underground, 4 land surface and underground.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Exclusive</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>0 or 1. Determines whether the object blocks objects behind it.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>ContactIncinerate</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Probability of incineration by contact: 0 none, or 1 (high) to 5 (low).</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>BlastIncinerate</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Incineration by explosion: 0 none, otherwise the damage level of incineration.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>BurnTo</literal_col>
|
||||
<col>C4ID</col>
|
||||
<col>Definition change upon incineration.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Base</literal_col>
|
||||
<col>Integer</col>
|
||||
|
@ -270,11 +240,6 @@
|
|||
<col>Integer</col>
|
||||
<col>0 no basement, 1 normal basement, other values reserved.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>NoBurnDecay</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>0 or 1. If 1, the object does not decompose if burning.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>IncompleteActivity</literal_col>
|
||||
<col>Integer</col>
|
||||
|
@ -330,21 +295,11 @@
|
|||
<col>Integer</col>
|
||||
<col>0 or 1. Can be used to prevent failure messages caused by failed commands.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>NoBurnDamage</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>0 or 1. If 1, the object does not take damage when burning.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>TemporaryCrew</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>0 or 1. If 1, the object is not stored in the permanent crew of a player.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>SmokeRate</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>0 to 200: determines the amount of smoke caused by the burning object. 0 for no smoke, 100 is default. If other than 0, the object will always generate maximum smoke when traveling at high velocity (e.g. a fire arrow).</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>BlitMode</literal_col>
|
||||
<col>Integer</col>
|
||||
|
|
|
@ -129,6 +129,31 @@ Stand = {
|
|||
<col><code>Plane</code></col>
|
||||
<col>int</col>
|
||||
<col>The Object's minor Z-Position. Negative values are behind the landscape, positive values before it. Use 1-399 for stuff behind Clonks, 401-999 for stuff before Clonks, and 1000+ for GUI objects.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Placement</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Placement: 0 land surface, 1 in liquid, 2 in mid-air, 3 underground, 4 land surface and underground.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>BlastIncinerate</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Incineration by explosion: 0 none, otherwise the damage level of incineration.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>BurnTo</literal_col>
|
||||
<col>C4ID</col>
|
||||
<col>Definition change upon incineration.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>NoBurnDecay</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>0 or 1. If 1, the object does not decompose if burning.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>ContactIncinerate</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Probability of incineration by contact: 0 none, or 1 (high) to 5 (low).</col>
|
||||
</row>
|
||||
</table>
|
||||
</text>
|
||||
|
|
|
@ -15,34 +15,15 @@
|
|||
}
|
||||
</code>
|
||||
<text>An object with this script will be given a rock right after it has been created. The Initialize function is called only when the object has reached full size (a building only when its construction has been completed and a living being only when it is fully grown).</text>
|
||||
<h>TimerCall</h>
|
||||
<text>Each object definition can define a timer call in its <emlink href="definition/defcore.html">DefCore</emlink>. The TimerCall is a function which will be called at regular intervals. The DefCore entry Timer determines the rate of calls. If no rate is specifed, the default value is 35 frames (roughly once per second).</text>
|
||||
<h>ActMap</h>
|
||||
<text>An active object can also define activity script calls in its <emlink href="definition/actmap.html">ActMap</emlink>. The defined StartCall is made whenever an action begins (or repeats), an EndCall is made at the end of each activity. PhaseCall is called at each animation phase step and should only be used for very short animations. The call frequency of PhaseCalls is determined by the speed of the animation.</text>
|
||||
<h>#include</h>
|
||||
<text>An object script can also include the functionality of another script.</text>
|
||||
<code>#include Clonk</code>
|
||||
<text>At this position the complete script of the specified object definition (that of the clonk, in this case) is inserted. Obviously, the included definition must be valid and loaded. Declared functions can be overloaded by functions of the same name that occur later in the script. Also see <funclink>inherited</funclink>().</text>
|
||||
<h id="Zugangsberechtigung">Access Control</h>
|
||||
<text>
|
||||
You can specify an access declaration for functions in object scripts:
|
||||
<table>
|
||||
<row>
|
||||
<col>public</col>
|
||||
<col>may be called by the object itself, by the engine, or by other objects</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>protected</col>
|
||||
<col>may only be called by the object itself or by the engine</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>private</col>
|
||||
<col>may only be called by the object itself</col>
|
||||
</row>
|
||||
</table>
|
||||
A special case: the callbacks TimerCall, StartCall, PhaseCall, and EndCall will work even if the function called was declared private (for downwards compatibility reasons) but the functions for all other engine calls (see below) must be declared protected or public.
|
||||
</text>
|
||||
<text>Functions with no special declaration are public. If you are unsure or don't care, leave your functions public.</text>
|
||||
<text>At this position the complete script of the specified object definition (that of the clonk, in this case) is inserted, including all scripts that that script includes or got via <emlink href="script/AppendTo.html">#appendto</emlink>. The only exception is that every script is included only once, so including both the Clonk script and a script that is included by the Clonk script doesn't include that script twice. Other Obviously, the included definition must be valid and loaded. Declared functions can be overloaded by functions of the same name that occur later in the script. Also see <funclink>inherited</funclink>().</text>
|
||||
<h>Interaction from other scripts</h>
|
||||
<text>Other scripts can call functions of an object <code>obj</code> with the <code>-></code> and <code>->~</code> operators.</text>
|
||||
<code>var obj = CreateObject(Flint); obj->Hit();</code>
|
||||
<h id="ObjektCallsderEngine">Object calls made by the engine</h>
|
||||
<text>
|
||||
The engine calls the following functions is objects at the given time.
|
||||
|
@ -104,8 +85,8 @@
|
|||
</row>
|
||||
<row id="Damage">
|
||||
<literal_col>Damage</literal_col>
|
||||
<col>int change, int by_player</col>
|
||||
<col>When the object is damage.</col>
|
||||
<col>int change, int cause, int by_player</col>
|
||||
<col>When the object is damaged. See <emlink href="script/Effects.html#damagecause">Fx*Damage</emlink>for <code>cause</code> values.</col>
|
||||
</row>
|
||||
<row id="DeepBreath">
|
||||
<literal_col>DeepBreath</literal_col>
|
||||
|
@ -272,6 +253,11 @@
|
|||
<col>object obj</col>
|
||||
<col>When the object has collected another object (obj) (in all cases, even in script controlled collection or entering).</col>
|
||||
</row>
|
||||
<row id="ContentsDestruction">
|
||||
<literal_col>ContentsDestruction</literal_col>
|
||||
<col>object destroyed</col>
|
||||
<col>When an object contained in the object has been destroyed/removed. The object still exists when the callback is called, but will be destroyed afterwards.</col>
|
||||
</row>
|
||||
<row id="Departure">
|
||||
<literal_col>Departure</literal_col>
|
||||
<col>object container</col>
|
||||
|
|
|
@ -8,12 +8,11 @@
|
|||
<part>
|
||||
<text>The engine allows to define control commands completely arbitrarily. Own keyboard commands can be added and modified. All supported input devices such as mouse, keyboard and gamepads can be mapped freely and commands can consist of any key combinations or sequences.</text>
|
||||
<h id="ControlFiles">PlayerControls.txt</h>
|
||||
<text>All control commands which a player can send to the game are defined in the file PlayerControls.txt. The standard keys as well as their standard mapping for various input devices are contained in the global definition file in the Systems.ocg folder. Object definitions and scenarios can add more keys or overload the parameters of existing commands in their local Systems.ocg folder**.</text>
|
||||
<text>Additional PlayerControls.txt files can be put in language packages to adapt the standard key mappings of different loaded languages to the keyboard of their respective country**.</text>
|
||||
<text>All control commands which a player can send to the game are defined in the file PlayerControls.txt. The standard keys as well as their standard mapping for various input devices are contained in the global definition file in the Systems.ocg folder. Object definitions and scenarios can add more keys or overload the parameters of existing commands in their local Systems.ocg folder.</text>
|
||||
<part>
|
||||
<h id="ControlDefs">Section [ControlDefs]</h>
|
||||
<text>
|
||||
Definition of possible player commands. Not valid in language packages. Subordinated to this section:
|
||||
Definition of possible player commands. Subordinated to this section:
|
||||
<text>
|
||||
<table>
|
||||
<caption id="ControlDef">Any number of sections [ControlDef]</caption>
|
||||
|
@ -35,7 +34,7 @@
|
|||
<row>
|
||||
<literal_col>GUIDesc</literal_col>
|
||||
<col>String</col>
|
||||
<col>Informative description which is displayed to the player in the control configuration dialog. Lokalisierte Zeichenketten koennen aus dem zugehoerigen StringTable refeenziert werden ($Name$).</col>
|
||||
<col>Informative description which is displayed to the player in the control configuration dialog. Localized strings from the corresponding string table can be used ($Desc$).</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Global</literal_col>
|
||||
|
@ -91,6 +90,14 @@
|
|||
<literal_col>Script</literal_col>
|
||||
<col>Execution of the script function <em>PlayerControl</em>. See <emlink href="playercontrols.xml#Script">Script callbacks</emlink>. (Default value)</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>ZoomIn</literal_col>
|
||||
<col>Zoom in one unit</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>ZoomOut</literal_col>
|
||||
<col>Zoom out one unit</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Menu</literal_col>
|
||||
<col>Open the player menu (asynchronous command).</col>
|
||||
|
@ -107,6 +114,18 @@
|
|||
<literal_col>MenuLeft / MenuUp / MenuRight / MenuDown</literal_col>
|
||||
<col>Navigation in the player menu (asynchronous command).</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>ObjectMenuOK / ObjectMenuSelect / ObjectMenuOKAll</literal_col>
|
||||
<col>Confirmation of the selected item in a menu (synchronous command).</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>ObjectMenuCancel</literal_col>
|
||||
<col>Close a menu (synchronous command).</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>ObjectMenuLeft / ObjectMenuUp / ObjectMenuRight / ObjectMenuDown</literal_col>
|
||||
<col>Navigation in a menu (synchronous command).</col>
|
||||
</row>
|
||||
</table>
|
||||
</text>
|
||||
|
||||
|
@ -130,7 +149,27 @@
|
|||
<row>
|
||||
<literal_col>Name</literal_col>
|
||||
<col>String</col>
|
||||
<col>Internal name for identification of otherwise equal control mappings. The names of the standard mappings are <em>Keyboard1</em>, <em>Keyboard1Classic</em>, <em>Keyboard2</em>, <em>Keyboard2Classic</em>, <em>Gamepad</em>. By using placeholders (*) keys can directly be defined in multiple mappings**.</col>
|
||||
<col>Internal name for identification of otherwise equal control mappings. By using placeholders (*) keys can directly be defined in multiple mappings.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>GUIName</literal_col>
|
||||
<col>String</col>
|
||||
<col>Name for the control assignment set which is shown to the player in the control configuration dialog.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Keyboard</literal_col>
|
||||
<col>Boolean</col>
|
||||
<col>Whether this control assignment set uses the keyboard. Default 1.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Mouse</literal_col>
|
||||
<col>Boolean</col>
|
||||
<col>Whether this control assignment set uses the mouse. Default 1.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Gamepad</literal_col>
|
||||
<col>Boolean</col>
|
||||
<col>Whether this control assignment set uses the gamepad. Default 0.</col>
|
||||
</row>
|
||||
</table>
|
||||
<text>
|
||||
|
@ -156,6 +195,26 @@
|
|||
<col>String</col>
|
||||
<col>Command that is combined with this mapping. The name should be equivalent to the <em>Identifier</em> of a command defined in a <emlink href="playercontrols.xml#ControlDef">[ControlDef]</emlink>.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>GUIName</literal_col>
|
||||
<col>String</col>
|
||||
<col>Name which is shown to the player in the control configuration dialog and in control tooltips. Localized strings from the corresponding string table can be used ($Name$). If unset, GUIName of the control def is used. If set to "None", the control is not displayed in the user customization dialog even if the control def has a name set.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>GUIDesc</literal_col>
|
||||
<col>String</col>
|
||||
<col>Informative description which is displayed to the player in the control configuration dialog. Lokalisierte Zeichenketten koennen aus dem zugehoerigen StringTable refeenziert werden ($Name$). If unset, GUIDesc of the control def is used.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>GUIGroup</literal_col>
|
||||
<col>Integer</col>
|
||||
<col>Control assignments in the same group are displayed grouped together in the control assignment dialog. The group with the lowest number is displayed at the top. Default 0.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>GUIDisabled</literal_col>
|
||||
<col>Boolean</col>
|
||||
<col>Whether this control assignment can not be changed in the control assignment dialog. Default 0.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>Priority</literal_col>
|
||||
<col>Integer</col>
|
||||
|
@ -188,10 +247,6 @@
|
|||
<literal_col>AlwaysUnhandled</literal_col>
|
||||
<col>The key press is always passed to the mapping with the next lowest priority, independent of whether the previous command was executed successfully or not.</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>ToggleUnhandled</literal_col>
|
||||
<col>The keypress is passed to the mapping with the next lower priority only if the previous command was executed successfully. This can be used to define macros. **</col>
|
||||
</row>
|
||||
<row>
|
||||
<literal_col>OverrideAssignments</literal_col>
|
||||
<col>The assignment overwrites all other assignments for the same control with the same press/release trigger mode.</col>
|
||||
|
@ -357,6 +412,5 @@ global func UpdateControlDir(int player)
|
|||
<h id="Priority">Priorities</h>
|
||||
<text>...</text>
|
||||
</part>
|
||||
<text><em>** - not yet implemented</em></text>
|
||||
<author>Sven2</author><date>2009-06</date>
|
||||
</doc>
|
||||
|
|
|
@ -375,21 +375,11 @@
|
|||
<col>4 integers</col>
|
||||
<col>0-100 with tolerance. Speed of season change.</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>Rain</col>
|
||||
<col>4 integers</col>
|
||||
<col>0-100 with tolerance. Precipitation amount.</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>Wind</col>
|
||||
<col>4 integers</col>
|
||||
<col>-100-100 with tolerance. Wind direction and strength.</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>Precipitation</col>
|
||||
<col>String</col>
|
||||
<col>Simple material definition precipitation.</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>NoGamma</col>
|
||||
<col>Integer</col>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<part>
|
||||
<text>Scenario scripts can control a general mission sequence or define specific features such as rejoins or special player placement. For documentation of the scripting language see <emlink href="script/index.html">C4Script</emlink>.</text>
|
||||
<h id="Callbacks">Callbacks overview</h>
|
||||
<text>The following callbacks are made to the scenario script. All callbacks except <code>Initialize</code> that are made to scenario script from the engine are also made to all goals, rules and environment objects in the game. With the functions <funclink>GameCall</funclink> and <funclink>GameCallEx</funclink>, callbacks to the scenario script can be made from scripts.</text>
|
||||
<text>The following callbacks are made to the scenario script. All callbacks except <code>Initialize</code> that are made to scenario script from the engine are also made to all goals, rules and environment objects in the game. Other scripts can access local variables of the scenario and call scenario functions with the global proplist <code>Scenario</code>. With the functions <funclink>GameCall</funclink> and <funclink>GameCallEx</funclink>, callbacks to the scenario script can be made from scripts.</text>
|
||||
<text>
|
||||
<table>
|
||||
<rowh>
|
||||
|
@ -80,14 +80,7 @@
|
|||
{
|
||||
<funclink>Log</funclink>("Hello");
|
||||
<funclink>CreateObject</funclink>(WindGenerator,250,200);
|
||||
<funclink>ScriptGo</funclink>(1);
|
||||
}</code>
|
||||
<text>Sequential scripting: at the start of a round the internal script counter is set to 0. If sequential scripting has been started with ScriptGo, the counter is increased by one every ten frames and the corresponding script function is called in the scenario script, if defined.</text>
|
||||
<code>func Script26()
|
||||
{
|
||||
<funclink>Log</funclink>("This function is executed after 260 frames.");
|
||||
}</code>
|
||||
<text>The script counter can also be manually adjusted using <funclink>goto</funclink>() to jump to certain counter positions.</text>
|
||||
<text>After joining a new player the engine calls the function InitializePlayer in the scenario script for that player. This function is called after the basic player objects as defined in Scenario.txt have been placed, so a preliminary starting position has been selected and the player's crew and starting material and buildings are present. In this function, you can now perform more special initial placement.</text>
|
||||
<code>func InitializePlayer(int player)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE doc
|
||||
SYSTEM '../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
|
||||
|
@ -71,12 +71,12 @@ func Activate(object caster, object caster2)
|
|||
|
||||
func FxInvisPSpellStart(object target, proplist effect)
|
||||
{
|
||||
// Vorherige Sichtbarkeit des Zauberers speichern
|
||||
// Save the casters previous visibility
|
||||
effect.visibility = target.Visibility;
|
||||
effect.old_mod = target-><funclink>GetClrModulation</funclink>();
|
||||
// Zauberer unsichtbar machen
|
||||
// Make the caster invisible
|
||||
target.Visibility = <funclink>VIS_Owner</funclink> | <funclink>VIS_Allies</funclink> | <funclink>VIS_God</funclink>;
|
||||
// Halbdurchsichtig bläulich für den Besitzer und Verbündete
|
||||
// Semitransparent and slightly blue for owner and allies
|
||||
target->SetClrModulation(<funclink>ModulateColor</funclink>(effect.old_mod, RGBa(127,127,255,127)));
|
||||
// Fertig
|
||||
return true;
|
||||
|
@ -328,6 +328,41 @@ func FxGravChangeUSpellAdd(object target, proplist effect, string new_name, int
|
|||
return true;
|
||||
}</code>
|
||||
<text>Returning -3 in the Fx*Effect callback will cause the Fx*Add callback to be invoked for the new effect. In this case the new effect is not actually created and the function AddEffect will return the effect which has taken on the consequences of the new effect instead. As opposed to the method above this has the advantage that the return value can now be used to determine whether the effect has been created at all.</text>
|
||||
<h id="Properties">Properties Reference</h>
|
||||
<text>Effects have a number of standard properties:</text>
|
||||
<table>
|
||||
<caption id="PropertiesTable">Effect Properties</caption>
|
||||
<rowh>
|
||||
<col>Data type</col>
|
||||
<col>Name</col>
|
||||
<col>Description</col>
|
||||
</rowh>
|
||||
<row>
|
||||
<col>string</col>
|
||||
<col><code>Name</code></col>
|
||||
<col>Can be changed.</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>int</col>
|
||||
<col><code>Priority</code></col>
|
||||
<col>See <a href="Priorities">Priorities</a></col>
|
||||
</row>
|
||||
<row>
|
||||
<col>int</col>
|
||||
<col><code>Interval</code></col>
|
||||
<col>Of the <a href="#TimerCallback">Timer callback</a>.</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>int</col>
|
||||
<col><code>Time</code></col>
|
||||
<col>The age of the effect in frames, used for the <a href="#TimerCallback">Timer callback</a>. Can be changed.</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>proplist</col>
|
||||
<col><code>CommandTarget</code></col>
|
||||
<col>Either the command object or the command definition, depending on which is used.</col>
|
||||
</row>
|
||||
</table>
|
||||
<h id="UserCallbacks">User Defined Properties</h>
|
||||
<text>Effects can be easily classified by name. In this way, e.g. all magic spell effects can easily be found through the respective wildcard string. If, however, you want to create user-defined properties which also apply to existing effects you can do this by defining additional effect functions:</text>
|
||||
<code>global func FxFireIsHot() { return true; }
|
||||
|
@ -454,8 +489,6 @@ global func FxExplodeOnDeathCurseStop(object target, proplist effect, int reason
|
|||
</table>
|
||||
</text>
|
||||
<text>Warning: as function names may not be more than 100 characters in length (and you will lose oversight eventually), you should not stuff too much information into the effect name. Effect names are case sensitive. Also, you should avoid using any of these identifiers in your effect names if your effect doesn't have anything to do with them.</text>
|
||||
<h id="Properties">Properties Reference</h>
|
||||
<text>Effects have a number of standard properties: Name, Priority, Interval, CommandTarget and Time. Name, Interval and Time can be changed, Priority and CommandTarget are read-only. CommandTarget returns either the command object or command definition, depending on which is used.</text>
|
||||
<h id="CBRef">Callback Reference</h>
|
||||
<part>
|
||||
<text>The following callbacks are made by the engine and should be implemented in your script according to necessity. * is to be replaced by your effect name.</text>
|
||||
|
@ -472,33 +505,39 @@ global func FxExplodeOnDeathCurseStop(object target, proplist effect, int reason
|
|||
<text>
|
||||
<table>
|
||||
<rowh>
|
||||
<col>Script constant</col>
|
||||
<col>reason</col>
|
||||
<col>Meaning</col>
|
||||
</rowh>
|
||||
<row>
|
||||
<col>FX_Call_Normal</col>
|
||||
<col>0</col>
|
||||
<col>Normal removal</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>FX_Call_Temp</col>
|
||||
<col>1</col>
|
||||
<col>Temporary removal (temporary is 1).</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>FX_Call_TempAddForRemoval</col>
|
||||
<col>2</col>
|
||||
<col>Not used</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>FX_Call_RemoveClear</col>
|
||||
<col>3</col>
|
||||
<col>The target object has been deleted</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>FX_Call_RemoveDeath</col>
|
||||
<col>4</col>
|
||||
<col>The target object has died</col>
|
||||
</row>
|
||||
</table>
|
||||
</text>
|
||||
<text>The effect can prevent removal by returning -1. This will not help, however, in temporary removals or if the target object has been deleted.</text>
|
||||
<h>Fx*Timer</h>
|
||||
<h id="TimerCallback">Fx*Timer</h>
|
||||
<text><code>int Fx*Timer (object target, proplist effect, int time);</code></text>
|
||||
<text>Periodic timer call, if a timer interval has been specified at effect creation. target and <code>effect</code> as usual.</text>
|
||||
<text>time specifies how long the effect has now been active. This might alternatively be determined using effect.Time.</text>
|
||||
|
@ -518,7 +557,7 @@ global func FxExplodeOnDeathCurseStop(object target, proplist effect, int reason
|
|||
<h>Fx*Damage</h>
|
||||
<text><code>int Fx*Damage (object target, proplist effect, int damage, int cause);</code></text>
|
||||
<text>Every effect receives this callback whenever the energy or damage value of the target object is to change. If the function is defined, it should then return whether to allow the change.</text>
|
||||
<text>This callback is made upon life energy changes in living beings and damage value changes in non-livings - but not vice versa. cause contains the value change and reason:</text>
|
||||
<text id="damagecause">This callback is made upon life energy changes in living beings and damage value changes in non-livings - but not vice versa. cause contains the value change and reason:</text>
|
||||
<text>
|
||||
<table>
|
||||
<rowh>
|
||||
|
|
|
@ -71,7 +71,7 @@ func MyCall1() { <funclink>Log</funclink>("Die zweite Funktion wurde aufger
|
|||
func MyCall2() { <funclink>Log</funclink>("Die dritte Funktion wurde aufgerufen!"); }</code>
|
||||
<text>In TestFunction() a <em>random</em> function is called (using <funclink>Random</funclink> and <funclink>Format</funclink> one of the three strings "MyCall1", "MyCall2", and "MyCall3" is randomly composed and passed to <code>Call</code>).</text>
|
||||
<text>This process has to be done with indirect calls as only at runtime we can know which function is to be called.</text>
|
||||
<text>There are also some other methods of indirect calls. See <funclink>GameCall</funclink>. Also see <funclink>PrivateCall</funclink>. They allow for bypassing the <emlink href="script/Funcs.html#Aufrufb">calling permission</emlink> and only exist as indirect calls.</text>
|
||||
<text>There are also some other methods of indirect calls. See <funclink>GameCall</funclink>.</text>
|
||||
</part>
|
||||
</part>
|
||||
<author>PeterW</author><date>2003-05</date>
|
||||
|
|
|
@ -34,6 +34,22 @@
|
|||
<text>The message displays the sum of the four values passed. The call</text>
|
||||
<code>ShowSum(1, 2, 3, 4);</code>
|
||||
<text>will result in the message "The sum of the first four parameters is 10.".</text>
|
||||
<text>All functions also have a hidden parameter called <code>this</code>. When calling a function in another proplist (which can be an object, a definition, or any other type of proplist) with <code>p -> Foo();</code> or <code>p ->~ Foo();</code>, the function <code>Foo</code> gets the proplist <code>p</code> as <code>this</code>.</text>
|
||||
<code>func Foo(proplist self) {
|
||||
Log("this == self: %v", this == self);
|
||||
}
|
||||
func Bar() {
|
||||
var p = { Baz = this.Foo };
|
||||
p->Baz(p);
|
||||
p->Baz("not p");
|
||||
Foo(this);
|
||||
}</code>
|
||||
<text>Calling Bar in this script results in this output:</text>
|
||||
<code>this == self: true
|
||||
this == self: false
|
||||
this == self: true</code>
|
||||
<text>The last call to <code>Foo</code> shows the reason for <code>this</code>: Most of the functions in an object need that object to do something with it, and passing the object to every function would result in a lot of repetitive code.</text>
|
||||
<text>Note for everyone familiar with previous versions of C4Script: When calling a function in a definition like <code>Flint->Hit();</code>, the definition is returned from <code>this</code>. In the <code>Flint->Hit();</code> example, that will probably result in an error message from the engine like "passed proplist, but expected object", because the Hit function of the Flint is not designed to be called like that.</text>
|
||||
<h id="parametertypen">Parameter Types</h>
|
||||
<text>You can specify the data type that is to be accepted for a given parameter. To do this, simply write the desired <emlink href="script/Typechecks.html">type name</emlink> before the parameter name:</text>
|
||||
<code>func TypeParameterFunction(object myClonk, id def, int count, string msg)
|
||||
|
@ -68,30 +84,6 @@ ShowSum(1, 2, 3, 4, 5, 6);</code>
|
|||
<text>The call "ShowDifference(5, 2)" will produce the message "The difference between 5 and 2 is 3!".</text>
|
||||
<text>If the function does not return a value, an implicit <code>return nil;</code> is implied.</text>
|
||||
</part>
|
||||
<h id="Aufrufb">Permissions</h>
|
||||
<part>
|
||||
<text>A function can have one of three levels of "calling permission". This will determine from where the function may be called:</text>
|
||||
<text>
|
||||
<table>
|
||||
<row>
|
||||
<col><code>public</code></col>
|
||||
<col>may be called from the engine or any other script (default)</col>
|
||||
</row>
|
||||
<row>
|
||||
<col><code>private</code></col>
|
||||
<col>may only be called from the same object script</col>
|
||||
</row>
|
||||
</table>
|
||||
</text>
|
||||
<text>The calling permissions are expected before the <code>func</code> marker:</text>
|
||||
<code>private func PrivateFunction()
|
||||
{
|
||||
// This function may only be called from the same script
|
||||
}</code>
|
||||
<text>Calling this function from another object script will cause an error.</text>
|
||||
<h>Remark</h>
|
||||
<text>As in some cases it may seem necessary to call a protected function from another object script, there is a workaround through the <funclink>PrivateCall</funclink> function.</text>
|
||||
</part>
|
||||
<h>Global Functions</h>
|
||||
<part>
|
||||
<text>A function is declared globally by placing the "<code>global</code>" keyword before the <code>func</code> marker.</text>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<text>Variables are declared using the following syntax:</text>
|
||||
<code>{ var / local / static } name [= expr] [, name [= expr] ... ];</code>
|
||||
<text>The variable's scope, followed by the variable's name.</text>
|
||||
<text>Optionally, you can assign a value to the variable directly at declaration time. However, this is not possible for global variables. Without initialization variables always start with <code>nil</code>.</text>
|
||||
<text>Optionally, you can assign a value to the variable directly at declaration time. However, this is not possible for <code>static</code> variables. Without initialization variables always start with <code>nil</code>.</text>
|
||||
<text>Additional variable declarations may follow, separated by comma. The declaration must always be ended with a semicolon.</text>
|
||||
<h>Example:</h>
|
||||
<code>static object_count;
|
||||
|
@ -70,6 +70,7 @@ protected func Timer()
|
|||
<text>
|
||||
<ul>
|
||||
<li>Object local variable declarations are also valid in #appendto or #include script extensions.</li>
|
||||
<li>When <code>this</code> is a definition, local variables are constant. That protects against accidental modifications that would appear to work fine while there is only one object of a kind, but break in subtle ways as soon as there are multiple instances.</li>
|
||||
<li>Using the <code>obj.foo</code> or <code>obj["foo"]</code> notation one can access local variables in other objects.</li>
|
||||
<li>If two variables of the same name but differing scope are valid at the same time, then the variable of the smaller scope will be used, meaning for example an object local variable will "cover up" a global variable within its own scope.</li>
|
||||
<li>If the same variable is declared multiple times, the variable will still exist only once and no error is thrown. Multiple initializations are considered regular assignments and executed in order, respectively.</li>
|
||||
|
|
|
@ -46,10 +46,10 @@
|
|||
<col><code>{ foo = 0, "bar baz" = 13, Prototype = Clonk }</code></col>
|
||||
</row>
|
||||
<row>
|
||||
<col><code>object</code></col>
|
||||
<col>Ingame Object</col>
|
||||
<col>Reference to an existing object at runtime. No direct representation. See <funclink>FindObject</funclink>()</col>
|
||||
<col><code>CreateObject(Clonk)</code></col>
|
||||
<col><code>func</code></col>
|
||||
<col>Function</col>
|
||||
<col>A function. At the moment, this is only used to store them in proplists.</col>
|
||||
<col><code>Flint.Hit</code></col>
|
||||
</row>
|
||||
<row>
|
||||
<col><code>nil</code></col>
|
||||
|
@ -64,11 +64,23 @@
|
|||
<col></col>
|
||||
</row>
|
||||
<row>
|
||||
<col><code>id</code></col>
|
||||
<col>definition id</col>
|
||||
<col>ID of an object definition (see <emlink href="definition/index.html#ObjektundEntwicklerIdentifikation">Object Definitions</emlink>).Will be changed into a proplist immediately.</col>
|
||||
<col><code>def</code></col>
|
||||
<col><emlink href="definition/index.html">Object Definition</emlink></col>
|
||||
<col>Represents a DefCore.txt and the associated Script.c. A special kind of proplist.</col>
|
||||
<col><code>Clonk</code></col>
|
||||
</row>
|
||||
<row>
|
||||
<col><code>object</code></col>
|
||||
<col>Ingame Object</col>
|
||||
<col>An instance of an Object Definition. A special kind of proplist.</col>
|
||||
<col><code><funclink>CreateObject</funclink>(Clonk)</code></col>
|
||||
</row>
|
||||
<row>
|
||||
<col><code>effect</code></col>
|
||||
<col><emlink href="script/Effects.html">Effect</emlink></col>
|
||||
<col>A special kind of proplist with associated timers and stacking callbacks.</col>
|
||||
<col><code><funclink>AddEffect</funclink>("Shiny", nil, 1)</code></col>
|
||||
</row>
|
||||
</table>
|
||||
</text>
|
||||
<h>Arrays</h>
|
||||
|
@ -118,7 +130,7 @@
|
|||
<li>All values except for <code>false</code>, <code>nil</code> and <code>0</code> are treated as <code>true</code> when a bool is required.</li>
|
||||
<li><code>nil</code> and <code>false</code> can be converted to <code>0</code>. <code>true</code> can be converted to <code>1</code>.</li>
|
||||
<li><code>nil</code> can always be used as a function parameter, if the function doesn't implement a separate check.</li>
|
||||
<li>If an object has been converted into a proplist then it can be converted back to an object. Otherwise proplists cannot be converted into objects.</li>
|
||||
<li>Objects, Definitions and Effects can be converted to proplists, and then back. Normal proplists cannot be converted into them.</li>
|
||||
</ul>
|
||||
</text>
|
||||
</part>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<desc>Numeric value to be displayed next to the menu entry (such as counts and amounts).</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<type>any</type>
|
||||
<name>parameter</name>
|
||||
<desc>Second parameter to the function specified in command (see remark).</desc>
|
||||
</param>
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
<funclink>Anim_Linear</funclink>
|
||||
<funclink>Anim_X</funclink>
|
||||
<funclink>Anim_Y</funclink>
|
||||
<funclink>Anim_R</funclink>
|
||||
<funclink>Anim_AbsY</funclink>
|
||||
<funclink>Anim_XDir</funclink>
|
||||
<funclink>Anim_YDir</funclink>
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
<funclink>Anim_Linear</funclink>
|
||||
<funclink>Anim_X</funclink>
|
||||
<funclink>Anim_Y</funclink>
|
||||
<funclink>Anim_R</funclink>
|
||||
<funclink>Anim_AbsX</funclink>
|
||||
<funclink>Anim_XDir</funclink>
|
||||
<funclink>Anim_YDir</funclink>
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
<funclink>Anim_Linear</funclink>
|
||||
<funclink>Anim_X</funclink>
|
||||
<funclink>Anim_Y</funclink>
|
||||
<funclink>Anim_R</funclink>
|
||||
<funclink>Anim_AbsX</funclink>
|
||||
<funclink>Anim_AbsY</funclink>
|
||||
<funclink>Anim_XDir</funclink>
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
<funclink>Anim_Linear</funclink>
|
||||
<funclink>Anim_X</funclink>
|
||||
<funclink>Anim_Y</funclink>
|
||||
<funclink>Anim_R</funclink>
|
||||
<funclink>Anim_AbsX</funclink>
|
||||
<funclink>Anim_AbsY</funclink>
|
||||
<funclink>Anim_XDir</funclink>
|
||||
|
|
|
@ -71,6 +71,7 @@ else
|
|||
<funclink>Anim_Const</funclink>
|
||||
<funclink>Anim_X</funclink>
|
||||
<funclink>Anim_Y</funclink>
|
||||
<funclink>Anim_R</funclink>
|
||||
<funclink>Anim_AbsX</funclink>
|
||||
<funclink>Anim_AbsY</funclink>
|
||||
<funclink>Anim_XDir</funclink>
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>Anim_R</title>
|
||||
<category>Animations</category>
|
||||
<version>5.3 OC</version>
|
||||
<syntax>
|
||||
<rtype>array</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<name>begin</name>
|
||||
<desc>Start of the interval.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<name>end</name>
|
||||
<desc>End of the interval. If end is chosen to be greater than begin then the value increases with clockwise rotation, otherwise it decreases.</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>The value depends on the rotation of the object. Upward rotation (0 degrees) is mapped to the value given by begin, and moves toward end when the object rotates clockwise, up to end after one revolution (360 degrees).</desc>
|
||||
<remark>See the <emlink href="definition/animations.html">animation documentation</emlink> for further explanations of the animation system.</remark>
|
||||
<examples>
|
||||
<example>
|
||||
<code><funclink>PlayAnimation</funclink>("Turn", 5, <funclink>Anim_R</funclink>(0, <funclink>GetAnimationLength</funclink>("Turn")), <funclink>Anim_Const</funclink>(1000));</code>
|
||||
<text>Plays the animation "Turn" in slot 5 and superimposes any other potential animations in slot 5. The animation is synchronized to the object's rotation so that the full animation is played once per revolution.</text>
|
||||
</example>
|
||||
</examples>
|
||||
<related>
|
||||
<funclink>PlayAnimation</funclink>
|
||||
<funclink>SetAnimationPosition</funclink>
|
||||
<funclink>SetAnimationWeight</funclink>
|
||||
<funclink>Anim_Const</funclink>
|
||||
<funclink>Anim_Linear</funclink>
|
||||
<funclink>Anim_X</funclink>
|
||||
<funclink>Anim_Y</funclink>
|
||||
<funclink>Anim_AbsX</funclink>
|
||||
<funclink>Anim_AbsY</funclink>
|
||||
<funclink>Anim_XDir</funclink>
|
||||
<funclink>Anim_YDir</funclink>
|
||||
<funclink>Anim_Action</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Clonk-Karl</author><date>2012-04</date>
|
||||
</funcs>
|
|
@ -47,6 +47,7 @@
|
|||
<funclink>Anim_Const</funclink>
|
||||
<funclink>Anim_Linear</funclink>
|
||||
<funclink>Anim_Y</funclink>
|
||||
<funclink>Anim_R</funclink>
|
||||
<funclink>Anim_AbsX</funclink>
|
||||
<funclink>Anim_AbsY</funclink>
|
||||
<funclink>Anim_XDir</funclink>
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
<funclink>Anim_Linear</funclink>
|
||||
<funclink>Anim_X</funclink>
|
||||
<funclink>Anim_Y</funclink>
|
||||
<funclink>Anim_R</funclink>
|
||||
<funclink>Anim_AbsX</funclink>
|
||||
<funclink>Anim_AbsY</funclink>
|
||||
<funclink>Anim_YDir</funclink>
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
<funclink>Anim_Const</funclink>
|
||||
<funclink>Anim_Linear</funclink>
|
||||
<funclink>Anim_X</funclink>
|
||||
<funclink>Anim_R</funclink>
|
||||
<funclink>Anim_AbsX</funclink>
|
||||
<funclink>Anim_AbsY</funclink>
|
||||
<funclink>Anim_XDir</funclink>
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
<funclink>Anim_Linear</funclink>
|
||||
<funclink>Anim_X</funclink>
|
||||
<funclink>Anim_Y</funclink>
|
||||
<funclink>Anim_R</funclink>
|
||||
<funclink>Anim_AbsX</funclink>
|
||||
<funclink>Anim_AbsY</funclink>
|
||||
<funclink>Anim_XDir</funclink>
|
||||
|
|
|
@ -8,11 +8,12 @@
|
|||
<category>Script</category>
|
||||
<subcat>Function call</subcat>
|
||||
<version>5.1 OC</version>
|
||||
<extversion>5.4 OC</extversion>
|
||||
<syntax>
|
||||
<rtype>any</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>string</type>
|
||||
<type>string or function</type>
|
||||
<name>function</name>
|
||||
<desc>Function to be called.</desc>
|
||||
</param>
|
||||
|
@ -23,13 +24,12 @@
|
|||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Calls the local function function. If "~" is prepended to the function name then the call does not fail if the function does not exist.</desc>
|
||||
<desc>Calls the specified function. If given a string, the function is looked up in the context object (<code>this</code>). For example, <code>obj->Call("Foo")</code> is the same as <code>obj->Foo()</code>. Using Call like this is primarily useful when the name of the function can vary. If "~" is prepended to the function name then the call does not fail if the function does not exist.</desc>
|
||||
<related>
|
||||
<funclink>ProtectedCall</funclink>
|
||||
<funclink>PrivateCall</funclink>
|
||||
<funclink>GameCall</funclink>
|
||||
<funclink>eval</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>jwk</author><date>2002-04</date>
|
||||
<author>Günther</author><date>2012</date>
|
||||
</funcs>
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>CheckConstructionSite</title>
|
||||
<category>Objects</category>
|
||||
<subcat>Creation</subcat>
|
||||
<version>5.2 OC</version>
|
||||
<syntax>
|
||||
<rtype>bool</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>id</type>
|
||||
<name>object_id</name>
|
||||
<desc>Type of object to be checked.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<name>xoffset</name>
|
||||
<desc>X coordinate</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<name>yoffset</name>
|
||||
<desc>Y coordinate</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Checks whether the given location is suitable for the construction of object_id. The same check is used before creation in <funclink>CreateConstruction</funclink> if check_side is true. In local calls the specified position will be an offset to the position of the calling object.</desc>
|
||||
<examples>
|
||||
<example>
|
||||
<code>if(CheckConstructionSite(WindGenerator, 150,100))
|
||||
Log("It is possible to construct a wind generator at position 150,100.");</code>
|
||||
</example>
|
||||
</examples>
|
||||
<related>
|
||||
<funclink>CreateConstruction</funclink>
|
||||
<funclink>FindConstructionSite</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Clonkonaut</author><date>2012-03</date>
|
||||
</funcs>
|
|
@ -0,0 +1,81 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>CreateParticleAtBone</title>
|
||||
<category>Particle</category>
|
||||
<version>5.4 OC</version>
|
||||
<syntax>
|
||||
<rtype>bool</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>string</type>
|
||||
<name>szName</name>
|
||||
<desc>Name of the particle</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>string</type>
|
||||
<name>szBoneName</name>
|
||||
<desc>Name of the bone at which to create the particle</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>array</type>
|
||||
<name>pos</name>
|
||||
<desc>Vector of three elements with the X,Y and Z coordinates of the particle relative to the bone position and orientation.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>array</type>
|
||||
<name>dir</name>
|
||||
<desc>Vector of three elements with the X,Y and Z components of the velocity of theparticle relative to the bone orientation.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<name>a</name>
|
||||
<desc>Extra parameter. This is usually the size of the particle in 1/5 pixels.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<name>b</name>
|
||||
<desc>Extra parameter. This is usually the color modulation of the particle.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>object</type>
|
||||
<name>target</name>
|
||||
<desc>Target object for object local particles. Object local particles are drawn directly on top of the object and are removed when the object is deleted.</desc>
|
||||
<optional />
|
||||
</param>
|
||||
<param>
|
||||
<type>bool</type>
|
||||
<name>behind_target</name>
|
||||
<desc>If specified and not <code>false</code>, the particle is drawn directly behind the target object.</desc>
|
||||
<optional />
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Creates a particle relative to a bone of the calling object's skeleton. The named particle definition must be loaded. For more information see the particle documentation.</desc>
|
||||
<remark>This function returns <code>false</code> if the particle definition was not found, or the function is called for an object which does not have a mesh graphics, or the skeleton of the mesh does not have a bone called <code>szBoneName</code>. Otherwise, <code>true</code> is returned. There is no return value indicating whether the particle has actually been created. This must be so to prevent synchronization problems in network games, as particles may be handled differently on each computer in the network.</remark>
|
||||
<examples>
|
||||
<example>
|
||||
<code>func InitializePlayer(int plr)
|
||||
{
|
||||
AddEffect("IntColorize", 0, 1, 1);
|
||||
}
|
||||
|
||||
global func FxIntColorizeTimer()
|
||||
{
|
||||
FindObject(Find_ID(Clonk))->CreateParticleAtBone("PSpark", "skeleton_body", [0, 0, 0], [0, 0, 0], 8, RGB(255,0,0));
|
||||
FindObject(Find_ID(Clonk))->CreateParticleAtBone("PSpark", "pos_hand1", [0, 0, 0], [0, 0, 0], 8, RGB(0,255,0));
|
||||
FindObject(Find_ID(Clonk))->CreateParticleAtBone("PSpark", "pos_hand2", [0, 0, 0], [0, 0, 0], 8, RGB(0,0,255));
|
||||
return(0);
|
||||
}</code>
|
||||
<text>Scenario script. Creates an effect which traces a Clonk's body, left hand and right hand with differently colored sparks.</text>
|
||||
</example>
|
||||
</examples>
|
||||
<related>
|
||||
<funclink>CreateParticle</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Clonk-Karl</author><date>2012-12</date>
|
||||
</funcs>
|
|
@ -45,7 +45,7 @@
|
|||
<row>
|
||||
<col>1</col>
|
||||
<col>CSPF_NoScenarioInit</col>
|
||||
<col>If true, the scenario initialization (i.e. placement of home base material, clonks, setting of build knowledge, etc.) is not performed for this player. Also, the global callbacks PreInitializePlayer and InitializePlayer to the scenario script and to goal, rule, and environment objects are not performed. Instead, the callback InitializeScriptPlayer(Player number, Team) is made to the object definition specified in extra_data. The call is made as DefinitionCall (without <funclink>this</funclink> object). Using this parameter you can create script-controlled AI players which do not receive the same standard treatment as user-controlled players.</col>
|
||||
<col>If true, the scenario initialization (i.e. placement of home base material, clonks, setting of build knowledge, etc.) is not performed for this player. Also, the global callbacks PreInitializePlayer and InitializePlayer to the scenario script and to goal, rule, and environment objects are not performed. Instead, the callback InitializeScriptPlayer(Player number, Team) is made to the object definition specified in extra_data. Using this parameter you can create script-controlled AI players which do not receive the same standard treatment as user-controlled players.</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>2</col>
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>DefinitionCall</title>
|
||||
<category>Script</category>
|
||||
<subcat>Function call</subcat>
|
||||
<version>5.1 OC</version>
|
||||
<syntax>
|
||||
<rtype>any</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>id</type>
|
||||
<name>definition</name>
|
||||
<desc>id of the definition in the script of which to call the function.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>string</type>
|
||||
<name>function</name>
|
||||
<desc>Function to call</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>any</type>
|
||||
<name>...</name>
|
||||
<desc>Additional parameters to be passed to the function.</desc>
|
||||
<optional />
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Calls a function in a script without object context. <funclink>this</funclink> returns <funclink>nil</funclink> in this case (comparable to scenario scripts).</desc>
|
||||
<related>
|
||||
<funclink>GameCall</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Sven2</author><date>2001-11</date>
|
||||
</funcs>
|
|
@ -8,7 +8,7 @@
|
|||
<category>Landscape</category>
|
||||
<version>5.1 OC</version>
|
||||
<syntax>
|
||||
<rtype>void</rtype>
|
||||
<rtype>int</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>int</type>
|
||||
|
@ -24,10 +24,15 @@
|
|||
<type>int</type>
|
||||
<name>radius</name>
|
||||
<desc>Radius</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>bool</type>
|
||||
<name>no_dig2objects</name>
|
||||
<desc>Prevent objects from being dug out</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Makes a circular hole in semi-solid materials.</desc>
|
||||
<desc>Makes a circular hole in semi-solid materials. The return value is the amount of pixels that were dug free. If no_dig2objects is true, the dug out material does neither create objects according to the Dig2Objects in the <emlink href="material/ocm.html">*.ocm</emlink> nor will the amount be stored in the internal buffer.</desc>
|
||||
<examples>
|
||||
<example>
|
||||
<code>DigFree(700, 1500, 5);</code>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<category>Landscape</category>
|
||||
<version>5.1 OC</version>
|
||||
<syntax>
|
||||
<rtype>void</rtype>
|
||||
<rtype>int</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>int</type>
|
||||
|
@ -29,10 +29,15 @@
|
|||
<type>int</type>
|
||||
<name>height</name>
|
||||
<desc>Height</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>bool</type>
|
||||
<name>no_dig2objects</name>
|
||||
<desc>Prevent objects from being dug out</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Makes a rectangular hole in semi-solid materials.</desc>
|
||||
<desc>Makes a rectangular hole in semi-solid materials. The return value is the amount of pixels that were dug free. If no_dig2objects is true, the dug out material does neither create objects according to the Dig2Objects in the <emlink href="material/ocm.html">*.ocm</emlink> nor will the amount be stored in the internal buffer.</desc>
|
||||
<remark>Drills an elevator shaft.</remark>
|
||||
<examples>
|
||||
<example>
|
||||
|
|
|
@ -35,14 +35,9 @@
|
|||
<name>map_name</name>
|
||||
<desc>Name of the map to be used from Landscape.txt.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>bool</type>
|
||||
<name>ignore_sky</name>
|
||||
<desc>If true, the old material is retained whenever Sky would be drawn.</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Draws a dynamic map within the specified rectangle using a given map specification from Landscape.txt.</desc>
|
||||
<desc>Draws a dynamic map within the specified rectangle over the old landscape using a given map specification from Landscape.txt.</desc>
|
||||
<remark>The Landscape.txt component is usually removed from memory after scenario initialization. To keep it in memory for later use by this command you should specify the option KeepMapCreator=1 in Scenario.txt section [Landscape].</remark>
|
||||
<examples>
|
||||
<example>
|
||||
|
|
|
@ -35,19 +35,14 @@
|
|||
<name>map</name>
|
||||
<desc>Definition of the dynamic map. The enclosing map { ... } tag must be present.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>bool</type>
|
||||
<name>ignore_sky</name>
|
||||
<desc>If true, the old material is retained whenever Sky would be drawn.</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Draws a dynamic map within the specified rectangle. This is done using the same evaluation as with Landscape.txt components.</desc>
|
||||
<desc>Draws a dynamic map within the specified rectangle over the old landscape. This is done using the same evaluation as with Landscape.txt components.</desc>
|
||||
<remark>As maximum string length in C4Script is limited by internal buffers you should use <funclink>DrawDefMap</funclink> for very complex maps.</remark>
|
||||
<examples>
|
||||
<example>
|
||||
<code>DrawMap(0,0,<funclink>LandscapeWidth</funclink>(), <funclink>LandscapeHeight</funclink>()/2, "map Empty{}");</code>
|
||||
<text>Empties the top half of the map.</text>
|
||||
<code>DrawMap(0,0,<funclink>LandscapeWidth</funclink>(), <funclink>LandscapeHeight</funclink>()/2, "map Earth{overlay{mat = Earth;};};");</code>
|
||||
<text>Fills the top half of the map with earth.</text>
|
||||
</example>
|
||||
</examples>
|
||||
<related><funclink>DrawDefMap</funclink></related>
|
||||
|
|
|
@ -72,7 +72,6 @@
|
|||
</examples>
|
||||
<related>
|
||||
<funclink>InsertMaterial</funclink>
|
||||
<funclink>SetLandscapePixel</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Sven2</author><date>2002-05</date>
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
<text>Ends the game if it has been running for more than 5 minutes.</text>
|
||||
</example>
|
||||
</examples>
|
||||
<related><funclink>ScriptCounter</funclink></related>
|
||||
</func>
|
||||
<author>Sven2</author><date>2002-04</date>
|
||||
</funcs>
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
<related>
|
||||
<funclink>GameCallEx</funclink>
|
||||
<funclink>Call</funclink>
|
||||
<funclink>DefinitionCall</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Günther</author><date>2002-04</date>
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
<related>
|
||||
<funclink>GameCall</funclink>
|
||||
<funclink>Call</funclink>
|
||||
<funclink>DefinitionCall</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Newton</author><date>2011-07</date>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<subcat>Display</subcat>
|
||||
<version>5.1 OC</version>
|
||||
<syntax><rtype>int</rtype></syntax>
|
||||
<desc>Gets the RGB color value of the ColorByOwner areas of an object. These are controlled by <funclink>SetOwner</funclink>, <funclink>SetColor</funclink> or <placeholder-3/>.</desc>
|
||||
<desc>Gets the RGB color value of the ColorByOwner areas of an object. These are controlled by <funclink>SetOwner</funclink> or <funclink>SetColor</funclink>.</desc>
|
||||
<examples>
|
||||
<example>
|
||||
<code>otherclonk-><funclink>SetColor</funclink>(GetColor());</code>
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
<category>Global</category>
|
||||
<version>5.1 OC</version>
|
||||
<syntax><rtype>int</rtype></syntax>
|
||||
<desc>Returns the current gravity in percent.</desc>
|
||||
<desc>Returns the current gravity in 1/100 pixel/tick².</desc>
|
||||
<examples>
|
||||
<example>
|
||||
<code><funclink>for</funclink> (var obj in <funclink>FindObjects</funclink>(<funclink>Find_Distance</funclink>(100)))
|
||||
obj-><funclink>SetYDir</funclink>(obj-><funclink>GetYDir</funclink>(500) - GetGravity(), 500);</code>
|
||||
obj-><funclink>SetYDir</funclink>(obj-><funclink>GetYDir</funclink>(100) - GetGravity(), 100);</code>
|
||||
<text>Makes the gravitation within a radius of 100 pixels vanish if called every frame.</text>
|
||||
</example>
|
||||
</examples>
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>GetIndexOf</title>
|
||||
<category>Script</category>
|
||||
<subcat>Arrays</subcat>
|
||||
<version>5.1 OC</version>
|
||||
<syntax>
|
||||
<rtype>int</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>array</type>
|
||||
<name>array2search</name>
|
||||
<desc>Array in which the element should be searched. The array can be zero, in which case the element is never found and -1 is returned.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>any</type>
|
||||
<name>needle</name>
|
||||
<desc>The value to which every element of the array is to be compared.</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Finds the first occurrence of a value in an array and returns its zero-based index. If the element is not found, -1 is returned. The usual rules for comparison using the <emlink href="script/operatoren.html#equality">==-operator</emlink> apply.</desc>
|
||||
</func>
|
||||
<author>Sven2</author><date>2012-12</date>
|
||||
</funcs>
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>GetPlayerControlAssignment</title>
|
||||
<category>Player</category>
|
||||
<version>5.1 OC</version>
|
||||
<syntax>
|
||||
<rtype>string</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<name>player</name>
|
||||
<desc>Number of the player for whom the control set is queried.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<name>control</name>
|
||||
<desc>Control to query. A CON_* constant should be used here.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>bool</type>
|
||||
<name>human_readable</name>
|
||||
<desc>If true, some internal names such as JOY_* for joystick buttons are replaced by variants suitable for display to the player.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>bool</type>
|
||||
<name>short_name</name>
|
||||
<desc>If true, short names are preferred if available. Currently effects Mac builds only.</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Returns the name of the key, mouse of joystick button assigned to a control for a player. If the player number is invalid, <code>nil</code> is returned. For unassigned or invalid controls, "" is returned.</desc>
|
||||
<remark>For network games and replays, the returned value is not synchronized. If the function is called for a remote player or during replay, "" is always returned for valid player numbers.</remark>
|
||||
<examples>
|
||||
<example>
|
||||
<code><funclink>Message</funclink>("Press <c ffff00>%s</c> to walk left!", GetPlayerControlAssignment(<funclink>GetPlayerByIndex</funclink>(0, C4PT_User), CON_Left, true, true));</code>
|
||||
<text>Tells the first player how to walk left.</text>
|
||||
</example>
|
||||
</examples>
|
||||
</func>
|
||||
<author>Sven2</author><date>2012-04</date>
|
||||
</funcs>
|
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>GetProperties</title>
|
||||
<category>Objects</category>
|
||||
<subcat>Properties</subcat>
|
||||
<version>5.3 OC</version>
|
||||
<syntax>
|
||||
<rtype>array</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>proplist</type>
|
||||
<name>object</name>
|
||||
<desc>Object to request property from, <code>nil</code> in local calls.</desc>
|
||||
<optional />
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Returns the names of all properties of <code>object</code>.</desc>
|
||||
<related><funclink>SetProperty</funclink></related>
|
||||
<related><funclink>GetProperty</funclink></related>
|
||||
<examples>
|
||||
<example>
|
||||
<code>GetProperties({foo = 1, bar = 2}) == ["bar", "foo"]</code>
|
||||
</example>
|
||||
</examples>
|
||||
</func>
|
||||
<author>Günther</author><date>2012</date>
|
||||
</funcs>
|
|
@ -27,6 +27,7 @@
|
|||
</syntax>
|
||||
<desc>Returns the property <code>key</code> of <code>object</code>.</desc>
|
||||
<related><funclink>SetProperty</funclink></related>
|
||||
<related><funclink>GetProperties</funclink></related>
|
||||
</func>
|
||||
<author>Günther</author><date>2009-05</date>
|
||||
</funcs>
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
<desc>Inserts a material pixel at the given position and given speed.</desc>
|
||||
<related>
|
||||
<funclink>Material</funclink>
|
||||
<funclink>InsertMaterialAmount</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Sven2</author><date>2001-11</date>
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>PrivateCall</title>
|
||||
<category>Script</category>
|
||||
<subcat>Function call</subcat>
|
||||
<version>5.1 OC</version>
|
||||
<syntax>
|
||||
<rtype>any</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>object</type>
|
||||
<name>obj</name>
|
||||
<desc>Object in which to call the function.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>string</type>
|
||||
<name>function</name>
|
||||
<desc>Function to be called.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>any</type>
|
||||
<name>...</name>
|
||||
<desc>Parameters of the function.</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Calls the specified private, protected, or public function in the target object. You should reconsider whether this workaround is really necessary.</desc>
|
||||
<related>
|
||||
<funclink>ProtectedCall</funclink>
|
||||
<funclink>Call</funclink>
|
||||
<funclink>GameCall</funclink>
|
||||
<funclink>eval</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>jwk</author><date>2002-06</date>
|
||||
</funcs>
|
|
@ -1,40 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>ProtectedCall</title>
|
||||
<category>Script</category>
|
||||
<subcat>Function call</subcat>
|
||||
<version>5.1 OC</version>
|
||||
<syntax>
|
||||
<rtype>any</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>object</type>
|
||||
<name>obj</name>
|
||||
<desc>Object in which to call the function.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>string</type>
|
||||
<name>function</name>
|
||||
<desc>Function to be called.</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>any</type>
|
||||
<name>...</name>
|
||||
<desc>Parameters of the function.</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Calls the protected or public function szFunction in obj. You should reconsider whether this workaround is really necessary.</desc>
|
||||
<related>
|
||||
<funclink>PrivateCall</funclink>
|
||||
<funclink>Call</funclink>
|
||||
<funclink>GameCall</funclink>
|
||||
<funclink>eval</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>jwk</author><date>2002-06</date>
|
||||
</funcs>
|
|
@ -37,11 +37,11 @@
|
|||
<remark>Accordingly, the specified script can be a single command only. It may not contain multiple commands separated by ";".</remark>
|
||||
<examples>
|
||||
<example>
|
||||
<code>Schedule("<funclink>Explode</funclink>(50)", 1000, 0, <funclink>FindObject</funclink>(<funclink>Find_ID</funclink>(Clonk)));</code>
|
||||
<code>Schedule(<funclink>FindObject</funclink>(<funclink>Find_ID</funclink>(Clonk)), "<funclink>Explode</funclink>(50)"<funclink></funclink>, 1000);</code>
|
||||
<text>Makes a clonk explode after 1000 ticks delay.</text>
|
||||
</example>
|
||||
<example>
|
||||
<code>Schedule("<funclink>SetWealth</funclink>(<funclink>GetPlayerByIndex</funclink>(0), <funclink>GetWealth</funclink>(<funclink>GetPlayerByIndex</funclink>(0)) + 1)", 1, 100);</code>
|
||||
<code>Schedule(<code>nil</code>, "<funclink>DoWealth</funclink>(<funclink>GetPlayerByIndex</funclink>(0), 1)"<funclink></funclink>, 1, 100);</code>
|
||||
<text>Gives one unit of money per frame to the first player for 100 frames. Notice that if the first player is eliminated, the donations will continue for the next (first) player, since the receiving player is determined anew in each execution.</text>
|
||||
</example>
|
||||
</examples>
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>ScriptCounter</title>
|
||||
<category>Script</category>
|
||||
<version>5.1 OC</version>
|
||||
<syntax><rtype>int</rtype></syntax>
|
||||
<desc>Prints the current value of the scenario script counter.</desc>
|
||||
<examples>
|
||||
<example>
|
||||
<text>See <funclink>goto</funclink>().</text>
|
||||
</example>
|
||||
</examples>
|
||||
<related>
|
||||
<funclink>ScriptGo</funclink>
|
||||
<funclink>goto</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Sven2</author><date>2002-08</date>
|
||||
</funcs>
|
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>ScriptGo</title>
|
||||
<category>Script</category>
|
||||
<version>5.1 OC</version>
|
||||
<syntax>
|
||||
<rtype>bool</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>bool</type>
|
||||
<name>start</name>
|
||||
<desc>Whether to start or stop the counter.</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Starts or stops the scenario script counter.</desc>
|
||||
<examples>
|
||||
<example>
|
||||
<text>See <funclink>goto</funclink>().</text>
|
||||
</example>
|
||||
</examples>
|
||||
<related>
|
||||
<funclink>goto</funclink>
|
||||
<funclink>ScriptCounter</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Sven2</author><date>2002-08</date>
|
||||
</funcs>
|
|
@ -78,7 +78,7 @@
|
|||
<examples>
|
||||
<example>
|
||||
<code>SetGamma(<funclink>RGB</funclink>(50,0,0), <funclink>RGB</funclink>(140,100,100), <funclink>RGB</funclink>(255,220,220));</code>
|
||||
<text>Adds a light blue hue to the game.</text>
|
||||
<text>Adds a light red hue to the game.</text>
|
||||
</example>
|
||||
</examples>
|
||||
<related>
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
<param>
|
||||
<type>int</type>
|
||||
<name>gravity</name>
|
||||
<desc>New gravity: value -300 til 300 (in percent)</desc>
|
||||
<desc>New gravity in 1/100 pixel/tick²</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Sets the gravity. Normal gravity is 100% and results in an acceleration of 0.2 pixels per Tick. (increasing YDir by 2 per Tick with precision=10).</desc>
|
||||
<desc>Sets the gravity. It is usually a good idea to set this to a multiple or a fraction of the previous value.</desc>
|
||||
<related><funclink>GetGravity</funclink></related>
|
||||
</func>
|
||||
<author>jwk</author><date>2002-08</date>
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>SetLandscapePixel</title>
|
||||
<category>Landscape</category>
|
||||
<version>5.1 OC</version>
|
||||
<syntax>
|
||||
<rtype>bool</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<name>x</name>
|
||||
<desc>X position of the pixel to be set; relative coordinates in local calls</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<name>y</name>
|
||||
<desc>Y position of the pixel to be set; relative coordinates in local calls</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<name>dwValue</name>
|
||||
<desc>32 bit color value of the pixel</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Sets a pixel in the landscape. Not available in the old 8 bit graphics system.</desc>
|
||||
<examples>
|
||||
<example>
|
||||
<code>SetLandscapePixel(0, 0, <funclink>RGB</funclink>(185, 127, 0));</code>
|
||||
<text>Colors the landscape pixel directly behind the calling object brown.</text>
|
||||
</example>
|
||||
</examples>
|
||||
<related><funclink>RGB</funclink></related>
|
||||
</func>
|
||||
<author>Sven2</author><date>2002-04</date>
|
||||
</funcs>
|
|
@ -53,10 +53,15 @@
|
|||
<col>GFX_BLIT_ClrSfc_Mod2</col>
|
||||
<col>8</col>
|
||||
<col>The overlay (owner color) is drawn using additive modulation. This flag might have to be set independently of bit 2.</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>GFX_BLIT_Wireframe</col>
|
||||
<col>16</col>
|
||||
<col>Draws the mesh as a wireframe. Only works with meshes!</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>5-7</col>
|
||||
<col>16, 32, 64</col>
|
||||
<col>32, 64</col>
|
||||
<col>reserved</col>
|
||||
</row>
|
||||
<row>
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>SortArray</title>
|
||||
<category>Script</category>
|
||||
<subcat>Arrays</subcat>
|
||||
<version>5.4 OC</version>
|
||||
<syntax>
|
||||
<rtype>bool</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>array</type>
|
||||
<name>array2sort</name>
|
||||
<desc>Array that is to be sorted</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>bool</type>
|
||||
<name>descending</name>
|
||||
<desc>If true, elements are sorted in descending (highest to lowest) order. Otherwise ascending order.</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Sorts an array by its elements. Elements should be either all strings or all integers.</desc>
|
||||
<related>
|
||||
<funclink>SortArrayByProperty</funclink>
|
||||
<funclink>SortArrayByArrayElement</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Sven2</author><date>2012-12</date>
|
||||
</funcs>
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>SortArrayByArrayElement</title>
|
||||
<category>Script</category>
|
||||
<subcat>Arrays</subcat>
|
||||
<version>5.4 OC</version>
|
||||
<syntax>
|
||||
<rtype>bool</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>array</type>
|
||||
<name>array2sort</name>
|
||||
<desc>Array that is to be sorted</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<name>element_index</name>
|
||||
<desc>Index of element in sub-array by which sorting should happen</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>bool</type>
|
||||
<name>descending</name>
|
||||
<desc>If true, elements are sorted in descending (highest to lowest) order. Otherwise ascending order.</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Sorts an array of arrays by a subarray element. All elements must be arrays of at least element_index+1 size. Subarray elements should be either all strings or all integer.</desc>
|
||||
<related>
|
||||
<funclink>SortArray</funclink>
|
||||
<funclink>SortArrayByProperty</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Sven2</author><date>2012-12</date>
|
||||
</funcs>
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>SortArrayByProperty</title>
|
||||
<category>Script</category>
|
||||
<subcat>Arrays</subcat>
|
||||
<version>5.4 OC</version>
|
||||
<syntax>
|
||||
<rtype>bool</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>array</type>
|
||||
<name>array2sort</name>
|
||||
<desc>Array that is to be sorted</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>string</type>
|
||||
<name>property_name</name>
|
||||
<desc>Name of property by which the array is to be sorted</desc>
|
||||
</param>
|
||||
<param>
|
||||
<type>bool</type>
|
||||
<name>descending</name>
|
||||
<desc>If true, elements are sorted in descending (highest to lowest) order. Otherwise ascending order.</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Sorts an array of proplists by a property. All elements must be proplists. Properties should be either all strings or all integer. If a property is not assigned, it is assumed to be integer zero.</desc>
|
||||
<related>
|
||||
<funclink>SortArray</funclink>
|
||||
<funclink>SortArrayByArrayElement</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>Sven2</author><date>2012-12</date>
|
||||
</funcs>
|
|
@ -10,7 +10,7 @@
|
|||
<version>5.1 OC</version>
|
||||
<syntax><rtype>array</rtype></syntax>
|
||||
<desc>Sort criterion: Sorts the found objects randomly.</desc>
|
||||
<remark>Sort_Random should not be used together with <placeholder-1/> to find a random, matching object. Instead the first object of a <placeholder-2/> search with a SortRandom parameter can be used for instance.</remark>
|
||||
<remark>Sort_Random should not be used together with <funclink>FindObject</funclink> to find a random, matching object. Instead the first object of a <funclink>FindObjects</funclink> search with a SortRandom parameter can be used for instance.</remark>
|
||||
<remark>For additional information on the use of this function see <funclink>FindObjects</funclink>.</remark>
|
||||
<related><funclink>FindObjects</funclink></related>
|
||||
</func>
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<!DOCTYPE funcs
|
||||
SYSTEM '../../../clonk.dtd'>
|
||||
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
|
||||
<funcs>
|
||||
<func>
|
||||
<title>goto</title>
|
||||
<category>Script</category>
|
||||
<version>5.1 OC</version>
|
||||
<syntax>
|
||||
<rtype>void</rtype>
|
||||
<params>
|
||||
<param>
|
||||
<type>int</type>
|
||||
<name>counter</name>
|
||||
<desc>New value for the script counter. The next scenario script function called will be ScriptXXX.</desc>
|
||||
</param>
|
||||
</params>
|
||||
</syntax>
|
||||
<desc>Sets the script counter for scenario scripts to the specified value. The script counter is responsible for calling the ScriptXXX functions in a scenario script. This does not apply to object scripts - those should be using TimerCall or ActMaps with StartCall/PhaseCall/EndCall.</desc>
|
||||
<examples>
|
||||
<example>
|
||||
<code>
|
||||
func Initialize()
|
||||
{
|
||||
// Start script counter
|
||||
<funclink>ScriptGo</funclink>(1);
|
||||
}
|
||||
|
||||
func Script10()
|
||||
{
|
||||
// Create firestones
|
||||
<funclink>CastObjects</funclink>(Firestone,10,200, <funclink>Random</funclink>(<funclink>LandscapeWidth</funclink>()), 20);
|
||||
goto(0);
|
||||
}</code>
|
||||
<text>A scenario script: a typical flint rain. Every 100 Frames 10 flints are created.</text>
|
||||
</example>
|
||||
</examples>
|
||||
<related>
|
||||
<funclink>ScriptGo</funclink>
|
||||
<funclink>ScriptCounter</funclink>
|
||||
</related>
|
||||
</func>
|
||||
<author>jwk</author><date>2002-04</date>
|
||||
</funcs>
|
|
@ -173,6 +173,20 @@
|
|||
<col>postfix</col>
|
||||
<col>bool, any/any</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>9l</col>
|
||||
<col>===</col>
|
||||
<col>Returns whether a and b refer to the same thing.</col>
|
||||
<col>postfix</col>
|
||||
<col>bool, any/any</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>9l</col>
|
||||
<col>!==</col>
|
||||
<col>Returns whether a and b do not refer to the same thing.</col>
|
||||
<col>postfix</col>
|
||||
<col>bool, any/any</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>8l</col>
|
||||
<col>&</col>
|
||||
|
@ -208,6 +222,13 @@
|
|||
<col>postfix</col>
|
||||
<col>any, any/any</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>3l</col>
|
||||
<col>??</col>
|
||||
<col>Returns the left-hand operand if the operand is not <code>nil</code>, or the right-hand operand otherwise.</col>
|
||||
<col>postfix</col>
|
||||
<col>any, any/any</col>
|
||||
</row>
|
||||
<row>
|
||||
<col>2r</col>
|
||||
<col>*=</col>
|
||||
|
@ -292,13 +313,21 @@ while(<strong>++somevar</strong> < 10)
|
|||
<text>Yet there is an important difference between the two versions: when using the postfix version, the <strong>previous</strong> value of the variable is returned. The first example will result in a count from 1 to <strong>10</strong>, since at beginning of the last loop repetition is value of <code>somevar</code> is 9. It is then increased by one (<code>somevar</code> is now 10) but the previous value of 9 is returned and compared to 10. Thus the loop will be repeated one more time and then the value of 10 is printed.</text>
|
||||
<text>In the second example, on the other hand, the loop runs from 1 to <strong>9</strong>. When <code>somevar</code> is 9 and is increased, the new value of 10 is returned immediately. The result is not less than 10 and the loop ends.</text>
|
||||
</part>
|
||||
<h id="andor">The Operators && and ||</h>
|
||||
<h id="shortcircuiting">The Short-Circuiting Operators &&, || and ??</h>
|
||||
<part>
|
||||
<text>These two operators are special. If the result can be determined by the first parameter alone, the second parameter is not computed at all. For example, this script does not explode an object, because the overall result would be <code>false</code>, regardless of the result of Explode:</text>
|
||||
<text>These operators are special. If the result can be determined by the first parameter alone, the second parameter is not computed at all. For example, this script does not explode an object, because the overall result would be <code>false</code>, regardless of the result of Explode:</text>
|
||||
<code>0 && Explode(20);</code>
|
||||
<text>Further, the result is the value of the first or second parameter, depending on whether one or both were evaluated. For example, one can create a knight if possible or else a Clonk:</text>
|
||||
<code>CreateObject(Knight,0,0,GetOwner()) || CreateObject(Clonk,0,0,GetOwner())</code>
|
||||
</part>
|
||||
<h id="nilcoalesce">The operator <code>??</code></h>
|
||||
<part>
|
||||
<text>The <code>??</code> operator is called the nil-coalescing operator. It can be used to specify a default value for an expression or function call that may evaluate to <code>nil</code>.</text>
|
||||
</part>
|
||||
<h id="equality">The equality operators <code>==</code>, <code>!=</code>, <code>===</code> and <code>!==</code></h>
|
||||
<part>
|
||||
<text>The shorter operators basically consider more things equal. For example, two arrays with the same contents are equal, but === only returns true when both sides of the operator contain the same array. This matters mostly when arrays or proplists are modified. Modification can change the return value of the <code>==</code>/<code>!=</code> operators, but not of the <code>===</code>/<code>!==</code> operators.</text>
|
||||
</part>
|
||||
<h id="prio">Priority and Associating</h>
|
||||
<part>
|
||||
<text>This subject shows how operator priority is evaluated in detail.</text>
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* OpenClonk, http://www.openclonk.org
|
||||
*
|
||||
* Copyright (c) 2012 Günther Brammer
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef C4SCRIPTSTANDALONE_H
|
||||
#define C4SCRIPTSTANDALONE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int c4s_runscript(const char * filename);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // C4SCRIPTSTANDALONE_H
|
|
@ -140,6 +140,17 @@ if ($link && $db) {
|
|||
$version = $row['new_version'];
|
||||
if ($version) {
|
||||
$message .= 'Version=' . $version . PHP_EOL;
|
||||
// strip build version from client request
|
||||
$n = 0;
|
||||
for($i=0;$i<strlen($client_version);$i++){
|
||||
if($client_version[$i]=='.'){
|
||||
$n++;
|
||||
if($n>=3){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$client_version = substr($client_version,0,$i);
|
||||
if (version_compare($client_version, $version) < 0) { //We need to update
|
||||
$result = mysql_query('SELECT `file` FROM `' . $prefix . 'update` WHERE `old_version` = \'' . $client_version . '\' AND `platform` = \'' . $platform . '\'');
|
||||
$row = mysql_fetch_assoc($result);
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
* -crlf
|
||||
|
||||
* text=auto
|
|
@ -0,0 +1,2 @@
|
|||
[Head]
|
||||
Index=4
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |