Linux implementation. Include changes for gcc x64.

This commit is contained in:
LuisAntonRebollo 2015-01-24 22:08:26 +01:00
parent 4e52824a42
commit 4e9034854d
56 changed files with 1108 additions and 3075 deletions

View file

@ -82,6 +82,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include "Opcode.h"
#include <stdint.h>
using namespace Opcode;
@ -208,7 +209,7 @@ bool HybridModel::Build(const OPCODECREATE& create)
Data->mLeaves[Data->mNbLeaves] = *current->GetAABB();
// Setup leaf data
udword Index = (udword(current->GetPrimitives()) - udword(Data->mBase))/sizeof(udword);
udword Index = (uintptr_t(current->GetPrimitives()) - uintptr_t(Data->mBase))/sizeof(uintptr_t);
Data->mTriangles[Data->mNbLeaves].SetData(current->GetNbPrimitives(), Index);
Data->mNbLeaves++;

View file

@ -17,6 +17,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include "Opcode.h"
#include <stdint.h>
using namespace Opcode;
@ -163,7 +164,7 @@ bool SAP_PairData::Init(udword nb_objects)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
inline_ void Remap(SAP_Element*& element, udword delta)
{
if(element) element = (SAP_Element*)(udword(element) + delta);
if(element) element = (SAP_Element*)(element + delta);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -199,7 +200,7 @@ SAP_Element* SAP_PairData::GetFreeElem(udword id, SAP_Element* next, udword* rem
// Remap everything
{
udword Delta = udword(NewElems) - udword(mElementPool);
udword Delta = uintptr_t(NewElems) - uintptr_t(mElementPool);
for(udword i=0;i<mNbUsedElements;i++) Remap(NewElems[i].mNext, Delta);
for(udword i=0;i<mNbObjects;i++) Remap(mArray[i], Delta);