Commit Graph

8328 Commits (ba82f5c3ac46ddaea2e9dc94cb71a4a956e5de42)
 

Author SHA1 Message Date
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
Maikel de Vries a6efefaecc fix float physics for objects moving out of a liquid surface (#1523)
This also fixes objects which previously jumped out of the water continuously, by adding an extra check to also capture faster moving objects. It could be made speed dependent, but that seems to be overkill for the situation.
2015-12-30 12:54:04 +01:00
Maikel de Vries 64af1e2a8a stars: fix placement and allow scenarios to change placement 2015-12-30 11:36:30 +01:00
Clonkonaut 4a26a7e8ad Increased bounty for several enemies. 2015-12-30 03:25:51 +01:00
Clonkonaut ef48a60b27 Fix possible null pointer. 2015-12-30 03:21:53 +01:00
Clonkonaut 1416887a22 Fix possible null pointer when shooting the balloon.
I suspect that when the clonk gets send tumbling, OnUnmount might get called and nil rider.
2015-12-30 03:21:35 +01:00
Maikel de Vries c8dff941dc worlds descriptions: fix whitespace and typos 2015-12-29 23:14:01 +01:00
Maikel de Vries 568c57900b add new world: Clonkomotive (thanks to Pyrit)
Based on a round made by Pyrit, changed to fit into the worlds folder.
2015-12-29 22:40:52 +01:00
Maikel de Vries ede6078c75 move out of solidmask as structure library function 2015-12-29 22:40:52 +01:00
Maikel de Vries 5a95f215a7 add wooden bridge
Parts of the scripts by Pyrit and graphics by Randrian.
2015-12-29 22:40:52 +01:00
Maikel de Vries 5b1d7d86a5 remove double initialization of wealth HUD in GoldRush 2015-12-29 22:40:52 +01:00
Nicolas Hake 9b34bf2634 Remove arbitrary inline forward declarations of StdBuf (and derivatives) 2015-12-29 21:42:46 +01:00
Nicolas Hake 93df9ba532 Docs: Desc??.rtf is now Desc??.txt 2015-12-29 19:17:48 +01:00
David Dormagen 7fce9071e3 lower interaction priority of dead Clonks 2015-12-29 18:28:23 +01:00
Nicolas Hake ae490dff11 Replace untranslated sentence in Tutorials/DE (#1522)
Translation provided by K-Pone.
2015-12-29 18:03:06 +01:00
Nicolas Hake 2723ef5516 Remove definition-local descriptions
These descriptions wouldn't be displayed anywhere anyway, so we don't
need them.
2015-12-29 17:58:44 +01:00
Nicolas Hake c0befc6ba0 Remove C4RTF
The only use of C4RTF in its final moments was parsing out plain text
from RTF files anyway, so why even go to all the trouble instead of just
storing plain text in the beginning?
2015-12-29 17:51:43 +01:00
Günther Brammer 77a71c39d3 Require some C++14 support (make_unique, index_sequence) 2015-12-29 15:47:55 +01:00
Günther Brammer b8953d8a09 CMake: Simplify precompiled header support for MSVC
Instead of conditionally adding src/C4Include.cpp, simply add it always. It
doesn't do anything with other compilers, but the tiny speedup from not
compiling it isn't worth the additional complexity.
2015-12-29 15:47:55 +01:00
Günther Brammer 16ef28e05f Drop unused C4VERSIONBUILDNAME and C4ENGINEINFO
This was used to name snapshot releases of the Network2 branch, and has
seen almost no use since.

C4ENGINEINFO(LONG) was a duplicate of C4ENGINENAME and C4ENGINECAPTION.
2015-12-29 15:47:55 +01:00
Nicolas Hake 0ef4e71363 MSVC 2015: Add natvis file to solution
This employs a rather ugly hack to make CMake do what we want. CMake
doesn't allow us to add items directly to the solution (as opposed to
one of the projects inside it), and thus requires us to abuse its lack
of parameter validation to manually add the file.
2015-12-29 13:58:15 +01:00
Nicolas Hake 500229c302 C4Extra: Make ownership of ExtraGroups more explicit 2015-12-29 13:56:06 +01:00
Nicolas Hake d0cd244077 C4Extra: Merge ctor/Default, dtor/Clear 2015-12-29 02:59:02 +01:00
Nicolas Hake 3da14127a4 C4TransferZone: Merge ctor/Default, dtor/Clear 2015-12-29 02:59:01 +01:00
Nicolas Hake 63ab46e293 C4Player: Merge ctor/Default, dtor/Clear 2015-12-29 02:59:00 +01:00
Günther Brammer 475ec23ef5 OS X: Use the same compiler flags code as the other stuff
Also remove redundant and inconsistent setting of the
XCODE_ATTRIBUTE_GCC_PFE_FILE_C_DIALECTS property, and a dead variable.
2015-12-29 01:48:41 +01:00
Günther Brammer 78f806f03c CMake: Fix check for getopt.h 2015-12-29 01:48:41 +01:00
Günther Brammer 4f64d13fc0 CMake: Remove broken addition of GLEW_DEFINITIONS to openclonk
This only didn't break earlier because this code was located before
find_package(GLEW). The add_definitions(${GLEW_DEFINITIONS}) call that
actually adds the macro is a bit broad, but the macro doesn't harm the
targets that do not use GLEW.
2015-12-29 01:48:41 +01:00
Nicolas Hake 6051c3e171 OS X: Stop overriding C++ version 2015-12-28 21:45:22 +01:00
Nicolas Hake 90293d019d C4FoWRegion: Make more private
Code outside of C4FoWRegion should not care about the internals of the
class. Therefore, we remove direct access to the backing surface (and
secondary buffer surface) and replace it instead with accessors that
return those few values that are required by outside code.
2015-12-28 21:45:21 +01:00
Nicolas Hake 5a9baeddbf C4FoWRegion: Turn some owned pointers into std::unique_ptr 2015-12-28 21:45:19 +01:00