Commit Graph

249 Commits (d59b1e5e5ba48c08a442d7ee0b4e4886cefd5089)

Author SHA1 Message Date
Mark 3971d60614 Match partial skeletons (#1177)
When using AttachMesh() with the flag AM_MatchSkeleton the behaviour was changed. The child mesh no longer uses the transformation of the bone in the parent skeleton by order, but by name.
2014-12-07 01:11:04 +01:00
Mark 1f4f280539 Bugfix: Missing AttachParent in AttachedMesh
On loading a savegame with attached meshes, the AttachParent of their child is NULL.
2014-12-07 01:11:02 +01:00
Mark 0e9c0e9be4 AttachMesh with added functionality (#1177)
Simple implementation of matching skeletons/animations. Short description added to the documentation. More functionality to follow.
2014-12-03 20:05:36 +01:00
Mark dda9599003 Extracted skeleton from StdMesh.
Skeleton is now represented by the class StdMeshSkeleton.
2014-12-03 20:04:54 +01:00
Armin Burgmeier a34cd5711c Add support for custom shaders in mesh material scripts 2014-10-21 15:19:30 -04:00
Armin Burgmeier 2f6d1eaa1f Parse program definitions from the material file 2014-10-21 15:19:30 -04:00
Armin Burgmeier 99fe2eca4f Fix gcc warnings about missing initializers 2014-10-21 15:19:30 -04:00
Philipp Kern 20701562e8 Allow distributions to use the system tinyxml.
Add a new cmake option WITH_SYSTEM_TINYXML=ON that allows to use the system
tinyxml library and header instead of the bundled copy. Adjust the include
path in the single source file referencing the header and add the thirdparty
path to the include search path if the use system option is unset or off.
2014-10-16 11:52:44 -04:00
Sven Eberhardt 7450a83746 Add missing tuple header #include. 2014-10-09 20:35:43 +02:00
Armin Burgmeier d47a416c0f Keep track of shaders in StdMeshMatManager
This replaces the fragile ShaderRef construction in StdMeshMaterialPass, and
it allows to re-use shaders and/or programs between different materials. This
is some more preparatory work for custom shaders.
2014-10-07 12:38:08 -04:00
Armin Burgmeier f23d745b1d Reorder submeshes by opacity after material change (#1125) 2014-10-04 16:12:13 -04:00
Armin Burgmeier 15c2497311 Serialize mesh materials in savegames (#1121) 2014-10-03 16:39:03 -04:00
Sven Eberhardt 378bda5546 Added custom scenario parameters (SCENPAR_*).
Can currently only be set in network games in the lobby. In the future, maybe we can find a place somewhere in the scenario selection dialogue.
2014-09-23 23:02:52 +02:00
Kevin Zheng 6a1a551d01 Clean up deprecated headers and functions
"gdk_pixbuf_unref has been deprecated since version 2.0 and should not be
used in newly-written code. Use g_object_unref()."

sys/timeb.h isn't used anymore since 2005.
2014-05-27 00:30:20 +02:00
Günther Brammer 88e5608298 Improve grammar in comment 2014-04-19 19:02:22 +02:00
Günther Brammer a840774965 Move FixedRandom to C4Random.cpp
No need to inline this seldomly-called function, or have RandomHold in the
global namespace.
2014-04-19 19:02:21 +02:00
Nicolas Hake 3c80a745b0 MinGW: Use __mingw_vasprintf if available
Recent versions of MinGW do no longer declare vasprintf in <stdio.h>,
but they ship a compatible function called __mingw_vasprintf. Use this
function if vasprintf isn't available.
2014-03-25 23:20:34 +01:00
Tobias Zwick 9c1f4bcbef replace FIXME logs on each scenario start with a FIXME comment in the code (#1013) 2014-01-26 17:16:22 +07: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
Armin Burgmeier 2cf11a1d6a Pre-compute Z values before face ordering (#984)
Pre-computed floating point numbers can be safely used in the comparison
function, whereas recomputation every time the sort function is called might
lead to a crash when the computed number is slightly differently every time,
because the sort function would return different results for the same faces.
2013-12-16 11:55:29 +01:00
Armin Burgmeier eddbbe3857 Make sure we never create mesh instances with 0 faces 2013-12-16 08:13:59 +01:00
Tobias Zwick fe2a400c02 replace global function GetTime() with class function C4TimeMilliseconds::Now() 2013-12-07 21:27:01 +07:00
Tobias Zwick 94c618d153 add new type C4TimeMilliseconds for time measurements to solve problems when GetTime() overflows (#251)
The new type C4TimeMilliseconds behaves for the most part like a uint32_t but is overflow-proof in comparisons.
In some places, a 0-value (or uint_max) of the variable storing the time had the special meaning "not set yet". This has been resolved by having it as a pointer to C4TimeMilliseconds with NULL meaning that it has not been set yet.
2013-12-04 19:35:07 +07:00
Tobias Zwick a8a8322dfb use %u to format unsigned ints (times) 2013-12-04 12:51:46 +07:00
Sven Eberhardt 6407c7cd2b Some more fixes for time_t change.
Some format strings had to be adjusted and clients always had ping timeout on join. Let's hope this fixes it.
2013-12-01 16:34:47 +01:00
Nicolas Hake 52fd2679cd Fix line endings broken by ecf538c, 7b9c1d5, and ceca8b8 2013-11-29 14:18:48 +01:00
Tobias Zwick ecf538cd1f refactor: consistently use time_t t... variables for times in sound system, stats, application and player controls 2013-11-29 14:16:14 +07:00
David Dormagen fe28104f98 prevent crash when StdSubMeshInstance face count is 0, added assertion though, because this should not happen to my knowledge
I believe a possible cause for this is a object's model with a very low completion. However, I am not sure where the right place is to make sure everything goes alright in that case.
2013-11-26 21:25:07 +01:00
Tim Blume 32968f2735 Remove more mentions of D3D 2013-11-25 14:35:51 +01:00
Nicolas Hake e753bf8168 Replace ResTable with a proper dictionary
ResTable (the main system string table) was a home-grown hashmap that
did not cope with collisions at all. Since we already have a proper
dictionary in C4LangStringTable, use that instead.
2013-10-19 19:28:54 +02:00
Nicolas Hake 58a39e972f Improve C4Object const correctness 2013-08-31 23:23:35 +02:00
Nicolas Hake 9ceb69236b Remove unused Base64 codec 2013-08-04 18:10:10 +02:00
Sven Eberhardt 49c16723a9 Change Random() on negative values to always return zero.
Before, it would return huge, positive values (e.g. Random(-20) could produce 47384782) which leads to all kinds of trouble in script (like #968)
2013-07-02 21:16:59 +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 524fe879aa Make DEBUGREC define a commandline option 2013-05-25 22:51:32 +02:00
Günther Brammer 74eda19838 Round C4Fixed towards positive infinity instead of away from zero
The movement code relies on itofix(a + 1) == itofix(a) + 1, which requires
always rounding in the same direction. Since negative numbers are rounded
less often (Objects rarely are outside the landscape), change the behavior
for them.
2013-05-25 18:44:05 +02:00
Günther Brammer bf130d664d Use a less convoluted way to avoid overflow when rounding large C4Fixeds
Instead of using a special path for the numbers that would overflow, make
use of the available bits to avoid overflow entirely.
2013-05-25 18:44:05 +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 90fbabd20f Implement depth_check for material scripts 2013-03-31 17:14:13 +02: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
Sven Eberhardt 57e63a5275 Added support for scripted maps (Map.c) and documentation. 2013-03-19 00:36:06 +01:00
Günther Brammer b19259a22c Switch to a better random number generator
This is already used in C4Landscape::ChunkyRandom, where it produces good
results.
2013-03-10 17:37:30 +01:00
Nicolas Hake 365d72fee1 Fix incorrect reloading of animations (#837)
Animation nodes accidentally did not have the correct
animation parent set when they were deserialized.

Closes #837, #872, #916.
2013-02-04 19:06:08 +01:00
Armin Burgmeier 43a2836279 Implement texture unit blending in material scripts with a shader
This might make the rendering a bit quicker, since the whole texture
environment setup that we do every frame is no longer required --
instead only the shader is bound and a few variables uploaded. However,
this was not the main motivation behind this change.

It also simplifies the code a bit. The texture environment setup is
replaced by GLSL code generation. Another small benefit is that for
texture units in material scripts that do not use an actual texture
image no hardware TIU is being used. This reduces the number of hardware
TIUs required for rendering the Clonk from 3 to 2.

The main benefit of this change, however, is that material specific
and clonk specific color variations can be applied correctly. This mainly
concerns ClrModulation and MOD2 drawing. Before, the ClrModulation was
mixed with the material color, which could lead to incorrect results
depending on what the texture units were doing. Now it is being applied
by the shader after all texture units in the material scripts have been
processed.

Another motivation of this change is to implement support for custom
shaders, which is already foreseen by OGRE material scripts. The
specification has only to be implemented. With this change in place,
both custom shaders and "fixed" processing can share the same code in
the engine, since both end up using a shader for the mesh rendering.

The shader currently works only for directional lights, but should be
easy to extend to also support point lights.
2013-02-03 16:26:01 +01:00
Martin Plicht 379cd1c210 StdStrBuf::AppendFormatV: Pass copied va_list to vsnprintf so the second iteration of the while loop does not crash 2013-01-13 11:31:13 +01:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Günther Brammer 6a6190564f Remove some forward declarations that are already in C4Prototypes.h 2012-12-31 22:03:12 +01:00
Günther Brammer 7967d94a59 Merge StdFont.cpp and C4Fonts.cpp 2012-11-12 02:30:16 +01:00