Commit Graph

364 Commits

Author SHA1 Message Date
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
Chris Forbes
5b793e0455 server: Fix server getting wedged after map query with bad minimap
If the mapserver returned an unusable minimap blob, we'd end up dropping
the resulting exceptions on the floor, and committing a completely broken
MapPreview, which would then blow up the tail end of the map change
process, and all future ValidateClient calls after players join (which
itself was handled by kicking the player and logging some noise of dubious
value).

Adjusts exception handling in a number of places to log the exception
rather than dropping it on the floor, and makes the mapserver response
parsing tolerant of bogus minimap blobs -- in this case, we'd rather just
have no minimap.

Candidate for stable, as it fixes a bug present in the current release and
the current playtest series.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
2016-09-20 19:28:31 +12:00
RoosterDragon
3b5798b5e8 Fix cancellation of downloads.
The Download class cancels asynchronously, which means callers must handle cancellation inside the completion event, and not after requesting cancellation.
2016-07-30 16:27:45 +01:00
reaperrr
526f851489 Merge pull request #11426 from pchote/actorpreview-dynamic-facing
Support dynamic ActorPreview facings and creating previews from live actors.
2016-06-20 14:38:11 +02:00
Paul Chote
55cd2ca8f5 Move initial map suitability calculation to MapCache.
This was previously trying to use values that had
not yet been initialised, which meant that *all*
maps were treated as unsuitable.  This would cause
the mod to always fall back to the first installed
map.
2016-06-18 11:04:37 +01:00
teees
b7bf7b6ec0 Move mod-level ActorInits out of the engine. 2016-06-15 20:35:22 +01:00
Paul Chote
b4d1517d0d Set yaml filename when loading from FileSystem. 2016-06-04 15:23:44 +01:00
abcdefg30
72ce367522 Fix a wrong string.Format index in the Map ctor 2016-05-24 21:01:01 +02:00
Paul Chote
756d2428d9 Add depth support to TileSet. 2016-04-21 17:23:08 +01:00
Matthias Mailänder
48ea9dc300 Fix NRE if package download fails or is corrupted. 2016-04-17 15:57:00 +02:00
Oliver Brakmann
b25eb81a42 Fix ready checkbox in the lobby being unusable after installing a map 2016-04-12 18:30:37 +02:00
Paul Chote
dabea59b7d Pass depth scale factors to vertex shaders. 2016-04-10 09:41:01 -04:00