TRX/lib/ati3dcif/Texture.hpp

38 lines
873 B
C++
Raw Normal View History

2021-11-12 20:03:04 +01:00
#pragma once
#include "ati3dcif.hpp"
#include <vector>
#include <glrage/GLRage.hpp>
#include <glrage_gl/Texture.hpp>
namespace glrage {
namespace cif {
class Texture : public gl::Texture
{
public:
static const uint32_t TRANS_MAP_DIM = 32;
static const uint32_t TRANS_TEX_DIM = 1024;
static const uint32_t TRANS_MAP_FACTOR = 32;
Texture();
~Texture();
void load(C3D_PTMAP tmap, std::vector<C3D_PALETTENTRY>& palette);
C3D_COLOR& chromaKey();
bool keyOnAlpha();
bool isTranslucent();
std::vector<uint8_t>& translucencyMap();
private:
Config& m_config{GLRage::getConfig()};
C3D_COLOR m_chromaKey;
bool m_keyOnAlpha;
std::map<std::string, std::string>& getTextureKeys();
std::vector<uint8_t> m_translucency_map;
bool m_is_translucent;
};
} // namespace cif
} // namespace glrage