28 #ifndef _AK_BANKREADHELPERS_H_
29 #define _AK_BANKREADHELPERS_H_
33 template<
typename T >
37 typedef T __attribute__((aligned(1))) UnalignedT;
38 return *
reinterpret_cast<const UnalignedT *
>(in_pVal);
39 #elif defined(_MSC_VER) && !defined(AK_CPU_X86)
40 return *
reinterpret_cast<const T __unaligned *
>(in_pVal);
42 return *
reinterpret_cast<const T *
>(in_pVal);
46 template<
typename T >
50 typedef T __attribute__((aligned(1))) UnalignedT;
51 *
reinterpret_cast<UnalignedT *
>(out_pVal) = in_val;
52 #elif defined(_MSC_VER) && !defined(AK_CPU_X86)
53 *
reinterpret_cast<T __unaligned *
>(out_pVal) = in_val;
55 *
reinterpret_cast<T *
>(out_pVal) = in_val;
60 template<
typename T >
68 T l_Value = ReadUnaligned<T>(in_rptr);
72 in_rSize -=
sizeof(T);
77 template<
typename T >
87 AkUInt8 currentByte = *in_rptr;
92 l_Value = (currentByte & 0x7F);
93 while (0x80 & currentByte)
95 currentByte = *in_rptr;
100 l_Value = l_Value << 7;
101 l_Value |= (currentByte & 0x7F);
112 , AkUInt32& out_uStringSize)
114 out_uStringSize = ReadBankData<AkUInt32>(in_rptr
121 if (out_uStringSize > 0)
123 pString =
reinterpret_cast<char*
>(in_rptr);
124 in_rptr += out_uStringSize;
126 in_rSize -= out_uStringSize;
137 #define READBANKDATA( _Type, _Ptr, _Size ) \
138 AK::ReadBankData<_Type>( _Ptr, _Size )
140 #define READVARIABLESIZEBANKDATA( _Type, _Ptr, _Size ) \
141 AK::ReadVariableSizeBankData<_Type>( _Ptr, _Size )
144 #define READBANKSTRING_UTF8( _Ptr, _Size, _out_StringSize ) \
145 AK::ReadBankStringUtf8( _Ptr, _Size, _out_StringSize )
148 #define READBANKSTRING( _Ptr, _Size, _out_StringSize ) \
149 AK::ReadBankStringUtf8( _Ptr, _Size, _out_StringSize ) //same as UTF-8 for now.
152 #define SKIPBANKDATA( _Type, _Ptr, _Size ) \
153 ( _Ptr ) += sizeof( _Type ); \
154 ( _Size ) -= sizeof( _Type )
157 #define SKIPBANKBYTES( _NumBytes, _Ptr, _Size ) \
158 ( _Ptr ) += _NumBytes; \
159 ( _Size ) -= _NumBytes
164 #define READBANKDATA( _Type, _Ptr, _Size ) \
165 AK::ReadBankData<_Type>( _Ptr )
167 #define READVARIABLESIZEBANKDATA( _Type, _Ptr, _Size ) \
168 AK::ReadVariableSizeBankData<_Type>( _Ptr )
170 #define READBANKSTRING_UTF8( _Ptr, _Size, _out_StringSize ) \
171 AK::ReadBankStringUtf8( _Ptr, _out_StringSize )
173 #define READBANKSTRING( _Ptr, _Size, _out_StringSize ) \
174 AK::ReadBankStringUtf8( _Ptr, _out_StringSize )
177 #define SKIPBANKDATA( _Type, _Ptr, _Size ) \
178 ( _Ptr ) += sizeof( _Type )
181 #define SKIPBANKBYTES( _NumBytes, _Ptr, _Size ) \
182 ( _Ptr ) += _NumBytes;
186 #define GETBANKDATABIT( _Data, _Shift ) \
187 (((_Data) >> (_Shift)) & 0x1)
191 #define CHECKBANKDATASIZE( _DATASIZE_, _ERESULT_ ) AKASSERT( _DATASIZE_ == 0 || _ERESULT_ != AK_Success );
193 #define CHECKBANKDATASIZE(_DATASIZE_, _ERESULT_ )
196 #endif //_AK_BANKREADHELPERS_H_
void WriteUnaligned(AkUInt8 *out_pVal, const T in_val)
T ReadBankData(AkUInt8 *&in_rptr)
Read data from bank and advance pointer.
T ReadVariableSizeBankData(AkUInt8 *&in_rptr)
T ReadUnaligned(const AkUInt8 *in_pVal)
char * ReadBankStringUtf8(AkUInt8 *&in_rptr, AkUInt32 &out_uStringSize)
지원이 필요하신가요?
질문이 있으신가요? 문제를 겪고 계신가요? 더 많은 정보가 필요하신가요? 저희에게 문의해주시면 도와드리겠습니다!
지원 페이지를 방문해 주세요
작업하는 프로젝트에 대해 알려주세요. 언제든지 도와드릴 준비가 되어 있습니다.
프로젝트를 등록하세요. 아무런 조건이나 의무 사항 없이 빠른 시작을 도와드리겠습니다.
Wwise를 시작해 보세요