Commit Graph

375 Commits

Author SHA1 Message Date
Paul Chote
ebf2ce32c0 Make sure braces for multi-line statements are on their own lines. 2019-06-08 19:26:53 +02:00
Paul Chote
c253aaeb9d Replace for(;;) with while (true). 2019-06-08 18:46:03 +02:00
Paul Chote
674155a8dd Move ctor initializers to their own line. 2019-06-08 18:44:50 +02:00
Paul Chote
78a70be0d4 Fix and enable SA1133, SA1134 style rules. 2019-05-24 10:47:57 +02:00
Paul Chote
5f157c572f Restore newlines between top-level map.yaml blocks. 2019-05-02 13:40:22 +02:00
Mustafa Alperen Seki
9fef2c01ec Add AppearsOnMapPreview
Allows preplaced actors to be rendered on map preview when saving the
map.

Also removes requirements for ResourceLayer in OpenRA.Game and moves it
to OpenRA.Mods.Common.
2019-04-04 19:37:19 +02:00
abcdefg30
0524a59b6b Fix map preview generation for isometric terrain 2019-03-08 21:21:10 +01:00
Paul Chote
3e404f6ac2 Remove HSLColor. 2019-03-04 18:26:42 +00:00
Paul Chote
ab4a7e3558 Replace System.Drawing primitives with our own. 2019-03-04 18:26:42 +00:00
Paul Chote
5f212a99fe Convert Map.SavePreview to new Png code. 2019-02-24 14:02:19 +01:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
Paul Chote
f65a777366 Remove System.Bitmap from map preview loading. 2019-01-08 21:20:06 +00:00
Unknown
7184f5f97e Fix QueryRemoteMapDetails multi-map status updates 2018-12-25 11:14:48 +13:00
Paul Chote
ad4b4dc7f8 Remove unused tileset update/save code. 2018-11-18 14:11:11 +01:00
Andre Mohren
b1a44086a0 Removed unused using directives. 2018-11-17 17:23:22 +00:00
Taryn Hill
5899636e10 Fix SubCell indexing in Map.CenterOfSubCell and MapGrid.OffsetOfSubCell 2018-11-02 22:42:51 +00:00
teinarss
cfaf5a6467 Updated CPos struct to use a bit field for all properties. 2018-10-02 00:54:45 +01:00
Noam
4e7a35b50f add NoAvailableMaps exception.
modify ChooseInitialMap to throw NoAvailalbeMaps exception if no maps were loaded.
implement Utilities.TryWithPrompt - safe execution of a provided action with ability to prompt user on error.
2018-09-19 12:52:51 +02:00
Paul Chote
4d664d4f74 Report custom map rule errors in the lint output. 2018-06-15 23:39:48 +02:00
Paul Chote
df31690332 Extend MiniYaml parser with new features:
- Add support for escaping '#' inside values
- Add support for escaping leading and trailing whitespace

And when discardCommentsAndWhitespace is set to false:
- Add proper support for comments
- Persist empty lines

Whitespace and comment support requires an explicit opt-in because
they produce MiniYamlNodes with null keys.  Supporting these through
the entire game engine would require changing all yaml enumerations
to explicitly check and account for these keys with no benefit.

Comments and whitespace are now treated as real nodes during parsing,
which means that the yaml parser will throw errors if they have
incorrect indentation, even if these nodes will be discarded.
2018-05-12 16:42:54 +02:00
Paul Chote
91295f9c68 Add IReadOnlyFileSystem.IsExternalModFile. 2018-05-01 00:46:57 +02:00
RoosterDragon
7bc5bd5791 Force buffered sheets to commit data to a texture on buffer release.
Previously ReleaseBuffer did not immediately null out the buffer, instead the releaseBufferOnCommit flag allows it to be nulled when the texture is next access and the pending changes from the buffer are committed to it. Now the texture is committed immediately, thus the buffer is null once ReleaseBuffer returns.

Once loaded, we force a GC to reclaim temporary memory used during loading. Previously the buffer would not be null as it was pending commit to the texture and thus could not be reclaimed. As soon as we rendered the first frame, the buffer is nulled but we are now in a low GC state - and the buffer will not be reclaimed until the next gen 2 GC which may be dozens of minutes away.

This change ensures the buffer is null in time for the post-load GC, and thus can be reclaimed before we start rendering.
2018-04-29 18:11:48 +02:00
Paul Chote
4f0aa89c01 Remove TileSet.Palette and PaletteFromCurrentTileset. 2018-04-08 21:14:29 +02:00
Paul Chote
8ea1da1046 Apply map upgrade rules without instantiating the Map object.
This avoids a crash that stops the maps from being updated
when the base mod ruleset is not valid (e.g. a trait is missing a
FieldLoader.Required property).  This also significantly improves the
upgrade performance.
2018-03-21 12:15:23 +01:00
RoosterDragon
5bd5a384b7 Use a BitSet for representing target types.
- Rename Bits<T> to BitSet<T>.
- Implement set based helpers for BitSet<T>.
- When representing TargetTypes of ITargetable in various traits, use a BitSet<TargetableType> instead of HashSet<string> for better performance & reduced memory usage.
- Fix FieldLoader to trim input values when generating a BitSet<T>.
- Require T in BitSet<T> and BitSetAllocator<T> to be a class since it's just a marker value. This allows the JIT to instantiate generic code for these classes once, as they don't benefit from specialized code for T. (Typically JITs will generate shared code for all reference types, and unique code for every value type encountered).
2018-03-21 12:07:44 +01:00
Peter Antal
3ce2417a06 Create SupportDirPrefix and IsPathRelativeToSupportDirectory() as members on Platform class. 2018-03-10 12:54:01 +00:00
Peter Antal
9ce0bcb0b7 Mop up active Stylecop nits.
Style consistency cleanup.
2018-03-03 11:45:35 +00:00
reaperrr
9107ca3bc1 Remove unused legacy IsWater flag
This was planned anyway, we had just forgotten about it when the last blocker was removed.
2018-02-22 11:51:10 +01:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
Paul Chote
b221787350 Allow CellRegions to be created with MPos. 2017-12-22 02:33:25 +01:00
RoosterDragon
be761de768 Compute map UIDs without copying all data to a MemoryStream.
We can use MergedStream to create a single combined stream with all the input and pass this to the hash function. This saves copying all the data into a MemoryStream to achieve the same goal, which requires more memory and allocations.
2017-12-17 19:20:12 +01:00
RoosterDragon
2dd1bd2d39 Initialize map inverse cell projections with capacity 1.
This prevents the capacity being set to 4 when the first item is added. For flat maps, the inverse projection will only ever be of size 1, thus this is sufficient capacity. For isometric maps, 1 is often sufficient, we only need more near height changes where the discontinuity means multiple cells may project back. We can pay for some reallocations to expand the size in these cases.

On flat maps, this reduces the memory required by the backing array 4x.
2017-12-11 01:38:17 +01:00
dsimmons87
65a2410738 Fixed bug in map Retry Install
If the download failed, the map status would be MapStatus.DownloadError,
which would cause the Install method to return immediately. I've updated
the Install method now to account for MapStatus.DownloadError.
2017-11-27 15:18:33 +02:00
abcdefg30
27345c1f6a Fix map linting crashing for not existing directories 2017-10-08 18:23:25 +01:00
Paul Chote
a1347a7f32 Populate MapLocations from LoadMaps.
This ensures that the map locations won't be created by the utility
but means that LoadMaps must be called before attempting to use MapLocations.
2017-09-30 17:37:52 +02:00
Matthias Mailänder
3af0b1a7a0 Remove PlayerPaletteFromCurrentTileset. 2017-09-17 16:20:38 +02:00
Paul Chote
f4c2b36778 Fix height calculations in custom terrain layers. 2017-09-17 15:35:40 +02:00
Paul Chote
d1ed0e09d0 Create user map directory if it doesn't exist. 2017-07-21 00:10:48 +02:00
rob-v
4b9c6c4746 Allow multiple terrain (tile) categories 2017-07-05 22:46:59 +02:00
rob-v
f29d2028fe Fix missing-failing logging of Ruleset (Yaml)Exceptions 2017-06-25 18:45:12 +02:00
Paul Chote
17089f2aee Rename VoxelSequences to ModelSequences. 2017-06-14 18:56:06 +02:00
Paul Chote
e1cd00c1dd Add backend plumbing for model loaders. 2017-06-14 18:56:06 +02:00
Paul Chote
8321d1f3e3 Remove legacy FileSystem.OpenPackage(string, IReadOnlyPackage). 2017-05-29 12:27:24 +02:00
Paul Chote
b1ac1d06e3 Catch and ignore exceptions while loading map previews. 2017-05-26 23:41:30 +02:00
Paul Chote
cdf2df58a0 Define RectangularIsometric world coordinate scale along the cell axis. 2017-05-07 13:45:30 +01:00
Paul Chote
1722f42f83 Move web urls from user config to mod config. 2017-04-17 12:00:41 +01:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
Paul Chote
06b9741807 Reveal the top tiles of cliffs too. 2016-11-13 12:31:21 +00:00
Paul Chote
b6809c97f2 Add a CellLayer with the height of each projected cell. 2016-11-11 16:44:12 +00:00
Paul Chote
9e8b18e7be Extract a common SHA1 helper. 2016-10-02 12:53:41 +01:00