2014-09-15 10:32:27 +00:00
|
|
|
#ifndef PAINTEDGRIDDATA_H
|
|
|
|
#define PAINTEDGRIDDATA_H
|
|
|
|
|
|
|
|
#include "definition_global.h"
|
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace definition {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal storage class to hold data for a PaintedGrid.
|
|
|
|
*/
|
|
|
|
class PaintedGridData
|
|
|
|
{
|
|
|
|
friend class PaintedGrid;
|
|
|
|
|
|
|
|
public:
|
|
|
|
PaintedGridData();
|
|
|
|
~PaintedGridData();
|
|
|
|
|
|
|
|
void copy(PaintedGridData *destination) const;
|
|
|
|
void save(PackStream *stream) const;
|
|
|
|
void load(PackStream *stream);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clear all stored data.
|
|
|
|
*/
|
|
|
|
void clear();
|
|
|
|
|
2015-09-20 23:36:03 +00:00
|
|
|
inline bool hasData() const {return rows_count > 0;}
|
|
|
|
|
2014-09-15 10:32:27 +00:00
|
|
|
private:
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int xstart;
|
|
|
|
int xend;
|
|
|
|
double* height;
|
|
|
|
} HeightMapPixelGroup;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int y;
|
|
|
|
int pixel_groups_count;
|
|
|
|
HeightMapPixelGroup* pixel_groups;
|
|
|
|
} HeightMapRow;
|
|
|
|
|
|
|
|
int memsize;
|
|
|
|
int rows_count;
|
|
|
|
HeightMapRow* rows;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // PAINTEDGRIDDATA_H
|