2016-03-21 04:10:14 +00:00
|
|
|
#ifndef _TEXTURE_SHEET_H_
|
|
|
|
#define _TEXTURE_SHEET_H_
|
|
|
|
|
|
|
|
#include "Types.h"
|
|
|
|
#include <unordered_map>
|
|
|
|
#include <vector>
|
|
|
|
#include <memory>
|
|
|
|
#include "Texture.h"
|
|
|
|
|
|
|
|
namespace New3D {
|
|
|
|
|
|
|
|
class TextureSheet
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TextureSheet();
|
|
|
|
|
2018-10-13 13:29:45 +00:00
|
|
|
std::shared_ptr<Texture> BindTexture (const UINT16* src, int format, int x, int y, int width, int height);
|
2016-03-21 04:10:14 +00:00
|
|
|
void Invalidate (int x, int y, int width, int height); // release parts of the memory
|
|
|
|
void Release (); // release all texture objects and memory
|
2016-05-21 15:50:54 +00:00
|
|
|
int GetTexFormat (int originalFormat, bool contour);
|
2016-10-06 01:37:29 +00:00
|
|
|
void GetMicrotexPos (int basePage, int id, int& x, int& y);
|
2016-03-21 04:10:14 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
int ToIndex(int x, int y);
|
2016-11-22 20:30:10 +00:00
|
|
|
void CropTile(int oldX, int oldY, int &newX, int &newY, int &newWidth, int &newHeight);
|
2016-03-21 04:10:14 +00:00
|
|
|
|
2017-03-24 20:54:12 +00:00
|
|
|
std::unordered_multimap<int, std::shared_ptr<Texture>> m_texMap;
|
2016-03-21 04:10:14 +00:00
|
|
|
|
|
|
|
// the key for the above maps is the x/y position in the 2048x2048 texture
|
|
|
|
// array of 8 planes for each texture type
|
|
|
|
|
|
|
|
std::vector<UINT8> m_temp;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // New3D
|
|
|
|
|
|
|
|
#endif
|