mirror of
https://github.com/glest/glest-source.git
synced 2025-10-01 09:56:41 +02:00
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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user