Merge branch 'master' into heavy-resources

Conflicts:
	planet/Objects.ocd/Items.ocd/Resources.ocd/Nugget.ocd/Script.c
heavy-resources
Clonkonaut 2014-01-24 00:48:06 +01:00
commit b371e6b51f
3247 changed files with 73839 additions and 53182 deletions

1
.git_archival 100644
View File

@ -0,0 +1 @@
node: $Format:%H$

3
.gitattributes vendored 100644
View File

@ -0,0 +1,3 @@
.git_archival export-subst
.gitattributes export-ignore
.gitignore export-ignore

View File

@ -1,14 +1,13 @@
syntax: glob
autom4te.cache
*~
*.bak
.deps
deps
*.o
./clonk
./netpuncher
./c4group
/openclonk
/netpuncher
/c4group
/c4script
.dirstamp
*.a
*.c4p
@ -41,6 +40,8 @@ planet/CMakeCache.txt
CPackConfig.cmake
CPackSourceConfig.cmake
*.rule
editor-icons.h
oc-icon.h
# Documentation
*.pyc
@ -85,6 +86,7 @@ openclonk.ilk
*.vcproj
*.vcxproj
*.vcxproj.filters
/ipch
# Temporary files created by Microsoft Visual Studio
*.ncb
@ -109,8 +111,6 @@ BuildLog.htm
xcode/build
*.xcodeproj
.anjuta*
# Binaries
*.app
*.exe
@ -122,11 +122,20 @@ planet/nohg*
planet/.project
# Code::Blocks files
clonk.layout
clonk.sdf
clonk.cbp
openclonk.layout
openclonk.sdf
openclonk.cbp
tests/openclonk_unittest.cbp
# MacOSX saved searches
*.savedSearch
planet/OpenClonk.bat
planet/openclonk.sln
WindowsGamesExplorer.xml
# Mape
mape
mape-icons.h
tests/openclonk_unittest.sln

3
.hgeol
View File

@ -1,3 +0,0 @@
[patterns]
planet/** = LF
** = native

File diff suppressed because it is too large Load Diff

47
COPYING 100644
View File

@ -0,0 +1,47 @@
Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de
Copyright (c) 2009-2013, 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
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Portions of the code have been contributed by other authors:
Copyright (c) 2006-2007 Alexander Post
Copyright (c) 2004-2013 Armin Burgmeier
Copyright (c) 2005-2006, 2008-2010 Asmageddon
Copyright (c) 2010, 2012 Benjamin Herr
Copyright (c) 2006, 2012 Bernhard Bonigl
Copyright (c) 2009-2010 Carl-Philip Hänsch
Copyright (c) 2001 Carlo Teubner
Copyright (c) 2009, 2011-2013 David Dormagen
Copyright (c) 2011-2012 Felix Wagner
Copyright (c) 2006 Florian Groß
Copyright (c) 2004-2012 Günther Brammer
Copyright (c) 2006-2008 Julian Raschke
Copyright (c) 2010-2012 Julius Michaelis
Copyright (c) 2010-2011 Maikel de Vries
Copyright (c) 2010 Manuel Riecke
Copyright (c) 2009 Mark Haßelbusch
Copyright (c) 2009-2012 Martin Plicht
Copyright (c) 1998-2008 Matthes Bender
Copyright (c) 2001 Michael Käser
Copyright (c) 2009 mizipzor
Copyright (c) 2009-2013 Nicolas Hake
Copyright (c) 2010 Peewee
Copyright (c) 2001-2011 Peter Wortmann
Copyright (c) 2012 Philipp Kern
Copyright (c) 2009-2010 Richard Gerum
Copyright (c) 2001-2013 Sven Eberhardt
Copyright (c) 2004-2005, 2009-2013 Tobias Zwick
Code inside the "thirdparty" directory has been included for convenience
and may be licensed under different terms. See the respective directories
for details.

View File

@ -1,20 +1,25 @@
<Engine Development>
<Engine and Tools>
Armin Burgmeier (Clonk-Karl)
Günther Brammer (Günther)
Sven Eberhardt (Sven2)
Nicolas Hake (Isilkor)
Peter Wortmann (PeterW)
Sven Eberhardt (Sven2)
Martin Plicht (Mortimer)
Peter Wortmann (PeterW)
Julius Michaelis (Caesar)
<Art and Content>
Charles Spurrill (Ringwaul)
Richard Gerum (Randrian)
Timo Stabbert (Mimmo)
<Scripting and Content>
Maikel de Vries (Maikel)
Bernhard Bonigl (Boni)
Felix Wagner (Clonkonaut)
David Dormagen (Zapper)
<Coordination, Administration>
Tobias Zwick (Newton)
<Content, Art and Scripting>
Charles Spurrill (Ringwaul)
Maikel de Vries (Maikel)
Timo Stabbert (Mimmo)
Richard Gerum (Randrian)
David Dormagen (Zapper)
<Thanks to Contributors>
Benjamin Herr (Loriel), Julius Michaelis (Caesar), Felix Wagner (Clonkonaut), Manuel Riecke (MrBeast), Benedict Etzel (B_E), Carl-Philip Hänsch (Carli), Alexander Semeniuk (AlteredARMOR), Asmageddon, Florian Graier (Nachtfalter), Merten Ehmig (pluto), Mark Haßelbusch (Marky), Luchs, Peewee, Lauri Niskanen (Ape), Dominik Bayerl (Kanibal), Matthias Rottländer (Matthi), Faby, Checkmaty, TomyLobo, Stan, Gurkenglas, Clonkine, mizipzor, RedWolf Design GmbH and all those who contributed to previous Clonk titles for the passion they put into the game and for agreeing to make Clonk open source.
Benjamin Herr (Loriel), Matthias Rottländer (Matthi), Felix Riese (Fungiform), Manuel Riecke (MrBeast), Benedict Etzel (B_E), Carl-Philip Hänsch (Carli), Alexander Semeniuk (AlteredARMOR), Florian Graier (Nachtfalter), Daniel Theuke (ST-DDT), Asmageddon, Merten Ehmig (Pluto), Mark Haßelbusch (Marky), Luchs, Peewee, Lauri Niskanen (Ape), Dominik Bayerl (Kanibal), Faby, Checkmaty, Gurkenglas, Clonkine, mizipzor, mixi, Pyrit, grgecko, Koronis, RedWolf Design GmbH and all those who contributed to previous Clonk titles for the passion they put into the game and for agreeing to make Clonk open source.

View File

@ -1,871 +0,0 @@
# Copyright (c) 2005-2011 Günther Brammer
# Copyright (c) 2009 Armin Burgmeier
# Copyright (c) 2010-2011 Nicolas Hake
# Copyright (c) 2005-2009, RedWolf Design GmbH, http://www.clonk.de
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ACLOCAL_AMFLAGS = -I autotools --install
bin_PROGRAMS = clonk c4group puncher c4script
EXTRA_PROGRAMS = tstc4netio gunzip4c4group
noinst_LIBRARIES = lib.a
# Some defines and warning options
if RECENT_GCC
WARNING_FLAGS = -Wall -Wextra -Wredundant-decls -Wendif-labels -Wpointer-arith \
-Wcast-qual -Wcast-align -Wwrite-strings -Winit-self -Wsign-promo \
-Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual -Wsign-promo
##-Wmissing-format-attribute -Wdisabled-optimization -Wlogical-op
##-Weffc++ -Wold-style-cast -Woverloaded-virtual -Wunsafe-loop-optimizations
else
WARNING_FLAGS = -Wall
endif
AM_CXXFLAGS = $(PTHREAD_CFLAGS) $(WINDOWS_CFLAGS) $(WARNING_FLAGS)
AM_CFLAGS = -Wall
AM_CPPFLAGS = \
-I$(builddir) \
-I$(srcdir)/src \
-I$(srcdir)/src/c4group \
-I$(srcdir)/src/network \
-I$(srcdir)/src/lib \
-I$(srcdir)/src/platform \
-I$(srcdir)/src/config \
-I$(srcdir)/src/res \
-I$(srcdir)/src/control \
-I$(srcdir)/src/gui \
-I$(srcdir)/src/editor \
-I$(srcdir)/src/game/landscape \
-I$(srcdir)/src/game/player \
-I$(srcdir)/src/game/script \
-I$(srcdir)/src/game \
-I$(srcdir)/src/game/object \
-I$(srcdir)/src/lib/texture \
-I$(srcdir)/src/script \
-I$(srcdir)/thirdparty \
$(GLEW_CFLAGS) \
$(GTK_CFLAGS) \
$(OPENAL_CFLAGS) \
$(FREETYPE_CFLAGS) \
$(SDL_CFLAGS) \
$(BOOST_CPPFLAGS) \
$(LIBUPNP_CFLAGS)
##BUILT_SOURCES = hgrevision.h
##hgrevision.h: $(srcdir)/.hg/dirstate
## $(srcdir)/tools/get_hg_revision.sh > hgrevision.h
##$(srcdir)/.hg/dirstate:
BUILT_SOURCES = C4Version.h
CLEANFILES =
DISTCLEANFILES = C4Version.h
do_subst = sed -e 's,[@]C4PROJECT[@],'"$$(sed -n 's/SET(C4PROJECT\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)"',g' \
-e 's,[@]C4PROJECT_DOMAIN[@],'"$$(sed -n 's/SET(C4PROJECT_DOMAIN\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)"',g' \
-e 's,[@]C4PROJECT_TLD[@],'"$$(sed -n 's/SET(C4PROJECT_TLD\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)"',g' \
-e 's,[@]C4PROJECT_URL[@],http://www.openclonk.org,g' \
-e 's,[@]C4COPYRIGHT_YEAR[@],'"$$(date '+%Y')"',g' \
-e 's,[@]C4ENGINENAME[@],'"$$(sed -n 's/SET(C4ENGINENAME\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)"',g' \
-e 's,[@]C4ENGINENICK[@],'"$$(sed -n 's/SET(C4ENGINENICK\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)"',g' \
-e 's,[@]C4ENGINEID[@],org.openclonk." C4ENGINENICK ",g' \
-e 's,[@]C4XVER1[@],'"$$(sed -n 's/SET(C4XVER1\s\+\(.\+\))/\1/ p' $(srcdir)/Version.txt)"',g' \
-e 's,[@]C4XVER2[@],'"$$(sed -n 's/SET(C4XVER2\s\+\(.\+\))/\1/ p' $(srcdir)/Version.txt)"',g' \
-e 's,[@]C4XVER3[@],'"$$(sed -n 's/SET(C4XVER3\s\+\(.\+\))/\1/ p' $(srcdir)/Version.txt)"',g' \
-e 's,[@]C4XVER4[@],'"$$(sed -n 's/SET(C4XVER4\s\+\(.\+\))/\1/ p' $(srcdir)/Version.txt)"',g' \
-e 's,[@]C4VERSIONBUILDNAME[@],'"$$(sed -n 's/SET(C4VERSIONBUILDNAME\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)"',g' \
-e 's,[@]C4VERSIONEXTRA[@],'"$$(sed -n 's/SET(C4VERSIONEXTRA\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)"',g'
C4Version.h: $(srcdir)/src/C4Version.h.in $(srcdir)/Version.txt
$(do_subst) < $< > $@
WindowsGamesExplorer.xml: $(srcdir)/src/res/WindowsGamesExplorer.xml.in $(srcdir)/Version.txt
$(do_subst) < $< > $@
src/res/engine.o: WindowsGamesExplorer.xml
#various hacks to get dependency tracking working with a precompiled C4Include
if RECENT_GCC
BUILT_SOURCES += C4Include.h.gch
CLEANFILES += C4Include.h.gch
DISTCLEANFILES += @am__quote@$(DEPDIR)/C4Include.Po@am__quote@
# Adapted from the automake compile-command for normal source files.
# Has to be updated after certain changes in this file.
C4Include.h.gch: src/C4Include.h
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -x c++-header -MT C4Include.h.gch -MD -MP -MF $(DEPDIR)/C4Include.Tpo -c -o $@ $(srcdir)/src/C4Include.h
@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/C4Include.Tpo $(DEPDIR)/C4Include.Po
@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -x c++-header -c -o $@ $(srcdir)/src/C4Include.h
@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/C4Include.Po@am__quote@
if am__fastdepCXX
AM_CXXFLAGS += -fpch-deps
endif
WARNING_FLAGS += -Winvalid-pch
endif
lib_a_SOURCES = \
src/c4group/C4Group.cpp \
src/c4group/C4Group.h \
src/c4group/C4Update.cpp \
src/c4group/C4Update.h \
src/c4group/CStdFile.cpp \
src/c4group/CStdFile.h \
src/config/C4SecurityCertificates.cpp \
src/config/C4SecurityCertificates.h \
src/lib/C4InputValidation.cpp \
src/lib/C4InputValidation.h \
src/lib/SHA1.h \
src/lib/Standard.cpp \
src/lib/Standard.h \
src/lib/StdBuf.cpp \
src/lib/StdBuf.h \
src/lib/StdCompiler.cpp \
src/lib/StdCompiler.h \
src/lib/C4Markup.cpp \
src/lib/C4Markup.h \
src/lib/StdResStr2.cpp \
src/lib/StdResStr2.h \
src/network/C4NetIO.cpp \
src/platform/GetTime.cpp \
src/platform/StdFile.cpp \
src/platform/StdFile.h \
src/platform/StdRegistry.cpp \
src/platform/StdRegistry.h \
src/platform/StdScheduler.cpp \
src/platform/StdScheduler.h \
src/zlib/gzio.c \
src/zlib/gzio.h \
src/zlib/zutil.h
clonk_SOURCES = \
src/C4Application.cpp \
src/C4Application.h \
src/C4FullScreen.cpp \
src/C4FullScreen.h \
src/C4Game.cpp \
src/C4Game.h \
src/C4Globals.cpp \
src/C4GraphicsSystem.cpp \
src/C4GraphicsSystem.h \
src/c4group/C4ComponentHost.cpp \
src/c4group/C4ComponentHost.h \
src/c4group/C4Components.h \
src/c4group/C4Extra.cpp \
src/c4group/C4Extra.h \
src/c4group/C4GroupSet.cpp \
src/c4group/C4GroupSet.h \
src/c4group/C4LangStringTable.cpp \
src/c4group/C4LangStringTable.h \
src/c4group/C4Language.cpp \
src/c4group/C4Language.h \
src/C4Include.h \
src/C4Prototypes.h \
src/C4Version.h.in \
src/C4WinMain.cpp \
src/config/C4Config.cpp \
src/config/C4Config.h \
src/config/C4Constants.h \
src/config/C4Reloc.cpp \
src/config/C4Reloc.h \
src/control/C4Control.cpp \
src/control/C4Control.h \
src/control/C4GameControl.cpp \
src/control/C4GameControl.h \
src/control/C4GameParameters.cpp \
src/control/C4GameParameters.h \
src/control/C4GameSave.cpp \
src/control/C4GameSave.h \
src/control/C4PlayerControl.cpp \
src/control/C4PlayerControl.h \
src/control/C4PlayerInfoConflicts.cpp \
src/control/C4PlayerInfo.cpp \
src/control/C4PlayerInfo.h \
src/control/C4Record.cpp \
src/control/C4Record.h \
src/control/C4RoundResults.cpp \
src/control/C4RoundResults.h \
src/control/C4Teams.cpp \
src/control/C4Teams.h \
src/editor/C4Console.cpp \
src/editor/C4ConsoleGUICommon.h \
src/editor/C4ConsoleGUI.h \
src/editor/C4Console.h \
src/editor/C4DevmodeDlg.cpp \
src/editor/C4DevmodeDlg.h \
src/editor/C4EditCursor.cpp \
src/editor/C4EditCursor.h \
src/editor/C4ObjectListDlg.cpp \
src/editor/C4ObjectListDlg.h \
src/editor/C4ToolsDlg.cpp \
src/editor/C4ToolsDlg.h \
src/game/C4GameVersion.h \
src/game/C4Physics.h \
src/game/landscape/C4Landscape.cpp \
src/game/landscape/C4Landscape.h \
src/game/landscape/C4LandscapeRenderClassic.cpp \
src/game/landscape/C4LandscapeRender.cpp \
src/game/landscape/C4LandscapeRender.h \
src/game/landscape/C4Map.cpp \
src/game/landscape/C4MapCreatorS2.cpp \
src/game/landscape/C4MapCreatorS2.h \
src/game/landscape/C4Map.h \
src/game/landscape/C4MassMover.cpp \
src/game/landscape/C4MassMover.h \
src/game/landscape/C4Material.cpp \
src/game/landscape/C4Material.h \
src/game/landscape/C4MaterialList.cpp \
src/game/landscape/C4MaterialList.h \
src/game/landscape/C4Particles.cpp \
src/game/landscape/C4Particles.h \
src/game/landscape/C4PathFinder.cpp \
src/game/landscape/C4PathFinder.h \
src/game/landscape/C4PXS.cpp \
src/game/landscape/C4PXS.h \
src/game/landscape/C4Region.cpp \
src/game/landscape/C4Region.h \
src/game/landscape/C4Scenario.cpp \
src/game/landscape/C4Scenario.h \
src/game/landscape/C4Sky.cpp \
src/game/landscape/C4Sky.h \
src/game/landscape/C4SolidMask.cpp \
src/game/landscape/C4SolidMask.h \
src/game/landscape/C4Texture.cpp \
src/game/landscape/C4Texture.h \
src/game/landscape/C4Weather.cpp \
src/game/landscape/C4Weather.h \
src/game/object/C4Action.cpp \
src/game/object/C4Command.cpp \
src/game/object/C4Command.h \
src/game/object/C4Def.cpp \
src/game/object/C4DefGraphics.cpp \
src/game/object/C4DefGraphics.h \
src/game/object/C4Def.h \
src/game/object/C4DefList.cpp \
src/game/object/C4DefList.h \
src/game/object/C4GameObjects.cpp \
src/game/object/C4GameObjects.h \
src/game/object/C4Id.cpp \
src/game/object/C4Id.h \
src/game/object/C4IDList.cpp \
src/game/object/C4IDList.h \
src/game/object/C4InfoCore.cpp \
src/game/object/C4InfoCore.h \
src/game/object/C4MeshAnimation.cpp \
src/game/object/C4MeshAnimation.h \
src/game/object/C4Movement.cpp \
src/game/object/C4ObjectCom.cpp \
src/game/object/C4ObjectCom.h \
src/game/object/C4Object.cpp \
src/game/object/C4Object.h \
src/game/object/C4ObjectInfo.cpp \
src/game/object/C4ObjectInfo.h \
src/game/object/C4ObjectInfoList.cpp \
src/game/object/C4ObjectInfoList.h \
src/game/object/C4ObjectList.cpp \
src/game/object/C4ObjectList.h \
src/game/object/C4ObjectMenu.cpp \
src/game/object/C4ObjectMenu.h \
src/game/object/C4ObjectPtr.cpp \
src/game/object/C4ObjectPtr.h \
src/game/object/C4ObjectScript.cpp \
src/game/object/C4Sector.cpp \
src/game/object/C4Sector.h \
src/game/object/C4Shape.cpp \
src/game/object/C4Shape.h \
src/game/player/C4Player.cpp \
src/game/player/C4Player.h \
src/game/player/C4PlayerList.cpp \
src/game/player/C4PlayerList.h \
src/game/player/C4RankSystem.cpp \
src/game/player/C4RankSystem.h \
src/game/script/C4Effect.cpp \
src/game/script/C4Effects.h \
src/game/script/C4FindObject.cpp \
src/game/script/C4FindObject.h \
src/game/script/C4GameScript.cpp \
src/game/script/C4Script.h \
src/game/script/C4TransferZone.cpp \
src/game/script/C4TransferZone.h \
src/gui/C4ChatDlg.cpp \
src/gui/C4ChatDlg.h \
src/gui/C4DownloadDlg.cpp \
src/gui/C4DownloadDlg.h \
src/gui/C4FileSelDlg.cpp \
src/gui/C4FileSelDlg.h \
src/gui/C4Folder.cpp \
src/gui/C4Folder.h \
src/gui/C4GameDialogs.cpp \
src/gui/C4GameDialogs.h \
src/gui/C4GameLobby.cpp \
src/gui/C4GameLobby.h \
src/gui/C4GameMessage.cpp \
src/gui/C4GameMessage.h \
src/gui/C4GameOptions.cpp \
src/gui/C4GameOptions.h \
src/gui/C4GameOverDlg.cpp \
src/gui/C4GameOverDlg.h \
src/gui/C4GfxErrorDlg.cpp \
src/gui/C4GfxErrorDlg.h \
src/gui/C4GuiButton.cpp \
src/gui/C4GuiCheckBox.cpp \
src/gui/C4GuiComboBox.cpp \
src/gui/C4GuiContainers.cpp \
src/gui/C4Gui.cpp \
src/gui/C4GuiDialogs.cpp \
src/gui/C4GuiEdit.cpp \
src/gui/C4Gui.h \
src/gui/C4GuiLabels.cpp \
src/gui/C4GuiListBox.cpp \
src/gui/C4GuiMenu.cpp \
src/gui/C4GuiTabular.cpp \
src/gui/C4KeyboardInput.cpp \
src/gui/C4KeyboardInput.h \
src/gui/C4LoaderScreen.cpp \
src/gui/C4LoaderScreen.h \
src/gui/C4MainMenu.cpp \
src/gui/C4MainMenu.h \
src/gui/C4Menu.cpp \
src/gui/C4Menu.h \
src/gui/C4MessageBoard.cpp \
src/gui/C4MessageBoard.h \
src/gui/C4MessageInput.cpp \
src/gui/C4MessageInput.h \
src/gui/C4MouseControl.cpp \
src/gui/C4MouseControl.h \
src/gui/C4PlayerInfoListBox.cpp \
src/gui/C4PlayerInfoListBox.h \
src/gui/C4Scoreboard.cpp \
src/gui/C4Scoreboard.h \
src/gui/C4StartupAboutDlg.cpp \
src/gui/C4StartupAboutDlg.h \
src/gui/C4Startup.cpp \
src/gui/C4Startup.h \
src/gui/C4StartupMainDlg.cpp \
src/gui/C4StartupMainDlg.h \
src/gui/C4StartupNetDlg.cpp \
src/gui/C4StartupNetDlg.h \
src/gui/C4StartupOptionsDlg.cpp \
src/gui/C4StartupOptionsDlg.h \
src/gui/C4StartupPlrSelDlg.cpp \
src/gui/C4StartupPlrSelDlg.h \
src/gui/C4StartupScenSelDlg.cpp \
src/gui/C4StartupScenSelDlg.h \
src/gui/C4UpdateDlg.cpp \
src/gui/C4UpdateDlg.h \
src/gui/C4UpperBoard.cpp \
src/gui/C4UpperBoard.h \
src/gui/C4UserMessages.h \
src/gui/C4Viewport.cpp \
src/gui/C4Viewport.h \
src/lib/C4LogBuf.cpp \
src/lib/C4LogBuf.h \
src/lib/C4Log.cpp \
src/lib/C4Log.h \
src/lib/C4NameList.cpp \
src/lib/C4NameList.h \
src/lib/C4Random.cpp \
src/lib/C4Random.h \
src/lib/C4Real.cpp \
src/lib/C4Real.h \
src/lib/C4Rect.cpp \
src/lib/C4Rect.h \
src/lib/C4RTF.cpp \
src/lib/C4RTF.h \
src/lib/C4Stat.cpp \
src/lib/C4Stat.h \
src/lib/PathFinder.cpp \
src/lib/PathFinder.h \
src/lib/StdAdaptors.h \
src/lib/StdBase64.cpp \
src/lib/StdBase64.h \
src/lib/StdColors.h \
src/lib/StdMesh.cpp \
src/lib/StdMesh.h \
src/lib/StdMeshLoaderBinaryChunks.cpp \
src/lib/StdMeshLoaderBinaryChunks.h \
src/lib/StdMeshLoaderBinary.cpp \
src/lib/StdMeshLoaderDataStream.h \
src/lib/StdMeshLoader.h \
src/lib/StdMeshLoaderXml.cpp \
src/lib/StdMeshMaterial.cpp \
src/lib/StdMeshMaterial.h \
src/lib/StdMeshMath.cpp \
src/lib/StdMeshMath.h \
src/lib/StdMeshUpdate.cpp \
src/lib/StdMeshUpdate.h \
src/lib/StdResStr.h \
src/lib/texture/C4Facet.cpp \
src/lib/texture/C4FacetEx.cpp \
src/lib/texture/C4FacetEx.h \
src/lib/texture/C4Facet.h \
src/lib/texture/C4GraphicsResource.cpp \
src/lib/texture/C4GraphicsResource.h \
src/lib/texture/C4SurfaceLoaders.cpp \
src/lib/texture/StdPNG.cpp \
src/lib/texture/StdPNG.h \
src/network/C4Client.cpp \
src/network/C4Client.h \
src/network/C4GameControlNetwork.cpp \
src/network/C4GameControlNetwork.h \
src/network/C4InteractiveThread.cpp \
src/network/C4InteractiveThread.h \
src/network/C4League.cpp \
src/network/C4League.h \
src/network/C4NetIO.h \
src/network/C4Network2Client.cpp \
src/network/C4Network2Client.h \
src/network/C4Network2.cpp \
src/network/C4Network2Dialogs.cpp \
src/network/C4Network2Dialogs.h \
src/network/C4Network2Discover.cpp \
src/network/C4Network2Discover.h \
src/network/C4Network2.h \
src/network/C4Network2IO.cpp \
src/network/C4Network2IO.h \
src/network/C4Network2IRC.cpp \
src/network/C4Network2IRC.h \
src/network/C4Network2Players.cpp \
src/network/C4Network2Players.h \
src/network/C4Network2Reference.cpp \
src/network/C4Network2Reference.h \
src/network/C4Network2Res.cpp \
src/network/C4Network2ResDlg.cpp \
src/network/C4Network2Res.h \
src/network/C4Network2Stats.cpp \
src/network/C4Network2Stats.h \
src/network/C4Network2UPnP.h \
src/network/C4Packet2.cpp \
src/network/C4PacketBase.h \
src/platform/Bitmap256.cpp \
src/platform/Bitmap256.h \
src/platform/C4App.cpp \
src/platform/C4App.h \
src/platform/C4AppT.cpp \
src/platform/C4FileMonitor.cpp \
src/platform/C4FileMonitor.h \
src/platform/C4Fonts.cpp \
src/platform/C4Fonts.h \
src/platform/C4GamePadCon.cpp \
src/platform/C4GamePadCon.h \
src/platform/C4MusicFile.cpp \
src/platform/C4MusicFile.h \
src/platform/C4MusicSystem.cpp \
src/platform/C4MusicSystem.h \
src/platform/C4SoundLoaders.cpp \
src/platform/C4SoundLoaders.h \
src/platform/C4SoundSystem.cpp \
src/platform/C4SoundSystem.h \
src/platform/C4Surface.cpp \
src/platform/C4Surface.h \
src/platform/C4Video.cpp \
src/platform/C4Video.h \
src/platform/C4VideoPlayback.cpp \
src/platform/C4VideoPlayback.h \
src/platform/C4ViewportWindow.cpp \
src/platform/C4ViewportWindow.h \
src/platform/C4Window.h \
src/platform/C4windowswrapper.h \
src/platform/PlatformAbstraction.cpp \
src/platform/PlatformAbstraction.h \
src/platform/StdD3D.cpp \
src/platform/StdD3D.h \
src/platform/StdD3DShader.cpp \
src/platform/StdD3DShader.h \
src/platform/StdDDraw2.cpp \
src/platform/StdDDraw2.h \
src/platform/StdFont.cpp \
src/platform/StdFont.h \
src/platform/StdGL.cpp \
src/platform/StdGLCtx.cpp \
src/platform/StdGL.h \
src/platform/StdNoGfx.cpp \
src/platform/StdNoGfx.h \
src/platform/StdSurface8.cpp \
src/platform/StdSurface8.h \
src/platform/StdSync.h \
src/platform/StdVideo.cpp \
src/platform/StdVideo.h \
src/res/Brush.h \
src/res/Cursor.h \
src/res/Dynamic.h \
src/res/Exact.h \
src/res/Fill.h \
src/res/Halt.h \
src/res/Ift.h \
src/res/Line.h \
src/res/Mouse.h \
src/res/NoIft.h \
src/res/Picker.h \
src/res/Play.h \
src/res/Rect.h \
src/res/resource.h \
src/res/Static.h \
src/script/C4Aul.cpp \
src/script/C4AulDebug.cpp \
src/script/C4AulDebug.h \
src/script/C4AulDefFunc.h \
src/script/C4AulExec.cpp \
src/script/C4AulExec.h \
src/script/C4AulFunc.h \
src/script/C4Aul.h \
src/script/C4AulLink.cpp \
src/script/C4AulParse.cpp \
src/script/C4PropList.cpp \
src/script/C4PropList.h \
src/script/C4Script.cpp \
src/script/C4ScriptHost.cpp \
src/script/C4ScriptHost.h \
src/script/C4StringTable.cpp \
src/script/C4StringTable.h \
src/script/C4ValueArray.cpp \
src/script/C4ValueArray.h \
src/script/C4Value.cpp \
src/script/C4Value.h \
src/script/C4ValueMap.cpp \
src/script/C4ValueMap.h \
thirdparty/timsort/sort.h \
thirdparty/tinyxml/tinystr.cpp \
thirdparty/tinyxml/tinystr.h \
thirdparty/tinyxml/tinyxml.cpp \
thirdparty/tinyxml/tinyxmlerror.cpp \
thirdparty/tinyxml/tinyxml.h \
thirdparty/tinyxml/tinyxmlparser.cpp
if WIN32
clonk_SOURCES += \
src/platform/C4CrashHandlerWin32.cpp \
src/res/engine.rc \
src/res/resource.h
endif
if SDL_MAIN_LOOP
clonk_SOURCES += \
src/platform/C4AppSDL.cpp \
src/platform/C4WindowSDL.cpp
else
if GTK
clonk_SOURCES += \
src/editor/C4ConsoleGTK.cpp \
src/platform/C4AppX.cpp \
src/platform/C4AppXImpl.h \
src/platform/C4WindowGTK.cpp \
src/platform/C4WindowX.cpp
else
if WIN32
clonk_SOURCES += \
src/editor/C4ConsoleWin32.cpp \
src/platform/C4WindowWin32.cpp \
src/platform/StdJoystick.cpp \
src/platform/StdJoystick.h
endif
if MACOSX
clonk_SOURCES += \
src/editor/C4ConsoleCocoa.mm \
src/platform/C4AppMac.mm \
src/platform/C4FileMonitorMac.mm \
src/platform/C4WindowMac.mm \
src/platform/ClonkAppDelegate.h \
src/platform/ClonkAppDelegate.mm \
src/platform/ConsoleWindowController.h \
src/platform/ConsoleWindowController.mm \
src/platform/ClonkWindowController.h \
src/platform/ClonkWindowController.mm \
src/platform/ClonkOpenGLView.h \
src/platform/ClonkOpenGLView.mm \
src/platform/CocoaKeycodeMap.h \
src/platform/ClonkMainMenuActions.h \
src/platform/ClonkMainMenuActions.mm
endif
endif
endif
if LIBUPNP
clonk_SOURCES += src/network/C4Network2UPnPLinux.cpp
else
if NATUPNP
clonk_SOURCES += src/network/C4Network2UPnPWin32.cpp
else
clonk_SOURCES += src/network/C4Network2UPnPDummy.cpp
endif
endif
clonk_LDADD = \
lib.a \
$(LDADD) \
$(LIBICONV) \
$(GTK_LIBS) \
$(OPENAL_LIBS) \
$(FREETYPE_LIBS) \
$(SDL_LIBS) \
$(PTHREAD_LIBS) \
$(Z_LIBS) \
$(CLONK_LIBS) \
$(LIBUPNP_LIBS)
# build the resources
.rc.o:
$(WINDRES) -I $(srcdir)/src/res -I $(builddir) -i $< -o $@
c4group_CPPFLAGS = \
-I$(builddir) \
-I$(srcdir)/src \
-I$(srcdir)/src/c4group \
-I$(srcdir)/src/network \
-I$(srcdir)/src/lib \
-I$(srcdir)/src/platform \
-I$(srcdir)/src/config \
-I$(srcdir)/src/res \
-I$(srcdir)/src/control \
-I$(srcdir)/src/gui \
-I$(srcdir)/src/editor \
-I$(srcdir)/src/game/landscape \
-I$(srcdir)/src/game/player \
-I$(srcdir)/src/game/script \
-I$(srcdir)/src/game \
-I$(srcdir)/src/game/object \
-I$(srcdir)/src/lib/texture \
-I$(srcdir)/src/script \
$(BOOST_CPPFLAGS)
c4group_SOURCES = \
src/lib/C4SimpleLog.cpp \
src/c4group/c4group_ng.cpp
if WIN32
c4group_SOURCES += src/c4group/Resource.rc
endif
c4group_LDADD = \
lib.a \
$(LDADD) \
$(LIBICONV) \
$(Z_LIBS) \
$(PTHREAD_LIBS)
## gunzip4c4group
gunzip4c4group_SOURCES = \
src/lib/C4SimpleLog.cpp \
src/c4group/gunzip4c4group.cpp
gunzip4c4group_LDADD = \
lib.a \
$(LDADD) \
$(Z_LIBS) \
$(PTHREAD_LIBS)
## puncher
puncher_SOURCES = \
src/lib/C4SimpleLog.cpp \
src/netpuncher/main.cpp
puncher_LDADD = \
lib.a \
$(LDADD) \
$(PTHREAD_LIBS)
if WIN32
puncher_LDADD += -lws2_32
endif
## tstc4netio
tstc4netio_SOURCES = \
src/lib/C4SimpleLog.cpp \
src/netio/TstC4NetIO.cpp
tstc4netio_LDADD = \
lib.a \
$(LDADD) \
$(Z_LIBS) \
$(PTHREAD_LIBS)
if WIN32
tstc4netio_LDADD += -lws2_32
endif
## c4script shell
c4script_SOURCES = \
include/c4script/c4script.h \
src/lib/C4SimpleLog.cpp \
src/lib/C4Real.cpp \
src/lib/C4Random.cpp \
src/script/shell.cpp \
src/script/C4Aul.cpp \
src/script/C4AulExec.cpp \
src/script/C4AulLink.cpp \
src/script/C4AulParse.cpp \
src/script/C4StringTable.cpp \
src/script/C4PropList.cpp \
src/script/C4ScriptHost.cpp \
src/script/C4ScriptStandalone.cpp \
src/script/C4ValueArray.cpp \
src/script/C4Value.cpp \
src/script/C4ValueMap.cpp \
src/game/object/C4Id.cpp \
src/script/C4Script.cpp \
src/c4group/C4GroupSet.cpp \
src/c4group/C4ComponentHost.cpp \
src/c4group/C4LangStringTable.cpp
c4script_LDADD = \
lib.a \
$(LDADD) \
$(Z_LIBS)
if WIN32
c4script_LDADD += -lwinmm
endif
## documentation
dist_doc_DATA = planet/AUTHORS planet/COPYING licenses/LGPL.txt Credits.txt
## game data
c4groups = \
Graphics.ocg \
Material.ocg \
Music.ocg \
Sound.ocg \
System.ocg \
Objects.ocd \
BackToTheRocks.ocf \
Tutorial.ocf
CLEANFILES += $(c4groups)
pkgdata_DATA = $(c4groups)
AM_CXXFLAGS += -DOC_SYSTEM_DATA_DIR=\"${pkgdatadir}\"
%.ocg: $(srcdir)/planet/%.ocg c4group$(EXEEXT)
./c4group$(EXEEXT) $< -t $@ || c4group $< -t $@
%.ocd: $(srcdir)/planet/%.ocd c4group$(EXEEXT)
./c4group$(EXEEXT) $< -t $@ || c4group $< -t $@
%.ocf: $(srcdir)/planet/%.ocf c4group$(EXEEXT)
./c4group$(EXEEXT) $< -t $@ || c4group $< -t $@
## windows setup.exe
if WIN32
tools/install/firewall.dll: $(srcdir)/tools/install/firewall.cpp
mkdir -p tools/install
$(CXX) -shared -o tools/install/firewall.dll $(srcdir)/tools/install/firewall.cpp -lole32 -loleaut32
setup_openclonk.exe: $(srcdir)/tools/install/oc.nsi c4group$(EXEEXT) clonk$(EXEEXT) $(c4groups)
makensis -NOCD -DSRCDIR=$(srcdir) '-DPROGRAMFILES=$$PROGRAMFILES' \
-DPRODUCT_NAME="$$(sed -n 's/SET(C4ENGINENAME\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)$$(sed -n 's/SET(C4VERSIONBUILDNAME\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)" \
-DPRODUCT_COMPANY="$$(sed -n 's/SET(C4PROJECT\s\+"\(.\+\)")/\1/ p' $(srcdir)/Version.txt)" \
$< "-XOutFile $@"
endif
## other stuff
EXTRA_DIST = \
planet \
Version.txt \
CMakeLists.txt \
Makefile.am \
config.h.cmake \
planet/System.ocg/LanguageUS.txt \
planet/System.ocg/LanguageDE.txt \
clonk.anjuta \
licenses \
src/netio/NetIO.dsp \
src/netpuncher/Puncher.dsp \
src/c4group/Resource.rc \
src/res/brush1.bmp \
src/res/Brush2.bmp \
src/res/Brush.bmp \
src/res/Brush.h \
src/res/Brush_Trans.png \
src/res/C4K.icns \
src/res/C4P.icns \
src/res/c4x.xpm \
src/res/Clonk.icns \
src/res/ClonkWindow.xib \
src/res/ConsoleGUIWindow.xib \
src/res/ConsoleWindow.xib \
src/res/Cursor2.bmp \
src/res/Cursor.bmp \
src/res/Cursor.h \
src/res/Cursor_Trans.png \
src/res/dynamic1.bmp \
src/res/Dynamic.h \
src/res/Dynamic_Trans.png \
src/res/Exact.h \
src/res/Exact_Trans.png \
src/res/fill1.bmp \
src/res/Fill.bmp \
src/res/Fill.h \
src/res/Fill_Trans.png \
src/res/FullscreenWindow.xib \
src/res/Game.pal \
src/res/Grab.bmp \
src/res/Halt2.bmp \
src/res/Halt.bmp \
src/res/Halt.h \
src/res/Halt_Trans.png \
src/res/ift1.bmp \
src/res/IFT.bmp \
src/res/Ift.h \
src/res/Ift_Trans.png \
src/res/Info.plist \
src/res/line1.bmp \
src/res/Line.bmp \
src/res/Line.h \
src/res/Line_Trans.png \
src/res/MainMenu.xib \
src/res/mouse1.bmp \
src/res/mouse.bmp \
src/res/Mouse.h \
src/res/Mouse_Trans.png \
src/res/NoIFT.bmp \
src/res/NoIft.h \
src/res/NoIft_Trans.png \
src/res/ocb.ico \
src/res/ocd.icns \
src/res/ocd.ico \
src/res/ocf.icns \
src/res/ocf.ico \
src/res/ocg.icns \
src/res/ocg.ico \
src/res/oc.ico \
src/res/oci.ico \
src/res/ocl.ico \
src/res/ocm.ico \
src/res/ocp.ico \
src/res/ocs.icns \
src/res/ocs.ico \
src/res/ocu.icns \
src/res/ocu.ico \
src/res/ocv.ico \
src/res/picker1.bmp \
src/res/Picker.h \
src/res/Picker_Trans.png \
src/res/Play2.bmp \
src/res/Play.bmp \
src/res/Play.h \
src/res/Play_Trans.png \
src/res/rect1.bmp \
src/res/Rectangle.bmp \
src/res/Rect.h \
src/res/Rect_Trans.png \
src/res/static1.bmp \
src/res/Static.h \
src/res/Static_Trans.png \
src/res/English.lproj/InfoPlist.strings \
src/res/English.lproj/Localizable.strings \
src/res/German.lproj/Localizable.strings \
src/res/SDLMain.nib/objects.nib

55
README 100644
View File

@ -0,0 +1,55 @@
Requirements
============
You should be able to build OpenClonk with any C++ compiler that supports
ISO C++11. That said, on Windows, we recommend using Microsoft Visual C++
2010 or higher; the Express edition will be sufficient. On Linux, you will
be fine with GNU g++ 4.6 or later. Apple users should use a clang-based
XCode version.
To generate project files for your chosen build system, you will also have to
install CMake from http://www.cmake.org/.
Additionally, OpenClonk depends on a number of third-party libraries:
- zlib (http://zlib.net/)
- libpng (http://www.libpng.org/pub/png/libpng.html)
- libjpeg-turbo (http://sourceforge.net/projects/libjpeg-turbo/files/)
- FreeType (http://www.freetype.org/)
- The OpenGL Extension Wrangler Library (http://glew.sourceforge.net/)
- FreeALUT (https://github.com/openclonk/freealut)
- libogg and libvorbis (https://www.xiph.org/downloads/)
- Boost (http://www.boost.org/users/download/)
OS X Specific
=============
OpenClonk supports OS X versions 10.6 "Snow Leopard" and later. You can build
universal binaries by setting CMAKE_OSX_ARCHITECTURES to "x86_64 i386", but
you will of course need universal versions of the dependencies in that case.
If you are using brew (https://github.com/mxcl/homebrew) or MacPorts
(http://www.macports.org/), the packages you'll have to install are:
libjpeg, libpng, freetype, glew, libogg, libvorbis, boost
Linux Specific
==============
For building OpenClonk on Linux, you need the following libraries in addition
to the ones listed above:
- libxpm
- libGL
- 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)
Most distributions should provide these dependencies via their packaging
system. For Debian based distributions, you will need these packages:
build-essential cmake libx11-dev libxxf86vm-dev libxrandr-dev libxpm-dev
libglew-dev libgl1-mesa-dev libpng12-dev libsdl1.2-dev
libsdl-mixer1.2-dev libgtk2.0-dev libjpeg8-dev zlib1g-dev libboost-dev
(This list was compiled on Debian 7.0 "Wheezy". More recent distributions may
provide packages with a higher version number.)
Windows Specific
================
In addition to the libraries above, you will need one more if you want to
target Windows:
- OpenAL Soft (http://kcat.strangesoft.net/openal.html)
To create an installer, you will also need the Nullsoft Install System
(http://nsis.sourceforge.net/). makensis needs to be in the PATH, and
the DLLs used by openclonk must be in the build directory. To create the
installer, build the "setup" target.

View File

@ -1,74 +0,0 @@
Requirements
============
To build on DEB-based Linux distributions (Debian, Ubuntu etc.) you need the
following packages:
make gcc g++
cmake OR automake autoconf
libc6-dev libx11-dev libxxf86vm-dev libxrandr-dev libxpm-dev libglew1.5-dev
libgl1-mesa-dev libpng12-dev libsdl1.2-dev libsdl-mixer1.2-dev libgtk2.0-dev
libjpeg62-dev zlib1g-dev libboost-dev
(Most of those packages can be substituted with a newer version if required,
for example libglew1.6-dev instead of libglew1.5-dev.)
To build on RPM-based Linux distributions (Red Hat, Fedora, Mandriva,
SuSE etc.) you need the following packages:
make gcc gcc-c++
cmake OR automake autoconf
libX11-devel libXxf86vm-devel libXrandr-devel libXpm-devel glew-devel
mesa-libGL-devel libpng-devel SDL-devel SDL_mixer1.2-dev gtk2-devel
libjpeg-devel zlib-devel boost-devel
Build using cmake
=================
To build OpenClonk, execute the following command inside of the source tree:
cmake . && make
By default, the binary will be built without debugging support. If you want
to generate a debug build, pass the parameter -DCMAKE_BUILD_TYPE=Debug to
your cmake invocation.
Please note that you do not need to build a Debug binary if you only want to
debug C4Script code.
You can see other build variables with:
cmake . -N -L
Build using autotools
=====================
If you build from version control, you need to run this:
autoreconf -i && ./configure && make
To build from tarball, run this:
./configure && make
If you want a debug build, pass --enable-debug to configure. Other options are
listed by ./configure --help.
On subsequent build runs, you only have to execute make.
Running
=======
You can run the game from the build directory:
./clonk
See docs/sdk/cmdline.xml for the supported command line options.
Or install it with this:
make install

View File

@ -1,45 +0,0 @@
Requirements
============
OSX 10.6 or higher (might also work with 10.5)
an Intel mac
brew (https://github.com/mxcl/homebrew) or macports (http://www.macports.org/)
Xcode
Apple X11
CMake (http://www.cmake.org/)
Build
=====
-Install dependencies using brew or port (libjpeg, libpng, freetype, glew, libogg, libvorbis, libvorbisfile)
-Launch the CMake GUI application
-Click Browse Source… button, navigate to your openclonk repository folder
-Also Specify location where you want to build
-Click Configure and use default native compilers
-Wait
-<Potentially include additional steps to make CMake find the right libraries>
-If you want 64-bit builds set the CMAKE_OSX_ARCHITECTURES setting to "x86_64"
-For universal builds set it to "x86_64 i386", but then you'll also need universal versions of the dependencies
-Click Configure button again for good measure
-Click Generate
-Launch xcode and load the project. Select the desired configuration and build.
It should be pretty straight forward, hopefully.
Additional CMake hints
=====================
FREETYPE_LIBRARY should be set to /usr/X11/lib/libfreetype.6.dylib
ZLIB_LIBRARY to /usr/lib/libz.dylib
ZLIB_INCLUDE_DIR to /usr/include
Situation with Xcode 4.3+
========================
Xcode is now a self-contained application bundle which confuses CMake.
The CMake git repo contains necessary fixes but those haven't been incorporated into a new CMake release yet so to use those you have to build the cmake command line tool yourself by
* cloning git://cmake.org/cmake.git
* running git checkout next
* running ./configure, make and sudo make install
The project generation command I (Mortimer) used was `cmake -G Xcode -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++`, obviously specifying clang as the compiler. There is a related CMake option called USE_APPLE_CLANG which should be ON by default.
After that I had a proper Xcode 4.3 project.
To use the CMake GUI for setting some library paths I put the self-built cmake command from /usr/local/bin into CMake 2.8-7.app/Contents/bin/ but one could have probably done that by editing CMakeCache.txt or setting via however the cli syntax for setting variables is.

View File

@ -1,61 +0,0 @@
Requirements
============
You can build on Windows using either:
* vc10 (Microsoft Visual C++ 2010)
- you need CMake (http://www.cmake.org/cmake/resources/software.html) to
create the "solution"
- you might have to set the correct DXSDK include and library directories
* MinGW and MSYS
- plus DXSDK 9 (if you want DirectX support)
* Some other compilers and IDEs which are supported by CMake might also work
OpenClonk requires some additional libraries. Prebuilt versions of them can be
found on http://openclonk.org.
Building the installer
======================
The installer is created with NSIS. makensis needs to be in the PATH, and
the dlls used by openclonk in the build directory. To create the installer,
build the "setup" target if using CMake, or if using autotools, run:
make setup_openclonk.exe
Get NSIS from http://nsis.sourceforge.net/.
Notes for MinGW
===============
You need gcc, g++, mingw-runtime, w32api, msys, msyscore, autoconf, automake,
and any packages needed by these.
Get the library package from openclonk.org and unpack it into the mingw
directory.
If you want DirectX support, get a DirectX 9 SDK from Microsoft. Copy the
contents of its include dir to the include dir of your MinGW installation,
and pass --with-directx to configure below.
Start msys (your MinGW directory, e.g. C:\MinGW -> msys.bat),
cd to this directory, and execute:
./autogen.sh && ./configure && make
To compile a debugbuild, pass --enable-debug to configure. Other options are
listed by ./configure --help.
On subsequent build runs, you only have to execute make.
If you want to separate the source directory and the output files, you can call
configure from another directory. You can call configure by it's relative path,
but using the full path helps gdb find the source files. Example:
mkdir build
cd build
/path/to/clonksource/configure --with-directx CXXFLAGS='-Os'
make

View File

@ -12,33 +12,20 @@ SET(C4ENGINENICK "openclonk")
SET(C4ENGINEID "${C4PROJECT_TLD}.${C4PROJECT_DOMAIN}.${C4ENGINENICK}")
SET(C4XVER1 5)
SET(C4XVER2 2)
SET(C4XVER2 3)
SET(C4XVER3 90)
SET(C4XVER4 21)
# C4VERSIONBUILDNAME should be witty and somewhat frequently changing
# for alpha and beta releases, and meaningful and stable for stable releases.
# Both variables need to start with a space if they aren't empty.
SET(C4VERSIONBUILDNAME " Beyond the Rocks")
SET(C4VERSIONEXTRA " Alpha")
SET(C4VERSIONEXTRA " Delta")
############################################################################
# Get revision from Mercurial
# Get revision from Git
############################################################################
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg_archival.txt")
# Archives generated by hg archive
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/.hg_archival.txt" C4REVISION
LIMIT_COUNT 1
REGEX "node: [0-9a-f]+"
)
string(SUBSTRING "${C4REVISION}" 6 12 C4REVISION)
else()
# Working copies
execute_process(WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND "hg" "id" "--id"
OUTPUT_VARIABLE C4REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
include(GitGetChangesetID)
git_get_changeset_id(C4REVISION)
############################################################################
# Get year

View File

@ -1,6 +0,0 @@
#!/bin/sh
aclocal -I autotools --install
autoheader
autoconf
automake -a

View File

@ -1,258 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_boost_base.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# DESCRIPTION
#
# Test for the Boost C++ libraries of a particular version (or newer)
#
# If no path to the installed boost library is given the macro searchs
# under /usr, /usr/local, /opt and /opt/local and evaluates the
# $BOOST_ROOT environment variable. Further documentation is available at
# <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
#
# And sets:
#
# HAVE_BOOST
#
# LICENSE
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2009 Peter Adolphs
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 20
AC_DEFUN([AX_BOOST_BASE],
[
AC_ARG_WITH([boost],
[AS_HELP_STRING([--with-boost@<:@=ARG@:>@],
[use Boost library from a standard location (ARG=yes),
from the specified location (ARG=<path>),
or disable it (ARG=no)
@<:@ARG=yes@:>@ ])],
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ac_boost_path=""
else
want_boost="yes"
ac_boost_path="$withval"
fi
],
[want_boost="yes"])
AC_ARG_WITH([boost-libdir],
AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
[Force given directory for boost libraries. Note that this will override library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
[
if test -d "$withval"
then
ac_boost_lib_path="$withval"
else
AC_MSG_ERROR(--with-boost-libdir expected directory name)
fi
],
[ac_boost_lib_path=""]
)
if test "x$want_boost" = "xyes"; then
boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
if test "x$boost_lib_version_req_sub_minor" = "x" ; then
boost_lib_version_req_sub_minor="0"
fi
WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
succeeded=no
dnl On 64-bit systems check for system libraries in both lib64 and lib.
dnl The former is specified by FHS, but e.g. Debian does not adhere to
dnl this (as it rises problems for generic multi-arch support).
dnl The last entry in the list is chosen by default when no libraries
dnl are found, e.g. when only header-only libraries are installed!
libsubdirs="lib"
ax_arch=`uname -m`
if test $ax_arch = x86_64 -o $ax_arch = ppc64 -o $ax_arch = s390x -o $ax_arch = sparc64; then
libsubdirs="lib64 lib lib64"
fi
dnl first we check the system location for boost libraries
dnl this location ist chosen if boost libraries are installed with the --layout=system option
dnl or if you install boost with RPM
if test "$ac_boost_path" != ""; then
BOOST_CPPFLAGS="-I$ac_boost_path/include"
for ac_boost_path_tmp in $libsubdirs; do
if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then
BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp"
break
fi
done
elif test "$cross_compiling" != yes; then
for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
for libsubdir in $libsubdirs ; do
if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
done
BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir"
BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
break;
fi
done
fi
dnl overwrite ld flags if we have required special directory with
dnl --with-boost-libdir parameter
if test "$ac_boost_lib_path" != ""; then
BOOST_LDFLAGS="-L$ac_boost_lib_path"
fi
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_REQUIRE([AC_PROG_CXX])
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <boost/version.hpp>
]], [[
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
]])],[
AC_MSG_RESULT(yes)
succeeded=yes
found_system=yes
],[
])
AC_LANG_POP([C++])
dnl if we found no boost with system layout we search for boost libraries
dnl built and installed without the --layout=system option or for a staged(not installed) version
if test "x$succeeded" != "xyes"; then
_version=0
if test "$ac_boost_path" != ""; then
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
V_CHECK=`expr $_version_tmp \> $_version`
if test "$V_CHECK" = "1" ; then
_version=$_version_tmp
fi
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
done
fi
else
if test "$cross_compiling" != yes; then
for ac_boost_path in /usr /usr/local /opt /opt/local ; do
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
V_CHECK=`expr $_version_tmp \> $_version`
if test "$V_CHECK" = "1" ; then
_version=$_version_tmp
best_path=$ac_boost_path
fi
done
fi
done
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
if test "$ac_boost_lib_path" = ""; then
for libsubdir in $libsubdirs ; do
if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
done
BOOST_LDFLAGS="-L$best_path/$libsubdir"
fi
fi
if test "x$BOOST_ROOT" != "x"; then
for libsubdir in $libsubdirs ; do
if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
done
if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then
version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
V_CHECK=`expr $stage_version_shorten \>\= $_version`
if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
BOOST_CPPFLAGS="-I$BOOST_ROOT"
BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir"
fi
fi
fi
fi
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <boost/version.hpp>
]], [[
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
]])],[
AC_MSG_RESULT(yes)
succeeded=yes
found_system=yes
],[
])
AC_LANG_POP([C++])
fi
if test "$succeeded" != "yes" ; then
if test "$_version" = "0" ; then
AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
else
AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
fi
# execute ACTION-IF-NOT-FOUND (if present):
ifelse([$3], , :, [$3])
else
AC_SUBST(BOOST_CPPFLAGS)
AC_SUBST(BOOST_LDFLAGS)
AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
# execute ACTION-IF-FOUND (if present):
ifelse([$2], , :, [$2])
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])

View File

@ -1,72 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS])
#
# DESCRIPTION
#
# Check whether the given FLAG works with the current language's compiler
# or gives an error. (Warnings, however, are ignored)
#
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
# success/failure.
#
# If EXTRA-FLAGS is defined, it is added to the current language's default
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
# force the compiler to issue an error when a bad flag is given.
#
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
#
# LICENSE
#
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 2
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
[AC_PREREQ(2.59)dnl for _AC_LANG_PREFIX
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
[AS_VAR_SET(CACHEVAR,[yes])],
[AS_VAR_SET(CACHEVAR,[no])])
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
[m4_default([$2], :)],
[m4_default([$3], :)])
AS_VAR_POPDEF([CACHEVAR])dnl
])dnl AX_CHECK_COMPILE_FLAGS

View File

@ -1,75 +0,0 @@
dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl From Bruno Haible.
dnl Modified for Clonk to not do all that weird stuff
AC_DEFUN([_AX_ICONV_LINK],
[
dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
dnl those with the standalone portable GNU libiconv installed).
dnl Search for libiconv and define LIBICONV and INCICONV
dnl accordingly.
AC_CACHE_CHECK(for iconv, ax_cv_func_iconv, [
ax_cv_func_iconv="no, consider installing GNU libiconv"
ax_cv_lib_iconv=no
LIBICONV=""
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
ax_cv_func_iconv=yes)
if test "$ax_cv_func_iconv" != yes; then
ax_save_LIBS="$LIBS"
LIBS="$LIBS -liconv"
AC_TRY_LINK([#include <stdlib.h>
#include <iconv.h>],
[iconv_t cd = iconv_open("","");
iconv(cd,NULL,NULL,NULL,NULL);
iconv_close(cd);],
ax_cv_lib_iconv=yes
ax_cv_func_iconv=yes
LIBICONV=-liconv)
LIBS="$ax_save_LIBS"
fi
])
if test "$ax_cv_func_iconv" = yes; then
AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
fi
if test "$ax_cv_lib_iconv" = yes; then
AC_MSG_CHECKING([how to link with libiconv])
AC_MSG_RESULT([-liconv])
fi
AC_SUBST(LIBICONV)
])
AC_DEFUN([AX_ICONV],
[
_AX_ICONV_LINK
if test "$ax_cv_func_iconv" = yes; then
AC_MSG_CHECKING([for iconv declaration])
AC_CACHE_VAL(ax_cv_proto_iconv, [
AC_TRY_COMPILE([
#include <stdlib.h>
#include <iconv.h>
extern
#ifdef __cplusplus
"C"
#endif
#if defined(__STDC__) || defined(__cplusplus)
size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
#else
size_t iconv();
#endif
], [], ax_cv_proto_iconv_arg1="", ax_cv_proto_iconv_arg1="const")])
AC_MSG_RESULT([extern size_t iconv (iconv_t cd, $ax_cv_proto_iconv_arg1 char * * inbuf, size_t * inbytesleft, char * * outbuf, size_t * outbytesleft);])
AC_DEFINE_UNQUOTED(ICONV_CONST, $ax_cv_proto_iconv_arg1,
[Define as const if the declaration of iconv() needs const.])
fi
])

View File

@ -1,309 +0,0 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_pthread.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
#
# DESCRIPTION
#
# This macro figures out how to build C programs using POSIX threads. It
# sets the PTHREAD_LIBS output variable to the threads library and linker
# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
# flags that are needed. (The user can also force certain compiler
# flags/libs to be tested by setting these environment variables.)
#
# Also sets PTHREAD_CC to any special C compiler that is needed for
# multi-threaded programs (defaults to the value of CC otherwise). (This
# is necessary on AIX to use the special cc_r compiler alias.)
#
# NOTE: You are assumed to not only compile your program with these flags,
# but also link it with them as well. e.g. you should link with
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
#
# If you are only building threads programs, you may wish to use these
# variables in your default LIBS, CFLAGS, and CC:
#
# LIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC"
#
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
#
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
# PTHREAD_CFLAGS.
#
# ACTION-IF-FOUND is a list of shell commands to run if a threads library
# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
# is not found. If ACTION-IF-FOUND is not specified, the default action
# will define HAVE_PTHREAD.
#
# Please let the authors know if this macro fails on any platform, or if
# you have any other suggestions or comments. This macro was based on work
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
# Alejandro Forero Cuervo to the autoconf macro repository. We are also
# grateful for the helpful feedback of numerous users.
#
# Updated for Autoconf 2.68 by Daniel Richard G.
#
# LICENSE
#
# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
# Copyright (c) 2011 Daniel Richard G. <skunk@iSKUNK.ORG>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 17
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_HOST])
AC_LANG_PUSH([C])
ax_pthread_ok=no
# We used to check for pthread.h first, but this fails if pthread.h
# requires special compiler flags (e.g. on True64 or Sequent).
# It gets checked for in the link test anyway.
# First of all, check if the user has set any of the PTHREAD_LIBS,
# etcetera environment variables, and if threads linking works using
# them:
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
AC_MSG_RESULT($ax_pthread_ok)
if test x"$ax_pthread_ok" = xno; then
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
fi
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
fi
# We must check for the threads library under a number of different
# names; the ordering is very important because some systems
# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
# libraries is broken (non-POSIX).
# Create a list of thread flags to try. Items starting with a "-" are
# C compiler flags, and other items are library names, except for "none"
# which indicates that we try without any flags at all, and "pthread-config"
# which is a program returning the flags for the Pth emulation library.
ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
# The ordering *is* (sometimes) important. Some notes on the
# individual items follow:
# pthreads: AIX (must check this before -lpthread)
# none: in case threads are in libc; should be tried before -Kthread and
# other compiler flags to prevent continual compiler warnings
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
# -pthreads: Solaris/gcc
# -mthreads: Mingw32/gcc, Lynx/gcc
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
# doesn't hurt to check since this sometimes defines pthreads too;
# also defines -D_REENTRANT)
# ... -mt is also the pthreads flag for HP/aCC
# pthread: Linux, etcetera
# --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library)
case "${host_cpu}-${host_os}" in
*solaris*)
# On Solaris (at least, for some versions), libc contains stubbed
# (non-functional) versions of the pthreads routines, so link-based
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
# a function called by this macro, so we could check for that, but
# who knows whether they'll stub that too in a future libc.) So,
# we'll just look for -pthreads and -lpthread first:
ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
;;
*-darwin*)
ax_pthread_flags="-pthread $ax_pthread_flags"
;;
esac
if test x"$ax_pthread_ok" = xno; then
for flag in $ax_pthread_flags; do
case $flag in
none)
AC_MSG_CHECKING([whether pthreads work without any flags])
;;
-*)
AC_MSG_CHECKING([whether pthreads work with $flag])
PTHREAD_CFLAGS="$flag"
;;
pthread-config)
AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
if test x"$ax_pthread_config" = xno; then continue; fi
PTHREAD_CFLAGS="`pthread-config --cflags`"
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
;;
*)
AC_MSG_CHECKING([for the pthreads library -l$flag])
PTHREAD_LIBS="-l$flag"
;;
esac
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Check for various functions. We must include pthread.h,
# since some functions may be macros. (On the Sequent, we
# need a special flag -Kthread to make this header compile.)
# We check for pthread_join because it is in -lpthread on IRIX
# while pthread_create is in libc. We check for pthread_attr_init
# due to DEC craziness with -lpthreads. We check for
# pthread_cleanup_push because it is one of the few pthread
# functions on Solaris that doesn't have a non-functional libc stub.
# We try pthread_create on general principles.
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
static void routine(void *a) { a = 0; }
static void *start_routine(void *a) { return a; }],
[pthread_t th; pthread_attr_t attr;
pthread_create(&th, 0, start_routine, 0);
pthread_join(th, 0);
pthread_attr_init(&attr);
pthread_cleanup_push(routine, 0);
pthread_cleanup_pop(0) /* ; */])],
[ax_pthread_ok=yes],
[])
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
AC_MSG_RESULT($ax_pthread_ok)
if test "x$ax_pthread_ok" = xyes; then
break;
fi
PTHREAD_LIBS=""
PTHREAD_CFLAGS=""
done
fi
# Various other checks:
if test "x$ax_pthread_ok" = xyes; then
save_LIBS="$LIBS"
LIBS="$PTHREAD_LIBS $LIBS"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
AC_MSG_CHECKING([for joinable pthread attribute])
attr_name=unknown
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[int attr = $attr; return attr /* ; */])],
[attr_name=$attr; break],
[])
done
AC_MSG_RESULT($attr_name)
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
[Define to necessary symbol if this constant
uses a non-standard name on your system.])
fi
AC_MSG_CHECKING([if more special flags are required for pthreads])
flag=no
case "${host_cpu}-${host_os}" in
*-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
*-osf* | *-hpux*) flag="-D_REENTRANT";;
*solaris*)
if test "$GCC" = "yes"; then
flag="-D_REENTRANT"
else
flag="-mt -D_REENTRANT"
fi
;;
esac
AC_MSG_RESULT(${flag})
if test "x$flag" != xno; then
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
fi
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
ax_cv_PTHREAD_PRIO_INHERIT, [
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[#include <pthread.h>]], [[int i = PTHREAD_PRIO_INHERIT;]])],
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
[ax_cv_PTHREAD_PRIO_INHERIT=no])
])
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], 1, [Have PTHREAD_PRIO_INHERIT.]))
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
# More AIX lossage: must compile with xlc_r or cc_r
if test x"$GCC" != xyes; then
AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
else
PTHREAD_CC=$CC
fi
else
PTHREAD_CC="$CC"
fi
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
AC_SUBST(PTHREAD_CC)
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test x"$ax_pthread_ok" = xyes; then
ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
:
else
ax_pthread_ok=no
$2
fi
AC_LANG_POP
])dnl AX_PTHREAD

View File

@ -1,157 +0,0 @@
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# serial 1 (pkg-config-0.24)
#
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])# PKG_PROG_PKG_CONFIG
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
#
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
# only at the first occurence in configure.ac, so if the first place
# it's called might be skipped (such as if it is within an "if", you
# have to call PKG_CHECK_EXISTS manually
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
# ---------------------------------------------
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])# _PKG_CONFIG
# _PKG_SHORT_ERRORS_SUPPORTED
# -----------------------------
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])# _PKG_SHORT_ERRORS_SUPPORTED
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
# [ACTION-IF-NOT-FOUND])
#
#
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
#
#
# --------------------------------------------------------------
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $1])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])# PKG_CHECK_MODULES

View File

@ -1,23 +0,0 @@
dnl Copyright (C) 2009 Günther Brammer
AC_DEFUN([AX_PROG_CXX_REFTOTEMP],
[
AC_LANG_ASSERT([C++])
AC_CACHE_CHECK([wether the C++ compiler is friendly], [ax_cv_reftotemp], [
AC_COMPILE_IFELSE([
struct Foo {
operator Foo & () { return *this; }
};
#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)))
void frobnicate(Foo &&) { }
#else
void frobnicate(Foo &) { }
#endif
int main () {
frobnicate (Foo());
}
], [ax_cv_reftotemp=yes], [ax_cv_reftotemp=no])])
if test $ax_cv_reftotemp = no; then
AC_MSG_ERROR([The C++ compiler won't be able to compile Clonk. Try CXX='g++ -std=gnu++0x' or CXX='g++-4.1'.])
fi[]dnl
])# AX_PROG_CXX_REFTOTEMP

View File

@ -1,185 +0,0 @@
# Configure paths for SDL
# Sam Lantinga 9/21/99
# stolen from Manish Singh
# stolen back from Frank Belew
# stolen from Manish Singh
# Shamelessly stolen from Owen Taylor
# serial 1
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
dnl
AC_DEFUN([AM_PATH_SDL],
[dnl
dnl Get the cflags and libraries from the sdl-config script
dnl
AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
sdl_prefix="$withval", sdl_prefix="")
AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
sdl_exec_prefix="$withval", sdl_exec_prefix="")
AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
, enable_sdltest=yes)
if test x$sdl_exec_prefix != x ; then
sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
fi
fi
if test x$sdl_prefix != x ; then
sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_prefix/bin/sdl-config
fi
fi
as_save_PATH="$PATH"
if test "x$prefix" != xNONE; then
PATH="$prefix/bin:$prefix/usr/bin:$PATH"
fi
AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
PATH="$as_save_PATH"
min_sdl_version=ifelse([$1], ,0.11.0,$1)
AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
no_sdl=""
if test "$SDL_CONFIG" = "no" ; then
no_sdl=yes
else
SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_sdltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $SDL_CFLAGS"
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
dnl
dnl Now check if the installed SDL is sufficiently new. (Also sanity
dnl checks the results of sdl-config to some extent
dnl
rm -f conf.sdltest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "SDL.h"
char*
my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else
new_str = NULL;
return new_str;
}
int main (int argc, char *argv[])
{
int major, minor, micro;
char *tmp_version;
/* This hangs on some systems (?)
system ("touch conf.sdltest");
*/
{ FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_sdl_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_sdl_version");
exit(1);
}
if (($sdl_major_version > major) ||
(($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
(($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
printf("*** to point to the correct copy of sdl-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_sdl" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$SDL_CONFIG" = "no" ; then
echo "*** The sdl-config script installed by SDL could not be found"
echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the SDL_CONFIG environment variable to the"
echo "*** full path to sdl-config."
else
if test -f conf.sdltest ; then
:
else
echo "*** Could not run SDL test program, checking why..."
CFLAGS="$CFLAGS $SDL_CFLAGS"
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include "SDL.h"
int main(int argc, char *argv[])
{ return 0; }
#undef main
#define main K_and_R_C_main
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding SDL or finding the wrong"
echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means SDL was incorrectly installed"
echo "*** or that you have moved SDL since it was installed. In the latter case, you"
echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
SDL_CFLAGS=""
SDL_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
rm -f conf.sdltest
])

View File

@ -1,93 +0,0 @@
dnl @synopsis VL_LIB_READLINE
dnl
dnl Searches for a readline compatible library. If found, defines
dnl `HAVE_LIBREADLINE'. If the found library has the `add_history'
dnl function, sets also `HAVE_READLINE_HISTORY'. Also checks for the
dnl locations of the necessary include files and sets `HAVE_READLINE_H'
dnl or `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or
dnl 'HAVE_HISTORY_H' if the corresponding include files exists.
dnl
dnl The libraries that may be readline compatible are `libedit',
dnl `libeditline' and `libreadline'. Sometimes we need to link a
dnl termcap library for readline to work, this macro tests these cases
dnl too by trying to link with `libtermcap', `libcurses' or
dnl `libncurses' before giving up.
dnl
dnl Here is an example of how to use the information provided by this
dnl macro to perform the necessary includes or declarations in a C
dnl file:
dnl
dnl #ifdef HAVE_LIBREADLINE
dnl # if defined(HAVE_READLINE_READLINE_H)
dnl # include <readline/readline.h>
dnl # elif defined(HAVE_READLINE_H)
dnl # include <readline.h>
dnl # else /* !defined(HAVE_READLINE_H) */
dnl extern char *readline ();
dnl # endif /* !defined(HAVE_READLINE_H) */
dnl char *cmdline = NULL;
dnl #else /* !defined(HAVE_READLINE_READLINE_H) */
dnl /* no readline */
dnl #endif /* HAVE_LIBREADLINE */
dnl
dnl #ifdef HAVE_READLINE_HISTORY
dnl # if defined(HAVE_READLINE_HISTORY_H)
dnl # include <readline/history.h>
dnl # elif defined(HAVE_HISTORY_H)
dnl # include <history.h>
dnl # else /* !defined(HAVE_HISTORY_H) */
dnl extern void add_history ();
dnl extern int write_history ();
dnl extern int read_history ();
dnl # endif /* defined(HAVE_READLINE_HISTORY_H) */
dnl /* no history */
dnl #endif /* HAVE_READLINE_HISTORY */
dnl
dnl @category InstalledPackages
dnl @author Ville Laurikari <vl@iki.fi>
dnl @version 2002-04-04
dnl @license AllPermissive
AC_DEFUN([VL_LIB_READLINE], [
AC_CACHE_CHECK([for a readline compatible library],
vl_cv_lib_readline, [
ORIG_LIBS="$LIBS"
for readline_lib in readline edit editline; do
for termcap_lib in "" termcap curses ncurses; do
if test -z "$termcap_lib"; then
TRY_LIB="-l$readline_lib"
else
TRY_LIB="-l$readline_lib -l$termcap_lib"
fi
LIBS="$ORIG_LIBS $TRY_LIB"
AC_TRY_LINK_FUNC(readline, vl_cv_lib_readline="$TRY_LIB")
if test -n "$vl_cv_lib_readline"; then
break
fi
done
if test -n "$vl_cv_lib_readline"; then
break
fi
done
if test -z "$vl_cv_lib_readline"; then
vl_cv_lib_readline="no"
LIBS="$ORIG_LIBS"
fi
])
if test "$vl_cv_lib_readline" != "no"; then
AC_DEFINE(HAVE_LIBREADLINE, 1,
[Define if you have a readline compatible library])
AC_CHECK_HEADERS(readline.h readline/readline.h)
AC_CACHE_CHECK([whether readline supports history],
vl_cv_lib_readline_history, [
vl_cv_lib_readline_history="no"
AC_TRY_LINK_FUNC(add_history, vl_cv_lib_readline_history="yes")
])
if test "$vl_cv_lib_readline_history" = "yes"; then
AC_DEFINE(HAVE_READLINE_HISTORY, 1,
[Define if your readline library has \`add_history'])
AC_CHECK_HEADERS(history.h readline/history.h)
fi
fi
])dnl

View File

@ -1,37 +0,0 @@
<?xml version="1.0"?>
<anjuta>
<plugin name="GBF Project Manager"
url="http://anjuta.org/plugins/"
mandatory="yes">
<require group="Anjuta Plugin"
attribute="Interfaces"
value="IAnjutaProjectManager"/>
<require group="Project"
attribute="Supported-Project-Types"
value="automake"/>
</plugin>
<plugin name="Symbol Browser"
url="http://anjuta.org/plugins/"
mandatory="yes">
<require group="Anjuta Plugin"
attribute="Interfaces"
value="IAnjutaSymbolManager"/>
</plugin>
<plugin name="Make Build System"
url="http://anjuta.org/plugins/"
mandatory="yes">
<require group="Anjuta Plugin"
attribute="Interfaces"
value="IAnjutaBuildable"/>
<require group="Build"
attribute="Supported-Build-Types"
value="make"/>
</plugin>
<plugin name="Debug Manager"
url="http://anjuta.org/plugins/"
mandatory="no">
<require group="Anjuta Plugin"
attribute="Interfaces"
value="IAnjutaDebugManager"/>
</plugin>
</anjuta>

View File

@ -1,3 +1,16 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2011-2013, 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.
# - Find DbgHelp
# Find the DbgHelp library
# This module defines
@ -5,20 +18,6 @@
# DBGHELP_LIBRARIES, the libraries needed to use DbgHelp.
# DBGHELP_FOUND, If false, do not try to use DbgHelp.
#=============================================================================
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2011 Nicolas Hake
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# See isc_license.txt for full license and disclaimer.
#
# "Clonk" is a registered trademark of Matthes Bender.
# See clonk_trademark_license.txt for full license.
#=============================================================================
find_path(DBGHELP_INCLUDE_DIR NAMES dbghelp.h)
set(DBGHELP_NAMES ${DBGHELP_NAMES} dbghelp)
find_library(DBGHELP_LIBRARY NAMES ${DBGHELP_NAMES})

View File

@ -1,3 +1,16 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2011-2013, 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.
# - Find FMod
# Find the FMod library
# This module defines
@ -5,20 +18,6 @@
# FMOD_LIBRARIES, the libraries needed to use FMod.
# FMOD_FOUND, If false, do not try to use FMod.
#=============================================================================
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2011 Nicolas Hake
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# See isc_license.txt for full license and disclaimer.
#
# "Clonk" is a registered trademark of Matthes Bender.
# See clonk_trademark_license.txt for full license.
#=============================================================================
find_path(FMOD_INCLUDE_DIR fmod.h)
if(CMAKE_CL_64)

View File

@ -0,0 +1,143 @@
# - Locate FreeType library
# This module defines
# FREETYPE_LIBRARIES, the library to link against
# FREETYPE_FOUND, if false, do not try to link to FREETYPE
# FREETYPE_INCLUDE_DIRS, where to find headers.
# FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
# This is the concatenation of the paths:
# FREETYPE_INCLUDE_DIR_ft2build
# FREETYPE_INCLUDE_DIR_freetype2
#
# $FREETYPE_DIR is an environment variable that would
# correspond to the ./configure --prefix=$FREETYPE_DIR
# used in building FREETYPE.
#=============================================================================
# CMake - Cross Platform Makefile Generator
# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
# Created by Eric Wing.
# Modifications by Alexander Neundorf.
# This file has been renamed to "FindFreetype.cmake" instead of the correct
# "FindFreeType.cmake" in order to be compatible with the one from KDE4, Alex.
# Modified by Nicolas Hake for the OpenClonk Project to make FindFreetype also
# look for the versioned libraries the freetype MSVC project generates.
# Ugh, FreeType seems to use some #include trickery which
# makes this harder than it should be. It looks like they
# put ft2build.h in a common/easier-to-find location which
# then contains a #include to a more specific header in a
# more specific location (#include <freetype/config/ftheader.h>).
# Then from there, they need to set a bunch of #define's
# so you can do something like:
# #include FT_FREETYPE_H
# Unfortunately, using CMake's mechanisms like include_directories()
# wants explicit full paths and this trickery doesn't work too well.
# I'm going to attempt to cut out the middleman and hope
# everything still works.
find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
HINTS
ENV FREETYPE_DIR
PATHS
/usr/X11R6
/usr/local/X11R6
/usr/local/X11
/usr/freeware
PATH_SUFFIXES include/freetype2 include
)
find_path(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
HINTS
ENV FREETYPE_DIR
PATHS
/usr/X11R6
/usr/local/X11R6
/usr/local/X11
/usr/freeware
PATH_SUFFIXES include/freetype2 include
)
if(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
file(STRINGS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h" freetype_version_str
REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
unset(FREETYPE_VERSION_STRING)
foreach(VPART MAJOR MINOR PATCH)
foreach(VLINE ${freetype_version_str})
if(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}")
string(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1"
FREETYPE_VERSION_PART "${VLINE}")
if(FREETYPE_VERSION_STRING)
set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
else()
set(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
endif()
unset(FREETYPE_VERSION_PART)
endif()
endforeach()
endforeach()
if(FREETYPE_VERSION_STRING)
string(REPLACE "." "" FREETYPE_VERSIONED_LIBRARY "${FREETYPE_VERSION_STRING}")
set(FREETYPE_VERSIONED_LIBRARY "freetype${FREETYPE_VERSIONED_LIBRARY}")
endif()
endif()
find_library(FREETYPE_LIBRARY
NAMES freetype libfreetype freetype219 ${FREETYPE_VERSIONED_LIBRARY}
HINTS
ENV FREETYPE_DIR
PATH_SUFFIXES lib
PATHS
/usr/X11R6
/usr/local/X11R6
/usr/local/X11
/usr/freeware
)
unset(FREETYPE_VERSIONED_LIBRARY)
# set the user variables
if(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
set(FREETYPE_INCLUDE_DIRS "${FREETYPE_INCLUDE_DIR_ft2build};${FREETYPE_INCLUDE_DIR_freetype2}")
endif()
set(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype
REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS
VERSION_VAR FREETYPE_VERSION_STRING)
mark_as_advanced(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build)

105
cmake/FindPNG.cmake 100644
View File

@ -0,0 +1,105 @@
# - Find the native PNG includes and library
#
# This module searches libpng, the library for working with PNG images.
#
# It defines the following variables
# PNG_INCLUDE_DIRS, where to find png.h, etc.
# PNG_LIBRARIES, the libraries to link against to use PNG.
# PNG_DEFINITIONS - You should add_definitons(${PNG_DEFINITIONS}) before compiling code that includes png library files.
# PNG_FOUND, If false, do not try to use PNG.
# PNG_VERSION_STRING - the version of the PNG library found (since CMake 2.8.8)
# Also defined, but not for general use are
# PNG_LIBRARY, where to find the PNG library.
# For backward compatiblity the variable PNG_INCLUDE_DIR is also set. It has the same value as PNG_INCLUDE_DIRS.
#
# Since PNG depends on the ZLib compression library, none of the above will be
# defined unless ZLib can be found.
#=============================================================================
# CMake - Cross Platform Makefile Generator
# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
# Modified by Nicolas Hake for the OpenClonk Project to make FindPNG also
# look for versioned libraries.
if(PNG_FIND_QUIETLY)
set(_FIND_ZLIB_ARG QUIET)
endif()
find_package(ZLIB ${_FIND_ZLIB_ARG})
if(ZLIB_FOUND)
find_path(PNG_PNG_INCLUDE_DIR png.h
/usr/local/include/libpng # OpenBSD
)
if (PNG_PNG_INCLUDE_DIR AND EXISTS "${PNG_PNG_INCLUDE_DIR}/png.h")
file(STRINGS "${PNG_PNG_INCLUDE_DIR}/png.h" png_version_str REGEX "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\".+\"")
string(REGEX REPLACE "^#define[ \t]+PNG_LIBPNG_VER_STRING[ \t]+\"([^\"]+)\".*" "\\1" PNG_VERSION_STRING "${png_version_str}")
unset(png_version_str)
endif ()
if (PNG_VERSION_STRING)
string(REGEX REPLACE "^([0-9]+)\\.([0-9]+).*" "png\\1\\2" PNG_VERSIONED_LIBRARY "${PNG_VERSION_STRING}")
set(PNG_VERSIONED_LIBRARY ${PNG_VERSIONED_LIBRARY} lib${PNG_VERSIONED_LIBRARY} lib${PNG_VERSIONED_LIBRARY}_static ${PNG_VERSIONED_LIBRARY}d lib${PNG_VERSIONED_LIBRARY}d lib${PNG_VERSIONED_LIBRARY}d_static)
endif ()
set(PNG_NAMES ${PNG_NAMES} png libpng ${PNG_VERSIONED_LIBRARY} png15 libpng15 png15d libpng15d png14 libpng14 png14d libpng14d png12 libpng12 png12d libpng12d)
unset(PNG_VERSIONED_LIBRARY)
find_library(PNG_LIBRARY NAMES ${PNG_NAMES} )
if (PNG_LIBRARY AND PNG_PNG_INCLUDE_DIR)
# png.h includes zlib.h. Sigh.
set(PNG_INCLUDE_DIRS ${PNG_PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
set(PNG_INCLUDE_DIR ${PNG_INCLUDE_DIRS} ) # for backward compatiblity
set(PNG_LIBRARIES ${PNG_LIBRARY} ${ZLIB_LIBRARY})
if (CYGWIN)
if(BUILD_SHARED_LIBS)
# No need to define PNG_USE_DLL here, because it's default for Cygwin.
else()
set (PNG_DEFINITIONS -DPNG_STATIC)
endif()
endif ()
endif ()
endif()
# handle the QUIETLY and REQUIRED arguments and set PNG_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PNG
REQUIRED_VARS PNG_LIBRARY PNG_PNG_INCLUDE_DIR
VERSION_VAR PNG_VERSION_STRING)
mark_as_advanced(PNG_PNG_INCLUDE_DIR PNG_LIBRARY )

View File

@ -1,3 +1,16 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2011-2013, 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.
# - Find READLINE
# Find the native READLINE includes and library
#

View File

@ -1,3 +1,16 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2012-2013, 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.
# - Find libupnp
# Find the libupnp library
# This module defines
@ -5,34 +18,21 @@
# UPNP_LIBRARIES, the libraries needed to use libupnp.
# UPNP_FOUND, If false, do not try to use libupnp.
#=============================================================================
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2012 Armin Burgmeier
# Copyright (c) 2012 Nicolas Hake
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# See isc_license.txt for full license and disclaimer.
#
# "Clonk" is a registered trademark of Matthes Bender.
# See clonk_trademark_license.txt for full license.
#=============================================================================
# TODO: Use pkg-config if available
find_path(UPNP_INCLUDE_DIR NAMES upnp.h PATH_SUFFIXES upnp)
set(UPNP_NAMES ${UPNP_NAMES} upnp)
set(THREADUTIL_NAMES ${THREADUTIL_NAMES} threadutil)
set(IXML_NAMES ${IXML_NAMES} ixml)
find_library(UPNP_LIBRARY NAMES ${UPNP_NAMES})
find_library(THREADUTIL_LIBRARY NAMES ${THREADUTIL_NAMES})
find_library(IXML_LIBRARY NAMES ${IXML_NAMES})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UPNP DEFAULT_MSG UPNP_LIBRARY IXML_LIBRARY UPNP_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UPNP DEFAULT_MSG UPNP_LIBRARY THREADUTIL_LIBRARY IXML_LIBRARY UPNP_INCLUDE_DIR)
if(UPNP_FOUND)
set(UPNP_LIBRARIES ${UPNP_LIBRARY} ${IXML_LIBRARY})
set(UPNP_LIBRARIES ${UPNP_LIBRARY} ${THREADUTIL_LIBRARY} ${IXML_LIBRARY})
set(UPNP_INCLUDE_DIR ${UPNP_INCLUDE_DIR})
endif()

View File

@ -0,0 +1,113 @@
# - Find zlib
# Find the native ZLIB includes and library.
# Once done this will define
#
# ZLIB_INCLUDE_DIRS - where to find zlib.h, etc.
# ZLIB_LIBRARIES - List of libraries when using zlib.
# ZLIB_FOUND - True if zlib found.
#
# ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
# ZLIB_VERSION_MAJOR - The major version of zlib
# ZLIB_VERSION_MINOR - The minor version of zlib
# ZLIB_VERSION_PATCH - The patch version of zlib
# ZLIB_VERSION_TWEAK - The tweak version of zlib
#
# The following variable are provided for backward compatibility
#
# ZLIB_MAJOR_VERSION - The major version of zlib
# ZLIB_MINOR_VERSION - The minor version of zlib
# ZLIB_PATCH_VERSION - The patch version of zlib
#
# An includer may set ZLIB_ROOT to a zlib installation root to tell
# this module where to look.
#=============================================================================
# CMake - Cross Platform Makefile Generator
# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the names of Kitware, Inc., the Insight Software Consortium,
# nor the names of their contributors may be used to endorse or promote
# products derived from this software without specific prior written
# permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
set(_ZLIB_SEARCHES)
# Search ZLIB_ROOT first if it is set.
if(ZLIB_ROOT)
set(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH)
list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT)
endif()
# Normal search.
set(_ZLIB_SEARCH_NORMAL
PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]"
"$ENV{PROGRAMFILES}/zlib"
)
list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL)
set(ZLIB_NAMES z zlib zlibstatic zdll zlib1 zlibd zlibd1)
# Try each search configuration.
foreach(search ${_ZLIB_SEARCHES})
find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include)
find_library(ZLIB_LIBRARY NAMES ${ZLIB_NAMES} ${${search}} PATH_SUFFIXES lib)
endforeach()
mark_as_advanced(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$")
string(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}")
string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}")
string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}")
set(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}")
# only append a TWEAK version if it exists:
set(ZLIB_VERSION_TWEAK "")
if( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
set(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}")
endif()
set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
endif()
# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
VERSION_VAR ZLIB_VERSION_STRING)
if(ZLIB_FOUND)
set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
endif()

View File

@ -68,7 +68,7 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _input)
${_compiler_FLAGS} -x c++-header -o ${_output} ${_source}
IMPLICIT_DEPENDS CXX ${_source}
)
FILE(WRITE "${_pchdir}/${_name}" "") # This file is added so the cc-units don't stumble over not being able to include the file
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}")

View File

@ -0,0 +1,52 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2012-2013, 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.
function(git_get_changeset_id VAR)
find_package(Git QUIET)
if (GIT_FOUND)
execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND "${GIT_EXECUTABLE}" "rev-parse" "HEAD"
RESULT_VARIABLE GIT_RESULT
OUTPUT_VARIABLE C4REVISION
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if(GIT_RESULT EQUAL 0)
string(SUBSTRING "${C4REVISION}" 0 12 C4REVISION)
execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND "${GIT_EXECUTABLE}" "status" "--porcelain"
OUTPUT_VARIABLE GIT_STATUS
)
string(REGEX MATCH "^[MADRC ][MD ]" WORKDIR_DIRTY "${GIT_STATUS}")
endif()
endif()
if (NOT C4REVISION)
# Git not found or not a git workdir
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/.git_archival" C4REVISION
LIMIT_COUNT 1
REGEX "node: [0-9a-f]+"
)
string(LENGTH "${C4REVISION}" revlength)
if(revlength LESS 18)
set(C4REVISION "unknown")
message(WARNING "Could not retrieve git revision. Please set GIT_EXECUTABLE!")
else()
string(SUBSTRING "${C4REVISION}" 6 12 C4REVISION)
endif()
unset(revlength)
endif()
if(WORKDIR_DIRTY)
set(C4REVISION "${C4REVISION}+")
endif()
set(${VAR} "${C4REVISION}" PARENT_SCOPE)
endfunction()

View File

@ -0,0 +1,21 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2013, 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.
include(CheckCXXSourceCompiles)
macro(REQUIRE_CXX_SOURCE_COMPILES _code _var)
CHECK_CXX_SOURCE_COMPILES("${_code}" ${_var})
if(NOT ${_var})
unset(${_var} CACHE)
MESSAGE(FATAL_ERROR "${_var} is required for this project to build properly. Aborting.")
endif()
endmacro()

View File

@ -1,14 +1,17 @@
/* Activate DebugRecs */
#cmakedefine DEBUGREC 1
/* Generate minidumps on crash */
#cmakedefine HAVE_DBGHELP 1
/* Define to 1 if you have the <direct.h> header file. */
#cmakedefine HAVE_DIRECT_H 1
/* Define to 1 if you have the <execinfo.h> header file. */
/* The backtrace function is declared in execinfo.h and works */
#cmakedefine HAVE_EXECINFO_H 1
/* Define to 1 if you have FreeType2. */
#cmakedefine HAVE_FREETYPE 1
/* Whether FMOD shall be used */
#cmakedefine HAVE_FMOD 1
/* Define to 1 if you have the <history.h> header file. */
#cmakedefine HAVE_HISTORY_H 1
@ -31,20 +34,14 @@
/* Define to 1 if you have SDL_mixer. */
#cmakedefine HAVE_LIBSDL_MIXER 1
/* Define to 1 if FMOD is available */
#cmakedefine HAVE_FMOD 1
/* Use OpenAL for playing sounds */
#cmakedefine USE_OPEN_AL 1
/* Define to 1 if you have the <locale.h> header file. */
#cmakedefine HAVE_LOCALE_H 1
/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine HAVE_MEMORY_H 1
/* Define to 1 if you have the <multimon.h> header file. */
#cmakedefine HAVE_MULTIMON_H 1
/* Define to 1 if you have support for nullptr. */
#cmakedefine HAVE_NULLPTR 1
/* Define to 1 if you have the <poll.h> header file. */
#cmakedefine HAVE_POLL_H 1
@ -64,6 +61,9 @@
/* Define to 1 if you have the <readline/readline.h> header file. */
#cmakedefine HAVE_READLINE_READLINE_H 1
/* C++ Compiler has rvalue references, a C++0x feature. */
#cmakedefine HAVE_RVALUE_REF 1
/* Define to 1 if you have SDL. */
#cmakedefine HAVE_SDL 1
@ -73,6 +73,9 @@
/* Define to 1 if you have the <signal.h> header file. */
#cmakedefine HAVE_SIGNAL_H 1
/* Define to 1 if your compiler supports static_assert */
#cmakedefine HAVE_STATIC_ASSERT 1
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H 1
@ -85,15 +88,15 @@
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine HAVE_STRING_H 1
/* Define to 1 if you have the <sys/inotify.h> header file. */
#cmakedefine HAVE_SYS_INOTIFY_H 1
/* Define to 1 if you have the <sys/eventfd.h> header file. */
#cmakedefine HAVE_SYS_EVENTFD_H
#cmakedefine HAVE_SYS_EVENTFD_H 1
/* Define to 1 if you have the <sys/file.h> header file. */
#cmakedefine HAVE_SYS_FILE_H 1
/* Define to 1 if you have the <sys/inotify.h> header file. */
#cmakedefine HAVE_SYS_INOTIFY_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
#cmakedefine HAVE_SYS_SOCKET_H 1
@ -114,18 +117,12 @@
#cmakedefine HAVE_VFW32
/* Define to 1 if you have the <X11/extensions/xf86vmode.h> header file. */
#cmakedefine HAVE_X11_EXTENSIONS_XF86VMODE_H 1
/* Define to 1 if you have the <X11/extensions/Xrandr.h> header file. */
#cmakedefine HAVE_X11_EXTENSIONS_XRANDR_H 1
/* Define to 1 if you have the <X11/keysym.h> header file. */
#cmakedefine HAVE_X11_KEYSYM_H 1
/* Define to 1 if you have the <X11/xpm.h> header file. */
#cmakedefine HAVE_X11_XPM_H 1
/* Define as const if the declaration of iconv() needs const. */
#cmakedefine ICONV_CONST
@ -160,53 +157,38 @@
/* dedicated server mode */
#cmakedefine USE_CONSOLE 1
/* DirectX graphics */
#cmakedefine USE_DIRECTX 1
/* OpenGL graphics */
#cmakedefine USE_GL 1
/* MP3 music */
#cmakedefine USE_MP3 1
/* OpenAL sound */
#cmakedefine USE_OPEN_AL 1
/* Define to 1 if SDL is used for the main loop */
#cmakedefine USE_SDL_MAINLOOP 1
/* Define to 1 if the X Window System is used */
#cmakedefine USE_X11 1
/* Enable automatic update system */
#cmakedefine WITH_AUTOMATIC_UPDATE 1
/* Developer mode */
#cmakedefine WITH_DEVELOPER_MODE 1
/* Define to 1 if you want to use Boost.Regex instead of <regex>. */
#cmakedefine USE_BOOST_REGEX 1
/* Glib */
#cmakedefine WITH_GLIB 1
/* Use GTK+3 for the developer mode */
#cmakedefine WITH_GTK3 1
/* Enable the automatic update system */
#cmakedefine WITH_AUTOMATIC_UPDATE 1
/* Define to 1 if the X Window System is missing or not being used. */
#cmakedefine X_DISPLAY_MISSING 1
/* compile with debug options */
#cmakedefine _DEBUG
/* Define to 1 if rvalue references are supported */
#cmakedefine HAVE_RVALUE_REF 1
#cmakedefine _DEBUG 1
/* Define to 1 if you have support for precompiled headers */
#cmakedefine HAVE_PRECOMPILED_HEADERS 1
/* Define to 1 if you have support for nullptr. */
#cmakedefine HAVE_NULLPTR 1
/* Use Apple Cocoa for the UI */
#cmakedefine USE_COCOA 1
/* Define to 1 if your compiler supports static_assert */
#cmakedefine HAVE_STATIC_ASSERT 1
/* Generate minidumps on crash */
#cmakedefine HAVE_DBGHELP 1

View File

@ -1,209 +0,0 @@
/* config.h.in. Generated from configure.ac by autoheader. */
/* Activate DebugRecs */
#undef DEBUGREC
/* define if the Boost library is available */
#undef HAVE_BOOST
/* Define to 1 if you have the <direct.h> header file. */
#undef HAVE_DIRECT_H
/* The backtrace function is declared in execinfo.h and works */
#undef HAVE_EXECINFO_H
/* Define to 1 if you have FreeType2. */
#undef HAVE_FREETYPE
/* Define to 1 if you have the <history.h> header file. */
#undef HAVE_HISTORY_H
/* Define if you have the iconv() function. */
#undef HAVE_ICONV
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <io.h> header file. */
#undef HAVE_IO_H
/* Define to 1 if you have the <langinfo.h> header file. */
#undef HAVE_LANGINFO_H
/* Define if you have a readline compatible library */
#undef HAVE_LIBREADLINE
/* Define to 1 if you have SDL_mixer. */
#undef HAVE_LIBSDL_MIXER
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <multimon.h> header file. */
#undef HAVE_MULTIMON_H
/* Define to 1 if you have the <natupnp.h> header file. */
#undef HAVE_NATUPNP_H
/* Define to 1 if you have the <poll.h> header file. */
#undef HAVE_POLL_H
/* Define if you have POSIX threads libraries and header files. */
#undef HAVE_PTHREAD
/* Have PTHREAD_PRIO_INHERIT. */
#undef HAVE_PTHREAD_PRIO_INHERIT
/* Define to 1 if you have the <readline.h> header file. */
#undef HAVE_READLINE_H
/* Define if your readline library has \`add_history' */
#undef HAVE_READLINE_HISTORY
/* Define to 1 if you have the <readline/history.h> header file. */
#undef HAVE_READLINE_HISTORY_H
/* Define to 1 if you have the <readline/readline.h> header file. */
#undef HAVE_READLINE_READLINE_H
/* C++ Compiler has rvalue references, a C++0x feature. */
#undef HAVE_RVALUE_REF
/* Define to 1 if you have SDL. */
#undef HAVE_SDL
/* Define to 1 if you have the <share.h> header file. */
#undef HAVE_SHARE_H
/* Define to 1 if you have the <signal.h> header file. */
#undef HAVE_SIGNAL_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/eventfd.h> header file. */
#undef HAVE_SYS_EVENTFD_H
/* Define to 1 if you have the <sys/file.h> header file. */
#undef HAVE_SYS_FILE_H
/* Define to 1 if you have the <sys/inotify.h> header file. */
#undef HAVE_SYS_INOTIFY_H
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/timerfd.h> header file. */
#undef HAVE_SYS_TIMERFD_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vasprintf' function. */
#undef HAVE_VASPRINTF
/* */
#undef HAVE_VFW32
/* Define to 1 if you have the <X11/extensions/xf86vmode.h> header file. */
#undef HAVE_X11_EXTENSIONS_XF86VMODE_H
/* Define to 1 if you have the <X11/extensions/Xrandr.h> header file. */
#undef HAVE_X11_EXTENSIONS_XRANDR_H
/* Define to 1 if you have the <X11/keysym.h> header file. */
#undef HAVE_X11_KEYSYM_H
/* Define to 1 if you have the <X11/xpm.h> header file. */
#undef HAVE_X11_XPM_H
/* Define as const if the declaration of iconv() needs const. */
#undef ICONV_CONST
/* compile without debug options */
#undef NDEBUG
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
#undef PTHREAD_CREATE_JOINABLE
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* dedicated server mode */
#undef USE_CONSOLE
/* DirectX graphics */
#undef USE_DIRECTX
/* Whether FMOD shall be used */
#undef USE_FMOD
/* OpenGL graphics */
#undef USE_GL
/* MP3 music */
#undef USE_MP3
/* OpenAL sound */
#undef USE_OPEN_AL
/* Define to 1 if SDL is used for the main loop */
#undef USE_SDL_MAINLOOP
/* Define to 1 if the X Window System is used */
#undef USE_X11
/* Enable automatic update system */
#undef WITH_AUTOMATIC_UPDATE
/* Developer mode */
#undef WITH_DEVELOPER_MODE
/* Glib */
#undef WITH_GLIB
/* Define to 1 if the X Window System is missing or not being used. */
#undef X_DISPLAY_MISSING
/* compile with debug options */
#undef _DEBUG

View File

@ -1,403 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
# Copyright (c) 2005-2011 Günther Brammer
# Copyright (c) 2005, 2008 Peter Wortmann
# Copyright (c) 2006 Julian Raschke
# Copyright (c) 2010 Armin Burgmeier
# Copyright (c) 2010 Martin Plicht
# Copyright (c) 2005-2009, RedWolf Design GmbH, http://www.clonk.de
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_PREREQ([2.67])
AC_INIT([clonk], [5])
AC_COPYRIGHT([©2005-2011 Günther Brammer])
AC_CONFIG_SRCDIR([/src/C4Game.cpp])
AC_CONFIG_AUX_DIR([autotools])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([Makefile])
AC_CANONICAL_HOST
dnl foreign to tell automake to shut up,
dnl and subdir-objects because it makes the Makefile smaller.
dnl no-define because PACKAGE and VERSION are not used
AM_INIT_AUTOMAKE([foreign tar-ustar nostdinc no-define 1.10])
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
AC_PROG_CXX
AC_LANG([C++])
AX_CHECK_COMPILE_FLAG([-std=gnu++0x], [CXX="${CXX} -std=gnu++0x"], [])
AC_COMPILE_IFELSE([
void f(struct D&&); int main() { return 0; }
], [AC_DEFINE([HAVE_RVALUE_REF], [], [C++ Compiler has rvalue references, a C++0x feature.])], [AX_PROG_CXX_REFTOTEMP])
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_RANLIB
case $host in
*-*-mingw32* | *-*-cygwin* | *-*-windows*)
win32=true; osx=false;;
*-*-darwin*)
win32=false; osx=true;
m4_ifdef([AC_PROG_OBJCXX], [AC_PROG_OBJCXX], [AC_MSG_ERROR([this configure script was created with an autoconf version older than 2.65 and does not support macosx.])])
;;
*)
win32=false; osx=false;;
esac
# Detect Wine. Unfortunately, at the moment winegcc does not meet the demands
AC_CHECK_HEADER([windows.h], [win32=true], [], [[ ]])
AM_CONDITIONAL(WIN32, [test $win32 = true])
AM_CONDITIONAL(MACOSX, [test $osx = true])
# various used headers
dnl the whitespace is there to prevent AC_INCLUDES_DEFAULT
AC_CHECK_HEADERS([stdint.h unistd.h poll.h sys/file.h sys/stat.h sys/types.h locale.h sys/socket.h signal.h langinfo.h sys/eventfd.h sys/timerfd.h sys/inotify.h], , , [[ ]])
# Mingw does not ship with multimon.h
AC_CHECK_HEADERS([multimon.h io.h direct.h share.h natupnp.h], [], [], [[#include <windows.h>]])
# iconv
AX_ICONV
# vasprintf is a GNU extension
AC_CHECK_FUNCS(vasprintf)
# so is execinfo.h - and some systems have the header despite the functions not being in the c library
AC_CHECK_HEADER(execinfo.h)
if test "x$ac_cv_header_execinfo_h" = xyes; then
AC_CHECK_FUNC(backtrace, [], [
AC_CHECK_LIB(execinfo, backtrace, [
CLONK_LIBS="-lexecinfo $CLONK_LIBS"
], [
ac_cv_header_execinfo_h=no
])
])
fi
if test "x$ac_cv_header_execinfo_h" = xyes; then
AC_DEFINE(HAVE_EXECINFO_H, 1, [The backtrace function is declared in execinfo.h and works])
fi
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],[debugging options [default=no]])],
, [enable_debug=no])
if test $enable_debug = yes; then
AC_DEFINE([_DEBUG], 1, [compile with debug options])
else
AC_DEFINE([NDEBUG], 1, [compile without debug options])
fi
AC_ARG_ENABLE([debugrec],
[AS_HELP_STRING([--enable-debugrec],[write additional debug control to records [default=no]])],
, [enable_debugrec=no])
if test $enable_debugrec = yes; then
AC_DEFINE([DEBUGREC], 1, [Activate DebugRecs])
fi
AC_ARG_ENABLE([console],
[AS_HELP_STRING([--enable-console],[compile as pure console application [default=no]])],
, [enable_console=no])
AC_ARG_ENABLE([sound],
[AS_HELP_STRING([--enable-sound],[compile with sound support [default=yes]])],
, [if test $enable_console = yes; then enable_sound=no; else if test $win32 = true; then enable_sound=no; else enable_sound=yes; fi; fi])
# GTK+
GTK2_REQUIRED="glib-2.0 >= 2.8 gtk+-2.0 >= 2.8"
GTK3_REQUIRED="glib-2.0 >= 2.27.5 gtk+-3.0 >= 2.99.0"
PKG_PROG_PKG_CONFIG
AC_MSG_CHECKING([which gtk+ version to compile against])
AC_ARG_WITH([gtk],
[AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against [default: auto]])],
[case "$with_gtk" in
2.0|3.0) ;;
no) ;;
*) AC_MSG_ERROR([invalid gtk version specified]) ;;
esac],
[AS_IF([test $enable_console = no],
[PKG_CHECK_EXISTS([$GTK3_REQUIRED],
[with_gtk=3.0],
[PKG_CHECK_EXISTS([$GTK2_REQUIRED],
[with_gtk=2.0],
[with_gtk=no])])],
[with_gtk=no])])
AC_MSG_RESULT([$with_gtk])
AS_IF([test $with_gtk != no],[
case "$with_gtk" in
2.0) GTK_REQUIRED="$GTK2_REQUIRED"
;;
3.0) GTK_REQUIRED="$GTK3_REQUIRED"
;;
esac
PKG_CHECK_MODULES(GTK, [$GTK_REQUIRED])
AC_DEFINE([WITH_GLIB], 1, [Glib])
AC_DEFINE([WITH_DEVELOPER_MODE], 1, [Developer mode])
])
AM_CONDITIONAL(GTK, [test $with_gtk != no])
# OpenAL
AC_ARG_WITH([openal],
[AS_HELP_STRING([--with-openal],[compile with openal support [default=no]])],
, [with_openal=no])
if test $with_openal = yes; then
PKG_CHECK_MODULES(OPENAL, [vorbis vorbisfile openal])
AC_DEFINE([USE_OPEN_AL], 1, [OpenAL sound])
if test $enable_sound = no; then
AC_MSG_ERROR([--with-openal cannot be used with --disable-sound.])
fi
fi
# SDL
with_sdl_mixer=no
AC_ARG_WITH([sdl],
AS_HELP_STRING([--with-sdl], [Use SDL @<:@default=yes (no for win32)@:>@]),
, [if test $win32 = true; then with_sdl=no; else if test $enable_console = yes; then with_sdl=no; else with_sdl=yes; fi fi])
if test $with_sdl = yes; then
# Check for SDL
SDL_VERSION=1.2.0
AM_PATH_SDL($SDL_VERSION,
[AC_DEFINE(HAVE_SDL, 1, [Define to 1 if you have SDL.])],
[AC_MSG_ERROR([libSDL not found.])])
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
if test $enable_sound = yes && test $with_openal = no; then
# Check for SDL_mixer library
AC_CHECK_LIB(SDL_mixer, Mix_OpenAudio,
[AC_DEFINE(HAVE_LIBSDL_MIXER,1,[Define to 1 if you have SDL_mixer.])
SDL_LIBS="-lSDL_mixer $SDL_LIBS"
with_sdl_mixer=yes],
[AC_MSG_ERROR([SDL_mixer not found.])],
[$SDL_LIBS])
fi
AC_ARG_ENABLE(sdlmainloop,
[AS_HELP_STRING([--enable-sdlmainloop],[use SDL instead of X11 or Win32 [default=no]])],
, [if test $osx = true; then enable_sdlmainloop=yes; else enable_sdlmainloop=no; fi ])
else
enable_sdlmainloop=no
fi
if test $enable_sdlmainloop = yes; then
with_x=no
AC_DEFINE(USE_SDL_MAINLOOP, 1, [Define to 1 if SDL is used for the main loop])
fi
AM_CONDITIONAL(SDL_MAIN_LOOP, [test $enable_sdlmainloop = yes])
if test $enable_sound = yes; then
AC_ARG_ENABLE([mp3],
[AS_HELP_STRING([--enable-mp3],[enable mp3 support [default=no]])],
, [enable_mp3=no])
if test $enable_mp3 = yes; then
AC_DEFINE([USE_MP3], 1, [MP3 music])
fi
fi
if test $enable_console = no; then
if test $win32 = true; then
AC_SUBST(WINDOWS_CFLAGS, "-mwindows")
fi
else
# console mode
AC_DEFINE([USE_CONSOLE], 1, [dedicated server mode])
with_x=no
enable_sdlmainloop=no
VL_LIB_READLINE
fi
# Check for boost
AX_BOOST_BASE([1.40.0], [], [
AC_MSG_ERROR([Boost not found.])
])
# Check for libjpeg
AC_CHECK_LIB(jpeg, jpeg_read_header, [
CLONK_LIBS="-ljpeg $CLONK_LIBS"
], [
AC_MSG_ERROR([libjpeg not found.])
])
# Check for libpng
AC_CHECK_LIB(png, png_read_image, [
CLONK_LIBS="-lpng $CLONK_LIBS"
], [
AC_MSG_ERROR([libpng not found.])
], [-lz])
# Check for libz
AC_CHECK_LIB(z, deflate, [
Z_LIBS="-lz $Z_LIBS"
], [
AC_MSG_ERROR([libz not found.])
])
# Check for librt
AC_CHECK_LIB(rt, clock_gettime, [
LDADD="-lrt $LDADD"
], [])
# Check for libfreetype
if test $enable_console = no; then
PKG_CHECK_MODULES(FREETYPE, freetype2, ,[
if test "$cross_compiling" = no; then
AC_CHECK_PROG(FREETYPE_CONFIG, freetype-config, freetype-config)
fi
if test $FREETYPE_CONFIG; then
AC_SUBST(FREETYPE_CFLAGS, [`$FREETYPE_CONFIG --cflags`])
AC_SUBST(FREETYPE_LIBS, [`$FREETYPE_CONFIG --libs`])
else
AC_MSG_ERROR([Freetype not found.])
fi
])
AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if you have FreeType2.])
fi
# X11, Xpm, Xrandr
AC_PATH_XTRA
if test $have_x = yes; then
AC_DEFINE(USE_X11, 1, [Define to 1 if the X Window System is used])
CLONK_LIBS="$X_LIBS $CLONK_LIBS"
AC_CHECK_HEADERS([X11/keysym.h X11/extensions/xf86vmode.h X11/xpm.h X11/extensions/Xrandr.h], ,
[AC_MSG_ERROR([A required X11 header was not found.])], [[#include <X11/Xlib.h>]])
AC_CHECK_LIB(X11, XOpenDisplay, [CLONK_LIBS="-lX11 $CLONK_LIBS"],
[AC_MSG_ERROR([libX11 not found.])], [$X_LIBS])
AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData, [CLONK_LIBS="-lXpm $CLONK_LIBS"],
[AC_MSG_ERROR([libXpm not found.])], [$X_LIBS])
AC_CHECK_LIB(Xxf86vm, XF86VidModeQueryVersion, [CLONK_LIBS="-lXxf86vm $CLONK_LIBS"],
[AC_MSG_ERROR([XF86VidMode not found.])], [$X_LIBS])
AC_CHECK_LIB(Xrandr, XRRQueryExtension, [CLONK_LIBS="-lXrandr $CLONK_LIBS"],
[AC_MSG_ERROR([libXrandr not found.])], [$X_LIBS])
fi
# OpenGL
AC_ARG_WITH([gl],
[AS_HELP_STRING([--with-gl],[compile with opengl support [default=yes]])],
, [if test $enable_console = yes; then with_gl=no; else with_gl=yes; fi])
if test $with_gl = yes; then
if test $osx = true; then
CLONK_LIBS="-framework OpenGL $CLONK_LIBS"
AC_CHECK_LIB(GLEW, glewInit, [CLONK_LIBS="-lGLEW $CLONK_LIBS"],
[AC_MSG_ERROR([glew not found.])])
elif test $win32 = true; then
AC_CHECK_LIB(opengl32, main, [CLONK_LIBS="-lopengl32 $CLONK_LIBS"],
[AC_MSG_ERROR([opengl32 not found.])])
AC_CHECK_LIB(glu32, main, [CLONK_LIBS="-lglu32 $CLONK_LIBS"],
[AC_MSG_ERROR([glu32 not found.])])
AC_CHECK_LIB(glew32, main, [CLONK_LIBS="-lglew32 $CLONK_LIBS"],
[AC_MSG_ERROR([glew not found.])])
AC_SUBST([GLEW_CFLAGS],["-DGLEW_STATIC"])
else
AC_CHECK_LIB(GL, glBegin, [CLONK_LIBS="-lGL $CLONK_LIBS"],
[AC_MSG_ERROR([libGL not found.])])
AC_CHECK_LIB(GLU, gluOrtho2D, [CLONK_LIBS="-lGLU $CLONK_LIBS"],
[AC_MSG_ERROR([libGLU not found.])])
AC_CHECK_LIB(GLEW, glewInit, [CLONK_LIBS="-lGLEW $CLONK_LIBS"],
[AC_MSG_ERROR([glew not found.])])
fi
AC_DEFINE([USE_GL], 1, [OpenGL graphics])
fi
# DirectX
AC_ARG_WITH([directx],
[AS_HELP_STRING([--with-directx],[compile with directx support [default=no]])],
, [with_directx="no"])
if test "$with_directx" = yes; then
AC_CHECK_LIB(d3d9, main, [CLONK_LIBS="-ld3d9 $CLONK_LIBS"],
[AC_MSG_ERROR([d3d9 not found.])])
AC_DEFINE([USE_DIRECTX], 1, [DirectX graphics])
fi
# UPnP
AC_ARG_WITH([upnp],
[AS_HELP_STRING([--with-upnp],[compile with upnp support [default=no]])],
, [with_upnp=no])
AS_IF([test $with_upnp = yes], [
AM_CONDITIONAL(NATUPNP, [test "$ac_cv_header_natupnp_h" = yes])
PKG_CHECK_MODULES(LIBUPNP, [libupnp], [have_libupnp=yes], [have_libupnp=no])
], [
AM_CONDITIONAL(NATUPNP, [false])
have_libupnp=no
])
AM_CONDITIONAL(LIBUPNP, [test "$have_libupnp" = yes])
# Automatic Update
AC_ARG_WITH([automatic-update],
[AS_HELP_STRING([--with-automatic-update],[enable support for automatic engine updates [default=yes]])],
, [with_automatic_update="yes"])
if test "$with_automatic_update" = "yes"; then
AC_DEFINE([WITH_AUTOMATIC_UPDATE], 1, [Enable automatic update system])
fi
if test $win32 = false; then
# pthread
AX_PTHREAD( , [AC_MSG_ERROR([No pthread support.])])
AC_SUBST(PTHREAD_LIBS)
AC_SUBST(PTHREAD_CFLAGS)
# FMod is used for windows only
AM_CONDITIONAL(USE_FMOD, false)
else
# Windows
for WIN32LIB in gdi32 comdlg32 ws2_32
do
AC_CHECK_LIB([$WIN32LIB], main, [CLONK_LIBS="-l$WIN32LIB $CLONK_LIBS"], [AC_MSG_ERROR([$WIN32LIB not found.])])
done
AC_CHECK_LIB([winmm], main, [LDADD="-lwinmm $LDADD"], [AC_MSG_ERROR([winmm not found.])])
AC_CHECK_LIB([vfw32], main, [
CLONK_LIBS="-lvfw32 $CLONK_LIBS"
AC_DEFINE([HAVE_VFW32], 1, [ ])
], [])
# FMod (Library comes with standard)
if test "$enable_sound" = yes; then
AC_DEFINE([USE_FMOD], 1, [Whether FMOD shall be used])
fi
AM_CONDITIONAL(USE_FMOD, test "$enable_sound" = yes)
# windres
AC_CHECK_TOOL(WINDRES, windres, no)
if test $WINDRES = no; then
AC_MSG_ERROR([windres not found.])
fi
fi
AC_SUBST(LDADD)
AC_SUBST(CLONK_LIBS)
AC_SUBST(Z_LIBS)
# precompiled headers and -Wextra
AC_MSG_CHECKING([whether we are using a GNU C++ compiler version 4.1 or newer])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#if defined(__GNUC__) && (((__GNUC__ >= 4) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ > 4))
// all ok
#else
choke me
#endif
]])], RECENT_GCC="yes", RECENT_GCC="no")
AC_MSG_RESULT([$RECENT_GCC])
AM_CONDITIONAL(RECENT_GCC, [test $RECENT_GCC = yes])
AC_OUTPUT
echo "Configuration:
Debug: $enable_debug
Debugrec: $enable_debugrec
Pure console: $enable_console
DirectX: $with_directx
OpenGL: $with_gl
Sound: $enable_sound
SDL_Mixer: $with_sdl_mixer
OpenAL: $with_openal
GTK+: $with_gtk
X11: $have_x
Nat/LibUPnP: $ac_cv_header_natupnp_h/$have_libupnp
CFLAGS: $CFLAGS
CXXFLAGS: $CXXFLAGS"
if test "$enable_sdlmainloop" = yes; then echo " SDL: mainloop";
else echo " SDL: $with_sdl"; fi

View File

@ -1,8 +1,15 @@
# Notable targets:
# all (default): German and English onlinedocs
# online-en: only English onlinedocs, which can be partially updated
# Enwickler.chm: the German offline doc
# use with make Entwickler.chm HHC = /path/to/hhc
# German and English online docs:
# make all
# make install prefix=/path/to/webspace
# The offline docs:
# make chm HHC=/path/to/hhc.exe
# Only English online docs, which can be partially updated:
# make online-en
# The English offline doc:
# make chm/en/Developer.chm HHC=/path/to/hhc.exe
# XML syntax check:
# make check
# Extra Parameters for xsltproc can be given in the XSLTFLAGS variable.
# Use prefix to select the directory where the docs are to be installed
@ -20,13 +27,13 @@ stylesheet = clonk.xsl
# find all directories neither beginning nor contained within a directory beginning with a dot
sdk-dirs := $(shell find sdk -name '.*' -prune -o -type d -print)
# find all *.xml files recursively in sdk/
xmlfiles := $(sort $(shell find sdk -name '.*' -prune -o -name 'content.xml' -prune -o -name \*.xml -print))
# misc
extra-files := $(sort $(wildcard *.css *.php *.js images/*.*))
extra-files-chm := $(sort $(wildcard *.css *.js images/*.*))
# find all *.xml files recursively in sdk/
xmlfiles := $(sort $(shell find sdk -name '.*' -prune -o -name 'content.xml' -prune -o -name \*.xml -print))
# Targets:
# strip from all files the .xml, and add a .html
@ -36,8 +43,8 @@ htmlfiles := $(addsuffix .html, $(basename $(xmlfiles)))
sdk-de-dirs := $(subst sdk, sdk-de, $(sdk-dirs))
# For openclonk.org
online-sdk-files := $(foreach lang, en de, $(addprefix online/$(lang)/, $(htmlfiles) sdk/content.html))
online-dirs := $(foreach lang, en de, $(addprefix online/$(lang)/, $(sdk-dirs) images))
online-sdk-files := $(foreach lang, en de, $(addprefix online/$(lang)/, $(htmlfiles) sdk/content.html))
online-extra-files := $(foreach lang, en de, $(addprefix online/$(lang)/, $(extra-files)))
# For Entwickler.chm
@ -45,21 +52,21 @@ chm-dirs := $(foreach lang, en de, $(addprefix chm/$(lang)/, . $(sdk-dirs) image
.PHONY: all online-en chm install check clean
all: $(online-dirs) $(sdk-de-dirs) $(online-extra-files) $(online-sdk-files)
all: $(sdk-de-dirs) $(online-dirs) $(online-sdk-files) $(online-extra-files)
online-en: $(addprefix online/en/, $(sdk-dirs) images $(htmlfiles) sdk/content.html $(extra-files))
chm: $(chm-dirs) $(sdk-de-dirs) chm/en/Developer.chm chm/de/Entwickler.chm
chm: $(sdk-de-dirs) $(chm-dirs) chm/en/Developer.chm chm/de/Entwickler.chm
install: all
$(MKDIR_P) $(prefix)
$(CP_R) $(PWD)/online/* $(prefix)
$(CP_R) online/* $(prefix)
check:
xmllint --noblanks --noout --valid $(xmlfiles)
@xmllint --noblanks --noout --valid $(xmlfiles)
clean:
rm -f *.mo Entwickler.chm Developer.chm doku.pot
rm -f *.mo Entwickler.chm Developer.chm doku.pot sdk/content.xml
rm -rf online sdk-de chm
sdk/content.xml: sdk/content.xml.in $(xmlfiles) build_contents.py experimental.py
@ -122,7 +129,7 @@ $(addprefix chm/de/, $(extra-files-chm)): chm/de/%: %
$(CP) $< $@
chm/en/Developer.chm: chm/en/Output.hhp chm/en/Output.hhk chm/en/Output.hhc $(addprefix chm/en/, $(sdk-dirs) images $(htmlfiles) $(extra-files-chm))
"$(HHC)" $<
! "$(HHC)" $<
chm/de/Entwickler.chm: chm/de/Output.hhp chm/de/Output.hhk chm/de/Output.hhc $(addprefix chm/de/, $(sdk-dirs) images $(htmlfiles) $(extra-files-chm))
"$(HHC)" $<
! "$(HHC)" $<

View File

@ -4,7 +4,7 @@ This section explains how to build the German and English HTML-documentation fro
In Linux, it should be as easy as: Open the console and run make in this directory.
In Windows, you ned Python and Cygwin. During the Cygwin installation, select these additional libraries to install:
In Windows, you need Python and Cygwin. During the Cygwin installation, select these additional libraries to install:
+ make
+ xsltproc (libxml2 + libxslt + python-libxml2)
+ findutils
@ -12,7 +12,8 @@ In Windows, you ned Python and Cygwin. During the Cygwin installation, select th
+ gettext
+ gettext-devel
+ libgcrypt + libgpg-error (for whatever reason)
Also you might have to rename find.exe, so that the cygwin provided one is used - first in Windows\System32\dllback then in Windows\System32 to make sure it isn't used.
After the installation, run cygwin, cd to this directory (/cygdrive/c/.../openclonk/docs/) and run make. The process takes about ten minutes to complete.
The online version of the documentation has been generated into the online/ directory.
After the installation, run cygwin, cd to this directory (/cygdrive/c/.../openclonk/docs/) and run make. The process takes a few minutes to complete.
The online version of the documentation has been generated into the online/ directory.
To build the .chm files, install the html help compiler from http://www.microsoft.com/en-us/download/details.aspx?id=21138 or http://go.microsoft.com/fwlink/?LinkId=14188 and run make chm HHC=/path/to/hhc.exe

View File

@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-
import sys
import xml.sax
from xml.sax.saxutils import escape, quoteattr
import experimental
class ClonkEntityResolver(xml.sax.handler.EntityResolver):
@ -125,11 +126,11 @@ class Clonkparser(xml.sax.handler.ContentHandler):
def printfunctions(f, _):
def folder(name):
f.write("<li>" + name + "\n<ul>\n")
f.write("<li>" + escape(name) + "\n<ul>\n")
def sheet(url, name):
f.write("<li><emlink href='" + url[4:] + "'>" + name + "</emlink></li>\n")
f.write("<li><emlink href=" + quoteattr(url[4:]) + ">" + escape(name) + "</emlink></li>\n")
def sheetE(url, name):
f.write("<li><emlink href='" + url[4:] + "'>" + name + "</emlink> (extended)</li>\n")
f.write("<li><emlink href=" + quoteattr(url[4:]) + ">" + escape(name) + "</emlink> (extended)</li>\n")
folder("Functions by Category")
cats = parser.cats.keys()
cats.sort()
@ -153,9 +154,9 @@ def printfunctions(f, _):
def printindex(f, _):
def folder(name):
f.write("<li class='index'>" + name + "\n<ul>\n")
f.write("<li class='index'>" + escape(name) + "\n<ul>\n")
def sheet(url, name):
f.write("<li><emlink href='" + url[4:] + "'>" + name.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;') + "</emlink></li>\n")
f.write("<li><emlink href=" + quoteattr(url[4:]) + ">" + escape(name) + "</emlink></li>\n")
folder("Index")
titles = parser.files.keys()
titles.sort(key=unicode.lower)

View File

@ -23,58 +23,68 @@
<!ELEMENT remark (#PCDATA | br | ul | li | table | %text;)*>
<!ELEMENT examples (example+)>
<!ELEMENT example (code | text)*>
<!ELEMENT code (#PCDATA | funclink | emlink | em | strong)*>
<!ELEMENT code (#PCDATA | funclink | emlink | em | i | strong)*>
<!ATTLIST code
id CDATA #IMPLIED>
<!ELEMENT i (#PCDATA)>
<!ELEMENT text (#PCDATA | br | ul | li | table | %text;)*>
<!ATTLIST text
id CDATA #IMPLIED>
<!ELEMENT related (funclink | emlink)+>
<!ELEMENT funclink (#PCDATA)>
<!ELEMENT emlink (#PCDATA)>
<!ELEMENT emlink (#PCDATA | %text;)*>
<!ATTLIST emlink href CDATA #REQUIRED>
<!ELEMENT author (#PCDATA)>
<!ELEMENT date (#PCDATA)>
<!ELEMENT search EMPTY>
<!ELEMENT doc (title, (h | text | dl | part | code | author | date | img | search)*)>
<!ELEMENT part (h | text | part | code | dl | search)*>
<!ELEMENT doc (title, (h | text | table | part | code | dl | ul | img | search | examples)+, related?, (author, date?)+)>
<!ELEMENT part ((h | text | table | part | code | dl | ul | img | search | examples)+, related?)>
<!ELEMENT h (#PCDATA | %text;)*>
<!ATTLIST h
id CDATA #IMPLIED>
<!ELEMENT br EMPTY>
<!ELEMENT table (#PCDATA | caption | rowh | row | bitmask)*>
<!ELEMENT caption (#PCDATA)>
<!ATTLIST caption
id ID #IMPLIED>
id CDATA #IMPLIED>
<!ELEMENT row (#PCDATA | col | literal_col)*>
<!ATTLIST row
id ID #IMPLIED>
id CDATA #IMPLIED>
<!ELEMENT rowh (#PCDATA | col | literal_col)*>
<!ELEMENT col (#PCDATA | %text;)*>
<!ELEMENT col (#PCDATA | table | text | %text;)*>
<!ATTLIST col
id CDATA #IMPLIED
colspan CDATA #IMPLIED>
<!ELEMENT literal_col (#PCDATA | %text;)*>
<!ELEMENT literal_col (#PCDATA | table | text | %text;)*>
<!ATTLIST literal_col
colspan CDATA #IMPLIED>
<!ELEMENT bitmask (#PCDATA)>
<!ELEMENT ul (#PCDATA | li)*>
<!ELEMENT li (#PCDATA | br | %text;)*>
<!ELEMENT li (#PCDATA | br | table | text | %text;)*>
<!ATTLIST li
id CDATA #IMPLIED>
<!ELEMENT dl (#PCDATA | dd | dt)*>
<!ELEMENT dt (#PCDATA | br | %text;)*>
<!ATTLIST dt
id ID #IMPLIED>
id CDATA #IMPLIED>
<!ELEMENT dd (#PCDATA | text | code)*>
<!ELEMENT em (#PCDATA)>
<!ELEMENT strong (#PCDATA)>
<!ELEMENT h (#PCDATA)>
<!ATTLIST h
id ID #IMPLIED>
<!ELEMENT img EMPTY>
<!ATTLIST img
src CDATA #REQUIRED
width CDATA "0"
height CDATA "0"
id ID #IMPLIED>
alt CDATA #IMPLIED
class CDATA #IMPLIED
width CDATA #IMPLIED
height CDATA #IMPLIED
id CDATA #IMPLIED>
<!ELEMENT a (#PCDATA)>
<!ATTLIST a

View File

@ -350,11 +350,13 @@
</xsl:template>
<xsl:template match="search">
<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 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">
@ -514,7 +516,7 @@
<xsl:template name="color2">
<xsl:param name="s" select="." />
<!-- the list of keywords -->
<xsl:param name="t" select="'#include|#appendto|public|private|protected|global|static|var|local|const|int|proplist|object|array|string|bool|any|return|if|else|break|continue|while|for|func|true|false|nil|'" />
<xsl:param name="t" select="'#include|#appendto|public|private|protected|global|static|var|local|const|any|int|bool|def|effect|object|proplist|string|array|func|return|if|else|break|continue|while|for|true|false|nil|'" />
<xsl:param name="w" select="substring-before($t, '|')" />
<!-- text before the keyword -->
<xsl:variable name="l" select="substring-before($s, $w)" />

2137
docs/de.po

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,9 @@
@font-face{
font-family: Endeavour;
src: url('/Endeavour.eot');
src: local('Endeavour'),url('/Endeavour.ttf') format("truetype");
}
body {
margin: 0;
font-size: small;
@ -74,6 +80,7 @@ color:#222222;
}
h1 {
font-family: Endeavour, Verdana, Sans-serif;
font-size: 2em;
font-weight: normal;
margin-top: 1.32em;
@ -243,4 +250,6 @@ ul.nav li.switchlang img {
margin: 0;
}
a {
color: rgb(0, 102, 153);
}

View File

@ -3,68 +3,56 @@ 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("http://www.openclonk.org/header/header.css");</style>
<div id="nav_header">
<div id="nav_logo">
<a href="http://www.openclonk.org/" target="_top"><img src="http://www.openclonk.org/header/logo.png" alt="OpenClonk"/></a>
</div>
</div>
<div id="nav_navigation">
<div id="nav_search">
<form action="http://www.openclonk.org/header/search.php" id="searchform" method="get" target="_top"><div>
search <input id="searchInput" name="s" type="text" value="" /> in the
<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 name="p">
<option value="blog">blog</option>
<option value="functions">c4script function list</option>
<option value="docs">c4script reference</option>
<option value="functionsDE">c4script function list (DE)</option>
<option value="docsDE">c4script reference (DE)</option>
<option value="bugtrack">bugtracker</option>
<option value="forum">forum</option>
<option value="hg">hg changelog</option>
<option value="hg-resources">hg resources changelog</option>
<option value="wiki">website</option>
<option value="forum">forum</option>
<option value="docs">documentation</option>
<option value="git">repository</option>
<option value="crucible">crucible</option>
<option value="bugtrack">bugtracker</option>
</select>
<input type='submit' class="nav_searchButton" id="searchButton" value="Go" title="Search" />
<input type='submit' id="nav_searchButton" value="Go" title="Search" />
</div></form>
</div>
<div style="float:right">
<ul>
<li>
<a href="http://docs.openclonk.org/en/sdk/" target="_top"><img src="http://forum.openclonk.org/flags/gb.png"/></a>
</li>
<li>
<a href="http://docs.openclonk.org/de/sdk/" target="_top"><img src="http://forum.openclonk.org/flags/de.png"/></a>
</li>
</ul>
</div>
<ul>
<li><a class="current" href="http://www.openclonk.org/" target="_top">Home</a> <ul>
<li><a href="http://wiki.openclonk.org/w/FAQ" target="_top">FAQ</a></li>
<li><a href="http://wiki.openclonk.org/w/About" target="_top">About</a></li>
</ul>
</li>
<li><!--[if lt IE 9]><span><![endif]--><a href="http://www.openclonk.org/download/" target="_top">Download</a><!--[if lt IE 9]></span><![endif]--> <ul>
<li><a href="http://www.openclonk.org/download/" target="_top">Latest Release</a></li>
<li><a href="http://www.openclonk.org/nightly-builds" target="_top">Development Snapshot</a></li>
<li><a href="http://www.openclonk.org/builds/release/" target="_top">Archive</a></li>
</ul>
</li>
<li><!--[if lt IE 9]><span><![endif]--><a href="http://forum.openclonk.org/" target="_top">Forum</a><!--[if lt IE 9]></span><![endif]--></li>
<li><!--[if lt IE 9]><span><![endif]--><a href="http://wiki.openclonk.org/w/Development" target="_top">Development</a><!--[if lt IE 9]></span><![endif]--> <ul>
<li><a href="http://bugs.openclonk.org" target="_top">Bugtracker</a></li>
<li><a href="http://hg.openclonk.org/openclonk/" target="_top">Repository</a></li>
<li><a href="http://hg.openclonk.org/openclonk-resources/" target="_top">Resource Repository</a></li>
</ul>
</li>
<li><!--[if lt IE 9]><span><![endif]--><a href="http://wiki.openclonk.org/w/C4Script_Documentation" target="_top">Documentation</a><!--[if lt IE 9]></span><![endif]--> <ul>
<li><a href="http://docs.openclonk.org/en/sdk/" target="_top">C4Script Reference</a></li>
</ul>
</li>
<li><!--[if lt IE 9]><span><![endif]--><a href="http://blog.openclonk.org/" target="_top">Blog</a><!--[if lt IE 9]></span><![endif]--></li>
</ul>
<div style="float:right">
<ul>
<li>
<a href="http://docs.openclonk.org/en/sdk/" target="_top"><img src="http://forum.openclonk.org/flags/gb.png"/></a>
</li>
<li>
<a href="http://docs.openclonk.org/de/sdk/" target="_top"><img src="http://forum.openclonk.org/flags/de.png"/></a>
</li>
</ul>
</div>
<div id="nav_logo">
<a href="http://www.openclonk.org/" target="_top"><img src="http://www.openclonk.org/header/logo.jpg" width="450" height="94" alt="OpenClonk"/></a>
</div>
<div id="nav_navigation">
<div id="nav_links">
<ul>
<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>
</div>
</header>

View File

@ -5,9 +5,9 @@
<doc>
<title>Command Line Parameters</title>
<h>Command Line Parameters</h>
<text>The installation directory of Clonk contains various executable program files. Usually programs are started with a double click or from a start menu without additional parameters. When starting programs from a command line shell or script file (batch file), additional command line parameters can be specified.</text>
<text>The installation directory of OpenClonk contains various executable program files. Usually programs are started with a double click or from a start menu without additional parameters. When starting programs from a command line shell or script file (batch file), additional command line parameters can be specified.</text>
<part>
<h id="Clonk">Clonk.exe (Windows) clonk (Linux) Clonk (Mac)</h>
<h id="Clonk">openclonk.exe (Windows) openclonk (Linux) Openclonk (Mac)</h>
<text>The engine. The main program of the game. Without startup parameters, the game starts in fullscreen (player mode) and shows the startup menu. The following command line parameters are recognized:</text>
<dl>
<dt id="editor">--editor</dt>
@ -82,7 +82,7 @@
</dd>
<dt id="recdump">--recdump=&lt;<em>Filename</em>&gt;</dt>
<dd>
<text>Only for replay of recorded games: Before the replay is started, all replay data (player controls) are dumped into a file called &lt;<em>File name</em>&gt; in the Clonk folder. If the file name extension is .txt, the controls will be dumped in text mode, otherwise binary. The replay file must be specified separately as a scenario file (e.g. Clonk.exe Records.ocf/Record001.ocs --recdump=CtrlRec.txt).</text>
<text>Only for replay of recorded games: Before the replay is started, all replay data (player controls) are dumped into a file called &lt;<em>File name</em>&gt; in the Clonk folder. If the file name extension is .txt, the controls will be dumped in text mode, otherwise binary. The replay file must be specified separately as a scenario file (e.g. openclonk.exe Records.ocf/Record001.ocs --recdump=CtrlRec.txt).</text>
</dd>
<dt id="startup">--startup=&lt;<em>Name</em>&gt;</dt>
<dd>
@ -108,7 +108,7 @@
</part>
<part>
<h id="C4Group">c4group.exe (Windows) c4group (Linux) c4group (Mac)</h>
<text>This command line program is used for processing group files. A list of command line options is available by starting the program without parameters via command line (<i>not</i> by double clicking).</text>
<text>This command line program is used for processing group files. A list of command line options is available by starting the program without parameters via command line (<em>not</em> by double clicking).</text>
</part>
<author>Sven2</author><date>2007-02</date>
<author>Günther</author><date>2011</date>

View File

@ -87,6 +87,7 @@
<li><emlink href="scenario/scenario.html">Scenario</emlink></li>
<li><emlink href="scenario/Teams.html">Multiplayer</emlink></li>
<li><emlink href="scenario/MapCreatorS2.html">Map Generator</emlink></li>
<li><emlink href="script/MapScript.html">Map Scripts</emlink></li>
<li><emlink href="scenario/script.html">Scripts</emlink></li>
</ul>
</li>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE doc
SYSTEM '../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
@ -15,6 +15,11 @@
<col>Data type</col>
<col>Description</col>
</rowh>
<row>
<literal_col>Prototype</literal_col>
<col>proplist</col>
<col>Must be Action. See below in the example.</col>
</row>
<row>
<literal_col>Name</literal_col>
<col>String</col>
@ -43,7 +48,7 @@
<row>
<literal_col>Directions</literal_col>
<col>Integer</col>
<col>Number of animation directions. Animation directions are arranged vertically in Graphics.png.</col>
<col>Number of animation directions. Animation directions are arranged vertically in Graphics.png. Default 1.</col>
</row>
<row>
<literal_col>FlipDir</literal_col>
@ -53,7 +58,7 @@
<row>
<literal_col>Length</literal_col>
<col>Integer</col>
<col>Number of animation phases for this activity (arranged horizontally in Graphics.png)</col>
<col>Number of animation phases for this activity (arranged horizontally in Graphics.png). Default 1.</col>
</row>
<row>
<literal_col>Reverse</literal_col>
@ -66,14 +71,44 @@
<col>Time difference in frames (ticks) between two animation phases.</col>
</row>
<row>
<literal_col>Attach</literal_col>
<literal_col>Step</literal_col>
<col>Integer</col>
<col>Attachment to surfaces: <emlink href="definition/cnat.html">CNAT Value</emlink>, e.g. value 8 if the object should attach to the floor like a walking clonk does; or 4 for attachment to the ceiling like a hangling clonk. Only evaluated if the procedure is NONE.</col>
<col>How many animation phases the animation should advance after Delay frames. Default 1.</col>
</row>
<row>
<literal_col>Facet</literal_col>
<col>6 integers</col>
<col>Animation graphics: Target rectangle from Graphics.png relative to upper left corner of unrotated object shape.</col>
<literal_col>Attach</literal_col>
<col>Integer</col>
<col>A bitmask for the attachment to surfaces. See <emlink href="definition/cnat.html">CNAT Values</emlink> for a documentation of possible values. Only evaluated if the procedure is NONE.</col>
</row>
<row>
<literal_col>X</literal_col>
<col>Integer</col>
<col>Animation graphics: X coordinate from Graphics.png.</col>
</row>
<row>
<literal_col>Y</literal_col>
<col>Integer</col>
<col>Animation graphics: Y coordinate from Graphics.png.</col>
</row>
<row>
<literal_col>Wdt</literal_col>
<col>Integer</col>
<col>Width of the animation graphic from Graphics.png.</col>
</row>
<row>
<literal_col>Hgt</literal_col>
<col>Integer</col>
<col>Height of the animation graphic from Graphics.png.</col>
</row>
<row>
<literal_col>OffX</literal_col>
<col>Integer</col>
<col>X-Offset at which to display the animation graphics.</col>
</row>
<row>
<literal_col>OffY</literal_col>
<col>Integer</col>
<col>Y-Offset at which to display the animation graphics.</col>
</row>
<row>
<literal_col>FacetBase</literal_col>
@ -87,13 +122,13 @@
</row>
<row>
<literal_col>FacetTargetStretch</literal_col>
<col>Boolean</col>
<col>Integer</col>
<col>0 or 1. If 1, the graphics will be stretched down towards the upper border of the ActionTarget. Used e.g. for the elevator line.</col>
</row>
<row>
<literal_col>NextAction</literal_col>
<col>String</col>
<col>Next action being set after the current one has reached its end.</col>
<col>Next action being set after the current one has reached its end. If it is not specified, the action will be kept and the animation phase resets to 0 and the animation begins anew. If it is "Hold", the action will also be kept but stops at the last animation frame. If it is "Idle", the object will have no action after this one.</col>
</row>
<row>
<literal_col>NoOtherAction</literal_col>
@ -102,22 +137,22 @@
</row>
<row>
<literal_col>StartCall</literal_col>
<col>String (max. 30 chars)</col>
<col>String</col>
<col>Object script function which is called when the activity is started.</col>
</row>
<row>
<literal_col>EndCall</literal_col>
<col>String (max. 30 chars)</col>
<col>String</col>
<col>Called when an activity reaches the end of its animation.</col>
</row>
<row>
<literal_col>PhaseCall</literal_col>
<col>String (max. 30 chars)</col>
<col>String</col>
<col>Called whenever the animation phase changes.</col>
</row>
<row>
<literal_col>AbortCall</literal_col>
<col>String (max. 30 chars)</col>
<col>String</col>
<col>Called if an activity is being replaced by another before its regular end; i.e. not by a transition through NextAction. Parameters are the previous animation phase, previous ActionTarget and previous ActionTarget2.</col>
</row>
<row>
@ -127,8 +162,8 @@
</row>
<row>
<literal_col>Sound</literal_col>
<col>String (max. 30 chars)</col>
<col>Permanent sound being played during this action.</col>
<col>String</col>
<col>Permanent sound being played during this action. The same can be achieved with <funclink>Sound</funclink> which is the more flexible solution.</col>
</row>
<row>
<literal_col>ObjectDisabled</literal_col>
@ -143,7 +178,7 @@
<row>
<literal_col>Animation</literal_col>
<col>String</col>
<col>Specifies the animation to be played in the mesh of the object. Works only if the object uses a mesh for its graphics. If given all of Facet, FacetBase, FacetTopFace and FacetTargetStretch are ignored. The Length times Delay possible animation phases are mapped linearly on the animation length. If Delay equals 0 only Length will be used and the animation does not play automatically. See <emlink href="definition/animations.html">Animationen</emlink> for further documentation on animations.</col>
<col>Specifies the animation to be played in the mesh of the object. Works only if the object uses a mesh for its graphics. If given all of Facet, FacetBase, FacetTopFace and FacetTargetStretch are ignored. The Length times Delay possible animation phases are mapped linearly on the animation length. If Delay equals 0 only Length will be used and the animation does not play automatically. See <emlink href="definition/animations.html">Animations</emlink> for further documentation on animations.</col>
</row>
</table>
</text>

View File

@ -40,6 +40,10 @@
<col><funclink>Anim_Y</funclink></col>
<col>Linear with Y position. When the object moves upwards the animation plays backwards. Can be used if the animation of an object should be synchronized to its vertical movement.</col>
</row>
<row>
<col><funclink>Anim_R</funclink></col>
<col>Linear with rotation. When the object rotates counter-clockwise the animation plays backwards. Can be used if the animation of an object should be synchronized to its rotation.</col>
</row>
<row>
<col><funclink>Anim_AbsX</funclink></col>
<col>Linear with X position. However, the animation is always played in the same direction, not taking into account whether the object moves left or right.</col>

View File

@ -6,82 +6,96 @@
<title>Object Categories</title>
<h>Object Categories</h>
<part>
<text>An object's category specifies parts of its behavior. For a definition it is set by the Category entry in the DefCore.txt file. Multiple categories can be combined using the binary OR operator.</text>
<text>An object's category specifies parts of its behavior. For a definition it is set by the <code id="Category">Category</code> entry in the DefCore.txt file. Multiple categories can be combined using the binary OR operator.</text>
<text>A category also specifies the default plane an object is drawn in if it doesn't specify this property itself. The higher the plane number, the further in the front an object is drawn. See <emlink href="definition/properties.html">Properties</emlink>.</text>
<text>
<table>
<rowh>
<col>Category</col>
<col>Description</col>
<col>Default plane</col>
</rowh>
<row>
<col>C4D_StaticBack</col>
<col>Immovable object.</col>
<col>100</col>
</row>
<row>
<col>C4D_Structure</col>
<col>Unused.</col>
<col>Structures.</col>
<col>200</col>
</row>
<row>
<col>C4D_Vehicle</col>
<col>Unused.</col>
<col>Vehicles.</col>
<col>300</col>
</row>
<row>
<col>C4D_Living</col>
<col>A living being.</col>
<col>400</col>
</row>
<row>
<col>C4D_Object</col>
<col>An item that can hit alive objects.</col>
<col>500</col>
</row>
<row>
<col>C4D_Goal</col>
<col>Game goal.</col>
<col></col>
</row>
<row>
<col>C4D_Environment</col>
<col>Environmental control object.</col>
<col></col>
</row>
<row>
<col>C4D_Rule</col>
<col>Rule control object.</col>
<col></col>
</row>
<row>
<col>C4D_Background</col>
<col>Object is behind the landscape.</col>
<col>Object is behind the landscape. Can be combined with any of the first 5 categories.</col>
<col>-600 (combined with C4D_StaticBack) to -100 (C4D_Object)</col>
</row>
<row>
<col>C4D_Parallax</col>
<col>Object moves parallax according to the Parallaxity property. For more information see <funclink>C4D_Parallax</funclink>.</col>
<col></col>
</row>
<row>
<col>C4D_MouseSelect</col>
<col>Object can be clicked with the mouse, causing a MouseSelection(int player) callback in the object.</col>
<col></col>
</row>
<row>
<col>C4D_Foreground</col>
<col>Object is always in the foreground, even before global particles.</col>
<col>+1100 (combined with C4D_StaticBack) to +1500 (C4D_Object)</col>
</row>
<row>
<col>C4D_MouseIgnore</col>
<col>Object cannot be selected with the mouse.</col>
<col></col>
</row>
<row>
<col>C4D_IgnoreFoW</col>
<col>Object is drawn above fog of war. Useful for creating status displays or gui elements using objects.</col>
<col></col>
</row>
</table>
</text>
<h id="Beispiel">Example</h>
<text>
<examples>
<example>
<code>Category=C4D_StaticBack|C4D_Rule</code>
<text>Category for a rule.</text>
</example>
</examples>
</text>
<h>Example</h>
<examples>
<example>
<code>Category=C4D_StaticBack|C4D_Rule</code>
<text>Category for a rule.</text>
</example>
</examples>
</part>
<author>Sven2</author><date>2006-05</date>
<author>Newton</author><date>2005-01</date>
<author>Günther</author><date>2005, 2011</date>
<date>2013-11</date>
</doc>

View File

@ -5,61 +5,45 @@
<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 CNAT 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>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>
<col>Bit</col>
<col>Value</col>
<col>CNAT</col>
<col>Description</col>
</rowh>
<row>
<col>0</col>
<col>1</col>
<col>CNAT_Left</col>
<col>Direction: Left</col>
</row>
<row>
<col>1</col>
<col>2</col>
<col>CNAT_Right</col>
<col>Direction: Right</col>
</row>
<row>
<col>2</col>
<col>4</col>
<col>CNAT_Top</col>
<col>Direction: Up</col>
</row>
<row>
<col>3</col>
<col>8</col>
<col>CNAT_Bottom</col>
<col>Direction: Down</col>
</row>
<row>
<col>4</col>
<col>16</col>
<col>CNAT_Center</col>
<col>Direction: Center (not for attachment)</col>
</row>
<row>
<col>5</col>
<col>32</col>
<col>CNAT_MultiAttach</col>
<col>Special flag: new attachment behaviour for objects with the same direction value at several vertices.</col>
</row>
<row>
<col>6</col>
<col>64</col>
<col>CNAT_NoCollision</col>
<col>Extra flag: non-colliding vertex</col>
</row>
<bitmask>CNAT</bitmask>
</table>
</text>
<author>Sven2</author><date>2002-04</date>
<author>Newton &amp; Günther</author><date>2005-01</date>
<author>Matthes</author><date>2005-08</date>
<text>A vertex can have multiple CNAT values, they can be combined them with the | operator. Example:</text>
<code>Attach = CNAT_Bottom | CNAT_Left</code>
<author>Newton</author><date>2013-11</date>
</doc>

View File

@ -25,31 +25,16 @@
<col>3 Integers</col>
<col>Minimal engine version required by the object. Should be always the current engine version at the time of the last change.</col>
</row>
<row>
<literal_col>Name</literal_col>
<col>String (max. 30 chars)</col>
<col>Name of the object. Will be overwritten by the applicable one in the Names.txt.</col>
</row>
<row>
<literal_col>RequireDef</literal_col>
<col>Definition IDs</col>
<col>List of definition IDs this object depends upon.</col>
</row>
<row>
<literal_col>Category</literal_col>
<col>Integer</col>
<col>Category of the object. Also see <emlink href="definition/category.html">object categories</emlink>.</col>
</row>
<row>
<literal_col>MaxUserSelect</literal_col>
<col>Integer</col>
<col>Maximal allowed count when placed in the menu system.</col>
</row>
<row>
<literal_col>TimerCall</literal_col>
<col>String (max. 30 chars)</col>
<col>Regularly called timer function in the <emlink href="definition/script.html">object script</emlink>.</col>
</row>
<row>
<literal_col>Timer</literal_col>
<col>Integer</col>
<col>Time interval between TimerCalls in frames. Default is 35.</col>
</row>
<row>
<literal_col>ContactCalls</literal_col>
<col>Integer</col>
@ -88,7 +73,7 @@
<row>
<literal_col>SolidMask</literal_col>
<col>6 integers</col>
<col>Solid areas of the object. Target rectangle from the source graphics onto the object.</col>
<col>Solid areas of the object. Target rectangle from the <emlink href="definition/index.html#SolidMask">SolidMask.png</emlink> graphics onto the object.</col>
</row>
<row>
<literal_col>TopFace</literal_col>
@ -140,36 +125,11 @@
<col>Integer</col>
<col>Flame distance to the object's bottom line.</col>
</row>
<row>
<literal_col>Placement</literal_col>
<col>Integer</col>
<col>Placement: 0 land surface, 1 in liquid, 2 in mid-air, 3 underground, 4 land surface and underground.</col>
</row>
<row>
<literal_col>Exclusive</literal_col>
<col>Integer</col>
<col>0 or 1. Determines whether the object blocks objects behind it.</col>
</row>
<row>
<literal_col>ContactIncinerate</literal_col>
<col>Integer</col>
<col>Probability of incineration by contact: 0 none, or 1 (high) to 5 (low).</col>
</row>
<row>
<literal_col>BlastIncinerate</literal_col>
<col>Integer</col>
<col>Incineration by explosion: 0 none, otherwise the damage level of incineration.</col>
</row>
<row>
<literal_col>BurnTo</literal_col>
<col>C4ID</col>
<col>Definition change upon incineration.</col>
</row>
<row>
<literal_col>Base</literal_col>
<col>Integer</col>
<col>0 or 1. Determines whether the building can be a home base.</col>
</row>
<row>
<literal_col>Line</literal_col>
<col>Integer</col>
@ -180,16 +140,6 @@
<col>Integer</col>
<col>0 or 1. If 1, the object is added to the player's crew upon purchase. Objects created using CreateObject have to be added to a player's crew manually using <emlink href="script/fn/MakeCrewMember">MakeCrewMember</emlink>.</col>
</row>
<row>
<literal_col>Growth</literal_col>
<col>Integer</col>
<col>Growth of the object. Trees 1-4, living beings 15.</col>
</row>
<row>
<literal_col>Rebuy</literal_col>
<col>Integer</col>
<col>0 or 1. Determines whether the object can be bought back after selling it.</col>
</row>
<row>
<literal_col>Construction</literal_col>
<col>Integer</col>
@ -200,31 +150,16 @@
<col>C4ID</col>
<col>Definition change upon building.</col>
</row>
<row>
<literal_col>Grab</literal_col>
<col>Integer</col>
<col>0 no grabbing, 1 grab and push, 2 grab only.</col>
</row>
<row>
<literal_col>GrabPutGet</literal_col>
<col>Integer</col>
<col>Bit mask: bit 0 (value 1) putting possible, bit 1 (value 2) getting possible.</col>
</row>
<row>
<literal_col>Collectible</literal_col>
<col>Integer</col>
<col>0 or 1. Determines whether the object can be collected.</col>
</row>
<row>
<literal_col>Rotate</literal_col>
<col>Integer</col>
<col>0 no rotation, 1 full rotation, 2-360 limited rotation.</col>
</row>
<row>
<literal_col>Chop</literal_col>
<col>Integer</col>
<col>0 or 1. Determines whether the object can be chopped.</col>
</row>
<row>
<literal_col>Float</literal_col>
<col>Integer</col>
@ -240,11 +175,6 @@
<col>Integer</col>
<col>0 or 1. If 1, the specified sections of the object's graphcis are colored by the player color.</col>
</row>
<row>
<literal_col>ColorByMaterial</literal_col>
<col>String (max. 15)</col>
<col>The object is colored by the color of the specified material.</col>
</row>
<row>
<literal_col>HorizontalFix</literal_col>
<col>Integer</col>
@ -265,16 +195,6 @@
<col>Integer</col>
<col>0 or 1. If 1, the uncomplete object (see <emlink href="script/fn/GetCon.html">GetCon</emlink>) is scaled, not sliced from the bottom like a construction site.</col>
</row>
<row>
<literal_col>Basement</literal_col>
<col>Integer</col>
<col>0 no basement, 1 normal basement, other values reserved.</col>
</row>
<row>
<literal_col>NoBurnDecay</literal_col>
<col>Integer</col>
<col>0 or 1. If 1, the object does not decompose if burning.</col>
</row>
<row>
<literal_col>IncompleteActivity</literal_col>
<col>Integer</col>
@ -330,25 +250,15 @@
<col>Integer</col>
<col>0 or 1. Can be used to prevent failure messages caused by failed commands.</col>
</row>
<row>
<literal_col>NoBurnDamage</literal_col>
<col>Integer</col>
<col>0 or 1. If 1, the object does not take damage when burning.</col>
</row>
<row>
<literal_col>TemporaryCrew</literal_col>
<col>Integer</col>
<col>0 or 1. If 1, the object is not stored in the permanent crew of a player.</col>
</row>
<row>
<literal_col>SmokeRate</literal_col>
<col>Integer</col>
<col>0 to 200: determines the amount of smoke caused by the burning object. 0 for no smoke, 100 is default. If other than 0, the object will always generate maximum smoke when traveling at high velocity (e.g. a fire arrow).</col>
</row>
<row>
<literal_col>BlitMode</literal_col>
<col>Integer</col>
<col>0 or 1. Value 1 for addtive drawing.</col>
<col>0 or 1. Value 1 for addtive drawing. Use <funclink>SetObjectBlitMode</funclink> for more flexibility.</col>
</row>
<row>
<literal_col>NoBreath</literal_col>
@ -360,11 +270,6 @@
<col>Integer</col>
<col>Values grater than 0 are deducted from the top of necessary construction space.</col>
</row>
<row>
<literal_col>NoSell</literal_col>
<col>Integer</col>
<col>0 or 1. If 1 the object can not be sold.</col>
</row>
<row>
<literal_col>NoGet</literal_col>
<col>Integer</col>
@ -390,115 +295,8 @@
<col>Integer</col>
<col>0 or 1. If 1 the object's pathfinding will ignore any transfer zones.</col>
</row>
<row>
<literal_col>AutoContextMenu</literal_col>
<col>Integer</col>
<col>0 or 1. If 1, the building's context menu will open automatically upon entry.</col>
</row>
</table>
</text>
<text>
<table>
<caption id="SektionPhysical">Section [Physical]</caption>
<rowh>
<col>Value</col>
<col>Data type</col>
<col>Description</col>
</rowh>
<row>
<literal_col>Energy</literal_col>
<col>Integer</col>
<col>0-100000. Maximum life energy.</col>
</row>
<row>
<literal_col>Breath</literal_col>
<col>Integer</col>
<col>0-100000. Maximum breath.</col>
</row>
<row>
<literal_col>Walk</literal_col>
<col>Integer</col>
<col>0-100000. Walking speed.</col>
</row>
<row>
<literal_col>Jump</literal_col>
<col>Integer</col>
<col>0-100000. Jump force.</col>
</row>
<row>
<literal_col>Scale</literal_col>
<col>Integer</col>
<col>0-100000. Scaling speed.</col>
</row>
<row>
<literal_col>Hangle</literal_col>
<col>Integer</col>
<col>0-100000. Hangling speed.</col>
</row>
<row>
<literal_col>Dig</literal_col>
<col>Integer</col>
<col>0-100000. Digging speed.</col>
</row>
<row>
<literal_col>Swim</literal_col>
<col>Integer</col>
<col>0-100000. Swimming speed.</col>
</row>
<row>
<literal_col>Throw</literal_col>
<col>Integer</col>
<col>0-100000. Throwing force.</col>
</row>
<row>
<literal_col>Push</literal_col>
<col>Integer</col>
<col>0-100000. Push power.</col>
</row>
<row>
<literal_col>Magic</literal_col>
<col>Integer</col>
<col>0-100000. Maximal magic energy.</col>
</row>
<row>
<literal_col>Float</literal_col>
<col>Integer</col>
<col>0-100. Flight speed.</col>
</row>
<row>
<literal_col>CanScale</literal_col>
<col>Integer</col>
<col>0 or 1. Scale.</col>
</row>
<row>
<literal_col>CanHangle</literal_col>
<col>Integer</col>
<col>0 or 1. Brachiation.</col>
</row>
<row>
<literal_col>CanDig</literal_col>
<col>Integer</col>
<col>0 or 1. Dig.</col>
</row>
<row>
<literal_col>CanConstruct</literal_col>
<col>Integer</col>
<col>0 or 1. Construct. If greater than 1, percentage construction speed. (100 normal, 50 half, etc.)</col>
</row>
<row>
<literal_col>CorrosionResist</literal_col>
<col>Integer</col>
<col>0 or 1. Determines wether the object resists acid.</col>
</row>
<row>
<literal_col>BreatheWater</literal_col>
<col>Integer</col>
<col>0 object breathes air, 1 object breathes water.</col>
</row>
</table>
</text>
<h>Note:</h>
<text>When a crew member is created, it gets an own physical section in it's Objectinfo (oci). In there, the individual changes to the physicals (for example because of training) are saved and restored when an object enters a player's crew. The physical section of the defcore is only used for new crew members and normal objects.</text>
</part>
<author>Sven2</author><date>2002-04</date>
<author>Newton</author><date>2013-11</date>
</doc>

View File

@ -38,6 +38,10 @@
<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>
<dt id="SolidMask"><img height="16" src="../../images/icon_image.png" width="16"/>SolidMask.png</dt>
<dd>
<text>Image describing areas in this object that are solid, so vertices of other objects will collide with it. Pixels are made solid if they are 50% or less transparent in this image. Source rectangle within this graphic and target position on the object must be set in <emlink href="definition/defcore.html">DefCore.txt</emlink> property "SolidMask" or using the script function <funclink>SetSolidMask</funclink>.</text>
</dd>
</dl>
<h id="MeshGraphics">3D Graphics</h>

View File

@ -6,7 +6,7 @@
<title>Meshes</title>
<h>Meshes</h>
<part>
<text>It is possible to directly use 3D models (meshes) as object graphics. To do so they need to be in OGRE format. For most modeling tools there exist exporter tools, a list can be found on the <a href="http://www.ogre3d.org/wiki/index.php/Exporters">OGRE Wiki</a>. Both the OGRE binary format (*.mesh) and the OGRE XML format(*.mesh.xml) are supported, however it is recommended to always use the binary format whenever possible since it is smaller in size and can be loaded more quickly by the engine. The tool <a href="http://www.ogre3d.org/wiki/index.php/OgreXmlConverter">OgreXMLConverter</a> can convert between the two formats.</text>
<text>It is possible to directly use 3D models (meshes) as object graphics. To do so they need to be in OGRE format. For most modeling tools there exist exporter tools, a list can be found on the <a href="http://www.ogre3d.org/tikiwiki/tiki-index.php?page=OGRE%20Exporters">OGRE Wiki</a>. Both the OGRE binary format (*.mesh) and the OGRE XML format(*.mesh.xml) are supported, however it is recommended to always use the binary format whenever possible since it is smaller in size and can be loaded more quickly by the engine. The tool <a href="http://www.ogre3d.org/tikiwiki/tiki-index.php?page=OgreXmlConverter">OgreXMLConverter</a> can convert between the two formats.</text>
<text>The exporter normally creates a mesh file (*.mesh or *.mesh.xml), a skeleton file (*.skeleton or *.skeleton.xml) if the mesh contains bones, a material script (*.material) and potentially used textures. To use the mesh as a Clonk object all generated files need to be copied into the <emlink href="definition/index.html">object definition</emlink> and the mesh file needs to be renamed to Graphics.mesh or Graphics.mesh.xml, respectively. Textures are supported in PNG, JPG and BMP format.</text>
<text>The mesh is not automatically scaled to the shape (i.e. the width and height values specified in <emlink href="definition/defcore.html">DefCore.txt</emlink>) of the object. Instead one unit in the modeling tool corresponds to one pixel in Clonk. This simplifies using the same magnitude of object sizes for all objects which is especially helpful for attaching meshes (see below). Also pay attention to the coordinate frame: The X axis in the mesh coordinate frame points out of the screen in Clonk, the Y axis points to the right and the Z axis points upwards.</text>
<h id="MaterialScripts">Material scripts</h>

View File

@ -21,91 +21,91 @@
<col>Action.Attach</col>
</row>
<row id="WALK">
<col>WALK</col>
<col>DFA_WALK</col>
<col>Walking</col>
<col>According to current <emlink href="script/fn/SetComDir.html">ComDir</emlink>.</col>
<col>CNAT_Bottom</col>
</row>
<row id="FLIGHT">
<col>FLIGHT</col>
<col>DFA_FLIGHT</col>
<col>Free fall</col>
<col>Only gravitational effects</col>
<col>CNAT_None</col>
</row>
<row id="KNEEL">
<col>KNEEL</col>
<col>DFA_KNEEL</col>
<col>Getting up</col>
<col>Behaviour according to <emlink href="definition/actmap.html">activity</emlink>.</col>
<col>CNAT_Bottom</col>
</row>
<row iD="SCALE">
<col>SCALE</col>
<row id="SCALE">
<col>DFA_SCALE</col>
<col>Scaling a wall</col>
<col>According to current <emlink href="script/fn/SetComDir.html">ComDir</emlink>.</col>
<col>CNAT_Left/Right</col>
</row>
<row id="HANGLE">
<col>HANGLE</col>
<col>DFA_HANGLE</col>
<col>Climbing on the ceiling</col>
<col>According to current <emlink href="script/fn/SetComDir.html">ComDir</emlink>.</col>
<col>CNAT_Top</col>
</row>
<row id="DIG">
<col>DIG</col>
<col>DFA_DIG</col>
<col>Dig</col>
<col>According to current <emlink href="script/fn/SetComDir.html">ComDir</emlink>. With <emlink href="script/fn/SetActionData.html">Data</emlink>=1 material chunks are dug free.</col>
<col>CNAT_None</col>
</row>
<row id="SWIM">
<col>SWIM</col>
<col>DFA_SWIM</col>
<col>Swimming</col>
<col>According to current <emlink href="script/fn/SetComDir.html">ComDir</emlink>.</col>
<col>CNAT_None</col>
</row>
<row id="THROW">
<col>THROW</col>
<col>DFA_THROW</col>
<col>Throw</col>
<col>Behaviour according to <emlink href="definition/actmap.html">activity</emlink>.</col>
<col>CNAT_Bottom</col>
</row>
<row id="BRIDGE">
<col>BRIDGE</col>
<col>DFA_BRIDGE</col>
<col>Bridge building</col>
<col>According to <emlink href="script/fn/SetComDir.html">ComDir</emlink>. Bridge material is a material number in <emlink href="script/fn/SetActionData.html">Data</emlink>.</col>
<col>CNAT_Bottom</col>
</row>
<row id="PUSH">
<col>PUSH</col>
<col>DFA_PUSH</col>
<col>Pushing</col>
<col>Pushes the <emlink href="script/fn/SetAction.html">target object </emlink> according to <emlink href="script/fn/SetComDir.html">ComDir</emlink>.</col>
<col>CNAT_Bottom</col>
</row>
<row id="LIFT">
<col>LIFT</col>
<col>DFA_LIFT</col>
<col>Lifting</col>
<col>Lifts the <emlink href="script/fn/SetAction.html">target object</emlink> according to <emlink href="script/fn/SetComDir.html">ComDir</emlink>.</col>
<col>CNAT_None</col>
</row>
<row id="FLOAT">
<col>FLOAT</col>
<col>DFA_FLOAT</col>
<col>Floating in mid-air</col>
<col>According to current <emlink href="script/fn/SetComDir.html">ComDir</emlink>.</col>
<col>CNAT_None</col>
</row>
<row id="ATTACH">
<col>ATTACH</col>
<col>DFA_ATTACH</col>
<col>Attachment to another object</col>
<col>Adjusts object position at vertex a to the position of vertex b of the <emlink href="script/fn/SetAction.html">target object</emlink>. a and b are the two low bytes of <emlink href="script/fn/SetActionData.html">ActionData</emlink> (see <emlink href="script/fn/SetActionData.html">SetActionData</emlink> for an example).</col>
<col>CNAT_None</col>
</row>
<row id="CONNECT">
<col>CONNECT</col>
<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">
<col>PULL</col>
<col>DFA_PULL</col>
<col>Pulling</col>
<col>Pulls the <emlink href="script/fn/SetAction.html">target object</emlink> according to <emlink href="script/fn/SetComDir.html">ComDir</emlink>.</col>
<col>CNAT_Bottom</col>

View File

@ -33,22 +33,22 @@ Stand = {
<row>
<col><code>Name</code></col>
<col>string</col>
<col></col>
<col>Name of the object. This string should be <emlink href="lang.html">internationalized</emlink>.</col>
</row>
<row>
<col><code>Collectible</code></col>
<col></col>
<col></col>
<col>bool</col>
<col>Whether the object can be picked up.</col>
</row>
<row>
<col><code>Touchable</code></col>
<col></col>
<col></col>
<col>int</col>
<col>1 the object can be grabbed, 2 the object can be grabbed and pushed</col>
</row>
<row>
<col><code>ActMap</code></col>
<col>proplist</col>
<col></col>
<col>See the <emlink href="definition/actmap.html">detailed description of the ActMap</emlink></col>
</row>
<row>
<col><code>Visibility</code></col>
@ -57,68 +57,73 @@ Stand = {
</row>
<row>
<col><code>LineColors</code></col>
<col></col>
<col></col>
<col>array</col>
<col>An array of two integers. The first denotes the color of the line and the second the color of the endpoints if the object is drawn as a line.</col>
</row>
<row>
<col><code>LineAttach</code></col>
<col></col>
<col></col>
</row>
<col>array</col>
<col>An array of two integers. Denotes the position of where the endpoint of the line is located relative to the object center.</col>
</row>
<row>
<col><code>PictureTransformation</code></col>
<col></col>
<col></col>
<col>array</col>
<col>If the object is a mesh, the picture graphic of the object can be transformed with this property. See <funclink>Trans_Mul</funclink> for an example.</col>
</row>
<row>
<col><code>MeshTransformation</code></col>
<col></col>
<col></col>
</row>
<row>
<col><code>MouseDragImage</code></col>
<col></col>
<col></col>
<col>array</col>
<col>If the object is a mesh, the ingame graphic of the object can be transformed with this property. See <funclink>Trans_Mul</funclink> for an example.</col>
</row>
<row>
<col><code>MouseDrag</code></col>
<col></col>
<col></col>
<col>bool</col>
<col>Whether the object can be dragged with the mouse. What exactly happens when an object is dragged onto another is defined in script.</col>
</row>
<row>
<col><code>Animation</code></col>
<col></col>
<col></col>
<col><code>MouseDragImage</code></col>
<col>id / object</col>
<col>The object or object id of which the picture should be displayed below the cursor while dragging.</col>
</row>
<row>
<col><code>Tooltip</code></col>
<col>string</col>
<col>A tooltip that is displayed for objects of the category <emlink href="definition/category.html">C4D_MouseSelect</emlink>. This string should be <emlink href="lang.html">internationalized</emlink>.</col>
</row>
<row>
<col><code>Action</code></col>
<col>proplist</col>
<col></col>
<col>The current action of the object as a proplist.</col>
</row>
<row>
<col><code>BreatheWater</code></col>
<col></col>
<col></col>
<col>bool</col>
<col>Whether the object breathes in water rather than air.</col>
</row>
<row>
<col><code>CorrosionResist</code></col>
<col></col>
<col></col>
<col>bool</col>
<col>Whether the alive object does not loose energy when in corrosive material.</col>
</row>
<row>
<col><code>MaxEnergy</code></col>
<col>int</col>
<col></col>
<col>Maximum life energy in a precision of 100.</col>
</row>
<row>
<col><code>MaxBreath</code></col>
<col>int</col>
<col></col>
<col>Maximum breath.</col>
</row>
<row>
<col><code>ThrowSpeed</code></col>
<col>int</col>
<col></col>
<col>Throwing speed in a precision of 100.</col>
</row>
<row>
<col><code>JumpSpeed</code></col>
<col>int</col>
<col>Jump speed in a precision of 100.</col>
</row>
<row id="Parallaxity">
<col><code>Parallaxity</code></col>
@ -129,6 +134,31 @@ Stand = {
<col><code>Plane</code></col>
<col>int</col>
<col>The Object's minor Z-Position. Negative values are behind the landscape, positive values before it. Use 1-399 for stuff behind Clonks, 401-999 for stuff before Clonks, and 1000+ for GUI objects.</col>
</row>
<row>
<literal_col>Placement</literal_col>
<col>Integer</col>
<col>Placement: 0 land surface, 1 in liquid, 2 in mid-air, 3 underground, 4 land surface and underground.</col>
</row>
<row>
<literal_col>BlastIncinerate</literal_col>
<col>Integer</col>
<col>Incineration by explosion: 0 none, otherwise the damage level that has to be reached until the object is incinerated. </col>
</row>
<row>
<literal_col>BurnTo</literal_col>
<col>C4ID</col>
<col>Definition change upon incineration.</col>
</row>
<row>
<literal_col>NoBurnDecay</literal_col>
<col>Integer</col>
<col>0 or 1. If 1, the object does not decompose if burning.</col>
</row>
<row>
<literal_col>ContactIncinerate</literal_col>
<col>Integer</col>
<col>Probability of incineration by contact: 0 none, or 1 (high) to 5 (low).</col>
</row>
</table>
</text>

View File

@ -15,8 +15,6 @@
}
</code>
<text>An object with this script will be given a rock right after it has been created. The Initialize function is called only when the object has reached full size (a building only when its construction has been completed and a living being only when it is fully grown).</text>
<h>TimerCall</h>
<text>Each object definition can define a timer call in its <emlink href="definition/defcore.html">DefCore</emlink>. The TimerCall is a function which will be called at regular intervals. The DefCore entry Timer determines the rate of calls. If no rate is specifed, the default value is 35 frames (roughly once per second).</text>
<h>ActMap</h>
<text>An active object can also define activity script calls in its <emlink href="definition/actmap.html">ActMap</emlink>. The defined StartCall is made whenever an action begins (or repeats), an EndCall is made at the end of each activity. PhaseCall is called at each animation phase step and should only be used for very short animations. The call frequency of PhaseCalls is determined by the speed of the animation.</text>
<h>#include</h>
@ -87,8 +85,8 @@
</row>
<row id="Damage">
<literal_col>Damage</literal_col>
<col>int change, int by_player</col>
<col>When the object is damage.</col>
<col>int change, int cause, int by_player</col>
<col>When the object is damaged. See <emlink href="script/Effects.html#damagecause">Fx*Damage</emlink>for <code>cause</code> values.</col>
</row>
<row id="DeepBreath">
<literal_col>DeepBreath</literal_col>
@ -145,8 +143,8 @@
<col>object obj, int x, int y</col>
<col>When an object (obj) using the internal pathfinding algorithm is trying to pass the transfer zone of this object on its way to point x/y. The transfer function can then help the object along by giving special script commands and returning <code>true</code>. Also see <emlink href="script/fn/SetTransferZone.html">SetTransferZone</emlink>().</col>
</row>
<row id="UpdateTransferZone">
<literal_col>UpdateTransferZone</literal_col>
<row id="OnSynchronized">
<literal_col>OnSynchronized</literal_col>
<col></col>
<col>When an object is loaded from a savegame or network synchronization is performed. Objects with a transfer zone should reset the zone in this call. Also see <emlink href="script/fn/SetTransferZone.html">SetTransferZone</emlink>().</col>
</row>
@ -325,12 +323,211 @@
<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="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></col>
<col>When object is deselected in editor. Use this callback to hide any information previously shown in EditCursorSelection.</col>
</row>
<row id="SaveScenarioObject">
<literal_col>SaveScenarioObject</literal_col>
<col>proplist props</col>
<col>Called when scenario is saved from the editor. Object should write creation of itself and properties to the buffer props. Return true if the object should be saved and false if saving of this object should be omitted. See <emlink href="definition/script.html#ScenSave">Scenario saving</emlink>.</col>
</row>
</table>
</text>
<h id="ScenSave">Scenario saving</h> <part>
<text>When the user chooses the "Save Scenario" option from the editor menu, the engine calls a global function SaveScenarioObjects defined in System.ocg/SaveScenario.c. This function writes all objects to the Objects.c file in their current state. The function stores all objects except the crew of currently joined human players and objects of a type that starts with GUI_. By default, objects are recreated using a call to <funclink>CreateObject</funclink> followed by setting a number of default properties like position, rotation, speed, action, if they are not in their default state.</text>
<text>For most object, the default saving method should be fine. However, it is possible to override the SaveScenarioObject callback to control how objects are created and which properties are set.</text>
<text>For example if a switch wants to save its target which is stored in a local variable called "target", the switch definition can override the callback:</text>
<code>local target;
func SetTarget(object new_target) { target = new_target; return true; }
func SaveScenarioObject(props)
{
if (!inherited(props, ...)) return false;
if (target) props->AddCall("Target", this, "SetTarget", target);
return true;
}</code>
<text>As a result, the generated Objects.c file will include the call to SetTarget if the switch is saved. Dependent objects should always either be passed to the AddCall function or stored as a string from the <funclink>MakeScenarioSaveName</funclink> function. If this is done, that object is marked as a dependency. The saving mechanism will ensure that any object this object depends on will be created before. In case of circular dependencies, the object property setting script is detached from object creation script.</text>
<text>If an object should not be saved in scenarios - for example, because it is just the helper of another object - the SaveScenarioObject callback should be overloaded to return false.</text>
<text>The object creation procedure can also be adjusted. For example, the waterfall object (defined in Objects.ocd/Environment.ocd/Waterfall.ocd) is created using the global functions CreateWaterfall and CreateLiquidDrain, which create a Waterfall object and attach an effect to it. To generate the creation functions from the effects, the waterfall overrides SaveScenarioObject:</text>
<code>func SaveScenarioObject(props)
{
if (!inherited(props, ...)) return false;
var fx_waterfall = GetEffect("IntWaterfall", this);
if (fx_waterfall)
{
props->RemoveCreation();
props->Add(SAVEOBJ_Creation, "CreateWaterfall(%d,%d,%d,%v)",fx_waterfall.X, fx_waterfall.Y, fx_waterfall.Strength, fx_waterfall.Material);
}
return true;
}</code>
<text>The call to RemoveCreation removes the existing object creation using <funclink>CreateObject</funclink>.</text>
<text>If you need access to one of the objects created in the editor, you can set its "StaticSaveVar" property to the name of a static variable. The InitializeObjects() function will then save the object in that variable.</text>
<text>The following table lists standard properties that are saved if their value is different from the default and if it is not removed using a props->Remove call.
<table>
<rowh>
<col>Property name</col>
<col>Default value</col>
<col>Description</col>
</rowh>
<row id="defprops_Alive">
<literal_col>Alive</literal_col>
<col>true</col>
<col>Category C4D_Living only: If object is not alive, a call to SetKill is stored. See <funclink>GetAlive</funclink> and <funclink>Kill</funclink>.</col>
</row>
<row id="defprops_Action">
<literal_col>Action</literal_col>
<col>this.DefaultAction</col>
<col>Action as retrieved using <funclink>GetAction</funclink> and set using <funclink>SetAction</funclink>. Includes ActionTargets. Not stored by default but only if <funclink>SaveScenarioObjectAction</funclink> is called.</col>
</row>
<row id="defprops_Phase">
<literal_col>Phase</literal_col>
<col>0</col>
<col>Action phase (see <funclink>GetPhase</funclink> and <funclink>SetPhase</funclink>). Not stored by default but only if <funclink>SaveScenarioObjectAction</funclink> is called.</col>
</row>
<row id="defprops_Dir">
<literal_col>Dir</literal_col>
<col>DIR_Left</col>
<col>Animation direction (see <funclink>GetDir</funclink> and <funclink>SetDir</funclink>)</col>
</row>
<row id="defprops_ComDir">
<literal_col>ComDir</literal_col>
<col>COMD_Stop</col>
<col>Commanded movement direction (see <funclink>GetComDir</funclink> and <funclink>SetComDir</funclink>)</col>
</row>
<row id="defprops_Con">
<literal_col>Con</literal_col>
<col>100</col>
<col>Construction percentage, i.e. object size (see <funclink>GetCon</funclink> and <funclink>SetCon</funclink>)</col>
</row>
<row id="defprops_Category">
<literal_col>Category</literal_col>
<col>GetID()->GetCategory()</col>
<col>Object category (see <funclink>GetCategory</funclink> and <funclink>SetCategory</funclink>)</col>
</row>
<row id="defprops_R">
<literal_col>R</literal_col>
<col>0</col>
<col>Rotation (see <funclink>GetR</funclink> and <funclink>SetR</funclink>)</col>
</row>
<row id="defprops_XDir">
<literal_col>XDir</literal_col>
<col>0</col>
<col>Horizontal speed (see <funclink>GetXDir</funclink> and <funclink>SetXDir</funclink>)</col>
</row>
<row id="defprops_YDir">
<literal_col>YDir</literal_col>
<col>0</col>
<col>Vertical speed (see <funclink>GetYDir</funclink> and <funclink>SetYDir</funclink>). Vertical speed is not saved it is very small and the object touches the ground to avoid saving of speed on idle objects.</col>
</row>
<row id="defprops_RDir">
<literal_col>RDir</literal_col>
<col>0</col>
<col>Rotation speed (see <funclink>GetRDir</funclink> and <funclink>SetRDir</funclink>)</col>
</row>
<row id="defprops_Color">
<literal_col>Color</literal_col>
<col>0, 0xffffffff</col>
<col>Object color of ColorByOwner-surfaces (see <funclink>GetColo</funclink> and <funclink>SetColor</funclink>)</col>
</row>
<row id="defprops_ClrModulation">
<literal_col>ClrModulation</literal_col>
<col>0, 0xffffffff</col>
<col>Object color modulation of all surfaces (see <funclink>GetClrModulation</funclink> and <funclink>SetClrModulation</funclink>)</col>
</row>
<row id="defprops_BlitMode">
<literal_col>BlitMode</literal_col>
<col>0</col>
<col>Object drawing mode (see <funclink>GetObjectBlitMode</funclink> and <funclink>SetObjectBlitMode</funclink>)</col>
</row>
<row id="defprops_Name">
<literal_col>Name</literal_col>
<col>GetID()->GetName()</col>
<col>Object name (see <funclink>GetName</funclink> and <funclink>SetName</funclink>)</col>
</row>
<row id="defprops_MaxEnergy">
<literal_col>MaxEnergy</literal_col>
<col>GetID().MaxEnergy</col>
<col>Maximum energy (see <emlink href="definition/properties.html">Properties</emlink>)</col>
</row>
<row id="defprops_Energy">
<literal_col>Energy</literal_col>
<col>GetID().MaxEnergy/1000</col>
<col>Current energy level (see <funclink>GetEnergy</funclink> and <funclink>DoEnergy</funclink>)</col>
</row>
<row id="defprops_Visibility">
<literal_col>Visibility</literal_col>
<col>VIS_All</col>
<col>Object visibility (see <emlink href="definition/properties.html">Properties</emlink>)</col>
</row>
<row id="defprops_Plane">
<literal_col>Plane</literal_col>
<col>GetID().Plane</col>
<col>Object plane, i.e. z-order (see <emlink href="definition/properties.html">Properties</emlink>)</col>
</row>
<row id="defprops_Position">
<literal_col>Position</literal_col>
<col></col>
<col>Object position. This is only set if the object has a rotation and could not be created directly at the correct offset (see <funclink>SetPosition</funclink>)</col>
</row>
<row id="defprops_Commands">
<literal_col>Command</literal_col>
<col>None</col>
<col>Stores only the topmost command of the chain (see <funclink>GetCommand</funclink> and <funclink>SetCommand</funclink>)</col>
</row>
<row id="defprops_Fire">
<literal_col>Fire</literal_col>
<col></col>
<col>Fire effect.</col>
</row>
</table>
</text>
<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)
{
// this is burning. Save incineration to scenario.
props->AddCall("Fire", obj, "Incinerate", fx.strength, fx.caused_by, fx.blasted, fx.incinerating_object);
return true;
}</code>
<text>obj and fx refer to the object and effect proplist as for any effect call. save_name is the variable name of the effected object and is unset for global effects.</text>
<h id="ScenSave">Scenario saving reference</h>
<text>The following functions are available to call on the "props" parameter passed to SaveScenarioObject callbacks:</text>
<h>AddCall</h>
<text><code>bool AddCall(string id, object target, string function, any par1, any par2, ...);</code></text>
<text>Adds a new call of format target->Function(par1, par2, ...) to the stored object script. Object parameters may be passed as is; strings must be quoted explicitely.</text>
<text>The id parameter is an identifier which can be used by derived objects to remove the property again.</text>
<h>Add</h>
<text><code>bool AddCall(string id, string script, any par1, any par2, ...);</code></text>
<text>Adds a custom script snippet of any format. script may contain format characters and parameters are formatted into the string using <funclink>Format</funclink>().</text>
<h>Remove</h>
<text><code>int Remove(string id);</code></text>
<text>Remove all strings added previously using AddCall or Add with the given ID. Can also be used to remove default properties. Returns number of script lines removed.</text>
<h>RemoveCreation</h>
<text><code>bool RemoveCreation();</code></text>
<text>Remove all strings added previously using with IDs SAVEOBJ_Creation or SAVEOBJ_ContentsCreation.</text>
<h>Clear</h>
<text><code>bool Clear();</code></text>
<text>Remove all creation and property setting strings.</text>
</part>
</part>
<author>sulai</author><date>2003-11</date>
<author>Sven2</author><date>2004-02</date>
<author>matthes</author><date>2004-07</date>
<author>Clonkonaut</author><date>2008-04</date>
<author>Sven2</author><date>2013-12</date>
</doc>

View File

@ -158,7 +158,7 @@
</text>
<text>The image is always stretched to the full available screen area. All coordinates given for section elements are relative to the unstretched background image.</text>
<h id="devel">Useful Hints</h>
<text>For testing purposes a folder map can be loaded from an unpacked scenario folder and reloaded an runtime using F5. If the classic scenario selection appears instead of the folder map, an error has occured in the folder map declaration, such as missing image files. With debug mode activated, there will also be an error message in Clonk.log.</text>
<text>For testing purposes a folder map can be loaded from an unpacked scenario folder and reloaded an runtime using F5. If the classic scenario selection appears instead of the folder map, an error has occured in the folder map declaration, such as missing image files. With debug mode activated, there will also be an error message in OpenClonk.log.</text>
</part>
<author>Sven2</author><date>2006-09</date>
</doc>

View File

@ -23,7 +23,7 @@
<row>
<col>ColorAnimation</col>
<col>Integer</col>
<col>0 oder 1. Color animation.</col>
<col>0 or 1. Color animation.</col>
</row>
<row>
<col>Shape</col>
@ -33,7 +33,7 @@
<row>
<col>Density</col>
<col>Integer</col>
<col>Density: 50 solid, 25 liquid (other values not allowed).</col>
<col>A density of 25 and above is liquid. 50 and above is solid. <funclink>BlastFree</funclink> offers a parameter to only blast solid materials of a given density or lower.</col>
</row>
<row>
<col>Friction</col>
@ -43,12 +43,12 @@
<row>
<col>DigFree</col>
<col>Integer</col>
<col>0 oder 1. Determines wether the material can be dug into.</col>
<col>0 or 1. Determines wether the material can be dug into.</col>
</row>
<row>
<col>BlastFree</col>
<col>Integer</col>
<col>0 oder 1. Determines whether the material can be blasted away.</col>
<col>0 or 1. Determines whether the material can be blasted away.</col>
</row>
<row>
<col>Blast2Object</col>
@ -83,7 +83,7 @@
<row>
<col>Instable</col>
<col>Integer</col>
<col>0 oder 1. Stability.</col>
<col>0 or 1. Stability.</col>
</row>
<row>
<col>MaxAirSpeed</col>

View File

@ -7,7 +7,7 @@
<h>Particle</h>
<part>
<text>Particles are lightweight objects which are not synchronized in a network game. This means that on the one hand you can create huge amounts of particles without slowing down the game too much but on the other hand there are only limited options for control of particle behaviour. If the particles are not sufficient for a given effect you have in mind, you can always use true objects instead.</text>
<text>If a particle is defined in a ocd group, any object definition located in the same group is ignored. This used to be a way to allow loading of placeholder options in the old graphics system which didn't support particles.</text>
<text>If a particle is defined in a ocd group, any object definition located in the same group is ignored.</text>
<text>Particles are not stored in savegames and are designed for temporary visual effects only.</text>
<h id="PartikelKomponentenOCD">Particle Components (ocd)</h>
<dl>
@ -34,190 +34,120 @@
<row>
<col>Name</col>
<col>String (max. 30 chars)</col>
<col>Name of the particle definition. This name is also used to refer to this particle type in scripts. For multi-language display in the menu system you should use the Names.txt component.</col>
</row>
<row>
<col>MaxCount</col>
<col>Integer</col>
<col>Maximum number of instances of this particle type. See <a href="#maxcount">instance control</a>.</col>
</row>
<row>
<col>MinLifetime</col>
<col>Integer</col>
<col>Only for smoke particles: lower limit for the lifetime, which ranges from MinLifetime to MaxLifetime.</col>
</row>
<row>
<col>MaxLifetime</col>
<col>Integer</col>
<col>Only for smoke particles: upper limit for the lifetime, which ranges from MinLifetime to MaxLifetime.</col>
</row>
<row>
<col>InitFn</col>
<col>String (max. 30 chars)</col>
<col>Identifier for the function used to initialize the particle. For valid functions see section <a href="#funcs">particle functions</a>.</col>
</row>
<row>
<col>ExecFn</col>
<col>String (max. 30 chars)</col>
<col>Identifier for the function used to execute the particle each frame. For valid functions see section <a href="#funcs">particle functions</a>.</col>
</row>
<row>
<col>DrawFn</col>
<col>String (max. 30 chars)</col>
<col>Identifier for the function used to draw the particle. For valid functions see section <a href="#drawfuncs">drawing functions</a>.</col>
</row>
<row>
<col>CollisionFn</col>
<col>String (max. 30 chars)</col>
<col>Identifier for the function called upon collision with the landscape. Also see <a href="#collision">collision checking</a>.</col>
<col>Name of the particle definition. This name is also used to refer to this particle type in scripts.</col>
</row>
<row>
<col>Face</col>
<col>6 integers</col>
<col>4 integers</col>
<col>Target rectangle for the graphics within Graphics.png. See <a href="#face">particle graphics</a>.</col>
</row>
<row>
<col>YOff</col>
<col>Integer</col>
<col>Upper spatial limit for the particle. At this limit the particles will be deleted as if the landscape would end here. Only StdExec.</col>
</row>
<row>
<col>Delay</col>
<col>Integer</col>
<col>Delay between two animation phases. If Delay = 0 one randomly chosen phase is permanently displayed.</col>
</row>
<row>
<col>Repeats</col>
<col>Integer</col>
<col>Number of animation runs until the particle is destroyed.</col>
</row>
<row>
<col>Reverse</col>
<col>Integer</col>
<col>0 or 1. If 1 every seconds animation is played backwards.</col>
</row>
<row>
<col>FadeOutLen</col>
<col>Integer</col>
<col>If specified, this number of animation phases is truncated from the end and reserved for a death animation which is displayed after all repetitions of the standard animation.</col>
</row>
<row>
<col>FadeOutDelay</col>
<col>Integer</col>
<col>Delay between two animation phases of the death animation.</col>
</row>
<row>
<col>RByV</col>
<col>Integer</col>
<col>0 to 3. 0 for no particle rotation. If 1 the particle will be aligned to its direction of travel; the particle's up-side will be in front. If 2 the speed parameters only determine rotation; the particle will not move. If 3 a random rotation is applied.</col>
</row>
<row>
<col>GravityAcc</col>
<col>Integer</col>
<col>Effects of gravity. At 0 the particle is not affected by gravity, at 100 it is fully affected. Negative values are also possible.</col>
</row>
<row>
<col>WindDrift</col>
<col>Integer</col>
<col>Horizontal drift by wind. Same as the material property of the same name.</col>
</row>
<row>
<col>VertexCount</col>
<col>Integer</col>
<col>0 or 1. If 1, <a href="#collision">collision detection</a> is done.</col>
</row>
<row>
<col>VertexY</col>
<col>Integer</col>
<col>Y offset of the collision checking point in percent. Also see <a href="#collision">collision detection</a>.</col>
</row>
<row>
<col>Additive</col>
<col>Integer</col>
<col>0 or 1. If 1, the particle is drawn additively.</col>
</row>
<row>
<col>AlphaFade</col>
<col>Integer</col>
<col>0 to 40. Rate of fade out per FadeDelay. A fully faded particle is removed.</col>
</row>
<row>
<col>FadeDelay</col>
<col>Integer</col>
<col>The default is 1.</col>
</row>
<row>
<col>Parallaxity</col>
<col>2 Integer</col>
<col>Parallaxity in x and y directions. 0 is locked with the viewport; 100 is default (locked with the landscape).</col>
</row>
<row>
<col>Attach</col>
<col>Integer</col>
<col>0 or 1. If 1 the particle is moving relative to its target object's position.</col>
</row>
</table>
</text>
<h id="attributes">Properties</h>
<text>Each particle has a position (x, y), horizontal and vertical impulse (xdir and ydir), life time (life), and two extra parameters (a and b). These are initialized by script and then processed by the <a href="#funcs">particle functions</a>. For more information see <a href="#funcs">particle functions</a> and <a href="#drawfuncs">drawing functions</a>.</text>
<h id="face">Graphics</h>
<text>The coordinates for the source rectangle within Graphics.png of a particle are comparable to the Face entry in an object's <emlink href="definition/actmap.html">ActMap</emlink>. The coordinates only specify the first animation phase. All following animation phases should be located on the right (with smoke also below) of the initial phase. The animation length is then automatically determined from the image size. For the drawing offset you should usually specify half the particle size. An offset 0/0 would cause the particle graphics to be drawn below actual particle position.</text>
<text>If Delay = 0, a random animation phase is chosen on startup and maintained. The particle will exist until is falls out of the landscape.</text>
<h id="maxcount">Particle Amounts</h>
<text>For each particle type a maximum count is defined which is then also adjusted by the configuration setting for effect levels in the graphics options. As soon as half of the maximum amount of particles is created, new particles are only created based on random selected and the closer you get to the maximum value, the smaller the chance of new particle generation. This ensures a smooth approach to the actual limit.</text>
<h id="collision">Collision Detection</h>
<text>Particles can collide with the landscape. This is not very exact, however. Fast moving particles might pass through very thin layers of solid materials. If you need more precision, you should use objects instead.</text>
<text>Collision detection is only done in StdExec (i.e. not with smoke particles). For valid functions see <a href="#funcs">particle functions</a>. Collision detection is done at the particle center and only if VertexCount is specified. The point of detection can be shifted using VertexY. The specified values are in percent of the particle size, meaning VertexY=100 would check at the bottom of the particle. The visual size specified in Face doesn't affect this.</text>
<h id="funcs">Particle Functions</h>
<text>The behaviour of particles can be controlled by predefined particle functions. These are executed for initialization, then at each fram, and in case of <a href="#collision">collision</a> with the landscape.</text>
<dl>
<dt id="stdexec">StdExec</dt>
<dd>
<text>Standard function ExecFn for almost all particle types. The particle runs through an animation defined by Face, Delay, Repeats, Reverse, FadeOutLen, and FadeOutDelay and is then destroyed. The extra parameter defines the size of the particle in 1/10 pixels. b defines color modulation; if b = 0 no modulation is applied. aa as well as b are not modified by this function and will preserve the <a href="#control">initial</a> values. Also, the particle moves according to xdir and ydir while ydir is affected by gravity if GravityAcc is enabled.</text>
</dd>
<dt id="stdinit">StdInit</dt>
<dd>
<text>Standard function for InitFn to be used with StdExec.</text>
</dd>
<dt id="bounce">Bounce</dt>
<dd>
<text>Collision function: the particle will bounce back into the exact opposite direction.</text>
</dd>
<dt id="bouncey">BounceY</dt>
<dd>
<text>Collision function: the particle will bounce back vertically.</text>
</dd>
<dt id="stop">Stop</dt>
<dd>
<text>Collision function: the particle will stop.</text>
</dd>
<dt id="die">Die</dt>
<dd>
<text>Collision function: the particle will be destroyed.</text>
</dd>
<dt id="smokeexec">SmokeExec</dt>
<dd>
<text>Hard coded processing function for smoke particles. a is puff size; b is color modulation. Smoke graphics must be defined in 4 x 4 animation phases in Graphics.png of which the one on the lower right is used only rarely. The other animation phases are used evenly. Smoke always rises continuously until it collides with the landscape. If the life time has passed, the smoke particle fades out until it is deleted.</text>
</dd>
<dt id="smokeinit">SmokeInit</dt>
<dd>
<text>Hard coded initialization function for smoke to be used in conjunction with SmokeExec.</text>
</dd>
</dl>
<h id="drawfuncs">Drawing Functions</h>
<text>Functions that can be assigned to DrawFn.</text>
<dl>
<dt id="drawstd">Std</dt>
<dd>
<text>Standard function for most particles except smoke. The particle is drawn at position x/y with size a/5 x a/5 and color modulated with b.</text>
</dd>
<dt id="drawsmoke">Smoke</dt>
<dd>
<text>Drawing function for smoke.</text>
</dd>
</dl>
<h id="control">Control</h>
<text>External control of particles is very limited and only allows creation, global offset, and global removal. This is necessary as particles are not synchronized on computers throughout a network game and any deviation in particle handling would cause sync loss. Particles are created using <funclink>CreateParticle</funclink>.</text>
<h id="face">Graphics</h>
<text>The coordinates for the source rectangle within Graphics.png of a particle specify the first phase of the particle graphics the other phases should follow to the right and can be continued in the next row. The animation length is then automatically determined from the image size.</text>
<h id="properties">Properties</h>
<text>Each particle has different attributes like position, lifetime, size and more. These are set by script when creating the particle.</text>
<text>The following properties can be contained in a proplist passed to <funclink>CreateParticle</funclink>. For an example, see <funclink>CreateParticle</funclink></text>
<text>You can assign either constants to the properties (f.e. <code>R = 200</code>) or use certain value provider functions (f.e. <code>R = <funclink>PV_Linear</funclink>(200, 0)</code>). Available value provider functions are:
<funclink>PV_Linear</funclink>
<funclink>PV_Direction</funclink>
<funclink>PV_Random</funclink>
<funclink>PV_Step</funclink>
<funclink>PV_Speed</funclink>
<funclink>PV_KeyFrames</funclink>
<funclink>PV_Wind</funclink>
<funclink>PV_Gravity</funclink>
</text>
<text>
<table>
<caption id="particledef">Particle definition proplist</caption>
<rowh>
<col>Name</col>
<col>Values</col>
<col>Description</col>
</rowh>
<row>
<col>R</col>
<col>0 to 255</col>
<col>Red part of the color modulation.</col>
</row>
<row>
<col>G</col>
<col>0 to 255</col>
<col>Green part of the color modulation.</col>
</row>
<row>
<col>B</col>
<col>0 to 255</col>
<col>Blue part of the color modulation.</col>
</row>
<row>
<col>Alpha</col>
<col>0 to 255</col>
<col>Alpha part of the color modulation.</col>
</row>
<row>
<col>Size</col>
<col>pixels</col>
<col>Size of the particle in pixels.</col>
</row>
<row>
<col>Stretch</col>
<col>factor</col>
<col>The vertical stretch of the particle. 1000 equals no stretch.</col>
</row>
<row>
<col>Phase</col>
<col>Index of phase</col>
<col>The displayed phase of the particle from the Graphics.png. The index starts at 0 and will be wrapped.</col>
</row>
<row>
<col>Rotation</col>
<col>0 to 360</col>
<col>Rotation of the particle.</col>
</row>
<row>
<col>ForceX</col>
<col>Integer</col>
<col>Force in x-direction that is constantly applied to the particle's speed. Can f.e. simulate wind.</col>
</row>
<row>
<col>ForceY</col>
<col>Integer</col>
<col>Force in y-direction that is constantly applied to the particle's speed. Ca f.e. simulate gravity.</col>
</row>
<row>
<col>DampingX</col>
<col>0 to 1000</col>
<col>Damping of the particle's speed in x-direction. 1000 means no damping, 0 means instant stop.</col>
</row>
<row>
<col>DampingY</col>
<col>0 to 1000</col>
<col>Damping of the particle's speed in y-direction. 1000 means no damping, 0 means instant stop.</col>
</row>
<row>
<col>BlitMode</col>
<col>0 or GFX_BLIT_Additive</col>
<col>The particle's blit mode. Currently only additive blitting is supported.</col>
</row>
<row>
<col>CollisionVertex</col>
<col>0 to 1000</col>
<col>The offset of the particle's hit point relative to its width. When set, the particle will collide with the landscape. 0 means the particle will collide with its center.</col>
</row>
<row>
<col>OnCollision</col>
<col><funclink>PC_Die</funclink>, <funclink>PC_Bounce</funclink>, <funclink>PC_Stop</funclink></col>
<col>Defines what happens when the particle collides with the landscape.</col>
</row>
<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</code></col>
</row>
</table>
</text>
</part>
<author>Sven2</author><date>2002-04</date>
<author>Zapper</author><date>2013-10</date>
</doc>

View File

@ -8,204 +8,256 @@
<part>
<text>The engine allows to define control commands completely arbitrarily. Own keyboard commands can be added and modified. All supported input devices such as mouse, keyboard and gamepads can be mapped freely and commands can consist of any key combinations or sequences.</text>
<h id="ControlFiles">PlayerControls.txt</h>
<text>All control commands which a player can send to the game are defined in the file PlayerControls.txt. The standard keys as well as their standard mapping for various input devices are contained in the global definition file in the Systems.ocg folder. Object definitions and scenarios can add more keys or overload the parameters of existing commands in their local Systems.ocg folder**.</text>
<text>Additional PlayerControls.txt files can be put in language packages to adapt the standard key mappings of different loaded languages to the keyboard of their respective country**.</text>
<text>All control commands which a player can send to the game are defined in the file PlayerControls.txt. The standard keys as well as their standard mapping for various input devices are contained in the global definition file in the Systems.ocg folder. Object definitions and scenarios can add more keys or overload the parameters of existing commands in their local Systems.ocg folder.</text>
<part>
<h id="ControlDefs">Section [ControlDefs]</h>
<text>
Definition of possible player commands. Not valid in language packages. Subordinated to this section:
<text>
<table>
<caption id="ControlDef">Any number of sections [ControlDef]</caption>
<rowh>
<col>Value</col>
<col>Data type</col>
<col>Description</col>
</rowh>
<row>
<literal_col>Identifier</literal_col>
<col>String (max. 96 chars)</col>
<col>Internally used name for identification of the command. The command is referenced by that name in standard mappings and it is predefined in script as CON_Name. The name should therefore be a valid identifier in script, i.e. only consist of letters, numbers and _. Especially there should be no space characters or German umlauts. To avoid conflicts the same rules as for object IDs apply for definitions local to a certain scenario or object.</col>
</row>
<row>
<literal_col>GUIName</literal_col>
<col>String</col>
<col>Name which is shown to the player in the control configuration dialog and in control tooltips. Localized strings from the corresponding string table can be used ($Name$).</col>
</row>
<row>
<literal_col>GUIDesc</literal_col>
<col>String</col>
<col>Informative description which is displayed to the player in the control configuration dialog. Lokalisierte Zeichenketten koennen aus dem zugehoerigen StringTable refeenziert werden ($Name$).</col>
</row>
<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.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.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.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.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.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.xml#ExtraData">ExtraData</emlink>.</col>
</row>
<row>
<literal_col>SendCursorPos</literal_col>
<col>Boolean</col>
<col>If true then the GUI mouse position at the time of triggering the command will be sent as a separate CON_CursorPos command. If the mouse is not activated then the cursor position in GUI coordinates is transmitted.</col>
</row>
<row>
<literal_col>Action</literal_col>
<col>String</col>
<col>
Action to be executed for this command. Possible values:
<text>
<table>
<rowh>
<col>Value</col>
<col>Description</col>
</rowh>
<row>
<literal_col>None</literal_col>
<col>No action.</col>
</row>
<row>
<literal_col>Script</literal_col>
<col>Execution of the script function <em>PlayerControl</em>. See <emlink href="playercontrols.xml#Script">Script callbacks</emlink>. (Default value)</col>
</row>
<row>
<literal_col>Menu</literal_col>
<col>Open the player menu (asynchronous command).</col>
</row>
<row>
<literal_col>MenuOK</literal_col>
<col>Confirmation of the selected item in the player menu (asynchronous command).</col>
</row>
<row>
<literal_col>MenuCancel</literal_col>
<col>Close the player menu (asynchronous command).</col>
</row>
<row>
<literal_col>MenuLeft / MenuUp / MenuRight / MenuDown</literal_col>
<col>Navigation in the player menu (asynchronous command).</col>
</row>
</table>
</text>
</col>
</row>
</table>
</text>
Definition of possible player commands. Subordinated to this section:
</text>
<h id="ControlSets">Section [ControlSets]</h>
<text>
Definition of standard control mappings.
<text>
<table>
<caption id="ControlSet">Any number of sections [ControlSet]</caption>
<rowh>
<col>Value</col>
<col>Data type</col>
<col>Description</col>
</rowh>
<row>
<literal_col>Name</literal_col>
<col>String</col>
<col>Internal name for identification of otherwise equal control mappings. The names of the standard mappings are <em>Keyboard1</em>, <em>Keyboard1Classic</em>, <em>Keyboard2</em>, <em>Keyboard2Classic</em>, <em>Gamepad</em>. By using placeholders (*) keys can directly be defined in multiple mappings**.</col>
</row>
</table>
<text>
<table>
<caption id="ControlDef">Any number of sections [ControlDef]</caption>
<rowh>
<col>Value</col>
<col>Data type</col>
<col>Description</col>
</rowh>
<row>
<literal_col>Identifier</literal_col>
<col>String (max. 96 chars)</col>
<col>Internally used name for identification of the command. The command is referenced by that name in standard mappings and it is predefined in script as CON_Name. The name should therefore be a valid identifier in script, i.e. only consist of letters, numbers and _. Especially there should be no space characters or German umlauts. To avoid conflicts the same rules as for object IDs apply for definitions local to a certain scenario or object.</col>
</row>
<row>
<literal_col>GUIName</literal_col>
<col>String</col>
<col>Name which is shown to the player in the control configuration dialog and in control tooltips. Localized strings from the corresponding string table can be used ($Name$).</col>
</row>
<row>
<literal_col>GUIDesc</literal_col>
<col>String</col>
<col>Informative description which is displayed to the player in the control configuration dialog. Localized strings from the corresponding string table can be used ($Desc$).</col>
</row>
<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.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.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.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.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.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.xml#ExtraData">ExtraData</emlink>.</col>
</row>
<row>
<literal_col>SendCursorPos</literal_col>
<col>Boolean</col>
<col>If true then the GUI mouse position at the time of triggering the command will be sent as a separate CON_CursorPos command. If the mouse is not activated then the cursor position in GUI coordinates is transmitted.</col>
</row>
<row>
<literal_col>Action</literal_col>
<col>String</col>
<col>
<text>
Action to be executed for this command. Possible values:
</text>
<table>
<caption id="Assignment">Any number of sections [Assignment]</caption>
<rowh>
<col>Value</col>
<col>Data type</col>
<col>Description</col>
</rowh>
<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.xml#Keys">Key mappings</emlink>.</col>
<literal_col>None</literal_col>
<col>No action.</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.xml#Keys">Key mappings</emlink>.</col>
<literal_col>Script</literal_col>
<col>Execution of the script function <em>PlayerControl</em>. See <emlink href="playercontrols.xml#Script">Script callbacks</emlink>. (Default value)</col>
</row>
<row>
<literal_col>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.xml#ControlDef">[ControlDef]</emlink>.</col>
<literal_col>ZoomIn</literal_col>
<col>Zoom in one unit</col>
</row>
<row>
<literal_col>Priority</literal_col>
<col>Integer</col>
<col>Priority of the mapping. If more than once mapping is using the same keys then the key with the highest priority is executed first until a command is treated as handled.</col>
<literal_col>ZoomOut</literal_col>
<col>Zoom out one unit</col>
</row>
<row>
<literal_col>TriggerMode</literal_col>
<col>bitmask</col>
<col>
Trigger mode of this mapping. Bitmask based on the following values:
<text>
<table>
<rowh>
<col>Value</col>
<col>Description</col>
</rowh>
<row>
<col>Default value</col>
<col>No particular action.</col>
</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.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.xml#Hold">Held keys</emlink>.</col>
</row>
<row>
<literal_col>AlwaysUnhandled</literal_col>
<col>The key press is always passed to the mapping with the next lowest priority, independent of whether the previous command was executed successfully or not.</col>
</row>
<row>
<literal_col>ToggleUnhandled</literal_col>
<col>The keypress is passed to the mapping with the next lower priority only if the previous command was executed successfully. This can be used to define macros. **</col>
</row>
<row>
<literal_col>OverrideAssignments</literal_col>
<col>The assignment overwrites all other assignments for the same control with the same press/release trigger mode.</col>
</row>
</table>
</text>
</col>
<literal_col>Menu</literal_col>
<col>Open the player menu (asynchronous command).</col>
</row>
<row>
<literal_col>MenuOK</literal_col>
<col>Confirmation of the selected item in the player menu (asynchronous command).</col>
</row>
<row>
<literal_col>MenuCancel</literal_col>
<col>Close the player menu (asynchronous command).</col>
</row>
<row>
<literal_col>MenuLeft / MenuUp / MenuRight / MenuDown</literal_col>
<col>Navigation in the player menu (asynchronous command).</col>
</row>
<row>
<literal_col>ObjectMenuOK / ObjectMenuSelect / ObjectMenuOKAll</literal_col>
<col>Confirmation of the selected item in a menu (synchronous command).</col>
</row>
<row>
<literal_col>ObjectMenuCancel</literal_col>
<col>Close a menu (synchronous command).</col>
</row>
<row>
<literal_col>ObjectMenuLeft / ObjectMenuUp / ObjectMenuRight / ObjectMenuDown</literal_col>
<col>Navigation in a menu (synchronous command).</col>
</row>
</table>
</text>
</text>
</col>
</row>
</table>
<h id="ControlSets">Section [ControlSets]</h>
<text>
Definition of standard control mappings.
</text>
<table>
<caption id="ControlSet">Any number of sections [ControlSet]</caption>
<rowh>
<col>Value</col>
<col>Data type</col>
<col>Description</col>
</rowh>
<row>
<literal_col>Name</literal_col>
<col>String</col>
<col>Internal name for identification of otherwise equal control mappings. By using placeholders (*) keys can directly be defined in multiple mappings.</col>
</row>
<row>
<literal_col>GUIName</literal_col>
<col>String</col>
<col>Name for the control assignment set which is shown to the player in the control configuration dialog.</col>
</row>
<row>
<literal_col>Keyboard</literal_col>
<col>Boolean</col>
<col>Whether this control assignment set uses the keyboard. Default 1.</col>
</row>
<row>
<literal_col>Mouse</literal_col>
<col>Boolean</col>
<col>Whether this control assignment set uses the mouse. Default 1.</col>
</row>
<row>
<literal_col>Gamepad</literal_col>
<col>Boolean</col>
<col>Whether this control assignment set uses the gamepad. Default 0.</col>
</row>
</table>
<table>
<caption id="Assignment">Any number of sections [Assignment]</caption>
<rowh>
<col>Value</col>
<col>Data type</col>
<col>Description</col>
</rowh>
<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.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.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.xml#ControlDef">[ControlDef]</emlink>.</col>
</row>
<row>
<literal_col>GUIName</literal_col>
<col>String</col>
<col>Name which is shown to the player in the control configuration dialog and in control tooltips. Localized strings from the corresponding string table can be used ($Name$). If unset, GUIName of the control def is used. If set to "None", the control is not displayed in the user customization dialog even if the control def has a name set.</col>
</row>
<row>
<literal_col>GUIDesc</literal_col>
<col>String</col>
<col>Informative description which is displayed to the player in the control configuration dialog. Lokalisierte Zeichenketten koennen aus dem zugehoerigen StringTable refeenziert werden ($Name$). If unset, GUIDesc of the control def is used.</col>
</row>
<row>
<literal_col>GUIGroup</literal_col>
<col>Integer</col>
<col>Control assignments in the same group are displayed grouped together in the control assignment dialog. The group with the lowest number is displayed at the top. Default 0.</col>
</row>
<row>
<literal_col>GUIDisabled</literal_col>
<col>Boolean</col>
<col>Whether this control assignment can not be changed in the control assignment dialog. Default 0.</col>
</row>
<row>
<literal_col>Priority</literal_col>
<col>Integer</col>
<col>Priority of the mapping. If more than once mapping is using the same keys then the key with the highest priority is executed first until a command is treated as handled.</col>
</row>
<row>
<literal_col>TriggerMode</literal_col>
<col>bitmask</col>
<col>
<text>
Trigger mode of this mapping. Bitmask based on the following values:
</text>
<table>
<rowh>
<col>Value</col>
<col>Description</col>
</rowh>
<row>
<col>Default value</col>
<col>No particular action.</col>
</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.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.xml#Hold">Held keys</emlink>.</col>
</row>
<row>
<literal_col>AlwaysUnhandled</literal_col>
<col>The key press is always passed to the mapping with the next lowest priority, independent of whether the previous command was executed successfully or not.</col>
</row>
<row>
<literal_col>ClearRecentKeys</literal_col>
<col>When the assignment is triggered, all recent keys are deleted and the trigger key is not added to the recent list. This means no future key combos can be triggered with any keys including and preceding the current.</col>
</row>
</table>
</col>
</row>
<row>
<literal_col>OverrideAssignments</literal_col>
<col>Boolean</col>
<col>The assignment overwrites all other assignments for the same control with the same press/release trigger mode.</col>
</row>
</table>
</part>
<h id="Script">Script callbacks</h>
<text>To initialize the player control the script function InitializePlayerControl is called for each player. This call might be delayed by a few frames with respect to InitializePlayer since the initialization of the control needs to be transmitted in the network. When continuing savegames InitalizePlayerControl will be called again. The chosen control might be different from the original one. The same can happen if a player chooses to change its controls during the game.</text>
@ -357,6 +409,5 @@ global func UpdateControlDir(int player)
<h id="Priority">Priorities</h>
<text>...</text>
</part>
<text><em>** - not yet implemented</em></text>
<author>Sven2</author><date>2009-06</date>
</doc>

View File

@ -25,6 +25,10 @@
<dt id="Landscapetxt"><img height="16" src="../../images/icon_text.png" width="16"/><emlink href="scenario/MapCreatorS2.html">Landscape.txt</emlink></dt>
<dd>
<text>Advanced scenario designers can use this component to define highly complex, fully random generated dynamic landscapes. This does require certain mathematical skill and some patience, however.</text>
</dd>
<dt id="Scriptc"><img height="16" src="../../images/icon_text.png" width="16"/><emlink href="script/MapScript.html">Map.c</emlink></dt>
<dd>
<text>Script for dynamic generation of map. See <emlink href="script/MapScript.html">map script documentation</emlink>.</text>
</dd>
</dl>
@ -104,10 +108,14 @@ US:Attack of the Killer Wipfs</code>
<dd>
<text>Stores the material table used in this scenario. The materials listed here are used by the exact landscape and have to be available in the loaded Material.ocg group.</text>
</dd>
<dt id="Objectstxt"><img height="16" src="../../images/icon_text.png" width="16"/>Objects.txt</dt>
<dt id="Objectstxt"><img height="16" src="../../images/icon_text.png" width="16"/>Game.txt</dt>
<dd>
<text>This component is generated by the engine and stores runtime object data of a savegame.</text>
</dd>
<dt id="Objectsc"><img height="16" src="../../images/icon_text.png" width="16"/>Objects.c</dt>
<dd>
<text>This component is generated by the engine if the game is stored as a scenario. Contains an InitializeObjects() function to recreate all objects placed during editing before. See <emlink href="definition/script.html#ScenSave">Object saving</emlink>.</text>
</dd>
</dl>
<h id="UeberladungenOCS">Overloading Rules</h>
<text>Various system components (graphics, loader screens, materials, music, or objects) can be overloaded in scenarios. In doing this, parent scenario folders (ocf) are searched. Also, components located in child groups will always overload the same components located in parent groups.</text>

View File

@ -218,7 +218,7 @@
<row>
<literal_col>BottomOpen</literal_col>
<col>Integer</col>
<col>0 or 1. Determines wether the bottom of the game world should be open.</col>
<col>0, 1 or 2. Determines wether the bottom of the game world should be open. 0=Bottom is closed, 1=Bottom is open, 2=Bottom is closed if the corresponding map pixel in the bottom row has tunnel background and open otherwise.</col>
</row>
<row>
<literal_col>TopOpen</literal_col>
@ -330,6 +330,11 @@
<col>Integer</col>
<col>Granularity of the Fog of War. Default: 64. Warning: smaller values will improve the looks of the FoW but will also severely increase processing times.</col>
</row>
<row>
<literal_col>FlatChunkShapes</literal_col>
<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>
</table>
</text>
<text>

View File

@ -9,8 +9,8 @@
<text>The keywords <code>break</code> and <code>continue</code> are used for finer control of loops:</text>
<text>
<ul>
<li><code>break</code> ends the enclosing loop. Execution is continued after the end of the loop.</li>
<li><code>continue</code> ends the current loop execution and continues with the next loop item from the beginning of the loop.</li>
<li id="break"><code>break</code> ends the enclosing loop. Execution is continued after the end of the loop.</li>
<li id="continue"><code>continue</code> ends the current loop execution and continues with the next loop item from the beginning of the loop.</li>
</ul>
</text>
<h>Example:</h>

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE doc
SYSTEM '../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
@ -71,12 +71,12 @@ func Activate(object caster, object caster2)
func FxInvisPSpellStart(object target, proplist effect)
{
// Vorherige Sichtbarkeit des Zauberers speichern
// Save the casters previous visibility
effect.visibility = target.Visibility;
effect.old_mod = target-&gt;<funclink>GetClrModulation</funclink>();
// Zauberer unsichtbar machen
// Make the caster invisible
target.Visibility = <funclink>VIS_Owner</funclink> | <funclink>VIS_Allies</funclink> | <funclink>VIS_God</funclink>;
// Halbdurchsichtig bläulich für den Besitzer und Verbündete
// Semitransparent and slightly blue for owner and allies
target-&gt;SetClrModulation(<funclink>ModulateColor</funclink>(effect.old_mod, RGBa(127,127,255,127)));
// Fertig
return true;
@ -505,26 +505,32 @@ global func FxExplodeOnDeathCurseStop(object target, proplist effect, int reason
<text>
<table>
<rowh>
<col>Script constant</col>
<col>reason</col>
<col>Meaning</col>
</rowh>
<row>
<col>FX_Call_Normal</col>
<col>0</col>
<col>Normal removal</col>
</row>
<row>
<col>FX_Call_Temp</col>
<col>1</col>
<col>Temporary removal (temporary is 1).</col>
</row>
<row>
<col>FX_Call_TempAddForRemoval</col>
<col>2</col>
<col>Not used</col>
</row>
<row>
<col>FX_Call_RemoveClear</col>
<col>3</col>
<col>The target object has been deleted</col>
</row>
<row>
<col>FX_Call_RemoveDeath</col>
<col>4</col>
<col>The target object has died</col>
</row>
@ -551,7 +557,7 @@ global func FxExplodeOnDeathCurseStop(object target, proplist effect, int reason
<h>Fx*Damage</h>
<text><code>int Fx*Damage (object target, proplist effect, int damage, int cause);</code></text>
<text>Every effect receives this callback whenever the energy or damage value of the target object is to change. If the function is defined, it should then return whether to allow the change.</text>
<text>This callback is made upon life energy changes in living beings and damage value changes in non-livings - but not vice versa. cause contains the value change and reason:</text>
<text id="damagecause">This callback is made upon life energy changes in living beings and damage value changes in non-livings - but not vice versa. cause contains the value change and reason:</text>
<text>
<table>
<rowh>

View File

@ -41,7 +41,7 @@ func MyCall()
<text>The function Activate() in the script of object B will first search for the closest object of type A (definition ID TestObjectA) and store a reference to this object in the variable "obj". Then the function Activate() is called in the script of object A. To do this we first specifiy the variable containing the pointer to the object, followed by an arrow, then the function name including the parameter list (no parameters in this case).</text>
<text>Calling Activate() in object B will cause the closest object of type A to be blown up. You may consider this a very primitive type of remote control. By the way, this script will cause an error if no object of type A can be found. To prevent this, first check whether obj is not <code>nil</code> before calling Activate().</text>
<h>Remarks</h>
<text>You don't <i>have</i> to store the object pointer in a variable as done in this example. You could also continue calling the function directly on the search result as in this case:</text>
<text>You don't <em>have</em> to store the object pointer in a variable as done in this example. You could also continue calling the function directly on the search result as in this case:</text>
<code>func Activate()
{
<funclink>FindObject</funclink>(<funclink>Find_Id</funclink>(TestObjectA), <funclink>Sort_Distance</funclink>())-&gt;Activate();

View File

@ -48,8 +48,8 @@ func Bar() {
<code>this == self: true
this == self: false
this == self: true</code>
<text>The last call to <code>Foo</code> shows the reason for <code>this</code>: Most of the functions in an object need that object to do something with it, and passing the object to every function would result in a lot of repetetive code.</text>
<text>Note for everyone familiar with previous versions of C4Script: When calling a function in a definition like <code>Flint->Hit();</code>, the definition is returned from <code>this</code>. In the <code>Flint->Hit();</code> example, that will probably result in an error message from the engine like "passed proplist, but expected object".</text>
<text>The last call to <code>Foo</code> shows the reason for <code>this</code>: Most of the functions in an object need that object to do something with it, and passing the object to every function would result in a lot of repetitive code.</text>
<text>Note for everyone familiar with previous versions of C4Script: When calling a function in a definition like <code>Flint->Hit();</code>, the definition is returned from <code>this</code>. In the <code>Flint->Hit();</code> example, that will probably result in an error message from the engine like "passed proplist, but expected object", because the Hit function of the Flint is not designed to be called like that.</text>
<h id="parametertypen">Parameter Types</h>
<text>You can specify the data type that is to be accepted for a given parameter. To do this, simply write the desired <emlink href="script/Typechecks.html">type name</emlink> before the parameter name:</text>
<code>func TypeParameterFunction(object myClonk, id def, int count, string msg)

View File

@ -0,0 +1,502 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE doc
SYSTEM '../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../clonk.xsl"?>
<doc>
<title>Map script</title>
<h>Map script</h>
<part>
<text>Map scripts provide a powerful method to generate diverse, dynamic maps with just a few lines of simple script code. Map scripts can be used to generate new maps, as well as modify existing maps defined as static Map.bmp or dynamic Landscape.txt.</text>
<h>Introduction</h>
<text>A map script is simply a script file called Map.c placed in a scenario. On scenario initialization, the engine calls the local function called InitializeMap in this script. If the function returns true, the map will be used by the engine. If false is returned, the map is discarded and the regular fallback map is created.</text>
<text>Here an example of a simple map script:</text>
<code>/* A simple map */
#include Library_Map
func InitializeMap(proplist map)
{
// Create a big map
Resize(150,150);
// Draw earth
DrawRegularGround();
// Draw some resources into the ground
DrawWaterVeins(3, [0,map.Hgt/3,map.Wdt,map.Hgt*2/3]);
DrawCoal(6);
DrawSulphur(4);
DrawRock(15);
DrawOre(4);
DrawGold(2*GetStartupPlayerCount()); // amount of gold depends on player count!
// Make sure liquids don't border tunnel or sky sideways
FixLiquidBorders();
// Done. Use this map.
return true;
}</code>
<text>This draws a pretty boring standard map with basic resources. It makes use of some high-level helper functions such as DrawRegularGround or DrawCoal. which are included in the definition named Library_Map in Objects.ocd/Libraries.ocd. All map scripts should include this definition.</text>
<h>Layers</h>
<part>
<text>All map draw functions work on layers, which are simply 8 bit image surfaces. The map itself is a layer, but additional layers can be created as temporary buffers using the CreateLayer or Duplicate script functions. Additional layers are bound to the map they were created from and destroyed alongside with it when map drawing is complete.</text>
<text>In C4Script, map layers are represented as prop lists. They have the implicit properties Wdt and Hgt, which contain the width and height of the surface respectively. To resize a map or layer, use the Resize() function. Do not modify Wdt or Hgt directly.</text>
<text>For example, the following code:</text>
<code>var layer = CreateLayer("Earth");
layer->DrawCoal();
Blit(layer, [0,0,layer.Wdt/2,layer.Hgt]);</code>
<text>would create a secondary layer filled with earth. It would then draw coal onto the layer and finally copy only the left half of its contents to the main map.</text>
</part>
<h>Algorithms</h>
<part>
<text>Algorithms are the core concept of dynamic map creation to point drawing operations to specific subregions of the map only. An algorithm is a function that maps a position (int x, int y) to either a pixel color (int) or a mask value (bool).</text>
<text>Algorithms are defined as prop list with the Algo property set to one of the MAPALGO_* constants and additional algorithm parameters set as properties. They can then be passed to one of the drawing functions (Draw or Blit), which will evaluate the algorithm at all positions and draw pixel values accordingly.</text>
<text>For example, the following code would draw rectangles of earth in a checkerboard pattern:</text>
<code>Draw("Earth", {Algo=MAPALGO_RndChecker, Wdt=5, Hgt=5});</code>
<text>In addition to pattern-generating algorithms, there are also modifier algorithms that take other algorithms as parameters. For example, the Turbulence algorithm jumbles all pixels of the underlying algorithm around to create a noisy pattern:</text>
<code>var checkerboard = {Algo=MAPALGO_RndChecker, Wdt=10, Hgt=10};
var jumbled_checkerboard = {Algo=MAPALGO_Turbulence, Amplitude=10, Scale=10};
Draw("Earth", jumbled_checkerboard);</code>
<text>Modifier algorithms can also be applied to layer contents directly. For example, to flip the contents of the current map, one could write:</text>
<code>// Backup contents of current map
var copy_layer = Duplicate();
// Redraw flipped horizontally
Blit({Algo=MAPALGO_Scale, OffX=Wdt/2, X=-100, Op=copy_layer});
</code>
<text>Note: If you are using the target layer in a drawing command, always draw from a copy. Otherwise, the result is undefined.</text>
<h>MAPALGO_Layer</h><part>
<text>Returns the pixel value at the x,y position of the given layer. Instead of passing a MAPALGO_Layer prop list, layers can also be passed directly as algorithms.</text>
<text><table><rowh><col>Parameter</col><col>Default</col><col>Meaning</col></rowh>
<row>
<col>Layer</col>
<col></col>
<col>The layer from which pixel values are taken.</col>
</row>
</table></text></part>
<h>MAPALGO_RndChecker</h><part>
<text>Returns values from a checkerboard pattern of rectangles that are filled with ones or zeros.</text>
<text><table><rowh><col>Parameter</col><col>Default</col><col>Meaning</col></rowh>
<row>
<col>Seed</col>
<col>Random(65536)</col>
<col>If nonzero, the checkerboard pattern is generated from a fixed seed.</col>
</row><row>
<col>Ratio</col>
<col>50</col>
<col>Percentage of checkerboard fields that are one.</col>
</row><row>
<col>Wdt</col>
<col>10</col>
<col>Width of rectangles.</col>
</row><row>
<col>Hgt</col>
<col>10</col>
<col>Height of rectangles</col>
</row><row>
<col>FixedOffset</col>
<col>false</col>
<col>If true, the pattern always starts at position (0,0). Otherwise, it is offset by a random phase.</col>
</row>
</table></text></part>
<h>MAPALGO_Rect</h><part>
<text>Returns one if the position is in a given rectangle and zero otherwise.</text>
<text><table><rowh><col>Parameter</col><col>Default</col><col>Meaning</col></rowh>
<row>
<col>X</col>
<col>0</col>
<col>Left side of rectangle (pixel is included).</col>
</row><row>
<col>Y</col>
<col>0</col>
<col>Top side of rectangle (pixel is included).</col>
</row><row>
<col>Wdt</col>
<col>0</col>
<col>Width of rectangle.</col>
</row><row>
<col>Hgt</col>
<col>0</col>
<col>Height of rectangle.</col>
</row>
</table></text></part>
<h>MAPALGO_Ellipsis</h><part>
<text>Returns one if the position is in a given ellipsis and zero otherwise.</text>
<text><table><rowh><col>Parameter</col><col>Default</col><col>Meaning</col></rowh>
<row>
<col>X</col>
<col>0</col>
<col>Horizontal center of ellipsis.</col>
</row><row>
<col>Y</col>
<col>0</col>
<col>Vertical center of ellipsis.</col>
</row><row>
<col>Wdt</col>
<col>10</col>
<col>Horizontal radius of ellipsis.</col>
</row><row>
<col>Hgt</col>
<col>10</col>
<col>Vertical radius of ellipsis</col>
</row>
</table></text></part>
<h>MAPALGO_Polygon</h><part>
<text>Returns one if the position is in a given polygon or on its border and zero otherwise.</text>
<text><table><rowh><col>Parameter</col><col>Default</col><col>Meaning</col></rowh>
<row>
<col>X</col>
<col></col>
<col>Array of x coordinates of polygon points.</col>
</row><row>
<col>Y</col>
<col></col>
<col>Array of y coordinates of polygon points.</col>
</row><row>
<col>Wdt</col>
<col>1</col>
<col>Width of border lines of polygon.</col>
</row><row>
<col>Empty</col>
<col>false</col>
<col>If true, the polygon is not filled and only the border is drawn.</col>
</row><row>
<col>Open</col>
<col>false</col>
<col>If true, the last segment of the polygon is not drawn. Useful to draw lines. Only valid if Empty is true.</col>
</row>
</table></text></part>
<h>MAPALGO_Lines</h><part>
<text>Returns one if the point is on regular stripes and zero otherwise.</text>
<text>Vector (X,Y) determines both width and direction of the stripes. So, for instance, if you want to draw vertical stripes of 10 pixels width and a gap of 5 pixels between them, you would set X=10, Y=0, Distance=15.</text>
<text><table><rowh><col>Parameter</col><col>Default</col><col>Meaning</col></rowh>
<row>
<col>X</col>
<col>0</col>
<col>X size of vector that points perpendicular to stripes.</col>
</row><row>
<col>Y</col>
<col>0</col>
<col>Y size of vector that points perpendicular to stripes.</col>
</row><row>
<col>OffX</col>
<col>0</col>
<col>Offset of stripes. If unspecified, stripes begin at (0,0).</col>
</row><row>
<col>OffY</col>
<col>0</col>
<col>Offset of stripes.</col>
</row><row>
<col>Distance</col>
<col>2*Sqrt(X*X+Y*Y)</col>
<col>Distance between two stripes. Includes the stripe width!</col>
</row>
</table></text></part>
<h>MAPALGO_And</h><part>
<text>Returns zero if any of the operands is zero. Otherwise, returns the value of the last operand. If there are zero operands, always returns zero.</text>
<text><table><rowh><col>Parameter</col><col>Default</col><col>Meaning</col></rowh>
<row>
<col>Op</col>
<col></col>
<col>Array of algorithms that are tested.</col>
</row>
</table></text></part>
<h>MAPALGO_Or</h><part>
<text>Returns the first operand that is nonzero. If all operands are zero, returns zero. If there are zero operands, always returns zero.</text>
<text><table><rowh><col>Parameter</col><col>Default</col><col>Meaning</col></rowh>
<row>
<col>Op</col>
<col></col>
<col>Array of algorithms that are tested.</col>
</row>
</table></text></part>
<h>MAPALGO_Not</h><part>
<text>Returns one if the operand is zero. Returns zero otherwise.</text>
<text><table><rowh><col>Parameter</col><col>Default</col><col>Meaning</col></rowh>
<row>
<col>Op</col>
<col></col>
<col>Algorithms that is negated.</col>
</row>
</table></text></part>
<h>MAPALGO_Xor</h><part>
<text>If exactly one of the two operands is nonzero, returns that operand. Otherwise, returns zero.</text>
<text><table><rowh><col>Parameter</col><col>Default</col><col>Meaning</col></rowh>
<row>
<col>Op</col>
<col></col>
<col>Array of two algorithms that are tested.</col>
</row>
</table></text></part>
<h>MAPALGO_Offset</h><part>
<text>Moves its operand by an 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>OffX</col>
<col>0</col>
<col>Horizontal offset to the right.</col>
</row><row>
<col>OffY</col>
<col></col>
<col>Vertical offset downwards.</col>
</row>
</table></text></part>
<h>MAPALGO_Scale</h><part>
<text>Scales its operand by a point.</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>X</col>
<col>100</col>
<col>Horizontal scaling in percent. Values smaller than zero flip the operand horizontally.</col>
</row><row>
<col>Y</col>
<col>100</col>
<col>Vertical scaling in percent. Values smaller than zero flip the operand vertically.</col>
</row><row>
<col>OffX</col>
<col>0</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.</col>
</row>
</table></text></part>
<h>MAPALGO_Rotate</h><part>
<text>Rotates its operand around a point.</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>R</col>
<col>0</col>
<col>Rotation angle in degrees (0 to 360). Positive values rotate counter-clockwise.</col>
</row><row>
<col>OffX</col>
<col>0</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.</col>
</row>
</table></text></part>
<h>MAPALGO_Turbulence</h><part>
<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>Seed</col>
<col>Random(65536)</col>
<col>If nonzero, the offset map is generated from a fixed seed.</col>
</row><row>
<col>Amplitude</col>
<col>10</col>
<col>Maximum range by which pixels may be moved in a single step. Movement in any direction is half of the amplitude. Can be an single integer for equal movement in both dimensions or an array of two integers for separate amplitudes for horizontal and vertical movement.</col>
</row><row>
<col>Scale</col>
<col>10</col>
<col>Distance of points for which the amplitude is randomized. A large scale relative to the amplitude creates more broadly scaled, regular turbulence, while a small scale can cause borders to look more jumpey. Can be an single integer for equal scale in both dimensions or an array of two integers for separate scales horizontally and vertically.</col>
</row><row>
<col>Iterations</col>
<col>2</col>
<col>Number of times each point is pushed around. The amplitude of the n'th successive push is reduced by 1/n.</col>
</row>
</table></text></part>
<h>MAPALGO_Border</h><part>
<text>Returns true for positions that lie on an inner or outer border of an operand. An inner border is defined as a position where the operand is nonzero and a position where it is zero lies within inner border width range. An outer border is defined as a position where the operand is zero and a position where it is nonzero lies within outer border width range. Note that borders are only searched in four directions (left, right, upwards, downwards) and not diagonally. This means that for a square, outer borders to not catch the corners.</text>
<text><table><rowh><col>Parameter</col><col>Default</col><col>Meaning</col></rowh>
<row>
<col>Op</col>
<col></col>
<col>Algorithm of which the border is to be determined.</col>
</row><row>
<col>Wdt</col>
<col>1</col>
<col>Border width in all directions. Positive integer for inner border; negative integer for outer border. Can also be an array of two integers of opposing signs for inner and outer borders.</col>
</row><row>
<col>Left</col>
<col></col>
<col>Border width to the left side. Definition like Wdt. Falls back to Wdt if not specified.</col>
</row><row>
<col>Top</col>
<col></col>
<col>Border width upwards. Definition like Wdt. Falls back to Wdt if not specified.</col>
</row><row>
<col>Right</col>
<col></col>
<col>Border width to the right side. Definition like Wdt. Falls back to Wdt if not specified.</col>
</row><row>
<col>Bottom</col>
<col></col>
<col>Border width downwards. Definition like Wdt. Falls back to Wdt if not specified.</col>
</row>
</table></text></part>
<h>MAPALGO_Filter</h><part>
<text>Return only pixel values of the operand that match the mask specification. Returns zero for other pixels.</text>
<text><table><rowh><col>Parameter</col><col>Default</col><col>Meaning</col></rowh>
<row>
<col>Op</col>
<col></col>
<col>Operand algorithm that is being filtered.</col>
</row><row>
<col>Filter</col>
<col></col>
<col>Mask specification (see section "Material-texture masks" below)</col>
</row>
</table></text></part>
</part>
<h>Script function parameters</h>
<part>
Map drawing functions follow a common syntax for passing certain structures:
<h>Rectangles (array rect)</h>
<text>All rectangles are given in the format <code>[left, top, width, height]</code>, where the left and top pixel rows are included and left+width and top+height pixel rows are excluded. Unless otherwise specified, rect can always be nil, in which case the area defaults to the whole map or layer (<code>[0,0,this.Wdt,this.Hgt]</code>).</text>
<h>Material-texture definitions (string mattex)</h>
<text>When a material is specified for the drawing functions, the following definitions are valid:</text>
<text>
<table>
<rowh>
<col>String</col>
<col>Example</col>
<col>Meaning</col>
</rowh>
<row>
<col>Material</col>
<col>Earth</col>
<col>Draws the given material in its default texture as underground (tunnel background) material.</col>
</row>
<row>
<col>Material-Texture</col>
<col>Earth-earth_topSoil</col>
<col>Draws the given material with the given texture as underground material.</col>
</row>
<row>
<col>^Material</col>
<col>^Water</col>
<col>Draws the given material with its default texture as overground (sky background) material.</col>
</row>
<row>
<col>^Material-Texture</col>
<col>^Earth-earth_rough</col>
<col>Draws the given material with the given texture as overground material.</col>
</row>
<row>
<col>Sky</col>
<col>Sky</col>
<col>Draws a sky material. Within the map generator, explicit sky is drawn as IFT (0x80), which is converted to index zero on map drawing. That way, sky can be blitted to other layers without being transparent.</col>
</row>
<row>
<col>Transparent</col>
<col>Transparent</col>
<col>Draws with index 0.</col>
</row>
</table>
</text>
<h>Material-texture masks (string mask_spec)</h>
<text>When a material is specified as a masking function, the following definitions are valid:</text>
<text>
<table>
<rowh>
<col>String</col>
<col>Example</col>
<col>Meaning</col>
</rowh>
<row>
<col>Material</col>
<col>Earth</col>
<col>True for given material with any texture and any (sky or tunnel) background.</col>
</row>
<row>
<col>Material-Texture</col>
<col>Earth-earth_topSoil</col>
<col>True for the given material with the given texture and any (sky or tunnel) background.</col>
</row>
<row>
<col>Sky</col>
<col>Sky</col>
<col>True for explicit sky material (0x80) only. Not true for transaprent (0) pixels.</col>
</row>
<row>
<col>Transparent</col>
<col>Transparent</col>
<col>True for transparent pixels (index 0) only.</col>
</row>
<row>
<col>Background</col>
<col>Background</col>
<col>True for all background materials (e.g. Tunnel, BrickBack and Sky).</col>
</row>
<row>
<col>Liquid</col>
<col>Liquid</col>
<col>True for all liquids (e.g. Water, Acid, Lava and DuroLava).</col>
</row>
<row>
<col>Solid</col>
<col>Solid</col>
<col>True for solid materials (e.g. Earth, Rock, Brick, etc.).</col>
</row>
<row>
<col>*</col>
<col>*</col>
<col>True for all materials.</col>
</row>
<row>
<col>^Definition</col>
<col>^Rock-rock_cracked</col>
<col>True for the definition if overground (sky background) only.</col>
</row>
<row>
<col>&amp;Definition</col>
<col>&amp;Liquid</col>
<col>True for the definition if underground (tunnel background) only. The example would match all underground liquids.</col>
</row>
<row>
<col>~Definition</col>
<col>~^*</col>
<col>Inverts the definition, i.e. true only if the definition would originally be false. The example would match all underground materials.</col>
</row>
</table>
</text>
</part>
<h>Script functions</h>
<part>
<text>All drawing functions are defined in the MapLayer static prop list. Because the Map.c script file is also evaluated in this context with the current map as this pointer, all drawing functions can be called directly by name in that script (e.g.: Resize(150,150)). In other script contexts or if the function is to be executed on a layer instead of on the main map, the base object must be given explicitely (e.g.: map->Resize(150,150), where map is the parameter passed to InitializeMap).</text>
<text>Because layers derive from the MapLayer prop list, all script functions defined in the Map.c and included script files are also available on any layer.</text>
<h>Internal engine functions</h>
<part>
<text><code>bool Draw(string mattex, proplist mask_algo, array rect);</code></text>
<text>Draws the material given by mattex on all pixels within rect if the algorithm given by mask_algo returns a value other than zero. Returns true on success.</text>
<text><code>bool Blit(proplist mask_algo, array rect);</code></text>
<text>Same as draw, but draws the result of evaluation of mask_algo directly instead of a material given by mattex. Because mask_algo can also be a layer, this function can be used to copy layer contents onto other layers or the map. If mask_algo evaluates to zero, nothing is drawn and the original pixel value is kept.</text>
<text><code>proplist CreateLayer(string mattex_fill, int width, int height);</code></text>
<text>Creates a new layer of size width,height. If no size is given, the layer is created in the same size as the calling context layer or map. The new layer is filled with the pixel color given by mattex_fill, or with zeroes if mattex_fill is nil. Returns the newly created layer.</text>
<text><code>bool Resize(int new_width, int new_height);</code></text>
<text>Recreates the calling layer or map surface in the given size. All contents are deleted and the layer is filled with zeroes. Use functions Duplicate and Blit to backup and restore any old layer contents if you want to extent the map without losing its contents. Returns true on success.</text>
<text><code>proplist Duplicate(any mask_spec, array rect);</code></text>
<text>Creates a new layer with the same size and surface contents as this layer. If a rect is given, the new layer is smaller and contains only the portion included in rect. If mask_spec is given, only pixels passing the mask are set and all other pixels in the new layer are zero.</text>
<text><code>int GetPixel(int x, int y);</code></text>
<text>Gets the pixel color at the given position in this layer. If x,y is outside the layer, zero is returned.</text>
<text><code>bool SetPixel(int x, int y, int new_color);</code></text>
<text>Sets the pixel at position x,y in this layer to new_color. Returns true on success.</text>
<text><code>int GetPixelCount(any mask_spec, array rect);</code></text>
<text>Returns number of pixels on this layer or map within rect that fulfill mask_spec.</text>
<text><code>bool FindPosition(proplist out_pos, mask_spec, array rect, int max_tries);</code></text>
<text>Tries to find a position on this layer for which the pixel color matches mask_spec. If a position is found, true is returned and the position is set as X and Y parameters in the out_pos prop list. If no position is found after max_tries, the function will walk through all pixels of the layer starting from a random starting position to find a point. If still no position is found, false is returned and out_pos is not changed. max_tries defaults to 500.</text>
<text><code>array CreateMatTexMask(any mask_spec);</code></text>
<text>Returns mask_spec as an array of 256 bools to be used e.g. in conjunction with the return value of GetPixel.</text>
</part>
</part>
</part>
<author>Sven2</author><date>2013-03</date>
</doc>

View File

@ -32,7 +32,7 @@
<desc>Numeric value to be displayed next to the menu entry (such as counts and amounts).</desc>
</param>
<param>
<type>int</type>
<type>any</type>
<name>parameter</name>
<desc>Second parameter to the function specified in command (see remark).</desc>
</param>

View File

@ -48,6 +48,7 @@
<funclink>Anim_Linear</funclink>
<funclink>Anim_X</funclink>
<funclink>Anim_Y</funclink>
<funclink>Anim_R</funclink>
<funclink>Anim_AbsY</funclink>
<funclink>Anim_XDir</funclink>
<funclink>Anim_YDir</funclink>

View File

@ -48,6 +48,7 @@
<funclink>Anim_Linear</funclink>
<funclink>Anim_X</funclink>
<funclink>Anim_Y</funclink>
<funclink>Anim_R</funclink>
<funclink>Anim_AbsX</funclink>
<funclink>Anim_XDir</funclink>
<funclink>Anim_YDir</funclink>

View File

@ -27,6 +27,7 @@
<funclink>Anim_Linear</funclink>
<funclink>Anim_X</funclink>
<funclink>Anim_Y</funclink>
<funclink>Anim_R</funclink>
<funclink>Anim_AbsX</funclink>
<funclink>Anim_AbsY</funclink>
<funclink>Anim_XDir</funclink>

View File

@ -32,6 +32,7 @@
<funclink>Anim_Linear</funclink>
<funclink>Anim_X</funclink>
<funclink>Anim_Y</funclink>
<funclink>Anim_R</funclink>
<funclink>Anim_AbsX</funclink>
<funclink>Anim_AbsY</funclink>
<funclink>Anim_XDir</funclink>

View File

@ -71,6 +71,7 @@ else
<funclink>Anim_Const</funclink>
<funclink>Anim_X</funclink>
<funclink>Anim_Y</funclink>
<funclink>Anim_R</funclink>
<funclink>Anim_AbsX</funclink>
<funclink>Anim_AbsY</funclink>
<funclink>Anim_XDir</funclink>

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>Anim_R</title>
<category>Animations</category>
<version>5.3 OC</version>
<syntax>
<rtype>array</rtype>
<params>
<param>
<type>int</type>
<name>begin</name>
<desc>Start of the interval.</desc>
</param>
<param>
<type>int</type>
<name>end</name>
<desc>End of the interval. If end is chosen to be greater than begin then the value increases with clockwise rotation, otherwise it decreases.</desc>
</param>
</params>
</syntax>
<desc>The value depends on the rotation of the object. Upward rotation (0 degrees) is mapped to the value given by begin, and moves toward end when the object rotates clockwise, up to end after one revolution (360 degrees).</desc>
<remark>See the <emlink href="definition/animations.html">animation documentation</emlink> for further explanations of the animation system.</remark>
<examples>
<example>
<code><funclink>PlayAnimation</funclink>(&quot;Turn&quot;, 5, <funclink>Anim_R</funclink>(0, <funclink>GetAnimationLength</funclink>(&quot;Turn&quot;)), <funclink>Anim_Const</funclink>(1000));</code>
<text>Plays the animation "Turn" in slot 5 and superimposes any other potential animations in slot 5. The animation is synchronized to the object's rotation so that the full animation is played once per revolution.</text>
</example>
</examples>
<related>
<funclink>PlayAnimation</funclink>
<funclink>SetAnimationPosition</funclink>
<funclink>SetAnimationWeight</funclink>
<funclink>Anim_Const</funclink>
<funclink>Anim_Linear</funclink>
<funclink>Anim_X</funclink>
<funclink>Anim_Y</funclink>
<funclink>Anim_AbsX</funclink>
<funclink>Anim_AbsY</funclink>
<funclink>Anim_XDir</funclink>
<funclink>Anim_YDir</funclink>
<funclink>Anim_Action</funclink>
</related>
</func>
<author>Clonk-Karl</author><date>2012-04</date>
</funcs>

View File

@ -47,6 +47,7 @@
<funclink>Anim_Const</funclink>
<funclink>Anim_Linear</funclink>
<funclink>Anim_Y</funclink>
<funclink>Anim_R</funclink>
<funclink>Anim_AbsX</funclink>
<funclink>Anim_AbsY</funclink>
<funclink>Anim_XDir</funclink>

View File

@ -43,6 +43,7 @@
<funclink>Anim_Linear</funclink>
<funclink>Anim_X</funclink>
<funclink>Anim_Y</funclink>
<funclink>Anim_R</funclink>
<funclink>Anim_AbsX</funclink>
<funclink>Anim_AbsY</funclink>
<funclink>Anim_YDir</funclink>

View File

@ -47,6 +47,7 @@
<funclink>Anim_Const</funclink>
<funclink>Anim_Linear</funclink>
<funclink>Anim_X</funclink>
<funclink>Anim_R</funclink>
<funclink>Anim_AbsX</funclink>
<funclink>Anim_AbsY</funclink>
<funclink>Anim_XDir</funclink>

View File

@ -43,6 +43,7 @@
<funclink>Anim_Linear</funclink>
<funclink>Anim_X</funclink>
<funclink>Anim_Y</funclink>
<funclink>Anim_R</funclink>
<funclink>Anim_AbsX</funclink>
<funclink>Anim_AbsY</funclink>
<funclink>Anim_XDir</funclink>

View File

@ -0,0 +1,54 @@
<?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>BlastFree</title>
<category>Landscape</category>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>
<params>
<param>
<type>int</type>
<name>x</name>
<desc>X coordinate</desc>
</param>
<param>
<type>int</type>
<name>y</name>
<desc>Y coordinate</desc>
</param>
<param>
<type>int</type>
<name>radius</name>
<desc>Radius</desc>
</param>
<param>
<type>int</type>
<name>caused_by</name>
<desc>The controller of objects that are created by the blast. See Blast2Objects in <emlink href="material/ocm.html">material definitions</emlink>. If not set, the controller is the owner of the calling object.</desc>
<optional />
</param>
<param>
<type>int</type>
<name>max_density</name>
<desc>Only materials of the given density or lower are blasted by this explosion. If not specified, any material is blasted.</desc>
<optional />
</param>
</params>
</syntax>
<desc>Blasts a hole in solid materials. </desc>
<examples>
<example>
<code>BlastFree(300, 300, 40, nil, 70);</code>
<text>Blasts a hole into the landscape with the center of the blast being 300,300. Additionally, only materials of a density of 70 or lower are blasted, so this blast does not blast granite.</text>
</example>
</examples>
<related>
<funclink>Explode</funclink>
</related>
</func>
<date>2014-01</date>
</funcs>

View File

@ -7,12 +7,12 @@
<title>Call</title>
<category>Script</category>
<subcat>Function call</subcat>
<version>5.1 OC</version>
<version>5.1 OC<extversion>5.4 OC</extversion></version>
<syntax>
<rtype>any</rtype>
<params>
<param>
<type>string</type>
<type>string or function</type>
<name>function</name>
<desc>Function to be called.</desc>
</param>
@ -23,11 +23,12 @@
</param>
</params>
</syntax>
<desc>Calls the local function function. If "~" is prepended to the function name then the call does not fail if the function does not exist.</desc>
<desc>Calls the specified function. If given a string, the function is looked up in the context object (<code>this</code>). For example, <code>obj->Call("Foo")</code> is the same as <code>obj->Foo()</code>. Using Call like this is primarily useful when the name of the function can vary. If "~" is prepended to the function name then the call does not fail if the function does not exist.</desc>
<related>
<funclink>GameCall</funclink>
<funclink>eval</funclink>
</related>
</func>
<author>jwk</author><date>2002-04</date>
<author>Günther</author><date>2012</date>
</funcs>

View File

@ -0,0 +1,46 @@
<?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>CanInsertMaterial</title>
<category>Landscape</category>
<subcat>Material</subcat>
<version>5.4 OC</version>
<syntax>
<rtype>bool</rtype>
<params>
<param>
<type>int</type>
<name>material_index</name>
<desc>Material to test to be inserted (see <funclink>Material</funclink>()).</desc>
</param>
<param>
<type>int</type>
<name>x</name>
<desc>X insert position or offset</desc>
<optional />
</param>
<param>
<type>int</type>
<name>y</name>
<desc>Y insert position or offset</desc>
<optional />
</param>
<param>
<type>proplist</type>
<name>out_insertpos</name>
<desc>If a writeable proplist is passed, members x and y are filled with the position at which the material would be inserted.</desc>
<optional />
</param>
</params>
</syntax>
<desc>Tests if a material pixel at the given position can be inserted.</desc>
<remark>If the target position already contains material of the same density as the inserted material, the engine will search upwards for a proper insertion position.</remark>
<related>
<funclink>Material</funclink>
</related>
</func>
<author>Sven2</author><date>2001-11</date>
</funcs>

View File

@ -1,81 +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>CastParticles</title>
<category>Particle</category>
<version>5.1 OC</version>
<syntax>
<rtype>bool</rtype>
<params>
<param>
<type>string</type>
<name>name</name>
<desc>Name of the particle type.</desc>
</param>
<param>
<type>int</type>
<name>amount</name>
<desc>Amount of particles.</desc>
</param>
<param>
<type>int</type>
<name>level</name>
<desc>Velocity at which to cast the particles.</desc>
</param>
<param>
<type>int</type>
<name>x</name>
<desc>X coordinate of the particle. Offset in local calls.</desc>
</param>
<param>
<type>int</type>
<name>y</name>
<desc>Y coordinate of the particle. Offset in local calls.</desc>
</param>
<param>
<type>int</type>
<name>a0</name>
<desc>Lower limit for the first extra parameter. This is usually the size of the particles in 1/5 pixels.</desc>
</param>
<param>
<type>int</type>
<name>a1</name>
<desc>Upper limit for the first extra parameter.</desc>
</param>
<param>
<type>int</type>
<name>b0</name>
<desc>Lower limit for the second extra parameter. This is usually the color modulation of the particles.</desc>
</param>
<param>
<type>int</type>
<name>b1</name>
<desc>Upper limit for the second extra parameter.</desc>
</param>
<param>
<type>object</type>
<name>obj</name>
<desc>Target object for object local particles. Object local particles are drawn directly on top of the object and are removed when the object is deleted.</desc>
<optional />
</param>
</params>
</syntax>
<desc>Casts the specified amount of particles of the specified type. The extra parameters are set randomly in the range from a0/b0 to a1/b1.</desc>
<remark>This function returns <code>false</code> if the particle definition was not found, otherwise <code>true</code>. There is no return value indicating whether the particle has actually been created. This must be so to prevent synchronization problems in network games, as particles may be handled differently on each computer in the network.</remark>
<examples>
<example>
<code>CastParticles(&quot;MagicSpark&quot;, 10,100, 0,0, 100, 200, <funclink>RGBa</funclink>(128,128,255,0), <funclink>RGBa</funclink>(255,255,255,127));</code>
<text>Creates some sparks.</text>
</example>
</examples>
<related>
<funclink>CreateParticle</funclink>
<funclink>CastObjects</funclink>
<funclink>CastPXS</funclink>
</related>
</func>
<author>Sven2</author><date>2002-05</date>
</funcs>

View File

@ -21,7 +21,7 @@
</syntax>
<desc>Checks whether this object is visible for the given player.</desc>
<related>
<emlink href="definition/visibility.html">Visibility</emlink>-Property
<emlink href="definition/visibility.html">Visibility Property</emlink>
</related>
</func>
<author>Newton</author><date>2009-07</date>

View File

@ -4,7 +4,7 @@
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>FreeRect</title>
<title>ClearFreeRect</title>
<category>Landscape</category>
<version>5.1 OC</version>
<syntax>
@ -13,12 +13,12 @@
<param>
<type>int</type>
<name>x</name>
<desc>Left limit of the rectangle</desc>
<desc>Left limit of the rectangle. Always global coordinates.</desc>
</param>
<param>
<type>int</type>
<name>y</name>
<desc>Top limit of the rectangle</desc>
<desc>Top limit of the rectangle. Always global coordinates.</desc>
</param>
<param>
<type>int</type>
@ -30,27 +30,21 @@
<name>height</name>
<desc>Height of the rectangle</desc>
</param>
<param>
<type>int</type>
<name>density</name>
<desc>If specified, material of the specified density is removed.</desc>
</param>
</params>
</syntax>
<desc>Removes all material within the specified rectangle. Coordinates are always global. Excluding the right and lower limits of the rectangle.</desc>
<remark>This call may take quite a while for large rectangles.</remark>
<examples>
<example>
<code>FreeRect(0, 0, <funclink>LandscapeWidth</funclink>(), <funclink>LandscapeHeight</funclink>());</code>
<code>ClearFreeRect(0, 0, <funclink>LandscapeWidth</funclink>(), <funclink>LandscapeHeight</funclink>());</code>
<text>Empties the complete landscape.</text>
</example>
</examples>
<related>
<funclink>DigFree</funclink>
<funclink>DigFreeRect</funclink>
<funclink>Explode</funclink>
<funclink>BlastFree</funclink>
</related>
</func>
<author>Sven2</author><date>2001-11</date>
<author>Clonkonaut</author><date>2008-04</date>
<date>2014-01</date>
</funcs>

View File

@ -5,36 +5,23 @@
<funcs>
<func>
<title>ClearParticles</title>
<category>Particle</category>
<category>Particles</category>
<version>5.1 OC</version>
<syntax>
<rtype>bool</rtype>
<params>
<param>
<type>string</type>
<name>name</name>
<desc>Name of the particle definition of which you want to delete all particles. If not specified, all particles of all types will be removed.</desc>
<optional />
</param>
<param>
<type>object</type>
<name>obj</name>
<desc>If specified, only the particles local to that object are removed.</desc>
<optional />
</param>
</params>
</syntax>
<desc>Removes all particles of the specified type.</desc>
<desc>Removes all particles associated with the calling object or the global particles if not called from object context.</desc>
<examples>
<example>
<code>ClearParticles(&quot;Smoke&quot;);</code>
<text>Removes all smoke.</text>
<code>
GetCursor(0)->ClearParticles();
Scenario->ClearParticles();</code>
<text>Removes all particles belonging to the first player's Clonk and all global particles.</text>
</example>
</examples>
<related>
<funclink>CreateParticle</funclink>
<funclink>PushParticles</funclink>
</related>
</func>
<author>Sven2</author><date>2002-04</date>
<author>Zapper</author><date>2013-12</date>
</funcs>

View File

@ -5,72 +5,91 @@
<funcs>
<func>
<title>CreateParticle</title>
<category>Particle</category>
<version>5.1 OC</version>
<category>Particles</category>
<version>5.3.4 OC</version>
<syntax>
<rtype>bool</rtype>
<params>
<param>
<type>string</type>
<name>szName</name>
<desc>Name of the particle</desc>
<name>particle_name</name>
<desc>Name of the particle definition.</desc>
</param>
<param>
<type>int</type>
<name>x</name>
<desc>X coordinate of the particle. Offset in local calls.</desc>
<desc>X-coordinate of the new particle (relative to object for local calls)</desc>
</param>
<param>
<type>int</type>
<name>y</name>
<desc>Y coordinate of the particle. Offset in local calls.</desc>
<desc>Y-coordinate of the new particle (relative to object for local calls)</desc>
</param>
<param>
<type>int</type>
<name>xdir</name>
<desc>Initial horizontal velocity of the particle.</desc>
<name>speed_x</name>
<desc>Starting speed of the particle in x-direction. Can also be a value provider function.</desc>
</param>
<param>
<type>int</type>
<name>ydir</name>
<desc>Initial vertical velocity of the particle.</desc>
<name>speed_y</name>
<desc>Starting speed of the particle in y-direction. Can also be a value provider function.</desc>
</param>
<param>
<param>
<type>int</type>
<name>a</name>
<desc>Extra parameter. This is usually the size of the particle in 1/5 pixels.</desc>
<name>lifetime</name>
<desc>Time in frames that the particle will be alive before it is removed. Can also be a value provider function.</desc>
</param>
<param>
<param>
<type>proplist</type>
<name>properties</name>
<desc>PropList with the particle attributes (see the <emlink href="particle/index.html#attributes">particle documentation</emlink>).</desc>
</param>
<param>
<type>int</type>
<name>b</name>
<desc>Extra parameter. This is usually the color modulation of the particle.</desc>
</param>
<param>
<type>object</type>
<name>target</name>
<desc>Target object for object local particles. Object local particles are drawn directly on top of the object and are removed when the object is deleted.</desc>
<optional />
</param>
<param>
<type>bool</type>
<name>behind_target</name>
<desc>If specified and not <code>false</code>, the particle is drawn directly behind the target object.</desc>
<optional />
<name>amount</name>
<desc>Amount of particles to create. Defaults to 1.</desc>
</param>
</params>
</syntax>
<desc>Creates a particle. The named particle definition must be loaded. For more information see the particle documentation.</desc>
<remark>This function returns <code>false</code> if the particle definition was not found, otherwise <code>true</code>. There is no return value indicating whether the particle has actually been created. This must be so to prevent synchronization problems in network games, as particles may be handled differently on each computer in the network.</remark>
<examples>
<example>
<code>CreateParticle(&quot;Blast&quot;, 0,0, 0,0, 100, <funclink>RGB</funclink>(128,128,255));</code>
<text>Creates a blue explosion at the position of the calling object.</text>
</example>
</examples>
<related>
<funclink>PushParticles</funclink>
<funclink>ClearParticles</funclink>
<desc>Creates a new particle with the given properties. Note that particle creation is not necessarily synchronized over the network and thus, the return value is not whether the particle was actually created but whether the particle definition was found.</desc>
<remark>See the <emlink href="particle/index.html">particle documentation</emlink> for further explanations.</remark>
<examples>
<example>
<code>
var particles =
{
Size = <funclink>PV_KeyFrames</funclink>(0, 0, 0, 200, 50, 1000, 0),
DampingX = 900,
DampingY = 900,
R = 255,
G = <funclink>PV_Linear</funclink>(255, 0),
B = <funclink>PV_Linear</funclink>(128, 0),
Alpha = <funclink>PV_Linear</funclink>(255, 0),
Rotation = <funclink>PV_Direction</funclink>(),
Stretch = <funclink>PV_Speed</funclink>(5 * 1000),
ForceY = <funclink>PV_KeyFrames</funclink>(0, 0, 0, 900, 0, 1000, -20),
ForceX = <funclink>PV_Random</funclink>(-5, 5, 15),
Phase = <funclink>PV_Step</funclink>(1, 0, 10)
};
<funclink>CreateParticle</funclink>("Fire", 0, 0, <funclink>PV_Random(-200, 200)</funclink>, <funclink>PV_Random</funclink>(-200, 200), <funclink>PV_Random</funclink>(18, 38 * 5), particles, 100);
</code>
<text>Casts 100 particles with a previously defined behavior.</text>
</example>
</examples>
<related>
<funclink>PV_Linear</funclink>
<funclink>PV_Direction</funclink>
<funclink>PV_Random</funclink>
<funclink>PV_Step</funclink>
<funclink>PV_Speed</funclink>
<funclink>PV_KeyFrames</funclink>
<funclink>PV_Wind</funclink>
<funclink>PV_Gravity</funclink>
<funclink>PC_Die</funclink>
<funclink>PC_Bounce</funclink>
<funclink>PC_Stop</funclink>
</related>
</func>
<author>Sven2</author><date>2002-04</date>
<author>Zapper</author><date>2013-10</date>
</funcs>

View File

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>CreateParticleAtBone</title>
<category>Particles</category>
<version>5.4 OC</version>
<syntax>
<rtype>bool</rtype>
<params>
<param>
<type>string</type>
<name>szName</name>
<desc>Name of the particle</desc>
</param>
<param>
<type>string</type>
<name>szBoneName</name>
<desc>Name of the bone at which to create the particle</desc>
</param>
<param>
<type>array</type>
<name>pos</name>
<desc>Vector of three elements with the X,Y and Z coordinates of the particle relative to the bone position and orientation.</desc>
</param>
<param>
<type>array</type>
<name>dir</name>
<desc>Vector of three elements with the X,Y and Z components of the velocity of theparticle relative to the bone orientation.</desc>
</param>
<param>
<type>int</type>
<name>lifetime</name>
<desc>Time in frames that the particle will be alive before it is removed. Can also be a value provider function.</desc>
</param>
<param>
<type>proplist</type>
<name>properties</name>
<desc>PropList with the particle attributes (see the <emlink href="particle/index.html#attributes">particle documentation</emlink>).</desc>
</param>
<param>
<type>int</type>
<name>amount</name>
<desc>Amount of particles to create. Defaults to 1.</desc>
</param>
</params>
</syntax>
<desc>Creates a particle relative to a bone of the calling object's skeleton. The named particle definition must be loaded. For more information see the particle documentation.</desc>
<remark>This function returns <code>false</code> if the particle definition was not found, or the function is called for an object which does not have a mesh graphics, or the skeleton of the mesh does not have a bone called <code>szBoneName</code>. Otherwise, <code>true</code> is returned. There is no return value indicating whether the particle has actually been created. This must be so to prevent synchronization problems in network games, as particles may be handled differently on each computer in the network.</remark>
<examples>
<example>
<code>func InitializePlayer(int plr)
{
AddEffect("IntColorize", 0, 1, 1);
}
global func FxIntColorizeTimer()
{
FindObject(Find_ID(Clonk))->CreateParticleAtBone("SphereSpark", "skeleton_body", [0, 0, 0], [0, 0, 0], PV_Random(20, 30), Particles_Spark());
FindObject(Find_ID(Clonk))->CreateParticleAtBone("Fire", "pos_hand1", [0, 0, 0], [0, 0, 0], PV_Random(5, 10), Particles_Fire());
FindObject(Find_ID(Clonk))->CreateParticleAtBone("Fire", "pos_hand2", [0, 0, 0], [0, 0, 0], PV_Random(5, 10), Particles_Fire());
return(0);
}</code>
<text>Scenario script. Creates an effect which traces a Clonk's body, left hand and right hand with differently colored sparks.</text>
</example>
</examples>
<related>
<funclink>CreateParticle</funclink>
</related>
</func>
<author>Clonk-Karl</author><date>2012-12</date>
</funcs>

View File

@ -45,7 +45,7 @@
<row>
<col>1</col>
<col>CSPF_NoScenarioInit</col>
<col>If true, the scenario initialization (i.e. placement of home base material, clonks, setting of build knowledge, etc.) is not performed for this player. Also, the global callbacks PreInitializePlayer and InitializePlayer to the scenario script and to goal, rule, and environment objects are not performed. Instead, the callback InitializeScriptPlayer(Player number, Team) is made to the object definition specified in extra_data. The call is made as DefinitionCall (without <funclink>this</funclink> object). Using this parameter you can create script-controlled AI players which do not receive the same standard treatment as user-controlled players.</col>
<col>If true, the scenario initialization (i.e. placement of home base material, clonks, setting of build knowledge, etc.) is not performed for this player. Also, the global callbacks PreInitializePlayer and InitializePlayer to the scenario script and to goal, rule, and environment objects are not performed. Instead, the callback InitializeScriptPlayer(Player number, Team) is made to the object definition specified in extra_data. Using this parameter you can create script-controlled AI players which do not receive the same standard treatment as user-controlled players.</col>
</row>
<row>
<col>2</col>

View File

@ -13,7 +13,7 @@
<examples>
<example>
<code><funclink>GetCursor</funclink>(0)-&gt;<funclink>SetComDir</funclink>(<funclink>COMD_None</funclink>);
<funclink><funclink>GetCursor</funclink>()-&gt;SetDir</funclink>(DIR_Left);</code>
<funclink>GetCursor</funclink>()-&gt;<funclink>SetDir</funclink>(DIR_Left);</code>
<text>The selected clonk stops and looks to the left.</text>
</example>
</examples>

View File

@ -1,38 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE funcs
SYSTEM '../../../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>DefinitionCall</title>
<category>Script</category>
<subcat>Function call</subcat>
<version>5.1 OC</version>
<syntax>
<rtype>any</rtype>
<params>
<param>
<type>id</type>
<name>definition</name>
<desc>id of the definition in the script of which to call the function.</desc>
</param>
<param>
<type>string</type>
<name>function</name>
<desc>Function to call</desc>
</param>
<param>
<type>any</type>
<name>...</name>
<desc>Additional parameters to be passed to the function.</desc>
<optional />
</param>
</params>
</syntax>
<desc>Calls a function in a script without object context. <funclink>this</funclink> returns <funclink>nil</funclink> in this case (comparable to scenario scripts).</desc>
<related>
<funclink>GameCall</funclink>
</related>
</func>
<author>Sven2</author><date>2001-11</date>
</funcs>

View File

@ -25,10 +25,17 @@
<name>radius</name>
<desc>Radius</desc>
</param>
<param>
<param>
<type>bool</type>
<name>no_dig2objects</name>
<desc>Prevent objects from being dug out</desc>
<optional />
</param>
<param>
<type>bool</type>
<name>no_instability_check</name>
<desc>Does not perform instability checks around dug pixels, i.e. prevents surrounding single pixels and liquids from becoming loose.</desc>
<optional />
</param>
</params>
</syntax>
@ -41,8 +48,7 @@
</examples>
<related>
<funclink>DigFreeRect</funclink>
<funclink>Explode</funclink>
</related>
</func>
<author>jwk</author><date>2002-04</date>
<date>2013-03</date>
</funcs>

View File

@ -30,10 +30,17 @@
<name>height</name>
<desc>Height</desc>
</param>
<param>
<param>
<type>bool</type>
<name>no_dig2objects</name>
<desc>Prevent objects from being dug out</desc>
<optional />
</param>
<param>
<type>bool</type>
<name>no_instability_check</name>
<desc>Does not perform instability checks around dug pixels, i.e. prevents surrounding single pixels and liquids from becoming loose.</desc>
<optional />
</param>
</params>
</syntax>
@ -47,5 +54,5 @@
</examples>
<related><funclink>DigFree</funclink></related>
</func>
<author>jwk</author><date>2002-04</date>
<date>2013-03</date>
</funcs>

View File

@ -72,7 +72,6 @@
</examples>
<related>
<funclink>InsertMaterial</funclink>
<funclink>SetLandscapePixel</funclink>
</related>
</func>
<author>Sven2</author><date>2002-05</date>

View File

@ -5,7 +5,7 @@
<funcs>
<func>
<title>DrawParticleLine</title>
<category>Particle</category>
<category>Particles</category>
<version>5.1 OC</version>
<syntax>
<rtype>int</rtype>

View File

@ -41,7 +41,8 @@
<related>
<funclink>RemoveObject</funclink>
<funclink>BlastObjects</funclink>
</related>
<funclink>BlastFree</funclink>
</related>
</func>
<author>Sven2</author><date>2001-11</date>
<author>Clonkonaut</author><date>2008-04</date>

View File

@ -11,10 +11,10 @@
<rtype>bool</rtype>
<params>
<param>
<optional/>
<type>string</type>
<name>message</name>
<desc>Error message to be displayed</desc>
<optional/>
</param>
</params>
</syntax>
@ -42,6 +42,9 @@
}</code><text></text>
</example>
</examples>
<related>
<funclink>LogCallStack</funclink>
</related>
</func>
<author>Newton</author><date>2011-09</date>
</funcs>

View File

@ -0,0 +1,40 @@
<?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>FileWrite</title>
<category>System</category>
<version>5.3 OC</version>
<syntax>
<rtype>bool</rtype>
<params>
<param>
<type>int</type>
<name>fid</name>
<desc>ID of file to be written to.</desc>
</param>
<param>
<type>string</type>
<name>data</name>
<desc>String to be written to the file.</desc>
</param>
</params>
</syntax>
<desc>Adds a text string to an open file. Currently, this function is only used to write to the Objects.c file in the SaveScenarioObjects callback defined in System.ocg/SaveScenario.c (See <emlink href="definition/script.html#ScenSave">Scenario objects saving</emlink>).</desc>
<examples>
<example>
<code>global func SaveScenarioObjects(f)
{
FileWrite(f, "func InitializeObjects() { return true; }\n");
}</code>
<text>When the user presses "Save scenario" in the editor, he won't save any objects.</text>
</example>
</examples>
<related>
<emlink href="definition/script.html#ScenSave">Scenario objects saving</emlink>
</related>
</func>
<author>Sven2</author><date>2013-12</date>
</funcs>

View File

@ -24,7 +24,7 @@
</param>
</params>
</syntax>
<desc>Ends a command in the command stack of an object.</desc>
<desc>Ends a command in the command stack of an object. A finished command stays in the stack until it would be time for it to be executed and is removed only then.</desc>
<related>
<funclink>SetCommand</funclink>
<funclink>GetCommand</funclink>
@ -33,4 +33,5 @@
</related>
</func>
<author>Günther</author><date>2004-04</date>
<author>Newton</author><date>2013-12</date>
</funcs>

View File

@ -34,7 +34,6 @@
<related>
<funclink>GameCallEx</funclink>
<funclink>Call</funclink>
<funclink>DefinitionCall</funclink>
</related>
</func>
<author>Günther</author><date>2002-04</date>

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