Start terrain refactor

This commit is contained in:
2023-10-08 09:18:43 -04:00
parent ffb541a12e
commit 0d75e6db9b
12 changed files with 52 additions and 53 deletions
+7 -7
View File
@@ -10,7 +10,7 @@
package engine.objects;
import engine.Enum;
import engine.InterestManagement.HeightMap;
import engine.InterestManagement.Terrain;
import engine.db.archive.DataWarehouse;
import engine.gameManager.DbManager;
import engine.gameManager.ZoneManager;
@@ -193,15 +193,15 @@ public class Zone extends AbstractGameObject {
else
bounds.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.halfExtents, Enum.CityBoundsType.ZONE.halfExtents), 0.0f);
HeightMap heightMap = this.getHeightMap();
Terrain terrain = this.getHeightMap();
// Set heightmap blending bounds
if (heightMap == null) {
if (terrain == null) {
this.blendBounds = bounds;
} else {
this.blendBounds = Bounds.borrow();
this.blendBounds.setBounds(new Vector2f(this.absX, this.absZ), bounds.getHalfExtents().subtract(heightMap.zone_minBlend, heightMap.zone_minBlend), 0.0f);
this.blendBounds.setBounds(new Vector2f(this.absX, this.absZ), bounds.getHalfExtents().subtract(terrain.zone_minBlend, terrain.zone_minBlend), 0.0f);
}
}
@@ -325,12 +325,12 @@ public class Zone extends AbstractGameObject {
// Return heightmap for this Zone.
public HeightMap getHeightMap() {
public Terrain getHeightMap() {
if (this.guild_zone)
return HeightMap.PlayerCityHeightMap;
return Terrain.playerCityTerrain;
return HeightMap.heightmapByLoadNum.get(this.template);
return Terrain.heightmapByLoadNum.get(this.template);
}
}