Commit Graph

10097 Commits (directional-lights)
 

Author SHA1 Message Date
Armin Burgmeier cd2b5a0e39 Add a directional shader for light rendering
This allows to render light as a cone in a certain direction with an inner
circle that is illuminating all directions. It is basically implemented as a
mask when rendering into the light texture. A separate fragment shader for the
first of the three render passes is used to set the light intensity based on
where the fragment is relative to the light source.
2016-11-27 22:11:14 -08:00
Armin Burgmeier 96013162fa Instantiate C4ShaderCall within C4FoWDrawStrategy
This will allow us to use different shaders for different passes of the draw.
2016-11-27 22:11:14 -08:00
Maikel de Vries 7552fd94f7 fix ownership changes of moving flags (#1846) 2016-11-28 00:53:48 +01:00
Armin Burgmeier 88361ab606 Use NEAREST texture filtering for material map
The material map is 1D texture that contains information about every
material-texture combination. There is no point in linear filtering,
i.e. trying to interpolate between two materials such as gold and granite
or whichever two materials happen to be adjacent in the material map texture.

This might or might not be relevant to #1841, but should be more correct
behavior in any case.
2016-11-27 11:21:17 -08:00
Armin Burgmeier 0340a28cdd editor: delete viewport widgets immediately
I don't know why the viewports are deleted with deleteLater(), but it leads
to an OpenGL context getting deselected behind our back, and so we don't know
when is a good time to re-select it. This leads to termination of the engine
when selecting File->Close (Ctrl+W) in the editor, because the graphics
re-initialization fails with no GL context active.

Instead, just delete the viewport widget immediately, which works fine at
least on Linux. This is also recommended by the Qt documentation at
http://doc.qt.io/qt-5/qopenglwidget.html.
2016-11-26 15:19:56 -08:00
Armin Burgmeier 75cbba8b7d editor: keep track of viewports properly
When removing a viewport, then also remove it from the internal list of
viewports. Otherwise, we might attempt to delete it again later. Fixes
crash on editor shutdown on Linux.
2016-11-26 15:19:56 -08:00
Armin Burgmeier 648309cf7e Make console destruction more deterministic
This fixes a crash on Linux when exiting the editor. It was caused by
C4Console::~C4Console being called by the C++ runtime after after main()
returned. The C4Console destructor then goes and deletes all the Qt
resources (QApplication and friends), and that caused a segfault, maybe
because some of the static Qt structures have already been deallocated.

Fix this by making the destruction of the Qt components deterministic. Add
a function "DeleteConsoleWindow" which deletes all the Qt components, and
call this function in C4Console::Clear.
2016-11-26 15:19:56 -08:00
Armin Burgmeier 7a8b01f7d5 Change return type of CreateConsoleWindow to bool
All implementations were just returning `this` anyway, and this makes it
easier to add a corresponding cleanup function.
2016-11-26 15:19:51 -08:00
Mark d356d9db3d Fix inherited() calls
The ... operator should be added so that the parameters are passed down. In some cases even the named parameters were not passed down.
2016-11-26 18:57:31 +01:00
Mark 94ec4e336b Fix inherited(...) calls
The named parameters have to be handed down, because the ... operator only passes all the unnamed parameters.
2016-11-26 17:56:41 +01:00
Mark 5fc6ae05f8 HUD Modularity: Move library as suggested by Clonkonaut 2016-11-26 11:12:09 +01:00
Mark 202e1ed682 HUD modularity: Callback for controller ID
I think that the call GUI_Controller->GetControllerID() has more appeal, but it makes the code confusing maybe.
2016-11-26 11:10:35 +01:00
Mark b557719287 HUD modularity: Library for HUD controller
Extracted the basic functionality for HUDs from GUI_Controller to a library. This way, if you want to create a new HUD, you only have to include the library and all the desired components. Previously you had to copy the script from GUI_Controller, too. This holds of course only if you want to actually remove components from the HUD, and not just add to it.

Currently the GUI_Controller is referenced as the ID for the HUD, will change this to a callback.
2016-11-26 11:10:29 +01:00
Sven Eberhardt 551d9968f5 UserAction: Fix default value assignment on "Any" evaluators 2016-11-23 23:34:04 -05:00
Sven Eberhardt b12421bff8 Add inscription EditorProp to guidepost2 2016-11-22 23:25:27 -05:00
Sven Eberhardt 5ccc932386 Editor: Disable packed export if no game is loaded 2016-11-22 22:28:19 -05:00
Sven Eberhardt 1cde52e060 Editor: Add "Export packed" file menu item 2016-11-20 22:43:44 -05:00
Sven Eberhardt d77206338c Editor: Fix pre-selection of last file and folder in save as dialogue 2016-11-20 22:43:15 -05:00
Sven Eberhardt 290d606bc5 Fix boiling liquid visibility, saving and activity in cave maps 2016-11-20 21:52:33 -05:00
Sven Eberhardt 27272aea02 Fix mac build 2016-11-20 13:58:25 -05:00
Sven Eberhardt a5de44b4e9 Add UserAction: Set shader 2016-11-20 13:43:46 -05:00
Sven Eberhardt 04b5f82080 Editor: Add "open in network" to file menu and to new scenario dialogue 2016-11-20 13:24:09 -05:00
Sven Eberhardt 4b508134f8 Add clonk EditorAction: Turn around 2016-11-20 13:15:03 -05:00
Sven Eberhardt 27291ec977 Automatically move dropped items from dialogue to dialogue target
Because it happens easily when editing.
2016-11-20 13:15:02 -05:00
Sven Eberhardt 615e08a137 UserAction evaluator: Object alive 2016-11-20 13:15:02 -05:00
Sven Eberhardt fb400456ce Add MovingBrick editorprops and graph movement 2016-11-20 13:15:01 -05:00
Sven Eberhardt 5e2c39da28 Editor: Fix shape edge and vertex properties when used within an enum 2016-11-20 13:15:00 -05:00
Sven Eberhardt e0d741079a Editor: Fix shape drag value updates 2016-11-20 13:15:00 -05:00
Sven Eberhardt 6793455119 Add drag_finished parameter to EditCursorMoved callback 2016-11-20 13:14:59 -05:00
Sven Eberhardt 4a31ce0fd8 Add editor prop for neutral flagpoles 2016-11-20 13:14:59 -05:00
Sven Eberhardt 8ac9a1e2bf Add Rule_BaseRespawn editor props 2016-11-20 13:14:58 -05:00
Sven Eberhardt c5623aa7a2 Fix crash on script error in DirectExec scripts 2016-11-20 13:14:57 -05:00
Sven Eberhardt bcf782a5a8 Improve diamond+socket scenario saving and editor visibility 2016-11-20 13:14:57 -05:00
Mark f2870dfa16 Object.c: New functions
Needed AddSpeed() in a project and thought that it would be a good addition. AddVelocity() is not used so far, maybe we should remove it again.
2016-11-19 19:05:27 +01:00
Sven Eberhardt a46ecc7b5b Editor: Invalidate selection if EditCursorMoved()-callback returned true
This allows position-induced shape- or property-changes to be reflected immediately.
2016-11-16 01:11:55 -05:00
Fulgen301 399a619e4c Aerobatics: German translation added. 2016-11-13 21:57:16 +01:00
Nicolas Hake 34bdab6ba5 Aul: Don't force assertions active
Assertions are great for debugging, but in public builds they just kill
apps dead.
2016-11-13 11:07:22 +01:00
Nicolas Hake eda6cc9c7f Aul: Gracefully handle errors in codegen (#1840)
By continuing to generate bytecode even after an error is found, we're
able to find more syntax errors and will also be able to keep the value
stack at the expected height.
2016-11-13 11:07:21 +01:00
Nicolas Hake ff0325dfac Aul: Always reset the current function when a declaration ends (#1839)
When an error occurred during codegen of a function, the current
function pointer would not be reset to 0, leading to spurious warnings
about redeclaration of functions.
2016-11-13 11:07:01 +01:00
Sven Eberhardt 072e1dcde0 Editor graph delegate: Add update callback functionality for graph edits 2016-11-12 22:20:05 -05:00
Sven Eberhardt 83c1d25b84 Fix editor graph delegate vertex hit radius 2016-11-12 22:20:04 -05:00
Sven Eberhardt 1621e984a9 Editor shapes: Update shape if value changed by script 2016-11-12 22:20:04 -05:00
Sven Eberhardt 91af5a95be Editor graph delegate: Add HorizontalFix, VerticalFix and StructureFix constraints 2016-11-12 22:20:03 -05:00
Lukas Werling 3b2909fa95 Use glUniform*iv for setting script uniforms 2016-11-13 00:17:35 +01:00
Lukas Werling d720e648ce Fix compile error with libstdc++ 2016-11-13 00:13:04 +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
Maikel de Vries bfc830a103 fix wrongly turned catapult (#1838) 2016-11-11 20:10:12 +01:00
Fulgen301 fb882d693e Ropebridge: German translation added. 2016-11-11 18:43:35 +01:00
Fulgen301 db61e047ee Tutorial 06: German translation added. 2016-11-11 18:43:35 +01:00
Fulgen301 863213fe76 Rapid Refining: German translation added. 2016-11-11 18:34:35 +01:00