Skip to content

Commit

Permalink
Updated groundwar planet surface rendering: (#1170)
Browse files Browse the repository at this point in the history
- Surface and radar minimap are drawn into a buffered image that is then drawn to the screen. The images are redrawn only in case of an event that changes the visual appearance of the planet surface.
  - Radar minimap is transformed to a rectangle and added an orange rectangle as a frame to resemble the og ig minimap.
  • Loading branch information
hemoridos authored Sep 4, 2024
1 parent fda5609 commit 2e2d455
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 95 deletions.
2 changes: 1 addition & 1 deletion src/hu/openig/gfx/ColonyGFX.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class ColonyGFX {
/** The tile crossed. */
@Img(name = "colony/tile_1x1_selected_crossed")
public BufferedImage tileCrossed;
/** The tile crossed. */
/** The tile paved. */
@Img(name = "colony/tile_1x1_pavement")
public BufferedImage tilePavement;
/** Upgrade panel. */
Expand Down
8 changes: 8 additions & 0 deletions src/hu/openig/model/PlanetSurface.java
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,14 @@ public boolean hasRoad(int x, int y) {
public boolean hasCrossRoad(int x, int y) {
return (surfaceArray[getArrayIndexForLocation(x, y)] & CROSSROAD) != 0;
}
/**
* Check if a location has building on it.
* @param loc the location
* @return true if surface tile has building on it
*/
public boolean hasBuilding(Location loc) {
return (surfaceArray[getArrayIndexForLocation(loc.x, loc.y)] & BUILDING) != 0;
}
/**
* Check if a cell is buildable.
* @param x the X coordinate
Expand Down
Loading

0 comments on commit 2e2d455

Please sign in to comment.