Commit Graph

79 Commits (d59b1e5e5ba48c08a442d7ee0b4e4886cefd5089)

Author SHA1 Message Date
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 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 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
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
Armin Burgmeier 178008928b Apply ClrModMap to meshes pixel-by-pixel
The support is not yet fully implemented; there are some transformations
missing. However, since the FoW support at the moment seems to be broken
(#1168) this feature cannot be tested properly.
2014-10-21 17:26:22 -04:00
Armin Burgmeier a34cd5711c Add support for custom shaders in mesh material scripts 2014-10-21 15:19:30 -04:00
Armin Burgmeier d1ea85d8d4 Remove now unused C4FacetEx::DrawLineDw 2014-10-18 13:41:06 -04:00
Armin Burgmeier 25b259ae20 Fix implementation of C4Draw::DrawLineDw (#1164) 2014-10-18 13:14:17 -04:00
Armin Burgmeier 5e43e595d3 Make attached meshes use their own blit parameters (#1095)
This might break some scenarios which for example change the color modulation
of a clonk and then expect that also its shovel or other objects get colored.
Such scenarios need to be fixed by also coloring the attached objects. This
might not be very convenient, and maybe we should introduce an option for
attached meshes to use the old behaviour (take blit parameters from main
object).

However, let's see how this change turns out in practise and then we see
whether further modifications are needed.
2014-10-16 11:50:30 -04:00
Armin Burgmeier b06e10e03b Add PerformMultiTris to draw many texturized triangles at once 2014-10-08 18:33:46 -04:00
Armin Burgmeier 2e03c3157b Remove C4Draw::PerformLine
It is no longer used
2014-10-08 18:33:46 -04:00
Armin Burgmeier a597dc28d7 Use PerformMultiLines where appropriate 2014-10-08 18:33:46 -04:00
Armin Burgmeier 9e81de1e77 Add the PerformMultiLines function
This function can be used to efficiently draw many lines
2014-10-08 18:33:46 -04:00
Armin Burgmeier c1f1a623fb Remove PerformPix in favor of PerformMultiPix 2014-10-08 18:33:45 -04:00
Armin Burgmeier 1c7b8ba9b5 Add PerformMultiPix method to draw many pixels at once 2014-10-08 18:33:45 -04:00
Armin Burgmeier 1da4a9bd44 Move shader classes to C4DrawGL 2014-10-08 18:33:45 -04:00
Armin Burgmeier 785c74015e Override std::exception destructor in C4DrawMeshGLError
Otherwise the default destructor does not always have the throw() attribute.
This (hopefully) fixes the autobuild on Linux.
2014-10-07 13:28:46 -04: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
Sven Eberhardt 840b9cd30a Fix off-by-one error in text line break code (#1122) 2014-10-05 18:10:23 +02:00
Armin Burgmeier f23d745b1d Reorder submeshes by opacity after material change (#1125) 2014-10-04 16:12:13 -04:00
Sven Eberhardt abab7be591 Added scenario achievements displayed as small symbols beside the scenario name in the startup selection screen.
They can be used e.g. to show that you have finished a scenario on different difficulty levels.
2014-09-24 23:08:40 +02:00
Günther Brammer 8780a69b51 Improve the messages for path problems
C4Group::Open would sometimes overwrite more specific error messages or
not mention the problematic path. DirectoryIterator::Read also now mentions
more detail. Two superfluous messages were removed to make space.
2014-06-09 04:17:17 +02:00
Julius Michaelis 405fc4f841 Fix dedicated 2014-04-02 20:53:12 +02:00
Martin Plicht c9521e2c3c mac: Zoom in/out main menu commands also work in game mode, call Viewports. methods then 2014-02-16 10:01:14 +01:00
Martin Plicht a4c858f4ee C4Draw::ResetGamma: Implement by applying saved DefRamp (Mac version went all blue using the old implementation) 2014-01-23 17:52:30 +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
Tim Blume 32968f2735 Remove more mentions of D3D 2013-11-25 14:35:51 +01:00
Nicolas Hake ca09a74241 Remove some silent conversion from integer 1/100ths to float 1/1s (#994)
4e875f4 didn't quite catch all instances of C4BltTransfor::SetRotate
being called, and silent conversion from int to float meant that those
rotations were incorrect by a factor of 100.
2013-11-11 00:23:01 +01:00
Sven Eberhardt 395f4c94b0 Reset gamma ramps after game (#842) 2013-11-09 17:11:29 +01:00
Martin Plicht a599974a9b mac: Use OSX Mavericks occlusionState API to test whether window is visible and needs drawing or not (should still work on Mountain Lion due to runtime check for API availability) 2013-11-03 11:44:20 +01:00
Tim Blume 240193ad5a Remove remains of Direct3D support
Direct3D hasn't worked for more than a year now, and there don't seem to
be any efforts to revive it. Remove it and concentrate on better OpenGL
support.
2013-11-02 21:39:34 +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 02f425d30b C4FontLoader: minimize footprint when headless
There's no need to do font loading and layouting when we're not going to
render it anyway.
2013-10-18 22:30:03 +02:00
Nicolas Hake c55888f7c3 CStdFont: Encapsulate iLineHgt 2013-10-18 22:30:02 +02:00
Martin Plicht a1cf73634c mac: Flip y coordinate of definition dragging location 2013-10-13 23:07:56 +02:00
Julius Michaelis 1261402357 Zoomed full map screenshots with artefacts and fixed zoom
Signed-off-by: Sven Eberhardt <sven2@goldwipf.de>
2013-09-14 23:36:07 +02:00
Martin Plicht fb4117307b mac: Fix Screen::rcBounds <> window size discrepancy + fullscreen windows still fill screen with less than fullscreen resolution in settings 2013-09-02 23:10:32 +02:00
Martin Plicht 41926866cc mac: Remove mouse-warping silliness (it doesn't work with tablets and I'm stupid D:) 2013-07-05 23:14:16 +02:00
Günther Brammer 92a8ca5a79 Crop the background wallpapers instead of stretching them 2013-05-26 17:56:43 +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