1
0

Merging r6288 through r6336 from trunk to ogl-es branch

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6337 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2022-04-15 18:51:09 +00:00
parent 67469c8899
commit 2d63fdba3d
115 changed files with 1828 additions and 1154 deletions

View File

@@ -102,18 +102,29 @@ IAnimatedMesh* COCTLoader::createMesh(io::IReadFile* file)
file->read(verts, sizeof(octVert) * header.numVerts);
file->read(faces, sizeof(octFace) * header.numFaces);
//TODO: Make sure id is in the legal range for Textures and Lightmaps
u32 i;
for (i = 0; i < header.numTextures; i++) {
octTexture t;
file->read(&t, sizeof(octTexture));
textures[t.id] = t;
for (i = 0; i < header.numTextures; i++)
{
u32 id;
file->read(&id, sizeof(id));
if ( id >= header.numTextures )
{
os::Printer::log("COCTLoader: Invalid texture id", irr::ELL_WARNING);
id = i;
}
file->read(&textures[id], sizeof(octTexture));
}
for (i = 0; i < header.numLightmaps; i++) {
octLightmap t;
file->read(&t, sizeof(octLightmap));
lightmaps[t.id] = t;
for (i = 0; i < header.numLightmaps; i++)
{
u32 id;
file->read(&id, sizeof(id));
if ( id >= header.numLightmaps )
{
os::Printer::log("COCTLoader: Invalid lightmap id", irr::ELL_WARNING);
id = i;
}
file->read(&lightmaps[id], sizeof(octLightmap));
}
file->read(lights, sizeof(octLight) * header.numLights);