mirror of
https://github.com/glest/glest-source.git
synced 2025-08-26 09:24:24 +02:00
up to 36 units selectable; maps can set camera heigth now ( be careful with this for performance reasons! )
This commit is contained in:
@@ -75,7 +75,8 @@ struct MapFileHeader {
|
||||
int8 short_desc[MAX_DESCRIPTION_LENGTH_VERSION2];
|
||||
int32 magic; // 0x01020304 for meta
|
||||
int32 cliffLevel;
|
||||
int8 meta[120];
|
||||
int32 cameraHeight;
|
||||
int8 meta[116];
|
||||
} version2;
|
||||
};
|
||||
};
|
||||
@@ -113,6 +114,7 @@ private:
|
||||
int heightFactor;
|
||||
int waterLevel;
|
||||
int cliffLevel;
|
||||
int cameraHeight;
|
||||
//Cell **cells;
|
||||
std::vector<std::vector<Cell> > cells;
|
||||
|
||||
@@ -136,10 +138,12 @@ public:
|
||||
int getHeightFactor() const{return heightFactor;}
|
||||
int getWaterLevel() const{return waterLevel;}
|
||||
int getCliffLevel() const{return cliffLevel;}
|
||||
int getCameraHeight() const{return cameraHeight;}
|
||||
|
||||
bool inside(int x, int y);
|
||||
|
||||
void setRefAlt(int x, int y);
|
||||
void setAdvanced(int heightFactor, int waterLevel, int cliffLevel);
|
||||
void setAdvanced(int heightFactor, int waterLevel, int cliffLevel, int cameraHeight);
|
||||
void setTitle(const string &title);
|
||||
void setDesc(const string &desc);
|
||||
void setAuthor(const string &author);
|
||||
|
@@ -32,6 +32,7 @@ MapPreview::MapPreview() {
|
||||
heightFactor = DEFAULT_MAP_CELL_HEIGHT_FACTOR;
|
||||
waterLevel = DEFAULT_MAP_WATER_DEPTH;
|
||||
cliffLevel = DEFAULT_CLIFF_HEIGHT;
|
||||
cameraHeight = 0;
|
||||
//cells = NULL;
|
||||
cells.clear();
|
||||
//startLocations = NULL;
|
||||
@@ -630,10 +631,11 @@ void MapPreview::setAuthor(const string &author) {
|
||||
this->author = author;
|
||||
}
|
||||
|
||||
void MapPreview::setAdvanced(int heightFactor, int waterLevel, int cliffLevel) {
|
||||
void MapPreview::setAdvanced(int heightFactor, int waterLevel, int cliffLevel, int cameraHeight) {
|
||||
this->heightFactor = heightFactor;
|
||||
this->waterLevel = waterLevel;
|
||||
this->cliffLevel = cliffLevel;
|
||||
this->cameraHeight = cameraHeight;
|
||||
}
|
||||
|
||||
void MapPreview::randomizeHeights() {
|
||||
@@ -697,6 +699,7 @@ void MapPreview::loadFromFile(const string &path) {
|
||||
else if(header.version==2){
|
||||
desc = header.version2.short_desc;
|
||||
cliffLevel=header.version2.cliffLevel;
|
||||
cameraHeight=header.version2.cameraHeight;
|
||||
}
|
||||
|
||||
//read start locations
|
||||
@@ -764,6 +767,7 @@ void MapPreview::saveToFile(const string &path) {
|
||||
strncpy(header.version2.short_desc, desc.c_str(), MAX_DESCRIPTION_LENGTH_VERSION2);
|
||||
header.version2.magic= 0x01020304;
|
||||
header.version2.cliffLevel= cliffLevel;
|
||||
header.version2.cameraHeight= cameraHeight;
|
||||
|
||||
|
||||
fwrite(&header, sizeof(MapFileHeader), 1, f1);
|
||||
|
Reference in New Issue
Block a user