Commit Graph

145 Commits (2e6e6e341c78b0b43d0b6ab85a3b04ffee756c97)

Author SHA1 Message Date
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 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
Sven Eberhardt 74243429c0 Fix Wait-command. 2013-12-29 21:57:26 +01:00
Sven Eberhardt a385102c36 Changed GetDefBottom to use bottom vertex to determine object bottom.
Since this is the method also used by CreateObject, GetDefBottom can be used to recreate objects at their proper position.
2013-12-27 17:11:02 +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 078899d0a0 added safety check for when calling CreateParticleAtBone without object context 2013-12-17 22:32:02 +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
Tobias Zwick 325053410f rename script callback UpdateTransferZone to OnSynchronized (#220) 2013-12-17 23:16:11 +07:00
Sven Eberhardt 25ddb14dca Rework prop list renumbering on section load (again).
Turns out changing prop list numbers while they are still indexed by number in the hash map was a bad idea. Existing prop lists are now de-numbered, pushed to an external shelve and re-numbered when added after section load.
2013-12-15 15:46:18 +01:00
Sven Eberhardt 1cca6fd1ad Rework section load again.
Now clears numbers of all existing proplists and renumbers them after loading. Fixes some assertions and duplicate numbers during loading.
2013-12-15 14:06:21 +01:00
Sven Eberhardt 29d1b4846a Fix scenario sections
Inactive objects got removed and calling section load from global effects caused a crash.
2013-12-14 18:16:39 +01:00
Tobias Zwick 17ab2c53a3 update documentation around DefCore, remove some obsolete fields (2) 2013-11-30 14:15:42 +07:00
Tobias Zwick 666a51b3d9 update documentation around DefCore, remove some obsolete fields 2013-11-30 14:14:18 +07:00
David Dormagen e7e9190fb9 objects now also instantiate their dynamic particle structures when loading from a savegame (fixes crash) 2013-11-26 22:00:03 +01:00
Nicolas Hake 4ebf67754c Move C4ComponentHost::LoadEx to C4Language
To make C4ComponentHost more reusable, move C4Language dependencies out
of the class.
LoadEx isn't really suited to reside in C4Language, but it's better to
have it there, since all C4Language consumers also use C4ComponentHost;
the reverse isn't true.
2013-10-29 21:32:21 +01:00
Nicolas Hake c55888f7c3 CStdFont: Encapsulate iLineHgt 2013-10-18 22:30:02 +02:00
Nicolas Hake 7ffa636540 C4Object: Don't do any drawing calcs when headless
There's no point in calculating render positions or audio source
locations when we're not rendering any audio or graphics. Skip it when
headless to save CPU cycles.
2013-10-18 22:30:01 +02:00
Sven Eberhardt bd103481e8 Fix crash when ATTACHed object detaches in Enter/Exit call. 2013-10-12 23:36:42 +02:00
David Dormagen fc3aaab835 dynamic particles: more code cleanup and fixes 2013-10-09 01:29:12 +02:00
David Dormagen 2e2c40db07 dynamic particles: added phase property; added parameters to PV_Step; objects now draw their particles correctly; fixed PV_Random 2013-10-07 20:56:51 +02:00
David Dormagen 8025e7c2b0 the dynamic particle system now runs the calculations in a different thread
added PV_KeyFrames
2013-10-07 20:56:49 +02:00
David Dormagen 40b66d1c76 added (early demo of) new particle system which should both be faster and more flexible than the old one 2013-10-07 20:56:49 +02:00
Maikel de Vries c05875da06 Make COMD_* work more intuitive for DFA_FLOAT
Changing from COMD_UpRight to COMD_Up now makes you go upwards instead of continuing in the diagonal direction.
This does not seem to break anything, although the C4Command.cpp code is hard to verify due to lacking comments. If this is broken I will fix it. In any case no one is using it anyways.
2013-10-07 19:15:46 +02:00
Maikel de Vries 9e8dd57dbb Disabled scaling and hangling under water, fixed vertices for swimming clonk
Please note that the dive animation is putting the clonk to low compared to its center this should be fixed by one of the OC modelers.
2013-10-06 14:55:48 +02:00
Nicolas Hake 58a39e972f Improve C4Object const correctness 2013-08-31 23:23:35 +02:00
Sven Eberhardt ba84fc7c4b Fix internal marker for FindObject searches and CrossCheck using shapes.
Before, the marker would be reset in every frame, but object markers and main counter weren't reset consistently at the same time. This could cause some objects to be not found if their markers were set after the object marker reset but before the main marker counter reset.
2013-08-10 23:21:26 +02:00
Sven Eberhardt 2da1dcc741 Make AdjustMoveToTarget more robust concerning large values.
Before, e.g. SetCommand("MoveTo", nil, 0,9999999) could freeze the engine for some time.
2013-07-02 21:18:16 +02:00
Martin Plicht 405453aed3 Merge branch 'debugrecoption' 2013-05-31 14:39:16 +02:00
Armin Burgmeier 695a9a88c3 Add TransformBone and SetAnimationBoneTransform script functions 2013-05-27 21:33:29 +02:00
Armin Burgmeier 90ee4d2380 Fix crash when an object whose mesh is attached to another mesh is removed 2013-05-27 15:55:18 +02:00
Martin Plicht eaf93d6a0e Also check for DebugRec flag in #ifdef DEBUGREC_* blocks 2013-05-25 23:01:41 +02:00
Martin Plicht 524fe879aa Make DEBUGREC define a commandline option 2013-05-25 22:51:32 +02:00
Martin Plicht 251ef5169c DEBUGREC compile fix 2013-05-25 19:06:01 +02: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
Günther Brammer ecae81d985 Enlarge rotated shape only by the minimum necessary
Previously, a rotated object had a quadratic shape that could hold all
possible rotations.
2013-05-25 14:47:54 +02:00
Sven Eberhardt 4557d1638e Added property LineMaxDistance to let a line break when connected objects are too far apart. 2013-05-09 12:02:44 +02:00
Sven Eberhardt 6250ff1766 Silence a few MSVC warnings 2013-04-01 12:48:02 +02:00
Sven Eberhardt 3e56ae6757 Fix saving of zeroes in vertex data that was nonzero in the definition. 2013-04-01 00:46:14 +02:00
Armin Burgmeier 7c240aefa3 Fix the build 2013-03-31 16:10:20 +02:00
Sven Eberhardt 2383a962af Only save Shape and Component data if it differs from the definition for scenarios using Game.txt.
Components and vertices of definitions are often changed for balancing reasons (e.g. trees giving more wood) or because of updated graphics. This saves us from having to update all Game.txt for such changes files in the future.
2013-03-30 15:59:15 +01:00
Nicolas Hake 459fce0758 Replace std::auto_ptr with std::unique_ptr
std::auto_ptr has awkward copy semantics and is deprecated in C++11.
2013-03-26 15:43:01 +01:00
Günther Brammer 7be81f78e8 C4GameObjects::ObjectPointer does not need to be virtual 2013-03-10 17:37:30 +01:00
Günther Brammer 2d7b472ab3 Script: GetID returns the prototype of an object, not the internal C4Def 2013-03-10 17:37:29 +01:00
Günther Brammer df3fcd2b2b Document C4PropList internals a bit 2013-02-11 22:23:05 +01: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 019ea36ee9 Remove unused C4Object::GetActionByName 2013-01-20 17:25:02 +01:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Tobias Zwick d0a6bb099f fix #792: wouldn't load Overlay.*.png 2013-01-08 23:52:45 +01:00
Günther Brammer 6a6190564f Remove some forward declarations that are already in C4Prototypes.h 2012-12-31 22:03:12 +01:00
Armin Burgmeier c3c148d53a Add CreateParticleAtBone script function 2012-12-29 00:06:30 +01:00
Sven Eberhardt 86b20be644 Fix C4Command::Jump, i.e. jumping as part of pathfinder. 2012-12-09 18:44:22 +01:00
Sven Eberhardt 6a4e5b0615 Attached objects with SolidMask (slave elevator case) can carry objects 2012-12-06 20:30:35 +01:00
Günther Brammer 7967d94a59 Merge StdFont.cpp and C4Fonts.cpp 2012-11-12 02:30:16 +01:00
Günther Brammer c439c81362 Remove unused C4D_None 2012-11-12 02:41:20 +01:00
Tobias Zwick 348fb8c7a9 clean up mouse controls, reduced cursor graphics to the used ones 2012-11-16 17:29:42 +01:00
Peter Wortmann 56bdeec585 FoW/lights preview
This is pretty much still prototype stage. Lots of bug, lots of stuff missing.
2012-08-19 19:35:10 +01:00
Günther Brammer 4b096d71a0 Do not clip parallax objects (fix disappearing moon, #575) 2012-10-30 22:18:27 +01:00
Philipp Kern e037300801 Fix spelling mistake: ressource -> resource. 2012-10-21 22:20:43 +02:00
Armin Burgmeier b4aafdd874 Remove build number aka C4XVER4 2012-10-18 23:54:50 +02:00
Armin Burgmeier 9c1496178b Load Graphics*.mesh files for use with SetGraphics (#480) 2012-10-14 14:37:45 +02:00
Sven Eberhardt 73120db094 DebugRec: CallEveryDefinition puts def names, not localized names into debug rec 2012-10-14 13:33:32 +02:00
Armin Burgmeier 977cf98f82 Always climb up when pressing the direction key against the wall 2012-10-13 18:03:20 +02:00
Günther Brammer 10dd29ee49 Do not scale or tumble while jumping upwards and hitting the feet
Theoretically, the Clonk shouldn't even hit the feet at the start of the
jump, but that's a quest for another time.
2012-10-13 17:14:13 +02: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
Nicolas Hake 9f83a613dc Always reset C4Action::t_attach when executing action (#808)
Not resetting t_attach leads to strange behavior in liquids since detaching from
the landscape usually happens via the Jump action which generally reverts to its
InLiquidAction before t_attach gets reset. By removing the shortcut return after
entering the InLiquidAction, we make sure t_attach gets reset correctly (as well
as immediately executing the correct action instead of doing so after a delay of
one frame).
2012-10-10 21:28:25 +02:00
Günther Brammer c9bcafba56 Simplify DoCon implementation
For example, the solidmask removal is done in
UpdateFace, and might have been needed in Clonk 4 or Clonk Planet, but the
current solidmask code is fine with the call from there.
2012-07-27 16:09:25 +02:00
Günther Brammer 6dac692bd5 DoCon holds the bottom-most vertex in place, not the bottom of the Shape
This makes trees not sink into the landscape when burning.
2012-07-27 17:44:59 +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 49a0ea7bd2 Support Decel for SCALE, HANGLE and FLIGHT, fall back to Accel
All procedures now use the Accel value if the Decel value is nil, and also
use the default Attach value if that is nil.
2012-07-15 21:47:50 +02:00
Günther Brammer 9f0556250f Clonks don't lose their speed when hitting a wall 2012-07-15 19:05:20 +02:00
Günther Brammer 692fb103f1 DrawVertex uses thinner lines for the cross 2012-06-08 16:19:36 +02:00
Günther Brammer f41590d71f Merge branch 'movement' 2012-07-13 23:27:14 +02:00
Armin Burgmeier 6661f8b8cb Fix a crash when attaching a mesh by definition fails 2012-06-30 22:04:48 +02:00
Günther Brammer 4985c519c6 Switch from SCALE to Walk on top of slopes
The precise rule is that only CNAT_Bottom vertices connect to the
landscape and connect at the bottom, too. It doesn't quite fit with
the other procedure-transitions because the movement code doesn't
consider the bottom vertex to touch the landscape in that situation,
but this is probably less weird than the old cornerscale teleportation.

Also don't transition from FLIGHT to Scale when the ComDir points
away from the wall. That tended to stop the Clonk in its tracks on
uneven ground.
2012-06-19 01:40:37 +02:00
Günther Brammer 24bfd6345d Use Action.Attach even when Action.Procedure is not nil
But default to the previously used value when Attach is not set. Use 0 to
override the default.
2012-06-16 03:01:47 +02:00
Günther Brammer bb292e828d Attached objects use the nearest available point instead of the farthest
This avoids some teleporting when there's some material behind the object
and in front of it. Especially useful for small bumps of material in front
of a wall with the new left/right attachment of the foot vertex of the
Clonk.
2012-06-08 16:20:26 +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 4e71af5489 Script: Add GetProperties function to get the keys of a proplist 2012-05-26 01:32:43 +02:00
Günther Brammer 09d08298bf Replace C4AulContext* this of C4Script engine functions with C4PropList*
This mainly removes some indirection and a superfluous struct.
2012-05-15 03:03:47 +02:00
Günther Brammer 0e6f972de4 Remove unused C4Object* parameter from C4AulExecError 2012-05-15 03:11:23 +02:00
Günther Brammer 3a3ed01c89 Savegames: Save readonly proplists by their name
For example, the proplist in Clonk.ActMap.Walk is saved as DClonk.ActMap.Walk.
Should the script defining the proplist change while the savegame is stored,
the proplist will have the new contents instead of the old ones after savegame
load.

Also, save functions as DFlint.Hit instead of fDFlint.Hit. Loading uses the same
code as static proplist loading.

Curiously, this makes g++ 4.4 use the C4RefCntPointer move constructor,
which was broken until now. Fix it to take a mutable rvalue reference.
2012-06-01 17:27:59 +02:00
Günther Brammer 099cd15e56 Script: Remove unused OnBlastIncinerationDamage callback
Scenarios that want to override the default behaviour of BlastObject should
overload the BlastObject function itself. Objects can simply use the Damage
callback and/or set BlastIncinerate to nil.
2012-05-06 15:37:43 +02:00
Günther Brammer 2510734ad3 Script: Damage callback changed to Damage(Change, Cause, CausedByPlr) 2012-05-06 14:45:35 +02:00
Günther Brammer 752e945b8d Call C4PropList::Freeze in Link, remove now empty AfterLink functions
AfterLink was otherwise only used for the TimerCalls, which are now gone.
2012-05-06 00:06:33 +02:00
Günther Brammer 5e60806439 Move GetNeededMatStr to the other object functions 2012-04-28 22:01:47 +02:00
Günther Brammer 815d5a895a Replace remaining functions in ObjectScript table with template AddFunc 2012-04-28 22:04:43 +02:00
Günther Brammer 8a4181a3be Replace C4AulObjectContext* with a simple C4Object* parameter 2012-04-28 22:04:36 +02:00
Maikel de Vries 6fcc0f6d2e Removed TimerCall in favour of AddTimer script implementation 2012-05-05 12:09:44 +02:00
Maikel de Vries 7857da2c50 Check object rather than def for fire related properties 2012-04-29 10:21:16 +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