Commit Graph

8358 Commits (stable-7)
 

Author SHA1 Message Date
Armin Burgmeier 96c8b51eac Use generic vertex attributes for landscape rendering 2016-01-02 17:20:24 -08:00
Jan Heberer 7f1ed15344 Fix clamping of unsigned 16-bit integers in StdCompilerINIRead
Clamp unsigned 16-bit integers to the range 0 to 65535 instead of 0 to 32767
2016-01-02 17:00:36 -08:00
Clonkonaut b2ecfcfc48 Slight improvements to Guardians.
A single player now receives four times more wave bounty than before, scaling up to four players. It's still challenging but I believe now doable.
Enemies should no longer jump off airships when being shot at.
Fixed a typo in the airship appendto script.
Fixed a possible null pointer when changing weapons.
2016-01-03 01:53:55 +01:00
Günther Brammer 9911a894df Fix FxRollingTimer parameter type for effect from int to effect 2016-01-03 00:22:36 +01:00
Günther Brammer 755fd09c78 docs: Fix contents position in really wide browser windows 2016-01-03 00:21:39 +01:00
Günther Brammer 5bd30204b7 docs: Fix some <ul> contents to be <li> instead of <text>
This fixes visual breakage in the contents.
2016-01-02 22:52:30 +01:00
Günther Brammer e1b7db956a docs: Update header and CSS for the new openclonk.org style 2016-01-02 22:44:45 +01:00
Armin Burgmeier 95774e0e8f Use generic vertex attributes for sprites, meshes, particles 2016-01-02 13:10:03 -08:00
Maikel de Vries a6344d0f1a dark mine: add deathmatch option plus some small improvements 2016-01-02 21:54:56 +01:00
Maikel de Vries 97cc3dd901 arena goals: pass whether it is a relaunch to OnPlayerRelaunch callback 2016-01-02 21:53:43 +01:00
Maikel de Vries 7ca791a5b0 fix random choice of object when dumping lorry contents 2016-01-02 21:52:52 +01:00
Maikel de Vries bbdb5d3229 add tutorial 4: explains loam production, lorry, pickaxe, elevator
The outro sequence is not yet finished, and requires quite a lot of work still.
2016-01-02 19:42:23 +01:00
Maikel de Vries 0b61ec4f93 add hanging action to the wipf 2016-01-02 19:42:23 +01:00
Maikel de Vries 06b6d6e85e fix musket bullet trail appearance at top map border 2016-01-02 19:42:23 +01:00
David Dormagen af576e7468 shovel: improved dust particles slightly
A bit more but smaller particles. Now you can't make out a single sprite easily anymore.
The particles also do not spawn in solid material now.
2016-01-02 17:27:49 +01:00
Clonkonaut 0348efa03e Fix propeller not moving in Deep Sea Mining Intro (#1531). 2016-01-02 13:44:23 +01:00
David Dormagen a0dddce691 C4FoWDrawLightTextureStrategy: do not crash when nothing to draw
This would crash for me when starting a game in developer's mode. Not sure if this is the best place for the fix. Maybe there is some other underlying issue. ck?
2016-01-02 13:03:44 +01:00
David Dormagen a3e4b620b9 reworked interactions (grabbing etc.)
The player interface is now similar to how picking up works. This should increase acceptance. Also it was pretty fucked up before. The action bar is gone.
The script logic is now outsourced into a new library similar to the other stuff.
Objects can overload the selector for the new interaction (see "call elevator case").

Additional issues hit and resolved when working on this:
Shifting a cursor did not cancel certain actions (and there was no callback for that). This is now solved by adding two new callbacks.

Issues hit and not resolved:
Certain interactions (calling an elevator case, flipping a construction) are in some control library. They should be in the respective objects (and shown via callbacks etc.). Meh.
The internal interface (declaring interactions etc) has a few places where proplists are just translated because the properties are called differently. This is also a fuckup (i.e. a.interaction_object = b.Object) where the properties should just have been called the same in all places from the beginning.
The name "Action Bar" is pretty misleading now as it is no bar. But that's not something visible to the players. todo: cleanup.
2016-01-02 13:02:45 +01:00
David Dormagen 683a6df0c4 Molten Monarch: some performance improvements
Search less often. Search for less. And use the proper inventory interface.

Before (first number is relative to MovingBrick.FxMoveVerticalTimer, because that's relatively constant (I guess?)).
59x 00826ms	Global.FxBlessTheKingTimer
38x 00537ms	Global.FxDeathByFireTimer
 1x 00014ms	MovingBrick.FxMoveVerticalTimer
After
41x 00328ms	Global.FxBlessTheKingTimer
27x 00213ms	Global.FxDeathByFireTimer
 1x 00008ms	MovingBrick.FxMoveVerticalTimer
2016-01-02 10:49:26 +01:00
Armin Burgmeier 0538d1e57f Fix the planet/Tests.ocf/ColorfulLights.ocs test scenario
The TexMap.txt was outdated
2016-01-01 22:28:22 -08:00
Armin Burgmeier b80a7ebb01 Use VBOs to render the FoW texture
In doing so, refactor the way C4FoWDrawStrategy works slightly. Get rid of
immediate mode OpenGL, and instead populate a vertex array and an index array
as vertices are added to the draw strategy. Then render everything as
triangles.

The actual rendering is then performed in C4DrawStrategy::End(). It passes
the accumulated vertices to the GL. Also get rid of the notion of multiple
passes in C4DrawStrategy. Instead, C4DrawStrategy::End() can simply just draw
the bunch of vertices multiple times. This allows us to do the vertex
generation and GPU upload only once, instead of repeating it for every pass.
2016-01-01 22:28:22 -08:00
Armin Burgmeier f582ea9f24 fow: persist draw strategies between light renderings
This allows the strategy to keep some state between invocations. I want to
use this in order to store a VBO in the draw strategy, and to avoid having
to re-create the VBO for every rendering.
2016-01-01 22:28:22 -08:00
Armin Burgmeier ecdcf5ac92 fow: Use a VBO to blit the framebuffer 2016-01-01 22:28:22 -08:00
Armin Burgmeier 1f4dbcc260 Particle system: make sure to always use a VBO
We are already using VBOs for meshes, so we can rely on them being available.
VBOs are shared between contexts, so #1195 is not an issue, either. However,
keep the workaround in place for the VAO, which is not shared between
contexts.
2016-01-01 22:28:22 -08:00
Armin Burgmeier b407558d7a Use a VBO to render the landscape 2016-01-01 22:28:22 -08:00
Armin Burgmeier 9b9d9e378f Fix PXSAndSmoke.ocs test scenario
It contained an outdated TexMap.
2016-01-01 22:28:21 -08:00
Armin Burgmeier 988fe15e29 Use VBOs to draw sprite graphics
I don't expect much of a performance benefit from this, but it works toward
removal of legacy OpenGL usage. Note that we are already using VBOs for
meshes, so this does not require any functionality that we don't require
already.
2016-01-01 22:26:41 -08:00
Clonkonaut e31b866e7f Fix animation error when scaling at unfavourably shaped walls (#1317).
The error rarely happened when the clonk was attached to a wall solely with its head vertex. CheckScaleTop (Animations.ocd/Script.c) only checked the shoulders and hip vertices.
I also made sure that this.dist (FxIntScaleTimer, line 616) cannot exceed the animation length of "ScaleTop" although that shouldn't have posed a problem.
2016-01-02 03:58:45 +01:00
Armin Burgmeier 9fd7e88afd Fix crash when changing mesh material of incomplete mesh
Changing the mesh material to something that does not use alpha blending
restores the originial face order. This caused a crash for meshes with
Completion below 1, since all original faces were copied, but the buffer
in the mesh instance was only large enough to hold the number of faces of
the incompleted mesh. To fix this, simply run the standard
select-faces-for-a-given-completion-value procedure.
2016-01-01 17:01:10 -08:00
Armin Burgmeier 795740c6ee C4Surface: fix texture restore on IntUnlock (#1526) 2016-01-01 14:48:33 -08:00
Günther Brammer 38c6242bce Fix out-of-bounds check and bounds collision for non-centric object shapes
The proper way to measure from the center to the right is X+Wdt, not -X
or Wdt/2. And the proper way to measure to the left is -X, not -Wdt/2.
2016-01-01 22:18:41 +01:00
Günther Brammer 00a4c6c428 Replace BorderBound DefCore value with BorderBound object property 2016-01-01 22:18:41 +01:00
Günther Brammer 690b4f9ba0 Move comparison out of C4Object::TargetBounds
This probably enlarges the maximum landscape height for borderbound objects.
The "infinity" constant +1000000 is larger than the biggest C4Fixed, so
would have been truncated to 16960.
2016-01-01 22:18:41 +01:00
Günther Brammer 87c9fc965f Inline pointless ForceLimits function
In the time it took to understand the API of that function, one can read
the entire TargetBounds function which was its sole user.
2016-01-01 22:18:41 +01:00
Maikel de Vries 2269d55801 fix typos in tutorials 2016-01-01 22:18:41 +01:00
Armin Burgmeier 26cfbdb059 Fix assertion failure when rendering mesh with degenerate transform (#1519)
The DynamiteBox sets the PictureTransformation to a degenerate matrix, to
prevent it from being rendered. Exit early in this case, since we are not
going to render anything anyway, and avoid the assertion when inverting the
matrix.
2016-01-01 11:34:04 -08:00
David Dormagen 104764b1e4 added ala's "BlastMetal" changes (#1492)
I had to convert it to mono, though. Also it's a .wav now. But that's fine imo.
2016-01-01 17:44:10 +01:00
Günther Brammer 5db59e8665 Fix C4MessageBoard key binding lifetime
I think C4Game::InitKeyboard relies on the callback targets outliving the
keybindings and every other class is prepared to be deleted before
C4KeyboardInput::Clear(), so needs to hold a ref to the keybinding to
delete that in its destructor.

C4KeyBinding is the class that is used for that, and it sets the reference
count to 1 in the constructor, to represent the reference held in the
owning class.

On the other hand, C4CustomKey gets immediately forgotten by C4Game and the
only reference is held in the keymap.

To prevent this from happening again, make the C4CustomKey constructors
protected and C4Game a friend of the class.

Also remove an unused C4CustomKey constructor.
2016-01-01 16:24:43 +01:00
Maikel de Vries 30d45fcdc3 streamline tutorial guide script interface 2016-01-01 13:45:50 +01:00
Maikel de Vries 80ad1a5650 improve lightning strikes
- changes particle appearance
- add sounds
- change branching behavior
- add light source
2016-01-01 10:51:54 +01:00
Maikel de Vries 53a1a76a90 add sounds for thunder strikes 2016-01-01 10:51:54 +01:00
Armin Burgmeier c0844c10ff Add support for generic attributes to C4Shader
Replace the hardcoded VAI_ constants with that. The VAI constants are now
moved to C4DrawGL as C4SSA_ constants, similar to the C4SSU ones. This allows
to introduce other attributes to replace vertex positions, normals, colors
and texture coordinates with attributes in later commits. This, in turn, is
needed because the built-in attributes are no longer available in the OpenGL
core profile.

Also, while at it, cleanup C4Shader a bit. Use std::vector<> instead of
maintaining an own array of uniform names. Delete the vertex and fragment
objects after the full shader program has been linked. Make sure that
C4Shader::Init keeps the old program in place if the new one cannot be
compiled or linked.
2015-12-31 22:28:23 -08:00
Armin Burgmeier c043795552 Fix memory leak in FoW surfaces
Surfaces are initially created in locked state, and only when unlocked the
memory buffer with the surface data is uploaded to the GPU. The FoW code
however never unlocks the surface but instead operates on the OpenGL texture
directly. To fix this, introduce a new flag for C4Surface to create it in an
unlocked state.

This is not a memory leak in the traditional sense as a pointer to the buffer
is still available and is being freed when the surface is being destructed
at the end of the game. However, during the game there might be several
megabytes allocated that are never used.

I'm not really sold by this Lock/Unlock mechanism. Instead, there should
simply be a function to obtain the current texture data, and a function to
upload new texture data. That's for another time though...
2015-12-31 18:40:38 -08:00
Armin Burgmeier fc4679e3ea Don't upload all texture data twice
For some reason, the C4TexRef constructor first uploaded a set of nulled
texture data, just to be replaced by the actual image data when Unlock()
is called. Skip the unnecessary step and instead just reserve the video
memory in the constructor.
2015-12-31 17:58:22 -08:00
Armin Burgmeier 8766f5123b Remove other usages of built-in GL matrices
Primarily for the FoW rendering, which now also uses (simple) shaders
without ftransform() everywhere. This also removes all GLU calls.
2015-12-31 17:30:21 -08:00
Maikel de Vries eaf66850b1 tutorial 3: fine-tuning and title image 2015-12-31 15:07:22 +01:00
Clonkonaut fa4512c5ea Guardians, slight improvements.
Removed the windbag from the chest (might also remove it from the buy menu).
The chest below the base will now sometimes contain a gold bar, giving extra money to the player picking it up.
Made sure that no airship remains after fade out.
2015-12-31 12:45:13 +01:00
Maikel de Vries 34fa60feeb dialogue: fix finding by name and public interface to get the target 2015-12-31 12:07:36 +01:00
Maikel de Vries 03ef09135e scenarios: some fine-tuning to clonkomotive 2015-12-31 10:33:27 +01:00
Maikel de Vries b5a00b69af fix whitespaces in tutorial scenario descriptions 2015-12-30 21:44:05 +01:00