Commit Graph

3009 Commits (Controls)

Author SHA1 Message Date
David Dormagen ac738735b2 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/Vehicles.ocd/Airplane.ocd/Script.c
	src/game/C4Game.cpp
	src/game/C4GraphicsSystem.cpp
	src/gamescript/C4GameScript.cpp
2015-09-02 08:19:34 +02:00
Sven Eberhardt 43165e24cd Change C4AbstractApp:SetVideoMode spatial resolution parameters to signed int.
The magic value -1 is used to denote "current screen mode", but it has trouble fitting into the unsigned concept. An alternative would be to use 0 as the magic value, but that would include quite a few places (including existing configuration settings) to change.
2015-09-01 22:51:32 -04:00
Sven Eberhardt 7d9f7aee02 Fix some unused variables and integer type conversions. 2015-09-01 22:18:39 -04:00
Sven Eberhardt e5814f8841 Silence some spurious compiler warnings about partially initialized structures. 2015-09-01 21:37:16 -04:00
Sven Eberhardt 15a1a62521 Automatically deduce shift state in combo keys with Control/Shift combo. 2015-09-01 19:11:13 -04:00
Peter Wortmann 38806f4c0b Define left + right control for Mac
Higher wizardry.
2015-09-01 19:11:31 +01:00
Sven Eberhardt 0b37c96490 Fix Windows builds.
Removed some leftover gamma ramp functionality from Win32 AbstractApp.
2015-09-01 08:20:34 -04:00
Sven Eberhardt 95baaa7934 Enable usage of LeftControl, RightControl, LeftShift and RightShift as player control keys. 2015-08-31 20:50:54 -04:00
Tobias Zwick f57bfa089c revert workaround made for #1368, doesn't work on (certain) Intel chipsets. Instead, limit the maximum bone count to 64 so to meet the limit of 1024 uniform components by certain graphics cards (#1285) 2015-08-31 19:28:00 +02:00
Peter Wortmann a45c865be1 Fixed preprocessor for AUDIO_TK != AUDIO_TK_OPENAL 2015-08-31 17:35:08 +01:00
Peter Wortmann 30857e835e Shader gamma implementation
In comparison to the old system, this is a downgrade - instead of being
able to set a full color mapping by gamma ramp, we now get just a value
per colour channel.

Upside is that we do not need to play around with the global gamma ramps
any more, which was arguably the wrong way to do it.

This commit will likely break everything that has been using gamma so far.
2015-08-31 17:35:08 +01:00
Peter Wortmann 6a016f807d Alternate light drawing, v2
This is now a "mix" between the original and the alternate drawing
strategy, hopefully combining its strength. In detail:

1. Intensity of light sources aren't added together anymore. Instead,
   the brightest light source decides end brightness pre-smoothing.

2. For smoothing, we update normals more quickly than brightness. This is
   the main change relative to the first "alternate" version. Actually
   quite embarassing that I didn't think of this solution before %)

This is still a tad busier than what we have currently, simply due to
normals changing around more quickly. On the plus side, Clonk faces
shouldn't go dark anymore while walking, so that's something.
2015-08-31 17:35:08 +01:00
Julius Michaelis 2a9b481087 Add a new variant of vehicle that can be passed from below but be walked on from above. 2015-08-30 22:19:36 +09:00
Sven Eberhardt 3886f76bf3 Do not hang when a C4Value with prop list pointer is not cleared at game end.
Just cause an assertion in debug mode instead.
2015-08-29 13:22:55 -04:00
Sven Eberhardt 7813d87338 Fix prop list leak on game end when a sound with a modifier is currently playing. 2015-08-29 13:20:51 -04:00
Sven Eberhardt 535fc79c0f Silence a few compiler warnings. 2015-08-29 08:33:00 -04:00
Sven Eberhardt ca3ae81658 Play OpenAL sounds in front instead of rear for 5.1 surround setups [Win]. 2015-08-29 07:26:36 -04:00
Sven Eberhardt bc2259d197 MSVC/Apple CMake: Search for alext.h separately and make OpenAL extensions optional if only al.h is found. 2015-08-28 20:11:59 -04:00
Sven Eberhardt 41fd8c38b0 Ignore mission access in editor mode. 2015-08-27 22:19:09 -04:00
Sven Eberhardt da4a45c8a4 Fix mape build. 2015-08-27 21:57:08 -04:00
Sven Eberhardt b73689fc33 Make C4SoundModifier destructor virtual.
It shouldn't matter because the derived classes have no on fields or custom destruction, but silences a warning.
2015-08-27 21:51:10 -04:00
Sven Eberhardt 6ab6a1ac3c Add script interface for some EFX sound modifiers. 2015-08-27 21:44:23 -04:00
Sven Eberhardt d7a0d291e2 Fix 64 bit build. 2015-08-21 15:03:13 -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
Sven Eberhardt 5ec9999d4c Fix crash on global or scenario script reload.
The string table of System.ocg scripts (except the global System.ocg) pointed to nowhere after the initial load phase, but is still required for reload. Added a ref counting option to keep these string tables alive.
2015-08-20 13:15:11 -04:00
Armin Burgmeier 0cdafc278b Transform all mesh data to Clonk reference frame on load
Instead of doing the transformation when drawing a mesh. This allows making
the OpenGL normal matrix more consistent, since it does not include the
Ogre-To-Clonk transformation, and so that the transformation does not need
to be inverted in the shader.

As a side effect, all Attach transformations were updated, since before
they were specified in the OGRE reference frame, not the Clonk reference
frame.
2015-08-18 20:30:20 -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 1827ed53ca Enhance mapscript functions for use with background materials
Add GetBackPixel, GetDefaultBackgroundIndex, GetMaterialTextureIndex, and make
SetPixel accept a background color.
2015-08-18 19:20:36 -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
Nicolas Hake 5ef76d63a9 Log the same shader code as is actually compiled
For whatever reason, the shader code that was passed to the compiler was
different from the code that got written to the shader log. This is a
huge pain in the ass when trying to debug shader errors because the line
information is completely wrong. I assume this decision was a premature
optimization, so I've removed it and we'll now log the exact same code
as the shader compiler sees.
2015-08-16 14:20:50 +02:00
Sven Eberhardt 0d16e67066 Order mat-tex combinations by appearance in texture map instead of by palette index when zooming map to landscape.
This should simplify insertion of new textures at arbitrary drawing orders without reassigning palette indices (the latter would invalidate all old maps).
2015-08-10 00:34:43 -04:00
Sven Eberhardt 134fc2799b Do not remove looping sounds on inaudibility in OpenAL.
This caused some sounds to not play at all when the object was inaudible at the position the sound was initially launched, but then moved into view (e.g. elevator cases or the planes in The Raid).
2015-08-09 21:28:29 -04:00
Sven Eberhardt a45c5afe60 Fix mape build. 2015-08-09 19:41:16 -04:00
Sven Eberhardt d92df758a8 Added pitch parameter to Sound() script function and allow pitch and sound level to be modified for sounds that have already been started.
Sound() called when the instance is already running used to fail. Now, it always succeeds (also for script sync safety) but updates the sound level and pitch parameters. SoundAt has not been modified since it allows creation of multiple concurrent sound instance of the same effect without object context.
2015-08-09 18:40:42 -04:00
Sven Eberhardt 8ca07b7bc4 Fix left/right audio pan in OpenAL build. 2015-08-09 17:36:54 -04:00
Sven Eberhardt 638ed81608 Implement background material controls in Windows editor.
Also removed auto-sort from the material combo boxes (so sky is on top in both) and put true background materials (i.e. sky and tunnel) on top.
2015-08-09 13:36:44 -04:00
Nicolas Hake 8e5aed4bea Update TRADEMARK and add trademark reference to credits (#1370)
I don't like that the FMOD and Clonk trademarks are separated, but we
don't have enough space in the credits screen to do it differently.
2015-08-09 19:20:53 +02:00
Sven Eberhardt 8ec159d755 Remove some unnecessary restrictions from /script message board command (#1369). 2015-08-08 21:52:13 -04:00
Tobias Zwick 20f95bf018 buildfix for MSVC compiler 2015-08-06 20:06:13 +02:00
Armin Burgmeier cd2d525b5b Rename C4Landscape::TRANSPARENT to C4Landscape::Transparent
Some stupid windows header seems to have a #define for TRANSPARENT.
2015-08-04 23:15:52 -04:00
Armin Burgmeier ad57b5a9c9 Fix fill tool in developer mode 2015-08-04 23:15:16 -04:00
Armin Burgmeier 94ce958e4c editor: sort background textures differently than foreground textures
The sort order in the combo boxes depends on the selected material.
2015-08-04 21:39:23 -04:00
Armin Burgmeier 3ec53c2c40 Update GTK+ editor so that one can draw background materials 2015-08-04 21:21:24 -04:00
Armin Burgmeier 08ae643c2c Add a draw mode which shows the background 8-bit surface 2015-08-04 21:21:24 -04:00
Armin Burgmeier 0d806fbcbf Add syntax for drawing background materials with Map.c 2015-08-04 21:21:24 -04:00
Armin Burgmeier 51986b68ef Allow script functions to access background landscape
Add GetBackMaterial() and GetBackTexture(), and allow DrawMaterialQuad to
specify a background mat-tex combination.
2015-08-04 21:21:24 -04:00
Armin Burgmeier 1f6825fb4b Make solidmask not overwrite background material
Also, remove Landscape.SetPix in favor of Landscape.SetPix2
2015-08-04 21:21:24 -04:00
Armin Burgmeier c43ca4ce9a Increase maximum number of material-texture combinations to 255
This is the maximum we can do. One value is reserved for diff / transparency,
and we have 8bpp surfaces.
2015-08-04 21:21:24 -04:00
Armin Burgmeier 56d48f5300 Fix mape 2015-08-04 21:21:24 -04:00