The GTK and OS X platforms already ignored the requested bit depth and
always used 32 bit. Windows and SDL would set a 16 bit color depth for
the screen, but still did all of the rendering short of the final
present in 32 bit.
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.
Add a C4ShaderCall parameter to tho most important drawing functions, and
make C4DrawGL's CreateSpriteShader public with additional parameters to
specify additional defines and shader slices. C4Sky uses this to compile its
own shader with OC_SKY defined.
Instead of one draw call for each tile, do the whole operation with a single
draw call by setting GL_REPEAT on the texture. This affects sky, the upper
board and the background.
This also allows to remove some code that was making sure surfaces are big
enough.
In comparison to the old system, this is a downgrade - instead of being
able to set a full color mapping by gamma ramp, we now get just a value
per colour channel.
Upside is that we do not need to play around with the global gamma ramps
any more, which was arguably the wrong way to do it.
This commit will likely break everything that has been using gamma so far.
Instead of doing the transformation when drawing a mesh. This allows making
the OpenGL normal matrix more consistent, since it does not include the
Ogre-To-Clonk transformation, and so that the transformation does not need
to be inverted in the shader.
As a side effect, all Attach transformations were updated, since before
they were specified in the OGRE reference frame, not the Clonk reference
frame.
This should improve cache coherency by having all surface tiles adjacent
instead of strewn across the heap. This will also remove an indirection
in the common case of only using one tile.
With this change, an additional rectangle is stored in C4FoWRegion that
represents the area covered by the viewport in fractional floating point
coordinates. This allows the light texture to be created for an arbitrary
portion of the landscape, and the coordinate transformations for the
shaders will still work.
Also, since the additional rectangle uses floating point precision, the
computed coordinate transformations do now give the exact same result as for
the landscape pixel-by-pixel, and there should not be any offsets left.
I also hope that this change improves or fixes the single-pixel-lines of sky
that are sometimes seen at the edges of the viewport.
There were two problems with the previous transforms:
1) For inverting the Y axis for the ambient map, the total height of the
output window is needed, not only the viewport region.
2) The Y offset to only use the part of the light texture that is being
rendered to was not applied.
In order to keep the transformations more readable, a new lightweight class
C4FragTransform has been introduced which can only handle translations
and scales in x and y.
Since we're no longer using DirectX, nVidia's automatic detection no longer works classifies OpenClonk as a game to use the high performance GPU. Note that this flag does not work on some old drivers (version<302 according to specs). To support these old drivers, we would have to link against DirectX despite not using it.
This doesn't fix material preview in editor mode yet but at least there's no more assertion. We should probably create a proper render target surface for that.
This will allow to avoid some code duplication when computing the coordinate
transform from fragment coordinates to ambient and light texture coordinates.
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.
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.
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.
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.
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.
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.
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.