mirror of
https://gitlab.com/skmp/dca3-game.git
synced 2025-09-02 19:23:16 +02:00
Removec uneccessary 64-byte align for RwMatrix.
This commit is contained in:
5
vendor/librw/src/dc/rwdc.cpp
vendored
5
vendor/librw/src/dc/rwdc.cpp
vendored
@@ -5779,7 +5779,9 @@ writeNativeSkin(Stream *stream, int32 len, void *object, int32 offset)
|
||||
stream->write8(&skin->numBones, 4);
|
||||
|
||||
for(int32 i = 0; i < skin->numBones; i++){
|
||||
Matrix &m = *reinterpret_cast<Matrix *>(&skin->inverseMatrices[i * 16]);
|
||||
Matrix &m = *reinterpret_cast<Matrix *>(
|
||||
&skin->inverseMatrices[i * 16]);
|
||||
|
||||
if(m.flags & MatrixBase::IDENTITY_OLD)
|
||||
m.flags |= MatrixBase::IDENTITY;
|
||||
m.pad0 = 0;
|
||||
@@ -5787,6 +5789,7 @@ writeNativeSkin(Stream *stream, int32 len, void *object, int32 offset)
|
||||
m.atw = 0.0f;
|
||||
m.posw = 1.0f;
|
||||
}
|
||||
|
||||
stream->write32(skin->inverseMatrices, skin->numBones*64);
|
||||
return stream;
|
||||
}
|
||||
|
5
vendor/librw/src/engine.cpp
vendored
5
vendor/librw/src/engine.cpp
vendored
@@ -56,7 +56,6 @@ size_t totalMemoryAllocated;
|
||||
// We align managed memory blocks on a 16 byte boundary
|
||||
|
||||
#define ALIGN16(x) ((x) + 0xF & ~0xF)
|
||||
#define ALIGN64(x) ((x) + 0x3F & ~0x3F)
|
||||
void*
|
||||
malloc_managed(size_t sz, uint32 hint)
|
||||
{
|
||||
@@ -66,13 +65,13 @@ malloc_managed(size_t sz, uint32 hint)
|
||||
|
||||
if(sz == 0) return nil;
|
||||
bool align64 = !!(hint & ID_MATRIX);
|
||||
origPtr = malloc(sz + sizeof(MemoryBlock) + ((align64)? 63 : 15));
|
||||
origPtr = malloc(sz + sizeof(MemoryBlock) + 15);
|
||||
if(origPtr == nil)
|
||||
return nil;
|
||||
totalMemoryAllocated += sz;
|
||||
data = (uint8*)origPtr;
|
||||
data += sizeof(MemoryBlock);
|
||||
data = (uint8*) ((align64)? ALIGN64((uintptr)data) : ALIGN16((uintptr)data));
|
||||
data = (uint8*) ALIGN16((uintptr)data);
|
||||
mem = (MemoryBlock*)(data-sizeof(MemoryBlock));
|
||||
|
||||
mem->sz = sz;
|
||||
|
9
vendor/librw/src/skin.cpp
vendored
9
vendor/librw/src/skin.cpp
vendored
@@ -225,15 +225,6 @@ writeSkin(Stream *stream, int32 len, void *object, int32 offset, int32)
|
||||
if(oldFormat)
|
||||
stream->writeU32(0xdeaddead);
|
||||
|
||||
printf("ROFLCOPTER!\n"); fflush(stdout);
|
||||
Matrix &m = *reinterpret_cast<Matrix *>(&skin->inverseMatrices[i * 16]);
|
||||
if(m.flags & MatrixBase::IDENTITY_OLD)
|
||||
m.flags |= MatrixBase::IDENTITY;
|
||||
m.pad0 = 0;
|
||||
m.upw = 0.0f;
|
||||
m.atw = 0.0f;
|
||||
m.posw = 1.0f;
|
||||
|
||||
stream->write32(&skin->inverseMatrices[i*16], 64);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user