libcmo21/LibCmo/CK2/ObjImpls/CKTexture.hpp

49 lines
1.3 KiB
C++
Raw Permalink Normal View History

2023-09-10 21:33:43 +08:00
#pragma once
#include "../../VTInternal.hpp"
2023-09-10 21:33:43 +08:00
#include "../CKBitmapData.hpp"
#include "CKBeObject.hpp"
namespace LibCmo::CK2::ObjImpls {
class CKTexture : public CKBeObject {
public:
CKTexture(CKContext* ctx, CK_ID ckid, CKSTRING name);
virtual ~CKTexture();
YYCC_DEL_CLS_COPY_MOVE(CKTexture);
2023-09-10 21:33:43 +08:00
virtual CK_CLASSID GetClassID(void) override {
return CK_CLASSID::CKCID_TEXTURE;
}
2023-09-14 17:03:09 +08:00
2023-09-10 21:33:43 +08:00
virtual bool Save(CKStateChunk* chunk, CKFileVisitor* file, CKDWORD flags) override;
virtual bool Load(CKStateChunk* chunk, CKFileVisitor* file) override;
CKBitmapData& GetUnderlyingData();
2023-10-08 10:42:07 +08:00
/**
* @brief A wrapper of underlying CKBitmapData::LoadImage. Not only load image, but also set file name.
* @param filename[in] File name of loading image.
* @param slot[in] The slot that image will be loaded into.
* @return True if success.
*/
bool LoadImage(CKSTRING filename, CKDWORD slot);
bool IsUseMipmap() const;
void UseMipmap(bool isUse);
CKDWORD GetMipmapLevel() const;
void SetMipmapLevel(CKDWORD level);
VxMath::VxImageDescEx* GetMipmapLevelData(CKDWORD level);
VxMath::VX_PIXELFORMAT GetVideoFormat() const;
void SetVideoFormat(VxMath::VX_PIXELFORMAT fmt);
2023-09-10 21:33:43 +08:00
protected:
CKBitmapData m_ImageHost;
VxMath::VX_PIXELFORMAT m_VideoFormat;
bool m_UseMipMap;
2023-09-12 17:03:06 +08:00
XContainer::XArray<VxMath::VxImageDescEx> m_MipmapImages;
2023-09-10 21:33:43 +08:00
};
}