Commit Graph

120 Commits

Author SHA1 Message Date
Paul Chote
ab921682c4 Rewrite yaml merger. 2016-01-30 15:03:56 +00:00
Pavel Penev
8542ed33ce Add ModData.GetLoaders()
Extract sound loaders and sprite loaders creation into a generic method to avoid code duplication.
2015-12-20 19:17:53 +02:00
Pavel Penev
8d56de80ca Add ISoundLoader
The interface is to be implemented by all sound loaders, just like ISpriteLoader. All loading goes through the interface. This would allow mods to create their own sound loaders outside the engine.
Also add a SoundFormats property to mod.yaml, where mods can define what sound loaders they will need.
This requires Game.Sound to be initialized after the ModData is loaded.
2015-12-20 19:17:48 +02:00
Pavel Penev
d08a400565 Add a context argument to package files contructors 2015-12-14 03:42:25 +02:00
Pavel Penev
1b88d24cfa Unstatic GlobalFileSystem and rename it to FileSystem
Add a ModFiles field on ModData and move all access to the file system to go through that.
2015-12-14 03:42:22 +02:00
RoosterDragon
0caffa8196 Remove some global state dependence in ActorInfo.
Instead on relying on the global Game.ModData.ObjectCreator, this is passed in via a parameter.
2015-11-28 17:20:32 +01:00
Paul Chote
c7249e6fa6 Move yaml removals to the end of the merge. 2015-11-28 17:20:32 +01:00
Paul Chote
a074bb1d4b Rename MiniYaml MergeLiberal -> MergePartial, MergeStrict -> Merge. 2015-11-28 17:20:21 +01:00
RoosterDragon
bfe1804bf6 Fix some spellings. 2015-11-27 16:19:59 +00:00
abcdefg30
674b1672f5 Merge pull request #9488 from atlimit8/MapMusic
Map Music
2015-10-18 17:47:26 +02:00
atlimit8
63513af027 Load music after mounting map 2015-10-18 09:53:39 -05:00
reaperrr
95709f1157 Remove obsolete mount hack 2015-09-30 01:56:10 +02:00
Paul Chote
7d62ac2b12 Merge RulesetCache.LoadDefaultRules and LoadMapRules. 2015-07-05 14:58:00 +01:00
RoosterDragon
d2d2f4a838 Made FieldLoader thread-safe, and cache some expensive reflection calls. 2015-04-25 18:55:46 +01:00
Paul Chote
a69145caf0 Add a utility command for checking sequences. 2015-03-22 12:48:51 +00:00
Paul Chote
7292bd20b3 Move Sequence parsing into mod code. 2015-03-09 20:45:22 +00:00
Paul Chote
5552000d69 Allow mods to define custom manifest metadata. 2015-03-07 10:02:42 +00:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
Hellhake
5a97a4b63b Fix StyleCop warnings in OpenRA.Game 2015-01-02 12:11:01 +01:00
Oliver Brakmann
39d13dc654 Merge pull request #7121 from pchote/switchmods
Add Launch.Connect command and on-connect mod switching.
2014-12-24 16:06:00 +01:00
Paul Chote
75b046ae2a Reorganize cursor plumbing in preparation for hardware cursors. 2014-12-23 22:09:22 +13:00
Paul Chote
ec7a32184e Move the mod-level initialisation code back into the load screen. 2014-12-23 09:20:19 +13:00
RoosterDragon
9cbac2d5e1 Clean up style of files affected by the last commit. 2014-12-22 17:34:02 +00:00
RoosterDragon
f0f02dff5c Dispose of graphics resources deterministically.
Textures, FrameBuffers and VertexBuffers allocated by the Sdl2 Renderer were only being released via finalizers. This could lead to OpenGL out of memory errors since resources may not be cleaned up in a timely manner. To avoid this, IDisposable has been implemented and transitively applied to classes that use these resources.

As a side-effect some static state is no longer static, particularly in Renderer, in order to facilitate this change and just for nicer design in general.

Also dispose some bitmaps.
2014-12-22 17:34:01 +00:00
Paul Chote
9cf8328979 Add plumbing for mod-defined sprite loaders. 2014-10-07 09:55:49 +13:00
RoosterDragon
3a30748f05 Reduce working set by releasing buffers for sheets.
Sheets carry a managed buffer of data that allows updates to be made without having to constantly fetch and set data to the texture memory of the video card. This is useful for things like SheetBuilder which make small progressive changes to sheets.

However these buffers are often large and are kept alive because sheets are referenced by the sprites that use them. If this buffer is explicitly null'ed when it is no longer needed then the GC can reclaim it. Sometimes a buffer need not even be created because the object using the sheet only works on the texture directly anyway.

In practise, this reduced memory consumed by such buffers from ~165 MiB to ~112 MiB (at the start of a new RA skirmish mission).
2014-07-02 17:25:56 +01:00
RoosterDragon
2e992a7310 Changed MiniYaml.NodesDict property into a method.
Method is now called ToDictionary.
- Cached a few invocations into locals which should prevent some redundant evaluation.
- Added ToDictionary overloads that take projection functions for the keys and elements, since several callsites were doing a subsequent Linq.ToDictionary call to get this.
2014-06-09 17:06:42 +01:00
Pavlos Touboulidis
531338a955 Preload sequences and fix #5382 2014-05-22 03:45:28 +03:00
Pavlos Touboulidis
ca44be7b2e Only update the loading screen from the main thread
Fixes the crash experienced by pchote. It's a hack but it's easy
to get rid of and it will have to do for now, until the messy
LoadScreen gets fixed.
2014-05-17 14:33:17 +03:00
Pavlos Touboulidis
750fc4e02c Merge ModRuleset and MapRuleset into Ruleset 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
63ec6d60e7 Refactoring to remove static Rules & SequenceProvider 2014-05-17 14:32:03 +03:00
Pavlos Touboulidis
2b3d5f1544 Better caching for Rules and Sequences
Refactored the Rules and SequenceProvider classes to be parts of ModData and
maintain a cache of the instances used in the mod.

The caching reduced the load times a lot, especially after the first load.
Some lazy loading in sequences also helped lower the startup time..

Note: The static classes were left behind to redirect the existing code's
calls.
2014-05-17 14:26:53 +03:00
Pavlos Touboulidis
603dd1d866 Style fixes 2014-04-24 13:46:06 +03:00
Pavlos Touboulidis
60732bd9bd Repurpose unused Timer.cs and add some loading perf metrics 2014-04-23 01:58:30 +03:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00
Paul Chote
37101ba88e Isolate gameplay map state from the map cache. Fixes #4937. 2014-03-22 13:03:45 +13:00
Paul Chote
c30b18a9d6 Introduce MapCache and MapPreview for improved UI map previews. 2014-03-16 21:45:59 +13:00
Matthias Mailänder
4ce31f39c6 lint check maps, too
closes #4187
2014-03-12 19:05:55 +01:00
Paul Chote
bd334a6295 Introduce a mod/map upgrade tool. 2013-12-26 19:58:23 +13:00
Paul Chote
6406e1d052 Allow mods to define a list of compatible map sources. Fixes #4319. 2013-12-19 14:44:20 +13:00
Matthias Mailänder
5794e69d52 enforce Map.RequiresMod so we don't get suprised by breakages 2013-12-08 10:46:55 +01:00
Paul Chote
510e812c02 Bump the map format 5 -> 6.
Version 6 ensures that maps define RequiresMod.
2013-12-08 11:18:58 +13:00
Paul Chote
f5f6f1e7aa Allow maps to be saved during initialisation. 2013-12-08 10:38:35 +13:00
Paul Chote
f153516151 Introduce proper support for non-shp sprites in cursors and ShpImageWidget. 2013-12-01 09:47:48 +13:00
Paul Chote
6d6d1e230b Remove runtime mod merging. Closes #3421. 2013-11-15 09:54:42 +13:00
ScottNZ
1394c1dcee Remove some misc redundancies 2013-11-12 19:39:39 +13:00
ScottNZ
00ec1ca87a Remove unused usings 2013-11-12 19:39:33 +13:00
Matthias Mailänder
74692bde66 load maps only from MapFolders defined separately in mod.yaml 2013-10-27 09:22:10 +01:00
Matthias Mailänder
c87c4cfda2 translate ^ and ~ as FileSystem.Mount does 2013-10-27 08:02:05 +01:00
Matthias Mailänder
32851e624c specify map folders in mod.yaml
closes #3544
2013-10-27 08:02:05 +01:00