Commit Graph

149 Commits

Author SHA1 Message Date
Paul Chote
226081d379 Remove map saving shim method. 2016-02-21 16:11:36 +00:00
Paul Chote
573e26c887 Load and save maps using packages. 2016-02-21 16:11:35 +00:00
Paul Chote
9c3b967a47 Remove dead map saving code. 2016-02-21 15:11:55 +00:00
Paul Chote
34e6bfdfa0 Fix filesystem references under Windows. 2016-02-19 20:44:06 +00:00
Paul Chote
0b13811976 Don't reenumerate files when loading maps. 2016-02-18 18:12:33 +00:00
Paul Chote
d573e21a48 Traits open files via the Map. 2016-02-18 18:12:33 +00:00
Paul Chote
d1d3d72edb Implement IReadOnlyFileSystem on Map. 2016-02-18 18:12:32 +00:00
Paul Chote
b347fade71 Use IReadOnlyFileSystem in artwork loaders. 2016-02-18 18:12:31 +00:00
Oliver Brakmann
5866164c40 Merge pull request #10353 from Mailaender/resize-map
Added a resize map command
2016-02-15 21:10:39 +01:00
Matthias Mailänder
8b9e60ba82 Set the bounds when resizing maps. 2016-02-13 21:56:51 +01:00
Matthias Mailänder
284e6ea061 Add a resize map command. 2016-02-13 21:56:51 +01:00
Mazar Farran
22a3358581 Fix max view distance check. 2016-02-12 21:01:34 -08:00
Paul Chote
34910cd128 Move map format upgrades to an explicit upgrade rule. 2016-02-08 18:53:28 +00:00
Paul Chote
6c7b687f34 Move map UID calculation to a static method. 2016-02-08 18:51:58 +00:00
Matthias Mailänder
60e86f73d0 Merge pull request #10702 from RoosterDragon/map-contains-fix
Fix Map.Contains for maps with height
2016-02-06 23:02:56 +01:00
Oliver Brakmann
a6e98620c0 Merge pull request #10650 from pchote/remove-fragile-diplomacy
Remove fragile diplomacy.
2016-02-06 22:55:55 +01:00
RoosterDragon
36e09990ca Fix Map.Contains checks for maps with height.
If a cell lacked any valid projected cells, then it is off the map entirely. The previous logic would think such a cell was within the map as none of projected cells were out of bounds (as there were no projected cells to fail the check).
2016-02-06 17:55:27 +00:00
Paul Chote
626fa0b60b Move CellCorners to MapGrid. 2016-02-05 23:00:14 +00:00
Paul Chote
00945dc9ef Tidy IReadOnlyPackage interface and implementations. 2016-02-01 22:49:12 +00:00
Paul Chote
feab81bdea Remove IReadOnlyPackage.Priority.
Priority is now determined solely by order in mod.yaml
(later packages take priority of earlier ones).
2016-02-01 22:49:11 +00:00
Paul Chote
73b3f20921 Remove fragile alliances feature. 2016-01-30 20:47:50 +00:00
RoosterDragon
8e89a6a696 Simplify names, remove unused usings, remove redundant casts. 2016-01-17 21:35:36 +00:00
Paul Chote
a0979634bb Use .Yaw.Facing in Map. 2016-01-16 22:38:17 +00:00
Paul Chote
f8d0b97e8d Split IPackage into IReadOnlyPackage and IReadWritePackage. 2016-01-16 10:37:21 +00:00
Pavel Penev
45382d193a Rename IFolder to IPackage 2016-01-11 21:53:48 +02:00
Oliver Brakmann
02fa63c1b4 Merge pull request #9853 from penev92/unglobalFileSystem
Unglobal file system
2015-12-14 20:52:30 +01:00
Pavel Penev
d08a400565 Add a context argument to package files contructors 2015-12-14 03:42:25 +02:00
Pavel Penev
1b88d24cfa Unstatic GlobalFileSystem and rename it to FileSystem
Add a ModFiles field on ModData and move all access to the file system to go through that.
2015-12-14 03:42:22 +02:00
RoosterDragon
b0619a3e25 Added comments in performance sensitive code. 2015-12-13 16:24:54 +00:00
RoosterDragon
bfe1804bf6 Fix some spellings. 2015-11-27 16:19:59 +00:00
Curtis Shmyr
f0e9b85ccc I before E except after C 2015-11-14 22:32:37 -07:00
atlimit8
dac15edce5 Load rgb[a] hex colors from MiniYaml (+ Lua) 2015-10-27 16:09:48 -05:00
Pavel Penev
b16ebd480b Rename MapGridType.Diamond to MapGridType.RectangularIsometric 2015-10-26 00:42:30 +02:00
Pavel Penev
0e417a3cf3 Rename MapGridType.Rectangle to MapGridType.Rectangular 2015-10-26 00:41:26 +02:00
Pavel Penev
bb3aea338a Rename enum TileShape to MapGridType 2015-10-26 00:41:21 +02:00
Paul Chote
347eb6410c Add a lint pass for map metadata. 2015-10-24 20:36:38 +01:00
abcdefg30
674b1672f5 Merge pull request #9488 from atlimit8/MapMusic
Map Music
2015-10-18 17:47:26 +02:00
Paul Chote
cf875c3db6 Update the UID stored in the map file after saving. 2015-10-17 23:25:52 +01:00
atlimit8
f6180d7fa4 Include add/replace playlist entries support using map.yaml 2015-09-30 10:31:49 -05:00
Pavel Penev
642468ce0c Add MapGrid class
MapGrid is a mod Manifest field which includes (and thus makes redundant) TileSize, TileShape, SubCells info and MaximumTerrainHeight.
2015-09-27 04:14:43 +03:00
RoosterDragon
d9dd96ca35 Speed up Map.ContainsAllProjectedCellsCovering on flat maps.
This method gets called often via Contains calls. We can significantly speed up the method for flat maps since we know the projection and it is trivial to perform. This avoids an expensive projection lookup.
2015-08-31 20:45:32 +01:00
RoosterDragon
4eacb6e5c9 Transparently cache results of GetTerrainIndex in Map.
This method performs an expensive calculation and is called often during pathfinding. We create a cache of the terrain indicies for the map to vastly reduce the cost.
2015-08-31 20:43:17 +01:00
RoosterDragon
fa87befeff Add missing CellEntryChanged checks. 2015-08-31 20:43:16 +01:00
RoosterDragon
d415d3ba4e Reduce allocations in the main game loop.
- Cache the shroud projection even for flat maps to avoid allocating single element arrays.
- Avoid LINQ in shroud and map projection queries to avoid enumerator allocations.
- Avoid LINQ in calculation of sync values.
- Cache enumerables in ProductionQueue.
- Cache delegate in HackyAI.
2015-08-18 21:17:28 +01:00
Paul Chote
3d65ba39f6 Lazily initialize cell projection mapping. 2015-08-02 17:15:39 +01:00
Taryn Hill
6fa1f757b0 Add Map.DistanceAboveTerrain(WPos) and Actor.IsAtGroundLevel() extension method 2015-08-01 11:48:47 -05:00
Paul Chote
a0e92093a1 Fix the WPos <-> CPos conversion.
Fixes #8463.
2015-08-01 11:09:07 +01:00
Paul Chote
d29519fca1 Implement height-aware map.ChooseClosestEdgeCell(). 2015-07-31 08:38:07 +01:00
Paul Chote
05f41a0182 Implement height-aware map.DistanceToEdge(). 2015-07-31 08:38:07 +01:00
Paul Chote
318d6aaa73 Implement height-aware map.ChooseRandomEdgeCell(). 2015-07-31 08:38:07 +01:00