Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/Decal.h
Show All 13 Lines | |||||
* You should have received a copy of the GNU General Public License | * 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/>. | * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>. | ||||
*/ | */ | ||||
#ifndef INCLUDED_DECAL | #ifndef INCLUDED_DECAL | ||||
#define INCLUDED_DECAL | #define INCLUDED_DECAL | ||||
#include "graphics/Material.h" | #include "graphics/Material.h" | ||||
#include "graphics/ModelAbstract.h" | #include "graphics/SceneObject.h" | ||||
#include "graphics/Texture.h" | #include "graphics/Texture.h" | ||||
class CTerrain; | class CTerrain; | ||||
/** | /** | ||||
* Terrain decal definition. | * Terrain decal definition. | ||||
* Decals are rectangular textures that are projected vertically downwards | * Decals are rectangular textures that are projected vertically downwards | ||||
* onto the terrain. | * onto the terrain. | ||||
Show All 11 Lines | struct SDecal | ||||
float m_SizeX; | float m_SizeX; | ||||
float m_SizeZ; | float m_SizeZ; | ||||
float m_Angle; | float m_Angle; | ||||
float m_OffsetX; | float m_OffsetX; | ||||
float m_OffsetZ; | float m_OffsetZ; | ||||
bool m_Floating; | bool m_Floating; | ||||
}; | }; | ||||
class CModelDecal : public CModelAbstract | class CModelDecal : public CSceneObject | ||||
{ | { | ||||
public: | public: | ||||
CModelDecal(CTerrain* terrain, const SDecal& decal) | CModelDecal(CTerrain* terrain, const SDecal& decal) | ||||
: m_Terrain(terrain), m_Decal(decal) | : m_Terrain(terrain), m_Decal(decal) | ||||
{ | { | ||||
ENSURE(terrain != NULL); | ENSURE(terrain != NULL); | ||||
} | } | ||||
/// Dynamic cast | /// Dynamic cast | ||||
virtual CModelDecal* ToCModelDecal() | virtual CModelDecal* ToCModelDecal() | ||||
{ | { | ||||
return this; | return this; | ||||
} | } | ||||
virtual CModelAbstract* Clone() const; | virtual CSceneObject* Clone() const; | ||||
virtual void SetDirtyRec(int dirtyflags) | virtual void SetDirtyRec(int dirtyflags) | ||||
{ | { | ||||
SetDirty(dirtyflags); | SetDirty(dirtyflags); | ||||
} | } | ||||
virtual void SetTerrainDirty(ssize_t i0, ssize_t j0, ssize_t i1, ssize_t j1); | virtual void SetTerrainDirty(ssize_t i0, ssize_t j0, ssize_t i1, ssize_t j1); | ||||
Show All 20 Lines |
Wildfire Games · Phabricator