Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/MiniMapTexture.h
Property | Old Value | New Value |
---|---|---|
svn:eol-style | null | native \ No newline at end of property |
/* Copyright (C) 2021 Wildfire Games. | ||||||||||
* This file is part of 0 A.D. | ||||||||||
* | ||||||||||
* 0 A.D. is free software: you can redistribute it and/or modify | ||||||||||
* it under the terms of the GNU General Public License as published by | ||||||||||
* the Free Software Foundation, either version 2 of the License, or | ||||||||||
* (at your option) any later version. | ||||||||||
* | ||||||||||
* 0 A.D. is distributed in the hope that it will be useful, | ||||||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||||||||
* GNU General Public License for more details. | ||||||||||
* | ||||||||||
* You should have received a copy of the GNU General Public License | ||||||||||
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | ||||||||||
*/ | ||||||||||
#ifndef INCLUDED_MINIMAPTEXTURE | ||||||||||
#define INCLUDED_MINIMAPTEXTURE | ||||||||||
#include "graphics/ShaderTechniquePtr.h" | ||||||||||
#include "lib/ogl.h" | ||||||||||
class CSimulation2; | ||||||||||
class CTerrain; | ||||||||||
class CMiniMapTexture | ||||||||||
{ | ||||||||||
NONCOPYABLE(CMiniMapTexture); | ||||||||||
public: | ||||||||||
CMiniMapTexture(CSimulation2& simulation); | ||||||||||
~CMiniMapTexture(); | ||||||||||
/** | ||||||||||
* Marks the texture as dirty if it's old enough to redraw it on Render. | ||||||||||
*/ | ||||||||||
void Update(const float deltaRealTime); | ||||||||||
/** | ||||||||||
* Redraws the texture if it's dirty. | ||||||||||
*/ | ||||||||||
void Render(); | ||||||||||
GLuint GetTerrainTexture() const { return m_TerrainTexture; } | ||||||||||
GLsizei GetTerrainTextureSize() const { return m_TextureSize; } | ||||||||||
/** | ||||||||||
* @return The maximum height for unit passage in water. | ||||||||||
*/ | ||||||||||
static float GetShallowPassageHeight(); | ||||||||||
private: | ||||||||||
void CreateTextures(const CTerrain* terrain); | ||||||||||
void DestroyTextures(); | ||||||||||
void RebuildTerrainTexture(const CTerrain* terrain); | ||||||||||
CSimulation2& m_Simulation; | ||||||||||
bool m_Dirty = true; | ||||||||||
// minimap texture handles | ||||||||||
GLuint m_TerrainTexture; | ||||||||||
StanUnsubmitted Not Done Inline Actions
Stan: | ||||||||||
// texture data | ||||||||||
u32* m_TerrainData; | ||||||||||
StanUnsubmitted Not Done Inline Actions
Stan: | ||||||||||
// map size | ||||||||||
ssize_t m_MapSize; | ||||||||||
// texture size | ||||||||||
GLsizei m_TextureSize; | ||||||||||
// 1.f if map is circular or 1.414f if square (to shrink it inside the circle) | ||||||||||
float m_MapScale; | ||||||||||
// Maximal water height to allow the passage of a unit (for underwater shallows). | ||||||||||
float m_ShallowPassageHeight = 0.0f; | ||||||||||
float m_WaterHeight = 0.0f; | ||||||||||
}; | ||||||||||
#endif // INCLUDED_MINIMAPTEXTURE | ||||||||||
No newline at end of file | ||||||||||
StanUnsubmitted Not Done Inline ActionsShould be added. Stan: Should be added. |
Wildfire Games · Phabricator