Commit Graph

11245 Commits (69fd50bee1333796930b5dbe3e732ebb327507ba)
 

Author SHA1 Message Date
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