Commit Graph

52 Commits

Author SHA1 Message Date
Paul Chote
b2458fc614 Remove GlobalFilesystem.OpenWithExts. Closes #5272. 2015-03-28 12:38:48 +00:00
Paul Chote
a69145caf0 Add a utility command for checking sequences. 2015-03-22 12:48:51 +00:00
Paul Chote
f91ee3fb45 Fix sequence terminology. 2015-03-09 20:45:49 +00:00
Paul Chote
7292bd20b3 Move Sequence parsing into mod code. 2015-03-09 20:45:22 +00:00
Paul Chote
d3783f0244 Introduce ISpriteSequence interface. 2015-03-09 19:19:00 +00:00
Paul Chote
44159ecdd6 Add support for race-specific actor sequences. 2015-03-02 20:46:24 +00:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01: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
RoosterDragon
c2b7d9ca5b Release sheet buffers in SequenceProvider and MapCache.
The buffers in SequenceProvider can be freed if Preload is called, since we know everything is loaded. A SequenceProvider is created for each TileSet is use so this saves memory for however many tilesets had been used in the game. This will be at least one for the shellmap, and often more.

The MapCache loading thread is kept alive for 5 seconds after it last generated a map (in anticipation of more requests). Once this time expires the thread is allowed to die, as it is unlikely there will be more requests in the short term. At this time it is ideal to force the changes to be committed to the texture so we can release the buffer. As well as marking the buffer for release, we must access the texture to force the changes stored in the buffer to be written to the texture, after which the buffer can be reclaimed.

Additionally, when starting the MapCache loading thread we must ensure the buffer is created from the main thread since it may query the texture object which has thread affinity. After that the buffer may be modified freely on the loading thread until released.
2014-11-29 12:04:51 +00:00
RoosterDragon
d671e1de01 Create a separate FrameCache for caching sprite frames.
We split the caching SpriteLoader into a SpriteCache and FrameCache. SpriteLoader instead becomes a holder for static loading methods.

Only a few classes loaded sprite frames, and they all use it with a transient cache. By moving this method into a new class, we can lose the now redundant frame cache, saving on memory significantly since the frame data array can be reclaimed by the GC. This saves ~58 MiB on frames and ~4 MiB on the caching dictionary in simple tests.
2014-10-14 22:06:11 +01:00
Paul Chote
9cf8328979 Add plumbing for mod-defined sprite loaders. 2014-10-07 09:55:49 +13:00
RoosterDragon
3c9f589b5e Move try-catch during creation of sequences into the function rather than around the lazy initialization.
This fixes an issue with VS breaking on the exception because it thinks it will go unhandled, even though it will be handled.
2014-06-24 17:21:41 +01:00
ScottNZ
dbffce81a6 Remove unused usings 2014-06-15 22:16:40 +12: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
Paul Chote
51c5797a42 Avoid a loop closure issue that caused incorrect sequence lookups. 2014-05-24 20:32:42 +12:00
Pavlos Touboulidis
531338a955 Preload sequences and fix #5382 2014-05-22 03:45:28 +03:00
Pavlos Touboulidis
f651cb3677 Final style & rebase fixes 2014-05-17 14:34:52 +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
a845947e0f Minor style & nit fixes 2014-05-17 14:33:17 +03:00
Pavlos Touboulidis
0e15ce1b88 Replace catch(KeyNotFoundException) with TryGetValue() 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
44c01bbaa2 Remove TileSetData and separate TileSet from Sequences 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
693186e1eb Fix caching by making the tileset part of the key 2014-05-17 14:26:54 +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
Paul Chote
8c7f77d2c7 Convert SmudgeLayer to sequences. 2013-12-11 22:53:33 +13:00
Paul Chote
d091789206 Remove sequence warnings for the stable release. Fixes #3142. 2013-05-04 23:20:28 +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
Chris Forbes
55036cd58c fix trailing whitespace everywhere 2011-09-26 08:40:39 +13:00
Chris Forbes
3b2efc7b0b fix #1184 -- useless error message when forgetting to define Render:Image: on a derived actor type 2011-09-24 19:58:34 +12:00
Chris Forbes
e829e4b5aa fix formatting nit in SequenceProvider 2011-09-24 19:57:33 +12:00
Chris Forbes
f6661d5e47 fix sequences being ignored when the only sequences in the mod are provided by a map 2011-09-24 19:57:08 +12:00
Chris Forbes
2063277654 remove dead SaveSequencesForUnit 2011-09-24 19:56:29 +12:00
Chris Forbes
ca81871b7b fix broken merging of yaml overrides in maps; we now have a strict mode and a liberal mode. 2011-04-09 10:55:54 +12:00
Paul Chote
094907c1a9 Update copyright header. Normalize line endings to LF. 2011-02-13 10:38:57 +13:00
Chris Forbes
f032322948 remove System.Xml using from SequenceProvider 2011-01-26 21:07:54 +13:00
Chris Forbes
b7ea695f0c better error when no sequences defined at all 2011-01-26 20:55:23 +13:00
geckosoft
b31a35d34b Changed: Made it possible for maps to contain custom sequences (allowing 100% custom map-specific units to be 'build') 2010-11-21 10:57:16 +13:00
Paul Chote
45d712d390 Fix defaultmod. 2010-09-09 20:31:53 +12:00
Paul Chote
dbbdc171d2 Use the new-format sequences. 2010-09-09 20:31:53 +12:00
Paul Chote
befe22e170 Convert sequences to yaml 2010-09-09 20:31:53 +12:00
Paul Chote
b6b4df703a Shift loadscreen into mods 2010-08-25 20:15:46 +12:00
Paul Chote
b17e6900ec Awesome loadscreen for ra; crashfixes 2010-08-25 20:15:45 +12:00
Paul Chote
9ebdef043c Allow custom/multiple cursor palettes 2010-07-23 14:49:45 +12:00
Paul Chote
7d02a801ad minicursors for minimap.
Bugs: ra doesn't define a sequence for move-blocked-minimap; cursor hotspot is wrong.
2010-07-21 00:26:32 +12:00
Chris Forbes
d5f12dd8ee trim down license spam in all files 2010-07-18 16:48:21 +12:00
alzeih
dc1e36f653 smite some more compile warnings (amended to add minimap changes) 2010-07-12 00:51:58 +12:00
Bob
bd74b29ea3 move projectile effects into mod 2010-07-08 16:04:18 +12:00
Paul Chote
915c9460cf Theater specific artwork done properly 2010-06-28 12:38:35 +12:00
Paul Chote
15a72e893b Quick hack for theater-specific artwork. Should probably be done better; editor support required. 2010-06-28 00:23:58 +12:00
alzeih
8e5a5552c4 Killed a bunch of logging statements 2010-03-18 19:50:11 +13:00