Commit Graph

23 Commits (544c1cbb4bb6da97d30571ff28772660c7ad5969)

Author SHA1 Message Date
Maikel de Vries 159dbf071f make ContactCalls a property instead of DefCore entry
This allows for useful runtime changes, like disabling contact calls when an animal dies.
2016-02-08 21:25:43 +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
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
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
David Dormagen 4d85c8ffc9 fixed deleting objects at the bottom of the map (#1435)
Instead of Y - Hgt > LandscapeHeight (or, equivalently, Y > LandscapeHeight + Hgt), it was checked for Y + Hgt > LandscapeHeight, which would remove objects too early.
2015-10-26 19:05:59 +01:00
Sven Eberhardt 4020769e23 Don't delete objects with partial shape still in viewport (#1404).
This will allow better graphics for the clouds movement when wrapping the landscape.

There is some potential for weird behavior; e.g. objects hidden just out of view outside the landscape. But we don't have any goals like Clonk Rage gold mine where you would have to find that nugget lying hidden in that place. Besides, the current behavior of just removing stuff even though it was just halfway out is worse.
2015-09-19 17:22:43 -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 fa57eb4ab0 Fix moving SolidMasks. 2014-01-03 17:39:00 +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
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
Günther Brammer 27ef3edff0 Consistently use rounded and precise values in movement code
Movement is done in single-pixel or single-degree steps, until the
rounded position that's used for collision detection is equal to
the target. The underlying position is maintained with subpixel
precision as much as possible, however.
2013-05-25 18:44:00 +02:00
Günther Brammer 398809dc55 Do not unnecessarily truncate the position of rotating objects
Rotating attached objects can move them, but for unattached objects this
would only reset them to the same pixel position there were at, but without
the subpixel fraction.
2013-05-25 15:09:56 +02:00
Günther Brammer 4e875f4495 Don't store object rotation twice
Rotation was still stored as an integer and as a fixed point number.
Compute the integer on demand from the fixed point instead, like the
position. Rewrite the movement code where the two variables were
temporarily out of sync.
2013-05-25 14:59:58 +02:00
Nicolas Hake d20ee02ad6 Abort SimFlight if no more movement can occur (#914)
In no-gravity situations, SimFlight would enter an endless
loop when trying to project an unmoving object, waiting for
a collision that would never happen.

Similarly, in negative gravity, SimFlight would continue
calculating objects that left the top boundary of the land-
scape, only aborting the simulation once the coordinates
underflowed to values below the landscape.
2013-01-30 14:00:08 +01:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Nicolas Hake 27eb5dd65a Allow object interaction with closed borders
Conceptually, the landscape stretches infinitely on both left and right hand
borders of the map. So far, the "closed" part of the border only blocked objects
from passing through. (Additionally, there was a bug where you could scale the
border under certain circumstances.) This patch allows objects to properly
move around on the map borders, including scaling the fake terrain.
2012-10-10 21:28:25 +02:00
Günther Brammer 6a0f9b164c Use a constant for the default gravity instead of triplicating it 2012-07-25 17:02:10 +02:00
Günther Brammer 944ca60910 Tweak the "corner scale" behaviour
Instead of teleporting from sticking with the left/rightmost vertex to the
want to standing on the lowest one at the same position, the Clonk can now
climb using the lowest vertex alone. That means the teleport only needs to
cover only one pixel each in x and y direction to go from sticking to the
side of the landscape pixel to sticking on top of the same pixel.

Also remove some unnecessary x/ydir resets and make comdir in the direction
of the wall the Clonk is scaling keep the up/down direction instead of only
going up.
2012-06-08 16:17:42 +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