SSE2: Fix for MinGW

--HG--
branch : sse2
hg/feature/sse2
kaetemi 11 years ago
parent b074ec61b5
commit 0bbb8cae2f

@ -53,8 +53,8 @@ public:
uint getNumAllocatedBlocks() const { return _NumAlloc; }
private:
class CChunk;
NL_ALIGN(NL_DEFAULT_MEMORY_ALIGNMENT)
class CNode
class NL_ALIGN(NL_DEFAULT_MEMORY_ALIGNMENT) CNode
{
public:
CChunk *Chunk; // the Chunk this node belongs to.

@ -57,8 +57,8 @@ class CPlane;
* \author Nevrax France
* \date 2000
*/
NL_ALIGN_SSE2
class CMatrix
class NL_ALIGN_SSE2 CMatrix
{
public:
/// Rotation Order.
@ -362,8 +362,8 @@ public:
friend CPlane operator*(const CPlane &p, const CMatrix &m);
#ifdef NL_HAS_SSE2
inline CMatrix44F &getMatrix44F() { testExpandRot(); testExpandProj(); return MF; }
inline const CMatrix44F &getMatrix44F() const { testExpandRot(); testExpandProj(); return MF; }
inline CMatrix44F &getMatrix44F() { testExpandRotEx(); testExpandProjEx(); return MF; }
inline const CMatrix44F &getMatrix44F() const { testExpandRotEx(); testExpandProjEx(); return MF; }
#else
inline CMatrix44F &getMatrix44F() { return reinterpret_cast<CMatrix44F &>(*this); }
inline const CMatrix44F &getMatrix44F() const { return reinterpret_cast<const CMatrix44F &>(*this); }
@ -426,6 +426,9 @@ private:
void testExpandRot() const;
void testExpandProj() const;
void testExpandRotEx() const;
void testExpandProjEx() const;
// inline
void setScaleUni(float scale);
};

@ -342,7 +342,7 @@ typedef unsigned int uint; // at least 32bits (depend of processor)
// #ifdef NL_ENABLE_FORCE_INLINE
# ifdef NL_COMP_VC
# define NL_FORCE_INLINE __forceinline
# elif NL_COMP_GCC
# elif defined(NL_COMP_GCC)
# define NL_FORCE_INLINE inline __attribute__((always_inline))
# else
# define NL_FORCE_INLINE inline
@ -358,7 +358,10 @@ typedef unsigned int uint; // at least 32bits (depend of processor)
#define NL_ALIGN(nb) __attribute__((aligned(nb)))
#endif
#ifdef NL_COMP_VC
#ifdef NL_OS_WINDOWS
#include <stdlib.h>
#include <intrin.h>
#include <malloc.h>
inline void *aligned_malloc(size_t size, size_t alignment) { return _aligned_malloc(size, alignment); }
inline void aligned_free(void *ptr) { _aligned_free(ptr); }
#else

@ -145,6 +145,11 @@ inline void CMatrix::testExpandRot() const
self->Scale33= 1;
}
}
void CMatrix::testExpandRotEx() const
{
testExpandRot();
}
inline void CMatrix::testExpandProj() const
{
if(hasProj())
@ -156,6 +161,10 @@ inline void CMatrix::testExpandProj() const
self->a41=0; self->a42=0; self->a43=0; self->a44=1;
}
}
void CMatrix::testExpandProjEx() const
{
testExpandProj();
}
// ======================================================================================================

Loading…
Cancel
Save