Commit Graph

59 Commits

Author SHA1 Message Date
Paul Chote
c02846e2cb Replace invalid tiles on map load. 2020-12-19 13:07:01 +01:00
abcdefg30
e4e1878a4b Remove an used TerrainTemplateInfo constructor 2020-10-02 12:09:42 +02:00
Paul Chote
ad4d6eaec9 Improve --check-missing-sprites error handling. 2020-09-12 17:52:46 +02:00
Paul Chote
3e849568ff Improve exception message for bogus tileset definitions. 2020-09-12 17:52:46 +02:00
teinarss
27f1a7ab27 Use out var syntax 2020-08-19 18:11:07 +01:00
Paul Chote
5f588561b6 Rewrite TS minimap rendering:
* Rename LeftColor and RightColor to MinColor and MaxColor
  These are mapped from LowRadarColor and HighRadarColor in
  the original inis, and appear to be used to set the bounding
  values for selecting a random colour, NOT for left/right
  pixels (which caused noticeably wrong banding).

* Adjust brightness based on terrain height.
  MinHeightColorBrightness and MaxHeightColorBrightness
  were chosen by trial/error to match the original
  map preview rendering.
2020-07-07 22:12:22 +02:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
Paul Chote
ab4a7e3558 Replace System.Drawing primitives with our own. 2019-03-04 18:26:42 +00: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
ad4b4dc7f8 Remove unused tileset update/save code. 2018-11-18 14:11:11 +01: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
4f0aa89c01 Remove TileSet.Palette and PaletteFromCurrentTileset. 2018-04-08 21:14:29 +02: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
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
Matthias Mailänder
3af0b1a7a0 Remove PlayerPaletteFromCurrentTileset. 2017-09-17 16:20:38 +02:00
rob-v
4b9c6c4746 Allow multiple terrain (tile) categories 2017-07-05 22:46:59 +02:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
Paul Chote
b4d1517d0d Set yaml filename when loading from FileSystem. 2016-06-04 15:23:44 +01:00
Paul Chote
756d2428d9 Add depth support to TileSet. 2016-04-21 17:23:08 +01:00
Paul Chote
e71225496b Clarify GPL version. 2016-02-21 16:30:48 +00:00
Paul Chote
b396965fd9 Update licence header year. 2016-02-21 16:27:31 +00:00
Paul Chote
88f6daf57f Misc remaining FileSystem cleanups. 2016-02-18 18:12:33 +00:00
Paul Chote
4a12e7bafc Load mod yaml via the virtual filesystem. 2016-02-06 16:30:23 +00:00
Paul Chote
dd963b75f5 Per-terrain color validation. 2016-01-27 21:43:55 +00:00
RoosterDragon
8e89a6a696 Simplify names, remove unused usings, remove redundant casts. 2016-01-17 21:35:36 +00:00
Pavel Penev
861d1368a4 Unhardcode internal terrain palette name from all over the codebase 2016-01-17 19:02:16 +02:00
Pavel Penev
0c51d73be9 Enable use of "custom" palettes per tile Templates
Keep the tileset's palette as default, defined on the tileset, but override it for any tile templates that may want to do so with a palette defined on the template.
2016-01-17 19:02:15 +02:00
Paul Chote
3665d8f19b Send TS terrain depth data to the GPU. 2015-10-17 22:35:07 +01:00
reaperrr
ca055eb7bb Refactored WaterPaletteRotation
Moved RotationBase from tileset definition to WaterPaletteRotation effect.
Unhardcoded rotation range and rotation rate.
Added possibility to exclude Tilesets from effect.

Fixed RA water palette rotation for actors on desert maps (#8872).
2015-09-06 19:25:10 +02:00
atlimit8
8250f223c4 More HashSet trait fields & Lint support 2015-09-05 16:59:30 -05: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
Paul Chote
19c777a922 Move maximum terrain height definition to mod.yaml. 2015-07-05 17:49:56 +01:00
Paul Chote
84e85d8a5d Rename Image -> Images. 2015-03-30 20:20:36 +01:00
Paul Chote
4be5334a0e Add support for TS-style random tile variants. 2015-03-30 19:44:53 +01:00
Paul Chote
b2458fc614 Remove GlobalFilesystem.OpenWithExts. Closes #5272. 2015-03-28 12:38:48 +00:00
Paul Chote
5d0eecd4c5 Don’t crash on bogus TerrainTiles. 2015-03-25 19:59:09 +00:00
Paul Chote
8844defb44 Fix TileSet.Save(). 2015-03-23 20:32:28 +00:00
Matthias Mailänder
2f1aae59eb don't crash so easily 2015-03-23 21:03:26 +01:00
RoosterDragon
1515ac54f6 Enforce a line length limit. 2015-03-19 17:20:34 +00:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
Paul Chote
118275b376 Add terrain geometry visualisation. 2014-11-07 19:18:34 +13:00
Paul Chote
60420340fb Add height map support. 2014-11-07 18:18:41 +13:00
Paul Chote
63f5fc8613 Work around the undesired R8 terrain sprite offsets. 2014-11-05 09:39:55 +13:00
Paul Chote
c3b6f9bef6 Rename TileTemplate -> TerrainTemplateInfo. 2014-11-05 09:39:55 +13:00
Paul Chote
ab2bc789ce TileSet cleanups. 2014-11-05 09:39:54 +13:00
Paul Chote
7d11649fab Add support for per-tile minimap color and height/ramp type. 2014-11-05 09:39:54 +13:00
RoosterDragon
59b3cd154d Change indexes into tile arrays to be stored as bytes to save memory.
The index value needs only be big enough to handle all defined terrain types. This is a low number so we can save memory by defining it as a byte. This particularly saves memory for the CustomTerrain field in the Map class, which defines a cell layer for the map using tile indexes, so we can reduce the size of that layer 4x as a result.
2014-10-09 20:03:01 +01:00
Tiago Sousa
ce68d67f0b Disallow same/similar colors (fixes #2820) 2014-08-30 01:53:38 +01:00
Paul Chote
997216aef0 Use CellLayer for terrain. 2014-06-27 22:07:02 +12:00