Commit Graph

147 Commits (d59b1e5e5ba48c08a442d7ee0b4e4886cefd5089)

Author SHA1 Message Date
Tobias Zwick d59b1e5e5b reduce version numbering from x.y.z (x does never changes) to y.z 2014-12-12 21:57:52 +01:00
Sven Eberhardt 612a05fe40 New script function: GetPXSCount.
Counts number of loose pixels of a material in an area.
2014-12-07 19:52:05 +01:00
Armin Burgmeier e46c558671 Fix a delete / delete[] mismatch in C4ParticleSystem 2014-12-06 15:42:42 -05:00
Armin Burgmeier a792a1c6a2 Fix possible race condition in C4ParticleSystem construction
Previously, the calculation thread was initialized before the event it was
going to wait for after it is launched. However, since the thread starts its
execution in its constructor, it might access the event before the event
itself has been constructed.

This is fixed by making sure the event is fully constructed before the thread
is constructed (and launched).
2014-12-03 11:03:51 -05:00
Armin Burgmeier fb5365c2b1 Fix possible crash when drawing empty pix or line PXS 2014-11-12 08:46:53 -05:00
Armin Burgmeier 233e5e7c13 Remove CStdGL::BlitLandscape
This code is only used for the low-resolution landscape that is hardly in use
anymore. The code was mostly a duplicate of the standard C4Surface blit
function, CStdGL::PerformBlt, with some added code for blitting material
textures with higher resolution. However, that code was not enabled anymore
by the classic landscape renderer either, so it seems safe to remove it.

The landscape is now simply drawn by C4Draw::Blit.
2014-11-02 11:15:06 -05:00
Armin Burgmeier b58fde88aa Add option to draw overlay with PerformMultiTris
This allows drawing images with overlay in a single rendering pass.
2014-11-01 22:28:03 -04:00
Martin Plicht 03f43f462b C4ObjectList: Replace trivial cases of manual list traversal with iterator usage 2014-10-25 21:25:52 +02:00
Sven Eberhardt e6ed26cfc4 Fix pixel masks Solid/Liquid/Background in map scripts.
Solid/Liquid/Background depend on PixMaps in C4Landscape being updated to currently loaded materials.

PixMaps should really be functions of C4MaterialMap and C4TextureMap. It's probably still broken in mape.
2014-10-17 01:10:47 +02:00
Armin Burgmeier de5e7d63db Render all PXS in one batch (#1135) 2014-10-08 18:33:46 -04:00
Sven Eberhardt abab7be591 Added scenario achievements displayed as small symbols beside the scenario name in the startup selection screen.
They can be used e.g. to show that you have finished a scenario on different difficulty levels.
2014-09-24 23:08:40 +02:00
Sven Eberhardt 378bda5546 Added custom scenario parameters (SCENPAR_*).
Can currently only be set in network games in the lobby. In the future, maybe we can find a place somewhere in the scenario selection dialogue.
2014-09-23 23:02:52 +02:00
Sven Eberhardt 4f1aa7c5cf Destroy single pixels of non-diggable material [ala] 2014-08-05 17:02:20 +02:00
Armin Burgmeier 6143f884f0 Allow MapScript generator to use non-global material and texture maps 2014-08-04 13:04:35 -04:00
Armin Burgmeier f25ec83568 Link C4MapScript into mape
Remove the two dependencies to ::Game from C4MapScript, so that ::Game
does not need to be linked into mape, which would basically drag the
whole rest of the engine after itself.
2014-08-04 13:04:35 -04:00
Armin Burgmeier 92720cf490 Allow C4ScriptHost to load a script from memory
This will allow mape to feed the Map.c that is being edited directly to
the map generator.
2014-08-04 13:04:34 -04:00
Sven Eberhardt fafa97e72b Fix memory leak in particle system.
Particle chunks were removed from the list (in the particle thread), but never deleted. They must be deleted from the main thread since it will delete GL objects. So simply delete empty chunks in the drawing proc.
2014-07-20 19:21:00 +02:00
Julius Michaelis 0476acef4f Fix landscape generation bug introduced by 2c7d9c0549
<Sven2> Your fix of the parent check for points in the landscape.txt parser. if (!(pToNode->Type() == MCN_Overlay))
<Sven2> It should also allow the poly algo in maps
<Sven2> i.e., make it if (!(pToNode->Type() == MCN_Overlay) && !(pToNode->Type() == MCN_Map))
<Sven2> Actually, better make it if (!pToNode->Overlay())
2014-07-09 17:02:02 +02:00
Sven Eberhardt 4556cb4890 Add particle value provider function PV_Sin 2014-06-30 01:00:15 +02:00
Clonkonaut a5040fe0ad Fixed potential crash in certain doomsday scenarios. 2014-05-11 22:04:51 +02:00
Sven Eberhardt 91db5d33c2 Added SolidMaskPlane property.
If an object moves and other objects are attached to its SolidMask, only objects in front of this plane are moved along with it. Defaults to Plane if zero.
2014-05-04 14:16:46 +02:00
Sven Eberhardt 79edc9917a Fix crash on DugOut callback if an unloaded definition is referenced in material Dig2Object. 2014-05-01 17:15:14 +02:00
Clonkonaut 3d224c1207 Added new callback: DugOut(object object_by).
Called in a new object that is created from digging out material.
2014-05-01 01:04:41 +02:00
Sven Eberhardt 1d0ebcd3a3 Added mode TopOpen=2: Pixels above landscape are partly free and partly solid depending on corresponding top row map IFT. Analogous to BottomOpen=2. 2014-04-21 02:01:17 +02:00
Günther Brammer 04e1c74c05 Merge Call fix commit 2014-04-19 19:02:27 +02:00
Günther Brammer 22016e075f Replace some usages of C4ID with C4Def*
In particular those that made the c4script shell depend on C4Id.cpp.
2014-04-19 19:02:22 +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
Maikel de Vries 9b96ab2305 Cleaned up base material in library and engine
* rename to cleaner *Base* instead of *HomeBase*
* fixed library implementation
* engine code is now obsolete
2014-04-16 14:07:01 +02:00
Nicolas Hake e8384901e6 Remove UB (++x %= y)
A construct like ++x %= y assigns to x twice between sequence points.
Introduce a sequence point here to make the behavior well-defined.
2014-04-15 14:58:54 +02:00
Julius Michaelis 405fc4f841 Fix dedicated 2014-04-02 20:53:12 +02:00
Nicolas Hake 6a5d738f03 Validate texmap entries on load (#1060)
This makes sure texmap entries look correct, thus avoiding a crash that
happened when the entry referenced a material without specifying a
texture.

Closes #1060.
2014-03-25 18:30:11 +01:00
David Dormagen 6b25e54f0b PV_Step: added "maximumValue" parameter 2014-02-18 20:37:43 +01:00
Martin Plicht 3d9c965ebd mac: C4Particles: glGenVertexArrays fix for Mac OS X 2014-01-23 17:52:19 +01:00
Sven Eberhardt 84600bef53 Auto-collect firestones if picked free and there's free space in inventory (same as for shoveling). 2014-01-22 21:46:50 +01:00
Sven Eberhardt 57463b61c4 Rework SolidMasks to be defined in a separate SolidMask.png graphics file instead of the main definition graphics. 2014-01-08 01:55:33 +01:00
Sven Eberhardt 50a6ccf009 Fix SolidMasks in editor mode when no viewport is opened. Do not re-put SolidMasks every frame on movable but non-moving objects.
Selecting a GL context during SolidMask initialization is not a very good solution. But as long as SolidMasks are stored in graphics surface we have no choice.

A better solution would be to generate a dedicated (non-OpengL) surface for SolidMask data on object loading. But then objects that have SolidMasks would need to be tagged somehow.
2014-01-03 15:13:09 +01:00
Sven Eberhardt 33d85a145e Fix particle-related crash.
ClearAllParticles deleted the particle lists but never bothered to clear any pointers to them.
2013-12-28 21:30:45 +01:00
Sven Eberhardt 5094cc5c1b Reworked "Save as scenario" option in editor to write a script file instead of Game.txt. 2013-12-27 17:10:09 +01: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
David Dormagen 921f21e9a6 allocate particle lists for C4Objects lazily
This should fix an error with incorrect particle lists after loading. This is also a cleaner way overall, since only a fraction of all objects will ever have particles attached to them
2013-12-22 18:51:05 +01:00
David Dormagen aeb057a4b1 made C4ParticleChunk uncopyable to prevent double-deletion of OpenGL buffers leading to a crash 2013-12-22 17:23:47 +01:00
David Dormagen b70b195e24 particles: use OpenGL buffer-objects and vertex-arrays-objects for particle drawing
Even though the whole data is (still) transmitted every frame, I get a pretty high (2x) performance increase on my system. I suspect that the graphics card has to allocate less memory every frame.
2013-12-21 14:07:14 +01:00
David Dormagen a10c9316ef renamed DynamicParticles* to Particles* and CreateParticleEx to CreateParticle 2013-12-17 22:32:01 +01:00
David Dormagen 02f54ba1eb removed the legacy particle system from the engine and docs 2013-12-17 22:32:01 +01:00
David Dormagen e42450ef5b different optimizations to particle creation
This patch might speed up particle creation by around 25%. See crucible review https://crucible.openclonk.org/cru/ENGINE-15
2013-12-16 17:34:15 +01:00
Tobias Zwick fe2a400c02 replace global function GetTime() with class function C4TimeMilliseconds::Now() 2013-12-07 21:27:01 +07:00
Tobias Zwick 94c618d153 add new type C4TimeMilliseconds for time measurements to solve problems when GetTime() overflows (#251)
The new type C4TimeMilliseconds behaves for the most part like a uint32_t but is overflow-proof in comparisons.
In some places, a 0-value (or uint_max) of the variable storing the time had the special meaning "not set yet". This has been resolved by having it as a pointer to C4TimeMilliseconds with NULL meaning that it has not been set yet.
2013-12-04 19:35:07 +07:00
David Dormagen c57929508a dynamic particles: possibly fixed a theoretical crash when creating particles
(race condition between initializing the particle and executing the particle calculation/removing the particle)
2013-12-02 20:05:45 +01:00
David Dormagen 0a69450d12 dynamic particles: log missing-glPRI-warning only to log file and not player-visible output
The warning is nothing that should bother the average player (mainly because they possibly can't do anything against it anyway). However, it might turn out to be useful for debugging purposes.
2013-12-02 19:39:29 +01:00
David Dormagen 3351ccd9d5 dynamic particles: correctly check for the absence of glPrimitiveRestartIndex 2013-11-30 13:43:46 +01:00