이 파일의 문서화 페이지로 가기
27 #ifndef _AK_BANKREADHELPERS_H_
28 #define _AK_BANKREADHELPERS_H_
32 #include <type_traits>
38 typename std::enable_if<std::is_fundamental<T>::value || std::is_enum<T>::value,
bool>::type =
true
43 typedef T __attribute__((aligned(1))) UnalignedT;
44 return *
reinterpret_cast<const UnalignedT *
>(in_pVal);
45 #elif defined(_MSC_VER) && !defined(AK_CPU_X86)
46 return *
reinterpret_cast<const T __unaligned *
>(in_pVal);
48 return *
reinterpret_cast<const T *
>(in_pVal);
54 typename std::enable_if<std::is_class<T>::value,
bool>::type =
true
65 typename std::enable_if<std::is_fundamental<T>::value || std::is_enum<T>::value,
bool>::type =
true
70 typedef T __attribute__((aligned(1))) UnalignedT;
71 *
reinterpret_cast<UnalignedT *
>(out_pVal) = in_val;
72 #elif defined(_MSC_VER) && !defined(AK_CPU_X86)
73 *
reinterpret_cast<T __unaligned *
>(out_pVal) = in_val;
75 *
reinterpret_cast<T *
>(out_pVal) = in_val;
81 typename std::enable_if<std::is_class<T>::value,
bool>::type =
true
89 template<
typename T >
97 T l_Value = ReadUnaligned<T>(in_rptr);
101 in_rSize -=
sizeof(T);
106 template<
typename T >
116 AkUInt8 currentByte = *in_rptr;
121 l_Value = (currentByte & 0x7F);
122 while (0x80 & currentByte)
124 currentByte = *in_rptr;
129 l_Value = l_Value << 7;
130 l_Value |= (currentByte & 0x7F);
143 char* pString = (
char *)in_rptr;
146 while (*in_rptr != 0)
168 #define READBANKDATA( _Type, _Ptr, _Size ) \
169 AK::ReadBankData<_Type>( _Ptr, _Size )
171 #define READVARIABLESIZEBANKDATA( _Type, _Ptr, _Size ) \
172 AK::ReadVariableSizeBankData<_Type>( _Ptr, _Size )
177 #define READBANKSTRING( _Ptr, _Size, _out_StringSize ) \
178 AK::ReadBankStringUtf8( _Ptr, _Size, _out_StringSize )
181 #define SKIPBANKDATA( _Type, _Ptr, _Size ) \
182 ( _Ptr ) += sizeof( _Type ); \
183 ( _Size ) -= sizeof( _Type )
186 #define SKIPBANKBYTES( _NumBytes, _Ptr, _Size ) \
187 ( _Size ) -= _NumBytes; \
188 ( _Ptr ) += _NumBytes
191 #define COPYBANKSTRING_CHAR( _Ptr, _Size, _OutPtr, _MaxOutPtrSize ) \
192 AKPLATFORM::SafeStrCpy( _OutPtr, ((const char*)_Ptr), (_MaxOutPtrSize) ); \
193 SKIPBANKBYTES( (AkUInt32)strlen((const char*)_Ptr) + 1, _Ptr, _Size )
196 #define COPYBANKSTRING_OSCHAR( _Ptr, _Size, _OutPtr, _MaxOutPtrSize ) \
197 AK_UTF8_TO_OSCHAR( _OutPtr, ((const char*)_Ptr), (_MaxOutPtrSize) ); \
198 SKIPBANKBYTES( (AkUInt32)strlen((const char*)_Ptr) + 1, _Ptr, _Size )
201 #define COPYBANKSTRING_WCHAR( _Ptr, _Size, OutPtr, _MaxOutPtrSize ) \
202 AK_CHAR_TO_UTF16( _OutPtr, ((const char*)_Ptr), (_MaxOutPtrSize) ); \
203 SKIPBANKBYTES( (AkUInt32)strlen((const char*)_Ptr) + 1, _Ptr, _Size )
209 #define READBANKDATA( _Type, _Ptr, _Size ) \
210 AK::ReadBankData<_Type>( _Ptr )
212 #define READVARIABLESIZEBANKDATA( _Type, _Ptr, _Size ) \
213 AK::ReadVariableSizeBankData<_Type>( _Ptr )
215 #define READBANKSTRING( _Ptr, _Size, _out_StringSize ) \
216 AK::ReadBankStringUtf8( _Ptr, _out_StringSize )
219 #define SKIPBANKDATA( _Type, _Ptr, _Size ) \
220 ( _Ptr ) += sizeof( _Type )
223 #define SKIPBANKBYTES( _NumBytes, _Ptr, _Size ) \
224 ( _Ptr ) += _NumBytes;
227 #define COPYBANKSTRING_CHAR( _Ptr, _Size, _OutPtr, _MaxPtrSize ) \
228 AKPLATFORM::SafeStrCpy( _OutPtr, (const char*)_Ptr, _MaxPtrSize ); \
229 SKIPBANKBYTES( (AkUInt32)strlen((const char*)_Ptr)+1, _Ptr, _Size )
232 #define COPYBANKSTRING_OSCHAR( _Ptr, _Size, _OutPtr, _MaxPtrSize ) \
233 AK_UTF8_TO_OSCHAR( _OutPtr, (const char*)_Ptr, _MaxPtrSize ); \
234 SKIPBANKBYTES( (AkUInt32)strlen((const char*)_Ptr)+1, _Ptr, _Size )
237 #define COPYBANKSTRING_WCHAR( _Ptr, _Size, OutPtr, _MaxPtrSize ) \
238 AK_CHAR_TO_UTF16( _OutPtr, (const char*)_Ptr, _MaxPtrSize ); \
239 SKIPBANKBYTES( (AkUInt32)strlen((const char*)_Ptr)+1, _Ptr, _Size )
243 #define GETBANKDATABIT( _Data, _Shift ) \
244 (((_Data) >> (_Shift)) & 0x1)
248 #define CHECKBANKDATASIZE( _DATASIZE_, _ERESULT_ ) AKASSERT( _DATASIZE_ == 0 || _ERESULT_ != AK_Success );
250 #define CHECKBANKDATASIZE(_DATASIZE_, _ERESULT_ )
253 #endif //_AK_BANKREADHELPERS_H_
void WriteUnaligned(AkUInt8 *out_pVal, const T in_val)
uint8_t AkUInt8
Unsigned 8-bit integer
T ReadBankData(AkUInt8 *&in_rptr)
Read data from bank and advance pointer.
T ReadVariableSizeBankData(AkUInt8 *&in_rptr)
AkForceInline void AkMemCpy(void *pDest, const void *pSrc, AkUInt32 uSize)
Platform Independent Helper
T ReadUnaligned(const AkUInt8 *in_pVal)
uint32_t AkUInt32
Unsigned 32-bit integer
char * ReadBankStringUtf8(AkUInt8 *&in_rptr, AkUInt32 &out_uStringSize)
지원이 필요하신가요?
질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!
지원 페이지를 방문해 주세요
작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.
프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.
Wwise를 시작해 보세요