Commit Graph

35 Commits

Author SHA1 Message Date
RoosterDragon
b7e0ed9b87 Improve lookups of nodes by key in MiniYaml.
When handling the Nodes collection in MiniYaml, individual nodes are located via one of two methods:

// Lookup a single key with linear search.
var node = yaml.Nodes.FirstOrDefault(n => n.Key == "SomeKey");

// Convert to dictionary, expecting many key lookups.
var dict = nodes.ToDictionary();

// Lookup a single key in the dictionary.
var node = dict["SomeKey"];

To simplify lookup of individual keys via linear search, provide helper methods NodeWithKeyOrDefault and NodeWithKey. These helpers do the equivalent of Single{OrDefault} searches. Whilst this requires checking the whole list, it provides a useful correctness check. Two duplicated keys in TS yaml are fixed as a result. We can also optimize the helpers to not use LINQ, avoiding allocation of the delegate to search for a key.

Adjust existing code to use either lnear searches or dictionary lookups based on whether it will be resolving many keys. Resolving few keys can be done with linear searches to avoid building a dictionary. Resolving many keys should be done with a dictionary to avoid quaradtic runtime from repeated linear searches.
2023-09-23 14:31:04 +02:00
abcdefg30
64933ed04b Fix sequence inheritance defined in yaml
Nodes need to be placed after "Inherits" nodes so that they take
precedence over the inherited nodes.
2023-03-11 20:56:32 +01:00
Paul Chote
5b8f148c50 Simplify tileset-specific sequence definitions.
All magic behaviour for constructing sprite filenames
has been removed in favour of an explicit Filename
(and TilesetFilenames for tileset-specific sequences)
property.
2023-01-22 22:10:48 +02:00
Paul Chote
08c7c80bb7 Render building lights as their own tint-ignoring animations. 2021-03-20 17:15:56 +01:00
Paul Chote
76a10283c4 Fix TS effect translucency/lighting effects. 2021-02-24 19:20:48 +01:00
Paul Chote
c5ea496c45 Add terrain lighting definitions to TS. 2020-07-13 14:02:02 +02:00
Matthias Mailänder
2ccba3768b Add overlay animations to CAARAY. 2017-08-25 10:48:35 +01:00
reaperrr
6e2418d940 Add TS civilian hit-shapes 2017-08-09 21:25:05 +01:00
reaperrr
ab6d18eab6 Center two-legged billboard sprites
They are supposed to be positioned in the middle of the two cells they occupy.
2017-08-09 21:25:05 +01:00
reaperrr
c40ec62511 Tweak sprite offsets of some TS aban civ buildings
In cases where the sprite has enough margin to the footprint cell edges, moving down the sprite a bit is much easier than manually setting up custom targetable offsets.
2017-08-09 21:25:05 +01:00
reaperrr
67d5df9da5 Fix TS snow civ buildings depth sorting 2016-10-22 03:08:40 +02:00
reaperrr
41dc76ef06 Fix Kodiak, Montauk, hospital & deployed ICBM depth sorting 2016-10-22 03:08:38 +02:00
reaperrr
e5fcf1d5f6 Fine-tune depth-sorting and offsets of temperate 4x2 TS civ buildings 2016-10-22 03:02:47 +02:00
reaperrr
c3946d9371 Fix depth sorting and offset of several civilian structures 2016-10-22 01:05:37 +02:00
Paul Chote
074edc9d50 Fix missing cabhut shadow. 2016-08-28 18:49:25 +01:00
Paul Chote
4676e8b083 Overhaul civilian.yaml 2016-08-27 18:31:04 +01:00
Matthias Mailänder
703388f034 Fixed sprite offsets. 2016-06-21 23:28:48 +02:00
Paul Chote
cec2c584e6 Fix TS EMP overlay. 2015-12-26 12:37:22 +00:00
Pavel Penev
b7192ffa14 Merge pull request #9207 from Mailaender/ctdam-animations
Added damaged, light and water animations to the Tiberian Sun hydroelectric dam
2015-09-02 15:08:49 +03:00
Pavel Penev
1679ac5a91 Merge pull request #9208 from Mailaender/kodiak-lights
Added Tiberian Sun Kodiak positional lights
2015-09-02 15:04:57 +03:00
Matthias Mailänder
f65c356399 add Kodiak positional lights 2015-08-31 20:20:47 +02:00
Matthias Mailänder
ee8cac25d0 add lights to the Nod pyramid 2015-08-31 20:18:14 +02:00
Matthias Mailänder
6137a44123 add lights to the Montauk 2015-08-30 18:51:00 +02:00
Matthias Mailänder
19801b6cc3 add damaged, light and water animations 2015-08-30 17:40:54 +02:00
reaperrr
c2aa0983a8 Fixes offsets for all civilian structures
Adds critical damage stage to snow-exclusive aban** buildings (the art isn't really suited for damaged/50% damage stage)
2015-06-27 22:44:29 +02:00
reaperrr
01a241d394 Fixed bogus temperate exclusivity from ca00** civ buildings and crash sites
- ...and fixed their snow palette via TilesetCode.
- Fixed palette via TilesetCode for several other structures as well.
- Removed redundant junk from civilian structure sequences.
2015-06-27 22:44:28 +02:00
Paul Chote
d8f24adcc7 Merge pull request #7853 from Mailaender/alpha-experiments
Added AlphaImage support
2015-04-25 19:03:25 +12:00
Matthias Mailänder
9a6e8467da fix GASPOT again 2015-04-18 13:47:20 +02:00
Matthias Mailänder
fdf58b29e2 setup the alpha image lighting for the light spot 2015-04-18 13:41:53 +02:00
reaperrr
62bb9677a6 Remove obsolete gagreen sequence
and removed a superflous newline
2015-04-16 21:47:38 +02:00
Paul Chote
f0414d2ec0 Make special structures unbuildable. 2015-03-31 19:11:38 +01:00
Paul Chote
0a6e21d908 Support tileset-specific art in TS. 2015-03-26 22:42:43 +00:00
Paul Chote
a7c64a0941 Remove redundancies from TS sequences. 2015-03-22 17:31:42 +00:00
Paul Chote
4110064c44 Fix TS civilian actor/sequence definitions. 2015-03-08 13:01:47 +00:00
Guido L.
2c485414e2 Add Buildings and Trees to Tiberian Sun 2014-12-30 18:18:48 +01:00