Commit Graph

3353 Commits

Author SHA1 Message Date
Paul Chote
96477b7c1a Invalidate FrozenActors that don’t have any sprites. Fixes #4809. 2014-06-13 21:07:39 +12:00
Paul Chote
b8cdb224d1 Merge pull request #5540 from RoosterDragon/begin-frame-cache-viewport
Avoid redundancy in BeginFrame.
2014-06-12 18:15:47 +12:00
Paul Chote
f6f366c4b3 Merge pull request #5401 from RoosterDragon/nodesdict
Changed MiniYaml.NodesDict property into a method.
2014-06-12 17:34:59 +12:00
Paul Chote
e0c59511fb Merge pull request #5152 from Mailaender/auto-l10n
Automated translation string extraction
2014-06-12 10:31:07 +12:00
Chris Forbes
1c5c2b576c Merge pull request #5601 from RoosterDragon/sheet-perf
Speed up some loops with Marshal.Copy
2014-06-12 10:07:29 +12:00
RoosterDragon
4ce8a4a648 Use Marshal.Copy for faster array copying.
- Rewrite several methods to use Marshal.Copy to copy data faster and more succinctly compared to doing it manually.
- Rewrite Sheet.AsBitmap(TextureChannel, Palette) with a faster and more self descriptive loop.
2014-06-11 05:02:38 +01:00
RoosterDragon
783fd8eb32 Streamline PerfSample.
- Avoid memory allocations by making PerfSample a struct, and tracking ticks manually rather than creating a Stopwatch instance.
2014-06-11 03:52:16 +01:00
Paul Chote
e347cdfb32 Merge pull request #5410 from RoosterDragon/IDisposable
Disposable fixup
2014-06-11 10:55:44 +12:00
RoosterDragon
a2ed4fd5f9 Avoid redundantly setting viewport parameters in BeginFrame.
- Cache the old resolution, scroll and zoom in BeginFrame, and don't bother updating the viewport parameters again until they change.
- Pass around scroll as an int2 to reduce the number of back-and-forth casts.
2014-06-10 17:06:25 +01:00
RoosterDragon
9dbbc23967 Make map preview generation fast.
- Change Map.LoadMapTiles and Map.LoadResourceTiles to read the whole stream into memory before processing individual bytes. This removes the cost of significant overhead from repeated calls to ReadUInt8/16.
- Remove significant UI jank caused by the map chooser by not including the placeholder widget. The maps render fast enough that it is no longer worthwhile and it was causing a lot of flushes which were the source of the jank.
- Trigger async generation for all maps when the chooser is loaded. This means in practice all previews will be ready by the time the user begins to scroll the selection. Since generation is fast, there is no issue with scrolling straight to the bottom and having to wait for the backlog to clear.
2014-06-10 11:46:39 +01:00
RoosterDragon
a598a01108 Fixed IDisposable implementation and usage.
- Implement IDisposable interface correctly, with sealed classes where possible for simplicity.
- Add using statement around undisposed local variables.
2014-06-10 11:23:55 +01:00
Matthias Mailänder
69d86cfcf2 add automated language string extraction to utility 2014-06-10 09:24:28 +02:00
Matthias Mailänder
c9a49538d6 translatable tooltips 2014-06-10 09:18:46 +02:00
Paul Chote
ee7573d01c Merge pull request #5484 from RoosterDragon/startup-efficiency
Improved efficiency of startup methods.
2014-06-10 18:28:25 +12:00
Paul Chote
373529e110 Merge pull request #5505 from pavlos256/map-preview-generation
Map preview generation
2014-06-10 17:56:21 +12:00
Matthias Mailänder
9df00ad8f9 Merge pull request #5590 from Happy0/sd2windowgrab
Closes #4977
2014-06-09 20:29:29 +02:00
Gordon Martin
5eab479c34 Adding SDL2 window grab on loading the game. Made this behaviour configurable in the 'Input' tab of the Settings menu
Updated settings file for TD to expose the new 'Lock mouse to window' display configuration option

A text label notes that modifying the 'Lock mouse' check box requires a restart
2014-06-09 19:10:05 +01:00
RoosterDragon
e63f330717 Improved efficiency of startup methods.
- ShpReader will copy the input stream into memory just once rather than for every header.
- ShpReader.CopyImageData switched to use Array.Copy since that uses some unsafe magic for speed.
- In ActorInfo, cache a GetType call and prevent needless materialization in PrerequisitesOf.
- In ObjectCreator, cache type and ctor lookups since these are expensive and often repeated.
- Implement IReadOnlyDictionary<T, U> on Cache<T, U> to provide some supplementary functions.
- In TechTree.GatherOwnedPrerequisites, rearrange a Boolean 'and' expression to evaluate expensive functions later in the chain, and use ContainsKey to speed up name check.
2014-06-09 17:13:01 +01:00
RoosterDragon
2e992a7310 Changed MiniYaml.NodesDict property into a method.
Method is now called ToDictionary.
- Cached a few invocations into locals which should prevent some redundant evaluation.
- Added ToDictionary overloads that take projection functions for the keys and elements, since several callsites were doing a subsequent Linq.ToDictionary call to get this.
2014-06-09 17:06:42 +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
Paul Chote
d8e5177a36 Merge pull request #5405 from RoosterDragon/min-max
Added MinBy, MaxBy, etc.
2014-06-09 17:42:01 +12:00
Chris Forbes
033f631f28 Merge pull request #5508 from pavlos256/read-only-list
Add IReadOnlyList
2014-06-09 17:36:40 +12:00
Paul Chote
1c8a8ca6ff Merge pull request #5400 from RoosterDragon/equatable
Implemented IEquatable<T>
2014-06-09 17:32:17 +12:00
Paul Chote
ea9601b128 Merge pull request #5509 from RoosterDragon/stream-exts-fixes
Fixes to StreamExts.
2014-06-09 17:25:25 +12:00
Matthias Mailänder
3a1c41c8ce move pixel doubling and health bar hotkeys to shared widget
closes #5572
2014-06-07 12:26:58 +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
RoosterDragon
531e3b7861 Fixes to StreamExts.
- Almost all calls to Stream.Read were broken. These have been patched to all go through ReadBytes which itself has been fixed to function correctly. The key thing to note is that Stream.Read is very much allowed to return less than the requested number of bytes. If this happens and you're not checking the return result, you'll be working with partially initialized arrays and really bad stuff happens when you do that.
- Call CopyTo rather than copying between streams manually.
- Peek and ReadUInt8 have been changed to avoid a pointless array allocation which is significant overhead for such simple calls.
2014-06-07 00:49:25 +01:00
Paul Chote
c0d7c7d840 Make RenderSprites aware of EffectiveOwner. Fixes #5526. 2014-06-02 18:21:06 +12:00
Paul Chote
adf8df5303 Merge pull request #5506 from Mailaender/openra.net
Replaced open-ra.org with openra.net in-game
2014-06-01 19:34:55 +12:00
Paul Chote
6dc83cf325 Merge pull request #5497 from Mailaender/map-rule-status-after-download
Fixed automatic map upload not refreshing map rule status
2014-06-01 18:29:39 +12:00
Matthias Mailänder
00662fe391 also do a local rule check after map download 2014-06-01 06:01:41 +02:00
Paul Chote
883837a83c Merge pull request #5498 from Mailaender/invalid-map-key-download
Fixed KeyNotFoundException in ServerBrowser
2014-06-01 14:05:08 +12:00
Pavlos Touboulidis
7d352fdad1 MapCache performance improvements 2014-05-31 23:49:04 +03:00
Pavlos Touboulidis
e083b392ba Add IReadOnlyList 2014-05-31 18:37:03 +03:00
Matthias Mailänder
5b86a8a6a8 open-ra.org → openra.net
closes #5500
2014-05-31 17:14:33 +02:00
Pavlos Touboulidis
441d602a6d Fix thread synchronization problem with Sheet.dirty 2014-05-31 17:26:24 +03:00
Matthias Mailänder
61d576ec6e harden map search preview against invalid data
fixes #5492
2014-05-31 15:19:22 +02:00
Matthias Mailänder
bb57ccd5bb update MapRuleStatus after download
fixes #5479
2014-05-31 13:14:53 +02: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
4d933481ce Merge pull request #5444 from ScottNZ/bleed
Closes #5439
2014-05-25 14:10:57 +02:00
ScottNZ
40e9fb93d6 Revert project file changes by RoosterDragon which would cause the TD mod to fail to load for some reason on Windows (de7a837d94, #5403).
VS will also generate a warning if it tries to source an icon from somewhere not in the project directory, so added it to the CrashDialog folder.
2014-05-26 00:07:30 +12:00
Matthias Mailänder
683edd2c37 fix frozen actors not visible under fog 2014-05-25 09:07:25 +02:00
Chris Forbes
5eb61dbdd2 Merge pull request #5411 from RoosterDragon/general-clean
General Cleanup
2014-05-25 11:03:03 +12:00
Chris Forbes
2d90032ce9 Merge pull request #5404 from RoosterDragon/remove-as-hashset
Changed removeActorPosition field in ActorMap into a set.
2014-05-25 10:53:19 +12:00
Chris Forbes
f7c91a9932 Merge pull request #5433 from RoosterDragon/main-loop-alloc
Reduce memory allocations in the main loop.
2014-05-25 10:38:27 +12:00
Matthias Mailänder
f83e27ae9a Merge pull request #5403 from RoosterDragon/solution-config
Unify settings for solution and project setups.
2014-05-24 17:13:43 +02:00
Paul Chote
910db14ee8 Save the replay metadata block when quitting. 2014-05-24 23:13:19 +12:00
Paul Chote
f5badcfc98 Merge pull request #5415 from pavlos256/replayrecorder-disposing-crash
Fix #5414
2014-05-24 20:55:38 +12:00