2010-09-10 23:02:10 +02:00
|
|
|
/* Copyright (C) 2010 Wildfire Games.
|
2009-04-18 19:00:33 +02:00
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2009-04-18 19:51:05 +02:00
|
|
|
/*
|
|
|
|
* Sky settings and texture management
|
2006-05-16 06:41:37 +02:00
|
|
|
*/
|
|
|
|
|
2007-05-07 18:33:24 +02:00
|
|
|
#ifndef INCLUDED_SKYMANAGER
|
|
|
|
#define INCLUDED_SKYMANAGER
|
2006-05-16 06:41:37 +02:00
|
|
|
|
2010-09-10 23:02:10 +02:00
|
|
|
#include "graphics/Texture.h"
|
2006-05-16 06:41:37 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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:
|
2010-09-10 23:02:10 +02:00
|
|
|
void LoadSkyTextures();
|
2009-11-03 22:46:35 +01:00
|
|
|
|
2006-05-17 04:24:17 +02:00
|
|
|
/// Name of current skyset (a directory within art/textures/skies)
|
|
|
|
CStrW m_SkySet;
|
|
|
|
|
|
|
|
// Indices into m_SkyTexture
|
2009-11-03 22:46:35 +01:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
FRONT,
|
|
|
|
BACK,
|
|
|
|
RIGHT,
|
|
|
|
LEFT,
|
|
|
|
TOP,
|
|
|
|
numTextures
|
|
|
|
};
|
|
|
|
|
|
|
|
// Sky textures
|
2010-09-10 23:02:10 +02:00
|
|
|
CTexturePtr m_SkyTexture[numTextures];
|
2006-05-17 04:24:17 +02:00
|
|
|
|
|
|
|
// Array of image names (defined in SkyManager.cpp), in the order of the IMG_ id's
|
2009-11-03 22:46:35 +01:00
|
|
|
static const wchar_t* s_imageNames[numTextures];
|
2006-05-16 06:41:37 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-05-07 18:33:24 +02:00
|
|
|
#endif // INCLUDED_SKYMANAGER
|