Compare commits

...

667 Commits

Author SHA1 Message Date
gitMarky 4a2048575f Refactor movement code (#87)
Improve readability by adding appropriate parentheses and braces, and fixing misleading/confusing whitespace. Extract SolidMask removal to a function since it's used in several places.
2019-03-05 21:15:39 +01:00
David Dormagen 765d9a24e9
Merge pull request #86 from fohly/master
better confetti for Boomshire
2019-03-02 10:19:55 +01:00
Philip Holzmann a844b6fe5b better confetti for Boomshire 2019-03-02 09:29:30 +01:00
Lukas Werling c9ee2c3eab Fix "no matching sound" error spam
Previously, the error message was only silenced for openclonk-server,
but appeared for openclonk if compiled without sounds.

Possible side effect: no local sounds will play if the global Sound.ocg
cannot be loaded. I don't think this is something we should support.
2019-02-20 09:36:35 +01:00
Lukas Werling 319dc87eea Remove #undef new/delete before Qt includes
This has not been necessary anymore since a1885006 ("Remove MS CRT
memory management debugging").
2019-02-19 15:35:00 +01:00
Lukas Werling 60841c1d96 Write text files with unix file endings
The old LineFeed constant caused problems with Qt. Using \n directly is
easier and I don't think there's a reason left to use \r\n anyways.
We've always converted the files in the repository. Nowadays, even
notepad.exe works with unix file endings.
2019-02-19 15:28:12 +01:00
isilkor a00566ca9e
Merge pull request #85 from isilkor/better-warning-pragma-parsing
Better warning pragma parsing
2019-02-17 14:04:00 +01:00
Nicolas Hake a0c9bfd931 Aul: Correctly check for enable/disable keywords in warning pragma
The parser was only checking that the passed setting matched the
beginning of the expected keyword, instead of checking for the full
length. This way, users could write "#warning e" instead of the
expected "#warning enable" and still have it work.
2019-02-17 11:58:03 +01:00
Nicolas Hake c8d22e321b Aul: Throw correct exception on parameter-less warning pragma
When no parameter followed the "#warning" pragma, because the end
iterator would be located before the begin iterator, basic_string's
constructor would throw std::length_error. Check for this case
beforehand so we can throw the expected C4ParseError instead.
2019-02-17 11:58:03 +01:00
Lukas Werling 918c4139e8 Add Flintbrawl by Zapper 2019-02-03 19:14:53 +01:00
Lukas Werling ee35d256aa Add basic character classes to WildcardMatch() 2019-02-03 19:14:53 +01:00
Lukas Werling 75d4ac2512 Fix team count inconsistency with random teams (#2051)
Switching to random teams would remove all teams but the first two on
the host, but not on the clients. With this fix, the extra teams are
removed on the clients as well. This fixes a desync when using
GetTeamCount() in a sync-relevant way.
2019-02-02 00:27:36 +01:00
Lukas Werling f6fba582f3 Fix star placement on full map screenshots (#1454) 2019-01-30 22:50:23 +01:00
Linus Heckemann c7550bd43c openclonk-server: install 2019-01-20 12:49:39 +01:00
Linus Heckemann 69fd50bee1 nix expression: fix build
Now that openclonk gets installed to bin, we don't need to (and
can't!) create the symlink anymore.
2019-01-20 12:38:54 +01:00
isilkor ad2eddcd63
Merge pull request #80 from isilkor/check-setlength-parameter-for-nil
Script: Test SetLength parameter 0 for nil (GH #79)
2019-01-05 19:47:38 +01:00
Nicolas Hake 486619b653 Script: Test SetLength parameter 0 for nil (GH #79)
SetLength didn't check whether its first parameter was valid, and
attempted to dereference a NULL pointer when passed nil.
2019-01-05 19:25:35 +01:00
Lukas Werling 3a59c15250 Add openclonk:// protocol handler (#1657) 2019-01-02 17:16:09 +01:00
Nicolas Hake d7ea9acfea C4Property: Don't use operator void* in tests anymore either 2019-01-01 22:20:04 +01:00
Nicolas Hake 5cf852d8ab C4Property: Add missing template<> specifier
MSVC doesn't care, apparently.
2019-01-01 21:55:42 +01:00
Nicolas Hake 0a81206b7e C4Property: Remove raw operator void*
operator void* is a quick and dirty workaround for the lack of
explicit operator bool in old C++ standards. Since we can use
explicit operator bool now, we don't need the operator void*
anymore.

Incidentally, that operator also allowed C4Set to equality compare
C4Property entries, which is unintuitive. Replace it with an
explicit specialization of C4Set::Equals.
2019-01-01 21:35:08 +01:00
Nicolas Hake 31c7805f10 C4Set: Replace elements with zero-initialized ones on clear
C4Set used to set its removed elements to nullptr. This requires
some special handling from non-pointer entries like C4Property.
Overwriting the element with a zero-initialized one removes this
requirement, leading to improved type safety on the part of
C4Property.
2019-01-01 21:35:08 +01:00
Nicolas Hake 15ad4fb690 MSVC: Disable incremental linking
LTCG doesn't work with incremental linking, but unless we explicitly
disable incremental linking, CMake tells the linker to attempt it.
2019-01-01 21:26:30 +01:00
Nicolas Hake 3a8830af6e C4Effect: Remove obsolete fire effect constants
These constants aren't used anywhere inside the engine anymore and
should therefore be removed.
2019-01-01 20:52:38 +01:00
Nicolas Hake 1b2f2889ad Old CMake: Correctly handle try_compile with language standard flags
CMake before 3.7 didn't properly pass the standard selection flags
to try_compile. Wrap try_compile on old CMake versions so that the
flag gets passed.
2018-12-31 17:34:34 +01:00
Nicolas Hake bc88820d57 Travis: Use CMake 3 on Ubuntu Trusty 2018-12-31 14:53:07 +01:00
Nicolas Hake 3edc6d9ead Fix misleading indentation on several controlled statements
The C++ standard doesn't require us to stuff multiple statements
onto the same line, so we should avoid this for readability reasons.
This is especially true if one of the statements is controlled and
others aren't.
2018-12-31 14:27:14 +01:00
Nicolas Hake dca6d2caaf C4Landscape: Correct really badly misleading indentation
Some code here was indented like it still belonged to the loop
above, but never did, and was never intended to. This is an
excellent argument for why braces are good, especially for
statements which span more than one line.
2018-12-31 14:17:23 +01:00
Nicolas Hake 7cd79b1eaa CMake: Use native Qt5 config instead of bad reimplementation
Qt5 already ships CMake configuration files with proper dependencies
so there's no need to build our own broken test for it.
2018-12-31 12:48:19 +01:00
Nicolas Hake 3b0891ba89 CMake: Remove #define for standard C++ features
We don't need to have a macro that just tells us that we're in fact
using standard C++. Especially if it isn't used anywhere.
2018-12-31 12:37:34 +01:00
Nicolas Hake b012189af4 CMake: Remove <stdint.h>, <inttypes.h> tests
<stdint.h> and <inttypes.h> are part of the C standard and available
on every platform with a conforming compiler.
2018-12-31 12:33:49 +01:00
Nicolas Hake c638647227 CMake: Remove <locale.h> test
We're not using the <locale.h> header anywhere besides including it
for no purpose, so we can drop the test (and the inclusion).
Additionally, the header is part of standard C++.
2018-12-31 12:30:06 +01:00
Nicolas Hake 8298813a90 CMake: Remove <direct.h> test
We're not using the <direct.h> header anywhere besides including it
for no purpose, so we can drop the test (and the inclusion).
2018-12-31 12:20:39 +01:00
Nicolas Hake 15f4a06cd4 CMake: Require C++14 support
CMake now supports compiler features (including language level), so
we can directly require C++14 instead of testing for compiler-
specific flags.
2018-12-31 12:15:49 +01:00
Nicolas Hake b702f1583c CMake: Update requirements to 3.5.1
CMake 3.5.1 is the version that ships with Ubuntu 16.04 LTS. Ubuntu
14.04 LTS was already unsupported by our build, so we don't need to
worry about that.
2018-12-31 11:51:21 +01:00
Nicolas Hake 606ad23e02 CMake: Deprecate CMAKE_ADDITIONAL_DEPS_PATH
The variable completely duplicates a different one and also intrudes
on CMake's own namespace. It should therefore be removed when
possible.
2018-12-31 11:34:18 +01:00
Mark a29d6f005c Added method for getting the connected object 2018-12-28 00:34:57 +01:00
Mark cd38671f61 Pipe control: Begin integrating limits into the library
Not sure about air pipes yet, those should theoretically be either
source or drain, instead of a separate connection category?

See also:
https://bugs.openclonk.org/view.php?id=1871
2018-12-28 00:14:54 +01:00
Mark 2a045a097b Renamed folder 2018-12-27 21:33:45 +01:00
Mark a8c475d212 Renamed pipe control internals 2018-12-27 21:31:36 +01:00
Mark 00b1b37787 Renamed Library_Tank to Library_PipeControl
The library did not depend on the Library_LiquidContainer script at all,
removed that include and added it to the previous includers.
Removed the IsLiquidTank() identifier, because it was unused.
2018-12-27 21:21:53 +01:00
Mark 94e200f201 Fix smoke and gravity issue
Smoke used to fly higher with gravity 40 than with gravity 10. Fixed
this by using a start value. At default gravity, light smoke will fly
rise a little higher now, and heavy smoke behaves the same.
With higher gravity the smoke may fall to the ground now.
2018-12-27 20:30:58 +01:00
Mark d0756e3b1c Producer: Allow overloading where the producer takes components from 2018-12-27 19:51:19 +01:00
Mark 68bb07f162 Allow more options for customization in the resource selection icons 2018-12-27 17:45:32 +01:00
Mark 3f2ee5080d Limit liquid input to the maximum available amount 2018-12-25 16:53:47 +01:00
Mark 1c9164b4be Collect cut pipes to Clonk inventory, if possible 2018-12-25 15:53:51 +01:00
Mark f5b1279cce Formatted code 2018-12-25 15:16:38 +01:00
Mark 431456d1fa Use new library in pump 2018-12-25 11:13:01 +01:00
Mark 8a26454f3c Library: Resource selection
The resource/material selection from the pump was practical, maybe even
applicable for cable cars and the like. Extracted a separate library for
that.
2018-12-25 11:11:44 +01:00
Mark bab1b7ee90 Extracted actual producer logic||Certain external projects have different systems and want to just use the logic on their own, without copy & paste of the file contents. 2018-12-21 21:29:45 +01:00
Mark 286d4d6a5b Added version info to the docu 2018-12-21 21:15:11 +01:00
Mark cf7469043d Simplified logic for substitutes
The production cost method returns an array of material cost arrays, but
their format has changed. Instead of
  [<default resource>, <cost>, <substitute(s)>]
it now returns an array of proplists
  [{Resource = optionA, Amount = costA}, {Resource = optionB, Amount =
costB}]
so that there are fewer cases to keep in mind: No "are there
substitutes?", but you can simply check all variants and pick the best.
This also allows different substitutions, for example "2 earth or 3
sand" is now possible.
2018-12-21 16:54:43 +01:00
Mark 36dbbd27e1 Formatted code 2018-12-21 14:26:24 +01:00
Mark c6254c2512 Added more producer tests 2018-12-21 14:05:30 +01:00
Mark 2ed69b96a5 Added producer test for substitute components 2018-12-21 11:57:39 +01:00
Mark b73169616b Fix producer test
Updating the values for substitutions was forgotten in 808e7fa, leading
to a failing test 5.
2018-12-21 11:49:56 +01:00
Mark 6bdb4275f7 Formatted code, no change in functionality
Brackets, protected/private func => func, whitespaces
2018-12-21 11:25:19 +01:00
Mark d9bc1d9142 Added callback for production progress 2018-12-21 11:08:10 +01:00
Mark 9deab8e6a9 Fix the logic again
Otherwise you can exit containers without an entrance area.
2018-12-21 09:56:19 +01:00
Mark b35a58a7fc Removed unused constants
This was a weird menu thing that I added about 2 years ago, and it is
not very useable, and not used :)
2018-12-21 09:10:33 +01:00
Mark ed514b7716 Added option for ignoring contents in the interaction menu
Also ignore Clonks as "inventory items" if they are contained.
2018-12-21 09:01:20 +01:00
Mark fcf2af1937 Fix not being able to exit a structure
It seems that the default structures have the entrance close to the
offset, so that there is an overlap and can_be_entered is true even
inside the structure.

In my case the structure offset and entrance area do not overlap, so you
could unfortunately not leave the structure.
2018-12-20 23:49:39 +01:00
Mark 6351fe7a66 GetEnergy() offers exact energy value optionally (Bug #2043) 2018-12-20 08:40:04 +01:00
Nicolas Hake 11cfcdd910 Appveyor: Stop depending on specific Qt build for building too 2018-11-18 10:15:28 +01:00
Nicolas Hake 5808ca8047 Appveyor: Stop depending on specific Qt build
AppVeyor occasionally updates platform images without really
versioning them, so in order to have a higher chance of not being
broken by those, we'll just use 5.11 instead of specifying 5.11.1
explicitly.
2018-11-18 10:02:11 +01:00
Nicolas Hake f90e424f4a Appveyor: Bundle C4Group
Users have requested that C4Group is bundled with the snapshots, and
the file itself is fairly small, so it should be fine to ship it as
well.
2018-11-14 20:03:52 +01:00
Lukas Werling 34d89adf47 Fix build on gcc 4.x 2018-10-15 21:01:15 +02:00
Clonkonaut c6d5c5044f Rework interaction menu into a new style. Also, style overloads are easily possible.
Because I did this in the test scenario first, it wasn't really possible to encapsulate different steps, sorry!
2018-10-15 17:38:22 +02:00
Lukas Werling 952cfef497 Add missing C4Include include in C4ConsoleQtShapes
Qt's moc generates another source file that includes this header without
including C4Include.h first. The generates source file thus doesn't
compile. It is unclear to me why this isn't an issue with our current
build setup (it is an issue with a meson-based build).
2018-10-14 23:19:32 +02:00
Lukas Werling a73e5fc871 undef "s" macro in C4Config
Necessary for unity builds, but also has a high conflict probability in
general.
2018-10-14 23:16:59 +02:00
Lukas Werling ca11d86893 Add missing include guards
These are necessary for unity builds.
2018-10-14 23:15:01 +02:00
Lukas Werling 7273b87b01 StdAdaptors: Replace array size macros with templates 2018-10-14 23:07:23 +02:00
Clonkonaut 2d3914b33b Fresh repository, fresh build on Windows, VS created these folders. Hope it's cool to put them on ignore. 2018-10-10 01:43:58 +02:00
Nicolas Hake a65dd5874f Appveyor: Fix library bundling path 2018-10-08 20:57:39 +02:00
Nicolas Hake ca2ba96969 Appveyor: Generate package and upload it if credentials are set 2018-10-07 20:21:17 +02:00
Nicolas Hake 6dcaaa7af5 Appveyor: Inject Google Test location 2018-10-07 20:21:17 +02:00
Nicolas Hake 9691c1e41a Appveyor: Build on Visual Studio 2017 x64 only
There is no pre-built binary package of Qt for 32 bit Visual Studio
2017, so we'll drop it for now.
2018-10-07 20:21:17 +02:00
Nicolas Hake 354b6be1c6 CI: Use AppVeyor to build MSVC binaries 2018-10-07 20:21:17 +02:00
Julius Michaelis 0d7738dce5 Drop broken GCC precompiled header support 2018-10-04 08:33:31 +02:00
Lukas Werling 04535b5438 Travis: Add update information for AppImage snapshots 2018-10-03 23:45:45 +02:00
Lukas Werling 55c34ecbd7 Add git branch to C4Version.h
The branch information is necessary for upcoming automatically-updating
snapshots. For Travis, cmake will also pick up the branch name from the
C4REVISION_BRANCH environment variable.
2018-10-03 23:44:35 +02:00
Lukas Werling 7616fa81be Travis: Update dependencies for AppImage snapshot 2018-09-25 20:02:51 +02:00
Lukas Werling 950ad4cf2f Fix C4ScriptLibrary destruction
C4PropListStaticMember must be deleted manually.
2018-09-25 20:02:51 +02:00
Lukas Werling 05e3648495 Travis: Skip TCP bind test because of missing IPv6 support 2018-09-25 20:02:51 +02:00
Lukas Werling 82feac4ccb Remove broken assert() 2018-09-25 20:02:51 +02:00
Lukas Werling 8aeef938fc Travis: Build and upload AppImage snapshot 2018-09-25 20:01:16 +02:00
Lukas Werling 8df71d3f32 Prevent parallel groups packing with ninja
For some reason, generating the groups in parallel fails frequently.
2018-09-24 19:22:32 +02:00
Lukas Werling 5395a8dc84 Add WITH_APPDIR_INSTALLATION configuration option
With this option enabled, `make install` will install the files in an
AppDir-compatible directory structure suitable for creating an AppImage.
2018-09-24 19:22:32 +02:00
Lukas Werling d8add861fe Fix LTO ar wrappers for versioned gcc executables
Debian packages older/newer gcc versions with executables named like
gcc-5, gcc-ar-5. The previous implementation did not handle this
correctly, breaking LTO-enabled linking.
2018-09-24 17:43:27 +02:00
Lukas Werling 2fb14b026d Script: Remove effect after error in Timer
As the timer tends to run more than once, you'd also very likely get the
error more than once. The timer also often determines the effect
lifetime, making a broken effect live forever.

This was especially annoying with one-off Schedule() invokations
that wouldn't even stop throwing errors after finishing the
designated number of repeats. Although fixing just that script
function would have been possible, I believe that a more general
solution for all effects is useful.
2018-08-26 23:15:05 +02:00
Nicolas Hake f5988085a7 Figure out whether a warning/error was #include'd or #appendto'd
We already notified the user on warning/error that the mistake
happened in a different script than the one we were currently
compiing. It's not too difficult to figure out whether that other
script was added due to an #include or an #appendto directive, so we
can just show the user which one it is.

We also don't show warnings in #include'd scripts anymore, since
they get compiled individually anyway and all warnings will show up
there. This way we don't duplicate warnings several times.
2018-07-24 14:35:12 +02:00
Nicolas Hake 829bb8cb28 Script functions: remove all BCCs at once instead of individually 2018-07-24 14:24:19 +02:00
Nicolas Hake 1cd3534740 C4KeyboardInput: Replace std::bind2nd &c by lambda
std::ptr_fun and std::bind_2nd have been deprecated since C++11, and
are no longer part of the standard since C++17.
2018-07-24 14:21:42 +02:00
Nicolas Hake 907c701fc6 Save scenario: Disable all warnings in auto-generated file 2018-07-24 14:20:09 +02:00
Nicolas Hake 4c5dfac952 Remove or use unused variables in Objects, System 2018-07-24 14:19:26 +02:00
Nicolas Hake 5ef52f2450 Fix variable_out_of_scope warnings in Worlds 2018-07-23 12:30:23 +02:00
Nicolas Hake 14ed608941 Fix variable_out_of_scope warnings in Missions 2018-07-23 12:30:23 +02:00
Nicolas Hake 7fb098c4df Fix variable_out_of_scope warnings in Defense 2018-07-23 12:30:23 +02:00
Nicolas Hake 1ef6b7a7fc Fix variable_out_of_scope warnings in Arena 2018-07-23 12:30:23 +02:00
Nicolas Hake 1bb728b047 Fix variable_out_of_scope warnings in Objects 2018-07-23 12:12:23 +02:00
Nicolas Hake 4c43ebf58c Warn when using variables outside of their block
When we introduce block scoping, using variables declared in a more
narrow scope from a block with wider scope will fail. Warn about
these so people can avoid it and fix their code.
2018-07-23 12:12:23 +02:00
Nicolas Hake b82cd52765 HotIce: Add closing brace omitted in c3ef039 2018-07-23 12:10:02 +02:00
Nicolas Hake a73c1998e4 Fix suspicious_assignment warnings in World 2018-07-23 10:45:52 +02:00
Nicolas Hake c4f47a6329 Fix suspicious_assignment warnings in Parkour 2018-07-23 10:45:52 +02:00
Nicolas Hake c3ef039872 Fix suspicious_assignment warnings in Arena 2018-07-23 10:45:52 +02:00
Nicolas Hake 8950db9cb4 Fix incorrect assignment instead of comparison in TutorialGuide 2018-07-23 10:45:52 +02:00
Nicolas Hake 30aa6abb55 Move PlaceBatches into System.ocg 2018-07-23 10:45:52 +02:00
Nicolas Hake 05ca450111 Fix suspicious_assignment warnings in Missions 2018-07-23 10:45:52 +02:00
Nicolas Hake 806357e283 Fix suspicious_assignment warnings in Defense 2018-07-23 10:45:52 +02:00
Nicolas Hake 808a90e5af Fix suspicious_assignment warnings in Decoration 2018-07-23 10:45:52 +02:00
Nicolas Hake e024bef54b Fix suspicious_assignment warnings in Objects, System 2018-07-23 10:45:52 +02:00
Nicolas Hake 81dff1b92a Disable suspicious_assigment warning in for conditions
While I do not agree with the idea of using straight assignments in
the condition of a for loop, people are divided on the argument and
lots of old code uses it.
2018-07-23 08:29:46 +02:00
Maikel de Vries ddc68d7ad3 column: proper rotation and allow smaller sizes 2018-07-04 08:30:53 +02:00
Maikel de Vries c3b114042d melt snow and ice much faster while submerged in lava 2018-07-04 08:17:11 +02:00
Maikel de Vries c47b790468 remove recently introduced debug logs 2018-06-25 08:49:10 +02:00
Maikel de Vries 7a933e81b7 windbag: scenario save full load to prevent air intake at scenario start 2018-06-23 15:36:20 +02:00
Maikel de Vries 5bb9fa228a ladder: climb up and down smoothly when grabbing ladder
I don't know the reason for not having this, but now we mimic normal wall climbing behaviour which is much smoother and leads to faster game play.
2018-06-23 10:05:45 +02:00
Maikel de Vries b11a25db4b fire: only reduce own fire strength if incineration of nearby object was successful 2018-06-23 10:05:45 +02:00
Maikel de Vries 446564f703 implement eternal flame saving 2018-06-23 10:05:45 +02:00
Lukas Werling f8c0fe6f82 Fix fallthrough in command line parsing 2018-04-23 12:12:32 +02:00
Lukas Werling 6d5dc2b92e c4group -l: Print both file and contents CRC
The contents CRC is the number that actually counts for group equality,
whereas the file CRC may differ, for example because of different
compression.
2018-04-21 21:41:28 +02:00
Martin Strohmeier a51560ce4f Add Nautilus to music folder 2018-04-21 15:13:32 +02:00
Romain Naour 4ae0a92d39 CMake: add C4GROUP_TOOL_ONLY
When cross-compiling c4group should be build for the host
machine before building OpenClonk for the target.

Without C4GROUP_TOOL_ONLY option, we have to build OpenClonk
for the host.

C4GROUP_TOOL_ONLY allow to build only c4group tool for the
host.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
---
With this patch I can build OpenClonk with Buildroot.
2018-04-21 10:58:31 +02:00
Romain Naour 87b60e99f6 CMake: use FIND_PROGRAM
While cross-compiling, it is easier to find a binary
from the patch using FIND_PROGRAM instead of using
a cmake file.

Try to find c4group native tool with FIND_PROGRAM and
fallback to the cmake file if c4group is not found.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
2018-04-21 10:18:50 +02:00
Romain Naour 48c38c91dc CMake: build libmisc and libc4script statically
As reported by [1], some distributions use shared libraries as
default preset in CMake.

Without explicitely linking statically libmisc and libc4script,
we have the following link issue:

[...]/host/bin/x86_64-linux-g++ --sysroot=[...]sysroot
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os
-std=gnu++14 -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  -DNDEBUG
-rdynamic CMakeFiles/c4group.dir/src/c4group/C4GroupMain.cpp.o
-o c4group
-Wl,-rpath,[...]/build/openclonk-7.0:
liblibmisc.so -lz -lpthread -lrt
liblibmisc.so : référence indéfinie vers « C4LangStringTable::Translate(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const »
liblibmisc.so : référence indéfinie vers « C4LangStringTable::system_string_table »

[1] https://github.com/openclonk/openclonk/pull/26

While at it, build libopenclonk statically since libopenclonk is not
installed by the CMake build system.

Signed-off-by: Romain Naour <romain.naour@gmail.com>
2018-04-21 10:18:50 +02:00
Lukas Werling 9fed69f3fa Add resolution uniform for sprite and mesh shaders (#2031)
The landscape shader already has such a uniform.
2018-04-18 12:02:43 +02:00
Lukas Werling 9a6772c27e Fix phase by xdir for DFA_Push (#2030) 2018-04-18 11:35:28 +02:00
Maikel de Vries 899fbaa867 cable cars: let sawmill send empty hoist to pickup trees 2018-04-16 11:13:32 +02:00
Maikel de Vries a4d20d79d5 cable cars: extend order interface and let producer order more components at a time 2018-04-16 11:13:32 +02:00
Mark 75a82e172a Added a generic ambient sound object
Is more versatile than Ambience_Zicadas. Could need some editor
functions. Backported from OC Classic.
2018-04-14 14:12:52 +02:00
Mark 25d008e99d FatalError: Allow formatting the message directly
FatalError(Format(...)) was necessary previously. Actually it seems not
like a huge thing, but being able to format the string directly in
FatalError is a lot more convenient.
2018-04-12 21:39:06 +02:00
Maikel de Vries 1e060d6124 cable cars: improve deliveries and producer requests fuel 2018-04-12 09:21:00 +02:00
Maikel de Vries 618b4039b3 cable cars: fix finding crossing for power supply when previous fails 2018-04-12 09:21:00 +02:00
Maikel de Vries 051863db5f make cable crossing structure flippable
This makes it easier for now to go around cliffs, a better solution where crossings can be rotated needs more work in the hammer script.
2018-04-12 09:21:00 +02:00
Maikel de Vries f4991f9705 remove base respawn rule
Is deprecated in 8.0 and can be removed now, all functionality is implemented in the relaunch rule.
2018-04-12 09:21:00 +02:00
Julius Michaelis 5e60579bd2 Document the zoom factor in Graphics.8.png in sdk/definition/index 2018-04-12 01:41:32 +02:00
Maikel de Vries c00a8cf3c3 fix a bunch of suspicious assignment warnings 2018-04-09 11:53:55 +02:00
Lukas Werling d9f9a2a9a3 Find_Property: Implement searching for specific value (#2021) 2018-04-08 15:00:27 +02:00
Mark 5dc4282b56 Replaced old calls to GainMissionAccess 2018-04-05 19:36:50 +02:00
Mark 4212310a9f Renamed *MissionAccess functions
Added legacy wrappers and updated the documentation.
2018-04-05 19:34:16 +02:00
Sven Eberhardt 065c8b7d96 Fix zoom setting by PlayerStart object 2018-04-04 19:59:32 -07:00
Mark a987f87181 Add version parameter to legacy warning 2018-04-04 21:49:39 +02:00
Nicolas Hake 704994f1b9 Remove warning on assignment in while() conditions (for now) 2018-04-04 21:42:24 +02:00
Mark 75bfef6b06 Use SetNextScenario() in the scenarios 2018-04-04 21:22:04 +02:00
Mark 1682f62df8 Function: SetNextScenario
Renamed and documented the former function SetNextMission. Added a script wrapper for the old function that issues a warning. Renaming is based on the fact that the docu speaks of scenarios, and other functions, such as GainScenarioAchievement already use this terminology
2018-04-04 21:17:16 +02:00
Maikel de Vries 82e674ddb8 cable cars: make crossing proper structure and resource chute upgrade 2018-04-02 16:03:52 +02:00
Maikel de Vries a70ab8b843 cable cars: let steam engine request coal when needed 2018-04-01 20:54:12 +02:00
Maikel de Vries 7178cf6a0a cable cars: improve hoist destination selection 2018-04-01 20:54:12 +02:00
Maikel de Vries 42a62aa730 cable car: make car a power consumer via crossings 2018-04-01 20:54:12 +02:00
Maikel de Vries 3085bfd264 power system: add functions to check if production and consumption is registered 2018-04-01 20:54:12 +02:00
Mark b12e54ef21 New coal texture 2018-04-01 20:29:54 +02:00
Lukas Werling 1382478774 Extract Goal_MultiRoundMelee from HotIce
There are currently multiple multi-round scenarios in development that
all copy most of HotIce's >500-line scenario script for the multi-round
logic. This commit isolates that logic in a goal with an easy-to-use
interface.
2018-03-31 16:08:29 +02:00
Maikel de Vries 07e66279be cable cars: scenario saving for cable car 2018-03-31 11:33:08 +02:00
Maikel de Vries 816754a3de cable cars: improve tests and script clean up 2018-03-31 11:32:42 +02:00
Maikel de Vries c629661af2 cable reel: fix connecting, max cable length, ensure straight cables 2018-03-31 10:44:36 +02:00
Maikel de Vries a28b3b9ca1 cable cars: fix network recreation when cable has broken 2018-03-30 10:54:41 +02:00
Maikel de Vries d8736a56ac cable cars: improve network deletion and recreation + clean up
This is a rather chaotic commit and does not solve all problems of network creation yet, but is an improvement over the old system where deletion of a cable line would fail the network. However, we probably need a cleaner method to construct a network properly.
2018-03-29 21:28:07 +02:00
Maikel de Vries 49d03e52c6 improve cable car test scenario 2018-03-29 21:28:07 +02:00
Maikel de Vries 2b9c96de30 make hoist target move more fluently 2018-03-29 21:28:07 +02:00
Maikel de Vries ff21dc3cfa improve destination selection menu a bit 2018-03-29 21:28:07 +02:00
Maikel de Vries 330e275b3d cable hoist: new type effect, prevent interactions when attached, complete menu texts 2018-03-29 21:28:07 +02:00
Maikel de Vries 85f1c714f7 add material costs to cable car components 2018-03-29 21:28:07 +02:00
Maikel de Vries 7768e6c992 fix script error when accessing non-initialized cable request queue 2018-03-29 21:28:07 +02:00
Maikel de Vries abfeb86e30 add cable cars test scenario 2018-03-29 21:28:07 +02:00
Maikel de Vries d7e3a4acd6 cable car: not ready for a new delivery if currently doing one 2018-03-29 21:28:07 +02:00
Maikel de Vries b1d1079d88 prevent script error in cable station if other station could not be found 2018-03-29 21:28:07 +02:00
Maikel de Vries e603bce240 add interaction menu tooltip and description for disengaging a cable car 2018-03-29 21:28:07 +02:00
Maikel de Vries 2a344b4543 fix hide in editor for cable car objects 2018-03-29 21:28:07 +02:00
Nicolas Hake 18b23d3d1e Merge pull request from ckanibal:slashfix
Slashfix (GH-68)
2018-03-29 14:48:45 +02:00
Nicolas Hake b0336bc1a6 Merge pull request from ronnystandtke:patch-1
Update openclonk.desktop (GH-67)
2018-03-29 14:46:35 +02:00
Lukas Werling 8d6090e607 Fix documentation of OverlayType
Bit 3 (C4MatOv_Monochrome) was removed in fc5c38468 ("Material: Remove
color field, use textures as is", 2009), but was still mentioned in the
documentation.
2018-03-27 19:20:21 +02:00
Nicolas Hake c73b8b3ece Warn on assignments where an expression is expected
This introduces a new diagnostic (suspicious_assignment) which
issues when an the compiler finds an assignment either where a
condition is expected or as the parameter to return.
2018-03-27 08:12:21 +02:00
Lukas Werling 99c14b5547 docs: Drop major version part from <version>s
The actual release names dropped the 5.x.x scheme long ago, so there is
no reason to keep it in the docs. It's extra confusing there because the
version is given as a two-part version (e.g. 5.1) most of the time, so
it looks like everything happened in OC 5.x, even though the change was
actually in OC x.0.
2018-03-24 23:13:08 +01:00
Lukas Werling 8e17d7fd7b docs: Fix case-sensitivity in search 2018-03-24 22:19:58 +01:00
Lukas Werling f4c854b651 docs: Implement client-side search
Search is now performed with a pre-computed index file. This commit
removes the old PHP-based search.
2018-03-23 21:23:38 +01:00
Mark 6aa72c1bdd Fix axe 2018-03-22 22:12:00 +01:00
Nicolas Hake b12792dddb Merge branch 'blake2-no-sse2' 2018-03-21 13:04:15 +01:00
Nicolas Hake e0850947bf BLAKE2: Fall back to plain C implementation on non-amd64 platforms
While amd64 always supports the SSE2 instruction set extension,
other architectures don't (including 32 bit x86). For the platforms
that don't, we'll use the reference C implementation by default, but
allow users to override it with the BLAKE2_USE_SSE2 option.
2018-03-21 13:00:40 +01:00
Nicolas Hake 570ba7a8ad Merge branch 'blake2-no-sse2'
This adds the BLAKE2 reference C implementation as a fallback for
architectures that don't guarantee SSE2 support out of the box.

Closes GH-69.
2018-03-21 07:58:56 +01:00
Nicolas Hake 1dd7cbb04a BLAKE2: Fall back to plain C implementation on non-amd64 platforms
While amd64 always supports the SSE2 instruction set extension,
other architectures don't (including 32 bit x86). For the platforms
that don't, we'll use the reference C implementation by default, but
allow users to override it with the BLAKE2_USE_SSE2 option.
2018-03-21 07:51:52 +01:00
Lukas Werling 69a08605cb docs: Change http:// links to https 2018-03-20 21:59:47 +01:00
Mark 21102bb4ef Melee Weapons: Code formatted for remaining melee weapons
No actual changes, just added spaces and brackets for improved readability
2018-03-20 21:13:45 +01:00
Mark 69d6b2e8d2 Melee Weapons: Code formatted
No actual changes, just added spaces and brackets for improved readability
2018-03-19 20:51:29 +01:00
Nicolas Hake 288e9f339b Merge commit '9493ed1277ef924c3005a9ff51f194d1cda87947' as 'thirdparty/blake2' 2018-03-19 13:50:17 +01:00
Nicolas Hake c39d1b8679 Merge commit '9493ed1277ef924c3005a9ff51f194d1cda87947' as 'thirdparty/blake2' 2018-03-19 13:50:17 +01:00
Nicolas Hake 9493ed1277 Squashed 'thirdparty/blake2/' content from commit beb75f451
git-subtree-dir: thirdparty/blake2
git-subtree-split: beb75f4512223e6a3a03a48992345256c5ef393a
2018-03-19 13:50:17 +01:00
Nicolas Hake ae0baf587d Remove BLAKE2b implementation requiring SSE2 2018-03-19 13:47:01 +01:00
Mark aea27f8758 Construction site: Take missing materials as interaction 2018-03-18 19:53:57 +01:00
Clonkonaut 4199a4060e Documentation: fixed example for GetRGBaValue(). 2018-03-18 13:41:23 +01:00
Clonkonaut 6f521a0805 Tutorial 8: fix in German language dialogue (#2009). 2018-03-17 17:21:18 +01:00
Clonkonaut 80b3a08770 Removed my stupid debug log. 2018-03-17 16:41:27 +01:00
Clonkonaut 4b0bca3c0d Tutorial 2: Tell the player about Roger a bit earlier (when entering the junction), so you do not miss him and mess up the scenario. 2018-03-17 16:31:43 +01:00
Maikel de Vries 52d8fdbafd warn about deprecated use of base respawn rule 2018-03-16 18:16:05 +01:00
Maikel de Vries 81b060ffb3 fix king of the hill graphics in editor mode 2018-03-16 14:00:04 +01:00
Maikel de Vries ffbda90130 convert paths to backslashes for Scenario.txt Definition entries 2018-03-16 13:54:52 +01:00
Kanibal f24d685a47 win32: fix handling of forward slashes 2018-03-15 23:49:00 +01:00
Maikel de Vries 3da209462e moving brick: fix movement graph saving
Did not test all corner cases but this improves the situation for sure.
2018-03-14 17:54:25 +01:00
Maikel de Vries 6efb292fa7 flame: option to make eternal for editor mode 2018-03-14 16:50:57 +01:00
Maikel de Vries f81d41ba84 correctly update active fire effect when NoBurnDecay changes 2018-03-14 16:38:33 +01:00
Maikel de Vries 017960cbc2 do not show compensator burning battery in editor creation list 2018-03-14 16:35:11 +01:00
Maikel de Vries 9ffab151c6 remove duplicate cloud effect object
The particle had the same graphics as the real Cloud object and the script does not seem to have any uses. Also unused for more than 4 years.
2018-03-14 11:49:02 +01:00
Maikel de Vries 3808c22df4 make time object more editor friendly 2018-03-13 22:32:03 +01:00
Maikel de Vries e084947bcd fix meteor graphics 2018-03-13 20:40:33 +01:00
Maikel de Vries d01aaa20bd waterfall: implement editor interface 2018-03-13 20:37:46 +01:00
Maikel de Vries b534bbb5f9 hide some more objects in editor creation list
The burned object may be creatable, but must then be moved such that the libraries parent folder remains invisble in the editor.
2018-03-12 22:30:02 +01:00
Maikel de Vries e7b4ce7bf2 relaunch rule: fix scoreboard updating and scenario overloading 2018-03-11 17:06:02 +01:00
Maikel de Vries 9fc94509c4 remove playground scenario
Sandbox is the new playground.
2018-03-11 17:06:02 +01:00
Maikel de Vries 0e535f880e sandbox: more scenario options and better map generation 2018-03-11 17:06:02 +01:00
David Dormagen 29a1a21526 club respects Rule_NoFriendFire and IsProjectileTarget (#1993)
Not recommended for 8.1, because there are semantic changes: The club can now also hit targets (IsProjectileTarget) while before it could only hit OCF_Alive and C4D_Object. It's similar to the sword now.
Oh, and before it could also not hit livings that were stuck.
2018-03-11 15:04:59 +01:00
Lukas Werling 99ef4ce853 Implement TCP Simultaneous Open for IPv6 2018-03-09 23:20:00 +01:00
Lukas Werling 9a5103d02c Don't link openclonk-server with SDL and audio libraries
Seems to build fine without, which apparently wasn't always the case.
2018-03-09 23:10:11 +01:00
Lukas Werling ee34ac1b06 Add C4NetIOTCP::Bind() for binding without connect 2018-03-07 17:30:58 +01:00
Lukas Werling 82a43b7cd9 Disable broken console input on Windows
C4StdInProc blocks on read() on Windows, stopping everything.
2018-03-07 15:27:51 +01:00
Maikel de Vries 1748797172 treasure hunt: fix wrong dialogue translation of Dagobert to Scrooge 2018-03-05 10:40:14 +01:00
Maikel de Vries 2d0221b8d0 add wooden sign object
Graphics made by Foaly.
2018-03-04 09:43:44 +01:00
Maikel de Vries 478a4e7f85 signpost and stone sign: clean up scripts and lessen code duplication 2018-03-04 09:37:20 +01:00
Maikel de Vries 03d0bb49dc c4script: some fixes for style guidelines and typos 2018-03-03 12:27:34 +01:00
Maikel de Vries e9f87ca028 add stone sign object
Graphics made by Foaly.
2018-03-03 12:22:19 +01:00
Maikel de Vries 65daa55156 fix guide post pictures and interaction icons 2018-03-03 12:19:03 +01:00
Maikel de Vries a2d7374302 prevent floor switch from making object stuck while moving 2018-02-28 10:35:17 +01:00
Maikel de Vries a023b63fda item spawn: prevent pickung up two carry heavy objects 2018-02-26 12:25:00 +01:00
Maikel de Vries f199169c8f item spawn: instantly pick carry heavy items 2018-02-25 21:32:27 +01:00
Nicolas Hake 701adc2eae Enable SSE2 for BLAKE2 library 2018-02-25 12:50:08 +01:00
Maikel de Vries 0c12b02727 keypad: save code hashed, so that they can't be read off in editor mode 2018-02-25 11:31:39 +01:00
Nicolas Hake e3de9f1003 Add BLAKE2 library and expose its a CS hash algorithm to script
The crypto "library" only consists of a single function at the
moment because that's all that users have asked for so far. It is
also highly experimental. We will make an attempt to keep the public
interface (i.e. the interface provided by Library_Crypto.c) stable,
but it might still change if necessary. The internal interface
(provided via the global _Crypto proplist) is not for public
consumption and will probably change at some point.
2018-02-25 10:23:30 +01:00
Nicolas Hake 8e57c0a9f4 Make cross-compiling work with GCC 6+
GCC6 doesn't like getting some of its default include search paths
passed with the -isystem flag, and the devs seem unlikely to change
whatever they did back to before they broke it. Work around CMake
not dealing with it well either by figuring out the paths at
configure time and telling CMake about them so it can avoid adding
them superfluously.
2018-02-25 01:11:53 +01:00
Maikel de Vries 3224e2c5cd fix dialogue image size for use as icon 2018-02-21 17:15:41 +01:00
Maikel de Vries 1f1149861a add star icon 2018-02-21 15:30:48 +01:00
Lukas Werling 4a3c9f2fc2 Add EvaluateOnAbort scenario flag for Tower of Despair
In Tower of Despair, the scenario saves per-room progress in the
player files. Players win individual rooms, but never the whole
scenario. Consequently, they currently have to give up to make sure
they don't lose their progress. This is not intuitive at all. With the
new flag enabled, players will be saved even if the scenario is aborted.
2018-02-18 21:46:56 +01:00
Lukas Werling fa3e8c2a50 Fix editor keyboard input on FreeBSD (hopefully)
Assuming keyboard scancodes on FreeBSD are the same as on Linux.
2018-02-18 01:05:28 +01:00
Lukas Werling c0375bba72 Fix IPv4 address serialization on FreeBSD (hopefully) 2018-02-18 00:42:17 +01:00
Lukas Werling 5b21505efd Editor join: Serialize reference as INI
On FreeBSD, the binary serialization doesn't work for IPv4 addresses,
and we never serialize game references as binary anywhere else.
2018-02-18 00:30:08 +01:00
Lukas Werling 55a81ea76a Launch editor via argv[0] on Unix systems without /proc/self/exe (#1999) 2018-02-17 12:57:43 +01:00
Lukas Werling 9855f9355e Autodetect "/proc/self/exe"-equivalent on FreeBSD (#1999) 2018-02-17 12:41:16 +01:00
Lukas Werling 334c57f296 Disable -Wformat-security in parts of C4AulCompiler (#1992, GH-64) 2018-02-17 12:12:16 +01:00
Kevin Zheng 0c8371f113 Fix networking on FreeBSD (#1998) 2018-02-17 11:59:24 +01:00
Lukas Werling e3017ba4ac Credits: Fix Kevin Zheng's name 2018-02-17 11:56:57 +01:00
Sven Eberhardt 9c32ee0336 Make QT library deployment optional via CMake option DEPLOY_QT_LIBRARIES (default off) 2018-02-15 21:40:25 -08:00
Sven Eberhardt b95dd50564 Simplify DeployQt to work with CMake<3.2 (hopefully). 2018-02-14 21:33:06 -08:00
Mark b0a790c747 Volcano: Fix copy & paste error 2018-02-13 23:28:38 +01:00
Mark c792833d98 Volcano: Additional script possibilities
Added settings for minimal and maximal strength, reset to defaults if passing nil as a parameter, possibility to overload chunk effects on eruption
2018-02-13 23:23:00 +01:00
Mark f62050cf5b Docu: Volcano strength 2018-02-13 23:03:11 +01:00
Sven Eberhardt 8a050c1ff9 Disable Qt library deployment for mac.
Doesn't seem to work on the autobuild server.
2018-02-12 21:51:50 -08:00
Sven Eberhardt 9df7a193e4 Deploy Qt libraries; fix platforms NSIS installer include 2018-02-12 21:44:18 -08:00
Armin Burgmeier ef1e348442 Install platforms/ folder in windows installer 2018-02-12 19:58:03 +01:00
ronnystandtke 26af088548
Update openclonk.desktop
- added a German translation of the GenericName field
- left out the "multiplayer" part, because OpenClonk is also a very fine single player game but this would make the German translation much too long...
2018-02-12 16:08:47 +01:00
Julius Michaelis a130f59f54 Fix mac build likely broken in 13f082e8c8. (Attempt 1) 2018-02-12 11:28:14 +01:00
Misty De Meo b492ae456f osx_bundle_libs: skip system libraries 2018-02-12 02:57:05 +01:00
Maikel de Vries f9e7a983f2 docs: removed obsolote Components entry and add IsEditor function 2018-02-11 10:33:58 +01:00
Maikel de Vries 18dce041e1 floor switch: improve object detection and save switch mass 2018-02-09 11:30:58 +01:00
Lukas Werling 08edf3bb58 Enable -Wformat-security for gcc and fix one warning (GH-64)
Fedora has -Werror=format-security enabled per default, so enabling and
fixing these warnings is a good idea.
2018-02-06 23:31:50 +01:00
Maikel de Vries 3ad91ee02b add stalactites to hot ice as decoration (#1564) 2018-02-05 16:54:02 +01:00
Maikel de Vries 42310548d8 stalactite: fix raindrop, allow placing in sky, fix stalagmite, clean up 2018-02-05 16:53:07 +01:00
Maikel de Vries e94a0b3c36 molten monarch: fix fire particles and fade out gravestones (#1560) 2018-02-05 15:04:46 +01:00
Maikel de Vries 81abbce77a flammable library: burned object copies motion from inflamed object 2018-02-04 21:20:39 +01:00
Lukas Werling cd2b8370da Fix warnings in DirectExec crashing (#1990) 2018-02-04 12:33:58 +01:00
Maikel de Vries 369e2d0b0c sandbox: remove god mode objects on departure
This ensures that their too large graphics do not appear for the player, the only departure is when the clonk dies or is removed.
2018-02-03 09:34:45 +01:00
Maikel de Vries 1113761679 sandbox: use spraycan and overload functionality 2018-02-01 21:38:24 +01:00
Maikel de Vries 3a866caa73 maze: fix warning for declaration of variables and move spray can to Decoration.ocd 2018-02-01 21:23:14 +01:00
Maikel de Vries 22ca0513cc remove strange pixel artefacts from signpost graphics 2018-02-01 20:58:13 +01:00
Maikel de Vries d65dd96851 sandbox: add english translations and clean up scripts 2018-02-01 20:55:24 +01:00
Lukas Werling 8f285299d1 Fix Mortimer missing in Credits 2018-01-31 21:18:27 +01:00
Lukas Werling 1f94d66000 Bump version to 9.0 alpha 2018-01-31 21:08:32 +01:00
Lukas Werling 13f082e8c8 Implement Credits.txt export from StartupAboutDlg
Pressing Ctrl+S while on the Credits screen will save everything to
Credits.txt in the current working directory. This is only meant for
developers modifying the credits; the shortcut isn't mentioned anywhere.
2018-01-31 21:07:09 +01:00
Maikel de Vries 9e01a861ce fix some more structure vertices, also for asymmetric ones when flipped (#1979) 2018-01-31 19:59:41 +01:00
Maikel de Vries 18bb8371d3 ... and remove log used to find the problem 2018-01-30 21:29:45 +01:00
Maikel de Vries 041597971f fix typo in ladder library that adds an infinite amount of effects to the clonk over time 2018-01-30 21:28:30 +01:00
Maikel de Vries 8889a68127 horrid highway: fade out trains if they are taking too long 2018-01-29 10:16:14 +01:00
Lukas Werling 53f29ccb96 Update remaining Version entries from 7 to 8,0
Maikel missed some in aa89217 ("update version to 8.0 in DefCore.txt,
Scenario.txt and Version.txt").
2018-01-28 23:09:06 +01:00
Lukas Werling 44172576af Add NativeException to credits 2018-01-28 21:16:14 +01:00
Arne Schauf 8ad13a4d51
Fix german description typo 2018-01-28 17:54:47 +01:00
Lukas Werling 0f78e63f02 Add warning for broken runtime join (#1109)
This also fixes the "no runtime join" error appearing for pre-lobby
games, where joining usually works anyways.
2018-01-28 17:34:45 +01:00
Lukas Werling 223ab6f77b Add warning about unfinished gamepad controls 2018-01-28 17:18:20 +01:00
Julius Michaelis 56cac7a4e2 Set C4VERSIONEXTRA to rc1 2018-01-28 14:02:38 +01:00
Maikel de Vries aa892171fb update version to 8.0 in DefCore.txt, Scenario.txt and Version.txt 2018-01-28 13:18:46 +01:00
Julius Michaelis f39ce4f25c Make arrows burn (#1983) 2018-01-28 12:51:14 +01:00
Kanibal 4dd97d266e C4LoaderScreen: use const string reference
C4LoaderScreen: compare file extension case-insensitive
2018-01-28 11:07:05 +01:00
Kanibal 384472f183 Modernize loader loading code (#1748) 2018-01-28 11:07:05 +01:00
Julius Michaelis 1a5a60c39e Move warning about #1965 to a better place (see d175f776a) 2018-01-28 01:14:25 +01:00
Julius Michaelis d175f776ad Warning about #1965 so if we release 8.0 without fixing that bug, hopefully nobody will stumble over it. 2018-01-27 22:21:18 +01:00
Maikel de Vries 41cecc6a6f liquid tank: show to which object the pipe is connected in interaction menu 2018-01-25 13:44:57 +01:00
Maikel de Vries 0b42dc8e20 fix implicit_range_loop_var_decl in Ambience object script 2018-01-24 19:50:35 +01:00
Maikel de Vries ea72e2e542 clean up library vendor script
Also set up buy all available on shift + click for testing
2018-01-24 17:44:42 +01:00
Maikel de Vries a13b7c48ab AI: put on wearables if in inventory 2018-01-24 17:41:07 +01:00
Maikel de Vries 73dbc72f34 make friendly fire rule also work for lightning strikes and punches 2018-01-24 11:42:19 +01:00
Maikel de Vries 65c279233e improve enemy finding for defense AI
The path finder seems quite slow if a lot of AI enemies are around and can't find a path...
2018-01-23 11:35:47 +01:00
Maikel de Vries 26fe0d089a fix possible script error in destructible library 2018-01-23 11:34:13 +01:00
Maikel de Vries 29aedb36f2 fix scenario saving of hand items for golden statue 2018-01-22 21:00:13 +01:00
Sven Eberhardt bb7afe5850 Missions/Raid+TreasureHunt: Oil barrels are actually filled with oil and don't empty. 2018-01-21 21:53:01 -08:00
Sven Eberhardt ceab026780 Missions/Raid: Fix Pyrit hat and activity 2018-01-21 21:40:25 -08:00
Sven Eberhardt 88d1136215 Missions/Raids: Add signpost texts 2018-01-21 21:36:44 -08:00
Maikel de Vries d411f07fda carry heavy: add option for scripters to skip pick up animation
This is probably not the cleanest solution but I needed one and could not think of a better option.
2018-01-21 09:44:48 +01:00
Maikel de Vries 2b4e40e589 improve AI for defense rounds (boom attack path finding) 2018-01-21 09:44:48 +01:00
David Dormagen 3acd4a22f2 take 'left' and 'player' (and more) out of global namespace
The values from the enums are converted to numbers a lot, so using an enum class would be counter-productive.
Having 'left' in the global namespace appeared to be an actual problem with some Qt headers, according to Fulgen.
2018-01-20 18:20:51 +01:00
Julius Michaelis 735a29103f Suggestion for #1765/Acid Drilling: Add a statue that requests an acid bath. 2018-01-20 00:09:06 +01:00
David Dormagen fda3eecd84 made structures either flippable or prevent it completely (#1980)
Foundry is now flippable. SteamEngine is not yet flippable due to collection zone (could use similar solution as foundry).
Pump is not yet flippable, because I don't want to test the bazillion combinations of states of the pump now - maybe after a release.
2018-01-19 17:16:10 +01:00
Maikel de Vries e7354ac4b1 defense enemy: add bomber plane
This is a first attempt at an AI flying an airplane and is still very basic.
2018-01-19 14:37:21 +01:00
Maikel de Vries 0bac4579ef fix other script usages of SimFlight 2018-01-19 14:37:21 +01:00
Maikel de Vries 92aba45914 fix diving animation prediction for clonk
And no! randomly multiplying by 2 is not a solution...
2018-01-19 14:37:21 +01:00
Maikel de Vries dc7734e223 FnSimFlight: fix precision of velocity if not provided 2018-01-19 14:37:21 +01:00
Maikel de Vries 0086f236c1 defense goal: improve scoreboard, description and enemies 2018-01-19 14:37:21 +01:00
Maikel de Vries f3626469b2 ensure proper saving of pipe lines to prevent line breaks 2018-01-19 14:37:20 +01:00
Maikel de Vries f815892b19 fix and unify message showing for goals and rules in F menu 2018-01-19 14:37:20 +01:00
Julius Michaelis 9d61cc9bc9 Fix Mac build broken in b11564168, attempt 2 2018-01-19 13:01:26 +01:00
Julius Michaelis 914d3798a4 Addedum to the control fixes in b11564168 (#1693, #1982):
- Allow configuring keyboard keys with modifier keys
 - Allow using Alt as a key in game on linux
   (I'm still puzzled why only Ctrl and Shift where implemented in so many places)
 - Adjust the deserializer and PlayerControls.txt to match the serializer for mouse keys
 - Refactor C4PlayerControl::DoMouseInput a little bit
 - Try to fix the Mac build (attempt 1)
 - Fix a bug in C4KeyCodeEx::CompileFunc where it set an incorrect KeyComboItem::sKeyName
 - Fix(?) StdCompilerConfigRead not doing anything on NoSeparator
2018-01-19 11:23:51 +01:00
Clonkonaut 9eef4e2a9f Make various vertices more symmetrically laid out and more fitting to the shape (#1979). 2018-01-18 02:32:54 +01:00
Lukas Werling ad66ba3145 Krakatoa: Fix spawn position of rejoining players 2018-01-17 00:09:27 +01:00
Lukas Werling 04ee087e7d Krakatoa: Don't reduce flag radius (#1981)
The scenario doesn't have an expansion goal anymore, so I don't see why
we'd want to restrict the radius - especially when that doesn't work
properly.
2018-01-17 00:09:27 +01:00
Mark 4db6300789 Test #1974: Improved test
The test can now actually reproduce the bug before it was fixed, and proves that it does not appear anymore now that it is fixed.
2018-01-15 22:19:05 +01:00
Maikel de Vries 601ca111c9 AI: pass effect to ExecuteJump() to prevent script error 2018-01-15 18:42:31 +01:00
Maikel de Vries 4aa0801762 speed up ladder search by clonks using Find_Property 2018-01-15 17:32:48 +01:00
Julius Michaelis b115641685 Allow using mouse keys and key combinations from the control assignment configuration dialogue (#1693, #1692) 2018-01-15 00:28:13 +01:00
Lukas Werling 417d10ed97 HotIce: Fix EciToh lava with Sky background 2018-01-14 21:27:28 +01:00
Maikel de Vries 42dfc79359 ranged AI: aim at bottom of structures to trigger explosions on basements or solid ground 2018-01-14 15:27:11 +01:00
Maikel de Vries 3c9dc104b3 defense boom attack: fix destruction tracking 2018-01-14 15:26:27 +01:00
Clonkonaut 16adcfff73 Detach any visible objects upon Death (#1974). 2018-01-14 14:48:03 +01:00
Maikel de Vries 07ea7f2791 (#1969): improve situation for structures that want to accept vehicles to be entered 2018-01-14 14:45:48 +01:00
Maikel de Vries 705ab86078 defense: improve goal info and script, king of the hill scenario 2018-01-14 14:42:16 +01:00
Maikel de Vries b5152e1215 do not show trajectory for script players to prevent lag 2018-01-14 14:42:16 +01:00
Mark 7b13b3455c Fix #1969: Prevent pushing vehicles into buildings where they are irretrievable 2018-01-14 14:34:27 +01:00
Mark 88aac09064 Test for #1974
The test cannot reproduce the bug at the moment, so consider it a prototype.
2018-01-14 13:34:27 +01:00
Lukas Werling 5944146f2b Fix more broken entries in Scenario.txt (#1910) 2018-01-13 18:57:32 +01:00
Maikel de Vries d2a8f2503c GILD: replace dynamite box with lantern (#1808) 2018-01-13 18:35:15 +01:00
Maikel de Vries 05268d140b GIDL: do not make stone doors static back 2018-01-13 18:26:20 +01:00
Maikel de Vries 187b887cdf ensure license abidance for liquid tank placeholder image 2018-01-13 18:11:14 +01:00
David Dormagen 825ad64afd AimManager: fixed incorrect use of PauseUse leading to aiming without holding CON_Use (#1691)
PauseUse can be called between ControlUseStart and ControlUseStop/Cancel. In this case ControlUseStop set aim_stop=1 but didn't actually stop reloading (which is somewhat fine). However, this led to PauseUse being called when e.g. tumbling or climbing.
And this again would lead to CON_Use being reissued even though the mouse button was not held down, leading to the Clonk being in aim mode.

The functional change here is that you will not continue reloading after tumbling/climbing when you are not holding down CON_Use anymore, which is consistent with other stuff.
2018-01-13 16:05:46 +01:00
Maikel de Vries c3dfdc5894 fix connecting multiple pipes to the refinery drain 2018-01-13 15:28:41 +01:00
David Dormagen 6b797e300e inventory bar: stack count always falls back to contained object count
Related to #1970 and 5fc07df757
This replaces the very hacky implementation just for the dynamite with a more general solution (and e.g. also works with the grenade launcher).
2018-01-13 15:24:08 +01:00
David Dormagen 12da14d603 structures: made very low damage repairable
When the damage times the total component value was much lower compared to the total HitPoints (e.g. with basements), the damage could sometimes not be repaired.
This is fixed now.
2018-01-13 15:04:15 +01:00
David Dormagen 38d937fa58 GetProperties: fixed returning of duplicated property names & too high repair costs
var a = {B=1}; var b = new a {B=1}; would include "B" twice in the list of properties.
This lead to an actual issue when calculating component value for repairing buildings
2018-01-13 15:02:19 +01:00
Julius Michaelis f286682e3b Revert assert from 0027666c4 2018-01-13 13:54:38 +01:00
Julius Michaelis 0027666c4e Fix for #1813 / #1956 2018-01-13 12:29:27 +01:00
Maikel de Vries 4a3173da36 move liquid tank to Experimental.ocd
This should not appear anywhere in the release (also not editor), unless explicitly included.
2018-01-13 12:14:41 +01:00
Maikel de Vries eb24079b2f pump: add interaction menu entries for air pipes 2018-01-13 12:09:59 +01:00
Maikel de Vries dc541620b5 add new liquid tank structure (graphics needed) 2018-01-13 11:06:35 +01:00
Maikel de Vries 3255b02728 pipes: fix attaching, cutting, swapping, messaging, and interface 2018-01-13 11:06:35 +01:00
Maikel de Vries 84ad52251f liquid library: fixes and typos 2018-01-13 11:06:35 +01:00
Mark 78060d59e2 Fix #1976: Prevent GIDL from moving
The GIDL is now C4D_Living and C4D_StaticBack, preventing it from moving. At first I thought that adding an underground vertex would be sufficient, but that still made the idol move/shake when hit.
2018-01-13 09:50:17 +01:00
Julius Michaelis 24cf662cbd Rust script to iterate over all scenarios with openclonk-server and look for script errors 2018-01-12 23:15:29 +01:00
Lukas Werling 54e5c6de38 Fix Sky definition not working (#1910) 2018-01-11 22:44:33 +01:00
Lukas Werling 09458901bb Improve Acid Drilling map a bit (#1766)
- Some gem material for the teleglove
 - Some mushrooms in the cave
 - Some animals
 - Chests!
2018-01-11 22:24:41 +01:00
Maikel de Vries cb8eb3a4d5 fulfill defense goal if last active player is removed 2018-01-11 20:24:16 +01:00
Sven Eberhardt b15a8234b1 TreasureHunt: Improve game end check and some map simplifications 2018-01-10 21:30:15 -08:00
Sven Eberhardt 5fc07df757 Fix dynamite stick display count within dynamite box in interaction menu. 2018-01-09 18:00:35 -08:00
Sven Eberhardt ebd2eeae4b Don't burn objects inside the Clonk when submerged in Lava 2018-01-09 18:00:35 -08:00
Julius Michaelis 2931886438 Limit the number of times Cloud->Place retries.
Initialization did not terminate in planet/System.ocg/Template.ocg/DefaultWorld.ocs/.
2018-01-08 23:12:52 +01:00
Lukas Werling 6e52963828 Fix tools attached to Clonks after their deaths (#1974) 2018-01-08 19:42:59 +01:00
Lukas Werling e200aa58b3 Add CrushedIceCocktail by K-Pone for Miami Ice 2018-01-08 17:04:29 +01:00
Lukas Werling 9cbf1947ad HotIce: Change default spawn type back to island spawn
The HotIce games in #openclonk pretty much never use balloon spawn.
2018-01-08 17:04:29 +01:00
Lukas Werling c01cae990e HotIce: Add Eci Toh and Miami Ice themes
Thanks to K-Pone and KKenny!
2018-01-08 17:04:29 +01:00
Maikel de Vries 5e69a753ad improve tutorial 08 end sequence checks and dialogue 2018-01-08 11:12:21 +01:00
Lukas Werling 08393d2300 Credits: Batman is Foaly 2018-01-07 19:02:38 +01:00
David Dormagen 1d93216f33 powder keg: drop icon overlay in favor of custom menu overlay (#1972)
The old icon overlay was behind the numbers in the inventory menu anyway. Now the object uses a bar similar to loam. And it also updates its description.
When turning empty, the (new) barrel is also no longer play-colored inside.

The powder barrel could of course just use actual gunpowder and be an extra-slot item (like the bow / dynamite box / etc.).
2018-01-07 18:23:14 +01:00
Lukas Werling 64aabefe2d Credits: Add contributors who didn't commit themselves
Powered by `git log --pretty=oneline v7.0.. | grep -w by` - I hope this
covers everyone!
2018-01-07 18:11:10 +01:00
David Dormagen 0f049800c5 Revert "Object Interation Menu: Request displayed amount from objects" (#1970)
This reverts commit 8698aa25cf.

Tackling #1970. The implementation in the reverted commit was incorrect (i.e. only one out of two "GetStackCount" were replaced with GetInteractionMenuAmount, leading to weird behaviour). If you want to replace it, please do it in a way that no call to IsInfiniteStack will be required. And this hack would probably require so much more bloat code that nothing would be gained (i.e. what happens when you put two infinite arrow stacks in one container?).
The bug report complains about the "display stopping at 999" *in some situations*, which was due to Stackable_Max_Display_Count. It's gone now. And that it was not limited to 999 in all situations (like the code would have suggested) is probably due to the things I described above.

# Conflicts:
#	planet/Objects.ocd/Libraries.ocd/LiquidControl.ocd/Liquid.ocd/Script.c
#	planet/Objects.ocd/Libraries.ocd/Stackable.ocd/Script.c
2018-01-07 17:42:27 +01:00
Mark 0d38a3fb33 Fix #1973: Gems do not grow on wooden bridges anymore
Gems should not be near material vehicle now. This does still not prevent them from growing on things that the player built with concrete.
2018-01-07 16:14:54 +01:00
Mark 8bf90871e1 Fix error when AI equips a shield and has a ranged weapon
The shield and bow both use fx.aim_weapon, but the ranged weapons AI thinks that a shield works the same way as a bow and tries to fire it - in order to prevent this, the AI now also checks whether the equipped item is a IsRangedWeapon. This _could_ have an impact on the vehicle AI, but the unit test worked fine.
2018-01-07 14:39:07 +01:00
Lukas Werling dd86c05b9f Fix some � U+FFFD REPLACEMENT CHARACTER instead of umlauts 2018-01-07 00:50:43 +01:00
Lukas Werling 4325de2084 Fix MCHalfVehic pixels in saved landscape
While saving the landscape, solid masks are temporarily removed. This
did not work for half solid masks, resulting in permanent solid masks
after restoring the save game.
2018-01-05 22:53:41 +01:00
Lukas Werling 22c84edea7 Save HalfVehicleSolidMask object state
After saving and restoring an object with a half vehicle solid mask, the
solid mask was fully solid.
2018-01-05 22:41:14 +01:00
Lukas Werling 058e9addb4 Skylands: Don't use half solid mask on vertical scaffold wall 2018-01-05 22:11:16 +01:00
Lukas Werling da63092ee1 Skylands: Fix "free wood" appearing in front of Sawmill 2018-01-05 22:11:16 +01:00
Mark 66adf0f72c Fix #1969: Lorry does not eject contents by default
Instead, the lorry asks a container whether it should eject its contents. This is done via the callback LorryEjectionOnEntrance(object lorry) in the object that is being entered.
The old callback NoLorryEjection(object lorry) is obsolete.
2017-12-31 16:14:04 +01:00
Mark ee0917d7e8 Fix #1951: Disabled putting water in airplane and lorry
Removing liquid collection from the lorry is a side effect, but it is not bad. The lorry behavior was weird anyway, because you could for example put lava and wood in it, without the wood burning etc.
2017-12-29 12:59:36 +01:00
Mark 5aea227504 Improved unit test
The unit test does not really pass for now (it never did before, because it is not finished yet and used for testing the different transfer function behavior only)
2017-12-29 12:34:00 +01:00
Mark 67ee58d4d7 Fix unit test: Forgot adding materials for TeleGlove 2017-12-29 12:09:01 +01:00
David Dormagen 9214257424 fixed non-moving, high-velocity coconuts (#1627)
Coconuts were C4D_Object AND C4D_StaticBack. That meant that they would save speed (e.g. by explosions?) and could hit Clonks that passed by them.
2017-12-29 09:55:11 +01:00
Lukas Werling 91ff13b81f Clamp y coordinate when looking up Left/RightColPix, part 2 2017-12-28 23:20:56 +01:00
Lukas Werling 2b3863a12c Show warning when attempting to load an old savegame (#1941) 2017-12-28 21:45:20 +01:00
Lukas Werling df979bb537 Fix restoring single-digit scancodes (#1944)
Most scancodes are two hex digits long, e.g. "$24" (J). However, there
are also a couple keys like Backspace ("$e") and Escape ("$1") with a
single-digit scancode. These previously weren't restored correctly.
2017-12-28 20:50:03 +01:00
Lukas Werling 86926377a5 Show error dialog if OpenGL initialization fails (#1890) 2017-12-28 17:32:59 +01:00
Mark c3122b4890 Fix unit test
The test was not broken, but I added ending conditions to tests 4 and 5
2017-12-27 21:56:56 +01:00
Mark fc6c48078f Fix unit test: Liquid container
Adjusted some return values - it turned out that the test was actually wrong in these cases
2017-12-27 20:32:45 +01:00
David Dormagen ca16ffdd20 LaunchLightning: fixed GetType check
The comparison with C4D_Object was taken from the original PR (github #61). C4D_Object is the category, though.
2017-12-27 16:10:56 +01:00
David Dormagen d108cdd6aa inventory menu: be more lenient when it comes to finding matches between updates (#1964)
The matching had a few issues:
Items with the same symbol were supposed to be stacked, but the "symbol" changed from ID to object at some point. So same-type objects were no longer correctly matched.
Items with different text (e.g. amount) but everything else the same should be stacked. But simple proplist equality is obviously not sufficient to determine whether the contents of the proplist changed.

The order of the items is generally more stable now. I hope this doesn't introduce other issues.
2017-12-27 15:42:38 +01:00
David Dormagen 11ec98a195 removed "RaindropSmall" particle
It was no longer used. It's also just a stretched dot. Consider using an actual stretched dot instead (i.e. round GFX and Stretch = XYZ).
The sprite was also a little unclean.
2017-12-27 14:51:07 +01:00
David Dormagen f10b0854e8 fixed slow-mo rain (#1958)
Yes, someone just had the "slow-mo" switch on. I also replaced the usage of the "RaindropSmall" particle (which was a stretched dot) with an actual stretched dot.
2017-12-27 14:41:38 +01:00
David Dormagen ca0e99e3ce C4FO_Exclude: explictly ignore non-valid objects
This does not change behavior at all, as nil-objects were later ignored in the check. Now the check is not even executed.
This does make it more likely that refactoring will keep the ignoring behaviour in place, though.

Loosely related to PR #61 - has nothing to do with the solution, though.
2017-12-27 14:00:43 +01:00
David Dormagen de2b44c126 LaunchLightning: don't set launcher when called from effect/proplist to prevent syntax error (related to PR #61)
Setting the launcher to a non-object would throw an error later when being passed to Find_Exclude.
2017-12-27 14:00:43 +01:00
Mark 993d8c4565 #1249 Fix barrel fuse effect
Improved the barrel fuse effect in two ways:
1) The fuse is not at the center of the poweder keg anymore, making it more prominent
2) When carried by a clonk the effect is at the keg instead of the clonk center
2017-12-27 13:51:33 +01:00
Lukas Werling ea009cad76 Skylands: Enable half solid masks for scaffolds
We found these scaffolds to be rather infuriating to use, maybe this
will make it a bit better.
2017-12-27 13:17:24 +01:00
Lukas Werling 4b0ab0b8b1 Skylands: Fix script error
OnPlaneFinished deletes the calling object.

ERROR: can't access local variables without this
 by: SetProgress(5) (Missions.ocf/Skylands.ocs/Plane.ocd/Script.c:37)
 by: AddPart() (Missions.ocf/Skylands.ocs/Plane.ocd/Script.c:57)
 by: Timer() (Missions.ocf/Skylands.ocs/Plane.ocd/Script.c:47)
 by: FxIntScheduleCallTimer(0,effect {Function = "Timer", Name = "IntScheduleCall", NoStop = true, Pars = [], Repeats = -10794}) (System.ocg/Schedule.c:95)
2017-12-27 12:59:11 +01:00
Lukas Werling 3583bfcbb6 Prevent script error in buy menu
ERROR: '->': invalid target type nil, expected proplist
 by: Object(9419)->GetBuyValue() (Objects.ocd/Libraries.ocd/Structures.ocd/Vendor.ocd/Script.c:23)
 by: Object(9419)->DoBuy(0,0,0,Object(270),0,true) (Objects.ocd/Libraries.ocd/Structures.ocd/Vendor.ocd/Script.c:77)
 by: Object(9419)->OnBuyMenuSelection(0,0,Object(270)) (Objects.ocd/Libraries.ocd/Structures.ocd/Vendor.ocd/Script.c:269)
 by: Object(60927)->OnMenuEntrySelected({index = 2, slot = 1},10) (Objects.ocd/HUD.ocd/ObjectInteractionMenu.ocd/Script.c:880)
 by: Object(60940)->DoCall(10,0,Object(60927)) (Objects.ocd/HUD.ocd/MenuStyles.ocd/List.ocd/Script.c:166)
 by: Object(60940)->OnClick(0,0,6090,10,Object(60940)) (Objects.ocd/HUD.ocd/MenuStyles.ocd/List.ocd/Script.c:175)
2017-12-27 12:54:50 +01:00
Lukas Werling d43051b180 Prevent script error in ObjectInteractionMenu
ERROR: proplist access: proplist expected, got nil
 by: Object(18501)->OnContentsSelection() (Objects.ocd/HUD.ocd/ObjectInteractionMenu.ocd/Script.c:887)
 by: Object(18501)->OnMenuEntrySelected({index = 0, slot = 0},2,1) (Objects.ocd/HUD.ocd/ObjectInteractionMenu.ocd/Script.c:880)
 by: Object(18911)->DoCall(2,0,Object(18501),0,1) (Objects.ocd/HUD.ocd/MenuStyles.ocd/List.ocd/Script.c:166)
 by: Object(18911)->OnClick(0,1,948,2,Object(18911)) (Objects.ocd/HUD.ocd/MenuStyles.ocd/List.ocd/Script.c:175)
2017-12-27 12:50:56 +01:00
Lukas Werling 0c848be4df Prevent script error in ladder
ERROR: '->': invalid target type nil, expected proplist
 by: Object(11586)->IsBlockedLadder(Object(13439)) (Objects.ocd/Libraries.ocd/LadderClimb.ocd/Script.c:123)
 by: Object(11586)->FxIntSearchLadderTimer() (Objects.ocd/Libraries.ocd/LadderClimb.ocd/Script.c:90)
 by: Object(11586)->AddSearchLadderEffect() (Objects.ocd/Libraries.ocd/LadderClimb.ocd/Script.c:67)
 by: Object(11586)->FxIntScheduleCallTimer(Object(11586),effect {Function = Clonk.AddSearchLadderEffect, Name = "IntScheduleCall", Pars = [nil, nil, nil, nil, nil], Repeats = 0}) (System.ocg/Schedule.c:95)
2017-12-27 12:47:08 +01:00
Lukas Werling 0167463c33 Change type of AutoScanSideOpen to int
This makes AutoScanSideOpen=2 actually possible.
2017-12-27 01:34:36 +01:00
Lukas Werling 75bd202ca9 Fix warnings in C4Landscape 2017-12-26 22:03:44 +01:00
Lukas Werling a4f25ecd4c Don't accidentally reattach coconuts (#1858)
I'm not sure how exactly that issue happens, but in the attached video
it looks like C4D_StaticBack was accidentally set again. As the XOR
operation can do that, I'm changing it to always set the C4D_StaticBack
bit to 0.
2017-12-26 20:00:32 +01:00
Lukas Werling 31fee7a46d Pickaxe: Check material in a cone (#1606)
This makes digging away single pixels easier.
2017-12-26 19:37:09 +01:00
Lukas Werling 2d7d7b86ae Clamp y coordinate when looking up Left/RightColPix 2017-12-26 14:31:43 +01:00
Lukas Werling 6fc5c76a2c Rewrite Cloud positioning
The old code did some obviously wrong things like calling functions
expecting relative coordinates with GetX()/GetY(). It also sometimes ran
into an infinite loop in Cloud->Place(). I fixed those issues and
cleaned up the rest to be nicer, hopefully without changing
functionality.
2017-12-26 14:14:17 +01:00
Lukas Werling 486c85ea76 Fix Left/RightColPix lookup 2017-12-26 14:14:17 +01:00
Lukas Werling 2ab1408e41 Fix Boomshire spawn position (#1943) 2017-12-26 14:14:17 +01:00
Lukas Werling c964fa1c84 /screenshot: Add error message when in editor (#1137) 2017-12-23 12:11:28 +01:00
Lukas Werling 7ff92179d5 /screenshot: Default to zoom = 2
Before, it would silently fail. As we already have a default for
Ctrl+F9, we can just use that instead.
2017-12-23 12:05:13 +01:00
Lukas Werling ec77fe8744 Rock Bottom: Always start with a sword (#1556) 2017-12-23 11:46:08 +01:00
Lukas Werling d42e23a503 Change AutoScanSideOpen to check fg as well per default
The previous behaviour of only checking the background broke existing
maps and triggered some (performance?) bug in the mass mover. It is
still available by setting AutoScanSideOpen=2, for symmetry with
Top/BottomOpen.
2017-12-22 23:14:54 +01:00
Lukas Werling 2c4f1a0b6d DeepSeaMining: Fix grammar in goal 2017-12-22 21:59:41 +01:00
Lukas Werling 10dbc470df Fix infinite loop when encountering invalid <tags> 2017-12-22 21:44:22 +01:00
Lukas Werling 9970b24375 Forgot to initialize RightColPix 2017-12-22 21:06:30 +01:00
Lukas Werling 8e2327326b FloodedVeins: Use AutoScanSideOpen
It does exactly what's needed here now!
2017-12-22 20:53:11 +01:00
Lukas Werling 8838d8c6ce AcidGoldMine: Draw acid lake with tunnel background (#1652)
The new AutoScanSideOpen won't close the border otherwise.
Additionally, this makes clear where to pump acid.
2017-12-22 20:50:28 +01:00
Lukas Werling fa8f868ffb Change AutoScanSideOpen to be like Top/BottomOpen=2 (#1652) 2017-12-22 20:40:03 +01:00
marsmoon 1f2e34c42d Docs: add an example for appendto
Close GH-59
2017-12-22 19:31:22 +01:00
Lukas Werling 3f48488fef Add Fulgen's real name to credits 2017-12-22 18:08:25 +01:00
Lukas Werling 585eb7db6d Fix C4LogBuf breaking lines within markup
In a text line containing <c ff0000>markup</c>, C4LogBuf would
occasionally split the line after <c, producing broken markup.
Additonally, markup spanning multiple lines would always stop at the end
of the first line.

With this commit, lines are never broken within tags and any unclosed
tags are repeated on the following line.
2017-12-21 22:57:52 +01:00
Lukas Werling e83ca471c0 Render (updated) credits with C4GUI 2017-12-21 22:57:37 +01:00
Lukas Werling 3b358e0a98 Fix condition in font loading code
This was inherited from CR.
2017-12-21 22:57:37 +01:00
Julius Michaelis 99fe7a1a2c Use Reloc.Open for Origin entries in Scenario.txt (#1966) 2017-12-21 16:39:15 +01:00
Lukas Werling 0ae6383937 Fix German translation of Goal_Expansion (#1967)
Not sure why the US format string worked before, but not the DE one.
2017-12-19 21:15:09 +01:00
Lukas Werling 298feab441 Change netpuncher protocol to be more extensible
- Each packet has a version field.

 - Clients connecting to the netpuncher always send a request packet.
   This allows the netpuncher to react differently depending on the
   client's version.

 - Encode packets as binary instead of ASCII. This allows adding fields
   while maintaining compatibility.
2017-12-14 17:22:38 +01:00
Lukas Werling 3476d76e61 C4NetIOUDP: Fix sending data before ConnOK
With my fix from 9eb2478b2 ("C4NetIOUDP: Fix timeout during non-MC
connection"), C4NetIOUDP would send data packets to the master server
before the ConnOK packet. The server would then discard these data
packets, resulting in a one-second delay until retransmission.
2017-12-14 14:35:07 +01:00
Julius Michaelis e324289f8d Do not pack music on installation (#1671) 2017-12-12 10:18:15 +01:00
Julius Michaelis be10e95698 Prevent SEGV on duplicate material names with different case (#1359) 2017-12-10 15:09:51 +01:00
Julius Michaelis d94dcc8267 Fix iLevel parameter of SoundAt (#1681) 2017-12-05 16:57:14 +01:00
Julius Michaelis 1ca46c80ad Poll for stdin close in C4StdInProc 2017-12-05 04:13:28 +01:00
Maikel de Vries 956108b415 fix scoreboard kills, deaths, etc.
This is better done through the clonk death callback such that all deaths and not just last clonk deaths are registered.
2017-12-03 20:56:51 +01:00
Maikel de Vries 752f086a0c fix dark mine relaunching for deathmatch mode (#1962) 2017-12-03 20:01:09 +01:00
Maikel de Vries 4abac1c6d6 interactions: do not show cycle message for interactions with a single object 2017-12-03 19:17:41 +01:00
Lukas Werling 9eb2478b2c C4NetIOUDP: Fix timeout during non-MC connection
The "normal" connection process is a three-way handshake (Conn->,
<-Conn, ConnOK->). When establishing a multicast connection, this
handshake is repeated via the MC address. However, the code always
expected that second handshake to happen and thus ran into a timeout on
the client in the non-MC case, repeating the handshake a second time. In
the end, it usually still worked as the server supports reconnecting,
but packets may be lost in the process.
2017-12-02 18:52:10 +01:00
Lukas Werling 2d4934e4dd Fix C4NETIO_DEBUG 2017-12-02 18:52:10 +01:00
Maikel de Vries 72093ffa7f fix switch target in horrid highway goal (#1960) 2017-11-30 18:54:46 +01:00
Maikel de Vries 7f0743a7b9 remove vehicle rotation alignment library
This did not do anything and the functionality does not seem to be needed.
2017-11-29 21:49:36 +01:00
Maikel de Vries 477bde5c88 airplane and airship use destructible library 2017-11-28 22:09:52 +01:00
Maikel de Vries 4b4e4a5522 structure library: fix for invincible objects and make health bar symmetric 2017-11-28 19:34:56 +01:00
Maikel de Vries 332016e6cc fix entry callback target for destructible library 2017-11-28 16:21:25 +01:00
Maikel de Vries 723a7767f6 add damage indication in interaction menu for destructible library 2017-11-28 15:20:39 +01:00
Mark 58b8a97734 For testing: Initial digging boost
The shovel initially has a little more speed, making the overhead dig less fiddly
2017-11-27 22:28:55 +01:00
Mark c7bb0785b6 For testing: Dive Jump 2017-11-27 21:57:17 +01:00
Clonkonaut 799bf97304 Forget this in my cable lorries work safe. 2017-11-27 00:46:30 +01:00
Clonkonaut e144bfd91f Clonk walk animations: smoother blending.
This was a very old script todo. I don't really know if I made it better (but I think so).
2017-11-26 14:28:04 +01:00
Mark f9cd3aa77e SwitchTarget: Single callback 2017-11-25 23:31:05 +01:00
Mark 43636c4941 Replace windows line endings 2017-11-25 22:55:53 +01:00
Mark 41d45db9c2 Library: Switch, SwitchTarget
Standardized behavior for switches
2017-11-25 22:16:47 +01:00
Maikel de Vries c50d3b84a2 fix missing construction site material info after loading game (#1740) 2017-11-25 16:52:15 +01:00
Lukas Werling 3d1caffcf6 Convert CRLF line endings to LF
Now all files are LF again.
2017-11-24 14:23:33 +01:00
Mark 06cd643d15 Clonk: Adjust mesh position while diving
This matches the vertex position better
2017-11-23 21:16:12 +01:00
Mark f8f9a38ee3 Clonk: Constants for SetMeshTransformation layers 2017-11-23 20:38:11 +01:00
Maikel de Vries e228d84670 make airship IsProjectileTarget failsafe as well 2017-11-22 17:18:41 +01:00
Maikel de Vries 5c11b703a9 Horrid Highway: add diamonds and remove debug log 2017-11-22 17:18:41 +01:00
Maikel de Vries 5bf83b7d3f IsProjectileTarget: make failsafe if projectile is nil and clean up 2017-11-22 17:18:41 +01:00
Mark 3e5de9eea9 For testing: More fluid hangling motion
Removed the dead stop between hangling strokes/swings. Instead, the
Clonk keeps moving with half speed.
2017-11-21 20:56:35 +01:00
Mark fd7eeecf2c For testing: Hangling with immediate stop
Instead of continuing to swing forward the Clonk stops immediately while
hangling. Additionally the hangle animation keeps on playing with a
short delay before it changes to the hanging animation, so that the
motion looks nice if you move a short distance only.
2017-11-21 20:49:41 +01:00
Clonkonaut 8cb3c6f6b3 New property, set for all buildings: FireproofContainer.
A fireproof container shields all contents from incendiary material (lava mainly). Structures can now be submerged in lava and the contents will not burn up.
2017-11-21 18:16:45 +01:00
Mark 5794e1bfb4 Removed ancient comments from the weapon code 2017-11-21 18:01:25 +01:00
Mark 877d5fc62a For testing: Constant digging speed
As discussed on the forum.
2017-11-20 20:42:59 +01:00
Maikel de Vries 7ba158521f fix invisible dynamite box igniter (#1955) 2017-11-17 11:24:26 +01:00
Maikel de Vries 7184109808 detach dynamite igniter only if fused 2017-11-17 09:58:55 +01:00
Maikel de Vries f6b15a9051 cancel current use action if pilot is removed (#1954) 2017-11-17 09:22:48 +01:00
Maikel de Vries bc3d0bb29d make bats not attack prey in containers 2017-11-16 12:47:39 +01:00
Maikel de Vries 0e6f1599c6 fix airplane control use coordinate forwarding 2017-11-15 20:30:14 +01:00
Maikel de Vries 3a47802702 airplane: add afterburner mode
This reqruired some movement code clean up, replaced old effects with new effects.
2017-11-15 18:49:47 +01:00
Lukas Werling 4278626b9f docs: Highlight the keyword "new" 2017-11-12 22:02:34 +01:00
Lukas Werling be9d3032e2 Add ExecutePXS script function
Before commit 5a652f23e ("Fix missing C4PXSSystem::Clear
implementation"), ChristmasIce would keep all snow PXS between scenario
section changes. That looked pretty neat, so I'm introducing this script
function to allow properly implementing it.
2017-11-12 22:00:52 +01:00
Lukas Werling 5a652f23ef Fix missing C4PXSSystem::Clear implementation
On scenario section change, the old PXS would continue to exist.
2017-11-12 11:57:41 +01:00
Maikel de Vries 101dc5055d add Op parameter to turbulence map script algorithm (#1948) 2017-11-11 10:49:42 +01:00
Maikel de Vries 181cfdfd6b fix flammable library now that (#1950) is fixed 2017-11-11 09:57:22 +01:00
Maikel de Vries 963285eee5 NoBurnDecay is a boolean 2017-11-11 09:49:52 +01:00
Maikel de Vries a9675eafa3 perform callbacks when moving contents when container is removed (#1950) 2017-11-11 09:12:46 +01:00
Maikel de Vries 2429ee6722 fix switching dynamite igniter while switching inventory (#1913) 2017-11-10 17:10:31 +01:00
Maikel de Vries ed41426ef8 fix line endings of some files in planet 2017-11-10 10:21:09 +01:00
Lukas Werling 3cce9f44c7 Fix another preprocessor conditional for MinGW 2017-11-09 09:33:29 +01:00
Lukas Werling 022ca2b364 Fix Nix expression for current nixpkgs unstable 2017-11-09 09:28:11 +01:00
Lukas Werling cfee39bbe5 Fix preprocessor conditional for Windows(/MinGW) 2017-11-08 22:29:38 +01:00
Lukas Werling 739de3f6c8 Fix log file permissions on Linux 2017-11-08 20:21:25 +01:00
Lukas Werling 587f5b5f0e Simplify C4PXSSystem
The old system allocated chunks of PXS on demand. I can't think of a
good reason to do this.

The savegame format changes slightly to not require saving full chunks,
however old savegames will still load fine (invalid PXS within chunks
are moved out during the next Execute() call).
2017-11-08 17:33:35 +01:00
Lukas Werling 607e8873e5 Fix landscape diff application (GH-58)
Savegames with a foreground material diff but no background material
diff would not apply the foreground diff at all. As the background
material rarely changes, this broke runtime joining for most scenarios.
2017-11-08 11:34:58 +01:00
Lukas Werling 1182e5ebd5 Don't truncate the log file while checking flock 2017-11-08 00:23:44 +01:00
Lukas Werling 60692c793d Fix assertion failure when joining with openclonk-server 2017-11-05 22:23:38 +01:00
Lukas Werling c0047bdc53 Fix a desync during runtime join (GH-58)
This is a workaround for a more complex engine-side issue. See #1953
2017-11-05 13:56:21 +01:00
Lukas Werling fb87db1579 Fix umlauts in engine strings 2017-11-05 13:56:21 +01:00
Mark 9cea6ed03c Fix documentation comment. 2017-11-04 11:40:13 +01:00
Mark ac0cf07e31 New assertion: Not empty 2017-11-04 11:31:12 +01:00
Mark 26e72eb489 AStar: Clarify the "todo" error 2017-11-02 17:36:31 +01:00
Mark aaed0b4d54 Fix the typo again 2017-11-02 17:29:43 +01:00
Clonkonaut b1902355f9 Cannon, Catapult, Lorry: use Library_Destructible (cannons and catapults are now destructible!). 2017-11-01 01:27:48 +01:00
Clonkonaut 5193f99d6c Library_Destructible: for destructible objects, mainly vehicles.
Objects will be destroyed after local HitPoints has been reached in damage taken. Objects will explode into little burning bits, just like it is with lorries.
2017-11-01 01:20:41 +01:00
Clonkonaut f6af52711a Catapult texture: removed some dark pixels around the draw wheel which showed because of stretching. 2017-11-01 00:56:14 +01:00
Clonkonaut 6acea8930b Various objects: include library flammable
Increased burn time (140 frames) for: axe, bucket, grapple bow, hammer, pickaxe, shovel, sickle. So useful items will burn a little bit longer.
Coal will burn for 245 frames and then just burst into ashes and not change into a Burned Object.
2017-11-01 00:54:24 +01:00
Clonkonaut cc163b21b0 New engine recognised property: MaterialIncinerate.
Objects will be incinerated by incendiary material (which before was only possible by using ContactIncinerate).
local MaterialIncinerate = true; - object will burn in lava not from other burning objects.
2017-11-01 00:49:26 +01:00
Clonkonaut 41676186a1 Library_Flammable: Logic for flammable objects / items.
When ignited, the object will burn for a fixed time (BurnTime property, default is 70 frames) with no detriment to its function.
After that time, the object will change to a 'Burned Object', no longer useful for anything.
2017-11-01 00:46:38 +01:00
Clonkonaut 5c45d7a08e Fix a script comment that Luchs complained about. 2017-10-29 11:39:07 +01:00
Clonkonaut 3084edcab7 Boomshire: fix arg_count_mismatch warning. 2017-10-29 11:34:53 +01:00
Martin Strohmeier 4d1a000ed8 Fix #1906: Rule_Relaunch is saved properly in Objects.c by using GetRelaunchRule() instead of CreateObject() 2017-10-27 18:51:14 +02:00
Clonkonaut 2c4aba74f0 Teleglove production: needs any one gem (diamond, ruby, amethyst) to produce (as discussed in #1505). 2017-10-27 13:25:34 +02:00
Clonkonaut fceda32505 Loam production: substitute sand for earth (#1148). 2017-10-27 13:22:37 +02:00
Clonkonaut 808e7fa866 Producer: allow construction material substitution for products via script.
All item can now define substitute components like this:
public func GetSubstituteComponent(id component)
{
	if (component == Rock) // Rock is in the regular components
		return Metal; // Rock can be replaced by Metal, amount is the same

	if (component == Wood) // Wood is in the regular components
		return [Cloth, Wipf]; // Wood can be replaced by either Cloth or Wipf, amount is the same
}
2017-10-27 13:19:59 +02:00
Clonkonaut 9d3e61e483 Nugget: more reddish colour, to fit the material (#1588). 2017-10-26 16:36:12 +02:00
Clonkonaut a3b387dc30 Treasure Hunt: fix goal description (Dagobert -> Scrooge) (#1912). 2017-10-26 01:20:03 +02:00
Fulgen301 ab3b6cc682 Treasure Hunt: NPC fixes * Make all NPCs except the AI invincible * Modify Jane's dialogue (before, the player clonk was amused about Tarzan's death ;) * AI clonk have now got names 2017-10-26 01:15:50 +02:00
Clonkonaut ea301d7289 Double elevator: transfer MoveTo calls to master case (#1708). 2017-10-26 01:05:37 +02:00
Clonkonaut df861d2654 Give visual feedback that loam is used (#1889). 2017-10-26 00:44:25 +02:00
Clonkonaut 646585a4c9 Fix links on 'Player Controls' page of documentation (#1686). 2017-10-25 15:38:47 +02:00
Fulgen301 05ad28c4f1 Hideout/PyreGem: Fix possible null pointer error The PyreGem calls thrower->GetOwner() in its Hit() function. However, if the gem hits something before setting a thrower (e.g. when falling), it throws a null pointer error. Note: This only concerns custom scenarios which include this gem. 2017-10-25 15:25:14 +02:00
Clonkonaut 232a7deb5b Deep Sea Mining: added Diving Helmet (#1939). 2017-10-25 15:21:30 +02:00
Clonkonaut 2ca557a09c inherited(...); to inherited(); in Initialize since Initialize doesn't have any parameters. 2017-10-25 15:01:19 +02:00
Clonkonaut cbe536711c Boomshire: making sure the airplane will always be upright when reset. 2017-10-25 15:00:38 +02:00
Lukas Werling afa348ab21 Add comment next to all documented functions in System.ocg
Many functions in System.ocg have proper documentation, but not next to
the code. When changing these functions, it is easy to forget updating
the docs. Nobody likes outdated documentation!
2017-10-21 00:10:42 +02:00
Lukas Werling 6605d390a9 Fix documentation of SplitRGBaValue 2017-10-20 23:36:02 +02:00
Martin Strohmeier a0b131cefd Fix scoreboard not updating relaunches #1947 2017-10-15 23:54:39 +02:00
Lukas Werling b94c3757a6 Fix water sliding on lava (#1946) 2017-10-14 17:46:04 +02:00
Clonkonaut 3c87d0f135 Work save regarding cable cars/lorries.
Started to work on a few station configuration options and combining these with producers for requesting materials (which now kind of works).
2017-10-04 01:19:46 +02:00
Julius Michaelis 3eb6dcbcd3 CMakeLists.txt: stop using add_backward and qt5_use_modules
(the former adds libraries multiple times, the latter is deprecated)
2017-09-23 16:52:33 +02:00
Lukas Werling 1541bf62c1 Fix buffer overrun in RealPath
This usually isn't an issue, but is caught by -fcheck-pointer-bounds.
2017-09-17 18:51:41 +02:00
Lukas Werling e92cff778c backward: remove reference to SIGUNUSED
glibc removed that definition in some recent version.
2017-09-17 18:30:17 +02:00
Mark 77bb9c91a6 Fix yet another typo 2017-09-10 20:07:38 +02:00
Mark 380d6202c7 Fixed typo 2017-09-10 19:34:29 +02:00
Mark 7f5ca45097 PowerSystem: Streamlined behavior of neutral network
The check for several neutral networks is more strict now, however. Did
not report an error in the unit test, so it *should* be OK.
2017-09-10 19:33:56 +02:00
Mark 6149f7de8a PowerSystem: Streamline method behaviour
Linked flag changing now always updates all networks (which is not very
hard on the performance), special treatment for neutral network will be
removed with the next commit.
2017-09-10 19:18:52 +02:00
Mark 0c148530a6 PowerSystem: Network creation as a function 2017-09-10 18:11:05 +02:00
Mark 28b22c6c62 PowerSystem: Use getter and setter internally 2017-09-10 15:43:19 +02:00
Mark cc21da2315 PowerSystem: Move network merging from flag to power library.
This is not totally finished yet, but this far it is mere refactoring
without changing the system itself.
2017-09-10 14:34:18 +02:00
Mark 4fab0cf47e PowerSystem: Make system overloadable
Replaced hardcoded method calls with a wrapper function
2017-09-10 12:54:11 +02:00
Mark 366ba86abc Fix #1940 All coconuts must be eaten! 2017-09-02 21:16:04 +02:00
Mark 4838093aaf Seed: Extract function for planting manually
Makes it possible to plant manually if some object overloads ControlUse
2017-09-02 21:15:38 +02:00
Julius Michaelis c4cd9dda63 Set VIS_Editor in Library_Goal to avoid forgetting it in future goals
Fixes #1932
2017-09-01 15:59:51 +02:00
Julius Michaelis 94394c2e2a Fix some valgrind warnings and a leak in openclonk-server 2017-09-01 15:59:46 +02:00
Mark 2db1ae5de2 ConstructionSite: Fix compiler warning 2017-08-27 21:05:07 +02:00
Mark 3917964bf2 ConstructionSite: Fix possible nil access
Code that works with that function expects an array to be returned.
2017-08-27 12:19:38 +02:00
Mark d1996e45df Structure: Improved SetBasement
The access to editor actions poses a problem sometime when deleting
basements.
2017-08-27 10:40:44 +02:00
Mark 3e26d4258a ConstructionSite: Overloadable function for construction site preview 2017-08-26 13:36:31 +02:00
Julius Michaelis 9c3c6d1079 Windmill: Syntax error fix 2017-08-26 12:16:32 +02:00
Julius Michaelis a630d2b94b Silence "Warning: could not find sound matching '...'" in openclonk-server 2017-08-26 10:56:14 +02:00
Julius Michaelis ef1c275227 Better error messages for non-constant expressions in 'static const' declarations
cf. #1922
2017-08-26 10:39:38 +02:00
Julius Michaelis e4adb0fd76 Fix StdCompilerINIWrite/19c1badfa 2017-08-25 15:10:28 +02:00
Mark 86154ddd40 ConstructionSite: Interface for custom implementation
Status update should be callable as such separately.
2017-08-24 22:24:03 +02:00
Mark d27223f960 ConstructionSite: Interface for custom implementation
Extracted some more functions to make overloading easier.
2017-08-24 21:49:40 +02:00
Mark 7067192c63 ConstructionSite: Interface for custom implementation 2017-08-24 21:08:27 +02:00
Mark 929b31c4a3 ConstructionSite: Cleaned script
I know that moving around functions is hell when merging, but I did it
anyway because the construction site is not being changed that often
anymore.
2017-08-24 20:58:29 +02:00
Mark 0a20608f60 ConstructionSite: Remove unused function
It did not really disallow taking stuff out, so I removed it.
2017-08-24 20:45:55 +02:00
Mark c25c63179f Gold idol: New graphics and script 2017-08-24 20:27:45 +02:00
Julius Michaelis 19c1badfa6 Fix StdCompilerINIWrite/08714a67f 2017-08-24 16:40:05 +02:00
Kanibal e727d35202 Share time information (frameCounter and realtime) with landscape shaders 2017-08-23 23:53:55 +02:00
Kanibal c1143a2e51 Add remaining glUniform-functions 2017-08-23 23:53:55 +02:00
Maikel de Vries fd42ddd823 add script option to block cutting of pipes
This allows scripters to place liquid containers with fixed pipes, so that players do not break scenarios.
2017-08-20 12:58:31 +02:00
Maikel de Vries cb1482d5a4 fix spamming balloons (#1709) 2017-08-19 16:11:04 +02:00
Maikel de Vries 2fa7aabcac prevent buildings from partially burning down (#1880) 2017-08-18 17:59:25 +02:00
David Dormagen 6fa13d8717 C4TimeMilliseconds: fixed comparison & stopped reloading shaders every frame
Imagine lhs being 0 and rhs being more than int32_t can handle. And then imagine subtracting them and casting them to int32_t.
That's what happened e.g. in void C4ShaderCall::Start() when ScriptShader.LastUpdate was 0. This caused the shaders to reload every frame;
at least when in the main menu. This lead to serious lagging (of the cursor) for me.

Note that the subtraction operator in C4TimeMilliseconds.cpp has a similar issue. This might need a fix or at least high awareness by users. Maybe an assert or something.

PS: Who thought that doing the comparison with a subtraction was a good idea? This is not assembler :I
2017-08-15 10:04:54 +02:00
David Dormagen 8d1aa0c0c2 DirectoryIterator: only append DirectorySeparator if necessary 2017-08-15 10:04:46 +02:00
Julius Michaelis 08714a67f8 Mess up StdCompilerINIWrite in an attempt to fix #1921 2017-08-15 05:50:38 +02:00
Fulgen301 56d1c689d8 The Raid: Correct string table entry Clonko3 2017-08-14 14:49:45 +02:00
Fulgen301 f80e9dbd1a Display carry heavy objects on the clonk's back while swimming (#1764) 2017-08-14 14:49:45 +02:00
Mark eb1657c3e3 Wearable: Attachment flags
Wearable items can have attachment flags, such as matching the target
skeleton
2017-08-13 23:41:04 +02:00
Maikel de Vries bbdd38830e show keys to cycle between interaction objects 2017-08-12 22:14:54 +02:00
Armin Burgmeier 02fa5abc66 Fix material/texture selection in landscape shader (#1841) 2017-08-12 17:01:52 +02:00
Lukas Werling e59205c2f3 Don't update MIME cache on install (#1618)
The install target is used both for manual installation and for
packaging. Updating the packager's MIME cache isn't very useful. Show a
message instead which reminds both packagers and regular users to run
the command.
2017-08-12 16:56:14 +02:00
Mark 5eaa5703a0 Golden statue: Getters for editor actions 2017-08-12 10:58:08 +02:00
Mark e4912b9fda Fight for Gidl: Statue uses a custom pose 2017-08-11 21:37:21 +02:00
Mark 22e05d7a8f Gold statue: Decorative items
Can place items in the gold statue hands. In the future, it might be
actual items that get displayed correctly in the hands by themselves
(maybe I have to tinker with the model here, unless we want to have
custom transformation callbacks for every item).
2017-08-11 21:29:52 +02:00
Mark daae41e61d Golden statue: Editor properties for pose 2017-08-11 15:34:36 +02:00
Mark 09eec4b53c MoltenMonarch: Moved materials to weapons
Weapon materials are now defined in the basic objects, so that other
scenarios can use the alternate skins, too.
2017-08-11 14:22:45 +02:00
Mark e0662bc206 Fight for Gidl: Adjust statue position
Made the statue not movable, so there is no need to make it stuck in the
ground.
Other scenarios do not need an adjustment, because they use
CreateObjectAbove(), so the positions will be OK (tested with 3
scenarios).
2017-08-10 22:43:09 +02:00
Mark be9f477a16 Gold statue: New graphics
Added a new mesh with 6 different poses for the gold statue.
2017-08-10 22:27:32 +02:00
Maikel de Vries 07a945ee8e playground: do not show plant library in spawn menu (#1911) 2017-08-05 16:17:28 +02:00
Maikel de Vries bb970f1d8c improve volcano escape atmosphere (#1566) 2017-08-05 10:49:54 +02:00
Mark e73c206bdd Constructor: Modular construction menu
Makes it easier to overload the individual parts
2017-07-28 23:01:19 +02:00
Mark f8e30e3a00 Animations: Parameter for rolling
Certain packs/objects may want to restrict your ability to roll. The
parameter that distinguishes between rolling from a fall and rolling
while running is helpful here.
2017-07-28 22:08:19 +02:00
Mark 349529fa02 ConstructionSite: Cleaned script
Made the script a little more readable in some places
2017-07-27 22:04:49 +02:00
Mark 3fcee70f60 Fix breathing sound 2017-07-27 21:51:07 +02:00
Mark 7f30f4d971 Fix #1930
Contained clonks can interact with their container now. Changed the
order of issued calls around a little, but it should not create unwanted
effects.
2017-07-23 20:37:53 +02:00
Maikel de Vries 81330d5b34 make lightning move to nearby lightning attractors 2017-07-23 10:47:16 +02:00
Fulgen301 d8579607ac Tutorial.ocf: Fix string tables 2017-07-23 10:00:22 +02:00
Fulgen301 69538d4962 Add rain drop effect and modify the stalactite in order to use this effect
Squashed three commits, see https://github.com/openclonk/openclonk/pull/47
2017-07-23 09:55:30 +02:00
Mark 62ff92aa97 Structure: Allow basement override
Structures created basements with ID Basement, now the basement type can
be defined with the callback GetBasementID (default value is Basement)
2017-07-22 23:47:16 +02:00
Mark ee4ac9e825 Structure: Callback for too much damage
Added callback OnNoHitPointsRemaining() that is called if whenever the
structure is about to be removed because it took too much damage. Should
the callback return true, then the damage counts as handled and the
structure will not be removed.
2017-07-22 23:47:15 +02:00
Maikel de Vries efe7dcf251 add Find_Cone to find objects in a cone
The reason for an engine function for this is speed, an implementation in script needs Find_Func and ensures slowness.
2017-07-19 22:04:43 +02:00
Maikel de Vries 0d58380dbf unify two implementations of Angle in the engine
There seems to be no reason to have two different implementation and the one in FnAngle seemed the most sane and complete one.
2017-07-19 22:04:43 +02:00
Nicolas Hake e5b15a494c Drop C4AulParSet defaulted ctor
Having the ctor defaulted confuses MSVC 2015 and makes it not use the
templated ctor below even for calls with a parameter list,
thus skipping required initialization.
2017-07-18 02:24:04 +02:00
Maikel de Vries f5f8b18204 remove unused AttractLightning defcore entry
Not used in either the engine or in script, script implementation of lightning can use a script defined property.
2017-07-15 14:00:19 +02:00
Maikel de Vries 4a093b747e remove unused FireTop defcore entry
This has been obsolete since fire is implemented in C4Script.
2017-07-15 13:40:37 +02:00
Mark 2da7768a8e Remove if-block in Eat()
The check should be made in the object that call Eat()
2017-07-13 21:49:07 +02:00
Mark e20d5e87ae Library: Edible items
All the functionality for food is bundled in one library now
2017-07-13 21:48:36 +02:00
Maikel de Vries 12e8ee6636 fix lightning striking certain objects and loosing strength 2017-07-12 22:37:03 +02:00
Sven Eberhardt 856dfc9aa9 Fix duplicate editor action buttons #1884 2017-07-11 21:25:08 -07:00
Sven Eberhardt 0c50e81413 Scenario list loader: Ignore .ocd and .ocg files when looking recursively for scenarios 2017-07-11 20:45:57 -07:00
Sven Eberhardt 17153c6fbe Show currently loaded item in gray while loading scenario list for scenario selection 2017-07-11 20:45:19 -07:00
Sven Eberhardt aa7c964fab Ignore main exe path for group loading when loading data from planet/ subfolder
This fixes a slowdown in scenario selection when some of the dependency folders (e.g. qt) are searched for scenarios.

Should also fix a bug where music is loaded from the exe path instead of planet/ if present
2017-07-11 20:43:21 -07:00
Sven Eberhardt 8dffeadc56 Fix slowdown during startup scenario list loading #1721
(the one that could be averted by wiggling the mouse)
2017-07-11 18:24:14 -07:00
Maikel de Vries 57c0aacbfa reduce lightning strength if an object is struck
This prevents lightning to be an infinite path of destruction.
2017-07-10 19:14:07 +02:00
Martin Strohmeier 2d0a178b87 HotIce: Fix Syntax error 2017-07-09 19:26:10 +02:00
Maikel de Vries 03b6024aca explode meteor when struck by projectile or lightning 2017-07-09 18:35:15 +02:00
Maikel de Vries cc92a58388 pass lightning object to OnLightningStrike for kill tracing 2017-07-09 18:35:15 +02:00
Maikel de Vries 906ccb6733 fix not playing thunder sound in lightning strikes when requested 2017-07-09 18:35:15 +02:00
David Dormagen c3fbdd538a coral: added comment
The intention of the underscore was not clear at a first glance. To avoid people thinking it's a bug and accidentally renaming it, it's commented now.
2017-07-09 17:56:12 +02:00
Maikel de Vries b1542a3338 horrid highway: resolve meteor spawn problem and adjust difficulty settings 2017-07-08 18:17:16 +02:00
Martin Strohmeier ea4aa3eae2 Hot Ice: Fix Clonks stuck in RelaunchContainer on classic spawn in first round 2017-07-08 15:06:47 +02:00
Clonkonaut c2f1d47f63 Added OnClonkEnteredRelaunch when the clonk enters the relaunch container (in accordance to OnClonkLeftRelaunch), request by the Knüppeln team.
I also use this commit to shamefully hide the bugfix of the bug I previously committed.
2017-07-07 00:52:23 +02:00
Clonkonaut 1144837e7e Make a positive return of the OnPlayerRelaunch game call suppress regular relaunch behavior.
I suspect this was intended all along (compare to line #223) but not implemented by mistake.
2017-07-07 00:27:08 +02:00
Maikel de Vries d34f0a689b add new world: horrid highway 2017-07-06 10:18:27 +02:00
Maikel de Vries d458b0a25a fix script error in relaunch rule when buying new clonk fails 2017-07-06 10:12:30 +02:00
Maikel de Vries f56e10c082 fix pump liquid selection menu entry for german language 2017-07-04 22:44:23 +02:00
Maikel de Vries b2a966150c pump: fix connecting already defined drain and source pipes 2017-07-04 15:19:31 +02:00
Maikel de Vries c20698060c airplane: allow changing direction while pushing, better landing, clean-up 2017-07-04 14:49:22 +02:00
Maikel de Vries 50221615b8 adapt clonkomotive scenario to new locomotive 2017-07-04 09:00:16 +02:00
Maikel de Vries 1775684038 locomotive: make liquid tank for easier use 2017-07-04 08:38:49 +02:00
Maikel de Vries 7d98d29b33 moved locomotive to main object folder
Now it can be used by other scenarios as well.
2017-07-03 16:05:58 +02:00
Martin Strohmeier a7c139bb68 Sandbox: Added object removing tool and feedback for invincibility tweak 2017-06-28 23:48:04 +02:00
Mark b7297c1358 Eat: Use existing function call instead of hardcoded comparison
Should the criteria for walking change then eating will still work
2017-06-28 19:36:39 +02:00
Mark 6208d99b98 Heal: Updated to new effect format, added variable interval
The healing interval defaults to the old fixed value.
2017-06-28 19:36:21 +02:00
David Dormagen 42b6e1f69c extra-slot display now shows object instead of definition (#1924)
Showing the definition means that objects can not modify their display in the extra-slot. E.g. the arrows would always show their "full" state. Now the arrow count is correctly displayed in the extra-slot.
2017-06-28 19:22:05 +02:00
Maikel de Vries 3a2c68dcc9 interaction menu: add callback target for menu entries
This allows to forward menus of one object to its parent properly. A specific usecase is cannons, which are soon to come (hopefully).
2017-06-26 17:28:40 +02:00
Maikel de Vries 0cd307a5f0 interaction menu: remove contents refresh effect if menu ordering has changed
This can happen if an objects updates the menus without any callback function [UpdateInteractionMenus(callbacks)].
2017-06-26 17:26:06 +02:00
Maikel de Vries a53bc7eb61 fix script error when fire arrow's incineration destroys an object 2017-06-26 17:20:22 +02:00
Maikel de Vries f98f12c863 defense boom attack: can be hit by more weapons 2017-06-26 17:19:13 +02:00
Mark 8720409fbf Colors: Breaking change - SplitRGBaValue
Changed the return value from array to proplist. The proplist contains the values R, G, B, Alpha.
2017-06-24 19:39:00 +02:00
Mark 56bf2eb06e Colors: Use constants where possible
Did not use constants for the HSL values, because it did not seem worth to introduce them.
2017-06-24 19:24:21 +02:00
Maikel de Vries ce0bb331f7 add function to set target to defense boom attack 2017-06-24 17:58:17 +02:00
Maikel de Vries 5d5cb709bc add functio to make cargo balloon floating 2017-06-24 17:58:17 +02:00
Mark 04b85e0719 More modular AI
The AI was split up into a basic controller object that contains just the AI control effect and basic logic. The other components should work individually, and the final implementation of the AI can import these components individually.

Fixed AI catapults, so that they now fire even if the clonk has no items in the inventory.

Merged from gitMarky/openclonk, branch ai_backport.
2017-06-24 12:00:22 +02:00
Mark fc4a1660da Debugging: Streamlined functions
Another possible option was a parameter for the log level, but I decided against it, because differently named functions feel better than a string constant as a parameter.. Removed some annoying log outputs that I added before.

 Any suggestions for the function names are welcome, because I am not quite happy with the names yet. The distinction between normal output and warning is maybe not even necessary.
2017-06-23 23:19:42 +02:00
Mark dddf5e223a Fix catapult not shooting
The problem was in AI_TargetFinding, line 18: The clonk that has a vehicle, but not any contents, will never find any attack targets. The vehicle is saved as fx.weapon, so if the clonk has a weapon it asks that weapon first whether it is suitable, and only if not it consults the inventory.
2017-06-23 22:32:17 +02:00
Mark fe9ef89cf4 Debugging: More log output
Will streamline the two different functions later on. The difference is, that one function issues a warning, while the other merely provides information. Logging calls in components have to be called failsafe, because the cannot rely on the actual AI implementation including AI_Debugging.

This helps me understand why the catapult in AI test #7 does not fire. The solution is very interesting: The AI executes the idle strategy as long as it has no contents. After giving contents to the AI it executes the catapult strategy.
2017-06-23 22:20:09 +02:00
Mark d9f7147dd3 Debugging: Use individual setting instead of definition setting
This helps when debugging a certain AI-controlled Clonk's behavior
2017-06-23 22:01:15 +02:00
Mark 6cb154fabd UseControl: Prevent possible call on null object
This usually happens in the following case from ClonkControl.ocd/Script.c:

// Release commands are always forwarded even if contents is 0, in case we
// need to cancel use of an object that left inventory
if (contents || (status == CONS_Up && GetUsedObject()))
{
	if (ControlUse2Script(ctrl, x, y, strength, repeat, status, contents))
		return true;
}

It could also be necessary that, instead of contents, either "this", or GetUsedObject() should be passed. Not sure which one was intended.
2017-06-21 00:06:12 +02:00
Mark 2553f5a388 Object: Variable placement for plants
RootSurface() does not yield good results for all objects, so I think the function should have a parameter for movement range. Re-declarated the variable "i" in the second if-block; I always thought we had scoped variables, it surprises me that the previous version worked.
2017-06-20 21:55:01 +02:00
Maikel de Vries 6b2cbf2ab2 add Place function to chippie 2017-06-20 18:25:27 +02:00
Maikel de Vries 30dd9c1d8f silence argument mismatch warning in rapid refining scenario 2017-06-20 18:24:41 +02:00
Maikel de Vries 968c5b9e68 clarify how to use hammer in tutorial 3 (#1888) 2017-06-17 21:16:38 +02:00
Maikel de Vries 48c17c1e54 clarify tutorial 2 loam message (#1887) 2017-06-17 21:08:45 +02:00
Maikel de Vries 6bfd967f40 add wealth display to tutorial 1 2017-06-17 20:56:03 +02:00
Nicolas Hake 8aea4cc360 Merge pull request GH-48 from Fulgen301/PR
- Remove StringToInteger function

Closes GH-48.
2017-06-14 21:13:21 +02:00
Fulgen301 73b52a15ce Remove StringToInteger function 2017-06-14 21:11:39 +02:00
Lukas Werling f44aaf6ff7 Merge pull request GH-45 2017-06-13 20:03:23 +02:00
Nicolas Hake 9020f3c0ec Merge parts of pull request GH-46 from tusharpm/cmake
- get year from CMake directly
2017-06-12 08:37:28 +02:00
Tushar Maheshwari 8fef67378d get year from CMake directly 2017-06-12 08:36:43 +02:00
Maikel de Vries bfe9449256 lava core: only have solid mask when frozen
This causes less lag.
2017-06-11 14:50:35 +02:00
Mark 16c2fd80d5 Animations: Rolling when hitting the landscape as a separate function
The logic for rolling can now be overloaded. Runtime overload is not intended yet.
2017-06-09 21:43:35 +02:00
Mark a4ad791969 Add help message to editor
Still no idea why it was added to the list twice.
2017-06-08 22:28:18 +02:00
Mark d252e839b5 Remove references to AI
the basic AI should not be referenced in its components, so that they are independent of each other
2017-06-08 21:58:37 +02:00
Mark df0a43a46b Stricter calls
This is completely optional, as the calls do now cause an error and not just log a warning
2017-06-08 21:44:32 +02:00
Mark c64670c7d5 Replace .control references
Same argument as renaming the control effect. Is optional, though
2017-06-08 21:35:04 +02:00
Mark 6440b16387 Minor script formatting 2017-06-08 21:25:11 +02:00
Mark a87eed5de1 Replace FxAI-references
The hardcoded references make renaming the effect later a huge problem.
2017-06-08 21:15:31 +02:00
Mark f204b959e7 Port from AI library project
It seems that the vehicle AI is broken.
2017-06-08 20:54:54 +02:00
Mark 8b149a5433 Preparation: Move files to a different folder 2017-06-08 20:32:36 +02:00
Maikel de Vries 7b4ba0245b fix script error on basement attachment to scaffold (#1917) 2017-06-03 15:41:03 +02:00
Maikel de Vries 2b88e77254 adapt System.ocg headers to style guidelines and small clean ups 2017-06-02 17:15:08 +02:00
Maikel de Vries f3cadedff1 add effects to block damage and fire 2017-06-02 17:15:08 +02:00
Mark b19e083495 Fixed a typo 2017-05-31 21:59:04 +02:00
Nicolas Hake 9d6d873156 Merge GH-43 from Fulgen301/OCMilestoneProject
Torch: Add new mesh
  Torch: Emits light when held, remove DoKneel() animation
2017-05-31 18:13:39 +02:00
Linus Heckemann 5e8ad9c8e6 nix expression: add readline 2017-05-30 09:02:43 +01:00
Linus Heckemann 03cb5f9881 nix expression: move pkgconfig to nativeBuildInputs 2017-05-30 09:02:43 +01:00
Linus Heckemann ef3e59890c Add expression for building with nix package manager 2017-05-30 09:02:43 +01:00
Mark 3f9687c1a0 Assert: New assertion for definition context 2017-05-29 21:56:06 +02:00
Sven Eberhardt 04ec41b54c Hide Wearable and RangedWeapon libraries in object creator 2017-05-27 16:34:33 +09:00
Sven Eberhardt 9c2fa297ca Move LavaChunk from volcano to items/resources
This simplifies editor placement
2017-05-27 16:33:22 +09:00
Sven Eberhardt a2d6b65668 Add Title.txt for group folders in Objects.ocd and Decoration.ocd 2017-05-27 16:31:46 +09:00
Sven Eberhardt a74dcc5450 Editor: Support localized definition group folder names (from Title.txt) 2017-05-27 16:30:59 +09:00
Sven Eberhardt cb86124d78 Ladder: Add editor handles to drag length 2017-05-22 12:15:45 -04:00
Nicolas Hake 233d7edba4 Merge PR GH-44 from tusharpm/clangtidy
Automatic fixes using clang-tidy for header files
2017-05-15 13:48:51 +02:00
Tushar Maheshwari a661eab867 Automatic fixes using clang-tidy for header files
A follow-up on a previous PR GH-41. The discussion in the forum can be
viewed at http://forum.openclonk.org/topic_show.pl?pid=33086.
Run clang-tidy (without auto, pass-by-value and using checks) to fix the
header files not modified in the previous PR.

Summary of the changes:

 - C++11 member initialization.
 - nullptr instead of 0 for pointers.
 - override for functions declared virtual in base class.
 - default trivial special member functions
2017-05-15 13:46:46 +02:00
Nicolas Hake 903be585c8 Merge PR GH-42 from tusharpm/includes
Consolidate the include statements scattered across the code in accordance
with this comment in C4Include.h. The advantages are listed in the same
comment.

Furthermore, it follows llvm-include-order which is the logical
extrapolation of the project's style guideline wherever possible
(C4Include.h being the most-frequent exception).

Summarizing the changes:

 - Remove the files included in C4Include.h from all other files.
 - Reorder the include directives in the cpp files
   - C4Include.h
   - main module header
   - other headers (lexicographical order)
 - Remove repeated include statements (easy to spot after sorting)

Tested the local Windows build and Travis builds succeeded for Linux.

Note: this was not all automated, the manual steps may have introduced
some errors in sorting.
2017-05-15 13:26:26 +02:00
Tushar Maheshwari 3a4f49ad90 Revisit #includes
Consolidate the include statements scattered across the code in accordance
with the comment in C4Include.h. The advantages are listed in the same
comment.
Furthermore, it follows llvm-include-order which is the logical
extrapolation of the project's style guideline wherever possible
(C4Include.h being the most-frequent exception).
2017-05-15 13:24:59 +02:00
Maikel de Vries 0ed4d484fc prevent kill logs rule from creating the relaunch rule 2017-05-15 12:17:17 +02:00
Maikel de Vries 9e9e664581 only show entering interaction if actually standing at the entrance of an object 2017-05-13 15:04:02 +02:00
Maikel de Vries 496c73a50f add a method to calculate the area to the shape library 2017-05-13 14:59:14 +02:00
Maikel de Vries fd734330d6 first try to enter pushed vehicle when entering objects
There was no possibility to enter vehicles into yet, so this would be my first attempt to solve this, we can evaluate this and improve if needed.
2017-05-12 14:38:36 +02:00
Mark 70a89ce4f8 GUI: More robust calculation 2017-05-11 21:52:20 +02:00
Mark 1362494790 Fixed accidental redeclaration existing constant 2017-05-11 21:19:47 +02:00
Sven Eberhardt 9abf0d156e Add editor drag handle to extend tunnel support decoration 2017-05-10 18:42:56 -04:00
Sven Eberhardt 041e562542 Add HorizontalFix and VerticalFix support for "point" editor property delegate 2017-05-10 18:42:56 -04:00
Lukas Werling 15e5857689 Change alut includes to <AL/alut.h>
Alut's pkg-config definition only adds the top-level include directory
containing the AL directory to the include paths. This works on most
platforms because OpenAL adds that AL directory. However, with nix,
these two directories are distinct and the build fails.
2017-05-10 23:23:09 +02:00
Mark 739ddc2be3 Additional GUI layout
I found it a lot easier to create GUIs with these functions, so I decided to add them. If something can be simplified, please tell me so.
2017-05-10 22:33:38 +02:00
Mark 631c239717 Merge function for proplists 2017-05-10 22:03:57 +02:00
Mark 03dc2cb84f Some common assertions
An attempt in reducing duplicate code :)
2017-05-10 21:52:54 +02:00
Fulgen301 2c15422c2e Torch: Add new mesh 2017-05-05 17:53:36 +02:00
Fulgen301 1d92b47141 Torch: Emits light when held, remove DoKneel() animation 2017-05-01 15:38:35 +02:00
2403 changed files with 116669 additions and 16721 deletions

28
.gitignore vendored
View File

@ -18,7 +18,7 @@ C4Version.h
Makefile
C4Include.h.gch
intermediate
build*
/build*
CMakeScripts
CMakeFiles
CMakeCache.txt
@ -35,13 +35,15 @@ tests/CTestTestfile.cmake
# Documentation
*.pyc
docs/online
docs/chm
docs/sdk-de
docs/sdk/content.xml
docs/*.mo
docs/doku.pot
docs/Functions.txt
node_modules
/docs/online
/docs/chm
/docs/sdk-de
/docs/sdk/content.xml
/docs/*.mo
/docs/doku.pot
/docs/Functions.txt
/docs/lunr.js
# Visual studio files
openclonk.opensdf
@ -82,6 +84,16 @@ openclonk.ilk
*.vcxproj
*.vcxproj.filters
/ipch
.vs/
c4group_autogen/
c4script_autogen/
libc4script_autogen/
libmisc_autogen/
libopenclonk_autogen/
netpuncher_autogen/
openclonk-server_autogen/
openclonk_autogen/
thirdparty/blake2/blake2_autogen/
# Temporary files created by Microsoft Visual Studio
*.ncb

View File

@ -2,7 +2,7 @@
language: cpp
dist: trusty
sudo: required # not actually required, but the virtualization builds are more stable and have better single core performance. If in doubt, remove.
sudo: required # for Qt libraries. Additionally, the virtualization builds are more stable and have better single core performance.
matrix:
include:
@ -11,7 +11,7 @@ matrix:
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-4.9', 'build-essential', 'cmake', 'libfreetype6-dev', 'libgl1-mesa-dev', 'libglew-dev', 'libgtk-3-dev', 'libjpeg-dev', 'libpng-dev', 'libsdl2-dev', 'libupnp-dev', 'libxrandr-dev', 'x11proto-core-dev', 'zlib1g-dev', 'libalut0', 'libgtest-dev']
packages: ['g++-4.9', 'build-essential', 'cmake3', 'libfreetype6-dev', 'libgl1-mesa-dev', 'libglew-dev', 'libgtk-3-dev', 'libjpeg-dev', 'libpng-dev', 'libsdl2-dev', 'libupnp-dev', 'libxrandr-dev', 'x11proto-core-dev', 'zlib1g-dev', 'libalut0', 'libgtest-dev']
env:
- CCOMPILER=gcc-4.9
- CXXCOMPILER=g++-4.9
@ -22,21 +22,25 @@ matrix:
compiler: gcc
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
packages: ['g++-5', 'build-essential', 'cmake', 'libfreetype6-dev', 'libgl1-mesa-dev', 'libglew-dev', 'libgtk-3-dev', 'libjpeg-dev', 'libpng-dev', 'libsdl2-dev', 'libupnp-dev', 'libxrandr-dev', 'x11proto-core-dev', 'zlib1g-dev', 'libalut0', 'ninja-build', 'libgtest-dev']
sources:
- ubuntu-toolchain-r-test
- sourceline: ppa:beineri/opt-qt596-trusty
packages: ['g++-5', 'build-essential', 'cmake3', 'libpng-dev', 'libjpeg-dev', 'libfreetype6-dev', 'libglew-dev', 'libreadline-dev', 'libsdl2-dev', 'qt59base', 'libalut-dev', 'libvorbis-dev', 'libopenal-dev', 'libdw-dev', 'libgtest-dev', 'ninja-build']
env:
- CCOMPILER=gcc-5
- CXXCOMPILER=g++-5
- TYPE=Debug
- CXX_FLAGS="-fdiagnostics-color"
- TYPE=RelWithDebInfo
- CXX_FLAGS="-fdiagnostics-color -I/usr/include/AL"
- BSYS="Ninja#ninja -k30" PCH=on
- UPLOAD_SNAPSHOT=1
- CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=/usr -DWITH_AUTOMATIC_UPDATE=ON -DWITH_APPDIR_INSTALLATION=ON"
- os: linux
compiler: clang
addons:
apt:
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-precise-3.8']
packages: ['clang-3.8', 'build-essential', 'cmake', 'libfreetype6-dev', 'libgl1-mesa-dev', 'libglew-dev', 'libgtk-3-dev', 'libjpeg-dev', 'libpng-dev', 'libsdl2-dev', 'libupnp-dev', 'libxrandr-dev', 'x11proto-core-dev', 'zlib1g-dev', 'libalut0', 'ninja-build', 'libc++-dev', 'libc++1', 'libgtest-dev']
packages: ['clang-3.8', 'build-essential', 'cmake3', 'libfreetype6-dev', 'libgl1-mesa-dev', 'libglew-dev', 'libgtk-3-dev', 'libjpeg-dev', 'libpng-dev', 'libsdl2-dev', 'libupnp-dev', 'libxrandr-dev', 'x11proto-core-dev', 'zlib1g-dev', 'libalut0', 'ninja-build', 'libc++-dev', 'libc++1', 'libgtest-dev']
env:
- CCOMPILER=clang-3.8
- CXXCOMPILER=clang++-3.8
@ -47,8 +51,12 @@ matrix:
before_install:
- for t in test mock; do wget https://github.com/google/google$t/archive/release-1.7.0.tar.gz -Og$t.tgz && tar xvf g$t.tgz; done
install:
- '[ -e /opt/qt59/bin/qt59-env.sh ] && source /opt/qt59/bin/qt59-env.sh || echo building without Qt'
before_script:
- export CXX="$CXXCOMPILER" CC="$CCOMPILER"
- export C4REVISION_BRANCH="$TRAVIS_BRANCH"
- >
cmake
-G"${BSYS/\#*/}"
@ -57,9 +65,20 @@ before_script:
-DUSE_GCC_PCH=${PCH:-off}
-DGTEST_ROOT=$PWD/googletest-release-1.7.0
-DGMOCK_ROOT=$PWD/googlemock-release-1.7.0
$CMAKE_FLAGS
.
script:
- ${BSYS/*#/} all netpuncher tests aul_test
- ./tests/tests
# TODO: Remove SKIP_IPV6_TEST once Travis generally adds ::1 as loopback address.
- SKIP_IPV6_TEST=1 ./tests/tests
- ./tests/aul_test
after_success:
- >
[ "$UPLOAD_SNAPSHOT" = 1 ] &&
echo "Creating AppImage..." &&
tools/create_appimage.sh &&
echo "Uploading snapshot..." &&
tools/upload_snapshot.sh OpenClonk-x86_64.AppImage OpenClonk-x86_64.AppImage.zsync ||
echo "Snapshot creation has failed"

View File

@ -1,6 +1,6 @@
# OpenClonk, http://www.openclonk.org
#
# Copyright (c) 2009-2016, The OpenClonk Team and contributors
# Copyright (c) 2009-2018, The OpenClonk Team and contributors
#
# Distributed under the terms of the ISC license; see accompanying file
# "COPYING" for details.
@ -11,7 +11,7 @@
# To redistribute this file separately, substitute the full license texts
# for the above references.
cmake_minimum_required (VERSION 3.0.2)
cmake_minimum_required (VERSION 3.5.1)
# Don't allow people to build "Release" builds because there's no reason to do that.
# Use one of RelWithDebInfo or MinSizeRel instead.
@ -23,31 +23,61 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()
project (openclonk CXX C)
if(POLICY CMP0067)
cmake_policy(SET CMP0067 NEW)
else()
# Wrap try_compile such that it correctly passes the standard flags to the
# compiler on CMake versions below 3.8. Remove when you update the minimum
# required version to 3.8 or later.
macro(try_compile)
set(_tc_langs)
foreach(_tc_lang CXX C)
if(DEFINED CMAKE_${_tc_lang}_STANDARD)
list(APPEND _tc_langs ${_tc_lang})
endif()
endforeach()
foreach(_tc_lang ${_tc_langs})
if (${CMAKE_${_tc_lang}_EXTENSIONS})
set(_tc_ext EXTENSION)
else()
set(_tc_ext STANDARD)
endif()
set(_backup_${_tc_lang}_flags "${CMAKE_${_tc_lang}_FLAGS}")
set(CMAKE_${_tc_lang}_FLAGS "${CMAKE_${_tc_lang}_FLAGS} ${CMAKE_${_tc_lang}${CMAKE_${_tc_lang}_STANDARD}_${_tc_ext}_COMPILE_OPTION}")
endforeach()
# CMP0054: Only interpret if() arguments as variables or keywords when unquoted
# (since CMake 3.1)
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
_try_compile(${ARGN})
foreach(_tc_lang ${_tc_langs})
set(CMAKE_${_tc_lang}_FLAGS "${_backup_${_tc_lang}_flags}")
endforeach()
endmacro()
endif()
project (openclonk CXX C)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(Version)
set(CMAKE_ADDITIONAL_DEPS_PATH "${CMAKE_CURRENT_BINARY_DIR}/deps" CACHE PATH "Additional directory to search for libraries and headers")
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_ADDITIONAL_DEPS_PATH})
if(DEFINED CMAKE_ADDITIONAL_DEPS_PATH)
message(WARNING "CMAKE_ADDITIONAL_DEPS_PATH is deprecated and will be removed in a future version. Set CMAKE_PREFIX_PATH instead.")
set(CMAKE_PREFIX_PATH ${CMAKE_ADDITIONAL_DEPS_PATH})
endif()
############################################################################
# User selectable options
############################################################################
include(CMakeDependentOption)
option(PROJECT_FOLDERS "Put source files into subfolders in project file" ON)
option(DEPLOY_QT_LIBRARIES "Deploy Qt libraries to executable path" OFF)
CMAKE_DEPENDENT_OPTION(USE_COCOA "Use Apple Cocoa widgets." ON "APPLE" OFF)
CMAKE_DEPENDENT_OPTION(USE_WIN32_WINDOWS "Use Microsoft Desktop App User Interface widgets." ON "WIN32" OFF)
CMAKE_DEPENDENT_OPTION(USE_SDL_MAINLOOP "Use SDL to create windows etc. Qt editor." ON "NOT USE_COCOA AND NOT USE_WIN32_WINDOWS AND NOT HEADLESS_ONLY" OFF)
option(WITH_AUTOMATIC_UPDATE "Automatic updates are downloaded from the project website." OFF)
CMAKE_DEPENDENT_OPTION(WITH_APPDIR_INSTALLATION "Install into an AppDir" OFF "UNIX AND NOT APPLE AND WITH_AUTOMATIC_UPDATE" ON)
option(HEADLESS_ONLY "Only build headless parts. Somewhat reduces dependencies. (still needs libpng because that one's small and hard to remove.) Only tested with make/gcc/linux." OFF)
option(C4GROUP_TOOL_ONLY "Only build c4group binary." OFF)
set_property(GLOBAL PROPERTY USE_FOLDERS ${PROJECT_FOLDERS})
@ -56,13 +86,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ${PROJECT_FOLDERS})
############################################################################
include(CheckCXXCompilerFlag)
# Required for CMake >= 3.1.0 and Qt >= 5.7
set(CMAKE_CXX_STANDARD 14)
CHECK_CXX_COMPILER_FLAG("-std=gnu++14" USE_GCC_STD_14)
if(USE_GCC_STD_14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Enable link-time code generation. We have to do this manually because while
# there is a INTERPROCEDURAL_OPTIMIZATION cmake flag, it's only implemented
@ -99,9 +124,11 @@ if(USE_GCC_STYLE_LTCG)
# Use GCC's ar and ranlib wrappers if necessary, because the plain ones
# don't understand lto objects without an explicit plugin parameter
if(CMAKE_C_COMPILER MATCHES "gcc$")
# Note that versioned gcc executables need splitting: gcc-5 -> gcc-ar-5
if(CMAKE_C_COMPILER MATCHES "^(.*gcc)(-[0-9.])?$")
set(LTCG_NEEDS_AR_WRAPPER 1)
set(LTCG_AR_WRAPPER_PREFIX "${CMAKE_C_COMPILER}")
set(LTCG_AR_WRAPPER_PREFIX "${CMAKE_MATCH_1}")
set(LTCG_AR_WRAPPER_SUFFIX "${CMAKE_MATCH_2}")
elseif(CMAKE_C_COMPILER MATCHES "cc$")
set(LTCG_NEEDS_AR_WRAPPER 1)
set(LTCG_AR_WRAPPER_PREFIX "gcc")
@ -110,12 +137,12 @@ if(USE_GCC_STYLE_LTCG)
endif()
if(LTCG_NEEDS_AR_WRAPPER)
find_program(AR_WRAPPER "${LTCG_AR_WRAPPER_PREFIX}-ar")
find_program(AR_WRAPPER "${LTCG_AR_WRAPPER_PREFIX}-ar${LTCG_AR_WRAPPER_SUFFIX}")
if (AR_WRAPPER)
message("Using ${AR_WRAPPER} instead of ${CMAKE_AR} to support lto objects.")
set(CMAKE_AR "${AR_WRAPPER}" CACHE FILEPATH "Path to an ar that supports lto objects." FORCE)
endif()
find_program(RANLIB_WRAPPER "${LTCG_AR_WRAPPER_PREFIX}-ranlib")
find_program(RANLIB_WRAPPER "${LTCG_AR_WRAPPER_PREFIX}-ranlib${LTCG_AR_WRAPPER_SUFFIX}")
if (RANLIB_WRAPPER)
message("Using ${RANLIB_WRAPPER} instead of ${CMAKE_RANLIB} to support lto objects.")
set(CMAKE_RANLIB "${RANLIB_WRAPPER}" CACHE FILEPATH "Path to a ranlib that supports lto objects." FORCE)
@ -141,6 +168,7 @@ if(MSVC)
# Enable LTCG for release builds
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Ob2 /GL")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /Ob2 /GL")
add_linker_flags(optimized MODULES exe shared FLAGS "/INCREMENTAL:NO")
add_linker_flags(optimized MODULES exe shared static FLAGS "/LTCG:incremental")
# do not link the release CRT in debug builds
@ -158,7 +186,7 @@ endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wextra-tokens -Wpointer-arith -Wno-cast-align -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual")
elseif(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wredundant-decls -Wendif-labels -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Winit-self -Wsign-promo -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wredundant-decls -Wendif-labels -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Winit-self -Wsign-promo -Wno-reorder -Wno-unused-parameter -Wnon-virtual-dtor -Woverloaded-virtual -Wformat-security")
endif()
if(WIN32 AND MINGW)
@ -166,10 +194,6 @@ if(WIN32 AND MINGW)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--nxcompat -Wl,--dynamicbase")
endif()
if(UNIX)
add_definitions("-DOC_SYSTEM_DATA_DIR=\"${CMAKE_INSTALL_PREFIX}/share/games/openclonk\"")
endif()
if(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fobjc-arc -headerpad_max_install_names")
endif()
@ -177,6 +201,12 @@ endif()
############################################################################
# Check for compiler quirks and features
############################################################################
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CROSSCOMPILING)
include(HandleGccCrossIncludePaths)
HANDLE_GCC_CROSS_INCLUDE_PATHS(CXX c++)
HANDLE_GCC_CROSS_INCLUDE_PATHS(C c)
endif()
include(CheckCXXSourceCompiles)
include(RequireCXXSourceCompiles)
include(CheckCXXSymbolExists)
@ -200,13 +230,9 @@ check_cxx_symbol_exists(vasprintf stdio.h HAVE_VASPRINTF)
############################################################################
include(CheckIncludeFileCXX)
include(CheckIncludeFilesCXX)
CHECK_INCLUDE_FILE_CXX(direct.h HAVE_DIRECT_H)
CHECK_INCLUDE_FILE_CXX(io.h HAVE_IO_H)
CHECK_INCLUDE_FILE_CXX(locale.h HAVE_LOCALE_H)
CHECK_INCLUDE_FILE_CXX(share.h HAVE_SHARE_H)
CHECK_INCLUDE_FILE_CXX(signal.h HAVE_SIGNAL_H)
CHECK_INCLUDE_FILE_CXX(stdint.h HAVE_STDINT_H)
CHECK_INCLUDE_FILE_CXX(inttypes.h HAVE_INTTYPES_H)
CHECK_INCLUDE_FILE_CXX(sys/stat.h HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILE_CXX(sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILE_CXX(unistd.h HAVE_UNISTD_H)
@ -224,25 +250,30 @@ CHECK_CXX_SOURCE_COMPILES("#include <getopt.h>\nint main(int argc, char * argv[]
# Locate libraries
############################################################################
SET(JPEG_NAMES ${JPEG_NAMES} libjpeg jpeg-static)
if(NOT HEADLESS_ONLY)
if(NOT HEADLESS_ONLY AND NOT C4GROUP_TOOL_ONLY)
find_package(Freetype REQUIRED)
include_directories(
${FREETYPE_INCLUDE_DIRS})
link_directories(
${FREETYPE_LIBRARY_DIRS})
endif()
find_package(JPEG REQUIRED)
find_package(PNG REQUIRED)
# Needed for c4group
find_package(ZLIB REQUIRED)
include_directories(
${JPEG_INCLUDE_DIR}
${PNG_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR})
if(CMAKE_SYSTEM MATCHES "Windows")
message(STATUS "Using Win32 threading.")
else()
find_package("Threads" REQUIRED)
SET(HAVE_PTHREAD ${CMAKE_USE_PTHREADS_INIT} CACHE INTERNAL "libpthread available")
if (NOT C4GROUP_TOOL_ONLY)
find_package(JPEG REQUIRED)
find_package(PNG REQUIRED)
include_directories(
${JPEG_INCLUDE_DIR}
${PNG_INCLUDE_DIR}
${ZLIB_INCLUDE_DIR})
if(CMAKE_SYSTEM MATCHES "Windows")
message(STATUS "Using Win32 threading.")
else()
find_package("Threads" REQUIRED)
SET(HAVE_PTHREAD ${CMAKE_USE_PTHREADS_INIT} CACHE INTERNAL "libpthread available")
endif()
endif()
# FINDLIB works the same as find_library, but also marks the resulting var as
@ -267,19 +298,20 @@ if(NOT HAVE_GETOPT_H)
set(GETOPT_LIBRARIES getopt)
endif()
# TinyXML
find_package(TinyXML)
if(NOT TinyXML_FOUND)
add_subdirectory(thirdparty/tinyxml)
set_property(TARGET tinyxml PROPERTY FOLDER "Third-party libraries")
set(TinyXML_INCLUDE_DIRS thirdparty/tinyxml)
set(TinyXML_LIBRARIES tinyxml)
set(TinyXML_FOUND TRUE)
if (NOT C4GROUP_TOOL_ONLY)
# TinyXML
find_package(TinyXML)
if(NOT TinyXML_FOUND)
add_subdirectory(thirdparty/tinyxml)
set_property(TARGET tinyxml PROPERTY FOLDER "Third-party libraries")
set(TinyXML_INCLUDE_DIRS thirdparty/tinyxml)
set(TinyXML_LIBRARIES tinyxml)
set(TinyXML_FOUND TRUE)
endif()
include_directories(SYSTEM ${TinyXML_INCLUDE_DIRS})
endif()
include_directories(SYSTEM ${TinyXML_INCLUDE_DIRS})
if(NOT HEADLESS_ONLY)
if(NOT HEADLESS_ONLY AND NOT C4GROUP_TOOL_ONLY)
find_package(OpenGL)
find_package(GLEW REQUIRED)
include_directories(${GLEW_INCLUDE_DIRS})
@ -291,13 +323,26 @@ if(NOT HEADLESS_ONLY)
CHECK_CXX_SOURCE_COMPILES("#include <GL/glew.h>\nvoid GLAPIENTRY OpenGLDebugProc(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char* message, const void* userParam) {}\nint main() { GLDEBUGPROCARB proc = &OpenGLDebugProc; }" GLDEBUGPROCARB_USERPARAM_IS_CONST)
endif()
if(UNIX AND NOT APPLE)
FINDLIB(X11_LIBRARIES X11)
if(NOT C4GROUP_TOOL_ONLY)
if(UNIX AND NOT APPLE)
FINDLIB(X11_LIBRARIES X11)
set(Backward_DIR thirdparty/backward-cpp)
find_package(Backward)
if(Backward_FOUND)
set(HAVE_BACKWARD 1)
set(Backward_DIR thirdparty/backward-cpp)
find_package(Backward)
if(Backward_FOUND)
set(HAVE_BACKWARD 1)
endif()
if(NOT DEFINED PROC_SELF_EXE)
macro(FIND_PROC_SELF_EXE path)
if(EXISTS ${path})
set(PROC_SELF_EXE ${path} CACHE FILEPATH "Path to /proc/self/exe (Linux) or equivalent")
endif()
endmacro()
FIND_PROC_SELF_EXE(/proc/self/exe) # Linux
FIND_PROC_SELF_EXE(/proc/curproc/file) # FreeBSD
FIND_PROC_SELF_EXE(/proc/curproc/exe) # NetBSD
endif()
endif()
endif()
@ -309,71 +354,74 @@ if (WIN32)
set(HAVE_DBGHELP ${DBGHELP_FOUND})
endif()
find_package(Upnp)
if(UPNP_FOUND)
include_directories(SYSTEM ${UPNP_INCLUDE_DIR})
endif()
if(NOT C4GROUP_TOOL_ONLY)
find_package(Upnp)
if(UPNP_FOUND)
include_directories(SYSTEM ${UPNP_INCLUDE_DIR})
endif()
find_package(Readline)
if(READLINE_FOUND)
include_directories(SYSTEM ${READLINE_INCLUDE_DIR})
endif()
SET(HAVE_LIBREADLINE ${READLINE_FOUND} CACHE INTERNAL "libreadline available")
find_package(Readline)
if(READLINE_FOUND)
include_directories(SYSTEM ${READLINE_INCLUDE_DIR})
endif()
SET(HAVE_LIBREADLINE ${READLINE_FOUND} CACHE INTERNAL "libreadline available")
find_package(GTK3 COMPONENTS gthread gio gobject glib OPTIONAL_COMPONENTS gtksourceview)
find_package(GTK3 COMPONENTS gthread gio gobject glib OPTIONAL_COMPONENTS gtksourceview)
# Select an audio library
find_package("Audio")
if(Audio_FOUND)
include_directories(${Audio_INCLUDE_DIRS})
endif()
# Select an audio library
find_package("Audio")
if(Audio_FOUND)
include_directories(${Audio_INCLUDE_DIRS})
endif()
# SDL
if(USE_SDL_MAINLOOP)
find_package(SDL2 REQUIRED)
else()
# for gamepads
find_package(SDL2)
endif()
set(HAVE_SDL ${SDL2_FOUND})
include_directories(SYSTEM ${SDL2_INCLUDE_DIRS})
# SDL
if(USE_SDL_MAINLOOP)
find_package(SDL2 REQUIRED)
else()
# for gamepads
find_package(SDL2)
endif()
set(HAVE_SDL ${SDL2_FOUND})
include_directories(SYSTEM ${SDL2_INCLUDE_DIRS})
# Qt5 for editor
find_path(Qt5DIR qt.pro PATHS ${CMAKE_ADDITIONAL_DEPS_PATH}/qt-5.5.0)
find_package(Qt5Widgets 5.4 PATHS ${Qt5DIR}/qtbase/lib/cmake/Qt5Widgets)
if(Qt5Widgets_FOUND)
SET(WITH_QT_EDITOR ${Qt5Widgets_FOUND} "Qt editor dialogues available")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
# As moc files are generated in the binary dir, tell CMake
# to always look for includes there:
set(CMAKE_INCLUDE_CURRENT_DIR ON)
else()
message("Qt5Widgets not found. Building openclonk without editor.")
UNSET(WITH_QT_EDITOR)
# Qt5 for editor
find_package(Qt5 5.4 CONFIG COMPONENTS Core Widgets)
if(TARGET Qt5::Core)
SET(WITH_QT_EDITOR ON "Qt editor dialogues available")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
# As moc files are generated in the binary dir, tell CMake
# to always look for includes there:
set(CMAKE_INCLUDE_CURRENT_DIR ON)
else()
message("Qt5Widgets not found. Building openclonk without editor.")
UNSET(WITH_QT_EDITOR)
endif()
endif()
############################################################################
# generated source files
############################################################################
find_program(GLIB_COMPILE_RESOURCES glib-compile-resources)
if(NOT C4GROUP_TOOL_ONLY)
find_program(GLIB_COMPILE_RESOURCES glib-compile-resources)
add_custom_command(
OUTPUT mape-resource.c
COMMAND
${GLIB_COMPILE_RESOURCES} "--internal" "--generate"
"--target" "mape-resource.c"
"--sourcedir" ${CMAKE_CURRENT_SOURCE_DIR}/src/res
"${CMAKE_CURRENT_SOURCE_DIR}/src/res/mape.xml"
MAIN_DEPENDENCY src/res/mape.xml
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocd.ico
${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocf.ico
${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocg.ico
${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocm.ico
${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocs.ico
VERBATIM
)
add_custom_command(
OUTPUT mape-resource.c
COMMAND
${GLIB_COMPILE_RESOURCES} "--internal" "--generate"
"--target" "mape-resource.c"
"--sourcedir" ${CMAKE_CURRENT_SOURCE_DIR}/src/res
"${CMAKE_CURRENT_SOURCE_DIR}/src/res/mape.xml"
MAIN_DEPENDENCY src/res/mape.xml
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocd.ico
${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocf.ico
${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocg.ico
${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocm.ico
${CMAKE_CURRENT_SOURCE_DIR}/src/res/ocs.ico
VERBATIM
)
endif()
############################################################################
# Mac OS bundle setup
@ -973,7 +1021,7 @@ include_directories(SYSTEM
############################################################################
add_definitions(-DHAVE_CONFIG_H)
add_library(libmisc
add_library(libmisc STATIC
src/C4Include.cpp
src/c4group/C4Group.cpp
src/c4group/C4Group.h
@ -1038,7 +1086,7 @@ if(UNIX AND NOT APPLE)
target_link_libraries(libmisc rt)
endif()
add_library(libc4script
add_library(libc4script STATIC
src/C4Include.cpp
src/c4group/C4ComponentHost.cpp
src/c4group/C4ComponentHost.h
@ -1072,6 +1120,8 @@ src/script/C4PropList.h
src/script/C4Script.cpp
src/script/C4ScriptHost.cpp
src/script/C4ScriptHost.h
src/script/C4ScriptLibraries.cpp
src/script/C4ScriptLibraries.h
src/script/C4StringTable.cpp
src/script/C4StringTable.h
src/script/C4Value.cpp
@ -1081,10 +1131,11 @@ src/script/C4ValueArray.h
src/script/C4ValueMap.cpp
src/script/C4ValueMap.h
)
add_subdirectory(thirdparty/blake2)
set_property(TARGET blake2 PROPERTY FOLDER "Third-party libraries")
target_link_libraries(libc4script blake2 libmisc)
target_link_libraries(libc4script libmisc)
add_library(libopenclonk
add_library(libopenclonk STATIC
src/c4group/C4Extra.cpp
src/c4group/C4Extra.h
src/control/C4PlayerInfoConflicts.cpp
@ -1154,7 +1205,7 @@ target_link_libraries(c4script
${GETOPT_LIBRARIES}
)
if(NOT HEADLESS_ONLY)
if(NOT HEADLESS_ONLY AND NOT C4GROUP_TOOL_ONLY)
add_executable(openclonk WIN32 MACOSX_BUNDLE
${OC_SYSTEM_SOURCES}
${OC_GUI_SOURCES}
@ -1186,48 +1237,60 @@ if(NOT HEADLESS_ONLY)
if(WITH_QT_EDITOR)
set_target_properties(openclonk PROPERTIES COMPILE_DEFINITIONS WITH_QT_EDITOR)
qt5_use_modules(openclonk Widgets)
target_link_libraries(openclonk Qt5::Widgets)
# Deploy dependency libraries and platforms/ folder
if(DEPLOY_QT_LIBRARIES)
if(WIN32)
include(DeployQt)
windeployqt(openclonk)
elseif(APPLE)
include(DeployQt)
macdeployqt(nitroshare-client)
endif()
endif()
endif()
if(HAVE_BACKWARD)
add_backward(openclonk)
target_link_libraries(openclonk Backward::Backward)
endif()
endif()
add_executable(openclonk-server
${OC_SYSTEM_SOURCES}
${OC_CLONK_SOURCES}
src/platform/C4AppT.cpp
src/platform/C4StdInProc.cpp
src/platform/C4StdInProc.h
)
target_compile_definitions(openclonk-server PRIVATE "USE_CONSOLE")
if(NOT C4GROUP_TOOL_ONLY)
add_executable(openclonk-server
${OC_SYSTEM_SOURCES}
${OC_CLONK_SOURCES}
src/platform/C4AppT.cpp
src/platform/C4StdInProc.cpp
src/platform/C4StdInProc.h
)
target_compile_definitions(openclonk-server PRIVATE "USE_CONSOLE")
target_link_libraries(openclonk-server
${PNG_LIBRARIES}
${JPEG_LIBRARIES}
${EXECINFO_LIBRARY}
${SDL2_LIBRARIES}
${READLINE_LIBRARIES}
${Audio_LIBRARIES}
${GETOPT_LIBRARIES}
${TinyXML_LIBRARIES}
${DBGHELP_LIBRARIES}
libmisc
libc4script
libopenclonk
)
if(UPNP_FOUND)
target_link_libraries(openclonk-server ${UPNP_LIBRARIES})
endif()
if(USE_COCOA)
target_link_libraries(openclonk-server "-framework Cocoa")
endif()
if(HAVE_BACKWARD)
add_backward(openclonk-server)
target_link_libraries(openclonk-server
${PNG_LIBRARIES}
${JPEG_LIBRARIES}
${EXECINFO_LIBRARY}
${READLINE_LIBRARIES}
${GETOPT_LIBRARIES}
${TinyXML_LIBRARIES}
${DBGHELP_LIBRARIES}
libmisc
libc4script
libopenclonk
)
if(UPNP_FOUND)
target_link_libraries(openclonk-server ${UPNP_LIBRARIES})
endif()
if(USE_COCOA)
target_link_libraries(openclonk-server "-framework Cocoa")
endif()
if(HAVE_BACKWARD)
target_link_libraries(openclonk-server Backward::Backward)
endif()
install(TARGETS openclonk-server DESTINATION bin)
endif()
if(GTK3_FOUND AND GTK3_gtksourceview_FOUND AND NOT HEADLESS_ONLY)
if(GTK3_FOUND AND GTK3_gtksourceview_FOUND AND NOT HEADLESS_ONLY AND NOT C4GROUP_TOOL_ONLY)
add_executable(mape ${MAPE_BASE_SOURCES} ${MAPE_SOURCES})
target_compile_options(mape PRIVATE ${GTK3_COMPILE_DEFINITIONS} ${GTK3_gtksourceview_COMPILE_DEFINITIONS})
set_property(TARGET mape PROPERTY FOLDER "Utilities")
@ -1254,17 +1317,19 @@ target_link_libraries(c4group
libmisc
)
add_executable(netpuncher EXCLUDE_FROM_ALL
src/netpuncher/C4PuncherHash.h
src/netpuncher/main.cpp
)
if(NOT C4GROUP_TOOL_ONLY)
add_executable(netpuncher EXCLUDE_FROM_ALL
src/netpuncher/C4PuncherHash.h
src/netpuncher/main.cpp
)
target_link_libraries(netpuncher
libmisc
)
target_link_libraries(netpuncher
libmisc
)
if(WIN32)
target_link_libraries(libmisc iphlpapi ws2_32)
if(WIN32)
target_link_libraries(libmisc iphlpapi ws2_32)
endif()
endif()
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS $<$<CONFIG:Debug>:_DEBUG>)
@ -1281,7 +1346,7 @@ if (APPLE AND NOT CMAKE_GENERATOR STREQUAL "Xcode")
set(EXECUTABLE_NAME openclonk)
endif()
if(NOT HEADLESS_ONLY)
if(NOT HEADLESS_ONLY AND NOT C4GROUP_TOOL_ONLY)
set_target_properties(openclonk PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/src/res/Info.plist")
endif()
@ -1367,7 +1432,9 @@ endif()
############################################################################
# Miscellaneous
############################################################################
add_subdirectory(tests)
if(NOT C4GROUP_TOOL_ONLY)
add_subdirectory(tests)
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
@ -1391,42 +1458,33 @@ if(CMAKE_GENERATOR MATCHES "^Visual Studio 14 2015")
)
endif()
############################################################################
# Precompiled header support, gcc part (it needs the cxx flags)
############################################################################
if(CMAKE_COMPILER_IS_GNUCXX)
include(GccPchSupport)
option(USE_GCC_PCH "Use GCC precompiled headers" OFF)
endif()
if(USE_GCC_PCH)
add_precompiled_header(libmisc src/C4Include.h)
add_precompiled_header(libc4script src/C4Include.h)
add_precompiled_header(openclonk src/C4Include.h)
add_precompiled_header(openclonk-server src/C4Include.h)
endif()
############################################################################
# installation
############################################################################
# Don't allow installation for WITH_AUTOMATIC_UPDATE because otherwise
# the installed binary wouldn't find its game data in the system data path.
IF(WITH_AUTOMATIC_UPDATE)
INSTALL(CODE "MESSAGE(SEND_ERROR \"Installation is only supported for WITH_AUTOMATIC_UPDATE disabled\")")
if(WITH_APPDIR_INSTALLATION)
INSTALL(CODE "MESSAGE(\"WITH_APPDIR_INSTALLATION is enabled, installation will create an AppDir\")")
else()
INSTALL(CODE "MESSAGE(SEND_ERROR \"Installation is only supported for WITH_AUTOMATIC_UPDATE disabled\")")
endif()
ENDIF()
# hack to build the data on install, see
# http://public.kitware.com/Bug/view.php?id=8438
add_custom_target(data)
set_property(TARGET data PROPERTY FOLDER "Setup")
install(
CODE
"execute_process(
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target data
)"
)
if(NOT C4GROUP_TOOL_ONLY)
# hack to build the data on install, see
# http://public.kitware.com/Bug/view.php?id=8438
add_custom_target(data)
set_property(TARGET data PROPERTY FOLDER "Setup")
install(
CODE
"execute_process(
COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target data
)"
)
endif()
if (NOT APPLE)
if (NOT APPLE AND NOT C4GROUP_TOOL_ONLY)
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/res/oc32.png
DESTINATION share/icons/hicolor/32x32/apps
@ -1461,84 +1519,105 @@ ENDIF()
# When cross-compiling, import c4group from a native build
IF(CMAKE_CROSSCOMPILING)
SET(IMPORT_NATIVE_TOOLS "IMPORT_NATIVE_TOOLS-NOTFOUND" CACHE FILEPATH "Export file from a native build")
INCLUDE(${IMPORT_NATIVE_TOOLS})
SET(native_c4group native-c4group)
FIND_PROGRAM(C4GROUP_PATH NAMES c4group PATHS)
IF (NOT C4GROUP_PATH)
SET(IMPORT_NATIVE_TOOLS "IMPORT_NATIVE_TOOLS-NOTFOUND" CACHE FILEPATH "Export file from a native build")
INCLUDE(${IMPORT_NATIVE_TOOLS})
SET(native_c4group native-c4group)
ELSE()
SET(native_c4group ${C4GROUP_PATH})
ENDIF()
ELSE()
SET(native_c4group c4group)
ENDIF()
# NOTE: The scripts that does the autobuilds and ultimately the automated
# releases as well do keep their own list of group files around currently.
# So if you change anything here, change it in the release scripts as well.
# See openclonk-release-scripts.git/groupcontent.py
set(OC_C4GROUPS
Graphics.ocg
Material.ocg
Music.ocg
Sound.ocg
System.ocg
Objects.ocd
Decoration.ocd
Arena.ocf
Parkour.ocf
Defense.ocf
Missions.ocf
Tutorials.ocf
Worlds.ocf
)
foreach(group ${OC_C4GROUPS})
if (APPLE)
if (CMAKE_GENERATOR STREQUAL Xcode)
add_custom_command(TARGET openclonk
POST_BUILD COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/osx_pack_gamedata.sh"
"$<TARGET_FILE:${native_c4group}>"
"${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}"
# leave out third parameter here so the script can figure out Xcode-ish paths as usual
DEPENDS "${native_c4group}"
)
else()
add_custom_command(TARGET openclonk
POST_BUILD COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/osx_pack_gamedata.sh"
"$<TARGET_FILE:${native_c4group}>"
"${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}"
"${CMAKE_CURRENT_BINARY_DIR}/openclonk.app/Contents/Resources"
DEPENDS "${native_c4group}"
)
endif()
else()
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${group}
COMMAND "${native_c4group}" ARGS "${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}" -t "${CMAKE_CURRENT_BINARY_DIR}/${group}"
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}
DEPENDS "${native_c4group}"
VERBATIM
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${group} DESTINATION share/games/openclonk)
if(NOT C4GROUP_TOOL_ONLY)
# NOTE: The scripts that does the autobuilds and ultimately the automated
# releases as well do keep their own list of group files around currently.
# So if you change anything here, change it in the release scripts as well.
# See openclonk-release-scripts.git/groupcontent.py
set(OC_C4GROUPS
Graphics.ocg
Material.ocg
Sound.ocg
System.ocg
Objects.ocd
Decoration.ocd
Arena.ocf
Parkour.ocf
Defense.ocf
Missions.ocf
Tutorials.ocf
Worlds.ocf
)
if(APPLE)
list(APPEND OC_C4GROUPS Music.ocg)
endif()
endforeach()
foreach(group ${OC_C4GROUPS})
if (APPLE)
if (CMAKE_GENERATOR STREQUAL Xcode)
add_custom_command(TARGET openclonk
POST_BUILD COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/osx_pack_gamedata.sh"
"$<TARGET_FILE:${native_c4group}>"
"${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}"
# leave out third parameter here so the script can figure out Xcode-ish paths as usual
DEPENDS "${native_c4group}"
)
else()
add_custom_command(TARGET openclonk
POST_BUILD COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/tools/osx_pack_gamedata.sh"
"$<TARGET_FILE:${native_c4group}>"
"${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}"
"${CMAKE_CURRENT_BINARY_DIR}/openclonk.app/Contents/Resources"
DEPENDS "${native_c4group}"
)
endif()
else()
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${group}
COMMAND "${native_c4group}" ARGS "${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}" -t "${CMAKE_CURRENT_BINARY_DIR}/${group}"
MAIN_DEPENDENCY ${CMAKE_CURRENT_SOURCE_DIR}/planet/${group}
DEPENDS "${native_c4group}"
VERBATIM
USES_TERMINAL # Hack: prevent parallel execution (for ninja), c4group tends to fail otherwise
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${group} DESTINATION share/games/openclonk)
endif()
endforeach()
endif()
if(NOT APPLE)
# group files (game data)
add_custom_target(groups DEPENDS ${OC_C4GROUPS})
set_property(TARGET groups PROPERTY FOLDER "Setup")
add_dependencies(data groups)
if(NOT HEADLESS_ONLY)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/planet/Music.ocg DESTINATION share/games/openclonk)
endif()
if(NOT C4GROUP_TOOL_ONLY)
# group files (game data)
add_custom_target(groups DEPENDS ${OC_C4GROUPS})
set_property(TARGET groups PROPERTY FOLDER "Setup")
add_dependencies(data groups)
endif()
# Install binaries
install(TARGETS c4group DESTINATION bin)
endif()
if(NOT HEADLESS_ONLY)
if(NOT HEADLESS_ONLY AND NOT C4GROUP_TOOL_ONLY)
if(NOT APPLE)
# Install new files
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/openclonk.desktop DESTINATION share/applications)
# Update the MIME cache -- this makes the clonk:// protocol handler actually work
install(CODE "execute_process(COMMAND update-desktop-database)")
install(CODE "message(\"Note: Run update-desktop-database to install clonk:// protocol handler\")")
# Install software center metadata
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/openclonk.appdata.xml DESTINATION share/appdata)
# Install binaries
install(TARGETS openclonk DESTINATION games)
if(WITH_APPDIR_INSTALLATION)
# AppDir expects binaries in /usr/bin
install(TARGETS openclonk DESTINATION bin)
else()
install(TARGETS openclonk DESTINATION games)
endif()
else()
install(TARGETS openclonk
BUNDLE DESTINATION .
@ -1553,26 +1632,28 @@ endif()
# setup_openclonk.exe
############################################################################
find_program(MAKENSIS makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS])
if(NOT C4GROUP_TOOL_ONLY)
find_program(MAKENSIS makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS])
if(NOT HEADLESS_ONLY)
add_custom_command(
OUTPUT setup_openclonk.exe
COMMAND ${MAKENSIS} -NOCD -DSRCDIR=${CMAKE_CURRENT_SOURCE_DIR} -DPROGRAMFILES=$PROGRAMFILES "-DPRODUCT_NAME=${C4ENGINENAME}" "-DPRODUCT_COMPANY=${C4PROJECT}" "-DCLONK=$<TARGET_FILE_DIR:openclonk>\\$<TARGET_FILE_NAME:openclonk>" "-DC4GROUP=$<TARGET_FILE_DIR:c4group>\\$<TARGET_FILE_NAME:c4group>" ${CMAKE_CURRENT_SOURCE_DIR}/tools/install/oc.nsi "-XOutFile setup_openclonk.exe"
MAIN_DEPENDENCY
${CMAKE_CURRENT_SOURCE_DIR}/tools/install/oc.nsi
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/tools/install/header.bmp
${CMAKE_CURRENT_SOURCE_DIR}/tools/install/inst.ico
${CMAKE_CURRENT_SOURCE_DIR}/tools/install/uninst.ico
${OC_C4GROUPS} openclonk c4group
VERBATIM
)
if(NOT HEADLESS_ONLY)
add_custom_command(
OUTPUT setup_openclonk.exe
COMMAND ${MAKENSIS} -NOCD -DSRCDIR=${CMAKE_CURRENT_SOURCE_DIR} -DPROGRAMFILES=$PROGRAMFILES "-DPRODUCT_NAME=${C4ENGINENAME}" "-DPRODUCT_COMPANY=${C4PROJECT}" "-DCLONK=$<TARGET_FILE_DIR:openclonk>\\$<TARGET_FILE_NAME:openclonk>" "-DC4GROUP=$<TARGET_FILE_DIR:c4group>\\$<TARGET_FILE_NAME:c4group>" ${CMAKE_CURRENT_SOURCE_DIR}/tools/install/oc.nsi "-XOutFile setup_openclonk.exe"
MAIN_DEPENDENCY
${CMAKE_CURRENT_SOURCE_DIR}/tools/install/oc.nsi
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/tools/install/header.bmp
${CMAKE_CURRENT_SOURCE_DIR}/tools/install/inst.ico
${CMAKE_CURRENT_SOURCE_DIR}/tools/install/uninst.ico
${OC_C4GROUPS} openclonk c4group
VERBATIM
)
add_custom_target(setup
DEPENDS setup_openclonk.exe groups
)
set_property(TARGET setup PROPERTY FOLDER "Setup")
add_custom_target(setup
DEPENDS setup_openclonk.exe groups
)
set_property(TARGET setup PROPERTY FOLDER "Setup")
endif()
endif()
############################################################################

View File

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

View File

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

32
appveyor.yml 100644
View File

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

View File

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

View File

@ -1,72 +0,0 @@
#Copied from http://www.mail-archive.com/cmake@cmake.org/msg04394.html which copied it from the rosengarden project
#see also: http://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/Precompiled-Headers.html
MACRO(ADD_PRECOMPILED_HEADER _targetName _input)
# Prepare environment
GET_FILENAME_COMPONENT(_name ${_input} NAME)
SET(_pchdir "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${_targetName}_pch.dir")
MAKE_DIRECTORY(${_pchdir})
SET(_source "${CMAKE_CURRENT_SOURCE_DIR}/${_input}")
SET(_includeput "${_pchdir}/${_name}")
SET(_output "${_includeput}.gch")
# Assemble the compiler command with which future stuff will be built
STRING(TOUPPER "CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}" _flags_var_name) # Don't worry: CMake won't use any of the R/D/RWDI/MSR vars if the build type is not defined
if(CMAKE_CXX_COMPILER_ARG1) # please, know what you're doing if you rely on this...
STRING(STRIP ${CMAKE_CXX_COMPILER_ARG1} _ccache_tweak)
SET(_ccache_tweak "\"${_ccache_tweak}\"")
endif()
SET(_compiler_FLAGS ${_ccache_tweak} ${CMAKE_CXX_FLAGS} ${${_flags_var_name}})
if(CMAKE_BUILD_TYPE)
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
LIST(APPEND _compiler_FLAGS "-D_DEBUG")
endif()
endif()
GET_TARGET_PROPERTY(_compile_defines ${_targetName} COMPILE_DEFINITIONS)
if(_compile_defines)
FOREACH(item ${_compile_defines})
STRING(REPLACE "\"" "\\\"" item ${item})
LIST(APPEND _compiler_FLAGS "-D${item}")
ENDFOREACH(item)
endif()
GET_TARGET_PROPERTY(_compile_defines ${_targetName} COMPILE_DEFINITIONS_${CMAKE_BUILD_TYPE})
if(_compile_defines)
FOREACH(item ${_compile_defines})
STRING(REPLACE "\"" "\\\"" item ${item})
LIST(APPEND _compiler_FLAGS "$<$<NOT:$<STREQUAL:,${item}>>:-D${item}>")
ENDFOREACH(item)
endif()
GET_DIRECTORY_PROPERTY(_compile_defines COMPILE_DEFINITIONS)
if(_compile_defines)
FOREACH(item ${_compile_defines})
STRING(REPLACE "\"" "\\\"" item ${item})
LIST(APPEND _compiler_FLAGS "$<$<NOT:$<STREQUAL:,${item}>>:-D${item}>")
ENDFOREACH(item)
endif()
GET_DIRECTORY_PROPERTY(_compile_defines COMPILE_DEFINITIONS_${CMAKE_BUILD_TYPE})
if(_compile_defines)
FOREACH(item ${_compile_defines})
STRING(REPLACE "\"" "\\\"" item ${item})
LIST(APPEND _compiler_FLAGS "$<$<NOT:$<STREQUAL:,${item}>>:-D${item}>")
ENDFOREACH(item)
endif()
GET_DIRECTORY_PROPERTY(_directory_flags INCLUDE_DIRECTORIES)
FOREACH(item ${_directory_flags})
LIST(APPEND _compiler_FLAGS "-I\"${item}\"")
ENDFOREACH(item)
SEPARATE_ARGUMENTS(_compiler_FLAGS)
list(REMOVE_DUPLICATES _compiler_FLAGS)
# Add a target with the pch
ADD_CUSTOM_COMMAND(
OUTPUT ${_output}
COMMAND "${CMAKE_CXX_COMPILER}"
${_compiler_FLAGS} -x c++-header -o ${_output} ${_source}
IMPLICIT_DEPENDS CXX ${_source}
)
FILE(WRITE "${_pchdir}/${_name}" "#ifdef __cplusplus\n#warning Precompiled header not used. Turn off or fix!\n#endif") # This file is added so the cc-units don't stumble over not being able to include the file
ADD_CUSTOM_TARGET(${_targetName}_pch DEPENDS ${_output})
ADD_DEPENDENCIES(${_targetName} ${_targetName}_pch)
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES COMPILE_FLAGS "-include ${_includeput}")
ENDMACRO(ADD_PRECOMPILED_HEADER)

View File

@ -42,6 +42,19 @@ function(git_get_changeset_id VAR)
OUTPUT_VARIABLE GIT_TIMESTAMP
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(DEFINED ENV{C4REVISION_BRANCH})
set(GIT_BRANCH "$ENV{C4REVISION_BRANCH}")
else()
execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND "${GIT_EXECUTABLE}" "symbolic-ref" "--short" "HEAD"
RESULT_VARIABLE GIT_RESULT
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT GIT_RESULT EQUAL 0)
set(GIT_BRANCH "unknown")
endif()
endif()
endif()
endif()
if (NOT C4REVISION)
@ -64,6 +77,7 @@ function(git_get_changeset_id VAR)
REGEX "date: .+"
)
string(SUBSTRING "${C4REVISION_TS}" 6 -1 GIT_TIMESTAMP)
set(GIT_BRANCH "unknown")
endif()
if(WORKDIR_DIRTY)
set(WORKDIR_DIRTY 1)
@ -71,4 +85,5 @@ function(git_get_changeset_id VAR)
set(${VAR} "${C4REVISION}" PARENT_SCOPE)
set(${VAR}_DIRTY ${WORKDIR_DIRTY} PARENT_SCOPE)
set(${VAR}_TS "${GIT_TIMESTAMP}" PARENT_SCOPE)
set(${VAR}_BRANCH "${GIT_BRANCH}" PARENT_SCOPE)
endfunction()

View File

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

View File

@ -23,13 +23,7 @@ git_get_changeset_id(C4REVISION)
# Get year
############################################################################
IF(CMAKE_HOST_UNIX)
EXECUTE_PROCESS(COMMAND "date" "+%Y" OUTPUT_VARIABLE DATE)
ELSEIF(CMAKE_HOST_WIN32)
EXECUTE_PROCESS(COMMAND "cscript.exe" "//nologo" "${CMAKE_CURRENT_SOURCE_DIR}/tools/get_current_year.vbs" OUTPUT_VARIABLE DATE)
ENDIF()
STRING(REGEX REPLACE "(.+)\n" "\\1" YEARFIXED "${DATE}")
SET(C4COPYRIGHT_YEAR ${YEARFIXED})
STRING(TIMESTAMP C4COPYRIGHT_YEAR "%Y")
############################################################################
# Build version strings

View File

@ -5,18 +5,12 @@
/* Use backward-cpp to print stack traces on crash */
#cmakedefine HAVE_BACKWARD 1
/* Define to 1 if you have the <direct.h> header file. */
#cmakedefine HAVE_DIRECT_H 1
/* The backtrace function is declared in execinfo.h and works */
#cmakedefine HAVE_EXECINFO_H 1
/* Define to 1 if you have the <history.h> header file. */
#cmakedefine HAVE_HISTORY_H 1
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H 1
/* Define to 1 if you have the <io.h> header file. */
#cmakedefine HAVE_IO_H 1
@ -26,9 +20,6 @@
/* Define to 1 if you have the <locale.h> header file. */
#cmakedefine HAVE_LOCALE_H 1
/* Define to 1 if your stdlib has std::make_unique */
#cmakedefine HAVE_MAKE_UNIQUE 1
/* Define to 1 if you have the <poll.h> header file. */
#cmakedefine HAVE_POLL_H 1
@ -44,9 +35,6 @@
/* Define to 1 if you have the <signal.h> header file. */
#cmakedefine HAVE_SIGNAL_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine HAVE_STDINT_H 1
/* Define to 1 if you have the <sys/eventfd.h> header file. */
#cmakedefine HAVE_SYS_EVENTFD_H 1
@ -71,9 +59,6 @@
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine HAVE_UNISTD_H 1
/* Define to 1 if your compiler supports variadic templates */
#cmakedefine HAVE_VARIADIC_TEMPLATES 1
/* Define to 1 if you have the `vasprintf' function. */
#cmakedefine HAVE_VASPRINTF 1
@ -105,12 +90,13 @@
/* Enable automatic update system */
#cmakedefine WITH_AUTOMATIC_UPDATE 1
#cmakedefine WITH_APPDIR_INSTALLATION 1
/* Select an audio provider */
#define AUDIO_TK AUDIO_TK_${Audio_TK_UPPER}
#else
#define AUDIO_TK AUDIO_TK_NONE
#endif
#endif // USE_CONSOLE
#define AUDIO_TK_NONE 0
#define AUDIO_TK_OPENAL 1
@ -118,3 +104,13 @@
/* Include OpenAL extensions (alext.h) for sound modifiers */
#cmakedefine HAVE_ALEXT 1
/* Path to data directory */
#ifdef WITH_APPDIR_INSTALLATION
#define OC_SYSTEM_DATA_DIR "../share/games/openclonk"
#else
#define OC_SYSTEM_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/games/openclonk"
#endif
/* Path to /proc/self/exe (Linux) or equivalent */
#cmakedefine PROC_SELF_EXE "${PROC_SELF_EXE}"

View File

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

View File

@ -35,7 +35,12 @@
</title>
</xsl:template>
<xsl:template match="script">
<xsl:copy><xsl:apply-templates select="@*|node()" /></xsl:copy>
<xsl:copy>
<xsl:for-each select="@*">
<xsl:copy />
</xsl:for-each>
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
<xsl:template match="func|const" mode="head">
<xsl:apply-templates mode="head" />
@ -349,16 +354,6 @@
<caption><xsl:apply-templates select="@id|node()" /></caption>
</xsl:template>
<xsl:template match="search">
<xsl:if test="not($chm)">
<form action="../search.php" method="get">
<input name="search" type="text"></input>
<input type="submit" name="func" value="Search"></input>
<input type="submit" name="fulltext" value="Fulltext"></input>
</form>
</xsl:if>
</xsl:template>
<xsl:template match="table/bitmask">
<xsl:value-of select="." />:
<input id="input" onKeyUp="Calc();" name="input" type="text">
@ -516,7 +511,7 @@
<xsl:template name="color2">
<xsl:param name="s" select="." />
<!-- the list of keywords -->
<xsl:param name="t" select="'#include|#appendto|#warning|public|private|protected|global|static|var|local|const|any|int|bool|def|effect|object|proplist|string|array|func|return|if|else|break|continue|while|for|true|false|nil|'" />
<xsl:param name="t" select="'#include|#appendto|#warning|public|private|protected|global|static|var|local|const|any|int|bool|def|effect|object|proplist|string|array|func|return|if|else|break|continue|while|for|new|true|false|nil|'" />
<xsl:param name="w" select="substring-before($t, '|')" />
<!-- text before the keyword -->
<xsl:variable name="l" select="substring-before($s, $w)" />

2140
docs/de.po

File diff suppressed because it is too large Load Diff

View File

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

View File

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

32
docs/package-lock.json generated 100644
View File

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

22
docs/package.json 100644
View File

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

View File

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

View File

@ -211,6 +211,10 @@
window.scrollTo(0, y0);
}
})();
// Collapse the index.
document.querySelector('.index > img').onclick();
]]>
</script>
<script src="../lunr.js"></script>
<script src="../search.js"></script>
</toc>

View File

@ -60,11 +60,6 @@
<col>Integer</col>
<col>Weight of the object. Rock 10, clonk 50, hut 1000, castle 10000.</col>
</row>
<row>
<literal_col>Components</literal_col>
<col>ID list</col>
<col>Elements from which the object is composed. Uncompleted or half grown objects will only have the respective fraction of the components.</col>
</row>
<row>
<literal_col>SolidMask</literal_col>
<col>6 integers</col>
@ -115,11 +110,6 @@
<col>4 integers</col>
<col>Position of the intake region relative to the object centre.</col>
</row>
<row>
<literal_col>FireTop</literal_col>
<col>Integer</col>
<col>Flame distance to the object's bottom line.</col>
</row>
<row>
<literal_col>Exclusive</literal_col>
<col>Integer</col>
@ -185,11 +175,6 @@
<col>Integer</col>
<col>0 or 1. The object can be scaled over 100% using DoCon.</col>
</row>
<row>
<literal_col>AttractLightning</literal_col>
<col>Integer</col>
<col>0 or 1. The object attracts lightning.</col>
</row>
<row>
<literal_col>Fragile</literal_col>
<col>Integer</col>

View File

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

View File

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

View File

@ -168,7 +168,17 @@ Stand = {
<row>
<literal_col>ContactIncinerate</literal_col>
<col>Integer</col>
<col>Probability of incineration by contact: 0 none, or 1 (high) to 5 (low).</col>
<col>Probability of incineration by contact: 0 none, or 1 (high) to 5 (low). Implies MaterialIncinerate.</col>
</row>
<row>
<literal_col>MaterialIncinerate</literal_col>
<col>bool</col>
<col>Incineration when submerged in incendiary material.</col>
</row>
<row>
<literal_col>FireproofContainer</literal_col>
<col>bool</col>
<col>Anything contained in this object does not catch fire when submerged in incendiary material.</col>
</row>
<row>
<literal_col>EditCursorCommands</literal_col>

View File

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

View File

@ -206,7 +206,7 @@
<row>
<col>OverlayType</col>
<col>Integer</col>
<col>Bit mask for texture calculation on this material. Bit 0 (1): exact (no zoom), bit 1 (2): no texture, bit 2 (4): extra large zoom, bit 3 (8): calculate texture based on gray scale.</col>
<col>Bit mask for texture calculation on this material. Bit 0 (1): exact (no zoom), bit 1 (2): no texture, bit 2 (4): extra large zoom</col>
</row>
<row>
<col>PXSGfx</col>

View File

@ -39,32 +39,32 @@
<row>
<literal_col>Global</literal_col>
<col>Boolean</col>
<col>If true this is a global definition, i.e. not assigned to a particular player. See <emlink href="playercontrols.xml#Globals">Global definitions</emlink>.</col>
<col>If true this is a global definition, i.e. not assigned to a particular player. See <emlink href="playercontrols.html#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>
<col>If true this command is interpreted as a held command. Such a command remembers whether the control key is pressed and generates another scripting event when it is released. See <emlink href="playercontrols.html#Hold">Held keys</emlink>.</col>
</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>
<col>Only valid if <em>Hold</em> is true. If greater than 0 then this key generates additional scripting events while pressed every that many number of frames. See <emlink href="playercontrols.html#Repeat">Key repeats</emlink>.</col>
</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>
<col>If specified then the delay of the first key repeat event can be changed. See <emlink href="playercontrols.html#Repeat">Key repeats</emlink>.</col>
</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>
<col>If true then the command is deactivated in the normal case and needs to be activated by script first. This is useful for commands that are only required in special situations. See <emlink href="playercontrols.html#Deactivate">Deactivated commands</emlink>.</col>
</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>
<col>Optional ID that is passed to the script function. See <emlink href="playercontrols.html#ExtraData">ExtraData</emlink>.</col>
</row>
<row>
<literal_col>CoordinateSpace</literal_col>
@ -94,7 +94,7 @@
</row>
<row>
<literal_col>Script</literal_col>
<col>Execution of the script function <em>PlayerControl</em>. See <emlink href="playercontrols.xml#Script">Script callbacks</emlink>. (Default value)</col>
<col>Execution of the script function <em>PlayerControl</em>. See <emlink href="playercontrols.html#Script">Script callbacks</emlink>. (Default value)</col>
</row>
<row>
<literal_col>ZoomIn</literal_col>
@ -184,17 +184,17 @@
<row>
<literal_col>Key</literal_col>
<col>String</col>
<col>Specifies the key(s) of this mapping or a reference to another mapping. See <emlink href="playercontrols.xml#Keys">Key mappings</emlink>.</col>
<col>Specifies the key(s) of this mapping or a reference to another mapping. See <emlink href="playercontrols.html#Keys">Key mappings</emlink>.</col>
</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>
<col>If true then multiple keys are taken as a sequence, i.e. they need to be pressed one after the other instead of all at the same time. See <emlink href="playercontrols.html#Keys">Key mappings</emlink>.</col>
</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>
<col>Command that is combined with this mapping. The name should be equivalent to the <em>Identifier</em> of a command defined in a <emlink href="playercontrols.html#ControlDef">[ControlDef]</emlink>.</col>
</row>
<row>
<literal_col>GUIName</literal_col>
@ -239,11 +239,11 @@
</row>
<row>
<literal_col>Hold</literal_col>
<col>The key changes the state of the command linked to to be held even if the key itself is pressed only shortly. Only valid if the <em>Hold</em> attribute is set for the command. This state remains until a corresponding mapping with trigger mode <em>Release</em> is being pressed. See <emlink href="playercontrols.xml#Hold">Held keys</emlink>.</col>
<col>The key changes the state of the command linked to to be held even if the key itself is pressed only shortly. Only valid if the <em>Hold</em> attribute is set for the command. This state remains until a corresponding mapping with trigger mode <em>Release</em> is being pressed. See <emlink href="playercontrols.html#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>
<col>The key removes the held state. A key can have both Hold and Release set to toggle between the two states. See <emlink href="playercontrols.html#Hold">Held keys</emlink>.</col>
</row>
<row>
<literal_col>AlwaysUnhandled</literal_col>
@ -351,7 +351,7 @@
<ul>
<li>When released they also generate <funclink>PlayerControl</funclink> calls in the script with the <em>Release</em> flag set.</li>
<li>Mappings can emulate permanent key presses using the <em>Hold</em>/<em>Release</em> flags.</li>
<li><emlink href="playercontrols.xml#Repeat">Key repeats</emlink> are generated.</li>
<li><emlink href="playercontrols.html#Repeat">Key repeats</emlink> are generated.</li>
<li>The held state of the key can be queried in the script via <funclink>GetPlayerControlState</funclink>.</li>
<li>If the command is bound to an analog stick or trigger on a controller, every change in position causes in a call to PlayerControl() with state = CONS_Moved.</li>
</ul>

View File

@ -68,7 +68,7 @@
<row>
<col>MissionAccess</col>
<col>String</col>
<col>The scenario will only load if the player gained this password in another scenario. See script function <funclink>GainMissionAccess</funclink>().</col>
<col>The scenario will only load if the player gained this password in another scenario. See script function <funclink>GainScenarioAccess</funclink>().</col>
</row>
<row>
<col>Secret</col>
@ -122,9 +122,14 @@
</row>
<row>
<col>FoWEnabled</col>
<col>Integer</col>
<col>Bool</col>
<col>0 or 1. If 0, FoW is disabled, and the whole landscape is visible. Default 1.</col>
</row>
<row>
<col>EvaluateOnAbort</col>
<col>Bool</col>
<col>If enabled, the game will be evaluated even when aborted by the player. This is intended for scenarios like Tower of Despair that save progress in players. Default false.</col>
</row>
</table>
</text>
<text>
@ -248,7 +253,7 @@
<row>
<literal_col>AutoScanSideOpen</literal_col>
<col>Integer</col>
<col>0 or 1. If 1, LeftOpen and RightOpen will be set automatically depending on the landscape at game start.</col>
<col>0, 1, or 2. If 1, the left and right borders are closed if the corresponding map pixel in the left or right row has non-sky foreground or background and open otherwise. If 2, it only checks the background.</col>
</row>
<row>
<literal_col>MapWidth</literal_col>

View File

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

View File

@ -166,6 +166,25 @@ func f() {
<code>func f() {
&#9;var i;
&#9;var i;
}</code>
</part>
</col>
</row>
<row>
<col>variable_out_of_scope</col>
<col>
<text>
A variable has been used outside of the block it has been
declared in. This is accepted only for backwards compatibility
and may be removed in a future release.
</text>
<part>
<code>func f(a) {
&#9;i = 0;
&#9;if (a) {
&#9;&#9;var i = 1;
&#9;}
&#9;return i;
}</code>
</part>
</col>
@ -229,6 +248,24 @@ func g(a, ...) {
</part>
</col>
</row>
<row>
<col>suspicious_assignment</col>
<col>
<text>
An assignment was found where an expression was expected. While
an assignment returns its own value, usually a comparison was
intended instead.
</text>
<part>
<code>if (a = b + 1) { /* Do something */}</code>
</part>
<text>
If the assignment is intentional, make this more obvious by
extracting it to a separate statement, or explicitly handle the
boolean conversion by adding a comparison operator.
</text>
</col>
</row>
</table>
</part>

View File

@ -292,6 +292,10 @@ Blit({Algo=MAPALGO_Scale, OffX=Wdt/2, X=-100, Op=copy_layer});
<text>Jumbles its operand around by moving points by a randomized offset.</text>
<text><table><rowh><col>Parameter</col><col>Default</col><col>Meaning</col></rowh>
<row>
<col>Op</col>
<col></col>
<col>Algorithms that is being manipulated.</col>
</row><row>
<col>Seed</col>
<col>Random(65536)</col>
<col>If nonzero, the offset map is generated from a fixed seed.</col>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@
<func>
<title>AddEffect</title>
<category>Effects</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<deprecated />
<syntax>
<rtype>proplist</rtype>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@
<title>Buy</title>
<category>Objects</category>
<subcat>Creation</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax>
<rtype>object</rtype>
<params>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@
<const>
<title>C4V_Bool</title>
<category>Variables</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Data type: boolean value (<code>true</code> or <code>false</code>).</desc>
<examples>

View File

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

View File

@ -6,7 +6,7 @@
<const>
<title>C4V_Def</title>
<category>Variables</category>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Data type: Definition. Definitions are a special type of proplist, and this data type is used for distinguishing definitions from proplists.</desc>
<examples>

View File

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

View File

@ -6,7 +6,7 @@
<const>
<title>C4V_Nil</title>
<category>Variables</category>
<version>5.2 OC</version>
<version>2.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Data type: nil.</desc>
<examples>

View File

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

View File

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

View File

@ -7,7 +7,7 @@
<title>COMD_Down</title>
<category>Objects</category>
<subcat>Movement</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Movement direction: down. For more information see <funclink>SetComDir</funclink>.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>COMD_DownLeft</title>
<category>Objects</category>
<subcat>Movement</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Movement direction: diagonally down and to the left. For more information see <funclink>SetComDir</funclink>.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>COMD_DownRight</title>
<category>Objects</category>
<subcat>Movement</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Movement direction: diagonally down and to the right. For more information see <funclink>SetComDir</funclink>.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>COMD_Left</title>
<category>Objects</category>
<subcat>Movement</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Movement direction: left. For more information see <funclink>SetComDir</funclink>.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>COMD_None</title>
<category>Objects</category>
<subcat>Movement</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Movement direction: keep current motion. For more information see <funclink>SetComDir</funclink>.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>COMD_Right</title>
<category>Objects</category>
<subcat>Movement</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Movement direction: right. For more information see <funclink>SetComDir</funclink>.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>COMD_Stop</title>
<category>Objects</category>
<subcat>Movement</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Movement direction: stop, hence end current motion. For more information see <funclink>SetComDir</funclink>.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>COMD_Up</title>
<category>Objects</category>
<subcat>Movement</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Movement direction: up. For more information see <funclink>SetComDir</funclink>.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>COMD_UpLeft</title>
<category>Objects</category>
<subcat>Movement</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Movement direction: diagonally up and to the left. For more information see <funclink>SetComDir</funclink>.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>COMD_UpRight</title>
<category>Objects</category>
<subcat>Movement</subcat>
<version>5.1 OC</version>
<version>1.0 OC</version>
<syntax><rtype>int</rtype></syntax>
<desc>Movement direction: diagonally up and to the right. For more information see <funclink>SetComDir</funclink>.</desc>
<examples>

View File

@ -7,7 +7,7 @@
<title>Call</title>
<category>Script</category>
<subcat>Function call</subcat>
<version>5.1 OC<extversion>5.4 OC</extversion></version>
<version>1.0 OC<extversion>4.0 OC</extversion></version>
<syntax>
<rtype>any</rtype>
<params>

View File

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

View File

@ -1,46 +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>
<?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>4.0 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

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@
<title>CheckConstructionSite</title>
<category>Objects</category>
<subcat>Creation</subcat>
<version>5.2 OC</version>
<version>2.0 OC</version>
<syntax>
<rtype>bool</rtype>
<params>

View File

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

View File

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

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