2006-05-16 06:41:37 +02:00
|
|
|
/**
|
|
|
|
* =========================================================================
|
|
|
|
* File : SkyManager.h
|
|
|
|
* Project : Pyrogenesis
|
|
|
|
* Description : Sky settings and texture management
|
|
|
|
* =========================================================================
|
|
|
|
*/
|
|
|
|
|
2007-05-07 18:33:24 +02:00
|
|
|
#ifndef INCLUDED_SKYMANAGER
|
|
|
|
#define INCLUDED_SKYMANAGER
|
2006-05-16 06:41:37 +02:00
|
|
|
|
|
|
|
#include "ps/Overlay.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Class SkyManager: Maintain sky settings and textures, and render the sky.
|
|
|
|
*/
|
|
|
|
class SkyManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
bool m_RenderSky;
|
2006-05-25 07:46:17 +02:00
|
|
|
float m_HorizonHeight;
|
2006-05-16 06:41:37 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
SkyManager();
|
|
|
|
~SkyManager();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* LoadSkyTextures: Load sky textures from within the
|
|
|
|
* progressive load framework.
|
|
|
|
*
|
|
|
|
* @return 0 if loading has completed, a value from 1 to 100 (in percent of completion)
|
|
|
|
* if more textures need to be loaded and a negative error value on failure.
|
|
|
|
*/
|
|
|
|
int LoadSkyTextures();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* UnloadSkyTextures: Free any loaded sky textures and reset the internal state
|
|
|
|
* so that another call to LoadSkyTextures will begin progressive loading.
|
|
|
|
*/
|
|
|
|
void UnloadSkyTextures();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* RenderSky: Render the sky.
|
|
|
|
*/
|
|
|
|
void RenderSky();
|
|
|
|
|
2006-05-17 04:24:17 +02:00
|
|
|
/**
|
2006-06-22 00:37:31 +02:00
|
|
|
* GetSkySet(): Return the currently selected sky set name.
|
2006-05-17 04:24:17 +02:00
|
|
|
*/
|
2006-07-20 16:37:58 +02:00
|
|
|
inline const CStrW& GetSkySet() const {
|
2006-05-17 04:24:17 +02:00
|
|
|
return m_SkySet;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2006-06-22 00:37:31 +02:00
|
|
|
* GetSkySet(): Set the sky set name, potentially loading the textures.
|
2006-05-17 04:24:17 +02:00
|
|
|
*/
|
2006-07-20 16:37:58 +02:00
|
|
|
void SetSkySet(const CStrW& name);
|
2006-05-17 04:24:17 +02:00
|
|
|
|
2006-06-22 00:37:31 +02:00
|
|
|
/**
|
|
|
|
* Return a sorted list of available sky sets, in a form suitable
|
|
|
|
* for passing to SetSkySet.
|
|
|
|
*/
|
|
|
|
std::vector<CStrW> GetSkySets() const;
|
|
|
|
|
2006-05-16 06:41:37 +02:00
|
|
|
private:
|
2006-05-17 04:24:17 +02:00
|
|
|
/// Name of current skyset (a directory within art/textures/skies)
|
|
|
|
CStrW m_SkySet;
|
|
|
|
|
|
|
|
// Sky textures
|
|
|
|
Handle m_SkyTexture[5];
|
|
|
|
|
|
|
|
// Indices into m_SkyTexture
|
|
|
|
static const int IMG_FRONT = 0;
|
|
|
|
static const int IMG_BACK = 1;
|
|
|
|
static const int IMG_RIGHT = 2;
|
|
|
|
static const int IMG_LEFT = 3;
|
|
|
|
static const int IMG_TOP = 4;
|
|
|
|
|
|
|
|
// Array of image names (defined in SkyManager.cpp), in the order of the IMG_ id's
|
|
|
|
static const char* IMAGE_NAMES[5];
|
|
|
|
|
2006-05-16 06:41:37 +02:00
|
|
|
/// State of progressive loading (in # of loaded textures)
|
|
|
|
uint cur_loading_tex;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-05-07 18:33:24 +02:00
|
|
|
#endif // INCLUDED_SKYMANAGER
|