Commit Graph

25 Commits (ebda8193ef6855e6df19332b75380d8061e889e7)

Author SHA1 Message Date
Sven Eberhardt ebda8193ef Replace NULL by nullptr in C++ sources
We don't support pre-C++0x any more, so nullptr should be fine everywhere (except in the plain C source files)
2016-11-02 19:58:02 -04:00
Julius Michaelis 376ca5a9df Prevent using USE_CONSOLE in lib{misc,c4script} 2016-10-22 17:42:23 +02:00
Nicolas Hake eabca223f5 Update all copyright notices for 2016 2016-04-03 20:24:42 +02:00
Nicolas Hake 493c276126 Rewrite header inclusions to #include "path/to/file.h" style 2016-04-03 20:24:42 +02:00
Nicolas Hake 64a5388d4d C4Surface: Remove broken "support" for split textures
Most code already didn't handle textures larger than GL_MAX_TEXTURE_SIZE
and only used the first one in case of a split texture.
2016-02-08 17:36:50 +01:00
Nicolas Hake 7b04914fc4 C4Surface: Make dbg_index unsigned int instead of int*
It seems like an odd decision to add a layer of indirection to this,
especially since it's just a pointer to int instead of a pointer to a
larger structure.
2016-02-08 17:36:50 +01:00
Nicolas Hake 059e9e7060 C4Surface: Explicitly mark copy ctor/assignment op deleted 2016-02-08 17:36:50 +01:00
Nicolas Hake 4fdafbc78a Move StdColors.h ref from C4Surface.h to files that actually need it
C4Surface.h doesn't require anything from StdColors.h, so there's no
reason to reference the latter there.
2016-02-08 02:13:18 +01:00
Günther Brammer 23d34f75ec Remove some dead graphics code 2016-02-06 23:46:58 +01:00
Nicolas Hake e9cf0f6fdc Stop pretending we support 16 bit color
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.
2016-02-02 00:00:23 +01:00
Günther Brammer d09ed41eea Avoid an OpenGL dependency in C4Surface.h 2016-01-23 20:36:33 +01:00
Günther Brammer fd61ac7ebe Remove unused IsRenderTarget and MaxTextureSize C4Surface options
They were always false and 0.
2016-01-17 11:37:17 -08:00
Armin Burgmeier 795740c6ee C4Surface: fix texture restore on IntUnlock (#1526) 2016-01-01 14:48:33 -08:00
Armin Burgmeier c043795552 Fix memory leak in FoW surfaces
Surfaces are initially created in locked state, and only when unlocked the
memory buffer with the surface data is uploaded to the GPU. The FoW code
however never unlocks the surface but instead operates on the OpenGL texture
directly. To fix this, introduce a new flag for C4Surface to create it in an
unlocked state.

This is not a memory leak in the traditional sense as a pointer to the buffer
is still available and is being freed when the surface is being destructed
at the end of the game. However, during the game there might be several
megabytes allocated that are never used.

I'm not really sold by this Lock/Unlock mechanism. Instead, there should
simply be a function to obtain the current texture data, and a function to
upload new texture data. That's for another time though...
2015-12-31 18:40:38 -08:00
Sven Eberhardt 737b1fd8fd Save screenshots in background thread (#998, #1104).
Also ensure music keeps streaming while collecting data for full map screenshot.
2015-09-29 20:48:34 -04:00
Sven Eberhardt 59d7c761fc Screenshot fixes and optimizations.
* There was an off-by-one-error causing a blank line at the screen upper screen border.
* Remove ApplyGamma. It is always applied because Gamma is just part of the drawing shaders now.
* Save by copying rows instead of pixels for whole map screenshots.
2015-09-28 18:54:34 -04:00
Armin Burgmeier fd285f6656 Create mipmaps only for static textures that are expected to be zoomed
Hopefully fixes #1403.
2015-09-18 21:10:39 -04:00
Armin Burgmeier e0d7d44948 Optimize drawing of tiled surfaces
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.
2015-09-12 16:11:50 -04:00
Nicolas Hake 72beae8100 Shortcut C4Surface::GetTexAt for unsplit texture
In the very common case where the C4Surface only uses a single texture
to store its data, a lot of work GetTexAt is actually unnecessary. Split
it up so we can inline the fast path and only fallback to the slow path
when the surface is split up into multiple textures.
2015-02-22 17:06:35 +01:00
Nicolas Hake fef96eca9c Replace C4Surface::ppTex by a vector
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.
2015-01-18 22:59:44 +01:00
Armin Burgmeier 137abb89df Implement normal maps for sprite graphics 2014-11-07 15:29:09 -05: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
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
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