Commit Graph

2564 Commits (d59b1e5e5ba48c08a442d7ee0b4e4886cefd5089)

Author SHA1 Message Date
Tobias Zwick d59b1e5e5b reduce version numbering from x.y.z (x does never changes) to y.z 2014-12-12 21:57:52 +01:00
Kevin Zheng 4fae398672 Fix build on 32-bit architectures 2014-12-10 21:45:41 +01:00
Sven Eberhardt b641650443 Do not fade out music on scenario section loading.
Instead, scripters can use SetPlayList() or Music() to fade music by script if desired.
2014-12-09 23:48:19 +01:00
Sven Eberhardt ac41e9a6eb Fix music fading when fading back to the same piece that is currently fading out. 2014-12-09 23:37:39 +01:00
Sven Eberhardt 35b65cd78c Use COMMENT (not COMMENTS) as the category field to select songs when using SetPlayList. 2014-12-09 23:37:34 +01:00
Armin Burgmeier ffed845849 Build fix 2014-12-07 14:59:38 -05:00
Sven Eberhardt 612a05fe40 New script function: GetPXSCount.
Counts number of loose pixels of a material in an area.
2014-12-07 19:52:05 +01:00
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
Sven Eberhardt bbe01335d9 Fail scenario saving if object saving returned nil (#1182).
This usually means there was a script error in the scenario saving function. Better abort instead of overwriting the existing scenario with garbage data.
2014-12-06 22:45:38 +01:00
Armin Burgmeier e46c558671 Fix a delete / delete[] mismatch in C4ParticleSystem 2014-12-06 15:42:42 -05:00
Armin Burgmeier 377d8ab1d0 Set pack alignment to 1 before reading the GL pixel buffer (#1181)
Otherwise the default pack alignment is 4, and when the horizontal window dimension
is not a multiple of 4, glReadPixels() would read past the end of the buffer we
provided.
2014-12-06 15:42:42 -05:00
Armin Burgmeier f58f7ad770 Initialize all structures when writing BMP file
Otherwise, we would partly write files with uninitialized data, such as the
padding bytes in a BMP, or the palette if not specified explicitly. This
mostly fixes corresponding valgrind warnings, but also makes sure we obtain
the same BMP files everytime we store the same StdSurface8 object, bit-by-bit.
2014-12-06 15:42:42 -05:00
Armin Burgmeier dd16b2d588 Set useful name for in-memory CStdFiles
This fixes a valgrind warning when creating a savegame, since in that case
the file name is filled with uninitialized junk. It is not used at other
places, since it is an in-memory file, and therefore was probably harmless.

Now we give a useful name to in-memory files based on the address of the
StdBuf object, which might actually be useful when debugging.
2014-12-06 15:42:42 -05:00
Sven Eberhardt baf05264d1 Implement music fading.
Moved music system execution from game tick execution into main application execution so music fading works when the game is paused or lagging.
2014-12-06 18:04:55 +01:00
Sven Eberhardt 62e6da2f23 Add categories for .ogg music files that can be referenced in SetPlayList. 2014-12-06 00:06:08 +01:00
Mark d0a74d9af3 Merge remote-tracking branch 'origin/master' 2014-12-03 20:08:41 +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 a792a1c6a2 Fix possible race condition in C4ParticleSystem construction
Previously, the calculation thread was initialized before the event it was
going to wait for after it is launched. However, since the thread starts its
execution in its constructor, it might access the event before the event
itself has been constructed.

This is fixed by making sure the event is fully constructed before the thread
is constructed (and launched).
2014-12-03 11:03:51 -05:00
Armin Burgmeier 56b19ac065 Fix brush preview in GTK+ developer mode
This looks like an artifact from when the alpha channel was inverted.
2014-11-24 16:32:25 -05:00
Armin Burgmeier fb5365c2b1 Fix possible crash when drawing empty pix or line PXS 2014-11-12 08:46:53 -05:00
Armin Burgmeier c3bcedfbf9 Don't attempt mouse hover callbacks when mouse control is passive (github #5) 2014-11-07 20:16:30 -05:00
Armin Burgmeier ebeeb534ce CreateParticleAtBone: Take object rotation into account (#1173) 2014-11-07 19:57:04 -05:00
Armin Burgmeier 73e4f5a89c Remove some unused code in C4Draw 2014-11-04 11:24:55 -05:00
Armin Burgmeier a1bafb937f Implement DrawQuadDw with PerformMultiTris
This simplifies the code further.
2014-11-04 11:02:40 -05:00
Armin Burgmeier 9e9f0cee9d Avoid setting oc_ClrModMap shader parameter when clrmodmap is not used
Otherwise, ResolveAutoParameter() does not set the correct parameter type, and
the code would try to set a sampler2D parameter as a float4. It does not matter
in principle since the shader would not use the texture anyway, but it
generates a GL error that is avoid this way.
2014-11-03 14:39:17 -05:00
Armin Burgmeier f89058f094 Remove config entries that are no longer used 2014-11-02 16:57:50 -05:00
Armin Burgmeier fe7897539a Remove unused code 2014-11-02 16:57:28 -05:00
Armin Burgmeier 233e5e7c13 Remove CStdGL::BlitLandscape
This code is only used for the low-resolution landscape that is hardly in use
anymore. The code was mostly a duplicate of the standard C4Surface blit
function, CStdGL::PerformBlt, with some added code for blitting material
textures with higher resolution. However, that code was not enabled anymore
by the classic landscape renderer either, so it seems safe to remove it.

The landscape is now simply drawn by C4Draw::Blit.
2014-11-02 11:15:06 -05:00
Armin Burgmeier 50769171f1 Remove manual clipping in C4Draw::BlitUnscaled
This was not working anymore correctly, since it now operated on unzoomed
coordinates. This could have been worked around by only applying it in the
unzoomed case, however I don't think the code is actually used much anymore.
In other cases of the rendering code, such as the mesh rendering, manual
clipping was never implemented and this did not seem to cause any problems.

Therefore, it can probably be removed safely.
2014-11-01 23:11:35 -04:00
Armin Burgmeier 373b992f45 Tweak the shader a bit 2014-11-01 22:45:14 -04:00
Armin Burgmeier 2b2bc56e77 Remove unused PerformBlt function 2014-11-01 22:28:03 -04:00
Armin Burgmeier 65a47623e4 Use PerformMultiTris in the standard blitting code
This makes blits with overlays to actually use a single pass only, and
applies the GLSL shader also to standard object blits, which might come
handy when the lighting calculations in the lights branch are applied
on sprite objects.

It also removes the last user of C4Draw::PerformBlt, which will be removed
in a subsequent commit.
2014-11-01 22:28:03 -04:00
Armin Burgmeier b58fde88aa Add option to draw overlay with PerformMultiTris
This allows drawing images with overlay in a single rendering pass.
2014-11-01 22:28:03 -04:00
Martin Plicht 1ddb8ebf39 mac: Quit from main menu also calls Application.Clear() 2014-11-01 15:47:04 +01:00
Martin Plicht d05c784478 C4GameObjects: Turn remaining explicit iterator use into for (x : list) loop 2014-11-01 15:47:04 +01:00
Martin Plicht f1f1627995 C4ObjectList: InsertLink, InsertLinkBefore and Clear also do some iterator adjusting 2014-11-01 15:47:03 +01:00
Armin Burgmeier b0f2f507b1 Fix execl invocation in C4UpdateDlg 2014-10-29 00:35:13 -04:00
Armin Burgmeier babb0b243b Load mesh material scripts also from .ocd folders without definition 2014-10-26 21:29:36 -04:00
Sven Eberhardt b310369b64 Initialize C4Game::CheckObjectEnumeration()::Check::maxNumber in ctor.
MSVC2012 build fix.
2014-10-26 20:44:06 +01:00
Sven Eberhardt a60bf33358 Rename C4DrawMeshGLProgramInstance::Parameter::Parameter to avoid name conflict.
MSVC doesn't like members having the same name as the enclosing class.
2014-10-26 20:41:45 +01:00
Martin Plicht 0bab7c17de C4Object: ShiftContents done with iterators 2014-10-25 21:26:07 +02:00
Martin Plicht afa6974f37 C4GameObjects: Sorting out objects with inactive state done with regular Remove/Add calls instead of manually doing linked list dance again 2014-10-25 21:26:07 +02:00
Martin Plicht 0219a40d2b C4GameObjects: PostLoad sanity Contents check done with iterators instead of direct C4ObjectLink access 2014-10-25 21:26:07 +02:00
Martin Plicht e375e4b30a C4GameObjects: When shelving contents of InactiveObjects temporarily, make a copy instead of setting InactiveObjects.First 2014-10-25 21:26:07 +02:00
Martin Plicht e05bdfbcb4 C4Game: Refactor CheckObjectEnumeration to not use manual list traversal 2014-10-25 21:26:07 +02:00
Martin Plicht 843d4039b1 C4GameObjects: Use this instead of ::Objects 2014-10-25 21:26:07 +02:00
Martin Plicht d84d42717e C4Object: Call Contents.GetLastObject() instead of accessing Last link directly 2014-10-25 21:26:06 +02:00
Martin Plicht b2fcc2ee32 C4EditCursor: Instead of manual list traversal use iterator 2014-10-25 21:26:06 +02:00