more fixes for editor

This commit is contained in:
nosogo
2010-12-05 01:33:28 +00:00
parent 81683509d9
commit f545edad68
15 changed files with 120 additions and 76 deletions

View File

@@ -146,6 +146,7 @@ MapPreview *Program::map = NULL;
Program::Program(int w, int h) {
cellSize = 6;
grid=false;
ofsetX = 0;
ofsetY = 0;
map = new MapPreview();
@@ -178,6 +179,7 @@ int Program::getResource(int x, int y) {
}
}
// TODO: move editor-specific code from shared_lib to here.
void Program::glestChangeMapHeight(int x, int y, int Height, int radius) {
map->glestChangeHeight((x - ofsetX) / cellSize, (y + ofsetY) / cellSize, Height, radius);
}
@@ -238,7 +240,7 @@ bool Program::redo() {
}
void Program::renderMap(int w, int h) {
renderer.renderMap(map, ofsetX, ofsetY, w, h, cellSize);
renderer.renderMap(map, ofsetX, ofsetY, w, h, cellSize, grid);
}
void Program::setRefAlt(int x, int y) {
@@ -444,6 +446,11 @@ void Program::resetOfset() {
cellSize = 6;
}
bool Program::setGridOnOff() {
grid=!grid;
return grid;
}
void Program::setMapAdvanced(int altFactor, int waterLevel) {
map->setAdvanced(altFactor, waterLevel);
}