Commit Graph

85 Commits

Author SHA1 Message Date
RoosterDragon
c37a691c33 Convert some keys users of CellLayer to index via map-coords for efficiency. 2014-12-20 23:39:03 +00:00
Paul Chote
5e402e95cb Update only dirty radar pixels and refresh every tick. 2014-12-04 21:18:45 +13:00
obrakmann
022c1ae4d1 Merge pull request #6310 from pchote/shroud-reset-fix
Fix shroud hash updating.
2014-08-23 10:43:56 +02:00
Paul Chote
531e3cfaf3 Fix shroud hash updating. Fixes #6308.
This ensures that multiple Invalidations() in one tick will each update the shroud rendering.
2014-08-23 15:25:39 +12:00
Paul Chote
2acfc23f18 Account for map edges in Shroud.IsExploredCore. 2014-08-23 10:54:01 +12:00
Paul Chote
80c4870a0f Don’t clear shroud outside the map. Fixes #6097. 2014-08-23 09:53:27 +12:00
Paul Chote
1d77cd5391 Merge pull request #5851 from RoosterDragon/shroud-perf
Speed up shroud checks
2014-07-23 11:02:27 +12:00
Matthias Mailänder
1071a94d1d document traits 2014-07-20 14:50:37 +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
9487f49cd5 Replace WPos.ToCPos -> Map.CellContaining. 2014-06-27 23:30:40 +12:00
Paul Chote
7b52fa52b6 Replace CPos.CenterPosition -> Map.CenterOfCell. 2014-06-27 23:30:40 +12:00
Paul Chote
5560f276ca Map: Rename IsInMap -> Contains. 2014-06-27 22:07:03 +12:00
Paul Chote
fd4d3b40d0 Simplify shroud range checks. 2014-06-27 22:07:03 +12:00
Paul Chote
2a466d08c3 Remove the now-unused ExploredBounds optimization. 2014-06-27 22:07:03 +12:00
Paul Chote
baf27bc4cd Use CellLayers for shroud. 2014-06-27 22:07:02 +12:00
ScottNZ
7e6f7c51e1 Refactor AutoTarget scan and GPS interaction, and cache trait lookup for a slight performance boost 2014-06-07 12:01:50 +12:00
Paul Chote
20b88fd904 Remove World.FrameNumber. 2014-03-12 17:19:29 +13:00
Chicken man
cf3cc43a28 Changed things to do with Shroud to WRange. Updated Utility. 2014-03-05 17:30:33 -05: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
ScottNZ
00ec1ca87a Remove unused usings 2013-11-12 19:39:33 +13:00
Paul Chote
8fcbe7bb9e Fix world visibility checks when shroud is disabled. 2013-08-10 20:15:05 +12:00
Paul Chote
c08f602661 Add lobby options for Shroud and Fog. 2013-08-04 13:04:09 +12:00
Paul Chote
9eaeeffae9 CenterLocation.ToCPos() -> CenterPosition.ToCPos(). 2013-07-08 21:52:26 +12:00
Paul Chote
9adfb56f65 Only update vis for actors in the world. Fixes #2726. 2013-06-22 13:15:38 +12:00
Paul Chote
b95cd0c91f Add an extra sanity check. 2013-06-22 13:15:38 +12:00
Paul Chote
7bce2017c3 Simplify and increase robustness of Shroud et al. Fixes #3440. 2013-06-22 13:15:27 +12:00
Paul Chote
400ad49de0 Allow maps/mods to properly disable fog or shroud (or both). 2013-04-11 22:36:56 +12:00
Paul Chote
248e815d99 More shroud refactoring.
This introduces a hash on Shroud which ShroudRenderer
can observe, removing the need to explicitly twiddle
a dirty flag between objects.

Shroud disabling is now done via RenderPlayer, so
enabling the cheat or winning/losing will now give
vis equivalent to an observer.
2013-04-10 21:08:22 +12:00
Paul Chote
c428cad70c Refactor per-player shrouds & fix shellmap shroud. 2013-04-10 19:36:03 +12:00
Scott_NZ
67fcdb5b91 Remove Shroud.Jank() and make all references to it call Shroud.Dirty() instead 2013-04-09 00:18:08 +12:00
Chris Forbes
3f273674f7 Merge pull request #2737 from Mailaender/shroud-sync
add Shroud, CreatesShroud and RevealsShroud to syncreport.log
2013-03-09 21:09:31 -08:00
Matthias Mailänder
58c3b52a1a add reset exploration developer cheat 2013-03-07 20:32:00 +01:00
Matthias Mailänder
72841a51e6 add shroud, creates shroud and reveals shroud to syncreport 2013-03-06 16:05:31 +01:00
Matthias Mailänder
3d8d116106 fix NullReferenceException in UnHideActor 2013-03-01 10:07:33 +01:00
Kenny
4f670d516d Shroud creators now only temporarily block explored shroud.
On powerdown or removal from the game, any previously explored terrain will become visible once again.
2013-01-31 16:57:04 +13:00
Kenny
f41fb32d60 Introducing per-player shrouds.
- Each player has their own shroud and their visibility does not extend outside of the shroud. 
- Units and buildings can no longer target other units outside of their visibility. Buildings can still be targetted if they have been explored.
- GPS will provide visibility in the fog-of-war.
- Spies that infiltrate radar domes will gain their victim's exploration and reset it on all clients (if the victim does not have GPS)
2012-12-13 15:16:56 -08:00
James Dunne
9c49143534 New types for cell and pixel coordinate position/vectors. 2012-06-21 15:36:59 -05:00
Curtis Shmyr
891cba456b give Gap Generator to allies 2012-04-06 18:23:30 +12:00
Chris Forbes
9581595a3d remove spurious null checks in Shroud -- all actors have an owner, always. 2011-12-27 21:53:31 +13:00
Chris Forbes
bc6af1841b fix indents everywhere 2011-10-18 15:10:17 +13:00
Chris Forbes
55036cd58c fix trailing whitespace everywhere 2011-09-26 08:40:39 +13:00
Chris Forbes
663a323f29 remove trait lookup spam everywhere for IOccupySpace. 2011-08-13 15:01:41 +12:00
Chris Forbes
64782fb254 use ToList rather than List<T>.ctor 2011-05-02 22:23:36 +12:00
Chris Forbes
149324ea92 remove most of the crap from queries 2011-03-17 22:09:08 +13:00
Paul Chote
094907c1a9 Update copyright header. Normalize line endings to LF. 2011-02-13 10:38:57 +13:00
Paul Chote
4b3c6cc62a Add a SubCell field to UIM. Allow UIM to query for units by subcell. 2011-02-04 18:39:03 +13:00
Paul Chote
60e3f7621f Remove fp from CenterLocation and aircraft. 2011-01-07 20:14:22 +13:00
Paul Chote
971287e989 Fix shroud crash 2010-12-01 18:22:46 +13:00
Paul Chote
3b0810a096 Simply the localplayer hack, and prevent vis dirtying when shroud is disabled. 2010-11-27 11:28:17 +13:00