Commit Graph

40 Commits (60841c1d96073b0adbb687f29dfc059619ad3919)

Author SHA1 Message Date
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
Julius Michaelis be10e95698 Prevent SEGV on duplicate material names with different case (#1359) 2017-12-10 15:09:51 +01:00
Lukas Werling b94c3757a6 Fix water sliding on lava (#1946) 2017-10-14 17:46:04 +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 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 9a201441d5 Mat insertion: Fix broken conditional 2017-02-05 13:51:04 +01:00
Sven Eberhardt 771a82d879 Fix direct PXS insertion when multiple PXS are at the same location
When many PXS were at the same location (e.g. because of fast/multiple pumps pumping into a basin), only one PXS per frame could be inserted because insertion of one PXS would postpone insertion of additional PXS in the same frame until they finished their slide movement.

This caused some scenarios like Rapid Refining to become very frustrating, because adding extra pumps didn't actually do anything (unless you tricked the insertion by putting the output into the basin).

Now insert them directly if slide movement led to an insertion position.
2017-01-16 20:32:20 -05: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
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 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 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
Günther Brammer 68c436576e Simplify construction of C4AulParSets 2016-01-25 00:00:57 +01:00
Günther Brammer a5f797f96b Move miscellaneous global functions from C4Effect.cpp to their users 2016-01-24 02:09:14 +01:00
David Dormagen dcfb986e34 moved sounds into subfolders
This completes http://forum.openclonk.org/topic_show.pl?tid=3215
2015-12-13 22:14:55 +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
Sven Eberhardt 2a54409384 Fix PXS movement on moving SolidMasks (#862). 2015-10-17 22:26:34 -04: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
Peter Wortmann df6d564d2d Remove "ColorAnimation"
Not used any more
2015-10-03 15:32:39 +01:00
Peter Wortmann cf4ed1b0b7 Shiny materials, shader reorganisation
This implements the proposal made in the forum for "shiny" materials -
material can now determine the angle at which the most light is reflected.
Shiny materials might set this lower to approximate a "reflection" effect,
and increase the "spottiness" at the same time. To compensate for the
lack of brightness without light, "emittance" can be used.

Not sure this is the most elegant way to model this - the "proper" way
here would be to have emittance, shading and specular as three separate
light parameters instead of molding one into the other and using the third
to compensate.

Furthermore, this reorganises shaders in a major way: We reduce the
number of shader files down to three, pushing a number of possible
configurations into preprocessor. I believe this should be easier to
understand, which for the moment trumps theoretical extensibility
benefits.
2015-10-03 15:32:39 +01: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
Julius Michaelis 2a9b481087 Add a new variant of vehicle that can be passed from below but be walked on from above. 2015-08-30 22:19:36 +09:00
Sven Eberhardt 21500a81a9 Fix pump to clear the last row of pixels (#1057) and allow pumping from pump without source pipe.
ExtractMaterial has been changed to be able to slurp in from the most distant horizontal position rather than the closest to the extraction top center.

Also speed up ExtractMaterial for the common case of no required horizontal shifts.
2015-05-01 18:13:41 +02:00
Sven Eberhardt 7b8ffd79a4 Make Lava/DuroLava emit ambient light as a material property. (#1205) 2015-01-28 22:35:14 +01:00
Nicolas Hake 2ef2c637a7 Remove several instances of disabled legacy code 2015-01-18 22:59:45 +01:00
Sven Eberhardt 4f1aa7c5cf Destroy single pixels of non-diggable material [ala] 2014-08-05 17:02:20 +02:00
Julius Michaelis 2c7d9c0549 Fix a load of warnings (two were actual errors, only in diagnostics though) 2014-04-17 19:24:41 +02:00
Nicolas Hake e0dc30c59a Update copyright notices
As discussed in http://forum.openclonk.org/topic_show.pl?tid=2917, I
have merged all copyright notices into a single file and referenced that
merged file from each source file.

For the updated source files, the timeline has been split into three
parts:
 1. Pre-RWD code (before 2001)
 2. RWD code (2001 through 2009)
 3. OpenClonk code (2009 and later)
All pre-RWD copyright notices have been left intact, as have RWD-era
copyright notices where the file did not have a RedWolf design copyright
notice but only individual author ones. All copyright notices of the
OpenClonk era have been replaced by a single notice ranging from the
first recorded year to the current year (2013). Mape code did not get a
OpenClonk Team copyright notice because it is somewhat separate from the
main OpenClonk codebase and has only been touched by Armin Burgmeier.
2013-12-23 13:03:19 +01:00
Sven Eberhardt 1f78ee3a88 Adjusted PXS code for cases of PXS-density > C4M_Solid (#944). 2013-03-30 14:05:12 +01:00
Sven Eberhardt 437433776f C4Landscape::InsertMaterial use ptr instead of ref for insertion pos 2013-02-18 00:48:25 +01:00
Armin Burgmeier 7357125368 Make C4Material.cpp independent of C4Game
This allows compiling and linking with it without pulling in whole
C4Game. This is useful for the mape map editor.

The only place where C4Game was used in C4Material.cpp was in
CrossMapMaterials where the name of the earth material is read from
Game.C4S. The code has been changed such that the earth material name is
now a parameter to the CrossMaterialMap function.
2013-01-14 02:14:39 +01:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Sven Eberhardt 548413449d fix material conversion on insertion into converting liquid 2012-12-16 18:52:32 +01:00
Günther Brammer 8a001972ab Avoid some false positives on a naive Random-between-sequence-points check
The check was git grep -Ewn -e 'Random\s*\([^;{}]+Random' src
2012-11-17 16:30:12 +01:00
Günther Brammer dfebadfd68 Drop Landscape.NewStyleLandscape from the Scenario.txt
The format of the landscape in savegames has changed over time, but for OC
only the newest one is relevant, so the code for the old variants can be
removed.
2012-06-11 00:09:24 +02:00
Günther Brammer 1a29f8625d Reorder engine source file organization a bit
This mostly consists of flattening the hierarchy, splitting the
graphics stuff out of platform, and a few smaller cleanups.
2012-04-27 19:04:43 +02:00