Commit Graph

152 Commits

Author SHA1 Message Date
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
ScottNZ
6598f0382a Add support for game translation 2013-10-14 19:38:18 +13:00
Matthias Mailänder
452342f289 StyleCop clean ModData 2013-08-07 15:52:29 +02:00
Paul Chote
82faf7e929 Allow mods and maps to define voxel sequences. 2013-06-04 20:40:24 +12:00
Paul Chote
a00696ec3b Add core voxel rendering code. 2013-06-04 20:40:24 +12:00
Paul Chote
0dd8d7f7b6 Distinguish between classic and crc file hashes. Fixes #3306, #3328. 2013-05-24 21:10:41 +12:00
Matthias Mailänder
6a6776754b added .mix file support for game asset browser 2013-05-15 18:13:39 +02:00
Paul Chote
4ebe547a05 Allow SheetBuilder to generate 1/2/4 channel sheets.
This makes the SpriteFont RBGA sprite hack explicit,
and adds a DualIndexed option to be used by the voxel
renderer.
2013-05-15 20:18:41 +12:00
Curtis Shmyr
f40fbaf35e Merge pull request #3134 from chrisforbes/load-time
avoid spurious re-indexing of maps just prior to shellmap load
2013-04-20 16:58:48 -07:00
Chris Forbes
8750f04f4c avoid spurious re-indexing of maps just prior to shellmap load 2013-04-21 11:38:24 +12:00
Matthias Mailänder
3649342317 be more verbose about missing sequences and files
as requested in #3039
2013-04-20 21:56:29 +02:00
Paul Chote
82426e0e45 Move Palette from ModData to WorldRenderer. 2013-02-26 09:35:41 +13:00
Chris Forbes
d57dfd1997 tidy 2011-12-27 21:23:25 +13:00
Chris Forbes
bc6af1841b fix indents everywhere 2011-10-18 15:10:17 +13:00
Chris Forbes
f9eb62beee tidy uid->map lookup in ServerBrowser implementations 2011-09-26 08:40:40 +13:00
Chris Forbes
55036cd58c fix trailing whitespace everywhere 2011-09-26 08:40:39 +13:00
Chris Forbes
896cbaae39 clean up ModData package mounting 2011-08-21 20:26:00 +12:00
Chris Forbes
1fe5c1d60f catch map load failures 2011-08-20 14:13:52 +12:00
Chris Forbes
3d2635fca5 drop CursorSheetBuilder; use normal SheetBuilder for cursors now. 2011-07-19 21:14:11 +12:00