Commit Graph

985 Commits (master)

Author SHA1 Message Date
Lukas Werling 3a59c15250 Add openclonk:// protocol handler (#1657) 2019-01-02 17:16:09 +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
Lukas Werling f8c0fe6f82 Fix fallthrough in command line parsing 2018-04-23 12:12:32 +02:00
Mark 4212310a9f Renamed *MissionAccess functions
Added legacy wrappers and updated the documentation.
2018-04-05 19:34:16 +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
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 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
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 dc7734e223 FnSimFlight: fix precision of velocity if not provided 2018-01-19 14:37:21 +01:00
Lukas Werling c964fa1c84 /screenshot: Add error message when in editor (#1137) 2017-12-23 12:11:28 +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 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
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
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 94669cebe4 Merge branch 'master' of ssh://git.openclonk.org/openclonk
Conflicts:
	src/editor/C4ConsoleQtPropListViewer.cpp
2017-05-07 15:16:01 -04:00
Sven Eberhardt 4fac960cf4 Editor: Add localized string support 2017-05-07 14:26:30 -04:00
Tushar Maheshwari e58a7884e4 Automatic fixes using clang-tidy
See http://forum.openclonk.org/topic_show.pl?tid=3376 for discussion.

Close GH-41
2017-05-03 20:30:45 +02:00
Nicolas Hake fc1a7a59c8 Use C4Real instead of C4Fixed where representation is irrelevant
While C4Real is just a typedef for C4Fixed, it signifies more clearly
that we don't care about the memory representation at the point of use.
2017-04-19 09:14:39 +02:00
Nicolas Hake bc5df7f35b CMake: Add date of commit to logfile
But only if the build is from a clean index. Otherwise, the logfile will
contain the date of build.
2017-04-12 12:34:36 +02:00
Nicolas Hake 9f7128a60e StdCompiler: Add override specifiers 2017-03-24 08:52:32 +01:00
Nicolas Hake 007a05468e C4Scenario: Remove fixed char buffers 2017-03-23 16:35:25 +01:00
Nicolas Hake 78b43e2182 StdCompiler: Add support for std::string 2017-03-23 16:35:25 +01:00
Lukas Werling 19b00b7862 Use backward-cpp on Linux for nicer stack traces 2017-03-21 20:17:55 +01:00
Nicolas Hake 7f2cce6f79 Fix WITH_AUTOMATIC_UPDATE, non-Windows platforms 2017-03-16 23:18:38 +01:00
Nicolas Hake a151ac12de C4Application: Remove StdStrBuf 2017-03-16 19:13:06 +01:00
Sven Eberhardt be66da2c7b Fix editor network join on Windows 2017-03-11 15:10:25 -05:00
Nicolas Hake 41f4779d74 StdCompiler: Use terms "Serializer" and "Deserializer"
Instead of "Compiler" and "Decompiler", which make me look up what's
even going on each time I see them, use the standard terms "serializer"
and "deserializer".
2017-03-11 15:05:41 +01:00
Sven Eberhardt cc0371bdf5 Add PIF_NoScenarioSave option to script players 2017-02-20 13:39:11 -05:00
Sven Eberhardt 69b0fd4f1a Do not call InitializePlayers after script player join if no human players joined 2017-02-19 20:36:40 -05:00
Sven Eberhardt a7bbda4ca1 Fix order of InitializePlayer(s) callbacks in non-network games with teams enabled [Luchs] 2017-02-18 18:26:21 -05:00
Lukas Werling 87ee44964c Send script-defined statistics to the masterserver
After GameOver(), the global function CollectStatistics() is called
which in turn calls CollectStats() on all definitions and the Scenario.
The results are collected into a proplist and sent to the masterserver
as JSON.

The intended purpose is to collect statistics like weapon kill counts
and evaluate them across all online games to improve balancing.
2017-02-17 23:29:16 +01:00
Nicolas Hake 71f8cb0699 C4Application: Remove unused flag IsInGameTick 2017-02-05 13:20:18 +01:00
Julius Michaelis 80c07d34e4 Add [Landscape] Secret to Scenario.txt to default-disable black NO_OWNER viewports
Related to: c569036d1d
2017-01-24 18:50:30 +01:00
Maikel de Vries ba731123a2 allow for script players to enter full teams
This should not break anything because script players are created by scripts and one may expect sane behaviour. This is useful to block entry for normal players into a team.
2017-01-16 18:57:00 +01:00
Lukas Werling 6847e50e79 Implement setting shader uniforms from script (#1206)
Uniform variables are read from the "Uniforms" proplist set on Scenario
or on individual objects. Proplist keys are uniform names. Values can
either be an int or an array of one to four ints in C4Script. In GLSL,
the uniforms then need a matching type (int/ivec2/ivec3/ivec4). There is
no error reporting; uniforms are only set if both name and type match.

The implementation walks the "Uniforms" proplists on each Draw call. We
may need to cache the uniform maps if this turns out to be too slow.
2016-11-12 22:09:23 +01:00
David Dormagen 8a8593e0ba Script GUI: added TightGridLayout style (requirement of #1842)
The TightGridLayout fills spaces more aggressively. This is slower but makes for a tighter layout. Finding the best layout is NP-complete. This here is just O(N^2) or so.
2016-11-05 15:35:15 +01:00
Sven Eberhardt ebda8193ef Replace NULL by nullptr in C++ sources
We don't support pre-C++0x any more, so nullptr should be fine everywhere (except in the plain C source files)
2016-11-02 19:58:02 -04:00
Julius Michaelis 55b6713185 Dedicated server: stop game when there are less than 2 clients 2016-10-30 21:36:29 +01:00
Julius Michaelis 890669ea0d Silence a warning from getopt when using --config 2016-10-30 21:36:29 +01:00
Lukas Werling 13fa0ab7b1 Implement adding/removing shaders from script
New script functions: AddFragmentShader, RemoveShader.

There is currently no support for adding vertex shaders.
2016-10-29 21:19:08 +02:00
Julius Michaelis 376ca5a9df Prevent using USE_CONSOLE in lib{misc,c4script} 2016-10-22 17:42:23 +02:00
Julius Michaelis 34a9a1de8d Twiddle with header organization: lib{misc,c4script} do no longer include GL/glew.h
(Yes, it is just that complicated.)
2016-10-20 18:46:32 +02:00
Armin Burgmeier 2362a73e60 FnSetSky: open Graphics.ocg before re-loading sky (#1827)
Needed to load shader slices in C4Sky::Init.
2016-10-16 10:04:54 -07:00
Armin Burgmeier 8f61918219 Initialize graphics when re-loading sky (#1827)
Need this so that C4Sky::Init can read the shaders.
2016-10-16 10:04:54 -07:00
Lukas Werling 59b5525a41 Rework sky definition parsing
This also adds a broken SetSky() script function which was the main
motivation for the rework. See #1827
2016-10-15 13:34:39 +02:00
Nicolas Hake d9696d2f88 Reorder game cleanup
The order in which game components were cleaned up seemed rather
arbitrary, so let's change that into blocks of reasonably connected
parts.
2016-10-11 19:44:29 +02:00
Nicolas Hake 14bfd7ea59 Clear console pointers earlier
It doesn't make a lot of sense to keep console pointers around while the
objects and scripts have already been deleted. Clear them earlier so we
don't have any dangling pointers.
2016-10-11 19:44:27 +02:00