forked from MagicBane/Server
Start terrain refactor
This commit is contained in:
+18
-18
@@ -30,17 +30,17 @@ import java.sql.SQLException;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
public class HeightMap {
|
public class Terrain {
|
||||||
|
|
||||||
// Class variables
|
// Class variables
|
||||||
|
|
||||||
public static final HashMap<Integer, HeightMap> heightmapByLoadNum = new HashMap<>();
|
public static final HashMap<Integer, Terrain> heightmapByLoadNum = new HashMap<>();
|
||||||
|
|
||||||
public static final HashMap<Integer, short[][]> _pixelData = new HashMap<>();
|
public static final HashMap<Integer, short[][]> _pixelData = new HashMap<>();
|
||||||
|
|
||||||
// Bootstrap Tracking
|
// Bootstrap Tracking
|
||||||
public static int heightMapsCreated = 0;
|
public static int heightMapsCreated = 0;
|
||||||
public static HeightMap PlayerCityHeightMap;
|
public static Terrain playerCityTerrain;
|
||||||
|
|
||||||
// Heightmap data for this heightmap
|
// Heightmap data for this heightmap
|
||||||
public final int heightMapID;
|
public final int heightMapID;
|
||||||
@@ -60,7 +60,7 @@ public class HeightMap {
|
|||||||
|
|
||||||
public float terrain_scale;
|
public float terrain_scale;
|
||||||
|
|
||||||
public HeightMap(ResultSet rs) throws SQLException {
|
public Terrain(ResultSet rs) throws SQLException {
|
||||||
|
|
||||||
this.heightMapID = rs.getInt("heightMapID");
|
this.heightMapID = rs.getInt("heightMapID");
|
||||||
this.maxHeight = rs.getInt("maxHeight");
|
this.maxHeight = rs.getInt("maxHeight");
|
||||||
@@ -107,13 +107,13 @@ public class HeightMap {
|
|||||||
|
|
||||||
generatePixelData(this);
|
generatePixelData(this);
|
||||||
|
|
||||||
HeightMap.heightmapByLoadNum.put(this.zoneLoadID, this);
|
Terrain.heightmapByLoadNum.put(this.zoneLoadID, this);
|
||||||
|
|
||||||
heightMapsCreated++;
|
heightMapsCreated++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Created for PlayerCities
|
//Created for PlayerCities
|
||||||
public HeightMap() {
|
public Terrain() {
|
||||||
|
|
||||||
this.heightMapID = 999999;
|
this.heightMapID = 999999;
|
||||||
this.maxHeight = 5; // for real...
|
this.maxHeight = 5; // for real...
|
||||||
@@ -149,7 +149,7 @@ public class HeightMap {
|
|||||||
this.terrain_scale = this.maxHeight / 255f;
|
this.terrain_scale = this.maxHeight / 255f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HeightMap(Zone zone) {
|
public Terrain(Zone zone) {
|
||||||
|
|
||||||
this.heightMapID = 999999;
|
this.heightMapID = 999999;
|
||||||
this.maxHeight = 0;
|
this.maxHeight = 0;
|
||||||
@@ -185,15 +185,15 @@ public class HeightMap {
|
|||||||
|
|
||||||
public static void GeneratePlayerCityHeightMap() {
|
public static void GeneratePlayerCityHeightMap() {
|
||||||
|
|
||||||
HeightMap.PlayerCityHeightMap = new HeightMap();
|
Terrain.playerCityTerrain = new Terrain();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void GenerateCustomHeightMap(Zone zone) {
|
public static void GenerateCustomHeightMap(Zone zone) {
|
||||||
|
|
||||||
HeightMap heightMap = new HeightMap(zone);
|
Terrain heightMap = new Terrain(zone);
|
||||||
|
|
||||||
HeightMap.heightmapByLoadNum.put(zone.template, heightMap);
|
Terrain.heightmapByLoadNum.put(zone.template, heightMap);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,9 +260,9 @@ public class HeightMap {
|
|||||||
|
|
||||||
//generate static player city heightmap.
|
//generate static player city heightmap.
|
||||||
|
|
||||||
HeightMap.GeneratePlayerCityHeightMap();
|
Terrain.GeneratePlayerCityHeightMap();
|
||||||
|
|
||||||
Logger.info(HeightMap.heightmapByLoadNum.size() + " Heightmaps cached.");
|
Logger.info(Terrain.heightmapByLoadNum.size() + " Heightmaps cached.");
|
||||||
|
|
||||||
// Load pixel data for heightmaps
|
// Load pixel data for heightmaps
|
||||||
|
|
||||||
@@ -305,19 +305,19 @@ public class HeightMap {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void generatePixelData(HeightMap heightMap) {
|
private static void generatePixelData(Terrain terrain) {
|
||||||
|
|
||||||
Color color;
|
Color color;
|
||||||
|
|
||||||
// Generate altitude lookup table for this heightmap
|
// Generate altitude lookup table for this heightmap
|
||||||
|
|
||||||
heightMap.pixelColorValues = new short[heightMap.heightmapImage.getWidth()][heightMap.heightmapImage.getHeight()];
|
terrain.pixelColorValues = new short[terrain.heightmapImage.getWidth()][terrain.heightmapImage.getHeight()];
|
||||||
|
|
||||||
for (int y = 0; y < heightMap.heightmapImage.getHeight(); y++) {
|
for (int y = 0; y < terrain.heightmapImage.getHeight(); y++) {
|
||||||
for (int x = 0; x < heightMap.heightmapImage.getWidth(); x++) {
|
for (int x = 0; x < terrain.heightmapImage.getWidth(); x++) {
|
||||||
|
|
||||||
color = new Color(heightMap.heightmapImage.getRGB(x, y));
|
color = new Color(terrain.heightmapImage.getRGB(x, y));
|
||||||
heightMap.pixelColorValues[x][y] = (short) color.getRed();
|
terrain.pixelColorValues[x][y] = (short) color.getRed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package engine.db.handlers;
|
package engine.db.handlers;
|
||||||
|
|
||||||
import engine.InterestManagement.HeightMap;
|
import engine.InterestManagement.Terrain;
|
||||||
import engine.gameManager.DbManager;
|
import engine.gameManager.DbManager;
|
||||||
import org.pmw.tinylog.Logger;
|
import org.pmw.tinylog.Logger;
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ public class dbHeightMapHandler extends dbHandlerBase {
|
|||||||
|
|
||||||
public void LOAD_ALL_HEIGHTMAPS() {
|
public void LOAD_ALL_HEIGHTMAPS() {
|
||||||
|
|
||||||
HeightMap thisHeightmap;
|
Terrain thisHeightmap;
|
||||||
HeightMap.heightMapsCreated = 0;
|
Terrain.heightMapsCreated = 0;
|
||||||
|
|
||||||
try (Connection connection = DbManager.getConnection();
|
try (Connection connection = DbManager.getConnection();
|
||||||
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_zone_heightmap INNER JOIN static_zone_size ON static_zone_size.loadNum = static_zone_heightmap.zoneLoadID")) {
|
PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM static_zone_heightmap INNER JOIN static_zone_size ON static_zone_size.loadNum = static_zone_heightmap.zoneLoadID")) {
|
||||||
@@ -27,7 +27,7 @@ public class dbHeightMapHandler extends dbHandlerBase {
|
|||||||
ResultSet rs = preparedStatement.executeQuery();
|
ResultSet rs = preparedStatement.executeQuery();
|
||||||
|
|
||||||
while (rs.next()) {
|
while (rs.next()) {
|
||||||
thisHeightmap = new HeightMap(rs);
|
thisHeightmap = new Terrain(rs);
|
||||||
|
|
||||||
if (thisHeightmap.heightmapImage == null) {
|
if (thisHeightmap.heightmapImage == null) {
|
||||||
Logger.info("Imagemap for " + thisHeightmap.heightMapID + " was null");
|
Logger.info("Imagemap for " + thisHeightmap.heightMapID + " was null");
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
package engine.devcmd.cmds;
|
package engine.devcmd.cmds;
|
||||||
|
|
||||||
import engine.InterestManagement.HeightMap;
|
import engine.InterestManagement.Terrain;
|
||||||
import engine.devcmd.AbstractDevCmd;
|
import engine.devcmd.AbstractDevCmd;
|
||||||
import engine.gameManager.ZoneManager;
|
import engine.gameManager.ZoneManager;
|
||||||
import engine.math.Bounds;
|
import engine.math.Bounds;
|
||||||
@@ -33,11 +33,11 @@ public class GetHeightCmd extends AbstractDevCmd {
|
|||||||
Zone heightmapZone;
|
Zone heightmapZone;
|
||||||
|
|
||||||
currentZone = ZoneManager.findSmallestZone(playerCharacter.getLoc());
|
currentZone = ZoneManager.findSmallestZone(playerCharacter.getLoc());
|
||||||
heightmapZone = HeightMap.getNextZoneWithTerrain(currentZone);
|
heightmapZone = Terrain.getNextZoneWithTerrain(currentZone);
|
||||||
parentZone = HeightMap.getNextZoneWithTerrain(currentZone.parent);
|
parentZone = Terrain.getNextZoneWithTerrain(currentZone.parent);
|
||||||
|
|
||||||
float currentHeight = HeightMap.getWorldHeight(currentZone, playerCharacter.getLoc());
|
float currentHeight = Terrain.getWorldHeight(currentZone, playerCharacter.getLoc());
|
||||||
float parentHeight = HeightMap.getWorldHeight(parentZone, playerCharacter.getLoc());
|
float parentHeight = Terrain.getWorldHeight(parentZone, playerCharacter.getLoc());
|
||||||
|
|
||||||
Vector2f zoneLoc = ZoneManager.worldToZoneSpace(playerCharacter.getLoc(), heightmapZone);
|
Vector2f zoneLoc = ZoneManager.worldToZoneSpace(playerCharacter.getLoc(), heightmapZone);
|
||||||
Vector2f gridSquare = heightmapZone.getHeightMap().getTerrainCell(zoneLoc);
|
Vector2f gridSquare = heightmapZone.getHeightMap().getTerrainCell(zoneLoc);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
package engine.gameManager;
|
package engine.gameManager;
|
||||||
|
|
||||||
import engine.Enum.*;
|
import engine.Enum.*;
|
||||||
import engine.InterestManagement.HeightMap;
|
import engine.InterestManagement.Terrain;
|
||||||
import engine.InterestManagement.WorldGrid;
|
import engine.InterestManagement.WorldGrid;
|
||||||
import engine.db.handlers.dbEffectsBaseHandler;
|
import engine.db.handlers.dbEffectsBaseHandler;
|
||||||
import engine.db.handlers.dbPowerHandler;
|
import engine.db.handlers.dbPowerHandler;
|
||||||
@@ -1772,7 +1772,7 @@ public enum PowersManager {
|
|||||||
} else {
|
} else {
|
||||||
targetLoc = tl;
|
targetLoc = tl;
|
||||||
try {
|
try {
|
||||||
targetLoc = targetLoc.setY(HeightMap.getWorldHeight(targetLoc)); //on ground
|
targetLoc = targetLoc.setY(Terrain.getWorldHeight(targetLoc)); //on ground
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error(e);
|
Logger.error(e);
|
||||||
targetLoc = tl;
|
targetLoc = tl;
|
||||||
@@ -1974,7 +1974,7 @@ public enum PowersManager {
|
|||||||
} else {
|
} else {
|
||||||
targetLoc = tl;
|
targetLoc = tl;
|
||||||
try {
|
try {
|
||||||
targetLoc = targetLoc.setY(HeightMap.getWorldHeight(targetLoc)); //on ground
|
targetLoc = targetLoc.setY(Terrain.getWorldHeight(targetLoc)); //on ground
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error(e);
|
Logger.error(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
package engine.gameManager;
|
package engine.gameManager;
|
||||||
|
|
||||||
import engine.Enum;
|
import engine.Enum;
|
||||||
import engine.InterestManagement.HeightMap;
|
import engine.InterestManagement.Terrain;
|
||||||
import engine.db.archive.CityRecord;
|
import engine.db.archive.CityRecord;
|
||||||
import engine.db.archive.DataWarehouse;
|
import engine.db.archive.DataWarehouse;
|
||||||
import engine.math.Bounds;
|
import engine.math.Bounds;
|
||||||
@@ -468,7 +468,7 @@ public enum ZoneManager {
|
|||||||
|
|
||||||
// return height from heightmap engine at zone location
|
// return height from heightmap engine at zone location
|
||||||
|
|
||||||
worldAlttitude = HeightMap.getWorldHeight(zone.parent, zone.getLoc());
|
worldAlttitude = Terrain.getWorldHeight(zone.parent, zone.getLoc());
|
||||||
|
|
||||||
// Add zone offset to value
|
// Add zone offset to value
|
||||||
|
|
||||||
@@ -479,7 +479,7 @@ public enum ZoneManager {
|
|||||||
|
|
||||||
public static boolean isLocUnderwater(Vector3fImmutable currentLoc) {
|
public static boolean isLocUnderwater(Vector3fImmutable currentLoc) {
|
||||||
|
|
||||||
float localAltitude = HeightMap.getWorldHeight(currentLoc);
|
float localAltitude = Terrain.getWorldHeight(currentLoc);
|
||||||
Zone zone = findSmallestZone(currentLoc);
|
Zone zone = findSmallestZone(currentLoc);
|
||||||
|
|
||||||
return localAltitude < zone.seaLevel;
|
return localAltitude < zone.seaLevel;
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ package engine.objects;
|
|||||||
|
|
||||||
import engine.Enum;
|
import engine.Enum;
|
||||||
import engine.Enum.*;
|
import engine.Enum.*;
|
||||||
import engine.InterestManagement.HeightMap;
|
|
||||||
import engine.InterestManagement.InterestManager;
|
import engine.InterestManagement.InterestManager;
|
||||||
import engine.InterestManagement.WorldGrid;
|
import engine.InterestManagement.WorldGrid;
|
||||||
import engine.exception.SerializationException;
|
import engine.exception.SerializationException;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import engine.Enum.DispatchChannel;
|
|||||||
import engine.Enum.EffectSourceType;
|
import engine.Enum.EffectSourceType;
|
||||||
import engine.Enum.GameObjectType;
|
import engine.Enum.GameObjectType;
|
||||||
import engine.Enum.GridObjectType;
|
import engine.Enum.GridObjectType;
|
||||||
import engine.InterestManagement.HeightMap;
|
import engine.InterestManagement.Terrain;
|
||||||
import engine.InterestManagement.WorldGrid;
|
import engine.InterestManagement.WorldGrid;
|
||||||
import engine.job.AbstractScheduleJob;
|
import engine.job.AbstractScheduleJob;
|
||||||
import engine.job.JobContainer;
|
import engine.job.JobContainer;
|
||||||
@@ -506,7 +506,7 @@ public abstract class AbstractWorldObject extends AbstractGameObject {
|
|||||||
if(this instanceof AbstractCharacter && this.region != null){
|
if(this instanceof AbstractCharacter && this.region != null){
|
||||||
this.loc = this.loc.setY(this.region.lerpY(this) + this.getAltitude());
|
this.loc = this.loc.setY(this.region.lerpY(this) + this.getAltitude());
|
||||||
} else{
|
} else{
|
||||||
this.loc = this.loc.setY(HeightMap.getWorldHeight(this.getLoc()) + this.getAltitude());
|
this.loc = this.loc.setY(Terrain.getWorldHeight(this.getLoc()) + this.getAltitude());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ package engine.objects;
|
|||||||
|
|
||||||
import engine.Enum;
|
import engine.Enum;
|
||||||
import engine.Enum.*;
|
import engine.Enum.*;
|
||||||
import engine.InterestManagement.HeightMap;
|
|
||||||
import engine.InterestManagement.RealmMap;
|
import engine.InterestManagement.RealmMap;
|
||||||
|
import engine.InterestManagement.Terrain;
|
||||||
import engine.InterestManagement.WorldGrid;
|
import engine.InterestManagement.WorldGrid;
|
||||||
import engine.db.archive.CityRecord;
|
import engine.db.archive.CityRecord;
|
||||||
import engine.db.archive.DataWarehouse;
|
import engine.db.archive.DataWarehouse;
|
||||||
@@ -206,7 +206,7 @@ public class Building extends AbstractWorldObject {
|
|||||||
// Altitude of this building is derived from the heightmap engine.
|
// Altitude of this building is derived from the heightmap engine.
|
||||||
|
|
||||||
Vector3fImmutable tempLoc = new Vector3fImmutable(this.statLat + this.parentZone.absX, 0, this.statLon + this.parentZone.absZ);
|
Vector3fImmutable tempLoc = new Vector3fImmutable(this.statLat + this.parentZone.absX, 0, this.statLon + this.parentZone.absZ);
|
||||||
tempLoc = new Vector3fImmutable(tempLoc.x, HeightMap.getWorldHeight(tempLoc), tempLoc.z);
|
tempLoc = new Vector3fImmutable(tempLoc.x, Terrain.getWorldHeight(tempLoc), tempLoc.z);
|
||||||
this.setLoc(tempLoc);
|
this.setLoc(tempLoc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ package engine.objects;
|
|||||||
|
|
||||||
import engine.Enum;
|
import engine.Enum;
|
||||||
import engine.Enum.*;
|
import engine.Enum.*;
|
||||||
import engine.InterestManagement.HeightMap;
|
|
||||||
import engine.InterestManagement.RealmMap;
|
import engine.InterestManagement.RealmMap;
|
||||||
|
import engine.InterestManagement.Terrain;
|
||||||
import engine.InterestManagement.WorldGrid;
|
import engine.InterestManagement.WorldGrid;
|
||||||
import engine.db.archive.CityRecord;
|
import engine.db.archive.CityRecord;
|
||||||
import engine.db.archive.DataWarehouse;
|
import engine.db.archive.DataWarehouse;
|
||||||
@@ -588,7 +588,7 @@ public class City extends AbstractWorldObject {
|
|||||||
this.setBounds(cityBounds);
|
this.setBounds(cityBounds);
|
||||||
|
|
||||||
if (zone.getHeightMap() == null && this.isNpc == 1 && this.getObjectUUID() != 1213) {
|
if (zone.getHeightMap() == null && this.isNpc == 1 && this.getObjectUUID() != 1213) {
|
||||||
HeightMap.GenerateCustomHeightMap(zone);
|
Terrain.GenerateCustomHeightMap(zone);
|
||||||
Logger.info(zone.zoneName + " created custom heightmap");
|
Logger.info(zone.zoneName + " created custom heightmap");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ package engine.objects;
|
|||||||
|
|
||||||
import engine.Enum;
|
import engine.Enum;
|
||||||
import engine.Enum.*;
|
import engine.Enum.*;
|
||||||
import engine.InterestManagement.HeightMap;
|
|
||||||
import engine.InterestManagement.InterestManager;
|
import engine.InterestManagement.InterestManager;
|
||||||
import engine.InterestManagement.RealmMap;
|
import engine.InterestManagement.RealmMap;
|
||||||
|
import engine.InterestManagement.Terrain;
|
||||||
import engine.InterestManagement.WorldGrid;
|
import engine.InterestManagement.WorldGrid;
|
||||||
import engine.db.archive.CharacterRecord;
|
import engine.db.archive.CharacterRecord;
|
||||||
import engine.db.archive.DataWarehouse;
|
import engine.db.archive.DataWarehouse;
|
||||||
@@ -4760,7 +4760,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
// If char is flying they aren't quite swimming
|
// If char is flying they aren't quite swimming
|
||||||
try {
|
try {
|
||||||
|
|
||||||
float localAltitude = HeightMap.getWorldHeight(currentLoc);
|
float localAltitude = Terrain.getWorldHeight(currentLoc);
|
||||||
|
|
||||||
Zone zone = ZoneManager.findSmallestZone(currentLoc);
|
Zone zone = ZoneManager.findSmallestZone(currentLoc);
|
||||||
|
|
||||||
@@ -4832,7 +4832,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
} else
|
} else
|
||||||
this.altitude = this.getDesiredAltitude();
|
this.altitude = this.getDesiredAltitude();
|
||||||
|
|
||||||
this.loc = this.loc.setY(HeightMap.getWorldHeight(this.getLoc()) + this.getAltitude());
|
this.loc = this.loc.setY(Terrain.getWorldHeight(this.getLoc()) + this.getAltitude());
|
||||||
|
|
||||||
this.setTakeOffTime(0);
|
this.setTakeOffTime(0);
|
||||||
MovementManager.finishChangeAltitude(this, this.getDesiredAltitude());
|
MovementManager.finishChangeAltitude(this, this.getDesiredAltitude());
|
||||||
@@ -4840,7 +4840,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loc = this.loc.setY(HeightMap.getWorldHeight(this.getLoc()) + this.getAltitude());
|
this.loc = this.loc.setY(Terrain.getWorldHeight(this.getLoc()) + this.getAltitude());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasBoon() {
|
public boolean hasBoon() {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
package engine.objects;
|
package engine.objects;
|
||||||
|
|
||||||
import engine.Enum;
|
import engine.Enum;
|
||||||
import engine.InterestManagement.HeightMap;
|
import engine.InterestManagement.Terrain;
|
||||||
import engine.db.archive.DataWarehouse;
|
import engine.db.archive.DataWarehouse;
|
||||||
import engine.gameManager.DbManager;
|
import engine.gameManager.DbManager;
|
||||||
import engine.gameManager.ZoneManager;
|
import engine.gameManager.ZoneManager;
|
||||||
@@ -193,15 +193,15 @@ public class Zone extends AbstractGameObject {
|
|||||||
else
|
else
|
||||||
bounds.setBounds(new Vector2f(this.absX, this.absZ), new Vector2f(Enum.CityBoundsType.ZONE.halfExtents, Enum.CityBoundsType.ZONE.halfExtents), 0.0f);
|
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
|
// Set heightmap blending bounds
|
||||||
|
|
||||||
if (heightMap == null) {
|
if (terrain == null) {
|
||||||
this.blendBounds = bounds;
|
this.blendBounds = bounds;
|
||||||
} else {
|
} else {
|
||||||
this.blendBounds = Bounds.borrow();
|
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.
|
// Return heightmap for this Zone.
|
||||||
|
|
||||||
public HeightMap getHeightMap() {
|
public Terrain getHeightMap() {
|
||||||
|
|
||||||
if (this.guild_zone)
|
if (this.guild_zone)
|
||||||
return HeightMap.PlayerCityHeightMap;
|
return Terrain.playerCityTerrain;
|
||||||
|
|
||||||
return HeightMap.heightmapByLoadNum.get(this.template);
|
return Terrain.heightmapByLoadNum.get(this.template);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ import engine.Enum;
|
|||||||
import engine.Enum.DispatchChannel;
|
import engine.Enum.DispatchChannel;
|
||||||
import engine.Enum.MinionType;
|
import engine.Enum.MinionType;
|
||||||
import engine.Enum.SupportMsgType;
|
import engine.Enum.SupportMsgType;
|
||||||
import engine.InterestManagement.HeightMap;
|
|
||||||
import engine.InterestManagement.RealmMap;
|
import engine.InterestManagement.RealmMap;
|
||||||
|
import engine.InterestManagement.Terrain;
|
||||||
import engine.InterestManagement.WorldGrid;
|
import engine.InterestManagement.WorldGrid;
|
||||||
import engine.db.archive.DataWarehouse;
|
import engine.db.archive.DataWarehouse;
|
||||||
import engine.db.handlers.dbRuneBaseHandler;
|
import engine.db.handlers.dbRuneBaseHandler;
|
||||||
@@ -385,7 +385,7 @@ public class WorldServer {
|
|||||||
Blueprint.loadAllBlueprints();
|
Blueprint.loadAllBlueprints();
|
||||||
|
|
||||||
Logger.info("Initializing Heightmap data");
|
Logger.info("Initializing Heightmap data");
|
||||||
HeightMap.loadAlHeightMaps();
|
Terrain.loadAlHeightMaps();
|
||||||
|
|
||||||
Logger.info("Loading Race data");
|
Logger.info("Loading Race data");
|
||||||
Enum.RaceType.initRaceTypeTables();
|
Enum.RaceType.initRaceTypeTables();
|
||||||
|
|||||||
Reference in New Issue
Block a user