Commit Graph

3943 Commits

Author SHA1 Message Date
RoosterDragon
d4421f0a41 Fix some broken Stream.Read calls.
Change callers of this method to use the ReadBytes extension method that ensures the requested amount of bytes are consumed.

Also tighten argument validation.
2015-02-23 19:40:16 +00:00
Oliver Brakmann
293ec6577b Merge pull request #7507 from delftswa2014/bugfix/cheatfix
Fixed all cheat code
2015-02-22 15:10:17 +01:00
pevers
3f1db45ea6 changed all cheat to really enable everything on call
added givecash to the all cheat

fixed spacing

fixed spacing
2015-02-22 14:43:42 +01:00
Matthias Mailänder
361c1bc010 Merge pull request #7483 from pchote/deadbuildingstate
Fix missing first animation frame and remove DeadBuildingState.
2015-02-21 14:00:23 +01:00
Pavel Penev
20ca9b2ab1 Merge pull request #7486 from delftswa2014/bugfix/apcbibs
Fixed #7472 so that cargo is only shown on allied vehicles
2015-02-21 02:08:41 +02:00
Pavel Penev
293bb78a3c Merge pull request #7457 from pchote/actorpreviews
Introduce ActorPreviewWidget (and other related changes).
2015-02-21 01:35:03 +02:00
RoosterDragon
4d5101a7c4 Vastly improve shroud rendering performance.
Changes in the shroud are now tracked. If a cell changes it will mark itself and its neighbors as dirty. During the render phase all dirty cells will have their vertices calculated and cached. If a cell is not dirty, the pre-calculated vertices are retrieved from cache. Then the sprite renderer is provided the sprite and the pre-calculated vertices to draw.

This prevents constant recalculation of vertices for the shroud in the render phase, requiring instead only dirty cells in the visible area. The update phase is reduced to a practical noop, instead incurring the cost only of changed cells each frame, rather than checking the visible area.
2015-02-20 20:03:42 +00:00
Paul Chote
df7588f1bc Merge pull request #7488 from RoosterDragon/trait-remove-perf
Speed up TraitContainer.RemoveActor.
2015-02-20 17:45:40 +00:00
Paul Chote
1a6de9a03c Merge pull request #7374 from DeadlySurprise/cashOverflowFix
Added a check for overflowing player credits
2015-02-20 17:24:57 +00:00
Paul Chote
e9caf7f6e6 Initialise frame time when playing a new sequence.
Fixes #3706, #6389.
2015-02-20 16:54:04 +00:00
pevers
329d610577 Fixed #7472 so that cargo is only shown on allied vehicles
fixed spacing

pips are shown on every team when shroud is disabled

removed comment

Remove unwanted comment explaining how ally-detection works

fixed the real problem in RenderAfterWorld
2015-02-19 21:09:37 +01:00
DeadlySurprise
7b53582c5e Implemented Floating Text and radar video 2015-02-18 14:38:30 +01:00
RoosterDragon
a3898db660 Speed up TraitContainer.RemoveActor.
Use the binary search invariant of the lists to find the actor quickly and remove the range of entries from the list in a single operation to avoid redundant copying otherwise caused by removing entries one by one.
2015-02-17 00:02:43 +00:00
penev92
9664e32005 Merge pull request #7424 from RoosterDragon/minor-alloc
Avoid some memory allocations
2015-02-16 20:20:40 +02:00
Oliver Brakmann
de16d29aa6 Merge pull request #7445 from jwbuurlage/bleed
Fixes #7219. In addition, sets cursor corresponding to the order with hi...
2015-02-14 12:22:34 +01:00
Taryn Hill
5349c69307 Merge pull request #7467 from ScottNZ/stylecop-fixes
Brace style fixes.
2015-02-12 07:54:10 -06:00
ScottNZ
582b6635ff Brace style fixes 2015-02-13 02:32:49 +13:00
Paul Chote
aa550790e5 Merge pull request #4528 from Mailaender/mime
Registered Linux MIME type to directly load replays
2015-02-12 11:21:37 +00:00
Paul Chote
1af61c92c5 Split SpriteRenderable into its own file. 2015-02-10 17:47:49 +00:00
Paul Chote
8d51fb0e66 Use ActorPreviewWidget for the color pickers. 2015-02-10 15:22:42 +00:00
Paul Chote
268ca94dc1 Introduce ActorPreviewWidget. 2015-02-10 15:22:42 +00:00
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
Jan-Willem Buurlage
7eb2106375 Change cursor according to the command with highest priority. 2015-02-08 22:38:05 +01:00
RoosterDragon
b4993efff1 Avoid some minor allocations.
- Don't call string.Format in Actor.ToString since it gets called often, instead prefer a simple concat.
- In HiddenUnderFog.IsVisible, avoid a needless level of lambda indirection.
2015-02-02 21:16:14 +00:00
RoosterDragon
7e28acadd8 DrawPanelPartial now specifies each sprite as an individual parameter.
This allows some array allocations to be avoided, and makes the code more obvious since each sprite is referred to by name rather than an array index.
2015-02-02 21:16:14 +00:00
Matthias Mailänder
595c792879 remove the unused movie lists 2015-02-01 18:53:50 +01:00
DeadlySurprise
4f07de2af8 Added a check for overflowing player credits 2015-02-01 13:28:47 +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
Matthias Mailänder
1b5928879c save replays in a less generic file extension 2015-01-18 13:17:11 +01: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