Objects and ressources under the mouse are displayed.

Hitting space can be used to select the brush for objects/ressources currently under the mouse.
This commit is contained in:
Titus Tscharntke
2010-03-08 00:28:42 +00:00
parent 983d8475c9
commit 3041efaa77
4 changed files with 64 additions and 5 deletions

View File

@@ -155,6 +155,28 @@ Program::~Program() {
delete map;
}
int Program::getObject(int x, int y) {
int i=(x - ofsetX) / cellSize;
int j= (y + ofsetY) / cellSize;
if (map->inside(i, j)) {
map->getObject(i,j);
}
else{
return 0;
}
}
int Program::getResource(int x, int y) {
int i=(x - ofsetX) / cellSize;
int j= (y + ofsetY) / cellSize;
if (map->inside(i, j)) {
map->getResource(i,j);
}
else{
return 0;
}
}
void Program::glestChangeMapHeight(int x, int y, int Height, int radius) {
map->glestChangeHeight((x - ofsetX) / cellSize, (y + ofsetY) / cellSize, Height, radius);
}