Commit Graph

194 Commits

Author SHA1 Message Date
Paul Chote
3665d8f19b Send TS terrain depth data to the GPU. 2015-10-17 22:35:07 +01: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
atlimit8
9acf121eb1 Replace ActorInfo.Traits.WithInterface with ActorInfo.TraitInfos<T>() 2015-09-21 15:50:57 -05: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
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
Matthias Mailänder
72dffe3391 dispose res properly 2015-08-29 18:47:10 +02:00
clemty
2bbc1fcda4 LUA and trait documentation fixes
- Typo in documentation ("proximitry").
- Add spaces between sentences.
- Remove most occurrences of "  " (two spaces) unless clearly used as indendation
- Punctuation (although no fullstop after filenames like "notifications.yaml").
2015-08-24 19:41:15 +02:00
Pavel Penev
02dd5afbd9 Merge pull request #9058 from RoosterDragon/reduce-alloc
Reduce allocations in the main game loop
2015-08-24 02:11:08 +03:00
Pavel Penev
09f67d18bb Some internal "race" to "faction" renaming 2015-08-22 23:34:36 +03: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
Matthias Mailänder
e428e6d8cc remove executable bits from source code 2015-08-06 18:05:50 +02: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
Paul Chote
e337710221 Implement height-aware map.ChooseRandomCell(). 2015-07-31 08:38:06 +01:00
Paul Chote
13e0527f7c Implement height-aware map.Clamp(MPos). 2015-07-30 08:18:45 +01:00
Paul Chote
2c00019715 Revert "Temporarily work around RadarWidget corruption."
This reverts commit 4bc75f1ed6.
2015-07-30 08:18:45 +01:00
Paul Chote
4bc75f1ed6 Temporarily work around RadarWidget corruption. 2015-07-27 20:20:01 +01:00
Paul Chote
e8794032e0 Introduce initial PPos plumbing.
PPos is best thought of as a cell grid applied in
screen space.  Multiple cells with different
terrain heights may be projected to the same PPos,
or to multiple PPos if they do not align with the
screen grid.

PPos coordinates are used primarily for map edge
checks and shroud / visibility queries.
2015-07-27 19:34:49 +01:00
Paul Chote
fb5bcd3889 Extract MapCoordsRegion from CellRegion. 2015-07-27 19:34:39 +01:00
penev92
7c1ef2231d Rename RaceInit to FactionInit 2015-07-25 00:39:31 +03:00
Oliver Brakmann
380cf22477 Merge pull request #8661 from penev92/bleed_renameCountry
Rename the Country trait to Faction
2015-07-14 21:05:52 +02:00
Oliver Brakmann
4ed7a4ce8a Merge pull request #8659 from penev92/bleed_playerReference
Rename PlayerReference.Race to Faction
2015-07-14 20:15:56 +02:00
penev92
2e04fb5ddd Rename Faction trait members
Rename Faction.Race to Faction.InternalName
2015-07-14 18:50:39 +03:00
penev92
a1af5386e0 Rename the Country trait to Faction 2015-07-14 18:50:31 +03:00
Matthias Mailänder
7447e0bf93 rename WRange to WDist 2015-07-09 10:55:38 +02:00
penev92
1d49c23af0 Rename PlayerReference.Race and LockRace to Faction and LockFaction 2015-07-05 23:08:49 +03:00
Paul Chote
19c777a922 Move maximum terrain height definition to mod.yaml. 2015-07-05 17:49:56 +01:00
Paul Chote
7d62ac2b12 Merge RulesetCache.LoadDefaultRules and LoadMapRules. 2015-07-05 14:58:00 +01:00
Paul Chote
e10cb5cd9c Fix an incorrect coordinate check. 2015-07-05 14:57:59 +01:00
Paul Chote
b8b27f11af Remove stub map constructor. 2015-07-05 14:57:58 +01:00
Paul Chote
0dbbc00d0a Simplify editor/importer map creation. 2015-07-05 14:57:58 +01:00
Paul Chote
41fa77d12a Fix projected world coordinate calculation for Lua API. 2015-07-05 14:57:58 +01:00
Oliver Brakmann
fc7df415d7 Merge pull request #8394 from Mailaender/map-container-nre
Fixed a null reference exception in Map.Save
2015-06-20 21:06:00 +02:00
Matthias Mailänder
330982310c avoid a null reference exception 2015-06-20 15:56:26 +02:00
Paul Chote
da3abb4e2e Tweak shroud revealing logic
The per-actor visibility now tracks all cells
inside the map area (including those outside the
currently visible bounds), but the shroud/fog is
only cleared if the cell is inside the currently
visible bounds.
2015-06-15 18:06:42 +01:00
Paul Chote
ba2d499e5d Fix a bug in Map/CellLayer.Contains. 2015-06-11 21:27:35 +01:00
Paul Chote
d21b63ca04 Add some more coordinate utility functions. 2015-06-11 20:59:35 +01:00
Paul Chote
ec576558c0 Generate shroud cells outside the map. 2015-06-07 19:15:11 +01:00
Paul Chote
bf4722fb9f Distinguish between all map cells and cells inside map bounds. 2015-06-02 21:53:25 +01:00
Oliver Brakmann
dc08b7a90a Add buttons for map file management to map chooser 2015-05-24 01:49:30 +02:00
Matthias Mailänder
9c53ff1403 Merge pull request #8103 from RoosterDragon/mapcache-better-threading
Fix graphical glitches & crashes related to map loading
2015-05-20 13:11:44 +02:00
Paul Chote
d211fe9fe1 Add the world components of the new editor. 2015-05-15 17:09:20 +01:00
RoosterDragon
3b5a672848 Always access the SheetBuilder from the main thread in MapCache.
Not doing this can occasionally this can result in a cross thread call to the backing texture which leads to bad things. This stops trying to be clever regarding the thread safety invariants exposed by SheetBuilder and does things simply and safely: All updates happen on the main thread.
2015-05-07 20:58:59 +01:00