Commit Graph

72 Commits

Author SHA1 Message Date
Paul Chote
3b18c7815d Remove Util.GetFacing. 2016-01-16 22:38:17 +00:00
RoosterDragon
b0619a3e25 Added comments in performance sensitive code. 2015-12-13 16:24:54 +00:00
Christopher Grant
a378abe7c1 Moved RandomWalk to OpenRA.Traits.Util 2015-10-11 18:59:11 +02:00
RoosterDragon
faaf1ea1e1 Provide an early exit in RunActivity when there is no activity. 2015-09-26 15:32:26 +01:00
ScottNZ
582b6635ff Brace style fixes 2015-02-13 02:32:49 +13:00
RoosterDragon
82bea961ba Checked LINQ queries and collections for inefficiencies.
- Made Array.IndexOf available via extension method.
- Made ToHashSet extension method.
- Change collections queried often via Contains into sets.
- Avoid Count() extension if Count or Length property exist.
- Made Count() > 0 checks and variations calls to Any() instead.
- Don't call ToList/ToArray if there is no benefit to materializing the sequence.
- If the sequence does benefit from materialization, follow this general pattern:
  - Collection queried often via Contains use ToHashSet to speed up lookups.
  - Short lived variables use ToList. This is because ToArray requires an extra copy to output the final size.
  - Collections persisted into fields or for a long time use ToArray to minimize memory overhead.
2015-01-29 19:20:11 +00:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
Hellhake
5a97a4b63b Fix StyleCop warnings in OpenRA.Game 2015-01-02 12:11:01 +01:00
reaperrr
ee8e1f46c1 Move 'Activity' into its own namespace in OpenRA.Game. 2014-12-14 17:12:46 +01:00
Paul Chote
0425416ce2 Convert damage modifiers to integer percentages. 2014-08-12 11:41:09 +12:00
Paul Chote
d7f1b1c9e2 Remove CVec -> WVec conversion. 2014-06-27 23:30:41 +12: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
b6d1d26eeb Add World parameter to Util.BetweenCells. 2014-06-27 23:30:40 +12:00
RoosterDragon
d1b3d77662 Changed logging in DoTimed/RunActivity to create less overhead.
- Refactored PerfTimer to use less memory.
- Avoid using the PerfTimer in highly called methods DoTimed and RunActivity, instead tracking long ticks manually to reduce overhead and avoid memory allocations.
- Added some helper methods in PerfTimer to output information when a tick takes too long.
- Changed PerfTimer logging to output the time at the start of the line, and no longer truncate output per line.
- Settings.LongTickThreshold changed from TimeSpan to float and renamed to LongTickThresholdMs.
2014-05-28 16:38:05 +01:00
Pavlos Touboulidis
df0d1360dd Give PerfTimer the ability to write only slow operations to the log
This is useful to ignore fast operations that just spam the log.

The class had to be reworked because it couldn't properly handle cases
where all of a node's children where below the threshold.

Also changed DoTimed() and RunActivity() to use PerfTimer.
2014-05-22 03:40:36 +03:00
Matthias Mailänder
187362e80e rename OpenRA.Support.Random aka XRandom to MersenneTwister 2014-05-18 21:53:21 +02:00
Pavlos Touboulidis
c28faffa45 Remove custom Stopwatch wrapper
Remove the redirection (that doesn't offer any new functionality)
and replace it with the familiar System.Diagnostics.Stopwatch.
2014-04-26 23:58:18 +03:00
Pavlos Touboulidis
035834978d Make Stopwatch.ElapsedTime() a property and TimeSpan 2014-04-23 00:56:07 +03:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00
ScottNZ
1394c1dcee Remove some misc redundancies 2013-11-12 19:39:39 +13:00
ScottNZ
00ec1ca87a Remove unused usings 2013-11-12 19:39:33 +13:00
Paul Chote
40a9caddc7 Add FrozenActor target type. 2013-08-12 21:34:18 +12:00
Paul Chote
4f3c9aa0af Introduce Target.Type property. 2013-08-11 22:23:52 +12:00
Paul Chote
3d1b7d6d53 Fix Traits.Util style issues. 2013-08-01 20:18:44 +12:00
Paul Chote
b50ba0bfb9 Use WAngle.ArcTan in Traits.Util.GetFacing. 2013-08-01 20:18:44 +12:00
Paul Chote
e08445f762 Remove obsolete functions from Traits.Util. 2013-08-01 20:18:44 +12:00
Paul Chote
3fd01cfac2 Remove obsolete PSubPos and PSubVec. 2013-08-01 20:18:43 +12:00
Paul Chote
0676116d77 Convert Move and related plumbing to world coordinates. 2013-07-21 17:35:45 +12:00
Paul Chote
d0bed06765 Use WVec overload of Util.GetFacing where possible. 2013-07-08 21:52:27 +12:00
Paul Chote
0fdffd7b6a Convert Drag to world coords. 2013-07-08 21:52:27 +12:00
Paul Chote
9eaeeffae9 CenterLocation.ToCPos() -> CenterPosition.ToCPos(). 2013-07-08 21:52:26 +12:00
Matthias Mailänder
11755798cc Don't reserve airfields/helipads for husks that just fall down
fixes #3376
2013-06-16 12:43:41 +02:00
James Dunne
b127ae8027 Added sub-pixel position/vector types.
Updated Sync code to handle new sub-pixel types.
2012-06-21 19:41:12 -05:00
James Dunne
9c49143534 New types for cell and pixel coordinate position/vectors. 2012-06-21 15:36:59 -05:00
Chris Forbes
bc6af1841b fix indents everywhere 2011-10-18 15:10:17 +13:00
Chris Forbes
2bc260c833 move Activity from OpenRA.Traits.Activities namespace to OpenRA.Traits 2011-10-06 23:11:58 +13:00
Chris Forbes
9eecd7ba6b tidy Traits.Util usings 2011-10-04 22:55:19 +13:00
Chris Forbes
55036cd58c fix trailing whitespace everywhere 2011-09-26 08:40:39 +13:00
Chris Forbes
a3818a6aa2 fix MoveAdjacentTo so it doesnt suck so much 2011-09-07 20:43:18 +12:00
Paul Chote
6495478433 Kill Util.Centered 2011-05-04 09:21:30 +12:00
Paul Chote
8f962853f9 Support arbitrary per-player palettes. Will crash if I missed any cases that don't explicitly set the Renderable palette. 2011-05-03 22:21:31 +12:00
alzeih
255bac6aff QueuedActivity's Insert is broken 2011-04-16 12:50:13 +12:00
Paul Chote
094907c1a9 Update copyright header. Normalize line endings to LF. 2011-02-13 10:38:57 +13:00
Paul Chote
48482cf09a Add an AttackWander trait for creeps. Remove a pile of bogosity from AttackMove. 2011-02-11 21:50:10 +13:00
Paul Chote
0bd466a9e9 Use a lookup table for fvecs. 2011-01-27 12:05:13 +13:00
Paul Chote
9db41f5638 Remove fp from facing calculation. 2011-01-27 12:01:02 +13:00
Paul Chote
60e3f7621f Remove fp from CenterLocation and aircraft. 2011-01-07 20:14:22 +13:00
Chris Forbes
d8eaa7c841 shuffle exits 2010-12-27 19:43:32 +13:00
Paul Chote
00a0aac7a3 Scale is now set via a field on Render* and interacts properly with chronoshift and building previews. 2010-11-27 13:30:08 +13:00