Loading [MathJax]/extensions/MathZoom.js
 |
Cytopia
0.3
A city building simulation game
|
#include <Map.hxx>
Definition at line 23 of file Map.hxx.
◆ Map() [1/4]
| Map::Map |
( |
int |
columns, |
|
|
int |
rows, |
|
|
const bool |
generateTerrain |
|
) |
| |
◆ Map() [2/4]
| Map::Map |
( |
int |
columns, |
|
|
int |
rows |
|
) |
| |
◆ ~Map()
◆ Map() [3/4]
◆ Map() [4/4]
◆ calculateVisibleMap()
| void Map::calculateVisibleMap |
( |
void |
| ) |
|
|
private |
For implementing frustum culling, find all map nodes which are visible on the screen. Only visible nodes will be rendered.
Definition at line 128 of file Map.cxx.
134 const int left = topLeft.
x + topLeft.
y - 2;
135 const int right = bottomRight.x + bottomRight.y + 1;
136 const int top = topLeft.
y - topLeft.
x + 1;
145 for (
int x = 0; x <
m_rows; x++)
147 const int xVal = x + y;
148 const int yVal = y - x;
150 if ((xVal >= left) && (xVal <= right) && (yVal <= top) && (yVal >= bottom))
◆ getMapNode()
Get pointer to a single mapNode at specific iso coordinates.
- Parameters
-
| isoCoords | The node to retrieve. |
Definition at line 54 of file Map.hxx.
◆ getMapNodes()
| const std::vector<MapNode>& Map::getMapNodes |
( |
| ) |
|
|
inlineprivate |
Get all mapnodes as a vector.
Definition at line 58 of file Map.hxx.
◆ operator=() [1/2]
| Map& Map::operator= |
( |
const Map & |
other | ) |
|
|
delete |
◆ operator=() [2/2]
| const Map& Map::operator= |
( |
Map && |
fp | ) |
|
|
delete |
◆ refresh()
Refresh all the map tile textures.
- See also
- Sprite::refresh
Definition at line 114 of file Map.cxx.
116 #ifdef MICROPROFILE_ENABLED
117 MICROPROFILE_SCOPEI(
"Map",
"Refresh Map", MP_YELLOW);
◆ renderMap()
| void Map::renderMap |
( |
| ) |
const |
Render the elements contained in the Map.
call the render() function of the sprite in the all contained MapNode elements
- See also
- Sprite::render
Definition at line 102 of file Map.cxx.
104 #ifdef MICROPROFILE_ENABLED
105 MICROPROFILE_SCOPEI(
"Map",
"Render Map", MP_YELLOW);
◆ MapFunctions
◆ m_columns
◆ m_rows
◆ m_saveGameVersion
| const size_t Map::m_saveGameVersion |
|
staticprivate |
◆ m_terrainGen
◆ m_visibleNodesCount
| int Map::m_visibleNodesCount = 0 |
|
private |
◆ mapNodes
◆ mapNodesInDrawingOrder
| std::vector<MapNode *> Map::mapNodesInDrawingOrder |
|
private |
◆ pMapNodesVisible
| Sprite** Map::pMapNodesVisible |
|
private |
◆ randomEngine
| std::default_random_engine Map::randomEngine |
|
private |
The documentation for this class was generated from the following files:
std::vector< MapNode > mapNodes
TerrainGenerator m_terrainGen
int toIndex() const
calculates the index (stride) that can be used to access in Map to access mapNodes vector.
static void enableLayers(std::vector< unsigned int > &&layers)
Enable drawing layers.
Point calculateIsoCoordinates(const SDL_Point &screenCoordinates)
Calculates screen space coordinates to isometric space coordinates.
ScreenDimension screenHeight
the screen height
@ POWERLINES
9- Powerlines
void generateTerrain(std::vector< MapNode > &mapNodes, std::vector< MapNode * > &mapNodesInDrawingOrder)
static const int maxHeight
Maximum height of the node.
@ GROUND_DECORATION
Remove only ground decoration.
int mapSize
the size of the map
ScreenDimension screenWidth
the screen width
Class that holds map nodes.
@ ZONE
4- Optional layer, zones(Industrial/Residential/Commercial).
void generateRiver(std::vector< MapNode > &mapNodes)
@ BUILDINGS
8- Buildings, Streets and everything that goes on the terrain
const std::string DEFAULT_TERRAIN
MapNode & getMapNode(Point isoCoords)
Get pointer to a single mapNode at specific iso coordinates.
@ FLORA
10- Trees and other flora/Fauna tiles
std::vector< MapNode * > mapNodesInDrawingOrder
void calculateVisibleMap(void)
For implementing frustum culling, find all map nodes which are visible on the screen....
std::default_random_engine randomEngine
@ ROAD
5- Optional layer, roads.
@ TERRAIN
Default "overworld" edit mode.
void refresh(const Layer &layer=Layer::NONE)
static Settings & instance(void)
Get an instance of the singleton.
Sprite ** pMapNodesVisible