Commit Graph

337 Commits (e3017ba4ac67cc004271b74af5ceab9af83bb5aa)

Author SHA1 Message Date
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
Günther Brammer bc45d417a9 Remove some dead blitting code 2013-05-25 14:47:54 +02:00
Armin Burgmeier 90fbabd20f Implement depth_check for material scripts 2013-03-31 17:14:13 +02:00
Sven Eberhardt 57e63a5275 Added support for scripted maps (Map.c) and documentation. 2013-03-19 00:36:06 +01:00
Julius Michaelis 06d4db2d72 Remove need for freetype and jpeg libraries building with USE_CONSOLE 2013-03-03 15:22:48 +01:00
Nicolas Hake d518669abc CPNGFile: Reduce global state
This changes a global variable to an instance variable in order to make
the CPNGFile class usable from multiple threads, as long as each thread
uses its own instance of the class.
2013-02-19 03:09:17 +01:00
Armin Burgmeier 55e9fc2717 Don't rethrow catched errors when compiling a shader
Just mark the technique as not available, if there are no available
techniques the material will not be loaded.
2013-02-12 22:40:30 +01:00
Armin Burgmeier 3bbf1314df Make sure not to use integers in generated shader code (#920) 2013-02-12 22:39:56 +01:00
Armin Burgmeier eb4a1f7884 Query the shader type with the correct command
GL_OBJECT_TYPE_ARB tells whether the object is a program or a shader,
whereas GL_OBJECT_SUBTYPE_ARB tells whether it is a fragment or a vertex
shader.
2013-02-12 22:39:05 +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
Armin Burgmeier 2a1ba0f8fe Split the mesh drawing into C4DrawMeshGL.cpp 2013-01-27 23:52:57 +01:00
Armin Burgmeier e7be3dc32d Remove some additionally introduced includes and forward declarations
they are no longer needed, the code compiles just fine without.
2013-01-14 02:25:11 +01:00
Armin Burgmeier 257db99165 Merge remote-tracking branch 'new/master' into mape
Conflicts:
	CMakeLists.txt
	src/graphics/C4Draw.h
2013-01-14 01:38:03 +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
Armin Burgmeier c3c148d53a Add CreateParticleAtBone script function 2012-12-29 00:06:30 +01:00
Günther Brammer 7967d94a59 Merge StdFont.cpp and C4Fonts.cpp 2012-11-12 02:30:16 +01:00
Günther Brammer a5b83665af Store all channels of a color together in CStdPalette
This mostly simplifies things, since most other places use an 32 bit
integer to store colors, but might even improve performance through better
cache locality.
2012-08-16 00:45:27 +02:00
Armin Burgmeier db31b53b6c Use floating point numbers for C4Facet coordinates
This fixes the lightbulb symbol from floundering around back and forth when
zoomed in and scrolling. Since C4Facets can be used to specify a target area
to draw into (such as in C4DefGraphics::Draw), and since this area can be
zoomed, sub-pixel precision can be achieved this way in such drawing
operations.
2012-10-28 15:33:58 +01:00
Armin Burgmeier 7c46cfb110 Fix the "Error at graphics file Cursor" error when moving around the window
or tabbing in/out, or changing its size.
2012-10-13 20:06:15 +02:00
Martin Plicht 38256bfaac mac: First startup with no resolution configuration uses desktop resolution, resolution switching from options works correctly 2012-10-13 15:01:13 +02:00
Martin Plicht 562565f865 mac: Move C4OpenGLView.mm/h to graphics/C4DrawGLMac.mm/h and move some C4AbstractApp functions to C4AppMac.mm to better match implementations for the other platforms 2012-09-02 20:51:43 +02:00
Martin Plicht f6825d073e mac: Compile with Automatic Reference Counting enabled 2012-09-02 13:56:53 +02:00
Günther Brammer cc25878ba6 Default to not changing the resolution
1. We receive bugreports that changing the resolution doesn't work, but
can't reproduce that
2. Flat screens look best at their natural resolution
2012-08-19 20:59:01 +02:00
Günther Brammer 692fb103f1 DrawVertex uses thinner lines for the cross 2012-06-08 16:19:36 +02:00
Günther Brammer a528b0d76e Silence some g++ warnings 2012-06-15 18:16:49 +02:00
Günther Brammer 6928332a0a Win32: Don't log things before retrieving GetLastError()
That just makes GetLastError return 0 - The operation completed successfully.
2012-06-06 17:13:51 +02:00
Günther Brammer 4c35c34ca4 Win32: Report GetLastError on OpenGL error 2012-06-06 16:49:40 +02:00
Armin Burgmeier e8a7dc0478 Fix a crash when rendering an untexturized mesh 2012-05-05 23:04:35 +02: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