1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 22:53:50 +00:00
openmw-tes3mp/apps/openmw/mwrender/globalmap.hpp

76 lines
1.4 KiB
C++
Raw Normal View History

#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;
class Image;
2015-05-16 12:48:20 +00:00
}
2012-11-04 11:13:04 +00:00
namespace Loading
{
class Listener;
}
2014-01-25 17:20:17 +00:00
namespace ESM
{
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();
~GlobalMap();
2012-09-20 11:56:37 +00:00
void render(Loading::Listener* loadingListener);
2012-09-20 11:56:37 +00:00
int getWidth() const { return mWidth; }
int getHeight() const { return mHeight; }
int getCellSize() const { return mCellSize; }
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);
/// Clears the overlay
void clear();
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();
osg::ref_ptr<osg::Texture2D> getOverlayTexture();
2015-05-16 12:48:20 +00:00
private:
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;
osg::ref_ptr<osg::Texture2D> mOverlayTexture;
osg::ref_ptr<osg::Image> mOverlayImage;
2012-11-04 11:13:04 +00:00
int mWidth;
int mHeight;
int mMinX, mMaxX, mMinY, mMaxY;
2012-09-20 11:56:37 +00:00
};
}
#endif