OROCHI
 
Loading...
Searching...
No Matches
GxResMovieCellSheet.h
1//===========================================================================
10//===========================================================================
11#pragma once
12
13GX_MOVIE_NAMESPACE_BEGIN()
14
15//===========================================================================
17//===========================================================================
19{
20 //-----------------------------------------------------------
22 //-----------------------------------------------------------
24public:
25 // RTTI定義 (抽象RTTIクラス)
26 GX_RTTI_RESOURCE_NAME( GxResMovieCellSheet, GxResBase, "ムービーセルシート")
27
28protected:
30 static const u32 MAX_CELL_TEXT_LENGTH = GxMath::VALUE_256;
31
33 //-----------------------------------------------------------
35 //-----------------------------------------------------------
37public:
41 ~GxResMovieCellSheet(void) override;
42private:
45
47 GX_FORCE_INLINE const GxResMovieCellSheet& operator=(const GxResMovieCellSheet&);
48
49public:
51 void cleanup(void) override;
52
54 //-----------------------------------------------------------
56 //-----------------------------------------------------------
58public:
60 constexpr void* getResourceData(void) const { return _pReadBuffer; }
62 constexpr u32 getResourceSize(void) const { return _fileSize; }
63
65 GX_FORCE_INLINE void* getValue(u32 column, u32 row) const { return static_cast<GX_CHAR*>(_pReadBuffer) + getOffset(column, row); }
67 constexpr u32 getNumColumn(void) const { return _column; }
69 constexpr u32 getNumRow(void) const { return _row; }
70
71private:
73 GX_FORCE_INLINE u32 getOffset(u32 column, u32 row) const { return *reinterpret_cast<u32*>(static_cast<GX_CHAR*>(_pReadBuffer) + (row * _column + column + 2) * sizeof(u32)); }
74
76 //-----------------------------------------------------------
78 //-----------------------------------------------------------
80public:
81#if GX_DEVELOP
83 GX_FORCE_INLINE b32 checkValue(u32 column, u32 row) const { return (*reinterpret_cast<u32*>(static_cast<GX_CHAR*>(_pReadBuffer) + (row * _column + column + 2) * sizeof(u32)) ? true : false); }
84#endif //GX_DEVELOP
85
86protected:
88 b32 load(GxStream& stream, u32 dataSize);
89
90#if GX_DEVELOP
92 b32 save(GxStream& stream);
93#endif //GX_DEVELOP
94
96 //-----------------------------------------------------------
98 //-----------------------------------------------------------
100protected:
103 u32 _row;
105private:
106 GX_CHAR _data[MAX_CELL_TEXT_LENGTH];
107
109};
110
111#if GX_DEVELOP
112//===========================================================================
114//===========================================================================
115class GxResMovieCellSheetCsv : public GxResMovieCellSheet
116{
117 //-----------------------------------------------------------
119 //-----------------------------------------------------------
121public:
122 GX_RTTI_RESOURCE_NAME( GxResMovieCellSheetCsv, GxResMovieCellSheet, "GxResMovieCellSheetCsvMovie")
123
124
125 class cellParam : public GxClassBase
126 {
127 //-----------------------------------------------------------
129 //-----------------------------------------------------------
131 public:
132 GX_RTTI_CLASS( GxResMovieCellSheetCsv::cellParam, GxClassBase)
133 GX_OPERATOR_NEW_DELETE_USE_ARRAY(GxAllocatorList::ALLOCATOR_TYPE::RESOURCE)
134
135 //-----------------------------------------------------------
137 //-----------------------------------------------------------
139
140 GxString text;
141
143 };
144
145private:
147 enum class CELL_TYPE
148 {
149 STRING = 0,
150 COMMENT,
151 INTEGER,
152 FLOAT,
153 HEXA_DECIMAL
154 };
155
157 //-----------------------------------------------------------
159 //-----------------------------------------------------------
161public:
163 GxResMovieCellSheetCsv(void);
164
166 ~GxResMovieCellSheetCsv(void) override;
167
168private:
170 GxResMovieCellSheetCsv(const GxResMovieCellSheetCsv&);
171
172private:
174 GX_FORCE_INLINE const GxResMovieCellSheetCsv& operator=(const GxResMovieCellSheetCsv&);
175
177 //-----------------------------------------------------------
179 //-----------------------------------------------------------
181public:
183 b32 finalize(void);
184protected:
186 b32 load(GxStream&, u32 dataSize);
187
189 b32 save(GxStream&);
190
192 //-----------------------------------------------------------
194 //-----------------------------------------------------------
196public:
198 constexpr cellParam* getCellData(void) const { return _pCell; }
199
200private:
202 b32 isNullData(GX_STR string);
204 b32 isCommentData(GX_STR string);
206 b32 isIntegerData(GX_STR string);
208 b32 isFloatData(GX_STR string);
210 b32 isHexaData(GX_STR string);
212 u32 htoui(GX_STR string);
213
215 //-----------------------------------------------------------
217 //-----------------------------------------------------------
219private:
220 cellParam* _pCell;
221
223};
224#endif // GX_DEVELOP
225
226GX_MOVIE_NAMESPACE_END()
オブジェクト基底クラス
Definition GxBase.h:88
static constexpr u32 VALUE_256
256
Definition GxMath.h:127
リソース基底クラス
Definition GxResBase.h:23
セルシートリソースクラス
Definition GxResMovieCellSheet.h:19
constexpr u32 getResourceSize(void) const
リソースのサイズを取得
Definition GxResMovieCellSheet.h:62
constexpr u32 getNumRow(void) const
行の数取得
Definition GxResMovieCellSheet.h:69
u32 _row
行(縦)の数
Definition GxResMovieCellSheet.h:103
constexpr u32 getNumColumn(void) const
列の数取得
Definition GxResMovieCellSheet.h:67
void * _pReadBuffer
読み込みバッファ
Definition GxResMovieCellSheet.h:101
constexpr void * getResourceData(void) const
リソースへのアクセサを取得
Definition GxResMovieCellSheet.h:60
u32 _column
列(横)の数
Definition GxResMovieCellSheet.h:104
b32 load(GxStream &stream, u32 dataSize)
ロード関数
Definition GxResMovieCellSheet.cpp:50
u32 _fileSize
ファイルサイズ
Definition GxResMovieCellSheet.h:102
GX_FORCE_INLINE void * getValue(u32 column, u32 row) const
セルの値を取得
Definition GxResMovieCellSheet.h:65
ストリーム基礎クラス
Definition GxStream.h:20
文字列型クラス
Definition GxString.h:18
32bitブーリアン
Definition GxDefine.h:173