Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/renderer/SkyManager.h
/* Copyright (C) 2012 Wildfire Games. | /* Copyright (C) 2018 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 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 | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 15 Lines | |||||
#include "graphics/Texture.h" | #include "graphics/Texture.h" | ||||
/** | /** | ||||
* Class SkyManager: Maintain sky settings and textures, and render the sky. | * Class SkyManager: Maintain sky settings and textures, and render the sky. | ||||
*/ | */ | ||||
class SkyManager | class SkyManager | ||||
{ | { | ||||
public: | public: | ||||
bool m_RenderSky; | |||||
float m_HorizonHeight; | |||||
public: | |||||
SkyManager(); | SkyManager(); | ||||
/** | /** | ||||
* RenderSky: Render the sky. | * Render the sky. | ||||
*/ | */ | ||||
void RenderSky(); | void RenderSky(); | ||||
/** | /** | ||||
* GetSkySet(): Return the currently selected sky set name. | * Return the currently selected sky set name. | ||||
*/ | */ | ||||
inline const CStrW& GetSkySet() const { | inline const CStrW& GetSkySet() const | ||||
{ | |||||
return m_SkySet; | return m_SkySet; | ||||
} | } | ||||
GLuint GetSkyCube() { | GLuint GetSkyCube() | ||||
{ | |||||
return m_SkyCubeMap; | return m_SkyCubeMap; | ||||
} | } | ||||
/** | /** | ||||
* GetSkySet(): Set the sky set name, potentially loading the textures. | * Set the sky set name, potentially loading the textures. | ||||
*/ | */ | ||||
void SetSkySet(const CStrW& name); | void SetSkySet(const CStrW& name); | ||||
/** | /** | ||||
* Return a sorted list of available sky sets, in a form suitable | * Return a sorted list of available sky sets, in a form suitable | ||||
* for passing to SetSkySet. | * for passing to SetSkySet. | ||||
*/ | */ | ||||
std::vector<CStrW> GetSkySets() const; | std::vector<CStrW> GetSkySets() const; | ||||
bool GetRenderSky() const | |||||
{ | |||||
return m_RenderSky; | |||||
} | |||||
void SetRenderSky(bool value) | |||||
{ | |||||
m_RenderSky = value; | |||||
} | |||||
private: | private: | ||||
void LoadSkyTextures(); | void LoadSkyTextures(); | ||||
bool m_RenderSky; | |||||
float m_HorizonHeight; | |||||
/// Name of current skyset (a directory within art/textures/skies) | /// Name of current skyset (a directory within art/textures/skies) | ||||
CStrW m_SkySet; | CStrW m_SkySet; | ||||
// Indices into m_SkyTexture | // Indices into m_SkyTexture | ||||
enum | enum | ||||
{ | { | ||||
FRONT, | FRONT, | ||||
BACK, | BACK, | ||||
RIGHT, | RIGHT, | ||||
LEFT, | LEFT, | ||||
TOP, | TOP, | ||||
numTextures | NUMBER_OF_TEXTURES | ||||
}; | }; | ||||
// Sky textures | // Sky textures | ||||
CTexturePtr m_SkyTexture[numTextures]; | CTexturePtr m_SkyTexture[NUMBER_OF_TEXTURES]; | ||||
GLuint m_SkyCubeMap; | GLuint m_SkyCubeMap; | ||||
// Array of image names (defined in SkyManager.cpp), in the order of the IMG_ id's | |||||
static const wchar_t* s_imageNames[numTextures]; | |||||
}; | }; | ||||
#endif // INCLUDED_SKYMANAGER | #endif // INCLUDED_SKYMANAGER |
Wildfire Games · Phabricator