Commit Graph

4349 Commits (master)

Author SHA1 Message Date
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
Julius Michaelis a130f59f54 Fix mac build likely broken in 13f082e8c8. (Attempt 1) 2018-02-12 11:28:14 +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
Lukas Werling cd2b8370da Fix warnings in DirectExec crashing (#1990) 2018-02-04 12:33:58 +01:00
Lukas Werling 8f285299d1 Fix Mortimer missing in Credits 2018-01-31 21:18:27 +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
Lukas Werling 44172576af Add NativeException to credits 2018-01-28 21:16:14 +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
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
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
Maikel de Vries dc7734e223 FnSimFlight: fix precision of velocity if not provided 2018-01-19 14:37:21 +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
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 5944146f2b Fix more broken entries in Scenario.txt (#1910) 2018-01-13 18:57:32 +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
Lukas Werling 54e5c6de38 Fix Sky definition not working (#1910) 2018-01-11 22:44:33 +01:00
Lukas Werling 08393d2300 Credits: Batman is Foaly 2018-01-07 19:02:38 +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
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 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
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
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 2d7d7b86ae Clamp y coordinate when looking up Left/RightColPix 2017-12-26 14:31:43 +01:00
Lukas Werling 486c85ea76 Fix Left/RightColPix lookup 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 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 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 fa8f868ffb Change AutoScanSideOpen to be like Top/BottomOpen=2 (#1652) 2017-12-22 20:40:03 +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 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 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
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
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 a9675eafa3 perform callbacks when moving contents when container is removed (#1950) 2017-11-11 09:12:46 +01:00
Lukas Werling 3cce9f44c7 Fix another preprocessor conditional for MinGW 2017-11-09 09:33:29 +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
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
Lukas Werling b94c3757a6 Fix water sliding on lava (#1946) 2017-10-14 17:46:04 +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
Julius Michaelis 94394c2e2a Fix some valgrind warnings and a leak in openclonk-server 2017-09-01 15:59:46 +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
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
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
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
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
Sven Eberhardt a74dcc5450 Editor: Support localized definition group folder names (from Title.txt) 2017-05-27 16:30:59 +09: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
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
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