Commit Graph

36 Commits

Author SHA1 Message Date
Paul Chote
2915db67c4 Add depth buffer support to sprites and sequences. 2016-04-15 09:42:29 -04:00
Paul Chote
e71225496b Clarify GPL version. 2016-02-21 16:30:48 +00:00
Paul Chote
b396965fd9 Update licence header year. 2016-02-21 16:27:31 +00:00
Paul Chote
b347fade71 Use IReadOnlyFileSystem in artwork loaders. 2016-02-18 18:12:31 +00:00
RoosterDragon
8e89a6a696 Simplify names, remove unused usings, remove redundant casts. 2016-01-17 21:35:36 +00:00
Pavel Penev
0e417a3cf3 Rename MapGridType.Rectangle to MapGridType.Rectangular 2015-10-26 00:41:26 +02:00
Pavel Penev
bb3aea338a Rename enum TileShape to MapGridType 2015-10-26 00:41:21 +02:00
Paul Chote
3665d8f19b Send TS terrain depth data to the GPU. 2015-10-17 22:35:07 +01:00
Paul Chote
e819ff832b Record the SheetType in each Sheet. 2015-10-17 22:28:19 +01:00
Paul Chote
038847cc4c Force the first template variant in TTPW. 2015-05-15 17:08:32 +01:00
Paul Chote
84e85d8a5d Rename Image -> Images. 2015-03-30 20:20:36 +01:00
Paul Chote
4be5334a0e Add support for TS-style random tile variants. 2015-03-30 19:44:53 +01:00
Paul Chote
b2458fc614 Remove GlobalFilesystem.OpenWithExts. Closes #5272. 2015-03-28 12:38:48 +00:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
Matthias Mailänder
bc3acfeee7 StyleCop clean OpenRA.Game 2015-01-04 15:38:54 +01: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
RoosterDragon
ff16690b86 Lazily generate buffer in Sheet.
The managed byte buffer is created on demand, meaning a newly allocated sheet will not waste memory holding onto the buffer until some changes are actually required to be written. This avoids a newly allocated sheet wasting memory on buffers that do not differ from their backing texture.
2014-11-29 12:04:00 +00:00
Paul Chote
f0eee47e68 Introduce TerrainTemplatePreviewWidget. 2014-11-05 09:39:55 +13:00
Paul Chote
63f5fc8613 Work around the undesired R8 terrain sprite offsets. 2014-11-05 09:39:55 +13: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
Paul Chote
7207841f8b Use the existing SpriteLoader cache for tilesets. 2014-10-07 09:55:48 +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
Paul Chote
997216aef0 Use CellLayer for terrain. 2014-06-27 22:07:02 +12:00
ScottNZ
dbffce81a6 Remove unused usings 2014-06-15 22:16:40 +12:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00
Paul Chote
314f819940 Load terrain from any SpriteSource. 2013-12-01 09:49:25 +13:00
Paul Chote
e4fe2b49f4 Make terrain tiles ISpriteSources. 2013-12-01 09:48:42 +13:00
Paul Chote
f92ce8bf51 Define a consistent interface for sprite loading. Fixes #4176. 2013-12-01 09:47:49 +13:00
ScottNZ
00ec1ca87a Remove unused usings 2013-11-12 19:39:33 +13:00
Matthias Mailänder
ba13c1d982 StyleCop clean Map/*.cs files 2013-08-25 14:30:00 +02:00
Paul Chote
5cb79283be Use uppercase extensions to support case-sensitive filesystems. 2013-08-17 20:01:24 +12:00
Paul Chote
608ca31f6d Support .r8 tileset artwork. 2013-08-15 19:28:55 +12:00
Paul Chote
7278739e45 Allow tilesets to specify their sheet size.
Decreased the default size from 4096 to 512.
2013-08-15 18:05:34 +12:00
Paul Chote
387ac04d9f Split tileset artwork loading out of TileSet.
This simplifies terrain loading and allows for
non-square tiles in game.

The editor still relies on the old code for now.
2013-08-14 23:08:17 +12:00