Compare commits

..

13 Commits

Author SHA1 Message Date
Tobias Zwick 6d9dfc0fb8 Merge remote-tracking branch '_origin/master' into shapetextures 2016-01-16 16:54:02 +01:00
Tobias Zwick 01cbe4d17f fix problems with scenarios after having added the shape textures 2016-01-16 16:52:17 +01:00
Tobias Zwick eff4820a69 correct normals of earth textures (green channel was inverted) 2016-01-16 16:45:05 +01:00
Tobias Zwick 9c597047f1 Merge branch 'master' into shapetextures 2016-01-15 22:38:12 +01:00
Tobias Zwick 62b6448bdb finetuning shape defs 2016-01-15 22:37:51 +01:00
Tobias Zwick 6270f682d3 add scenario for website header 2016-01-15 19:51:34 +01:00
Tobias Zwick a486c23671 reorder materials so i.e. sand does not paint over a rock shape anymore.
* all non-diggable materials are now in front of diggable materials
* except: firestone and coal are still in front of rock

At least this change makes it necessary to test every scenario we have if there are any problems with the landscape
2016-01-12 01:18:03 +01:00
Tobias Zwick d1ca7fe059 fix tiling of the gold normal texture 2016-01-12 01:18:03 +01:00
Tobias Zwick 4ace35cee1 add new shape and normal textures to hideout.ocs 2016-01-12 01:18:03 +01:00
Tobias Zwick 28e48173ec fix bug in the ore color texture (rendering done by Matthias) 2016-01-12 01:18:03 +01:00
Tobias Zwick cbd49913c2 add shape textures to Amethyst, Ruby, Firestone, Gold, Everrock, Ore and enhance shape textures of Granite and Rock.
* move ruby texture phase by 50% so ruby and amethyst do not look like the same material with a different color when next to each other so much
2016-01-12 01:18:03 +01:00
Tobias Zwick c0e9287bae make granite and rock shape indexed 2016-01-12 01:18:03 +01:00
Tobias Zwick 863cfc42ba add a shape map for amethyst and ruby; also, fix a small issue with tiling the textures horizontally 2016-01-12 01:18:03 +01:00
3820 changed files with 53426 additions and 220498 deletions

View File

@ -1,2 +1 @@
node: $Format:%H$
date: $Format:%ci$

49
.gitignore vendored
View File

@ -5,7 +5,6 @@ deps
*.o
/openclonk
/openclonk-server
/netpuncher
/c4group
/c4script
*.a
@ -18,7 +17,7 @@ C4Version.h
Makefile
C4Include.h.gch
intermediate
/build*
build*
CMakeScripts
CMakeFiles
CMakeCache.txt
@ -30,20 +29,16 @@ CPackSourceConfig.cmake
editor-icons.h
oc-icon.h
NativeToolsExport.cmake
engine-resource.c
tests/CTestTestfile.cmake
# Documentation
*.pyc
node_modules
/docs/online
/docs/chm
/docs/sdk-de
/docs/sdk/content.xml
/docs/*.mo
/docs/doku.pot
/docs/Functions.txt
/docs/lunr.js
docs/online
docs/chm
docs/sdk-de
docs/sdk/content.xml
docs/*.mo
docs/doku.pot
docs/Functions.txt
# Visual studio files
openclonk.opensdf
@ -60,10 +55,6 @@ planet/fmod.dll
planet/cmake_install.cmake
planet/clonk.sln
planet/clonk.ilk
*.ipdb
*.iobj
openclonk.VC.db
openclonk.VC.VC.opendb
build
planet/clonk.app
@ -84,16 +75,6 @@ openclonk.ilk
*.vcxproj
*.vcxproj.filters
/ipch
.vs/
c4group_autogen/
c4script_autogen/
libc4script_autogen/
libmisc_autogen/
libopenclonk_autogen/
netpuncher_autogen/
openclonk-server_autogen/
openclonk_autogen/
thirdparty/blake2/blake2_autogen/
# Temporary files created by Microsoft Visual Studio
*.ncb
@ -134,7 +115,6 @@ openclonk.layout
openclonk.sdf
openclonk.cbp
tests/openclonk_unittest.cbp
tests/openclonk_unittest.sln
# MacOSX saved searches
*.savedSearch
@ -144,19 +124,10 @@ WindowsGamesExplorer.xml
# Mape
./mape
/mape
mape-icons.h
mape-resource.c
tests/openclonk_unittest.sln
# Packed groups created directly in root path
/*.oc*
# QMake stuff
*_automoc.cpp
moc_*.cpp
qrc_resource.cpp
ui_C4ConsoleQt*.h
resource.qrc.depends
*.exp
qt.conf

View File

@ -1,84 +0,0 @@
# thanks to http://stackoverflow.com/questions/29312015/building-with-more-than-one-version-of-a-compiler for the template
language: cpp
dist: trusty
sudo: required # for Qt libraries. Additionally, the virtualization builds are more stable and have better single core performance.
matrix:
include:
- os: linux
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9', 'build-essential', 'cmake3', 'libfreetype6-dev', 'libgl1-mesa-dev', 'libglew-dev', 'libgtk-3-dev', 'libjpeg-dev', 'libpng-dev', 'libsdl2-dev', 'libupnp-dev', 'libxrandr-dev', 'x11proto-core-dev', 'zlib1g-dev', 'libalut0', 'libgtest-dev']
env:
- CCOMPILER=gcc-4.9
- CXXCOMPILER=g++-4.9
- TYPE=Debug # somehow, the linking fails for release builds. If someone could fix that, that would be great.
- BSYS="Unix Makefiles#make -k"
- os: linux
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: ppa:beineri/opt-qt596-trusty
packages: ['g++-5', 'build-essential', 'cmake3', 'libpng-dev', 'libjpeg-dev', 'libfreetype6-dev', 'libglew-dev', 'libreadline-dev', 'libsdl2-dev', 'qt59base', 'libalut-dev', 'libvorbis-dev', 'libopenal-dev', 'libdw-dev', 'libgtest-dev', 'ninja-build']
env:
- CCOMPILER=gcc-5
- CXXCOMPILER=g++-5
- TYPE=RelWithDebInfo
- CXX_FLAGS="-fdiagnostics-color -I/usr/include/AL"
- BSYS="Ninja#ninja -k30" PCH=on
- UPLOAD_SNAPSHOT=1
- CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=/usr -DWITH_AUTOMATIC_UPDATE=ON -DWITH_APPDIR_INSTALLATION=ON"
- os: linux
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8']
packages: ['clang-3.8', 'build-essential', 'cmake3', 'libfreetype6-dev', 'libgl1-mesa-dev', 'libglew-dev', 'libgtk-3-dev', 'libjpeg-dev', 'libpng-dev', 'libsdl2-dev', 'libupnp-dev', 'libxrandr-dev', 'x11proto-core-dev', 'zlib1g-dev', 'libalut0', 'ninja-build', 'libc++-dev', 'libc++1', 'libgtest-dev']
env:
- CCOMPILER=clang-3.8
- CXXCOMPILER=clang++-3.8
- CXX_FLAGS="-stdlib=libc++ -fcolor-diagnostics"
- TYPE=Debug
- BSYS="Ninja#ninja -k30"
before_install:
- for t in test mock; do wget https://github.com/google/google$t/archive/release-1.7.0.tar.gz -Og$t.tgz && tar xvf g$t.tgz; done
install:
- '[ -e /opt/qt59/bin/qt59-env.sh ] && source /opt/qt59/bin/qt59-env.sh || echo building without Qt'
before_script:
- export CXX="$CXXCOMPILER" CC="$CCOMPILER"
- export C4REVISION_BRANCH="$TRAVIS_BRANCH"
- >
cmake
-G"${BSYS/\#*/}"
-DCMAKE_BUILD_TYPE="$TYPE"
-DCMAKE_CXX_FLAGS="$CXX_FLAGS"
-DUSE_GCC_PCH=${PCH:-off}
-DGTEST_ROOT=$PWD/googletest-release-1.7.0
-DGMOCK_ROOT=$PWD/googlemock-release-1.7.0
$CMAKE_FLAGS
.
script:
- ${BSYS/*#/} all netpuncher tests aul_test
# TODO: Remove SKIP_IPV6_TEST once Travis generally adds ::1 as loopback address.
- SKIP_IPV6_TEST=1 ./tests/tests
- ./tests/aul_test
after_success:
- >
[ "$UPLOAD_SNAPSHOT" = 1 ] &&
echo "Creating AppImage..." &&
tools/create_appimage.sh &&
echo "Uploading snapshot..." &&
tools/upload_snapshot.sh OpenClonk-x86_64.AppImage OpenClonk-x86_64.AppImage.zsync ||
echo "Snapshot creation has failed"

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de
Copyright (c) 2009-2016, The OpenClonk Team and contributors
Copyright (c) 2009-2015, The OpenClonk Team and contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above

View File

@ -1,17 +1,15 @@
<Engine and Tools>
Sven Eberhardt (Sven2)
Armin Burgmeier (Clonk-Karl)
Günther Brammer (Günther)
Nicolas Hake (Isilkor)
Armin Burgmeier (Clonk-Karl)
Lukas Werling (Luchs)
Martin Plicht (Mortimer)
Julius Michaelis (JCaesar)
Peter Wortmann (PeterW)
Julius Michaelis (Caesar)
<Scripting and Content>
Maikel de Vries (Maikel)
David Dormagen (Zapper)
Mark Haßelbusch (Marky)
Felix Wagner (Clonkonaut)
Bernhard Bonigl (Boni)
@ -28,8 +26,11 @@ Martin Strohmeier (K-Pone)
<Administration>
Tobias Zwick (Newton)
<Thanks to our package maintainers>
Benedict Etzel (B_E), Phillip Kern (pkern), Kevin Zheng and more
<Special Thanks to Contributors>
Contributors for OpenClonk 8.0: George Tokmaji (Fulgen), Martin Adam (Win), Merten Ehmig (pluto), Florian Graier (Nachtfalter), Philip Holzmann (Foaly), Dominik Bayerl (Kanibal), Linus Heckemann (sphalerite), Pyrit, Armin Schäfer, Tushar Maheshwari, jok, Tarte, Philip Kern (pkern), Arne Schauf (NativeException), Matthias Mailänder, marsmoon
Previous contributors: Tim Blume, Sven-Hendrik Haase, Carl-Philip Hänsch (Carli), Jan Heberer, Benjamin Herr (Loriel), Lauri Niskanen (Ape), Johannes Nixdorf (mixi), Misty de Meo, Fabian Pietsch, Manuel Rieke (MrBeast), Felix Riese (Fungiform), Sebastian Rühl, Oliver Schneider (ker), Lorenz Schwittmann, Alexander Semeniuk (AlteredARMOR), Daniel Theuke (ST-DDT), Andriel, Apfelclonk, Asmageddon, Checkmaty, Clonkine, dylanstrategie, Faby, grgecko, Gurkenglas, hasufell, Koronis, mizipzor, Peewee, Russell, Stan, TomyLobo
Also thanks to our Linux package maintainers Benedict Etzel (B_E), Linus Heckemann (sphalerite), Philip Kern (pkern), Matthias Mailänder, Julian Ospald (hasufell), Kevin Zheng, and more
Finally, a big thanks to Matthes Bender 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.
Martin Adam (Win), Florian Graier (Nachtfalter), Mark Haßelbusch (Marky), Merten Ehmig (pluto), Benjamin Herr (Loriel), Armin Schäfer, Pyrit, Philip Holzmann (Batman), Alexander Semeniuk (AlteredARMOR), Andriel, Peewee, Oliver Schneider (ker), Fabian Pietsch, Manuel Rieke (MrBeast), Felix Riese (Fungiform), Carl-Philip Hänsch (Carli), Sebastian Rühl, Gurkenglas and many more:
Luchs, Asmageddon, mizipzor, Tim Blume, Apfelclonk, Sven-Hendrik Haase, Lauri Niskanen (Ape), Daniel Theuke (ST-DDT), Russell, Stan, TomyLobo, Clonkine, Koronis, Johannes Nixdorf (mixi), grgecko, Dominik Bayerl, Misty de Meo, Lorenz Schwittmann, hasufell, Jan Heberer, dylanstrategie, Checkmaty, Faby
Also, big thanks to Matthes Bender 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.

15
README
View File

@ -17,7 +17,6 @@ Additionally, OpenClonk depends on a number of third-party libraries:
- The OpenGL Extension Wrangler Library (http://glew.sourceforge.net/)
- FreeALUT (https://github.com/vancegroup/freealut)
- libogg and libvorbis (https://www.xiph.org/downloads/)
- Qt >= 5.7 (https://www.qt.io/download-open-source/)
OS X Specific
=============
@ -30,13 +29,19 @@ Linux Specific
==============
For building OpenClonk on Linux, you need the following libraries in addition
to the ones listed above:
- SDL 2.0 (https://www.libsdl.org/download-2.0.php)
- GTK+ 3.4 or greater (http://www.gtk.org)
- libGL (http://www.mesa3d.org/)
- OpenAL Soft >= 1.13 (https://github.com/kcat/openal-soft)
- miniupnpc (http://miniupnp.free.fr/)
- SDL 1.2 (http://www.libsdl.org/download-1.2.php)
- SDL_mixer 1.2 (http://www.libsdl.org/projects/SDL_mixer/release-1.2.html)
- libupnp
- libxrandr
Most distributions should provide these dependencies via their packaging
system. At least gcc-4.9 is required.
system. For Debian based distributions, you will need these packages:
build-essential cmake imagemagick libfreetype6-dev libgl1-mesa-dev
libglew-dev libgtk-3-dev libjpeg-dev libpng-dev libsdl1.2-dev
libsdl-mixer1.2-dev libupnp-dev libxrandr-dev x11proto-core-dev
zlib1g-dev libalut0
At least gcc-4.9 is required.
Windows Specific
================

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2009-2018, The OpenClonk Team and contributors
# Copyright (c) 2009-2015, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -22,9 +22,9 @@ SET(C4PROJECT_URL "http://${C4PROJECT_DOMAIN}.${C4PROJECT_TLD}")
SET(C4ENGINENAME "OpenClonk")
SET(C4ENGINENICK "openclonk")
SET(C4XVER1 9)
SET(C4XVER1 7)
SET(C4XVER2 0)
# Set this variable to any string for pre-release versions, like "alpha" or
# "rc1". Don't supply a value (FALSE) for release versions.
SET(C4VERSIONEXTRA "alpha")
SET(C4VERSIONEXTRA FALSE)

View File

@ -1,32 +0,0 @@
version: "{build}"
pull_requests:
do_not_increment_build_number: true
shallow_clone: true
cache: ..\openclonk-cache
image: Visual Studio 2017
configuration: RelWithDebInfo
platform:
- x64
install:
- ps: "& $env:APPVEYOR_BUILD_FOLDER\\tools\\ci\\appv-Install.ps1"
before_build:
- ps: "& $env:APPVEYOR_BUILD_FOLDER\\tools\\ci\\appv-BeforeBuild.ps1"
build:
project: ../openclonk-build/openclonk.sln
parallel: true
verbosity: minimal
# The after_build and test_script scripts need to be called in a real
# powershell instance because they call into the MSBuild API, which has issues
# finding its data files when called from AppVeyor's powershell host, because
# it attempts to read the application config instead of the registry to find
# them (starting with MSBuild 15, which ships with Visual Studio 2017).
after_build:
- cmd: powershell -NoLogo -NoProfile -ExecutionPolicy Unrestricted -Command "& $env:APPVEYOR_BUILD_FOLDER\\tools\\ci\\appv-AfterBuild.ps1"
test_script:
- cmd: powershell -NoLogo -NoProfile -ExecutionPolicy Unrestricted -Command "& $env:APPVEYOR_BUILD_FOLDER\\tools\\ci\\appv-Test.ps1"
deploy: off

View File

@ -1,89 +0,0 @@
# The MIT License (MIT)
#
# Copyright (c) 2018 Nathan Osman
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
find_package(Qt5Core REQUIRED)
# Retrieve the absolute path to qmake and then use that path to find
# the windeployqt and macdeployqt binaries
get_target_property(_qmake_executable Qt5::qmake IMPORTED_LOCATION)
get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY)
find_program(WINDEPLOYQT_EXECUTABLE windeployqt HINTS "${_qt_bin_dir}")
if(WIN32 AND NOT WINDEPLOYQT_EXECUTABLE)
message(FATAL_ERROR "windeployqt not found")
endif()
find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_qt_bin_dir}")
if(APPLE AND NOT MACDEPLOYQT_EXECUTABLE)
message(FATAL_ERROR "macdeployqt not found")
endif()
# Add commands that copy the required Qt files to the same directory as the
# target after being built as well as including them in final installation
function(windeployqt target)
# Run windeployqt immediately after build
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E
env PATH="${_qt_bin_dir}" "${WINDEPLOYQT_EXECUTABLE}"
--verbose 0
--no-compiler-runtime
--no-angle
--release-with-debug-info
--no-translations
\"$<TARGET_FILE:${target}>\"
COMMENT "Deploying Qt..."
)
# windeployqt doesn't work correctly with the system runtime libraries,
# so we fall back to one of CMake's own modules for copying them over
# Doing this with MSVC 2015 requires CMake 3.6+
if((MSVC_VERSION VERSION_EQUAL 1900 OR MSVC_VERSION VERSION_GREATER 1900)
AND CMAKE_VERSION VERSION_LESS "3.6")
message(WARNING "Deploying with MSVC 2015+ requires CMake 3.6+")
endif()
set(CMAKE_INSTALL_UCRT_LIBRARIES TRUE)
include(InstallRequiredSystemLibraries)
foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
get_filename_component(filename "${lib}" NAME)
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E
copy_if_different "${lib}" \"$<TARGET_FILE_DIR:${target}>\"
COMMENT "Copying ${filename}..."
)
endforeach()
endfunction()
# Add commands that copy the required Qt files to the application bundle
# represented by the target.
function(macdeployqt target)
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${MACDEPLOYQT_EXECUTABLE}"
\"$<TARGET_FILE_DIR:${target}>/../..\"
-always-overwrite
COMMENT "Deploying Qt..."
)
endfunction()
mark_as_advanced(WINDEPLOYQT_EXECUTABLE MACDEPLOYQT_EXECUTABLE)

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2009-2016, The OpenClonk Team and contributors
# Copyright (c) 2009-2015, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -82,12 +82,23 @@ macro(__FINDAUDIO_FINDOPENAL)
endif()
endmacro()
macro(__FINDAUDIO_FINDSDLMIXER)
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(SDLMixer "SDL_mixer>=1.2.11")
endif()
endmacro()
if(Audio_TK)
# Already chosen, don't do anything
elseif(USE_CONSOLE)
# Dedicated servers don't need audio output
set(Audio_TK "none")
set(Audio_FOUND TRUE)
else()
# Test for OpenAL
__FINDAUDIO_FINDOPENAL()
find_package(SDL2Mixer)
__FINDAUDIO_FINDSDLMIXER()
if(OpenAL_FOUND AND Alut_FOUND AND OggVorbis_FOUND)
# Prefer OpenAL
@ -95,7 +106,7 @@ else()
if (NOT HAVE_ALEXT)
message(STATUS "Warning: Found OpenAL but no extensions (alext.h). Sound modifiers will be disabled.")
endif()
elseif(SDL2Mixer_FOUND)
elseif(SDLMixer_FOUND)
set(Audio_TK "SDL_Mixer")
endif()
endif()
@ -113,11 +124,11 @@ if(Audio_TK STREQUAL "OpenAL")
set(Audio_INCLUDE_DIRS ${Audio_INCLUDE_DIRS} ${Alut_INCLUDE_DIRS})
endif()
elseif(Audio_TK STREQUAL "SDL_Mixer")
find_package(SDL2Mixer)
if(SDL2Mixer_FOUND)
__FINDAUDIO_FINDSDLMIXER()
if(SDLMixer_FOUND)
set(Audio_FOUND TRUE)
set(Audio_LIBRARIES ${SDL2Mixer_LIBRARIES})
set(Audio_INCLUDE_DIRS ${SDL2Mixer_INCLUDE_DIRS})
set(Audio_LIBRARIES ${SDLMixer_LIBRARIES})
set(Audio_INCLUDE_DIRS ${SDLMixer_INCLUDE_DIRS})
endif()
elseif(Audio_TK STREQUAL "none")
set(Audio_FOUND TRUE)

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2011-2017, The OpenClonk Team and contributors
# Copyright (c) 2011-2015, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -18,23 +18,12 @@
# DBGHELP_LIBRARIES, the libraries needed to use DbgHelp.
# DBGHELP_FOUND, If false, do not try to use DbgHelp.
# MSVC knows how to find the Windows SDK on its own, and replicating that
# in CMake is very tricky, especially with the SDK's layout changing
# occasionally. So instead we'll just leave it to MSVC to do correctly.
if(MSVC AND NOT DEFINED DBGHELP_INCLUDE_DIR AND NOT DEFINED DBGHELP_LIBRARY)
set(DBGHELP_INCLUDE_DIR "")
set(DBGHELP_LIBRARY "dbghelp")
set(DBGHELP_FOUND TRUE)
endif()
find_path(DBGHELP_INCLUDE_DIR NAMES dbghelp.h PATH_SUFFIXES include)
set(DBGHELP_NAMES ${DBGHELP_NAMES} dbghelp)
find_library(DBGHELP_LIBRARY NAMES ${DBGHELP_NAMES})
if(NOT DBGHELP_FOUND)
find_path(DBGHELP_INCLUDE_DIR NAMES dbghelp.h PATH_SUFFIXES include)
set(DBGHELP_NAMES ${DBGHELP_NAMES} dbghelp)
find_library(DBGHELP_LIBRARY NAMES ${DBGHELP_NAMES})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DBGHELP DEFAULT_MSG DBGHELP_LIBRARY DBGHELP_INCLUDE_DIR)
endif()
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(DBGHELP DEFAULT_MSG DBGHELP_LIBRARY DBGHELP_INCLUDE_DIR)
if(DBGHELP_FOUND)
set(DBGHELP_LIBRARIES ${DBGHELP_LIBRARY})

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2014-2016, The OpenClonk Team and contributors
# Copyright (c) 2014-2015, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -19,8 +19,11 @@
# Use pkg-config if possible instead of doing guesswork like the default CMake module does
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
if(PKG_CONFIG_FOUND AND NOT APPLE)
set(_ft_pkgconfig_args "")
if(FREETYPE_FIND_REQUIRED)
set(_ft_pkgconfig_args "${_ft_pkgconfig_args}REQUIRED ")
endif()
if(FREETYPE_FIND_QUIET)
set(_ft_pkgconfig_args "${_ft_pkgconfig_args}QUIET ")
endif()

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2015-2016, The OpenClonk Team and contributors
# Copyright (c) 2015, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2015-2016, The OpenClonk Team and contributors
# Copyright (c) 2015, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2011-2016, The OpenClonk Team and contributors
# Copyright (c) 2011-2013, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -26,13 +26,6 @@ ENDIF (READLINE_INCLUDE_DIR)
FIND_PATH(READLINE_INCLUDE_DIR readline.h PATH_SUFFIXES readline)
# Unmodified readline depends on symbols from termcap without explicitly
# linking to it. Several distributions patch this to make it link against
# terminfo from ncurses or another termcap library, but some don't. To avoid
# having to run link tests, we'll just look for and use any termcap providing
# library.
FIND_LIBRARY(TERMCAP_LIBRARY NAMES tinfo termcap ncursesw ncurses cursesw curses)
SET(READLINE_NAMES readline libreadline)
FIND_LIBRARY(READLINE_LIBRARY NAMES ${READLINE_NAMES} )
@ -42,13 +35,10 @@ INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(READLINE DEFAULT_MSG READLINE_LIBRARY READLINE_INCLUDE_DIR)
IF(READLINE_FOUND)
if(TERMCAP_LIBRARY)
set(READLINE_LIBRARIES ${READLINE_LIBRARY} ${TERMCAP_LIBRARY})
else()
set(READLINE_LIBRARIES ${READLINE_LIBRARY})
endif()
SET( READLINE_LIBRARIES ${READLINE_LIBRARY} )
ELSE(READLINE_FOUND)
SET( READLINE_LIBRARIES )
ENDIF(READLINE_FOUND)
MARK_AS_ADVANCED( READLINE_LIBRARY TERMINFO_LIBRARY READLINE_INCLUDE_DIR )
MARK_AS_ADVANCED( READLINE_LIBRARY READLINE_INCLUDE_DIR )

View File

@ -1,41 +0,0 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2016, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
#
# "Clonk" is a registered trademark of Matthes Bender, used with permission.
# See accompanying file "TRADEMARK" for details.
#
# To redistribute this file separately, substitute the full license texts
# for the above references.
# Locate SDL2.
# This module defines
# SDL2_INCLUDE_DIRS - a list of directories that need to be added to the include path
# SDL2_LIBRARIES - a list of libraries to link against to use SDL2
# SDL2_FOUND - if false, SDL2 cannot be used
find_path(SDL2_INCLUDE_DIR SDL.h
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES SDL2 include
)
mark_as_advanced(SDL2_INCLUDE_DIR)
find_library(SDL2_LIBRARY
SDL2
HINTS
$ENV{SDL2DIR}
PATH_SUFFIXES lib
)
mark_as_advanced(SDL2_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
if (SDL2_FOUND)
set(SDL2_LIBRARIES "${SDL2_LIBRARY}")
set(SDL2_INCLUDE_DIRS "${SDL2_INCLUDE_DIR}")
endif()

View File

@ -1,37 +0,0 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2016, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
#
# "Clonk" is a registered trademark of Matthes Bender, used with permission.
# See accompanying file "TRADEMARK" for details.
#
# To redistribute this file separately, substitute the full license texts
# for the above references.
# Locate SDL_Mixer 2.
# This module defines
# SDL2Mixer_INCLUDE_DIRS - a list of directories that need to be added to the include path
# SDL2Mixer_LIBRARIES - a list of libraries to link against to use SDL2
# SDL2Mixer_FOUND - if false, SDL2 cannot be used
if(SDL2Mixer_FIND_QUIETLY)
set(_FIND_SDL2_ARG QUIET)
endif()
find_package(SDL2 ${_FIND_SDL2_ARG})
find_path(SDL2Mixer_INCLUDE_DIR SDL_mixer.h PATH_SUFFIXES SDL2 HINTS ENV SDL2DIR)
mark_as_advanced(SDL2Mixer_INCLUDE_DIR)
find_library(SDL2Mixer_LIBRARY SDL2_mixer HINTS ENV SDL2DIR)
mark_as_advanced(SDL2Mixer_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SDL2Mixer REQUIRED_VARS SDL2Mixer_LIBRARY SDL2Mixer_INCLUDE_DIR
SDL2_LIBRARIES SDL2_INCLUDE_DIRS)
if (SDL2Mixer_FOUND)
set(SDL2Mixer_LIBRARIES ${SDL2Mixer_LIBRARY} ${SDL2_LIBRARIES})
set(SDL2Mixer_INCLUDE_DIRS ${SDL2Mixer_INCLUDE_DIR} ${SDL2_INCLUDE_DIRS})
endif()

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2012-2016, The OpenClonk Team and contributors
# Copyright (c) 2012-2015, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -31,16 +31,22 @@ if(WIN32)
SET(UPNP_FOUND TRUE)
SET(UPNP_STYLE "Win32")
else()
find_path(UPNP_INCLUDE_DIR NAMES miniupnpc.h PATH_SUFFIXES miniupnpc)
set(UPNP_NAMES ${UPNP_NAMES} miniupnpc)
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})
if(UPNP_LIBRARY)
SET(UPNP_FOUND TRUE)
set(UPNP_LIBRARIES ${UPNP_LIBRARY})
include(FindPackageHandleStandardArgs)
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} ${THREADUTIL_LIBRARY} ${IXML_LIBRARY})
set(UPNP_INCLUDE_DIR ${UPNP_INCLUDE_DIR})
set(UPNP_STYLE "miniupnpc")
set(UPNP_STYLE "libupnp")
endif()
endif()
mark_as_advanced(UPNP_LIBRARY UPNP_INCLUDE_DIR)
mark_as_advanced(UPNP_LIBRARY IXML_LIBRARY UPNP_INCLUDE_DIR)

View File

@ -0,0 +1,76 @@
#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)
# Prepare environment
GET_FILENAME_COMPONENT(_name ${_input} NAME)
SET(_pchdir "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_targetName}_pch.dir")
MAKE_DIRECTORY(${_pchdir})
SET(_source "${CMAKE_CURRENT_SOURCE_DIR}/${_input}")
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
if(CMAKE_CXX_COMPILER_ARG1) # please, know what you're doing if you rely on this...
STRING(STRIP ${CMAKE_CXX_COMPILER_ARG1} _ccache_tweak)
SET(_ccache_tweak "\"${_ccache_tweak}\"")
endif()
SET(_compiler_FLAGS ${_ccache_tweak} ${CMAKE_CXX_FLAGS} ${${_flags_var_name}})
if(CMAKE_BUILD_TYPE)
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
LIST(APPEND _compiler_FLAGS "-D_DEBUG")
endif()
endif()
GET_TARGET_PROPERTY(_compile_defines ${_targetName} COMPILE_DEFINITIONS)
if(_compile_defines)
FOREACH(item ${_compile_defines})
STRING(REPLACE "\"" "\\\"" item ${item})
LIST(APPEND _compiler_FLAGS "-D${item}")
ENDFOREACH(item)
endif()
GET_TARGET_PROPERTY(_compile_defines ${_targetName} COMPILE_DEFINITIONS_${CMAKE_BUILD_TYPE})
if(_compile_defines)
FOREACH(item ${_compile_defines})
STRING(REPLACE "\"" "\\\"" item ${item})
LIST(APPEND _compiler_FLAGS "-D${item}")
ENDFOREACH(item)
endif()
GET_DIRECTORY_PROPERTY(_compile_defines COMPILE_DEFINITIONS)
if(_compile_defines)
FOREACH(item ${_compile_defines})
STRING(REPLACE "\"" "\\\"" item ${item})
LIST(APPEND _compiler_FLAGS "-D${item}")
ENDFOREACH(item)
endif()
GET_DIRECTORY_PROPERTY(_compile_defines COMPILE_DEFINITIONS_${CMAKE_BUILD_TYPE})
if(_compile_defines)
FOREACH(item ${_compile_defines})
STRING(REPLACE "\"" "\\\"" item ${item})
LIST(APPEND _compiler_FLAGS "-D${item}")
ENDFOREACH(item)
endif()
GET_DIRECTORY_PROPERTY(_directory_flags INCLUDE_DIRECTORIES)
FOREACH(item ${_directory_flags})
LIST(APPEND _compiler_FLAGS "-I\"${item}\"")
ENDFOREACH(item)
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
STRING(REPLACE "\"" "\\\"" _directory_flags ${_directory_flags}) # Welcome to escape hell. Replace " with \"
LIST(APPEND _compiler_FLAGS ${_directory_flags})
SEPARATE_ARGUMENTS(_compiler_FLAGS)
list(REMOVE_DUPLICATES _compiler_FLAGS)
# Add a target with the pch
ADD_CUSTOM_COMMAND(
OUTPUT ${_output}
COMMAND "${CMAKE_CXX_COMPILER}"
${_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)
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "-include ${_includeput}")
ENDMACRO(ADD_PRECOMPILED_HEADER)

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2012-2016, The OpenClonk Team and contributors
# Copyright (c) 2012-2013, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -28,33 +28,6 @@ function(git_get_changeset_id VAR)
OUTPUT_VARIABLE GIT_STATUS
)
string(REGEX MATCH "^[MADRC ][MD ]" WORKDIR_DIRTY "${GIT_STATUS}")
execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND "${GIT_EXECUTABLE}" "rev-parse" "--git-path" "index"
OUTPUT_VARIABLE GIT_INDEX
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
"${GIT_INDEX}"
)
execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND "${GIT_EXECUTABLE}" "show" "--format=%ci" "-s" "HEAD"
OUTPUT_VARIABLE GIT_TIMESTAMP
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(DEFINED ENV{C4REVISION_BRANCH})
set(GIT_BRANCH "$ENV{C4REVISION_BRANCH}")
else()
execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND "${GIT_EXECUTABLE}" "symbolic-ref" "--short" "HEAD"
RESULT_VARIABLE GIT_RESULT
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT GIT_RESULT EQUAL 0)
set(GIT_BRANCH "unknown")
endif()
endif()
endif()
endif()
if (NOT C4REVISION)
@ -71,19 +44,9 @@ function(git_get_changeset_id VAR)
string(SUBSTRING "${C4REVISION}" 6 12 C4REVISION)
endif()
unset(revlength)
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/.git_archival" C4REVISION_TS
LIMIT_COUNT 1
REGEX "date: .+"
)
string(SUBSTRING "${C4REVISION_TS}" 6 -1 GIT_TIMESTAMP)
set(GIT_BRANCH "unknown")
endif()
if(WORKDIR_DIRTY)
set(WORKDIR_DIRTY 1)
set(C4REVISION "${C4REVISION}+")
endif()
set(${VAR} "${C4REVISION}" PARENT_SCOPE)
set(${VAR}_DIRTY ${WORKDIR_DIRTY} PARENT_SCOPE)
set(${VAR}_TS "${GIT_TIMESTAMP}" PARENT_SCOPE)
set(${VAR}_BRANCH "${GIT_BRANCH}" PARENT_SCOPE)
endfunction()

View File

@ -1,37 +0,0 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2018, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
#
# "Clonk" is a registered trademark of Matthes Bender, used with permission.
# See accompanying file "TRADEMARK" for details.
#
# To redistribute this file separately, substitute the full license texts
# for the above references.
# GCC6 doesn't work well with CMake while cross-compiling. See bugs:
# https://gitlab.kitware.com/cmake/cmake/issues/16291
# https://gitlab.kitware.com/cmake/cmake/issues/16919
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129
function(HANDLE_GCC_CROSS_INCLUDE_PATHS _lang _gcc_lang_flag)
set(_compiler "${CMAKE_${_lang}_COMPILER}")
set(_compile_flags "${CMAKE_${_lang}_FLAGS}")
separate_arguments(_compile_flags UNIX_COMMAND "${_compile_flags}")
execute_process(
COMMAND ${_compiler} ${_compile_flags} -v -E -x ${_gcc_lang_flag} /dev/null
OUTPUT_QUIET
ERROR_VARIABLE _compiler_output
)
if ("${_compiler_output}" MATCHES "#include <\\.\\.\\.> search starts here:\n *(.*)\nEnd of search list\\.")
string(REGEX REPLACE "[\n ]+" " " _search_list "${CMAKE_MATCH_1}")
separate_arguments(_search_list)
foreach(_directory ${_search_list})
get_filename_component(_fixed_component "${_directory}" REALPATH)
set(_resolved_list ${_resolved_list} "${_fixed_component}")
endforeach()
set(CMAKE_${_lang}_IMPLICIT_INCLUDE_DIRECTORIES ${CMAKE_${_lang}_IMPLICIT_INCLUDE_DIRECTORIES} ${_resolved_list} PARENT_SCOPE)
endif()
endfunction()

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2013-2016, The OpenClonk Team and contributors
# Copyright (c) 2013, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2009-2016, The OpenClonk Team and contributors
# Copyright (c) 2009-2015, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -23,7 +23,13 @@ git_get_changeset_id(C4REVISION)
# Get year
############################################################################
STRING(TIMESTAMP C4COPYRIGHT_YEAR "%Y")
IF(CMAKE_HOST_UNIX)
EXECUTE_PROCESS(COMMAND "date" "+%Y" OUTPUT_VARIABLE DATE)
ELSEIF(CMAKE_HOST_WIN32)
EXECUTE_PROCESS(COMMAND "cscript.exe" "//nologo" "${CMAKE_CURRENT_SOURCE_DIR}/tools/get_current_year.vbs" OUTPUT_VARIABLE DATE)
ENDIF()
STRING(REGEX REPLACE "(.+)\n" "\\1" YEARFIXED "${DATE}")
SET(C4COPYRIGHT_YEAR ${YEARFIXED})
############################################################################
# Build version strings

View File

@ -2,8 +2,8 @@
/* Generate minidumps on crash */
#cmakedefine HAVE_DBGHELP 1
/* Use backward-cpp to print stack traces on crash */
#cmakedefine HAVE_BACKWARD 1
/* Define to 1 if you have the <direct.h> header file. */
#cmakedefine HAVE_DIRECT_H 1
/* The backtrace function is declared in execinfo.h and works */
#cmakedefine HAVE_EXECINFO_H 1
@ -11,6 +11,9 @@
/* Define to 1 if you have the <history.h> header file. */
#cmakedefine HAVE_HISTORY_H 1
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H 1
/* Define to 1 if you have the <io.h> header file. */
#cmakedefine HAVE_IO_H 1
@ -20,6 +23,9 @@
/* Define to 1 if you have the <locale.h> header file. */
#cmakedefine HAVE_LOCALE_H 1
/* Define to 1 if your stdlib has std::make_unique */
#cmakedefine HAVE_MAKE_UNIQUE 1
/* Define to 1 if you have the <poll.h> header file. */
#cmakedefine HAVE_POLL_H 1
@ -35,6 +41,9 @@
/* Define to 1 if you have the <signal.h> header file. */
#cmakedefine HAVE_SIGNAL_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H 1
/* Define to 1 if you have the <sys/eventfd.h> header file. */
#cmakedefine HAVE_SYS_EVENTFD_H 1
@ -59,18 +68,42 @@
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H 1
/* Define to 1 if your compiler supports variadic templates */
#cmakedefine HAVE_VARIADIC_TEMPLATES 1
/* Define to 1 if you have the `vasprintf' function. */
#cmakedefine HAVE_VASPRINTF 1
/* Define to 1 if you have the `__mingw_vasprintf' function. */
#cmakedefine HAVE___MINGW_VASPRINTF 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
/* compile without debug options */
#cmakedefine NDEBUG 1
/* MP3 music */
#cmakedefine USE_MP3 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
/* Use Apple Cocoa for the UI */
#cmakedefine USE_COCOA 1
/* Enable automatic update system */
#cmakedefine WITH_AUTOMATIC_UPDATE 1
/* Developer mode */
#cmakedefine WITH_DEVELOPER_MODE 1
/* Define to 1 if the userParam parameter to GLDEBUGPROCARB is const, as the
spec requires. */
#cmakedefine GLDEBUGPROCARB_USERPARAM_IS_CONST 1
@ -81,36 +114,27 @@
/* compile with debug options */
#cmakedefine _DEBUG 1
#ifndef USE_CONSOLE
/* The widgets for the windows and the editor GUI */
#cmakedefine USE_SDL_MAINLOOP 1
#cmakedefine USE_WIN32_WINDOWS 1
#cmakedefine USE_COCOA 1
#cmakedefine USE_GTK 1
/* Enable automatic update system */
#cmakedefine WITH_AUTOMATIC_UPDATE 1
#cmakedefine WITH_APPDIR_INSTALLATION 1
/* Define to 1 if you have support for precompiled headers */
#cmakedefine HAVE_PRECOMPILED_HEADERS 1
/* Select an audio provider */
#define AUDIO_TK AUDIO_TK_${Audio_TK_UPPER}
#else
#define AUDIO_TK AUDIO_TK_NONE
#endif // USE_CONSOLE
#define AUDIO_TK_NONE 0
#define AUDIO_TK_OPENAL 1
#define AUDIO_TK_SDL_MIXER 3
#define AUDIO_TK AUDIO_TK_${Audio_TK_UPPER}
/* Include OpenAL extensions (alext.h) for sound modifiers */
#cmakedefine HAVE_ALEXT 1
/* Path to data directory */
#ifdef WITH_APPDIR_INSTALLATION
#define OC_SYSTEM_DATA_DIR "../share/games/openclonk"
#else
#define OC_SYSTEM_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/games/openclonk"
#endif
#ifdef USE_CONSOLE
/* FIXME: Sort this out in CMake instead of here */
#undef USE_COCOA
#undef USE_SDL_MAINLOOP
#undef USE_X11
#undef WITH_AUTOMATIC_UPDATE
#undef WITH_DEVELOPER_MODE
/* Path to /proc/self/exe (Linux) or equivalent */
#cmakedefine PROC_SELF_EXE "${PROC_SELF_EXE}"
#undef AUDIO_TK
#define AUDIO_TK AUDIO_TK_NONE
#endif

View File

@ -19,7 +19,6 @@ HHC = hhc.exe
MKDIR_P = mkdir -p
CP = cp
CP_R = cp -r
NODE = node
stylesheet = clonk.xsl
@ -30,10 +29,9 @@ 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))
xmlfiles-de := $(subst sdk, sdk-de, $(xmlfiles))
# misc
extra-files := $(sort $(wildcard *.css *.js images/*.*) lunr.js)
extra-files := $(sort $(wildcard *.css *.php *.js images/*.*))
extra-files-chm := $(sort $(wildcard *.css *.js images/*.*))
# Targets:
@ -48,16 +46,15 @@ sdk-de-dirs := $(subst sdk, sdk-de, $(sdk-dirs))
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)))
online-index-files := $(foreach lang, en de, $(addprefix online/$(lang)/, index.json))
# For Entwickler.chm
chm-dirs := $(foreach lang, en de, $(addprefix chm/$(lang)/, . $(sdk-dirs) images))
.PHONY: all online-en chm install check clean
all: $(sdk-de-dirs) $(online-dirs) $(online-sdk-files) $(online-extra-files) $(online-index-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) index.json)
online-en: $(addprefix online/en/, $(sdk-dirs) images $(htmlfiles) sdk/content.html $(extra-files))
chm: $(sdk-de-dirs) $(chm-dirs) chm/en/Developer.chm chm/de/Entwickler.chm
@ -72,36 +69,23 @@ clean:
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) tools/build_contents.py tools/experimental.py
sdk/content.xml: sdk/content.xml.in $(xmlfiles) build_contents.py experimental.py
@echo generate $@
@python2 tools/build_contents.py $(xmlfiles)
@python build_contents.py $(xmlfiles)
# Node dependencies for index.
node_modules/.make: package.json
npm install
@touch $@
lunr.js: node_modules/.make
$(CP) node_modules/lunr/lunr.js $@
online/en/index.json: node_modules/.make $(xmlfiles) tools/build_index.js
@$(NODE) tools/build_index.js $@ $(xmlfiles)
online/de/index.json: node_modules/.make $(xmlfiles-de) tools/build_index.js
@$(NODE) tools/build_index.js $@ $(xmlfiles-de)
chm/en/Output.hhp: $(xmlfiles) chm/en/. tools/build_hhp.py Template.hhp
chm/en/Output.hhp: $(xmlfiles) chm/en/. build_hhp.py Template.hhp
@echo generate $@
@python2 tools/build_hhp.py $@ Template.hhp $(xmlfiles)
chm/de/Output.hhp: $(xmlfiles) chm/de/. tools/build_hhp.py Template.de.hhp
@python build_hhp.py $@ Template.hhp $(xmlfiles)
chm/de/Output.hhp: $(xmlfiles) chm/de/. build_hhp.py Template.de.hhp
@echo generate $@
@python2 tools/build_hhp.py $@ Template.de.hhp $(xmlfiles)
@python build_hhp.py $@ Template.de.hhp $(xmlfiles)
$(sdk-de-dirs) $(online-dirs) $(chm-dirs):
mkdir -p $@
doku.pot: $(xmlfiles) extra-strings.xml sdk/content.xml.in tools/xml2po.py tools/clonk.py
doku.pot: $(xmlfiles) extra-strings.xml sdk/content.xml.in xml2po.py clonk.py
@echo extract strings to $@
@python2 tools/xml2po.py -e -m clonk -o $@ $(xmlfiles) extra-strings.xml sdk/content.xml.in
@python xml2po.py -e -m clonk -o $@ $(xmlfiles) extra-strings.xml sdk/content.xml.in
%.po: doku.pot
@echo update $@
@ -112,9 +96,9 @@ doku.pot: $(xmlfiles) extra-strings.xml sdk/content.xml.in tools/xml2po.py tools
@echo compile $@
@msgfmt --statistics -o $@ $<
sdk-de/%.xml: sdk/%.xml de.mo tools/xml2po.py tools/clonk.py
sdk-de/%.xml: sdk/%.xml de.mo xml2po.py clonk.py
@echo generate $@
@python2 tools/xml2po.py -e -m clonk -t de.mo -o $@ $<
@python xml2po.py -e -m clonk -t de.mo -o $@ $<
define run-xslt
@echo generate $@

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import xml.sax

View File

@ -35,12 +35,7 @@
</title>
</xsl:template>
<xsl:template match="script">
<xsl:copy>
<xsl:for-each select="@*">
<xsl:copy />
</xsl:for-each>
<xsl:apply-templates />
</xsl:copy>
<xsl:copy><xsl:apply-templates select="@*|node()" /></xsl:copy>
</xsl:template>
<xsl:template match="func|const" mode="head">
<xsl:apply-templates mode="head" />
@ -341,7 +336,7 @@
</xsl:if>
<xsl:if test="position() mod 2=0"><xsl:attribute name="class">dark</xsl:attribute></xsl:if>
<xsl:for-each select="col|literal_col">
<td><xsl:apply-templates select="@colspan|@id|node()"/></td>
<td><xsl:apply-templates select="@colspan|node()"/></td>
</xsl:for-each>
</tr>
</xsl:for-each>
@ -354,6 +349,16 @@
<caption><xsl:apply-templates select="@id|node()" /></caption>
</xsl:template>
<xsl:template match="search">
<xsl:if test="not($chm)">
<form action="../search.php" method="get">
<input name="search" type="text"></input>
<input type="submit" name="func" value="Search"></input>
<input type="submit" name="fulltext" value="Fulltext"></input>
</form>
</xsl:if>
</xsl:template>
<xsl:template match="table/bitmask">
<xsl:value-of select="." />:
<input id="input" onKeyUp="Calc();" name="input" type="text">
@ -511,7 +516,7 @@
<xsl:template name="color2">
<xsl:param name="s" select="." />
<!-- the list of keywords -->
<xsl:param name="t" select="'#include|#appendto|#warning|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|new|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)" />

11363
docs/de.po

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
@font-face{
font-family: Endeavour;
/*src: url('/Endeavour.eot');
src: local('Endeavour'),url('/Endeavour.ttf') format("truetype");*/
src: url('/Endeavour.eot');
src: local('Endeavour'),url('/Endeavour.ttf') format("truetype");
}
body {
@ -243,6 +243,10 @@ ul.nav a {
text-decoration: none;
}
ul.nav a:hover, ul.nav a:hover {
background: #333 url(images/stripe-wide.gif) left repeat-x;
}
ul.nav li.switchlang img {
margin: 0;
}

View File

@ -3,19 +3,19 @@ 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>
<style type="text/css">@import url("https://www.openclonk.org/header/header.css");</style>
<style type="text/css">@import url("http://www.openclonk.org/header/header.css");</style>
<div id="nav_header">
<div id="nav_doclangswitch">
<a href="https://docs.openclonk.org/en/sdk/" target="_top"><img src="https://forum.openclonk.org/flags/gb.png"/></a>
<a href="https://docs.openclonk.org/de/sdk/" target="_top"><img src="https://forum.openclonk.org/flags/de.png"/></a>
<a href="http://docs.openclonk.org/en/sdk/" target="_top"><img src="http://forum.openclonk.org/flags/gb.png"/></a>
<a href="http://docs.openclonk.org/de/sdk/" target="_top"><img src="http://forum.openclonk.org/flags/de.png"/></a>
</div>
<div id="nav_search">
<form action="https://www.openclonk.org/header/search.php" id="nav_searchform" method="get" target="_top"><div>
<form action="http://www.openclonk.org/header/search.php" id="nav_searchform" method="get" target="_top"><div>
<input id="nav_searchInput" name="s" type="text" value="search" onfocus="if(this.value == 'search') { this.value = ''; }" onblur="if(this.value == '') { this.value = 'search'; }"/> in the
<select value="docs" name="p">
<select name="p">
<option value="blog">blog</option>
<option value="wiki">website</option>
<option value="forum">forum</option>
@ -29,21 +29,21 @@ clonk.xsl also uses it to match the processing for it. -->
</div>
<div id="nav_logo">
<a href="https://www.openclonk.org/" target="_top"><img src="https://www.openclonk.org/header/logo.png" width="450" height="94" alt="OpenClonk"/></a>
<a href="http://www.openclonk.org/" target="_top"><img src="http://www.openclonk.org/header/logo.png" width="450" height="94" alt="OpenClonk"/></a>
</div>
<div id="nav_navigation">
<div id="nav_links">
<ul>
<li><a href="https://www.openclonk.org/" target="_top">Home</a></li>
<li><a href="https://www.openclonk.org/download/" target="_top">Download</a></li>
<li><a href="https://blog.openclonk.org/" target="_top">Blog</a></li>
<li><a href="https://forum.openclonk.org/" target="_top">Forum</a></li>
<li><a href="https://league.openclonk.org/" target="_top">League</a></li>
<li><a href="https://wiki.openclonk.org/w/C4Script_Documentation" target="_top">Docs</a></li>
<li><a href="https://wiki.openclonk.org/w/Development" target="_top">Developers</a></li>
<li><a href="https://git.openclonk.org/openclonk.git" target="_top">Repository</a></li>
<li><a href="https://bugs.openclonk.org" target="_top">Bugs</a></li>
<li><a href="http://www.openclonk.org/" target="_top">Home</a></li>
<li><a href="http://www.openclonk.org/download/" target="_top">Download</a></li>
<li><a href="http://blog.openclonk.org/" target="_top">Blog</a></li>
<li><a href="http://forum.openclonk.org/" target="_top">Forum</a></li>
<li><a href="http://league.openclonk.org/" target="_top">League</a></li>
<li><a href="http://wiki.openclonk.org/w/C4Script_Documentation" target="_top">Docs</a></li>
<li><a href="http://wiki.openclonk.org/w/Development" target="_top">Developers</a></li>
<li><a href="http://git.openclonk.org/openclonk.git" target="_top">Repository</a></li>
<li><a href="http://bugs.openclonk.org" target="_top">Bugs</a></li>
</ul>
</div>
</div>

32
docs/package-lock.json generated
View File

@ -1,32 +0,0 @@
{
"name": "openclonk-docs",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"lunr": {
"version": "2.1.6",
"resolved": "https://registry.npmjs.org/lunr/-/lunr-2.1.6.tgz",
"integrity": "sha512-ydJpB8CX8cZ/VE+KMaYaFcZ6+o2LruM6NG76VXdflYTgluvVemz1lW4anE+pyBbLvxJHZdvD1Jy/fOqdzAEJog=="
},
"sax": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
},
"xml2js": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",
"integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==",
"requires": {
"sax": "1.2.4",
"xmlbuilder": "9.0.7"
}
},
"xmlbuilder": {
"version": "9.0.7",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz",
"integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0="
}
}
}

View File

@ -1,22 +0,0 @@
{
"name": "openclonk-docs",
"version": "1.0.0",
"description": "Developer documentation for OpenClonk",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/openclonk/openclonk.git"
},
"author": "The OpenClonk Team",
"license": "ISC",
"bugs": {
"url": "https://github.com/openclonk/openclonk/issues"
},
"homepage": "https://github.com/openclonk/openclonk#readme",
"dependencies": {
"lunr": "^2.1.6",
"xml2js": "^0.4.19"
}
}

View File

@ -56,7 +56,7 @@
<dd>
<text>Searches for a network game on the specified address and joins it. No local scenario (*.ocs) should be specified. Implies --network.</text>
</dd>
<dt id="clonkp">[open]clonk://&lt;<em>Address</em>&gt;/</dt>
<dt id="clonkp">clonk://&lt;<em>Address</em>&gt;/</dt>
<dd>
<text>Same as --join if an address is specified. If "update" is specified as an address, this will cause the engine to perform an update check instead.</text>
</dd>

View File

@ -131,21 +131,14 @@
<![CDATA[
(function() {
function navigate(url) {
var urlsplit = url.split("#");
var xhr = new XMLHttpRequest();
xhr.open('GET', urlsplit[0]);
xhr.open('GET', url.split("#")[0]);
xhr.onreadystatechange = function (e) {
if (xhr.readyState === 4) {
var d = parent.document;
var r = xhr.responseText;
d.getElementById("content").innerHTML = r.split('<div id="content">')[1];
d.title = r.slice(r.indexOf("<title>")+7, r.indexOf("</title>"));
if (urlsplit.length > 1) {
var scrolltarget = d.getElementById(urlsplit[1]);
if (scrolltarget) {
scrolltarget.scrollIntoView();
}
}
}
};
xhr.send();
@ -211,10 +204,6 @@
window.scrollTo(0, y0);
}
})();
// Collapse the index.
document.querySelector('.index > img').onclick();
]]>
</script>
<script src="../lunr.js"></script>
<script src="../search.js"></script>
</toc>

View File

@ -5,7 +5,7 @@
<doc>
<title>CNAT - Contact Attachment</title>
<h>CNAT - Contact Attachment</h>
<text>In multiple places the engine uses ContactAttachment values (a bitmask) to manage the orientation of objects and processes. For example, a vertex of an object can have the <code id="CNAT">CNAT</code> bit <em>left</em>. If that object has <emlink href="definition/properties.html">ContactCalls</emlink> activated, the engine calls on every contact of that vertex with the landscape the object script function <em>ContactLeft</em>. CNAT values are composed of the following bits:</text>
<text>In multiple places the engine uses ContactAttachment values (a bitmask) to manage the orientation of objects and processes. For example, a vertex of an object can have the <code id="CNAT">CNAT</code> bit <em>left</em>. If that object has <emlink href="definition/defcore.html">ContactCalls</emlink> activated, the engine calls on every contact of that vertex with the landscape the object script function <em>ContactLeft</em>. CNAT values are composed of the following bits:</text>
<text>
<table>
<rowh>
@ -40,10 +40,6 @@
<col>CNAT_NoCollision</col>
<col>Extra flag: non-colliding vertex</col>
</row>
<row>
<col>CNAT_PhaseHalfVehicle</col>
<col>Extra flag: Entirely suppress collisions with HalfVehicle</col>
</row>
<bitmask>CNAT</bitmask>
</table>
</text>

View File

@ -35,6 +35,11 @@
<col>Integer</col>
<col>Category of the object. Also see <emlink href="definition/category.html">object categories</emlink>.</col>
</row>
<row>
<literal_col>ContactCalls</literal_col>
<col>Integer</col>
<col>0 or 1. If 1, Contactcalls are called in the object script.</col>
</row>
<row>
<literal_col>Width</literal_col>
<col>Integer</col>
@ -60,6 +65,11 @@
<col>Integer</col>
<col>Weight of the object. Rock 10, clonk 50, hut 1000, castle 10000.</col>
</row>
<row>
<literal_col>Components</literal_col>
<col>ID list</col>
<col>Elements from which the object is composed. Uncompleted or half grown objects will only have the respective fraction of the components.</col>
</row>
<row>
<literal_col>SolidMask</literal_col>
<col>6 integers</col>
@ -110,10 +120,15 @@
<col>4 integers</col>
<col>Position of the intake region relative to the object centre.</col>
</row>
<row>
<literal_col>FireTop</literal_col>
<col>Integer</col>
<col>Flame distance to the object's bottom line.</col>
</row>
<row>
<literal_col>Exclusive</literal_col>
<col>Integer</col>
<col>0 or 1. Determines whether the object blocks objects behind it. Exclusive objects also block the placement of a construction site at an overlapping location.</col>
<col>0 or 1. Determines whether the object blocks objects behind it.</col>
</row>
<row>
<literal_col>Line</literal_col>
@ -175,6 +190,11 @@
<col>Integer</col>
<col>0 or 1. The object can be scaled over 100% using DoCon.</col>
</row>
<row>
<literal_col>AttractLightning</literal_col>
<col>Integer</col>
<col>0 or 1. The object attracts lightning.</col>
</row>
<row>
<literal_col>Fragile</literal_col>
<col>Integer</col>
@ -196,7 +216,7 @@
<col>1 - 10. Determines search depth of the pathfinder algorithm (default 1). Warning: higher values may slow down the game. By setting this value you can also enable non-CrewMember objects to use pathfinding when executing commands.</col>
</row>
<row>
<literal_col>NoMassFromContents</literal_col>
<literal_col>NoComponentMass</literal_col>
<col>Integer</col>
<col>0 or 1. If 1, the object's contents is not added to the object's total mass. This can be used to prevent small container objects from turning into killer throwing items.</col>
</row>
@ -260,11 +280,6 @@
<col>Integer</col>
<col>0 or 1. If 1 the object's pathfinding will ignore any transfer zones.</col>
</row>
<row>
<literal_col>HideInCreator</literal_col>
<col>Boolean</col>
<col>false (default) or true. If true, the definition is not shown in the object creator window of the editor. Should be used for internal definitions, libraries, etc.</col>
</row>
</table>
</text>
</part>

View File

@ -27,9 +27,9 @@
</dl>
<h id="RasterGraphics">Raster Graphics</h>
<dl>
<dt id="Graphicspng"><img height="16" src="../../images/icon_image.png" width="16"/>Graphics.png/Graphics.*.png</dt>
<dt id="Graphicspng"><img height="16" src="../../images/icon_image.png" width="16"/>Graphics.png</dt>
<dd>
<text>Graphics of the object. Base graphics, animation phases and a picture for display in menus are stored in a 32 bit picture with transparency channel (PNG format, 32 bit RGBA color, non interlaced). An optional zoom factor for high-resolution graphics can be provided in the '*'-portion of the name.</text>
<text>Graphics of the object. Base graphics, animation phases and a picture for display in menus are stored in a 32 bit picture with transparency channel (PNG format, 32 bit RGBA color, non interlaced).</text>
</dd>
<dt id="Overlaypng"><img height="16" src="../../images/icon_image.png" width="16"/>Overlay.png</dt>
<dd>
@ -39,7 +39,7 @@
<dd>
<text>An optional normal map for the object, where the red, green and blue components in the image correspond to the normal vectors to be used for the lighting of the object. If this file is not present, the normal vector at each pixel points straight into Z direction (outside of the screen).</text>
</dd>
<dt id="Graphicsex"><img height="16" src="../../images/icon_image.png" width="16"/>Graphics*.png/Overlay*.png (Graphics*.*.png/Overlay*.*.png)</dt>
<dt id="Graphicsex"><img height="16" src="../../images/icon_image.png" width="16"/>Graphics*.png/Overlay*.png</dt>
<dd>
<text>Objects can also contain alternative sets of graphics which can be selected ingame using the script command <funclink>SetGraphics</funclink>(). The name corresponds to the file name portion following "Graphics". The matching overlay is automatically selected. For more information see <funclink>SetGraphics</funclink>().</text>
</dd>

View File

@ -14,6 +14,6 @@
<text>This script turns all rotatable objects upside down.</text>
<h id="ocf_fns">OCF Constants</h>
<text>The following OCFs are defined in C4Script:</text>
<text><funclink>OCF_Alive</funclink>, <funclink>OCF_Available</funclink>, <funclink>OCF_Chop</funclink>, <funclink>OCF_Collectible</funclink>, <funclink>OCF_Collection</funclink>, <funclink>OCF_Construct</funclink>, <funclink>OCF_Container</funclink>, <funclink>OCF_CrewMember</funclink>, <funclink>OCF_Entrance</funclink>, <funclink>OCF_Exclusive</funclink>, <funclink>OCF_Fullcon</funclink>, <funclink>OCF_Grab</funclink>, <funclink>OCF_HitSpeed1</funclink>, <funclink>OCF_HitSpeed2</funclink>, <funclink>OCF_HitSpeed3</funclink>, <funclink>OCF_HitSpeed4</funclink>, <funclink>OCF_Inflammable</funclink>, <funclink>OCF_InFree</funclink>, <funclink>OCF_InLiquid</funclink>, <funclink>OCF_InSolid</funclink>, <funclink>OCF_Living</funclink>, <funclink>OCF_NotContained</funclink>, <funclink>OCF_OnFire</funclink>, <funclink>OCF_Rotate</funclink></text>
<text><funclink>OCF_Alive</funclink>, <funclink>OCF_AttractLightning</funclink>, <funclink>OCF_Available</funclink>, <funclink>OCF_Chop</funclink>, <funclink>OCF_Collectible</funclink>, <funclink>OCF_Collection</funclink>, <funclink>OCF_Construct</funclink>, <funclink>OCF_Container</funclink>, <funclink>OCF_CrewMember</funclink>, <funclink>OCF_Entrance</funclink>, <funclink>OCF_Exclusive</funclink>, <funclink>OCF_Fullcon</funclink>, <funclink>OCF_Grab</funclink>, <funclink>OCF_HitSpeed1</funclink>, <funclink>OCF_HitSpeed2</funclink>, <funclink>OCF_HitSpeed3</funclink>, <funclink>OCF_HitSpeed4</funclink>, <funclink>OCF_Inflammable</funclink>, <funclink>OCF_InFree</funclink>, <funclink>OCF_InLiquid</funclink>, <funclink>OCF_InSolid</funclink>, <funclink>OCF_Living</funclink>, <funclink>OCF_NotContained</funclink>, <funclink>OCF_OnFire</funclink>, <funclink>OCF_Rotate</funclink></text>
<author>Sven2</author><date>2002-05</date>
</doc>

View File

@ -101,7 +101,7 @@
<row id="CONNECT">
<col>DFA_CONNECT</col>
<col>Line connections</col>
<col>Only <emlink href="definition/lineconnect.html">line objects</emlink>. Connects <emlink href="script/fn/SetAction.html">target object 1</emlink> and <emlink href="script/fn/SetAction.html">target object 2</emlink>.</col>
<col>Only <emlink href="definition/lineconnect.html">line objects</emlink>. Connects <emlink href="script/fn/SetAction.html">target object 1</emlink> and <emlink href="script/fn/SetAction.html">target object 2</emlink>. If property LineMaxDistance is a nonzero integer, the line breaks when the target objects are further apart than the given distance.</col>
<col>CNAT_None</col>
</row>
<row id="PULL">

View File

@ -28,7 +28,7 @@ Stand = {
<row>
<col><code>Prototype</code></col>
<col>proplist</col>
<col>Deprecated. Use <funclink>SetPrototype</funclink> and <funclink>GetPrototype</funclink>.</col>
<col></col>
</row>
<row>
<col><code>Name</code></col>
@ -133,7 +133,7 @@ Stand = {
<row id="Plane">
<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. Global particles are on 900.</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 id="SolidMaskPlane">
<col><code>SolidMaskPlane</code></col>
@ -168,38 +168,18 @@ Stand = {
<row>
<literal_col>ContactIncinerate</literal_col>
<col>Integer</col>
<col>Probability of incineration by contact: 0 none, or 1 (high) to 5 (low). Implies MaterialIncinerate.</col>
</row>
<row>
<literal_col>MaterialIncinerate</literal_col>
<col>bool</col>
<col>Incineration when submerged in incendiary material.</col>
</row>
<row>
<literal_col>FireproofContainer</literal_col>
<col>bool</col>
<col>Anything contained in this object does not catch fire when submerged in incendiary material.</col>
<col>Probability of incineration by contact: 0 none, or 1 (high) to 5 (low).</col>
</row>
<row>
<literal_col>EditCursorCommands</literal_col>
<col>Array</col>
<col>Array of functions made available in the context menu when right-clicking an object in the editor. Functions may be either strings (like "Explode(20)") or function pointers (like this.Hit). Function pointers are always called by name.</col>
<col>Array of functions made available in the context menu when right-clicking an object in the editor. Functions may be either strings (like "Explode(20)") or function pointers (like this.Hit). Function pointers are always called by name. Windows only.</col>
</row>
<row>
<literal_col>BorderBound</literal_col>
<col>Integer</col>
<col>Bit mask indicating object boundaries: stop at map sides (C4D_Border_Sides), stop at map top (C4D_Border_Top), stop at map bottom (C4D_Border_Sides), stop at object layer boundaries (C4D_Border_Layer). For example BorderBound = C4D_Border_Top | C4D_Border_Bottom.</col>
</row>
<row>
<literal_col>ContactCalls</literal_col>
<col>bool</col>
<col>True or false. If true, <emlink href="definition/cnat.html">ContactCalls</emlink> are called in the object script.</col>
</row>
<row>
<literal_col>Components</literal_col>
<col>array</col>
<col>List of definitions and counts specifying the components of an object. Example: Components = {Rock = 1, Wood = 3};</col>
</row>
</table>
</text>
</part>

View File

@ -33,11 +33,6 @@
<col>Parameter</col>
<col>Description</col>
</rowh>
<row id="Initialize">
<literal_col>Definition</literal_col>
<col></col>
<col>Called in definition context after all definitions have been loaded and before definition properties are frozen. Use this callback to initialize complex definition properties such as EditorProps or dependencies between definitions. Definition() callbacks are performed in descending order of the DefinitionPriority property or 0 if that property is not defined.</col>
</row>
<row id="Initialize">
<literal_col>Initialize</literal_col>
<col></col>
@ -53,11 +48,6 @@
<col></col>
<col>When the object is removed.</col>
</row>
<row id="EditorInitialize">
<literal_col>EditorInitialize</literal_col>
<col></col>
<col>Called after Construction and Initialize when the object is placed in the editor.</col>
</row>
<row id="Hit">
<literal_col>Hit</literal_col>
<col></col>
@ -198,15 +188,15 @@
<col>object by</col>
<col>Called before the object is hit or punched by another object. By returning <code>true</code>, QueryCatchBlow can reject physical blows.</col>
</row>
<row id="OnLineBreak">
<literal_col>OnLineBreak</literal_col>
<row id="LineBreak">
<literal_col>LineBreak</literal_col>
<col>int cause</col>
<col>When a line object is broken. cause: 0 by movement, 1 because of a missing or incomplete target object.</col>
</row>
<row id="OnLineChange">
<literal_col>OnLineChange</literal_col>
<col>int cause</col>
<col>When a line object is changed, that is when one of it vertices changed its position.</col>
<row id="BuildNeedsMaterial">
<literal_col>BuildNeedsMaterial</literal_col>
<col>id material_definition, int amount</col>
<col>When the object is building another object and building material is required. The parameters are the type and amount of the first needed material. If this function returns <code>true</code>, no material message is displayed above the object.</col>
</row>
<row id="AttachTargetLost">
<literal_col>AttachTargetLost</literal_col>
@ -343,16 +333,22 @@
<col>int player, int new_team, int old_team</col>
<col>Callback in game goal, rule, and environment objects and in the scenario script. Called when a player has successfully switch from old_team to new_team (see <funclink>SetPlayerTeam</funclink>).</col>
</row>
<row id="OnCompletionChange">
<literal_col>OnCompletionChange</literal_col>
<col>int old_con, int new_con</col>
<col>Callback in when the completion of the object has changed (see <funclink>GetCon</funclink>, <funclink>DoCon</funclink> and <funclink>SetCon</funclink>).</col>
<row id="EditCursorSelection">
<literal_col>EditCursorSelection</literal_col>
<col></col>
<col>When object is selected in editor. Use this callback to display extra information for scenario designers.</col>
</row>
<row id="EditCursorDeselection">
<literal_col>EditCursorDeselection</literal_col>
<col>object next_selection</col>
<col>When object is deselected in editor. Use this callback to hide any information previously shown in EditCursorSelection. If deselection happens due to another object being selected, that object is passed in next_selection.</col>
</row>
<row id="EditCursorMoved">
<literal_col>EditCursorMoved</literal_col>
<col>int old_x, int old_y</col>
<col>When object is moved in editor. Callback is also done when moved in non-network pause mode. old_x, old_y contains object position before movement.</col>
</row>
<row id="SaveScenarioObject">
<literal_col>SaveScenarioObject</literal_col>
<col>proplist props</col>
@ -516,19 +512,6 @@ func SaveScenarioObject(props)
</row>
</table>
</text>
<text>Properties published to the editor as EditorProps can also be saved automatically by setting the Save property of the EditorProp to a string that serves as an identifier so saved properties can be removed by derived definitions. These properties are atuomatically saved if they are different from their default value. E.g.:</text>
<code>/* Define two properties that can be set in the editor */
// foo is a property with a setter function
local foo = 42;
public func SetFoo(new_foo) { foo = new_foo; return true; }
// bar is just a property without setter
local bar = 23;
local EditorProps = {
foo = { Type="int", Set="SetFoo", Save="Foo" }; // saved as object->SetFoo(value); unless foo is 42.
bar = { Type="int", Save="Bar"; } // saved as object.bar = value; unless bar is 23.
};</code>
<text>By default, effects are not saved in scenarios. To force saving of an effect, define the Fx*SaveScen callback. For example, the fire effect saves itself like this:</text>
<code>global func FxFireSaveScen(object obj, proplist fx, proplist props)
{

View File

@ -54,10 +54,6 @@ this.Visibility = [<funclink>VIS_Enemies</funclink>]; // This is also possible (
<col><code>VIS_OverlayOnly</code></col>
<col>Only overlays will be visible, other visibility-rules still apply.</col>
</row>
<row id="VIS_Editor">
<col><code>VIS_Editor</code></col>
<col>Visible in editor (both neutral and player viewports).</col>
</row>
</table>
</text>
<related>

View File

@ -13,6 +13,8 @@
<h>Get started</h>
<text><emlink href="files.html">Game data</emlink> - Get an overview over the game data needed for the creation of custom game content.</text>
<text><emlink href="script/index.html">C4Script</emlink> - View the introduction to the script language C4Script.</text>
<h>Search the documentation</h>
<search/>
</part>
<author>Newton</author><date>2011-08</date>
</doc>

View File

@ -106,12 +106,9 @@
<col>Inflammability.</col>
</row>
<row>
<col>Incendiary</col>
<col>Incindiary</col>
<col>Integer</col>
<col>
This material incinerates objects.
<em>Note: For compatibility reasons, the misspelling &quot;Incindiary&quot; is also accepted if (and only if) no value with the correct spelling is set.</em>
</col>
<col>This material incinerates objects.</col>
</row>
<row>
<col>Corrode</col>
@ -206,7 +203,7 @@
<row>
<col>OverlayType</col>
<col>Integer</col>
<col>Bit mask for texture calculation on this material. Bit 0 (1): exact (no zoom), bit 1 (2): no texture, bit 2 (4): extra large zoom</col>
<col>Bit mask for texture calculation on this material. Bit 0 (1): exact (no zoom), bit 1 (2): no texture, bit 2 (4): extra large zoom, bit 3 (8): calculate texture based on gray scale.</col>
</row>
<row>
<col>PXSGfx</col>
@ -375,11 +372,8 @@
<col>The background material.</col>
</row>
<row>
<col>Incendiary</col>
<col>
All materials that can incinerate objects.
<em>Note: For compatibility reasons, the misspelling &quot;Incindiary&quot; is also accepted.</em>
</col>
<col>Incindiary</col>
<col>All materials to be incinerated.</col>
</row>
<row>
<col>Extinguisher</col>

View File

@ -57,8 +57,6 @@
<funclink>PV_KeyFrames</funclink>
<funclink>PV_Wind</funclink>
<funclink>PV_Gravity</funclink>
<funclink>PV_Sin</funclink>
<funclink>PV_Cos</funclink>
</text>
<text>
<table>
@ -151,7 +149,7 @@
<row>
<col>Attach</col>
<col>bit mask</col>
<col>Defines the attachment of the particles to the calling object. Can be a combination of ATTACH_Front, ATTACH_Back, and ATTACH_MoveRelative. For example <code>ATTACH_Front | ATTACH_MoveRelative. Non-attached particles are drawn on plane 900 (i.e. before most objects).</code></col>
<col>Defines the attachment of the particles to the calling object. Can be a combination of ATTACH_Front, ATTACH_Back, and ATTACH_MoveRelative. For example <code>ATTACH_Front | ATTACH_MoveRelative</code></col>
</row>
</table>
</text>

View File

@ -39,32 +39,32 @@
<row>
<literal_col>Global</literal_col>
<col>Boolean</col>
<col>If true this is a global definition, i.e. not assigned to a particular player. See <emlink href="playercontrols.html#Globals">Global definitions</emlink>.</col>
<col>If true this is a global definition, i.e. not assigned to a particular player. See <emlink href="playercontrols.xml#Globals">Global definitions</emlink>.</col>
</row>
<row>
<literal_col>Hold</literal_col>
<col>Boolean</col>
<col>If true this command is interpreted as a held command. Such a command remembers whether the control key is pressed and generates another scripting event when it is released. See <emlink href="playercontrols.html#Hold">Held keys</emlink>.</col>
<col>If true this command is interpreted as a held command. Such a command remembers whether the control key is pressed and generates another scripting event when it is released. See <emlink href="playercontrols.xml#Hold">Held keys</emlink>.</col>
</row>
<row>
<literal_col>RepeatDelay</literal_col>
<col>Integer</col>
<col>Only valid if <em>Hold</em> is true. If greater than 0 then this key generates additional scripting events while pressed every that many number of frames. See <emlink href="playercontrols.html#Repeat">Key repeats</emlink>.</col>
<col>Only valid if <em>Hold</em> is true. If greater than 0 then this key generates additional scripting events while pressed every that many number of frames. See <emlink href="playercontrols.xml#Repeat">Key repeats</emlink>.</col>
</row>
<row>
<literal_col>InitialRepeatDelay</literal_col>
<col>Integer</col>
<col>If specified then the delay of the first key repeat event can be changed. See <emlink href="playercontrols.html#Repeat">Key repeats</emlink>.</col>
<col>If specified then the delay of the first key repeat event can be changed. See <emlink href="playercontrols.xml#Repeat">Key repeats</emlink>.</col>
</row>
<row>
<literal_col>DefaultDisabled</literal_col>
<col>Boolean</col>
<col>If true then the command is deactivated in the normal case and needs to be activated by script first. This is useful for commands that are only required in special situations. See <emlink href="playercontrols.html#Deactivate">Deactivated commands</emlink>.</col>
<col>If true then the command is deactivated in the normal case and needs to be activated by script first. This is useful for commands that are only required in special situations. See <emlink href="playercontrols.xml#Deactivate">Deactivated commands</emlink>.</col>
</row>
<row>
<literal_col>ExtraData</literal_col>
<col>C4ID</col>
<col>Optional ID that is passed to the script function. See <emlink href="playercontrols.html#ExtraData">ExtraData</emlink>.</col>
<col>Optional ID that is passed to the script function. See <emlink href="playercontrols.xml#ExtraData">ExtraData</emlink>.</col>
</row>
<row>
<literal_col>CoordinateSpace</literal_col>
@ -94,7 +94,7 @@
</row>
<row>
<literal_col>Script</literal_col>
<col>Execution of the script function <em>PlayerControl</em>. See <emlink href="playercontrols.html#Script">Script callbacks</emlink>. (Default value)</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>
@ -184,17 +184,17 @@
<row>
<literal_col>Key</literal_col>
<col>String</col>
<col>Specifies the key(s) of this mapping or a reference to another mapping. See <emlink href="playercontrols.html#Keys">Key mappings</emlink>.</col>
<col>Specifies the key(s) of this mapping or a reference to another mapping. See <emlink href="playercontrols.xml#Keys">Key mappings</emlink>.</col>
</row>
<row>
<literal_col>ComboIsSequence</literal_col>
<col>Boolean</col>
<col>If true then multiple keys are taken as a sequence, i.e. they need to be pressed one after the other instead of all at the same time. See <emlink href="playercontrols.html#Keys">Key mappings</emlink>.</col>
<col>If true then multiple keys are taken as a sequence, i.e. they need to be pressed one after the other instead of all at the same time. See <emlink href="playercontrols.xml#Keys">Key mappings</emlink>.</col>
</row>
<row>
<literal_col>Control</literal_col>
<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.html#ControlDef">[ControlDef]</emlink>.</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>
@ -239,11 +239,11 @@
</row>
<row>
<literal_col>Hold</literal_col>
<col>The key changes the state of the command linked to to be held even if the key itself is pressed only shortly. Only valid if the <em>Hold</em> attribute is set for the command. This state remains until a corresponding mapping with trigger mode <em>Release</em> is being pressed. See <emlink href="playercontrols.html#Hold">Held keys</emlink>.</col>
<col>The key changes the state of the command linked to to be held even if the key itself is pressed only shortly. Only valid if the <em>Hold</em> attribute is set for the command. This state remains until a corresponding mapping with trigger mode <em>Release</em> is being pressed. See <emlink href="playercontrols.xml#Hold">Held keys</emlink>.</col>
</row>
<row>
<literal_col>Release</literal_col>
<col>The key removes the held state. A key can have both Hold and Release set to toggle between the two states. See <emlink href="playercontrols.html#Hold">Held keys</emlink>.</col>
<col>The key removes the held state. A key can have both Hold and Release set to toggle between the two states. See <emlink href="playercontrols.xml#Hold">Held keys</emlink>.</col>
</row>
<row>
<literal_col>AlwaysUnhandled</literal_col>
@ -273,7 +273,7 @@
return true;
}</code>
<text>most commands (except for asynchronous commands in the player menu) call a global script function:</text>
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, int state)</code>
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, bool release)</code>
<text>For an explanation of the parameters see <funclink>PlayerControl</funclink>. Amongst others, the function receives the calling player in player as well as the command to be executed in control.</text>
<text>As a simple example let's assume that in the global <em>PlayerControls.txt</em> the following command has been defined:</text>
<code>[ControlDefs]
@ -293,11 +293,11 @@
Control=Jump
Priority=50</code>
<text>This defines a Jump key and the corresponding standard mapping on the keyboard for the first player. The following script is used to handle the control:</text>
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, int state)
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, bool release)
{
// Which command has been issued?
// The constant CON_Jump has been declared automatically through the definition in PlayerControls.txt
if (control == CON_Jump &amp;&amp; state == CONS_Down)
if (control == CON_Jump &amp;&amp; !release)
{
// pressed the jump button. The clonk selected by the player shall jump
var player_clonk = GetCursor(player);
@ -319,17 +319,17 @@
GUIDesc=Going underground
ExtraData=Shovel</code>
<text>Let shovel be the ID of a shovel object. In the global script there could be the following, generic handling for unknown commands, for example:</text>
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, int state)
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, bool release)
{
// Handling of known controls
// [...]
// control with own handling
if (control_extra) return control_extra-&gt;PlayerControl(player, control, x, y, strength, repeat, state);
if (control_extra) return control_extra-&gt;PlayerControl(player, control, x, y, strength, repeat, release);
// unkown control
return false;
}</code>
<text>And in the script of the shovel:</text>
<code>func PlayerControl(int player, int control, int x, int y, int strength, bool repeated, int state)
<code>func PlayerControl(int player, int control, int x, int y, int strength, bool repeated, bool release)
{
// Handling of known controls
// Control dig directly in the shovel
@ -351,9 +351,8 @@
<ul>
<li>When released they also generate <funclink>PlayerControl</funclink> calls in the script with the <em>Release</em> flag set.</li>
<li>Mappings can emulate permanent key presses using the <em>Hold</em>/<em>Release</em> flags.</li>
<li><emlink href="playercontrols.html#Repeat">Key repeats</emlink> are generated.</li>
<li><emlink href="playercontrols.xml#Repeat">Key repeats</emlink> are generated.</li>
<li>The held state of the key can be queried in the script via <funclink>GetPlayerControlState</funclink>.</li>
<li>If the command is bound to an analog stick or trigger on a controller, every change in position causes in a call to PlayerControl() with state = CONS_Moved.</li>
</ul>
</text>
<text>A good example for this functionality is a directional command:</text>
@ -363,7 +362,7 @@
GUIDesc=Walk left
Hold=1</code>
<text>In the script the direction is transferred to the Clonk:</text>
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, int state)
<code>global func PlayerControl(int player, int control, C4ID control_extra, int x, int y, int strength, bool repeated, bool release)
{
if (control == CON_Left) return UpdateControlDir(player);
// ...

View File

@ -68,11 +68,11 @@
<row>
<col>MissionAccess</col>
<col>String</col>
<col>The scenario will only load if the player gained this password in another scenario. See script function <funclink>GainScenarioAccess</funclink>().</col>
<col>The scenario will only load if the player gained this password in another scenario. See script function <funclink>GainMissionAccess</funclink>().</col>
</row>
<row>
<col>Secret</col>
<col>Bool</col>
<col>bool</col>
<col>If true and MissionAccess is set, the scenario is invisible in the scenario selection list if the player does not have the required password access.</col>
</row>
<row>
@ -100,11 +100,6 @@
<col>Data type</col>
<col>Description</col>
</rowh>
<row>
<col>Mode</col>
<col>String</col>
<col>General game mode of this scenario. Used by network and league servers to determine which league to host the game in. Currently suggested identifiers are: Melee, Parkour, Settlement, Defense. Strings should be valid identifiers.</col>
</row>
<row>
<col>Rules</col>
<col>ID list</col>
@ -122,14 +117,9 @@
</row>
<row>
<col>FoWEnabled</col>
<col>Bool</col>
<col>Integer</col>
<col>0 or 1. If 0, FoW is disabled, and the whole landscape is visible. Default 1.</col>
</row>
<row>
<col>EvaluateOnAbort</col>
<col>Bool</col>
<col>If enabled, the game will be evaluated even when aborted by the player. This is intended for scenarios like Tower of Despair that save progress in players. Default false.</col>
</row>
</table>
</text>
<text>
@ -253,7 +243,7 @@
<row>
<literal_col>AutoScanSideOpen</literal_col>
<col>Integer</col>
<col>0, 1, or 2. If 1, the left and right borders are closed if the corresponding map pixel in the left or right row has non-sky foreground or background and open otherwise. If 2, it only checks the background.</col>
<col>0 or 1. If 1, LeftOpen and RightOpen will be set automatically depending on the landscape at game start.</col>
</row>
<row>
<literal_col>MapWidth</literal_col>
@ -350,11 +340,6 @@
<col>Integer</col>
<col>0 or 1. If 1, all landscape chunks are drawn flat when the map is zoomed to draw the landscape. Set this while drawing a static map in console mode to fix small gaps of lower order materials hidden behind materials of chunky shape.</col>
</row>
<row>
<literal_col>Secret</literal_col>
<col>Bool</col>
<col>Whether to hide the map from <code><funclink>NO_OWNER</funclink></code> viewports (e.g. observers not following a player in network rounds)</col>
</row>
</table>
</text>
<text>

View File

@ -27,11 +27,6 @@
<col>int player, int x, int y, object base, int team, id extra_data</col>
<col>Called after when a new player joins the game. At this point, the clonks, materials, structures etc. are already placed at the position given in the <emlink href="scenario/scenario.html#SektionenPlayer1Player2Player3Player4">Scenario.txt</emlink>. <code>x</code> and <code>y</code> specify the starting position of the player, <code>base</code> is the player's base (if any), <code>team</code> denotes the team of the player. For <code>extra_data</code>, see <funclink>CreateScriptPlayer</funclink></col>
</row>
<row id="InitializePlayers">
<literal_col>InitializePlayers</literal_col>
<col></col>
<col>Called after all initial players joined. Can be used e.g. to start intros.</col>
</row>
<row id="RelaunchPlayer">
<literal_col>RelaunchPlayer</literal_col>
<col>int player, int killed_by_player</col>

View File

@ -9,26 +9,10 @@
<text>With #appendto, you can modify an existing object defintion script without changing the original file. For example, a scenario could change flints to cause bigger explosions, without having to duplicate the entire flint in the scenario.</text>
<h id="Syntax">Declaration</h>
<code>#appendto [id]</code>
<text>A script can append itself to one or multiple existing scripts using the <code>#appendto</code> directive. Such script needs to be placed in System.ocg directory. Functions of the same name will overload functions in the target script. The original overloaded functions can still be called using <emlink href="script/fn/inherited.html">inherited</emlink>. #included scripts are not appended with #append, but #appended scripts are included by #include.</text>
<text>A script can append itself to one or multiple existing scripts using the <code>#appendto</code> directive. Functions of the same name will overload functions in the target script. The original overloaded functions can still be called using <emlink href="script/fn/inherited.html">inherited</emlink>. #included scripts are not appended with #append, but #appended scripts are included by #include.</text>
<code>#appendto *</code>
<text>Appending to <code>*</code> will append this script to all definitions.</text>
<text>A script can contain multiple #appendto directives. It is always compiled with the original script. This is of interest whenever local variables or functions from the appended script are used.</text>
<h id="Example">Example</h>
<code>#appendto WindBag
// This function will be "overwritten" in the original windbag.
// You can however call the original function by calling <funclink>_inherited</funclink>(...)
// You'll find this quite often in other scenarios. Just take a look at other
// scenarios that contain a System.ocg folder.
func FxIntReloadTimer(object target, proplist effect)
{
// Make the windbag reload faster.
var old_fill = fill_amount;
var ret = <funclink>inherited</funclink>(target, effect, ...);
if (fill_amount > old_fill)
fill_amount += (fill_amount - old_fill) * 5;
return ret;
}</code>
</part>
<author>Sven2</author><date>2002-04</date>
<author>matthes</author><date>2004-06</date>

View File

@ -1,288 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE doc
SYSTEM '../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Diagnostic Messages</title>
<h>Diagnostic Messages</h>
<part>
<text>
Certain constructs may be flagged by the engine as potentially
unintended or deprecated. In these cases, the engine will, by default,
emit a warning to the log file.
</text>
<text>
On occasion, these constructs are in fact intended by the script
author. In order to avoid unwanted warning messages hiding more important
messages, the engine supports selectively suppressing a warning category
for parts of a script.
</text>
</part>
<part>
<text>
Suppression and re-enablement is handled by the <code>#warning</code>
directive. The directive must be placed on a separate line.
</text>
<text>Warnings can be controlled using this syntax:</text>
<code>#warning {enable|disable} [warning_category [warning_category...]]</code>
<text>
If no category is given, the engine will suppress or enable all messages,
including those that are not enabled by default. A category remains
disabled or enabled until the next directive that affects it, or until
the end of the script. A script linked to via the <code>#include</code>
or <code>#appendto</code> directives does not affect, and is itself not
affected by, the warning settings of the current script.
</text>
<text>
It is not an error to specify a category that does not exist; the
invalid category is simply ignored. No separate warning is emitted.
</text>
</part>
<part>
<h>Warning Categories</h>
<text>The following warning categories currently exist:</text>
<table>
<rowh>
<col>Category</col>
<col>Description</col>
</rowh>
<row>
<col>invalid_escape_sequence</col>
<col>
<text>
The engine found an escape sequence inside a string that it
did not recognize.
</text>
<part><code>"\p"</code></part>
</col>
</row>
<row>
<col>invalid_hex_escape</col>
<col>
<text>
The engine found the start of a hexadecimal escape sequence
inside a string, but no hexadecimal digits followed it.
</text>
<part><code>"\xGN"</code></part>
</col>
</row>
<row>
<col>type_name_used_as_par_name</col>
<col>
<text>
A function parameter was declared without an explicit type
specification, but with a name that is the same as a built-in type.
</text>
<part><code>func f(array)</code></part>
<text>
This warning is not enabled by default.
<a href="#fn1" title="The warning may be enabled by default in a future version.">¹</a>
</text>
</col>
</row>
<row>
<col>empty_parameter_in_call</col>
<col>
<text>
In a function call, a parameter was left empty. The engine is
passing <code>nil</code> in its place.
</text>
<part><code><funclink>CreateObject</funclink>(Clonk,, 30, 100);</code></part>
<text>
This warning is not enabled by default.
<a href="#fn1" title="The warning may be enabled by default in a future version.">¹</a>
</text>
</col>
</row>
<row>
<col>empty_parameter_in_array</col>
<col>
<text>
In an array literal, an entry was left empty. The engine is
using <code>nil</code> in its place.
</text>
<part><code>[1, 2,, 3, 4]</code></part>
<text>
This warning is not enabled by default.
<a href="#fn1" title="The warning may be enabled by default in a future version.">¹</a>
</text>
</col>
</row>
<row>
<col>implicit_range_loop_var_decl</col>
<col>
<text>
The loop variable of a for-in loop was not declared either in the
loop header itself nor in the containing function. This is only
accepted for backwards compatibility and may be removed in a
future release. Explicitly declare the variable by adding the
<code>var</code> keyword.
</text>
<part>
<code>func f() {
&#9;for (i in [1, 2, 3]) {
&#9;}
}</code>
</part>
</col>
</row>
<row>
<col>non_global_var_is_never_const</col>
<col>
<text>
A variable has been declared as <code>const</code>, but is not
global. At this time, non-global variables are always mutable.
</text>
<part>
<code>const local a = {}</code>
</part>
</col>
</row>
<row>
<col>variable_shadows_variable</col>
<col>
<text>
The declaration of a variable uses the same name as a variable
in a greater scope. Changes to the shadowing variable will not
affect the shadowed variable.
</text>
<part>
<code>static foo;
func f() {
&#9;var foo = 3;
}</code>
</part>
</col>
</row>
<row>
<col>redeclaration</col>
<col>
<text>
A variable has been redeclared in the same scope. Make sure
you do not accidentally overwrite values another part of the
code relies upon.
</text>
<part>
<code>func f() {
&#9;var i;
&#9;var i;
}</code>
</part>
</col>
</row>
<row>
<col>variable_out_of_scope</col>
<col>
<text>
A variable has been used outside of the block it has been
declared in. This is accepted only for backwards compatibility
and may be removed in a future release.
</text>
<part>
<code>func f(a) {
&#9;i = 0;
&#9;if (a) {
&#9;&#9;var i = 1;
&#9;}
&#9;return i;
}</code>
</part>
</col>
</row>
<row>
<col>undeclared_varargs</col>
<col>
<text>
Use of <code><funclink>Par</funclink></code> inside a function
implicitly declares it as using a variable number of arguments.
This is not immediately obvious to callers of the function, and
should be explicitly declared in the function signature by
adding a final <code>...</code> parameter.
</text>
<part>
<code>func f(a) {
&#9;return <funclink>Par</funclink>(a);
}
// Better:
func g(a, ...) {
&#9;return <funclink>Par</funclink>(a);
}</code>
</part>
</col>
</row>
<row>
<col>arg_count_mismatch</col>
<col>
<text>
A function call passes more parameters than the function will
accept.
</text>
<part>
<code><funclink>GetDir</funclink>(0)</code>
</part>
</col>
</row>
<row>
<col>arg_type_mismatch</col>
<col>
<text>
The parameter given in a function call is of a different type
than the called function expects. The call will likely fail at
runtime.
</text>
<part>
<code><funclink>Sin</funclink>("huh?")</code>
</part>
</col>
</row>
<row>
<col>empty_if</col>
<col>
<text>
An <code>if</code> conditional is controlling an empty statement.
Use the empty block <code>{}</code> if this is intentional, or
remove the conditional entirely.
</text>
<part>
<code>if (true);</code>
</part>
</col>
</row>
<row>
<col>suspicious_assignment</col>
<col>
<text>
An assignment was found where an expression was expected. While
an assignment returns its own value, usually a comparison was
intended instead.
</text>
<part>
<code>if (a = b + 1) { /* Do something */}</code>
</part>
<text>
If the assignment is intentional, make this more obvious by
extracting it to a separate statement, or explicitly handle the
boolean conversion by adding a comparison operator.
</text>
</col>
</row>
</table>
</part>
<part>
<h>Examples</h>
<examples>
<example>
<code>func f(string s) {
&#9;Sin(s);&#x9;// WARNING: parameter 0 of call to 'Sin' passes string (int expected)
#warning disable arg_type_mismatch
&#9;Sin(s);
#warning enable arg_type_mismatch
&#9;Sin(s);&#x9;// WARNING: parameter 0 of call to 'Sin' passes string (int expected)
}</code>
</example>
</examples>
</part>
<a id="fn1" style="font-size: smaller; color: inherit;">¹ The warning may be enabled by default in a future version.</a>
</doc>

View File

@ -51,8 +51,7 @@ func Destruction()
<text>The magic spell object exists until the spell has ended and then makes the clonk visible again. Also, if the spell object is deleted for other reasons (e.g. a scenario section change), the clonk is made visible in the Destruction callback (if this wasn't so, the clonk would remain invisible for ever). Also there is a Timer (defined in the DefCore) called every second. Notice you couldn't just have a single timer call to mark the end of the spell because timer intervals are marked in the engine beginning with the start of the round and you wouldn't know at what point within an engine timer interval the spell would start.</text>
<text>However, there are some problems with this implementation: for example, the magician can not cast a second invisibility spell while he's already invisible - the second spell would have practically no effect, because the end of the first spell would make the clonk visible again. The spell script would have to do some special handling for this case - but not only for multiple invisibility spells, but also for any other spell or script that might affect visibility or coloration of the clonk. Even if this spell would remember the previous value e.g. for coloration it could not handle a situation in which other scripts change the color of their own in the middle of the spell. The same problems occur when multiple scripts modify temporary clonk physcials such as jumping, walking speed, fight strength or visibility range, energy, magic energy etc. Using effects, these conflicts can be avoided.</text>
<h id="Usage">Application</h>
<text>Effects are created using <funclink>CreateEffect</funclink> and removed with <funclink>RemoveEffect</funclink>. If an effect was successfully created, the callback <emlink href="script/Effects.html#Construction">Construction</emlink> is made. Depending on the parameters, there can also be an <emlink href="script/Effects.html#TimerCallback">Timer</emlink> call for continuous activity such as casting sparks, adjusting energy etc. Finally, when the effect is deleted, the callback <emlink href="script/Effects.html#Destruction">Destruction</emlink> is made.</text>
<text>Now, the invisibility spell implemented using effects:</text>
<text>Effects are created using <funclink>AddEffect</funclink> and removed with <funclink>RemoveEffect</funclink>. If an effect was successfully created, the callback Fx*Start is made (* is replaced with the effect name). Depending on the parameters, there can also be an Fx*Timer call for continuous activity such as casting sparks, adjusting energy etc. Finally, when the effect is deleted, the callback Fx*Stop is made. Now, the invisibility spell implemented using effects:</text>
<code>/* Invisibility spell with effect system */
// visibility - previous visibility
@ -60,86 +59,92 @@ func Destruction()
func Activate(object caster, object caster2)
{
// get caster
if (caster2) caster = caster2;
// get caster
if (caster2) caster = caster2;
// start effect
caster-><funclink>CreateEffect</funclink>(InvisPSpell, 200, 1111);
// done - the spell object is not needed anymore
<funclink>RemoveObject</funclink>();
return true;
// start effect
<funclink>AddEffect</funclink>(&quot;InvisPSpell&quot;, caster, 200, 1111, nil, GetID());
// done - the spell object is not needed anymore
<funclink>RemoveObject</funclink>();
return true;
}
local InvisPSpell = new Effect {
Start = func() {
// Save the casters previous visibility
this.visibility = Target.Visibility;
this.old_mod = Target-&gt;<funclink>GetClrModulation</funclink>();
// Make the caster invisible
Target.Visibility = <funclink>VIS_Owner</funclink> | <funclink>VIS_Allies</funclink> | <funclink>VIS_God</funclink>;
// Semitransparent and slightly blue for owner and allies
Target-&gt;SetClrModulation(<funclink>ModulateColor</funclink>(this.old_mod, RGBa(127,127,255,127)));
},
Stop = func() {
// restore previous values
Target-&gt;<funclink>SetClrModulation</funclink>(this.old_mod);
Target.Visibility = this.visibility;
}
func FxInvisPSpellStart(object target, proplist effect)
{
// Save the casters previous visibility
effect.visibility = target.Visibility;
effect.old_mod = target-&gt;<funclink>GetClrModulation</funclink>();
// Make the caster invisible
target.Visibility = <funclink>VIS_Owner</funclink> | <funclink>VIS_Allies</funclink> | <funclink>VIS_God</funclink>;
// Semitransparent and slightly blue for owner and allies
target-&gt;SetClrModulation(<funclink>ModulateColor</funclink>(effect.old_mod, RGBa(127,127,255,127)));
// Fertig
return true;
}
func FxInvisPSpellStop(object target, proplist effect)
{
// restore previous values
target-&gt;<funclink>SetClrModulation</funclink>(effect.old_mod);
target.Visibility = effect.visibility;
// done
return true;
}</code>
<text>In this case, the magic spell object only starts the effect, then deletes itself immediately. The engine ensures that there are no conflicts with multiple effects modifying the visibility: effects are stored in a stack which ensures that effects are always removed in the opposite order of their addition. For this, there are a couple of extra Start and Stop calls to be made which are explained in detail later.</text>
<text>This effects does not have a timer function. It does, however, define a timer interval of 1111 which will invoke the standard timer function after 1111 frames which will delete the effect. Alternatively, you could define a timer function as such:</text>
<code>Timer = func()
<code>func FxInvisPSpellTimer()
{
// return value of -1 means that the effect should be removed
return -1;
// return value of -1 means that the effect should be removed
return -1;
}</code>
<text>To store the previous status of the target object, properties of the effect are used. This way effects are independant of other objects and effects - remember that the magic spell object which has created the effect is already deleted. If you need to call functions in the context of the target object or other objects, use <code>-></code>.</text>
<text>To store the previous status of the target object, properties of the effect are used. This is necessary because in this case the effect callbacks do not have any object script context. So you cannot access any object local variables in the effect callbacks - remember that the magic spell object which has created the effect is already deleted. If you require an object context in the effect callbacks you can specify one in <funclink>AddEffect</funclink>(). In that case, effect callbacks would be in object local context and the effect would automatically be deleted if the target object is destroyed.</text>
<h id="Priorities">Priorities</h>
<text>When creating an effect you always specify a priority value which determines the effect order. The engine ensures that effects with lower priority are added before effects with a higher priority - even if this means deleting an existing effect of higher priority. So if one effect colors the clonk green and another colors the clonk red, the result will be that of the effect with higher priority. If two effects have the same priority, the order is undefined. However, it is guaranteed that effects added later always notify the <code>Effect</code> callback of the same priority.</text>
<text>In the case of the red and green color, one effect could also determine the previous coloring and then mix a result using ModulateColor. But priorities also have another function: an effect of higher priority can prevent the addition of other effects of lower priority. This is done through the <code>Effect</code> callback. If any existing effect reacts to this callback with the return value -1, the new effect is not added (the same applies to the Start callback of the effect itself). Here an example:</text>
<text>When creating an effect you always specify a priority value which determines the effect order. The engine ensures that effects with lower priority are added before effects with a higher priority - even if this means deleting an existing effect of higher priority. So if one effect colors the clonk green and another colors the clonk red, the result will be that of the effect with higher priority. If two effects have the same priority, the order is undefined. However, it is guaranteed that effects added later always notify the Fx*Effect callback of the same priority.</text>
<text>In the case of the red and green color, one effect could also determine the previous coloring and then mix a result using ModulateColor. But priorities also have another function: an effect of higher priority can prevent the addition of other effects of lower priority. This is done through the Fx*Effect callback. If any existing effect reacts to this callback with the return value -1, the new effect is not added (the same applies to the Start callback of the effect itself). Here an example:</text>
<code>/* Spell of immunity against fire */
func Activate(object caster, object caster2)
{
// get caster
if (caster2) caster = caster2;
// get caster
if (caster2) caster = caster2;
// start effect
caster-><funclink>CreateEffect</funclink>(BanBurnPSpell, 180, 1111);
// start effect
<funclink>AddEffect</funclink>(&quot;BanBurnPSpell&quot;, caster, 180, 1111, nil, GetID());
// done - the spell object is not needed anymore
<funclink>RemoveObject</funclink>();
return true;
// done - the spell object is not needed anymore
<funclink>RemoveObject</funclink>();
return true;
}
local BanBurnPSpell = new Effect {
Construction = func()
{
// On start of the effect: extinguish clonk
Target-&gt;<funclink>Extinguish</funclink>();
},
Effect = func(string new_name)
{
// block fire
if (<funclink>WildcardMatch</funclink>(new_name, &quot;*Fire*&quot;)) return -1;
// everything else is ok
return 0;
}
};</code>
<text>This effect makes the clonk fire-proof for 30 seconds. The effect is implemented without any Timer or Stop callbacks as the complete functionality is achieved by simply blocking other effects which might have "Fire" as part of their name. This especially applies to the engine internal fire which has exactly the name "Fire". Of course, you could still add a Timer callback for graphic effects so the player can see that his clonk is immune. Also, you could create special visual effects when preventing incineration in <code>Effect</code>. For the like:</text>
<code>[...]
Effect = func(string new_name, var1, var2, var3, var4)
func FxBanBurnPSpellStart(object target, proplist effect, bool temporary)
{
// only handle fire
if (!<funclink>WildcardMatch</funclink>(new_name, &quot;*Fire*&quot;)) return 0;
// with fire, the three extra parameters have the following meaning:
// var1: caused_by - player that is responsible for the fire
// var2: blasted - bool: if the fire has been created by an explosion
// var3: burning_object - object: incineratable object
// extinguish burning object
if (var3 &amp;&amp; <funclink>GetType</funclink>(var3) == <funclink>C4V_C4Object</funclink>) var3-&gt;<funclink>Extinguish</funclink>();
// block fire
return -1;
// On start of the effect: extinguish clonk
if (!temporary) target-&gt;<funclink>Extinguish</funclink>();
return true;
}
func FxBanBurnPSpellEffect(string new_name)
{
// block fire
if (<funclink>WildcardMatch</funclink>(new_name, &quot;*Fire*&quot;)) return -1;
// everything else is ok
return 0;
}</code>
<text>This effect makes the clonk fire-proof for 30 seconds. The effect is implemented without any Timer or Stop callbacks as the complete functionality is achieved by simply blocking other effects which might have "Fire" as part of their name. This especially applies to the engine internal fire which has exactly the name "Fire". Of course, you could still add a Timer callback for graphic effects so the player can see that his clonk is immune. Also, you could create special visual effects when preventing incineration in FxBanBurnPSpellEffect. For the like:</text>
<code>[...]
func FxBanBurnPSpellEffect(string new_name, object target, proplist effect, var1, var2, var3)
{
// only handle fire
if (!<funclink>WildcardMatch</funclink>(new_name, &quot;*Fire*&quot;)) return 0;
// with fire, the three extra parameters have the following meaning:
// var1: caused_by - player that is responsible for the fire
// var2: blasted - bool: if the fire has been created by an explosion
// var3: burning_object - object: incineratable object
// extinguish burning object
if (var3 &amp;&amp; <funclink>GetType</funclink>(var3) == <funclink>C4V_C4Object</funclink>) var3-&gt;<funclink>Extinguish</funclink>();
// block fire
return -1;
}</code>
<text>This would even delete all burning objects which would otherwise incinerate the target object. The type check for var3 avoids possible conflicts with other "Fire" effects that might have differing parameters. Obviously, conflict situations like this should be avoided at all cost.</text>
<text>The following table contains general guidelines for priorities in effects of the original pack:</text>
@ -205,44 +210,44 @@ Effect = func(string new_name, var1, var2, var3, var4)
func Activate(object caster, object caster2)
{
// get caster
if (caster2) caster = caster2;
// get caster
if (caster2) caster = caster2;
// start effect
caster-><funclink>CreateEffect</funclink>(ReincarnationPSpell, 180, 0);
// done - the spell object is not needed anymore
<funclink>RemoveObject</funclink>();
return true;
// start effect
<funclink>AddEffect</funclink>(&quot;ReincarnationPSpell&quot;, caster, 180, 0, nil, GetID());
// done - the spell object is not needed anymore
<funclink>RemoveObject</funclink>();
return true;
}
local ReincarnationPSpell = new Effect {
Construction = func() {
// Only at the first start: message
Target-&gt;<funclink>Message</funclink>(&quot;%s gets an extra life&quot;, Target-&gt;<funclink>GetName</funclink>());
return true;
},
func FxReincarnationPSpellStart(object target, proplist effect, bool temporary)
{
// Only at the first start: message
if (!temporary) target-&gt;<funclink>Message</funclink>(&quot;%s gets an extra life&quot;, target-&gt;<funclink>GetName</funclink>());
return true;
}
func Stop(int reason, bool temporary) {
// only when the clonk died
if (reason != 4) return true;
// the clonk has already been resurrected
if (Target-&gt;<funclink>GetAlive</funclink>()) return -1;
// resurrect clonk
Target-&gt;<funclink>SetAlive</funclink>(true);
// give energy
Target-&gt;<funclink>DoEnergy</funclink>(100);
// message
Target-&gt;<funclink>Message</funclink>(&quot;%s has been resurrected.&quot;, Target-&gt;<funclink>GetName</funclink>());
func FxReincarnationPSpellStop(object target, proplist effect, int reason, bool temporary)
{
// only when the clonk died
if (reason != 4) return true;
// the clonk has already been resurrected
if (target-&gt;<funclink>GetAlive</funclink>()) return -1;
// resurrect clonk
target-&gt;<funclink>SetAlive</funclink>(true);
// give energy
target-&gt;<funclink>DoEnergy</funclink>(100);
// message
target-&gt;<funclink>Message</funclink>(&quot;%s has been resurrected.&quot;, target-&gt;<funclink>GetName</funclink>());
// remove
return true;
}
};</code>
// remove
return true;
}</code>
<text>This effect reanimates the clonk as many times as he has cast the reanimation spell.</text>
<h id="GlobalEffects">Global Effects</h>
<text>There are two global effect types: Scenerio effects and global effects. They are bound to the <code>Scenario</code> and <code>Global</code> proplists. With these effects, too, priorities are observed and temporary Add/Remove calls might be necessary to ensure order.</text>
<text>Global effects are effects that are not bound to any target object. With global effects, too, priorities are observed and temporary Add/Remove calls might be necessary to ensure order. Simply imagine all global effects are attached to an imaginary object. Global effects are accessed whenever you specify <code>nil</code> for the target object.</text>
<text>This can be used to make changes to gravity, sky color, etc. Here's an example for a spell that temporarily reduces gravity and then resets the original value:</text>
<code>/* Gravitation spell */
@ -328,39 +333,34 @@ func FxGravChangeUSpellAdd(object target, proplist effect, string new_name, int
<table>
<caption id="PropertiesTable">Effect Properties</caption>
<rowh>
<col>Name</col>
<col>Data type</col>
<col>Name</col>
<col>Description</col>
</rowh>
<row>
<col><code>Name</code></col>
<col>string</col>
<col><code>Name</code></col>
<col>Can be changed.</col>
</row>
<row>
<col><code>Priority</code></col>
<col>int</col>
<col><code>Priority</code></col>
<col>See <a href="Priorities">Priorities</a></col>
</row>
<row>
<col><code>Interval</code></col>
<col>int</col>
<col><code>Interval</code></col>
<col>Of the <a href="#TimerCallback">Timer callback</a>.</col>
</row>
<row>
<col><code>Time</code></col>
<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>proplist</col>
<col><code>nil</code> when created by <funclink>CreateEffect</funclink>, as the effect gets the callbacks itself. When created by <funclink>AddEffect</funclink> either the command object or the command definition, depending on which is used.</col>
</row>
<row>
<col><code>Target</code></col>
<col>proplist</col>
<col>The object the effect belongs to, or the proplists <code>Scenario</code> or <code>Global</code> for scenario and global effects.</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>
@ -488,19 +488,19 @@ global func FxExplodeOnDeathCurseStop(object target, proplist effect, int reason
</row>
</table>
</text>
<text>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>
<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="CBRef">Callback Reference</h>
<part>
<text>The following callbacks are made by the engine and should be implemented in your effect prototype as necessary.</text>
<h>Start</h>
<text><code>int Start (int temporary, any var1, any var2, any var3, any var4);</code></text>
<text>Called at the start of the effect. <code>this</code> is the effect itself. It can be used to manipulate the effect, for example with <code>this.Interval=newinterval</code>.</text>
<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>
<h>Fx*Start</h>
<text><code>int Fx*Start (object target, proplist effect, int temporary, any var1, any var2, any var3, any var4);</code></text>
<text>Called at the start of the effect. target is the target object of the effect. <code>effect</code> is the effect itself. <code>effect</code> can be used to manipulate the effect, for example with <code>effect.Interval=newinterval</code>.</text>
<text>In normal operation the parameter temporary is 0. It is 1 if the effect is re-added after having been temporarily removed and 2 if the effect was temporarily removed and is now to be deleted (in this case a Remove call will follow).</text>
<text>If temporary is 0, var1 to var4 are the additional parameters passed to <funclink>CreateEffect</funclink>().</text>
<text>If temporary is 0 and this callback returns -1 the effect is not created and the corrsponding <funclink>CreateEffect</funclink>() call returns <code>nil</code>.</text>
<h>Stop</h>
<text><code>int Stop (int reason, bool temporary);</code></text>
<text>When the effect is temporarily or permanently removed. <code>this</code> is the effect itself.</text>
<text>If temporary is 0, var1 to var4 are the additional parameters passed to <funclink>AddEffect</funclink>().</text>
<text>If temporary is 0 and this callback returns -1 the effect is not created and the corrsponding <funclink>AddEffect</funclink>() call returns 0.</text>
<h>Fx*Stop</h>
<text><code>int Fx*Stop (object target, proplist effect, int reason, bool temporary);</code></text>
<text>When the effect is temporarily or permanently removed. target again is the target object and <code>effect</code> the effect itself.</text>
<text>reason contains the cause of the removal and can be one of the following values:</text>
<text>
<table>
@ -537,34 +537,26 @@ global func FxExplodeOnDeathCurseStop(object target, proplist effect, int reason
</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 id="FxConstructionCallback">Construction</h>
<text><code>int Construction (any var1, any var2, any var3, any var4);</code></text>
<text>Called when the effect is first created, before it is started. The parameters <code>var1</code> to <code>var4</code> are passed through from <funclink>CreateEffect</funclink>.</text>
<text>The return value is ignored.</text>
<h id="FxDestructionCallback">Destruction</h>
<text><code>nil Destruction (int reason);</code></text>
<text>Callback when the effect is removed. <code>reason</code> is the same as in the preceding <code>Stop</code> call, see above.</text>
<text>The return value is ignored.</text>
<h id="TimerCallback">Timer</h>
<text><code>int Timer (int time);</code></text>
<text>Periodic timer call, if a timer interval has been specified at effect creation.</text>
<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>
<text>If this function is not implemented or returns -1, the effect will be deleted after this call.</text>
<h>Effect</h>
<text><code>int Effect (string new_name, any var1, any var2, any var3, any var4);</code></text>
<text>A call to all effects of higher priority if a new effect is to be added to the same target object. new_name is the name of the new effect; <code>this</code> is the effect being called.</text>
<h>Fx*Effect</h>
<text><code>int Fx*Effect (string new_name, object target, proplist effect, any var1, any var2, any var3, any var4);</code></text>
<text>A call to all effects of higher priority if a new effect is to be added to the same target object. new_name is the name of the new effect; <code>effect</code> is the effect being called.</text>
<text>Warning: the new effect is not yet properly initialized and should not be manipulated in any way. Especially the priority field might not yet have been set.</text>
<text>This function can return -1 to reject the new effect. As the new effect might also be rejected by other effects, this callback should not try to add effects or similar (see gravitation spell). Generally you should not try to manipulate any effects during this callback.</text>
<text>Return -2 or -3 to accept the new effect. As long as the new effect is not rejected by any other effect, the <code>Add</code> call is then made to the accepting effect, the new effect is not actually created, and the calling <funclink>CreateEffect</funclink> function returns the accepting effect. The return value -3 will also temporarily remove all higher prioriy effects just before the <code>Add</code> callback and re-add them later.</text>
<text>var1 bis var4 are the parameters passed to <funclink>CreateEffect</funclink>()</text>
<h>Add</h>
<text><code>int Add (string new_name, int new_timer, any var1, any var2, any var3, any var4);</code></text>
<text>Callback to the accepting effect if that has returned -2 or -3 to a prior <code>Effect</code> call. <code>this</code> identifies the accepting effect to which the consequences of the new effect will be added.</text>
<text>Return -2 or -3 to accept the new effect. As long as the new effect is not rejected by any other effect, the Fx*Add call is then made to the accepting effect, the new effect is not actually created, and the calling AddEffect function returns the effect index of the accepting effect. The return value -3 will also temporarily remove all higher prioriy effects just before the Fx*Add callback and re-add them later.</text>
<text>var1 bis var4 are the parameters passed to <funclink>AddEffect</funclink>()</text>
<h>Fx*Add</h>
<text><code>int Fx*Add (object target, proplist effect, string new_name, int new_timer, any var1, any var2, any var3, any var4);</code></text>
<text>Callback to the accepting effect if that has returned -2 or -3 to a prior Fx*Effect call. <code>effect</code> identifies the accepting effect to which the consequences of the new effect will be added; target is the target object (0 for global effects).</text>
<text>new_timer is the timer interval of the new effect; var1 to var4 are the parameters from AddEffect. Notice: in temporary calls, these parameters are not available - here they will be 0.</text>
<text>If -1 is returned, the accepting effect is deleted also. Logically, the calling <funclink>CreateEffect</funclink> function will then return <code>nil</code>.</text>
<h>Damage</h>
<text><code>int Damage (int damage, int cause, int by_player);</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 the damage to be done to the target.</text>
<text>If -1 is returned, the accepting effect is deleted also. Logically, the calling AddEffect function will then return -2.</text>
<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 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>
@ -647,7 +639,7 @@ global func FxExplodeOnDeathCurseStop(object target, proplist effect, int reason
<text>There are the following functions for manipulation of effects:</text>
<text>
<ul>
<li><funclink>CreateEffect</funclink>() - for effect creation</li>
<li><funclink>AddEffect</funclink>() - for effect creation</li>
<li><funclink>RemoveEffect</funclink>() - for effect removal</li>
<li><funclink>GetEffect</funclink>() - to search for effects</li>
<li><funclink>GetEffectCount</funclink>() - for effect counting</li>

View File

@ -178,10 +178,6 @@
<col>GUI_GridLayout</col>
<col>The sub-windows of this window will automatically be arranged in a grid.</col>
</row>
<row>
<col>GUI_TightGridLayout</col>
<col>Like GUI_GridLayout but might reorder items and lead to less empty space between sub-windows.</col>
</row>
<row>
<col>GUI_VerticalLayout</col>
<col>The sub-windows of this window will automatically be arranged vertically in a list.</col>

View File

@ -260,11 +260,11 @@ Blit({Algo=MAPALGO_Scale, OffX=Wdt/2, X=-100, Op=copy_layer});
</row><row>
<col>OffX</col>
<col>0</col>
<col>X position of fixed point that remains in position. Actual fixed point is translated left by -0.5 pixels to achieve proper pixel mapping.</col>
<col>X position of fixed point that remains in position.</col>
</row><row>
<col>OffY</col>
<col>0</col>
<col>Y position of fixed point that remains in position. Actual fixed point is translated up by -0.5 pixels to achieve proper pixel mapping.</col>
<col>Y position of fixed point that remains in position.</col>
</row>
</table></text></part>
<h>MAPALGO_Rotate</h><part>
@ -292,10 +292,6 @@ Blit({Algo=MAPALGO_Scale, OffX=Wdt/2, X=-100, Op=copy_layer});
<text>Jumbles its operand around by moving points by a randomized offset.</text>
<text><table><rowh><col>Parameter</col><col>Default</col><col>Meaning</col></rowh>
<row>
<col>Op</col>
<col></col>
<col>Algorithms that is being manipulated.</col>
</row><row>
<col>Seed</col>
<col>Random(65536)</col>
<col>If nonzero, the offset map is generated from a fixed seed.</col>

View File

@ -38,9 +38,6 @@
<text>Finds a random position in the shape and returns it as properties x and y in the supplied proplist. The return value indivates whether a point could be found.</text>
<text>The parameter max_tries indicates how many times the algorithm tries to find a point within the shape. The function is guaranteed to succeed for non-empty base shapes (i.e. rectangle and circle) as well as combined shapes on a single try. However a stochastic approach is used for intersection and subtraction shapes where random points are queried from one of the sub-shapes and subsequently checked against the other sub-shapes.</text>
<text></text>
<code>bool GetArea();</code>
<text>Returns the area covered by the shape in squared pixels.</text>
<text></text>
<code>proplist GetBoundingRectangle();</code>
<text>Returns a rectangular shape that includes at least the whole shape used as calling context.</text>
<text></text>

View File

@ -6,7 +6,7 @@
<func>
<title>Abs</title>
<category>Arithmetics</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -7,7 +7,7 @@
<title>AbsX</title>
<category>Objects</category>
<subcat>Position</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -7,7 +7,7 @@
<title>AbsY</title>
<category>Objects</category>
<subcat>Position</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -7,7 +7,7 @@
<title>ActIdle</title>
<category>Objects</category>
<subcat>Activity</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax><rtype>bool</rtype></syntax>
<desc>Checks whether an object is currently performing an activity.</desc>
<related>

View File

@ -7,7 +7,7 @@
<title>AddCommand</title>
<category>Objects</category>
<subcat>Commands</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>bool</rtype>
<params>

View File

@ -6,8 +6,7 @@
<func>
<title>AddEffect</title>
<category>Effects</category>
<version>1.0 OC</version>
<deprecated />
<version>5.1 OC</version>
<syntax>
<rtype>proplist</rtype>
<params>
@ -19,7 +18,7 @@
<param>
<type>object</type>
<name>target</name>
<desc>Target object for the effect. If <code>nil</code>, <code>Global</code> is used, but the target parameter of the callbacks will get <code>nil</code>.</desc>
<desc>Target object for the effect. If <code>nil</code>, a global effect is created.</desc>
<optional />
</param>
<param>
@ -75,7 +74,6 @@
<remark>For examples and more information see the <emlink href="script/Effects.html">effects documentation</emlink>.</remark>
<related>
<emlink href="script/Effects.html">Effects Documentation</emlink>
<funclink>CreateEffect</funclink>
<funclink>CheckEffect</funclink>
<funclink>GetEffectCount</funclink>
<funclink>EffectCall</funclink>

View File

@ -1,60 +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>AddFragmentShader</title>
<category>Global</category>
<version>8.0 OC</version>
<syntax>
<rtype>int</rtype>
<params>
<param>
<type>string</type>
<name>category</name>
<desc>
Shader category or shader name the slices are added to. Known categories:
<table>
<rowh>
<col>Category</col>
<col>Description</col>
</rowh>
<row>
<col>Common</col>
<col>Applies to everything.</col>
</row>
<row>
<col>Object</col>
<col>Applies to all objects and sprites.</col>
</row>
<row>
<col>Landscape</col>
<col>Applies to the landscape.</col>
</row>
</table>
</desc>
</param>
<param>
<type>string</type>
<name>shader</name>
<desc>The GLSL shader code.</desc>
</param>
</params>
</syntax>
<desc>Adds shader slices to a category of shaders or to a single shader. Returns an identifier for removal.</desc>
<remark>
Consider using built-in functions such as <funclink>SetGamma</funclink>, <funclink>SetMatAdjust</funclink>, or <funclink>SetClrModulation</funclink> for changing colors instead of writing a custom shader.
</remark>
<examples>
<example>
<code>AddFragmentShader("Landscape", "slice(color+1) { fragColor.r = 1.f; }");</code>
<text>Makes the landscape very red.</text>
</example>
</examples>
<related>
<funclink>RemoveShader</funclink>
</related>
</func>
<author>Luchs</author><date>2016-10</date>
</funcs>

View File

@ -7,7 +7,7 @@
<title>AddMenuItem</title>
<category>Objects</category>
<subcat>Menu</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>AddMsgBoardCmd</title>
<category>Interface</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -7,19 +7,19 @@
<title>AddVertex</title>
<category>Objects</category>
<subcat>Vertices</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>bool</rtype>
<rtype>int</rtype>
<params>
<param>
<type>int</type>
<name>x</name>
<desc>X coordinate, relative to the object center.</desc>
<desc>X coordinate, relative to the object center</desc>
</param>
<param>
<type>int</type>
<name>y</name>
<desc>Y coordinate, relative to the object center.</desc>
<desc>Y coordinate, relative to the object center</desc>
</param>
</params>
</syntax>
@ -32,7 +32,6 @@
</example>
</examples>
<related>
<funclink>InsertVertex</funclink>
<funclink>GetVertex</funclink>
<funclink>SetVertex</funclink>
<funclink>GetVertexNum</funclink>

View File

@ -6,7 +6,7 @@
<func>
<title>Angle</title>
<category>Arithmetics</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_AbsX</title>
<category>Animations</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_AbsY</title>
<category>Animations</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_Action</title>
<category>Animations</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>array</rtype>
<params />

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_Const</title>
<category>Animations</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_Dist</title>
<category>Animations</category>
<version>6.0 OC</version>
<version>5.6 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_Linear</title>
<category>Animations</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_R</title>
<category>Animations</category>
<version>3.0 OC</version>
<version>5.3 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_X</title>
<category>Animations</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_XDir</title>
<category>Animations</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_Y</title>
<category>Animations</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>Anim_YDir</title>
<category>Animations</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>array</rtype>
<params>

View File

@ -7,7 +7,7 @@
<title>AppendCommand</title>
<category>Objects</category>
<subcat>Commands</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>bool</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>ArcCos</title>
<category>Arithmetics</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>ArcSin</title>
<category>Arithmetics</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -7,7 +7,7 @@
<title>AttachMesh</title>
<category>Objects</category>
<subcat>Display</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>BlastFree</title>
<category>Landscape</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>BlastObjects</title>
<category>Objects</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -6,7 +6,7 @@
<func>
<title>BoundBy</title>
<category>Arithmetics</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>

View File

@ -7,7 +7,7 @@
<title>Bubble</title>
<category>Environment</category>
<subcat>Effects</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>bool</rtype>
<params>

View File

@ -7,7 +7,7 @@
<title>Buy</title>
<category>Objects</category>
<subcat>Creation</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax>
<rtype>object</rtype>
<params>
@ -50,6 +50,7 @@
<related>
<funclink>Sell</funclink>
<funclink>GetWealth</funclink>
<funclink>GetBase</funclink>
<funclink>FindBase</funclink>
</related>
</func>

View File

@ -7,7 +7,7 @@
<title>C4D_All</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Object category: all categories.</desc>
<related>

View File

@ -7,7 +7,7 @@
<title>C4D_Background</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax><rtype>int </rtype></syntax>
<desc>Object category: object is drawn behind the landscape. Useful for effects like clouds or celestial bodies.</desc>
<remark>This category does not work in the old 8 bit graphics system.</remark>

View File

@ -7,7 +7,7 @@
<title>C4D_Goal</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Object category: game goal.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>C4D_Living</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax><rtype>int </rtype></syntax>
<desc>Objects with this category are alive when created.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>C4D_Object</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax><rtype>int </rtype></syntax>
<desc>Object category: Item that can hit alive objects.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>C4D_Parallax</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax><rtype>int </rtype></syntax>
<desc>Object category: the object moves parallax with respect to the landscape. This means that the apparent object position changes depending on the scroll position of the viewport. This can be used to have objects apparently moving in the far background or to create status overlays.<br/>Parallax deviation from the normal location is specified in percent and stored in an array in the <emlink href="definition/properties.html#Parallaxity"><code>Parallaxity</code> property</emlink> of the object (<code>Parallaxity[0]</code> for horizontal, <code>Parallaxity[1]</code> for vertical deviation). This means for normal location these two values should be 100. A value of 0 will lock the object to the viewport. For parallax background object use values between 0 and 100. Object positions can also be negative values. Those objects will then be aligned with the right or bottom edge of the screen respectively.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>C4D_Rule</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Object category: rule object.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>C4D_StaticBack</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax><rtype>int </rtype></syntax>
<desc>Objects with this category do not move. This is useful for all kinds of stuff, like making sure rule objects don't fall out of the landscape.</desc>
<related>

View File

@ -7,7 +7,7 @@
<title>C4D_Structure</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax><rtype>int </rtype></syntax>
<desc>Unused Object category.</desc>
<related>

View File

@ -7,7 +7,7 @@
<title>C4D_Vehicle</title>
<category>Objects</category>
<subcat>Category</subcat>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax><rtype>int </rtype></syntax>
<desc>Unused Object category.</desc>
<related>

View File

@ -6,7 +6,7 @@
<const>
<title>C4V_Array</title>
<category>Variables</category>
<version>1.0 OC</version>
<version>5.1 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Data type: array.</desc>
<examples>

Some files were not shown because too many files have changed in this diff Show More