From f484de89a94bcde2b076ea81364570b224d2907b Mon Sep 17 00:00:00 2001 From: bluma4862 Date: Sun, 13 Apr 2008 14:52:35 +0000 Subject: [PATCH] * fixed BLPloader - do not try to load over end of mip block * fixed scale factor of doodads --- src/Client/GUI/CImageLoaderBLP.cpp | 3 ++- src/Client/GUI/SceneWorld.cpp | 1 + src/shared/ADTFileStructs.h | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Client/GUI/CImageLoaderBLP.cpp b/src/Client/GUI/CImageLoaderBLP.cpp index c9daa7f..7eec748 100644 --- a/src/Client/GUI/CImageLoaderBLP.cpp +++ b/src/Client/GUI/CImageLoaderBLP.cpp @@ -103,7 +103,8 @@ IImage* CImageLoaderBLP::loadImage(io::IReadFile* file) const core::array imagedata3; core::array imagedata1; - for(u32 i=0;i<(header.mip_size[0]/8);i++) + u32 count = header.mip_size[0] / (header.alpha_bitdepth > 1 ? 16 : 8); + for(u32 i=0;i1) { diff --git a/src/Client/GUI/SceneWorld.cpp b/src/Client/GUI/SceneWorld.cpp index b80a01e..e0b5db1 100644 --- a/src/Client/GUI/SceneWorld.cpp +++ b/src/Client/GUI/SceneWorld.cpp @@ -387,6 +387,7 @@ void SceneWorld::UpdateTerrain(void) //doodad->addShadowVolumeSceneNode(); doodad->setPosition(core::vector3df(-d->x, d->z, -d->y)); doodad->setRotation(core::vector3df(-d->ox, -d->oy-90, -d->oz)); + doodad->setScale(core::vector3df(d->scale, d->scale, d->scale)); SceneNodeWithGridPos gp; gp.gx = mapmgr->GetGridX() + tilex - 1; gp.gy = mapmgr->GetGridY() + tiley - 1; diff --git a/src/shared/ADTFileStructs.h b/src/shared/ADTFileStructs.h index bd53ee8..13d95e5 100644 --- a/src/shared/ADTFileStructs.h +++ b/src/shared/ADTFileStructs.h @@ -50,15 +50,15 @@ struct MCIN_chunk struct MDDF_chunk { uint32 id; // position in the MMDX list - uint32 uniqueid; // unique instance id (?) + uint32 uniqueid; // unique instance id float x; // position (quaternion) float y; float z; - float a; // rotatation + float a; // rotation float b; float c; - uint16 flags; uint16 scale; + uint16 flags; }; struct MODF_chunk