Commit Graph

3917 Commits

Author SHA1 Message Date
Paul Chote
db1a27b071 Introduce IFinalizedRenderable.ScreenBounds. 2015-02-10 14:26:44 +00:00
Paul Chote
c55d723fb4 Remove Scale from IRenderable interface.
It is no longer used, and isn’t implemented for most renderables.
2015-02-09 23:26:06 +00:00
Paul Chote
a495a2f528 Split IFinalizedRenderable from Renderable to remove mutable structs. 2015-02-09 23:23:37 +00:00
Matthias Mailänder
595c792879 remove the unused movie lists 2015-02-01 18:53:50 +01: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
Matthias Mailänder
034c071fbc Merge pull request #7382 from Mailaender/stylecop-plus
Added support for StyleCop+
2015-01-25 23:58:42 +01:00
Paul Chote
27a3a1e974 Merge pull request #7383 from obrakmann/fix7379_invalid_debug_channel
Fix wrong log channel name: Debug -> debug
2015-01-26 09:20:10 +13:00
Matthias Mailänder
f444fa6763 Merge pull request #7362 from RoosterDragon/fix-shared-font-sheetbuilder
Avoid a globally shared SheetBuilder in SpriteFont.
2015-01-25 19:48:54 +01:00
Matthias Mailänder
24deec2a7b fix CodeLineMustNotEndWithWhitespace 2015-01-25 18:41:29 +01:00
Oliver Brakmann
16cf805a23 Fix wrong log channel name: Debug -> debug 2015-01-25 18:34:16 +01:00
RoosterDragon
c39ff6894c Reassert some changes lost in rebasing in MiniYaml.cs. 2015-01-20 20:52:02 +00:00
Oliver Brakmann
7267a3afdb Merge pull request #6984 from DeadlySurprise/yamlFix
Fixed yaml bug with leading spaces
2015-01-20 21:42:22 +01:00
RoosterDragon
c313c52e96 Avoid a globally shared SheetBuilder in SpriteFont.
A globally shared sheet builder leaks memory and resources between mod switches. Instead, we create and inject the sheet builder during mod startup to ensure we still share the builder across all fonts, but can reclaim it when the mod is unloaded.
2015-01-19 21:04:17 +00:00
Matthias Mailänder
398af8e513 Merge pull request #7357 from pchote/yay-outdated-distros
Fix compilation on mono 2.10.
2015-01-18 22:12:11 +01:00
Paul Chote
4a73c88a85 Fix compilation on mono 2.10. 2015-01-19 08:56:18 +13:00
RoosterDragon
930d9cbea3 Cache or inline some delegates to avoid repeated allocations. 2015-01-14 22:57:41 +00:00
Paul Chote
3ea70e891d Merge pull request #7291 from RoosterDragon/dynamic-palette-sizing
Implement dynamic hardware palette sizing.
2015-01-13 17:41:15 +13:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
Matthias Mailänder
89b2f4d5d3 Merge pull request #7217 from Mailaender/chrome-init-cleanup
Cleaned up the ingame widget initialization
2015-01-08 07:40:36 +01:00
Matthias Mailänder
88922b056e Merge pull request #7229 from RoosterDragon/map-coords
Introduce a new type for representing map coordinates.
2015-01-08 07:39:23 +01:00
Chris Forbes
507fe66f78 Merge pull request #7288 from RoosterDragon/faster-depth-sorting
Speed up depth sorting of renderables.
2015-01-08 14:22:20 +13:00
Chris Forbes
0a493df4c1 Merge pull request #7281 from RoosterDragon/cache-render-traits
Cache render related TraitsImplementing calls in Actor.
2015-01-08 14:13:11 +13:00
RoosterDragon
53f06ba093 Implement dynamic hardware palette sizing.
The HardwarePalette will now grow its palette buffer and texture in power-of-2 increments. This avoids it having to allocate memory for a full 256x256 texture up front. In practice the default mods use 22 or 23 palettes so a 32x256 texture is used. This means both the buffer and texture save neatly on memory. Additionally, HardwarePalette.ApplyModifiers sees a nice speedup as it has to transfer a much smaller amount of memory from the buffer to the texture.

To facilitate this change, the MaxPalettes constant is no more. Instead the PaletteReference deals with the calculation of the index and this is passed into the appropriate methods.
2015-01-07 22:41:51 +00:00
DeadlySurprise
fbe6ab7f4e Fixed yaml bug with leading spaces 2015-01-07 22:16:15 +01:00
RoosterDragon
69c409c20d Speed up depth sorting of renderables.
The OrderBy overload that takes an int generating key selector is faster than the one that requires a custom comparer. We extract a function from the ScreenZPosition function that determines the Z position of a WPos with an offset, but does not account for the tileset height. For the ordering function this is fine as only the relative magnitude of the comparison keys matter, so we don't need to spend time adjusting for the tileset height, as that won't affect the sort.
2015-01-07 18:22:38 +00:00
RoosterDragon
7cfece6dc0 Introduce a new type for representing map coordinates.
To resolve the ambiguity introduced when the introduction of isometric maps meant that cell and map coordinates were no longer equivalent, a new type has been introduced so they can each be represented separately.
2015-01-07 17:30:34 +00:00
Igor Popov
40c9d0a47d Merge pull request #7275 from RoosterDragon/formatting
Formatted all files.
2015-01-07 13:56:04 +03:00
RoosterDragon
a6cda967c2 Formatted all files.
Automatically formatted all files via VS. This generally corrects indentation, removes trailing whitespace and corrects misplaced tabs or spaces. Manually tweaked a few files where required.
2015-01-06 21:28:50 +00:00
RoosterDragon
dc4d522967 Cache render related TraitsImplementing calls in Actor.
The TraitsImplementing<T> performs a dictionary lookup to match up its generic type parameter with the right trait collection. Since actors are rendered so much, it is useful to cache this result to avoid looking it up repeatedly.
2015-01-05 21:05:19 +00:00
RoosterDragon
2c34358372 Avoid initialization of graphical elements for a server.
Avoid allocating memory and resources for graphical elements that will never be drawn when starting a dedicated server. This reduces the server memory footprint by approx 17 MiB.
2015-01-04 19:22:41 +00:00
Oliver Brakmann
58dc61e6ed Merge pull request #7262 from RoosterDragon/actormap-partitioning
Fix ActorMap spatial partitioning to actually work.
2015-01-04 18:48:01 +01:00
Matthias Mailänder
9d2f33d42c add a World type 2015-01-04 17:57:38 +01:00
Oliver Brakmann
302cf44f5a Merge pull request #7267 from atimoschenkow/fix-selection-after-radar
Selection rectangle is drawn after exiting radar widget while dragging the viewport
2015-01-04 17:23:08 +01:00
atimoschenkow
831f19e993 A selection box is drawn if the mouse exits the radar widget while dragging the viewport.
These changes prevent this side effect.
2015-01-04 17:06:50 +01:00
Oliver Brakmann
75808c365a Merge pull request #7269 from abcdefg30/general-polish
Some general polish
2015-01-04 16:54:37 +01:00
Matthias Mailänder
bc3acfeee7 StyleCop clean OpenRA.Game 2015-01-04 15:38:54 +01:00
abcdefg30
4fed02cd74 Make health bars 2 pixels shorter 2015-01-04 13:07:55 +01:00
abcdefg30
f2e224dd72 Fix a crash in RemoveProximityTrigger 2015-01-04 13:06:06 +01:00
RoosterDragon
a0737ccbf3 Fix ActorMap spatial partitioning to actually work.
The bin partitioning in ActorMap worked by dividing the map up into a few chunks of cells, each of which would contain some actors. Unfortunately, the bins were accessed directly in world coordinates which are on a scale 1024x greater than cell coordinates. This lead to all actors being placed into the bottom right bin. When checking for actors in a box, only this bottom right bin would be iterated for actors. Thanks to the fact this bin indeed contained all the actors, some clamps on the input ranges and filtering required per bin anyway, this actually returned correct results. Effectively, it was as if there was no spatial partitioning at all.

Not surprisingly however, this is fairly inefficient. By correcting the spatial partitioning to actually partition we see a 7x speedup in ActorsInBox on the RA shellmap.
2015-01-04 02:35:16 +00:00
Matthias Mailänder
44cd174a8d StyleCop clean OpenRA.Game 2015-01-03 19:00:48 +01:00
Oliver Brakmann
30e42cdc62 Merge pull request #7247 from Hellhake/stylecop-game
Fix StyleCop warnings in OpenRA.Game
2015-01-02 12:58:04 +01:00
Hellhake
5a97a4b63b Fix StyleCop warnings in OpenRA.Game 2015-01-02 12:11:01 +01:00
Hellhake
fa72e04042 Remove BOM 2015-01-01 22:51:12 +01:00
Matthias Mailänder
f093de98b6 Merge pull request #7238 from Mailaender/server-cpu-fix
Fixed high CPU usage due to Socket.Select not blocking the thread properly when the game started
2015-01-01 10:53:40 +01:00
asl97
d2a14842d8 avoid a busy server loop with high CPU usage
fixes #7237
2014-12-31 19:46:39 +01:00
Matthias Mailänder
714233d72e Merge pull request #7220 from obrakmann/d2k-worm-option-and-maps
Add worms to d2k maps and add lobby option to disable them
2014-12-31 13:03:37 +01:00
RoosterDragon
fdcfb30011 Improve YAML parse time.
Stream lines to avoid needing to load the whole file first, and avoid a LINQ Contains call when string.IndexOf will be much faster.
2014-12-30 18:17:32 +00:00
Oliver Brakmann
de0a62eb42 Add a lobby option to control spawning creeps (viceroids/worms)
The lobby option is only exposed in d2k currently, not in TD or TS.
2014-12-28 19:26:39 +01:00
Paul Chote
d9752c3bdf Make production type hotkeys configurable. 2014-12-28 17:24:12 +13:00
Matthias Mailänder
962d8fe74f fetch Mono.Nat from nuget 2014-12-26 15:40:06 +01:00