summaryrefslogtreecommitdiffstats
path: root/src/core/FileLoader.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-07-27 15:38:34 +0200
committeraap <aap@papnet.eu>2020-07-27 15:38:46 +0200
commit6b7a8f96a6763e9f0f9e94185afe097cb63984ae (patch)
tree5e8189744c28abffa7739a6bc9b35c69ab85f874 /src/core/FileLoader.cpp
parentMerge pull request #664 from aap/miami (diff)
downloadre3-6b7a8f96a6763e9f0f9e94185afe097cb63984ae.tar
re3-6b7a8f96a6763e9f0f9e94185afe097cb63984ae.tar.gz
re3-6b7a8f96a6763e9f0f9e94185afe097cb63984ae.tar.bz2
re3-6b7a8f96a6763e9f0f9e94185afe097cb63984ae.tar.lz
re3-6b7a8f96a6763e9f0f9e94185afe097cb63984ae.tar.xz
re3-6b7a8f96a6763e9f0f9e94185afe097cb63984ae.tar.zst
re3-6b7a8f96a6763e9f0f9e94185afe097cb63984ae.zip
Diffstat (limited to '')
-rw-r--r--src/core/FileLoader.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp
index 86ebb5dd..635192ea 100644
--- a/src/core/FileLoader.cpp
+++ b/src/core/FileLoader.cpp
@@ -326,13 +326,13 @@ CFileLoader::LoadCollisionModel(uint8 *buf, CColModel &model, char *modelname)
int32 numVertices = *(int16*)buf;
buf += 4;
if(numVertices > 0){
- model.vertices = (CVector*)RwMalloc(numVertices*sizeof(CVector));
+ model.vertices = (CompressedVector*)RwMalloc(numVertices*sizeof(CompressedVector));
for(i = 0; i < numVertices; i++){
- model.vertices[i] = *(CVector*)buf;
+ model.vertices[i].Set(*(float*)buf, *(float*)(buf+4), *(float*)(buf+8));
#if 0
- if(Abs(model.vertices[i].x) >= 256.0f ||
- Abs(model.vertices[i].y) >= 256.0f ||
- Abs(model.vertices[i].z) >= 256.0f)
+ if(Abs(*(float*)buf) >= 256.0f ||
+ Abs(*(float*)(buf+4)) >= 256.0f ||
+ Abs(*(float*)(buf+8)) >= 256.0f)
printf("%s:Collision volume too big\n", modelname);
#endif
buf += 12;