Commit Graph

2033 Commits (e91d4a42789bfa23945bf7c6aeaefdac48d3b1bb)

Author SHA1 Message Date
Nicolas Hake e91d4a4278 Update more various references to clonk.exe 2013-02-03 20:54:34 +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
Sven Eberhardt bf8655ab1d Fix Call() in global context (required for ScheduleCall) 2013-01-31 22:38:16 +01:00
Nicolas Hake d20ee02ad6 Abort SimFlight if no more movement can occur (#914)
In no-gravity situations, SimFlight would enter an endless
loop when trying to project an unmoving object, waiting for
a collision that would never happen.

Similarly, in negative gravity, SimFlight would continue
calculating objects that left the top boundary of the land-
scape, only aborting the simulation once the coordinates
underflowed to values below the landscape.
2013-01-30 14:00:08 +01:00
Armin Burgmeier 2a1ba0f8fe Split the mesh drawing into C4DrawMeshGL.cpp 2013-01-27 23:52:57 +01:00
Günther Brammer 9d34c4e30d gtk: Make the window fullscreen even when not changing the resolution 2013-01-24 19:36:59 +01:00
Günther Brammer 1e67a6fb24 Fix missing mouse cursor in fullscreen without resolution change
The mouse cursor was about the only thing affected by fZoom, and fZoom
should have been always 1 at the moment anyway.
2013-01-24 19:36:59 +01:00
Günther Brammer a62e556b63 Script: Reimplement GameCall in C4Script 2013-01-23 21:36:21 +01:00
Günther Brammer f38670abc3 Script: Functions can shadow global variables
Previously, declaring a global variable could break another script that had
a function with the same name.
2013-01-23 21:36:21 +01:00
Günther Brammer 42608c5209 Remove C4DirectExecScript, use an existing scripthost for the eval function
Since the scripthost isn't used to store the bytecode anymore,
Parse_Expression doesn't modify it anymore. So there is no need for a
temporary one.
2013-01-23 21:36:21 +01:00
Günther Brammer 57c01ac537 Rename C4AulParse::a to C4AulParse::Host and add C4AulParse::Engine
C4AulParse::Host is now only used for local variables and named functions.

Global directexec functions have neither, so they won't need a scripthost
at all anymore.
2013-01-23 21:36:21 +01:00
Armin Burgmeier 682e315ea1 mape: Fix an endless loop when enumerating available drives on Windows 2013-01-22 00:28:42 +01:00
Armin Burgmeier 0d4703e6a8 mape: Change "close window" shortcut from alt+F4 to ctrl+q
Alt+F4 will be caught by the window manager and close the program as
well.
2013-01-20 23:56:00 +01:00
Armin Burgmeier 2dcd26521d mape: Fix directory listing for directories with non-readable files 2013-01-20 22:28:30 +01:00
Günther Brammer 211634cf15 mape: Even more windows fixes 2013-01-20 20:36:51 +01:00
Günther Brammer 414cb8a4c7 gtk: GDK_KEY_* constants require at least GTK+ 2.21.8 2013-01-20 18:41:07 +01:00
Günther Brammer bf12980ccb mape: Further windows compilation fix 2013-01-20 18:39:56 +01:00
Günther Brammer cd19aff059 mape: Correct openclonk file extensions some more 2013-01-20 17:54:27 +01:00
Günther Brammer 78c39530a2 mape: Make group.c compile on windows 2013-01-20 17:53:52 +01:00
Günther Brammer 019ea36ee9 Remove unused C4Object::GetActionByName 2013-01-20 17:25:02 +01:00
Sven Eberhardt 4b189cacd1 Added Scenario [Landscape] FlatChunkShapes. If set to true, all chunks are drawn flat. Useful for scenario editing to fix little holes in your static landscape. 2013-01-20 12:51:33 +01:00
Günther Brammer ce87faaf9e Fix #including a definition that has local variables with proplists
The missing break meant that the freshly created copy of the proplist would
get overwritten by the original, which was thankfully caught and announced
with "internal error: constant proplist has the wrong parent".

Thanks to Zapper for the testcase.
2013-01-18 01:45:06 +01:00
Armin Burgmeier 8be7ff42db Merge branch 'mape' 2013-01-16 21:58:07 +01:00
Günther Brammer 263d944d5c mape: Build with debugrecs enabled 2013-01-16 02:13:38 +01:00
Sven Eberhardt 06e70b7b74 Synchronized EditCursor(De)selection, so you can edit scenarios in network mode and/or record it. 2013-01-15 23:30:23 +01:00
Sven Eberhardt f51a085592 Added object callbacks EditCursorSelection and EditCursorDeselection. Useful to show or hide developer stuff in the editor. 2013-01-15 23:10:25 +01:00
Armin Burgmeier 881ebd4b95 Don't show line numbers for error messages not coming from map generator 2013-01-14 02:25:15 +01:00
Armin Burgmeier 9e4d3d9caf Make C4MapCreatorS2 show line numbers in error messages when parsing from mem 2013-01-14 02:25:15 +01:00
Armin Burgmeier 2cd91a56c4 Add support for algo=script overlays 2013-01-14 02:25:15 +01:00
Armin Burgmeier 0b45ac83cf Make sure not to render map before map size configuration has been read 2013-01-14 02:25:14 +01:00
Armin Burgmeier ab66f3ffd5 Fix overload_materials and overload_textures flag being erroneously set to true
since they are not initialized by C4TextureMap::LoadMap in case
materials and/or textures are not overloaded.
2013-01-14 02:25:14 +01:00
Armin Burgmeier f016b07d47 Handle the unsupportedness of algo=script gracefully
at a later point this logic can be used to load the script file if
algo=script occurs somewhere in the Landscape.txt to be rendered.
2013-01-14 02:25:14 +01:00
Armin Burgmeier c8f9bc4252 Fix function namespacing 2013-01-14 02:25:13 +01:00
Armin Burgmeier 9a6d545f94 Use the OpenClonk version as the mape version 2013-01-14 02:25:13 +01:00
Armin Burgmeier 3849972dfd Fix a crash when the water material appears on the map somewhere 2013-01-14 02:25:13 +01:00
Armin Burgmeier 4aca001152 Fix warning about gtk_container_set_border_width being used with GtkBox 2013-01-14 02:25:12 +01:00
Günther Brammer 36e966ba26 mape: Port to GTK+ 3.0 2013-01-14 02:25:11 +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 aa2f3df779 Make mape link only against the part of the Clonk engine that is needed
and not against the whole engine. This avoids pulling in unnecessary
dependencies like SDL or OpenGL.
2013-01-14 02:25:11 +01:00
Armin Burgmeier 7357125368 Make C4Material.cpp independent of C4Game
This allows compiling and linking with it without pulling in whole
C4Game. This is useful for the mape map editor.

The only place where C4Game was used in C4Material.cpp was in
CrossMapMaterials where the name of the earth material is read from
Game.C4S. The code has been changed such that the earth material name is
now a parameter to the CrossMaterialMap function.
2013-01-14 02:14:39 +01:00
Armin Burgmeier 3420b2a9a2 Move C4ScenarioSection code from C4Scenario.cpp into C4ScenatioSection.cpp
This allows compiling and linking with C4Scenario.cpp without having to
pull in whole C4Game.
2013-01-14 02:14:37 +01:00
Armin Burgmeier bab0e4bb3c Show correct material color in preview 2013-01-14 01:41:22 +01:00
Armin Burgmeier 98c9ec7734 When rendering the generated map in a pixbuf, apply rowstride correctly
Current behaviour could lead to crash in case of non-square images whose
width was not a multiple of 4, i.e. rowstride != width.
2013-01-14 01:41:22 +01:00
Armin Burgmeier e8076221df Return the correct image width of the generated map
Before the rowstride was returned as actual image width
2013-01-14 01:41:22 +01:00
Armin Burgmeier cc4f62a327 Fix a memory leak in mape_texture_map_load_textures() 2013-01-14 01:41:22 +01:00
Armin Burgmeier d2729e17e7 Make average texture color available in mape, and set it from loaded textures 2013-01-14 01:41:22 +01:00
Armin Burgmeier b6bcc0d36e Make a texture's average color able to be set externally 2013-01-14 01:41:22 +01:00
Armin Burgmeier 26143ededc Load the default textures for all materials
so that materials without a proper tex= line are rendered correctly
2013-01-14 01:41:21 +01:00
Armin Burgmeier 8ce4b2472b Honor configured map size correctly 2013-01-14 01:41:21 +01:00
Armin Burgmeier 64c78f1674 Show a thumbnail of the textures in the textures view 2013-01-14 01:41:21 +01:00