Commit Graph

167 Commits (4a2048575f22b18d9bc7c6db6d8348d774e197c4)

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
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
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 9a6772c27e Fix phase by xdir for DFA_Push (#2030) 2018-04-18 11:35:28 +02: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
Maikel de Vries a9675eafa3 perform callbacks when moving contents when container is removed (#1950) 2017-11-11 09:12:46 +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
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
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
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 c41bd063bd Stop disabling debugrec code by preprocessor
The optimizer is going to remove dead code anyway, and has the
additional advantage of doing syntax checking, so the code won't
silently break when someone changes something.
2017-04-19 09:47:21 +02:00
Nicolas Hake 81e49fe0f5 Fix several broken conversions from C4Fixed->bool->int (#1904)
This is why non-explicit operator bool is bad.
2017-04-19 09:24:27 +02: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
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
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
Sven Eberhardt f17046e1f0 Fix display of rotated meshes with MeshTransformation
Rotation used the wrong (untransformed) coordinates for the rotation center
2016-10-31 10:10:29 -04:00
Julius Michaelis 376ca5a9df Prevent using USE_CONSOLE in lib{misc,c4script} 2016-10-22 17:42:23 +02:00
Julius Michaelis 8d2f2846b5 Fix mac build
Also move some stuff around once again…
2016-10-21 01:25:48 +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
Sven Eberhardt 15d850e4ec Editor: Add effects to property viewer 2016-10-14 10:50:17 -04:00
Sven Eberhardt 30738c760e Fix water splashing particles 2016-08-30 18:56:46 -04:00
Sven Eberhardt 1d566ec6c5 Add VIS_Editor visibility flag 2016-08-02 01:12:08 -04:00
Sven Eberhardt a7aa89f168 Merge branch 'master' into qteditor
Conflicts:
	planet/Objects.ocd/Structures.ocd/StoneDoor.ocd/SpinWheel.ocd/Script.c
	src/platform/C4WindowSDL.cpp
	src/script/C4AulParse.cpp
	src/script/C4Effect.cpp
2016-06-20 22:27:03 -04:00
Sven Eberhardt b6526d2f65 Qt Editor: Always duplicate contents with objects
Even if they are not selected, this is probably what the user expects.
2016-06-20 15:50:35 -04:00
Maikel de Vries 8291298af1 add script callback on completion change 2016-05-21 13:34:34 +02:00
Maikel de Vries 6794b3b630 remove object component functionality from the engine 2016-05-21 13:34:34 +02:00
Maikel de Vries accd897b91 rename NoComponentMass to NoMassFromContents
This had nothing to with components, and risk of backwards compatibility is minor.
2016-05-21 13:34:33 +02:00
Maikel de Vries 183ab4c4a0 remove unused function ComposeContents 2016-05-21 13:34:33 +02:00
Maikel de Vries 5841b55f7e remove unused function GetNeededMatStr 2016-05-21 13:34:33 +02:00
Günther Brammer c0d32f8f4e Remove redundant target parameters from effect implementation 2016-05-15 15:17:17 +02:00
Günther Brammer 6aaf7cd2ef Store a pointer to the effect target in the effect itself 2016-05-15 15:17:17 +02:00
Günther Brammer b00b8554ab Merge branch script 2016-04-28 03:25:44 +02:00
Günther Brammer efd4724084 Script: Add Scenario effects
These work just like global effects, except that effects from CreateEffect
get the scenario as target parameter in the callbacks.
2016-04-28 02:53:21 +02:00
Sven Eberhardt 881534bee0 Qt Editor: Shape properties 2016-04-25 16:17:10 -04:00
Lukas Werling c349254d8b Remove C4Particles.h include from C4Object.h
This reduces the number of files indirectly including PCG from ~50 to 7.
2016-04-25 21:24:27 +02:00
Günther Brammer e8811a7b21 Move global effects from ::Game to ::ScriptEngine
This even enables some simplification in the CompileFuncs, since the global
effects were already put in the same section as the other ScriptEngine
parts. The callback for updates due to relinks also fits nicely.

The reset in C4Game::Default was redundant with C4Game::Clear already.
2016-04-24 19:40:28 +02:00
Günther Brammer e2c6c2a841 Do not use C4Object in C4Effect
Instead, the pointer to the effect list is passed to the functions that
previously used the object to determine it.
2016-04-24 19:40:28 +02:00
Nicolas Hake 8ffc1ab8cb Apply DrawTransform to meshes too
This will make lighting look weird again for meshes flipped via FlipDir.
Avoid doing that until we implement FlipDir for meshes via an internal
MeshTransform.
2016-04-17 17:56:56 +02:00
Nicolas Hake 9dddf289db Merge branch 'master' into qteditor 2016-04-03 21:06:32 +02:00
Nicolas Hake eabca223f5 Update all copyright notices for 2016 2016-04-03 20:24:42 +02:00
Nicolas Hake 493c276126 Rewrite header inclusions to #include "path/to/file.h" style 2016-04-03 20:24:42 +02:00
Nicolas Hake 3641509462 Mesh rotation: Keep rendered mesh inside shape 2016-04-03 13:37:04 +02:00
Nicolas Hake 0537df5f23 C4Object: Move C4Def.h dep out of header
C4Def is only ever used as a pointer inside C4Object.h, so we don't need
to include C4Def.h from it.
2016-04-03 13:24:26 +02:00
Nicolas Hake 735f9cc06b C4Landscape: Pull everything private out of the header
Since LTCG is enabled now, we don't have to define every function inside
the headers for ~xXx super speed xXx~, which means we can strip the
headers down to their bare minimum and reduce interdependencies and
therefore recompilation times by a lot.
2016-04-03 13:24:24 +02:00
Nicolas Hake cd0032ccf0 Do mesh rotation outside of DrawTransform
Mesh rotation needs to happen as part of the MeshTransform so lighting
is applied correctly. DrawTransform applies after lighting which made
rotated meshes look weird.
2016-03-31 01:19:58 +02:00
Maikel de Vries d6b963d321 remove unused LineMaxDistance property 2016-03-22 22:26:46 +01:00
Maikel de Vries dc1e828cfb add callback OnLineChange when line changes its vertices or vertex positions 2016-03-22 21:53:32 +01:00
Maikel de Vries fc008241cd rename LineBreak callback to OnLineBreak 2016-03-22 18:58:55 +01:00
Sven Eberhardt 771a333e21 Qt Editor: Add effects to object list view + fixes
Also remove cache of C4Values and use callbacks on object and effect deletion instead.
2016-02-21 22:23:42 -05:00
Nicolas Hake 5f895c14fc Materials: Fix misspelling of "Incendiary" (#1680)
The wrong spelling will still be accepted as a material value, as long
as no value with the correct spelling exists.
2016-02-09 23:45:02 +01:00