2014-01-05 17:22:29 +00:00
|
|
|
#ifndef GAME_RENDER_GLOBALMAP_H
|
|
|
|
#define GAME_RENDER_GLOBALMAP_H
|
2012-09-20 11:56:37 +00:00
|
|
|
|
|
|
|
#include <string>
|
2015-05-16 12:48:20 +00:00
|
|
|
#include <vector>
|
2012-09-20 11:56:37 +00:00
|
|
|
|
2015-05-16 12:48:20 +00:00
|
|
|
#include <osg/ref_ptr>
|
|
|
|
|
|
|
|
namespace osg
|
|
|
|
{
|
|
|
|
class Texture2D;
|
2015-05-28 16:49:24 +00:00
|
|
|
class Image;
|
2015-05-16 12:48:20 +00:00
|
|
|
}
|
2012-11-04 11:13:04 +00:00
|
|
|
|
2013-08-27 13:48:13 +00:00
|
|
|
namespace Loading
|
|
|
|
{
|
|
|
|
class Listener;
|
|
|
|
}
|
|
|
|
|
2014-01-25 17:20:17 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2015-03-06 08:36:42 +00:00
|
|
|
struct GlobalMap;
|
2014-01-25 17:20:17 +00:00
|
|
|
}
|
|
|
|
|
2012-09-20 11:56:37 +00:00
|
|
|
namespace MWRender
|
|
|
|
{
|
|
|
|
|
2015-05-16 12:48:20 +00:00
|
|
|
class GlobalMap
|
2012-09-20 11:56:37 +00:00
|
|
|
{
|
|
|
|
public:
|
2015-05-16 12:48:20 +00:00
|
|
|
GlobalMap();
|
2014-08-14 17:01:03 +00:00
|
|
|
~GlobalMap();
|
2012-09-20 11:56:37 +00:00
|
|
|
|
2013-08-27 13:48:13 +00:00
|
|
|
void render(Loading::Listener* loadingListener);
|
2012-09-20 11:56:37 +00:00
|
|
|
|
2014-09-26 10:47:33 +00:00
|
|
|
int getWidth() const { return mWidth; }
|
|
|
|
int getHeight() const { return mHeight; }
|
|
|
|
|
|
|
|
int getCellSize() const { return mCellSize; }
|
2012-09-21 14:26:04 +00:00
|
|
|
|
|
|
|
void worldPosToImageSpace(float x, float z, float& imageX, float& imageY);
|
|
|
|
|
|
|
|
void cellTopLeftCornerToImageSpace(int x, int y, float& imageX, float& imageY);
|
|
|
|
|
2012-11-04 11:13:04 +00:00
|
|
|
void exploreCell (int cellX, int cellY);
|
|
|
|
|
2014-01-25 12:34:56 +00:00
|
|
|
/// Clears the overlay
|
|
|
|
void clear();
|
|
|
|
|
2014-04-26 11:42:32 +00:00
|
|
|
void write (ESM::GlobalMap& map);
|
|
|
|
void read (ESM::GlobalMap& map);
|
2014-01-25 17:20:17 +00:00
|
|
|
|
2015-05-16 12:48:20 +00:00
|
|
|
osg::ref_ptr<osg::Texture2D> getBaseTexture();
|
2015-05-28 16:49:24 +00:00
|
|
|
osg::ref_ptr<osg::Texture2D> getOverlayTexture();
|
2012-09-21 14:26:04 +00:00
|
|
|
|
2015-05-16 12:48:20 +00:00
|
|
|
private:
|
2014-09-26 10:47:33 +00:00
|
|
|
int mCellSize;
|
|
|
|
|
2012-11-04 11:13:04 +00:00
|
|
|
std::vector< std::pair<int,int> > mExploredCells;
|
|
|
|
|
2015-05-16 12:48:20 +00:00
|
|
|
osg::ref_ptr<osg::Texture2D> mBaseTexture;
|
2015-05-28 16:49:24 +00:00
|
|
|
osg::ref_ptr<osg::Texture2D> mOverlayTexture;
|
|
|
|
|
|
|
|
osg::ref_ptr<osg::Image> mOverlayImage;
|
2012-11-04 11:13:04 +00:00
|
|
|
|
2012-09-21 14:26:04 +00:00
|
|
|
int mWidth;
|
|
|
|
int mHeight;
|
|
|
|
|
|
|
|
int mMinX, mMaxX, mMinY, mMaxY;
|
2012-09-20 11:56:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|