Commit Graph

131 Commits (dca6d2caafc300ad699ecacf957eb14df17a7d4b)

Author SHA1 Message Date
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
Lukas Werling 91ff13b81f Clamp y coordinate when looking up Left/RightColPix, part 2 2017-12-28 23:20:56 +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 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 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 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
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 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
Nicolas Hake d9f9d9ba38 C4MapCreator: Remove unused optional parameter
No code called C4MapCreator::Create with the fLayers parameter omitted
or set to false, so we can just remove it.
2017-03-11 11:35:33 +01:00
Maikel de Vries ae6cdc6619 fix return value of InsertMaterial when a pixel is created
This is a partial fix for #1865. Also this return value still needs to be fixed for query_only == true, but that requires a bit more work in C4PXS.
2016-12-19 22:49:28 +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 376ca5a9df Prevent using USE_CONSOLE in lib{misc,c4script} 2016-10-22 17:42:23 +02:00
Kanibal 1c63c8cbe0 Fix off-by-one mistake in C4Landscape assertion 2016-07-23 22:47:13 -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
Lukas Werling 19395b23ae Fix SetMatAdjust() (for kenny) 2016-06-18 17:17:43 +02:00
Lukas Werling 7005eae55d Use PCG as random number generator 2016-04-20 22:42:00 +02:00
Maikel de Vries 97f316a35a fix debug build 2016-04-10 09:48:42 +02:00
Lukas Werling de98bbef46 Fix compile errors on Linux/SDL 2016-04-06 19:17:52 +02:00
Nicolas Hake 9dddf289db Merge branch 'master' into qteditor 2016-04-03 21:06:32 +02:00
Nicolas Hake 267bb1c3f1 Landscape: Make script-edited maps work again 2016-04-03 17:23:00 +02:00
Nicolas Hake 5c0d8a9ce6 Landscape: Make script-generated maps work again
...by actually storing the result of the generator somewhere.
2016-04-03 17:02:41 +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 893d4e295b C4Landscape: Set dynamic mode when map was successfully generated
...instead of when it failed to generate.
2016-04-01 14:38:47 +02:00
Nicolas Hake 0abef8dac5 Remove "High-res landscape" option
We're requiring shaders for everything else we render, so there's no
point in having a shader-free landscape renderer around.
2016-03-31 19:22:17 +02:00
Sven Eberhardt 4f70fdbfc8 Qt Editor landscape drawing fixes and improvements. Add brush size preview. 2016-03-18 00:26:14 -04:00
Maikel de Vries e7c296104f set controller of dig2material objects when the digger exists
This ensures correct kill tracing for example a piece of coal falling on an enemy after being dug out.
2016-02-01 20:20:26 +01:00
Günther Brammer 03d11cd596 Merge script branch 2016-01-31 21:51:58 +01:00
Maikel de Vries 4bcdfc451e block construction sites based on Exclusive and not on planes (#1534)
This makes more sense, exclusive object block all other construction sites, irrespective of their planes.
2016-01-30 14:46:14 +01:00
Günther Brammer 68c436576e Simplify construction of C4AulParSets 2016-01-25 00:00:57 +01:00
Günther Brammer 9b7b4bf30a Remove unused variable in C4Landscape::DrawBrush
This was forgotten in 47e422f452.
2016-01-11 01:50:34 +01:00
Sven Eberhardt 8552b3a8f9 Change return value of InsertMaterial when inserting outside landscape bounds #1509
Fixes clogged pump when pumping outside map.
2016-01-08 01:05:22 -04:00
Armin Burgmeier eab0f2850a Clear Relight markers in C4Landscape::Clear (#1510)
Otherwise, when starting the next scenario, random spots would be initially
re-lighted. That's not necessarily a problem, but unnecessary work, and it
triggered the assertion in C4FowAmbient::UpdateFromLandscape if the relight
was scheduled for a region that's outside of the landscape boundaries of the
second scenario.
2015-12-21 19:35:43 -08:00
Sven Eberhardt d48f590dfb Fix conversion buffer access for DrawMaterialQuad with DMQ_Bridge (#1478). 2015-12-05 14:41:56 -05:00
Nicolas Hake 871811eac8 Move some private shape calculating functions out of C4Landscape
None of these functions require access to any state of C4Landscape, and
they've only been used from within C4Landscape.cpp, so don't need to be
part of the header.
2015-12-02 01:48:13 +01:00
Nicolas Hake e8a90e7d23 Temporarily remove solid masks before clearing landscape (#1472)
When clearing parts of the landscape, solid masks must be disabled
beforehand because we don't want to remove the actual solid mask itself.
Theoretically we should also temp remove solid masks before DigFree,
ShakeFree, and all of the other landscape modifiers, just in case
someone overrides the Vehicle material with stupid values.
2015-12-02 01:41:47 +01:00
Nicolas Hake 24b54211c5 Drop Min, Max, Swap for std::min, std::max, std::swap
The C++ standard library comes with perfectly fine implementations of
these functions, so there's no point in reimplementing them just for the
hell of it.
2015-11-15 13:53:01 +01:00
Armin Burgmeier 236759b1db Don't update relights array while relighting (#1371)
Removing solidmasks temporarily as part of the relighting procedure caused
a landscape update which modified the list of to-be-relighted regions that
is currently being iterated over. This could cause relighting of a region in
which solidmasks have not been removed, leading to vehicle pixels in the
landscape surface used by the landscape shader, which show up pink on the
screen.

Fixed this by introducing C4Landscape::_SetPix2Tmp, which changes a pixel
without causing relighting (or material count updates), and use that when
temporarily removing or putting solidmasks. This should also avoid unnecessary
computations (relighting, material count updates) when updating the landscape
or moving objects with solidmasks.
2015-11-08 13:48:19 -08:00
Sven Eberhardt d136dc22c0 Implement landscape inflammation.
It used to create the non-existent FLAM objects from the engine. Use a script callback to a global function that creates Flame objects instead.
2015-10-09 16:24:16 -04:00
Sven Eberhardt 47e422f452 Rework and document texture shapes.
* Renamed from material shapes to textures shapes
* No per-texture, so the same material can use different shapes with different textures
* Load a shape image instead of text file with vector components
* Allow texture sizes that are not multiple of the map zoom
* Add minimum overlap parameter to draw shapes only when the given overlap is reached.
2015-10-09 00:16:24 -04:00
Sven Eberhardt 5b47a26d30 Perform DugOut callback also on non-collectibles and on objects not created through Dig2Object mechanism. 2015-10-01 22:43:01 -04:00
Armin Burgmeier 653680b296 Revert "Add Scale parameter in materials"
This reverts commit 8ef1f908cc. This seems to be
a performance bottleneck on some graphics cards and/or drivers. Clonkonaut
reports issues with a Radeon HD 7800.

This feature is not vital since textures can always be drawn such that they
tile properly at 512x512. While that particular problem with the Radeon card
could probably be worked around, it's just not worth it.
2015-09-19 17:26:46 -04:00
Armin Burgmeier 8ef1f908cc Add Scale parameter in materials
This allows to scale textures up or down from their initial size, allowing
them to tile at intervals other than 512x512.
2015-09-19 10:48:28 -04:00
Sven Eberhardt aac23e6bc7 Fix landscape renderer and ambience level on savegame resume (#1400). 2015-09-16 22:11:39 -04:00
Sven Eberhardt cc0a139ff9 Fix landscape reinitialization on saved section load (#1379). 2015-09-15 00:13:45 -04:00