Skip to content

Commit

Permalink
Optimize: Do not bother buffering unknown chunks in models
Browse files Browse the repository at this point in the history
Rather than buffering unknown chunks in model files, simply seek
past them instead.
  • Loading branch information
danij-deng committed Sep 29, 2011
1 parent 2623da4 commit 0359d48
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions doomsday/engine/portable/src/r_model.c
Expand Up @@ -321,7 +321,7 @@ static void R_LoadModelDMD(DFile* file, model_t* mo)

while(LONG(chunk.type) != DMC_END)
{
switch (LONG(chunk.type))
switch(LONG(chunk.type))
{
case DMC_INFO: // Standard DMD information chunk.
DFile_Read(file, (uint8_t*)inf, LONG(chunk.length));
Expand All @@ -342,9 +342,8 @@ static void R_LoadModelDMD(DFile* file, model_t* mo)

default:
// Just skip all unknown chunks.
temp = M_Malloc(LONG(chunk.length));
DFile_Read(file, (uint8_t*)temp, LONG(chunk.length));
free(temp);
DFile_Seek(file, LONG(chunk.length), SEEK_CUR);
break;
}
// Read the next chunk header.
DFile_Read(file, (uint8_t*)&chunk, sizeof(chunk));
Expand Down

0 comments on commit 0359d48

Please sign in to comment.