Commit Graph

106 Commits (d3428003a817016d4e129f862462ac87829c16a9)

Author SHA1 Message Date
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
Armin Burgmeier 4267d07616 mape: Also load syntax highlighting from current directory and repository 2014-08-04 16:27:06 -04:00
Armin Burgmeier 08cdf0e301 mape: Initialize script engine only once instead of per-rendering 2014-08-04 16:27:05 -04:00
Armin Burgmeier bac7a89ce1 mape: Make sure error messages from the linker are shown 2014-08-04 16:27:05 -04:00
Armin Burgmeier d32eb98ee1 mape: Fix crash when InitializeMap() returns false 2014-08-04 16:27:05 -04:00
Armin Burgmeier cd388ba178 mape: Add syntax highlighting for Map.c files 2014-08-04 16:27:05 -04:00
Armin Burgmeier afa32381ad mape: Default to the new map generator
Only use the C4MapCreatorS2, when the file is called "Landscape.txt".
2014-08-04 13:04:35 -04:00
Armin Burgmeier ade34f5efe mape: Add interface to run the new script map generator 2014-08-04 13:04:35 -04:00
Armin Burgmeier f25ec83568 Link C4MapScript into mape
Remove the two dependencies to ::Game from C4MapScript, so that ::Game
does not need to be linked into mape, which would basically drag the
whole rest of the engine after itself.
2014-08-04 13:04:35 -04:00
Armin Burgmeier 92720cf490 Allow C4ScriptHost to load a script from memory
This will allow mape to feed the Map.c that is being edited directly to
the map generator.
2014-08-04 13:04:34 -04:00
Armin Burgmeier 42c1826935 mape: Don't hold the GDK thread lock (#1091)
The lock was from times when the GTK+ widget was updated directly
from the render thread, but this is not the case anymore, so it
can be removed without substitution.
2014-08-03 12:44:02 -04:00
Günther Brammer 22016e075f Replace some usages of C4ID with C4Def*
In particular those that made the c4script shell depend on C4Id.cpp.
2014-04-19 19:02:22 +02:00