Commit Graph

117 Commits (61962fe70abd22a665446cc09fcef163bf0e3862)

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 8d2f2846b5 Fix mac build
Also move some stuff around once again…
2016-10-21 01:25:48 +02:00
Julius Michaelis 5b7c5b48ee Fix mape and mac build
Attempt #1.
2016-10-20 20:36:52 +02:00
Sven Eberhardt 5c965aba2e Fix mape build 2016-06-22 01:47:45 -04:00
Sven Eberhardt b34ae09437 Fix utility builds 2016-06-21 21:48:10 -04:00
Sven Eberhardt a7bd20a927 Fix server and utility build
Adding missing C4DefList::SortByPriority() stub
2016-06-18 10:35:54 -04:00
Nicolas Hake 493c276126 Rewrite header inclusions to #include "path/to/file.h" style 2016-04-03 20:24:42 +02:00
Nicolas Hake 5134a0a0a4 Fix mape build 2016-04-03 20:24:42 +02:00
Nicolas Hake de1d00eb68 Meshes: Enable reload for custom material shaders 2016-04-03 13:37:03 +02:00
Nicolas Hake 735f9cc06b C4Landscape: Pull everything private out of the header
Since LTCG is enabled now, we don't have to define every function inside
the headers for ~xXx super speed xXx~, which means we can strip the
headers down to their bare minimum and reduce interdependencies and
therefore recompilation times by a lot.
2016-04-03 13:24:24 +02:00
Günther Brammer 9dadfba5af Move GlobalNamed.SetNameList call after Link() into Link()
It isn't clear whether that call is necessary since the C4AulScriptEngine
constructor already does this, but it is clear that duplicating the call
all over is a bad idea.
2016-01-25 00:00:58 +01:00
Günther Brammer 27cbdb2177 Remove superfluous mape stubs 2016-01-24 02:09:14 +01:00
Günther Brammer e790d2c327 Remove duplicated stubs for the scriptengine from mape 2016-01-24 02:09:14 +01:00
Günther Brammer 39c2a0e18c gtk: Use glib-compile-resources instead of gdk-pixbuf-csource
Yet another deprecated feature replacement. At least this one makes our
code more concise.
2016-01-11 01:52:49 +01:00
Nicolas Hake 8fc57b69c3 Don't ZeroMem non-POD types
Using memset to initialize non-POD types doesn't work. Or rather, it may
work right now, but will fail when somebody adds a member that relies on
its constructor doing something (like for example any STL container).
Either way it's undefined behavior and needs to go. Furthermore, using
it to reinitialize an object also prevents any dtors from doing their
work when needed.

A new helper function InplaceReconstruct will take an object of nothrow-
default-constructible type, and call the dtor to properly clean up
before placement-new reconstructing the object in the same location.
This is still bad design, but unfortunately removing the Default/Clear
functions from every object currently using them is a herculean task.
2015-11-14 16:43:19 +01:00
Armin Burgmeier ef4ea2d931 Drop support for GTK+ 2
The minimum GTK version is now GTK+ 3.4, which is available since 2012.
It's part of Ubuntu LTS 12.04, and so should be available on any halfway
modern linux distribution.

This should allow getting rid of using deprecated GTK+ API much easier.
2015-10-18 14:45:52 -04:00
Armin Burgmeier 10249d9a87 mape: fix another free/g_free mismatch 2015-10-17 13:20:19 -04:00
Armin Burgmeier ac2be1866f mape: fix an uninitialized variable in mape_disk_view_load_materials 2015-10-17 13:14:36 -04:00
Armin Burgmeier 84015e5eef mape: fix a free/g_free mismatch 2015-10-17 13:12:23 -04:00
Armin Burgmeier 63bff7914e Fix the mape build 2015-10-09 18:43:02 -04:00
Sven Eberhardt cb25282350 Fix mape again. 2015-10-09 14:55:43 -04:00
Sven Eberhardt 675db52e38 Texture shape coverage fix and mape build fix. 2015-10-09 14:49:31 -04:00
Armin Burgmeier 6d226e30ed mape: fix memory corruption when setting filename (#1256) 2015-09-19 11:39:20 -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 20eb0615ee Custom shader for drawing sky
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.
2015-09-12 18:15:34 -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
Sven Eberhardt da4a45c8a4 Fix mape build. 2015-08-27 21:57:08 -04:00
Sven Eberhardt cf940d639b Fix memory leak caused by circular prop list chains.
The shapes library has such pointer chains. The leaks were getting pretty heavy because they included pointers to C4AulFuncs, which kept a lot of parts of the script engine and string tables in memory.
2015-08-20 20:19:38 -04:00
Armin Burgmeier 035cbb01b2 mape: draw mattex indices above 127 2015-08-18 19:37:38 -04:00
Armin Burgmeier 5d047d4e44 mape: Move second texture map read pass before crossmapping materials
Otherwise the default textures are not set correctly.
2015-08-18 19:36:58 -04:00
Armin Burgmeier dfebd7996c Make sure mape loads texture map indices as specified in TexMap.txt
What happens is that mape first loads the TexMap.txt, however adding all the
texmap entries internally fails, because the materials and textures are not
yet loaded. However, mape must first load the TexMap to see if
OverloadMaterials or OverloadTextures are present in it, to know what
materials/textures to actually load.
2015-08-17 21:52:59 -04:00
Sven Eberhardt a45c5afe60 Fix mape build. 2015-08-09 19:41:16 -04:00
Armin Burgmeier 56d48f5300 Fix mape 2015-08-04 21:21:24 -04:00
Armin Burgmeier b8343786b6 Make MapScript create a background map
This removes the last occurence of the IFT flag
2015-08-04 21:21:23 -04:00
Nicolas Hake 0fe248692e Fix mismatched mape function stub
21500a8 changed a function prototype inside C4Landscape but neglected to
change the mape stub to match. Fix this so the build stops failing.
2015-05-09 22:14:40 +02:00
Nicolas Hake 2b332f5a74 Adapt mape to C4Group changes 2015-02-13 20:22:41 +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 166b5de519 Fix mape build 2015-01-15 14:42:22 -05:00
Armin Burgmeier b8fa1dd191 Fix the mape build 2015-01-07 12:28:10 +01:00
Armin Burgmeier 45897241f2 Remove debug logs 2014-10-17 18:28:17 -04:00
Armin Burgmeier 45d090ae37 mape: initialize the landscape pixmaps (#1162) 2014-10-17 18:27:31 -04:00
Armin Burgmeier 6d983e5174 mape: use global texture map
Otherwise certain script functions would only access an empty texture map
2014-10-17 13:22:57 -04:00
Armin Burgmeier a2b7dd9e4b Fix crash in mape when unknown texture is encountered (#1113) 2014-09-28 16:34:41 -04:00
Armin Burgmeier faa9667b66 mape: Add map zoom option 2014-08-24 13:20:23 -04:00
Armin Burgmeier c6216ddef5 mape: Initialize random number generator (#1094) 2014-08-05 09:30:49 -04:00
Armin Burgmeier dbadd3bcbe mape: Show rendering time in statusbar 2014-08-04 16:27:07 -04:00
Armin Burgmeier 7339f7ae8d mape: Re-initialize script engine between renderings
Otherwise there are warnings when the user changes the value of a
constant, since it was initialized with a different value at the
time of the previous rendering.
2014-08-04 16:27:06 -04:00
Armin Burgmeier cee110de34 mape: Set output window size to size of generated map
This is useful when a Map.c script specifies the size of the map.
2014-08-04 16:27:06 -04:00
Armin Burgmeier 0c4bbfaf16 mape: Load the Library_Map script 2014-08-04 16:27:06 -04:00
Armin Burgmeier 428046400d mape: Implement minimalist C4DefList 2014-08-04 16:27:06 -04:00