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