File tree Expand file tree Collapse file tree 4 files changed +56
-1
lines changed
Expand file tree Collapse file tree 4 files changed +56
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ if(WIN32)
2424list (APPEND CORE_EXTRA src/win32_largefilewrapper.c)
2525elseif (APPLE )
2626list (APPEND CORE_EXTRA src/osx_largefilewrapper.c)
27+ elseif (GEKKO)
28+ list (APPEND CORE_EXTRA src/gekko_support.c)
2729endif ()
2830
2931add_library (AthenaCore
@@ -41,7 +43,6 @@ add_library(AthenaCore
4143 src/LZ77/LZBase.cpp
4244 src/Athena/FileInfo.cpp
4345 src/Athena/Dir.cpp
44- src/gekko_support.c
4546 ${CORE_EXTRA}
4647
4748 include /Athena/IStream.hpp
Original file line number Diff line number Diff line change @@ -221,6 +221,28 @@ class IStreamReader : public IStream
221221 return val != 0 ;
222222 }
223223
224+ /* ! \brief Reads an atVec2f (8 bytes) and advances the current position
225+ *
226+ * \return atVec2f The value at the current address
227+ * \throw IOException when address is out of range
228+ */
229+ inline atVec2f readVec3f ()
230+ {
231+ atVec2f val;
232+ readUBytesToBuf (&val, 8 );
233+ if (m_endian == BigEndian)
234+ {
235+ utility::BigFloat (val.vec [0 ]);
236+ utility::BigFloat (val.vec [1 ]);
237+ }
238+ else
239+ {
240+ utility::LittleFloat (val.vec [0 ]);
241+ utility::LittleFloat (val.vec [1 ]);
242+ }
243+ return val;
244+ }
245+
224246 /* ! \brief Reads an atVec3f (12 bytes) and advances the current position
225247 *
226248 * \return atVec3f The value at the current address
Original file line number Diff line number Diff line change @@ -204,6 +204,27 @@ class IStreamWriter : public IStream
204204 */
205205 inline void writeBool (bool val) {writeUBytes ((atUint8*)&val, 1 );}
206206
207+ /* ! \brief Writes an atVec2f (8 bytes) to the buffer and advances the buffer.
208+ * It also swaps the bytes depending on the platform and Stream settings.
209+ *
210+ * \sa Endian
211+ * \param vec The value to write to the buffer
212+ */
213+ inline void writeVec2f (atVec2f vec)
214+ {
215+ if (m_endian == BigEndian)
216+ {
217+ utility::BigFloat (vec.vec [0 ]);
218+ utility::BigFloat (vec.vec [1 ]);
219+ }
220+ else
221+ {
222+ utility::LittleFloat (vec.vec [0 ]);
223+ utility::LittleFloat (vec.vec [1 ]);
224+ }
225+ writeUBytes ((atUint8*)&vec, 8 );
226+ }
227+
207228 /* ! \brief Writes an atVec3f (12 bytes) to the buffer and advances the buffer.
208229 * It also swaps the bytes depending on the platform and Stream settings.
209230 *
Original file line number Diff line number Diff line change @@ -46,6 +46,17 @@ typedef unsigned long long atUint64;
4646#include < xmmintrin.h>
4747#endif
4848
49+ typedef union
50+ {
51+ #if __clang__
52+ float clangVec __attribute__ ((__vector_size__ (8 )));
53+ #endif
54+ #if __SSE__
55+ __m128 mVec128 ;
56+ #endif
57+ float vec[2 ];
58+ } atVec2f;
59+
4960typedef union
5061{
5162#if __clang__
You can’t perform that action at this time.
0 commit comments