Commit Graph

26 Commits

Author SHA1 Message Date
reaperrr
be290cfabd Split Actor.Bounds into RenderBounds and SelectableBounds
Additionally, internally renamed VisualBounds to SelectionOverlayBounds to avoid confusion with RenderBounds.

This step was necessary to prevent actors with selectable area smaller than their graphics to be removed too early from ScreenMap even though part of the graphics should still be visible.
RA cruisers were a prime example, but to a lesser extent several other actors were affected as well.

This separation also serves as preparation to determine the final RenderBounds from multiple source bounds later, to fix the remaining ScreenMap issues (building 'bibs', aircraft shadows).
2017-11-21 01:00:09 +02:00
reaperrr
4ae92a5c22 Only add partitioned effects to ScreenMap if (current) bounds are valid
This serves to avoid adding effect where either width or height is 0.
2017-09-24 10:54:58 +01:00
Matthias Mailänder
1aebf9857c Add support for only rendering effects inside screen bounds 2017-09-17 12:52:04 +01:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06: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
Pavel Penev
642468ce0c Add MapGrid class
MapGrid is a mod Manifest field which includes (and thus makes redundant) TileSize, TileShape, SubCells info and MaximumTerrainHeight.
2015-09-27 04:14:43 +03:00
RoosterDragon
09dc1db651 Refactored ScreenMap & improved perf of updates, removals and region lookups.
Reduce code duplication by extracting a common class to deal with spatial partitioning of actors, and use some (cached) delegates to reduce duplication further without affecting performance too much.

Speed up updates and removal of actors by caching their location so we only need to update or remove them from bins they are actually in (typically very few), compared to having to check every bin for removals which is much more work in comparison.

Speed up checking for actors inside a region by checking if items are located entirely within the bin they are located in. If so, we don't need to add them to the hash-set for de-duplication purposes which is fairly expensive.
2015-04-23 21:06:09 +01: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
Hellhake
5a97a4b63b Fix StyleCop warnings in OpenRA.Game 2015-01-02 12:11:01 +01:00
RoosterDragon
1116f578a3 Make FrozenActorsInBox a streaming enumerable.
Following the same layout as ActorsInBox, this streams the enumerable internally making it cheaper to call if only part of it is required, and also avoids building an intermediate list.
2014-12-07 21:36:56 +00:00
huwpascoe
a660bb95b5 Actor properties consistency improved 2014-11-21 02:44:05 +00:00
Alexander Fast
070d00c678 Fixes year numbers in license text in file headers. 2014-08-21 11:27:52 +02:00
RoosterDragon
8a60880cf1 Tackle the last of the low hanging fruit for memory allocations in the main game loop.
- Avoid calling string.Split twice in SprintFont.Measure.
- Change ActorsInBox method of ActorMap and ScreenMap to avoid allocating and intermediate list. As a bonus this allows the sequence to be lazily consumed. Also avoid LINQ in these methods.
- In FrozenUnderFog.TickRender, the method exits early if no players are visible so the attempt at lazy generation was not needed.
- Unwrap a LINQ Any call in ClassicProductionQueue.Tick.
- Merge some successive Where calls in ProximityCapturable into single predicates.
2014-06-22 17:29:45 +01: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
45ccf0035e Only render the frozen actors that are visible. Fixes #4300. 2013-12-13 22:36:25 +13:00
ScottNZ
00ec1ca87a Remove unused usings 2013-11-12 19:39:33 +13:00
Paul Chote
33f514001e Fix viewport-px / world-px confusion in ScreenMap. Fixes #3964. 2013-10-21 17:57:53 +13:00
Paul Chote
3ae75362bb Remove WorldUtils.FindFrozenActorsAtMouse. 2013-10-05 21:01:22 +13:00
Paul Chote
1ca9c90565 Add ScreenMap.ActorsAt(MouseInput) overload. 2013-10-05 21:01:21 +13:00
Paul Chote
8241718d01 Fix double-rendering regression. 2013-09-29 21:29:10 +13:00
Paul Chote
0dc50c65f5 Remove unnecessary int2 -> PPos -> int2 conversions. 2013-09-27 15:41:32 +12:00
Paul Chote
ad44610e5a Replace dynamic Actor.Bounds with the (unchanging) relative rect. 2013-09-27 15:39:57 +12:00
Paul Chote
dfd51c0caa Introduce ScreenMap trait for caching screen-coord queries. 2013-09-27 15:36:25 +12:00