Commit Graph

13068 Commits

Author SHA1 Message Date
RoosterDragon
b733465f33 General uncontroversial cleanup:
- Made private methods static where possible (runtime can elide checking the object for null).
- Declared attribute classes as sealed (allows reflection on attributes to complete faster).
- Moved some static cctor's into field initializers (static cctor's are slower than static field initializers).
- Made classes static if they contained only static methods (can't create instances of useless objects).
- Use inferable Exts.Lazy and not new Lazy<T>().
- Added required STAThread attribute to CrashDialog.
- Removed unused parameters in private methods.
- Added Serializable attribute to exceptions.
- Added parameter name in calls to ArgumentNullException.
- Use of as operator instead of is + cast.
- Changed (x as Foo).Bar anti-pattern into ((Foo)x).Bar. Results in sensible cast exceptions on error rather than null dereferences.
- Removed unused method in NullShader.
2014-05-23 15:50:54 +01:00
psydev
6c46f9d198 Reduce Grenadier dmg vs. heavy from 50% -> 35%
Grenadier is a wee bit too powerful vs. everything. 
This will keep its value vs. heavy armor still very high, but not OP like it is for the cost. 
(Grenadier will still have highest DPS vs. heavy as a function of cost, after this nerf).
2014-05-23 07:20:41 -07:00
RoosterDragon
a0db80cb6a Changes to reduce allocations in the main loop.
Targeted some methods that generated allocated a lot of memory in the main game loop:
- Actor.Render - Changed LINQ calls into equivalent loops. No allocation for delegates.
- Animation.Render - Returned an array rather than a yield expression. The array uses less memory than the complier generated enumerable.
- FrozenActor and FrozenUnderFog - Materialize the footprint into an array: The enumerable is not-trivial to evaluate is and evaluated many times inside the Tick function. The memory needed is minimal. Changed LINQ into equivalent loops to prevent delegate allocation. Should result in overall much faster calls.
- Widget.GetEventBounds - Changed LINQ calls into equivalent loops.
- MobileInfo.CanEnterCell - Changed LINQ calls into equivalent loops. Don't materialize list of blocking actors every time, instead enumerate them and only when they need to be checked.
- FrozenUnderFog.TickRender - Generate the renderables lazily and also remove a no-op Select call.
2014-05-23 14:48:11 +01:00
Psydev
11a3b3d4fc minor: removed "C&C" from the title of Haos Ridges 2014-05-23 06:14:12 -07:00
Psydev
fd0287cec0 improved "Deterring Democracy". Better tib.
Changed layout of tiberium, especially blue tib.
Removed hospitals.
2014-05-23 06:12:09 -07:00
RoosterDragon
b1d5f4edd9 Also implemented on the Bits<T> struct. 2014-05-23 13:53:56 +01:00
Psydev
13483f797a new map: "Profit Over People" (1vs1) 2014-05-23 05:23:57 -07:00
Psydev
15e7b098d1 re-add 8-player version of HoS, with "8P" title
Includes same minor aesthetic fixes as 4P version.
2014-05-23 05:22:28 -07:00
Psydev
5c38fcee27 fix + replace Hegemony or Survival with 4p version
There were a few leftover minor aesthetic issues with the map which I
quickly fixed.
I decided that not many people would play the 8P version of this map, so I
made the 4P version the one included. It's actually fun.
2014-05-23 05:20:56 -07:00
reaperrr
467d1b6137 Adds Scorch and Crater marks to world, adds Heavy start unit support for testing purposes 2014-05-23 13:39:51 +02:00
reaperrr
06fc2a31d6 Fixes offsets, adds muzzles and Turret ROT values for several vehicles.
Adds cloak sound to stealth tank.
2014-05-23 13:39:50 +02:00
reaperrr
21625f5650 Fixes bounds, offsets, FireDelays and weapons for some infantry 2014-05-23 13:39:50 +02:00
reaperrr
425d02e86b Adds several previously missing weapons, resets Versus values to original TS values
Fixes flameall.shp to cover 8 directions instead of only 4
2014-05-23 13:39:49 +02:00
RoosterDragon
2bd8778c55 Changed removeActorPosition field in ActorMap into a set.
This is because it's purpose is to be queried via Contains when actors needed to be removed.
2014-05-23 08:30:45 +01:00
RoosterDragon
da6b5c1ce4 Fixed TraitDictionary.Contains to use Any() rather than Count() != 0.
This means it can bail early if a match is found.
2014-05-23 08:25:47 +01:00
RoosterDragon
0ea3509ee4 Added MinBy, MaxBy, MinByOrDefault and MaxByOrDefault methods and replaced calls of the style OrderBy[Descending]().First[OrDefault]() which is not as performant. 2014-05-23 08:23:42 +01:00
RoosterDragon
de7a837d94 Unify settings for solution and project setups.
Create a single solution platform named x86.
Ensure both Debug and Release configs build to the root for all projects.
Ensure all Release configs generate pdbs.
2014-05-23 08:16:09 +01:00
Squiggles211
7e2599c898 Fixes #5394 Spawnpoint dropdown count
Fixes where the spawn point dropdown would show the same number of spawn
points as the number of players rather than the actual number of
available spawn points.
2014-05-23 02:14:16 -05:00
RoosterDragon
67594b844a Implemented IEquatable<T> to speed up equality comparisons.
Actor, CPos, CVec, WAngle, WPos, WRange, WRot and WVec structs now implement IEquatable<T> which means unboxing/casting costs can be eliminated.

Also simplified the ToString method by concatenating components directly rather than using a format string since the overhead is a bit high for simple cases like this.
2014-05-23 08:04:43 +01:00
Paul Chote
db08357e36 Merge pull request #5215 from pavlos256/replay-meta
Replay meta
2014-05-23 11:30:12 +12:00
reaperrr
9d5228d141 Set Tick value for various TS infantry sequences to 80 2014-05-22 22:27:55 +02:00
reaperrr
887ec938cc adds muzzle sequences for vehicles 2014-05-22 22:27:54 +02:00
reaperrr
dc143d0967 Adds sequences for flameall, scorch and crater marks, and smoke placeholder 2014-05-22 22:27:53 +02:00
reaperrr
3fcd77eb41 Adds various crate effect sequences, removes levelup ra backfall. 2014-05-22 21:50:05 +02:00
reaperrr
077efb5884 Fixes two music track titles 2014-05-22 21:46:11 +02:00
reaperrr
e4b37c1b5d Reduce speed penalty for vehicles on certain terrain types.
The old one were a bit harsh.
2014-05-22 21:36:24 +02:00
reaperrr
a5eb398840 Merge pull request #5379 from Mailaender/alpha-lamb
Added the Tiberian Sun light post
2014-05-22 21:20:48 +02:00
Pavlos Touboulidis
b8bbd55598 Misc changes
* Use Pair instead of KeyValuePair
* double -> var
* Butcher XML comments
* Change WinState default to Undefined and use it instead of the new GameOutcome
* Other changes
2014-05-22 21:57:07 +03:00
Pavlos Touboulidis
fe1eb1f3e0 Use the stream extensions instead of the BinaryReader/Writer 2014-05-22 21:54:15 +03:00
Pavlos Touboulidis
39cc4cc014 Use "debug" channel to report loading exceptions 2014-05-22 21:54:15 +03:00
Pavlos Touboulidis
38a5e326f6 Fix crash when trying to read empty replay files
It was crashing because it tried to seek 8 bytes before the end
of a file that was empty (zero length).

I also added a few more checks and another try/catch to prevent
any more crashes related to damaged files.
2014-05-22 21:54:15 +03:00
Pavlos Touboulidis
f4c52eefae Change date labels
Change "Last Week" to "Last 7 days" and "Last Month" to "Last 30 days".
Also added a "Last 14 days" option.
2014-05-22 21:54:15 +03:00
Pavlos Touboulidis
de0a5ebd43 Improve replay metadata and the replay browser
List of changes:

* Better and more filters with new layout, for both mods.

* Rename/Delete/Detele all functionality.

* Simplified ReplayMetadata class considerably by introducing a new
GameInformation data object. The new GameInformation class contains
more information than previously available so the new solution is not
compatible with old replays, meaning it can't read old replays.

* Better and cleaner game information gathering in order to be written
at the end of the replay file.

* Revert changes to ReplayConnection, no longer necessary.

* Better exception message on missing sprites and fonts.

* New "SpawnOccupant" class that holds all the information needed by the
MapPreviewWidget to visualize a spawn point. It was using Session.Client
before and it was necessary to separate it to be able to show information
not available at lobby time.

* Fix keyboard focus UI bug when closing a window would not remove focus.
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
042910bd5e New common dialog: TextInputPrompt to get a string from the user
For both ra and cnc
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
713141cf4d Support for input validation on TextFieldWidgets
See OnTextEdited(), IsValid(), TextColorInvalid (with the default in metrics.yaml).
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
ce8c42b552 Style & nit fixes 2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
a80c4f086a Add filters to the replay browser dialog
This closes issue #2152. The filters added are:

* Game type (singleplayer / multiplayer)
* Date
* Duration
* Outcome
* Player name

Other changes:

* Added a 'CollapseHiddenChildren' option to the ScrollPanelWidget to
make hidden children take up no space.
* Removed the extension (.rep) from the replay filenames in the
replay browser.
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
98a05b61b3 Add metadata block to replays
The replay files are just streams all network communication so to
get any info out of them it is necessary to play back the stream
until the wanted information is reached.

This introduces a new metadata block placed at the end of the
replay files and logic to read the new block, or fall back to
playing back the stream for older files.

The replay browser is also updated to use the metadata information
instead of reading the replay stream directly.
2014-05-22 21:54:14 +03:00
Matthias Mailänder
20a441a1f4 add the Tiberian Sun light post 2014-05-22 14:59:43 +02:00
Paul Chote
4454c0c2f8 Merge pull request #5372 from Mailaender/desert-tree-exclude
Fixed temperat trees showing up in the Tiberian Dawn DESERT tileset
2014-05-23 00:57:27 +12:00
Paul Chote
d252d1cf18 Merge pull request #5366 from Mailaender/rpmlint-duplicates
Removed duplicates identified by RPMlint
2014-05-23 00:56:01 +12:00
Matthias Mailänder
4eaeff8ccb Merge pull request #5393 from pchote/palettehax
Support per-animation palettes in RenderSprites.
2014-05-22 14:54:39 +02:00
Paul Chote
892f3c834c Merge pull request #5365 from Mailaender/tools-shortcuts
Separated tools and /usr/bin shortcuts
2014-05-23 00:53:42 +12:00
Paul Chote
ab1ce4554d Fix star port and repair depot lights. 2014-05-23 00:37:21 +12:00
Paul Chote
8e18e34a8b Fix D2K construction yard overlays. 2014-05-23 00:37:20 +12:00
Paul Chote
46a7c9c469 Add custom palette support to With*Overlay. 2014-05-23 00:37:20 +12:00
Paul Chote
900f5bffb5 Change Bib to use RenderSprites. 2014-05-23 00:37:20 +12:00
Paul Chote
4c92c5da99 Support per-animation palettes. 2014-05-23 00:37:20 +12:00
Paul Chote
15f63fb5ea RenderSprites.anims is finally private.
Followup to #3348.
2014-05-23 00:37:20 +12:00
Paul Chote
4aa7376994 Add wrappers for RenderSprites anims dictionary. 2014-05-22 23:35:10 +12:00