Commit Graph

1306 Commits

Author SHA1 Message Date
Matthias Mailänder
87fd576b26 use TickRender() for RenderSprites and PaletteModifier 2014-07-06 08:24:08 +02:00
Matthias Mailänder
0feb5a7bdc check for building influence when growing resources
closes #5556
2014-07-04 09:22:14 +02:00
Matthias Mailänder
362c86764f document the buildable and country trait 2014-07-01 09:08:08 +02: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
RoosterDragon
7030d8b2b6 Changed HardwarePalette.ApplyModifiers to be more efficient.
- Add separate ImmutablePalette and MutablePalette classes since the distinction is extremely important to HardwarePalette.
- Keep a cache of palettes in HardwarePalette to avoid reallocation them every time ApplyModifiers is called.
- Palettes that are not allowed to be modified are copied to the buffer once when added, rather than every time ApplyModifiers is called.
- The AdjustPalette method now takes a read-only dictionary to prevent the dictionary being messed with.
- Added a constant for the palette size to remove its usage as a magic number in several areas.
- The ColorPreviewManagerWidget is annoying in that it needs to actually permanently update a palette after it has been added. To allow this, HardwarePalette now allows a palette to be replaced after initialization. The WorldRenderer therefore now also updates the PaletteReference it created earlier with the new palette to prevent stale data being used elsewhere.
2014-06-28 01:11:48 +01: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
Paul Chote
086ec07eb6 Add World parameter to Target.FromCell. 2014-06-27 23:30:40 +12:00
Paul Chote
e4ea012b9e Add World parameter to Target.FromOrder. 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
ad730a44c3 Use CellLayer for resources. 2014-06-27 22:07:02 +12:00
Paul Chote
ce331a28e8 Use CellLayer for custom terrain. 2014-06-27 22:07:02 +12:00
Paul Chote
8dc0967d2e Use CellLayer for ActorMap. 2014-06-27 22:07:02 +12:00
Paul Chote
baf27bc4cd Use CellLayers for shroud. 2014-06-27 22:07:02 +12:00
Paul Chote
295af5741f Use CellLayers for ResourceLayer. 2014-06-27 22:07:01 +12:00
Paul Chote
bbd1331536 Clean up actor selection in WorldInteractionControllerWidget. 2014-06-27 19:20:44 +12:00
Paul Chote
d43acfe94b Merge pull request #5679 from RoosterDragon/main-loop-alloc
Reduce memory allocation in the main loop
2014-06-26 23:10:56 +12: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
Matthias Mailänder
05609399eb don't try to spawn resources when the cell is already full
fixes #5699
2014-06-22 11:49:40 +02:00
Paul Chote
57280e3eab Merge pull request #5660 from Mailaender/document-traits
Documented some order related traits
2014-06-21 01:27:11 +12:00
Matthias Mailänder
e607c04cce let harvester splatter resources when exploding
closes #2346
2014-06-20 11:11:31 +02:00
Matthias Mailänder
3e627d2eba rename ore to the more generic name resources everywhere 2014-06-20 11:11:31 +02:00
Matthias Mailänder
18805779a8 document RejectsOrders 2014-06-19 21:21:14 +02:00
RoosterDragon
22abf9b4c4 Remove and sort usings. 2014-06-18 21:43:35 +01:00
Paul Chote
887a515e14 Add MinRange plumbing to attack activities. 2014-06-15 22:48:43 +12:00
ScottNZ
dbffce81a6 Remove unused usings 2014-06-15 22:16:40 +12:00
Paul Chote
1169211893 Merge pull request #5579 from Mailaender/frozen-C4
Fixed C4 target inconsistencies with Fog of War and Husks
2014-06-15 22:01:04 +12:00
Matthias Mailänder
8f64835898 StyleCop 2014-06-15 10:51:57 +02:00
Matthias Mailänder
dac12839fd Merge pull request #5630 from pavlos256/map-helpers
Move map helpers from WorldUtils to Map
2014-06-14 11:49:19 +02:00
Matthias Mailänder
fe0d7ab00e Merge pull request #5627 from pchote/frozen-cloak-fix
Invalidate FrozenActors that don’t have any sprites.
2014-06-14 11:41:49 +02:00
Matthias Mailänder
1ebfc6bb06 Merge pull request #5631 from pavlos256/dev-iddqd
Add "/all" dev command
2014-06-14 10:27:58 +02:00
Matthias Mailänder
ee0df9c1cb make C4 Demolition frozen actor aware 2014-06-14 09:35:38 +02:00
Paul Chote
5e986b3079 Merge pull request #5615 from RoosterDragon/minor-alloc
Minor allocation tweaks
2014-06-14 12:26:39 +12:00
Pavlos Touboulidis
ee4f3e5642 Always allow cheats on single player games 2014-06-13 17:18:12 +03:00
Pavlos Touboulidis
3f2425f1d6 StyleCop 2014-06-13 15:55:48 +03:00
Pavlos Touboulidis
c282fa1077 Move GetTerrainIndex/Info from WorldUtils to Map 2014-06-13 13:57:32 +03:00
Paul Chote
96477b7c1a Invalidate FrozenActors that don’t have any sprites. Fixes #4809. 2014-06-13 21:07:39 +12:00
Pavlos Touboulidis
092352729f Change terrain type from string based dictionaries to arrays 2014-06-13 11:20:54 +03:00
RoosterDragon
b8b8b1e2df Minor changes to reduce allocation.
- Cache a predicate in ActorMap.
- Use short circuiting to skip a call to HasTrait in AttackBase.
- In AutoTarget.ScanForTarget, move the check for the scan time above the calculations since we can skip them if it's not time yet.
- In AutoTarget.ChooseTarget, merge four Where calls into one.
2014-06-12 05:32:44 +01:00
Matthias Mailänder
7216688baf Merge pull request #5567 from ScottNZ/perf
Refactor AutoTarget scan and GPS interaction
2014-06-09 12:01:05 +02:00
Matthias Mailänder
0dee8208a8 never spawn with density 0 because that is not rendered 2014-06-07 11:56:54 +02: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
c0d7c7d840 Make RenderSprites aware of EffectiveOwner. Fixes #5526. 2014-06-02 18:21:06 +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
RoosterDragon
0c8bdff5be Formatting fixes.
Spaces to tabs, indents, etc.
2014-05-26 18:10:59 +01:00
Matthias Mailänder
683edd2c37 fix frozen actors not visible under fog 2014-05-25 09:07:25 +02:00