Commit Graph

19 Commits

Author SHA1 Message Date
Matthias Mailänder
50ab941d1f avoid NullReferenceException in updatedRegion
fixes #6166
2014-08-12 06:19:34 +02:00
RoosterDragon
a512d9ad0a Sped up shroud rendering.
- Only update shroud within the visible screen area, rather than the whole map. This improves performance on larger maps significantly when scrolling around since large portions of the shroud do not need to be updated.
- Provide methods in Shroud to return delegates to check for explored/visibility for tiles within a certain region. This allows it to return more efficient delegates whenever the region is within the map bounds, or shroud/fog is disabled. In the typical case where the region is in bounds and shroud/fog is enabled, the fast check is almost twice as fast as the slow check.
- Use the Shroud delegate functions in shroud rendering, frozen actors, minimap rendering and resource layer areas to provide a speedup since these areas of code can often take advantage of the fact they perform checks within the map boundary.
- Cache current element in CellRegionEnumerator to prevent repeated work if the element is accessed more than once.
- Decrease the size of elements in some arrays in hopes of reducing memory needs and improving cache hits.
2014-07-07 17:34:31 +01:00
RoosterDragon
2351c43237 Refactoring pass.
- Extract an enum for edges rather than using magic numbers for everything.
- Remove duplicated code between FoggedEdges and ShroudedEdges by hosting the visibility function into a delegate.
- Make minimap methods more readable.
- Tidy formatting.
- Make some fields readonly.
- Remove unused usings.
2014-07-07 17:34:25 +01:00
Paul Chote
0d625b6af6 Fix sprite overlap outside the map border. 2014-07-01 00:40:42 +12:00
Paul Chote
af0e948a67 Use map.Contains for the observer shroud check.
Checking against the bounds directly is no longer valid.
2014-06-30 11:24:41 +12:00
Matthias Mailänder
7fa51712ec Merge pull request #5758 from pchote/cell-world-conversions
Generalize cell/world coordinate conversions.
2014-06-28 08:27:18 +02:00
Matthias Mailänder
e9ee4a1e15 Update ShroudRenderer.cs
fix typo
2014-06-27 13:30:57 +02:00
Paul Chote
7b52fa52b6 Replace CPos.CenterPosition -> Map.CenterOfCell. 2014-06-27 23:30:40 +12:00
Paul Chote
8f046c7c5a Support split sprites for fog/shroud. 2014-06-27 22:28:33 +12:00
Paul Chote
8c4dcb7fe0 Configurable ShroudRenderer palettes and readonly state. 2014-06-27 22:28:33 +12:00
Paul Chote
baf27bc4cd Use CellLayers for shroud. 2014-06-27 22:07:02 +12:00
ScottNZ
dbffce81a6 Remove unused usings 2014-06-15 22:16:40 +12: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
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00
Paul Chote
0143e8bfb8 Support rectangular tiles. 2013-12-29 14:16:20 +13:00
Paul Chote
e424d7c6c1 Always initialise the fog palette. Fixes #4297. 2013-12-13 17:49:31 +13:00
Paul Chote
4d70996012 New shroud renderer. Fixes #2162. Fixes #3024. Fixes #4034.
Uses the original tile sprites in C&C and D2K and uses a smoother transition in all mods.
2013-12-11 20:51:49 +13:00
Paul Chote
4e814a8c2e Move ShroudRenderer into a trait. 2013-12-11 19:22:55 +13:00