OROCHI
 
Loading...
Searching...
No Matches
GxResThumbnail.h
Go to the documentation of this file.
1//===========================================================================
9//===========================================================================
10#pragma once
11
12GX_CORE_NAMESPACE_BEGIN()
13
14#if GX_DEVELOP
15//===========================================================================
17//===========================================================================
18class GxResThumbnail : public GxResBase
19{
20 //-----------------------------------------------------------
22 //-----------------------------------------------------------
24public:
25 // サムネイルの解像度
26 static const u32 THUMBNAIL_RESOLUTION = GxMath::VALUE_64;
27 static const u32 THUMBNAIL_COUNT_X = GxMath::VALUE_1K / THUMBNAIL_RESOLUTION;
28
29 // RTTI宣言
30 GX_RTTI_RESOURCE(GxResThumbnail, GxResBase)
31 // ClassBaseReference継承クラス用禁止宣言
33
34
35 //-------------------------------------------------------------
37 //-------------------------------------------------------------
39
41 GxResThumbnail(void);
43 void cleanup(void) override;
44
46 //-------------------------------------------------------------
48 //-------------------------------------------------------------
50public:
52 void addThumbnail(GxResTexture* pResTexture);
54 void addThumbnail(const GxResBase* pResource, GxRenderTexture* pTexture);
55private:
57 void addThumbnail(const GxGuid& guid, void* pBuffer);
58protected:
60 b32 load(GxStream& stream, u32 dataSize);
61#if GX_DEVELOP
63 b32 save(GxStream& stream);
64#endif //GX_DEVELOP
65
67 //-------------------------------------------------------------
69 //-------------------------------------------------------------
71public:
73 b32 getThumbnailUV(const GxGuid& guid, GxVector2& uv0, GxVector2& uv1) const;
75 constexpr GxRenderTexture* getTexture(void) const { return _pResTexture->getTexture(); }
76
78 //-------------------------------------------------------------
80 //-------------------------------------------------------------
82protected:
83 GxHashMap _guidList;
84 GxResTexture* _pResTexture;
85
87};
88
89//===========================================================================
91//===========================================================================
92class GxResThumbnailTno : public GxResThumbnail
93{
94 //-----------------------------------------------------------
96 //-----------------------------------------------------------
98public:
99 // RTTI宣言
100 GX_RTTI_RESOURCE(GxResThumbnailTno, GxResThumbnail)
101 // ClassBaseReference継承クラス用禁止宣言
102 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxResThumbnailTno)
103
104
105 //-----------------------------------------------------------
107 //-----------------------------------------------------------
109
111 GxResThumbnailTno(void) {}
112
114 //-----------------------------------------------------------
116 //-----------------------------------------------------------
118protected:
120 GX_FORCE_INLINE b32 load(GxStream& in, u32 dataSize) { return Super::load(in, dataSize); }
122 GX_FORCE_INLINE b32 save(GxStream& out) { return Super::save(out); }
124 GX_FORCE_INLINE b32 finalize(void) { return true; }
125
127};
128#endif //GX_DEVELOP
129
130GX_CORE_NAMESPACE_END()
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
#define GX_RTTI_RESOURCE(__THIS__, __BASE__)
リソースクラス型情報宣言
Definition GxRttiResource.h:102
GUID生成クラス
Definition GxGuid.h:19
連想配列クラス
Definition GxHashMap.h:18
static constexpr u32 VALUE_1K
1K
Definition GxMath.h:129
static constexpr u32 VALUE_64
64
Definition GxMath.h:125
テクスチャクラス
Definition GxRenderTexture.h:19
GX_FORCE_INLINE GxNativeTexture getTexture(void) const
テクスチャを取得
Definition GxRenderTexture.h:224
リソース基底クラス
Definition GxResBase.h:23
void cleanup(void) override
解放
Definition GxResBase.cpp:74
b32 load(GxStream &stream, u32 size)
ロード
Definition GxResBase.h:394
テクスチャリソース
Definition GxResTexture.h:23
ストリーム基礎クラス
Definition GxStream.h:20
2次元ベクトル
Definition GxVector.h:34
32bitブーリアン
Definition GxDefine.h:173