2013-10-29 20:28:59 +00:00
|
|
|
#ifndef SCENERY_H
|
|
|
|
#define SCENERY_H
|
|
|
|
|
2013-11-17 21:36:18 +00:00
|
|
|
#include "definition_global.h"
|
2013-10-29 20:28:59 +00:00
|
|
|
|
2015-08-12 20:21:10 +00:00
|
|
|
#include "DefinitionNode.h"
|
2013-10-30 14:39:56 +00:00
|
|
|
|
2013-11-17 21:36:18 +00:00
|
|
|
namespace paysages {
|
|
|
|
namespace definition {
|
2013-10-29 20:28:59 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Global scenery management
|
|
|
|
*
|
|
|
|
* This class contains the whole scenery definition.
|
|
|
|
*/
|
2015-08-12 20:21:10 +00:00
|
|
|
class DEFINITIONSHARED_EXPORT Scenery: public DefinitionNode
|
2013-10-29 20:28:59 +00:00
|
|
|
{
|
2013-12-10 21:32:58 +00:00
|
|
|
public:
|
|
|
|
typedef enum {
|
|
|
|
FILE_OPERATION_OK,
|
|
|
|
FILE_OPERATION_IOERROR,
|
|
|
|
FILE_OPERATION_APP_MISMATCH,
|
|
|
|
FILE_OPERATION_VERSION_MISMATCH
|
|
|
|
} FileOperationResult;
|
|
|
|
|
|
|
|
typedef void (*SceneryCustomDataCallback)(PackStream* stream, void* data);
|
|
|
|
|
2013-10-29 20:28:59 +00:00
|
|
|
public:
|
|
|
|
Scenery();
|
2013-11-13 22:03:02 +00:00
|
|
|
|
2013-11-14 17:47:03 +00:00
|
|
|
virtual void validate() override;
|
2013-11-17 22:33:46 +00:00
|
|
|
|
2013-12-10 21:32:58 +00:00
|
|
|
FileOperationResult saveGlobal(const std::string &filepath) const;
|
|
|
|
FileOperationResult loadGlobal(const std::string &filepath);
|
|
|
|
|
2013-11-17 21:36:18 +00:00
|
|
|
virtual Scenery* getScenery() override;
|
2013-11-14 17:47:03 +00:00
|
|
|
|
2013-12-10 21:32:58 +00:00
|
|
|
void autoPreset(int seed=0);
|
2013-10-29 20:28:59 +00:00
|
|
|
|
|
|
|
void setAtmosphere(AtmosphereDefinition* atmosphere);
|
2013-11-13 19:07:35 +00:00
|
|
|
inline AtmosphereDefinition* getAtmosphere() const {return atmosphere;}
|
2013-10-29 20:28:59 +00:00
|
|
|
void getAtmosphere(AtmosphereDefinition* atmosphere);
|
|
|
|
|
|
|
|
void setCamera(CameraDefinition* camera);
|
2013-11-13 19:07:35 +00:00
|
|
|
inline CameraDefinition* getCamera() const {return camera;}
|
2013-10-29 20:28:59 +00:00
|
|
|
void getCamera(CameraDefinition* camera);
|
|
|
|
|
|
|
|
void setClouds(CloudsDefinition* clouds);
|
2013-11-13 19:07:35 +00:00
|
|
|
inline CloudsDefinition* getClouds() const {return clouds;}
|
2013-10-29 20:28:59 +00:00
|
|
|
void getClouds(CloudsDefinition* clouds);
|
|
|
|
|
|
|
|
void setTerrain(TerrainDefinition* terrain);
|
2013-11-13 19:07:35 +00:00
|
|
|
inline TerrainDefinition* getTerrain() const {return terrain;}
|
2013-10-29 20:28:59 +00:00
|
|
|
void getTerrain(TerrainDefinition* terrain);
|
|
|
|
|
|
|
|
void setTextures(TexturesDefinition* textures);
|
2013-11-13 19:07:35 +00:00
|
|
|
inline TexturesDefinition* getTextures() const {return textures;}
|
2013-10-29 20:28:59 +00:00
|
|
|
void getTextures(TexturesDefinition* textures);
|
|
|
|
|
|
|
|
void setWater(WaterDefinition* water);
|
2013-11-13 19:07:35 +00:00
|
|
|
inline WaterDefinition* getWater() const {return water;}
|
2013-10-29 20:28:59 +00:00
|
|
|
void getWater(WaterDefinition* water);
|
|
|
|
|
2015-07-22 16:39:46 +00:00
|
|
|
void keepCameraAboveGround(CameraDefinition* camera);
|
2013-11-14 20:05:12 +00:00
|
|
|
|
2013-10-29 20:28:59 +00:00
|
|
|
private:
|
|
|
|
AtmosphereDefinition* atmosphere;
|
|
|
|
CameraDefinition* camera;
|
|
|
|
CloudsDefinition* clouds;
|
|
|
|
TerrainDefinition* terrain;
|
|
|
|
TexturesDefinition* textures;
|
|
|
|
WaterDefinition* water;
|
|
|
|
};
|
|
|
|
|
2013-11-17 21:36:18 +00:00
|
|
|
}
|
|
|
|
}
|
2013-10-29 20:28:59 +00:00
|
|
|
|
|
|
|
#endif // SCENERY_H
|