Commit Graph

156 Commits (7005eae55d8fe61edd21d366894f183595f7c199)

Author SHA1 Message Date
Lukas Werling 7005eae55d Use PCG as random number generator 2016-04-20 22:42:00 +02:00
Lukas Werling abf32cf00b LoadScenarioSection: Allow reloading the current section 2016-04-18 23:03:35 +02:00
Lukas Werling 4a9553bd20 Fix LoadScenarioSection() resetting the Random seed 2016-04-18 22:57:38 +02:00
Nicolas Hake eabca223f5 Update all copyright notices for 2016 2016-04-03 20:24:42 +02:00
Nicolas Hake 493c276126 Rewrite header inclusions to #include "path/to/file.h" style 2016-04-03 20:24:42 +02:00
Nicolas Hake 0537df5f23 C4Object: Move C4Def.h dep out of header
C4Def is only ever used as a pointer inside C4Object.h, so we don't need
to include C4Def.h from it.
2016-04-03 13:24:26 +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
Lukas Werling 9e0143b998 Remove gamepad ids from key codes
We want one gamepad key mapping to work with multiple gamepads, so
including the id there doesn't make sense.

Additionally, the gamepad id may change during the game (controller
hot-plugging).
2016-02-21 18:27:02 +01:00
Lukas Werling 9f69c650d6 Use icons for all controller buttons
The icons currently only show Xbox 360 controller labeling. The icon set
also includes icons for PlayStation controllers, so we could extend this
in the future.
2016-02-21 18:27:02 +01:00
Lukas Werling 24622f3a9c Update main menu GUI gamepad control bindings
It is now possible to control all GUI menus using the left stick or the
dpad, along with the A and B buttons on the controller.

This also doubles the button emulation dead zone to make navigating the
menus with the stick easier.
2016-02-21 18:26:44 +01:00
Sven Eberhardt 439b1f481c Register Objects.c script as global constant to make it accessible from outside 2016-02-06 21:12:22 -05:00
Günther Brammer 03d11cd596 Merge script branch 2016-01-31 21:51:58 +01:00
Maikel de Vries 4bcdfc451e block construction sites based on Exclusive and not on planes (#1534)
This makes more sense, exclusive object block all other construction sites, irrespective of their planes.
2016-01-30 14:46:14 +01: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 68c436576e Simplify construction of C4AulParSets 2016-01-25 00:00:57 +01:00
Günther Brammer 6b6dd96719 Move GameScript.GRBroadCast to Game.GRBroadCast
This avoids a dependency on ::Objects from C4ScriptHost.
2016-01-24 02:09:14 +01:00
Günther Brammer e1a38ee010 Move references to ::Objects and ::MaterialMap from C4AulLink to C4Game
This changes the order in which the various parts of the engine are updated
after a definition reload, but they should not interfere with each other.
2016-01-24 02:09:14 +01:00
Günther Brammer 93f12150c4 CMake: Remove obsolete USE_X11 option and add USE_WIN32_WINDOWS
USE_WIN32_WINDOWS was previously defined in PlatformAbstraction.h. Move it
to CMakeLists.txt and config.h like its peers. Replace USE_X11 with USE_GTK
or GDK_WINDOWING_X11 as appropriate.
2016-01-23 20:36:34 +01:00
Nicolas Hake d737dc1b05 Remove C4Video, StdVideo
Video recording and playback only worked on Windows, and recording only
handled video, not game audio. As such, it was of fairly limited use,
and there's lots of software available these days that handle both.
2015-12-28 11:43:41 +01:00
Nicolas Hake 7475b89bd2 C4MessageBoard: Merge Default/Clear into ctor/dtor 2015-12-28 11:43:40 +01:00
Nicolas Hake 3c625a00dd C4Game: Turn some owned pointers into std::unique_ptr
Using std::unique_ptr instead of raw pointers makes ownership clear and
avoids leaks.
2015-12-28 11:43:37 +01:00
David Dormagen dcfb986e34 moved sounds into subfolders
This completes http://forum.openclonk.org/topic_show.pl?tid=3215
2015-12-13 22:14:55 +01:00
Sven Eberhardt d736b613b3 Keep and compile Objects.c file in savegames #1077
Just don't call the InitializeObjects() function. But the file should be left there because it may contain static variables required in scripts.
2015-12-08 22:22:52 -05:00
Nicolas Hake 96fcf1389a Aul: Make engine not automatically log error summary
Getting the error summary written to the log/console automatically may
be useful for general game usage, but when testing Aul we just end up
with thousands of useless messages in the output. Let the caller log the
message if it's really desired.
2015-12-08 13:17:39 +01:00
Sven Eberhardt 96082569bd Allow sounds in subfolders and create namespaces for them (#1185) 2015-12-06 23:44:41 -05:00
Sven Eberhardt 8c3e61c3da Fix NO_OWNER global sound modifier on savegame resume (#1462) 2015-12-02 20:27:38 -05:00
Nicolas Hake 6738ef1f4c Clear object pointers in inactive objects (#1238, #1452)
Instead of iterating through the main object list twice to check for
pointers, iterate through both the main list and the inactive list.
2015-12-01 23:46:46 +01:00
Nicolas Hake a3b7b66386 Drop "Toggle" helper function
Toggling a boolean is trivial enough to not really warrant a helper
function.
2015-11-15 16:15:25 +01:00
Nicolas Hake 24b54211c5 Drop Min, Max, Swap for std::min, std::max, std::swap
The C++ standard library comes with perfectly fine implementations of
these functions, so there's no point in reimplementing them just for the
hell of it.
2015-11-15 13:53:01 +01:00
Armin Burgmeier 4addc62467 Open Graphics.ocg before reloading a definition (#1428)
We might need to load shader slices when reloading mesh materials.
2015-10-17 19:05:23 -04:00
Sven Eberhardt cc5d43d0b0 Localize loading message for scenario local player control definitions. 2015-10-05 22:38:45 -04:00
Sven Eberhardt 17e0e2f423 Add breaks between music. 2015-09-30 22:50:18 -04:00
Sven Eberhardt 737b1fd8fd Save screenshots in background thread (#998, #1104).
Also ensure music keeps streaming while collecting data for full map screenshot.
2015-09-29 20:48:34 -04:00
Sven Eberhardt 8614ce46c4 Create default ambience controller in all scenarios.
Can be overloaded by providing a custom function InitializeAmbience either globally or in the Scenario proplist.
2015-09-28 20:20:31 -04:00
Sven Eberhardt 59d7c761fc Screenshot fixes and optimizations.
* There was an off-by-one-error causing a blank line at the screen upper screen border.
* Remove ApplyGamma. It is always applied because Gamma is just part of the drawing shaders now.
* Save by copying rows instead of pixels for whole map screenshots.
2015-09-28 18:54:34 -04:00
Sven Eberhardt 1f46a9004c Fix some erroneous file orders causing group rewinds. 2015-09-22 23:47:06 -04:00
Armin Burgmeier b750ac6537 Remove outdated comment 2015-09-22 22:28:38 -04:00
Armin Burgmeier f4a87d5d2f Fix image aspect of meshes embedded in messages (#1380) 2015-09-22 22:26:12 -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
Sven Eberhardt 73a42fef92 Suppress warning messages for undefined fields when returning to main section in LoadScenarioSection. 2015-09-14 23:01:09 -04:00
Sven Eberhardt e3213812a9 Implement GetStartupTeamCount() script function (#1246).
Returns number of teams containing active players at game start.
2015-09-06 23:29:22 -04:00
Sven Eberhardt c22157c04b Simplified implementation of StartupPlayerCount.
Setting it by player filenames in the beginning is not necessery (and wrong for invalid files). Also copying it through C4S.Head didn't serve any purpose because PlayerInfo is synchronized in network and replays and startup player count can be deduced from that.

Tested in standalone, network, savegames, runtime join and replays from standalone, savegames and runtime join (Some replays of network games were bugged but that's an unrelated error).
2015-09-06 22:31:04 -04:00
Sven Eberhardt 0ceda6734b Fix memory leak in TextureMap initialization.
The Default call from C4Game is issued before construction of all members, which causes a memory leak when TextureMap is actually constructed.

Just merge Default() into Clear(). The separation into two calls serves no other purpose than putting the class into an inconsistent state between them.

It actually does that in almost all other subclasses as well but they don't allocate memory.
2015-09-04 21:49:36 -04:00
Sven Eberhardt 0b308e75fe Remove duplicate sound system initialization. 2015-09-03 23:47:41 -04:00
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 15a1a62521 Automatically deduce shift state in combo keys with Control/Shift combo. 2015-09-01 19:11:13 -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
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
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 41fd8c38b0 Ignore mission access in editor mode. 2015-08-27 22:19:09 -04:00