+ // allocate a new model
+ loadmodel = mod;
+
+ // LordHavoc: unload the existing model in this slot (if there is one)
+ Mod_UnloadModel(mod);
+ mod->isworldmodel = isworldmodel;
+ mod->needload = false;
+ mod->used = true;
+ mod->crc = crc;
+
+ // all models use memory, so allocate a memory pool
+ mod->mempool = Mem_AllocPool(mod->name);
+ // all models load textures, so allocate a texture pool
+ if (cls.state != ca_dedicated)
+ mod->texturepool = R_AllocTexturePool();
+
+ // call the apropriate loader
+ if (!memcmp(buf, "IDPO" , 4)) Mod_LoadAliasModel (mod, buf);
+ else if (!memcmp(buf, "IDP2" , 4)) Mod_LoadQ2AliasModel(mod, buf);
+ else if (!memcmp(buf, "ZYMOTIC" , 7)) Mod_LoadZymoticModel(mod, buf);
+ else if (!memcmp(buf, "IDSP" , 4)) Mod_LoadSpriteModel (mod, buf);
+ else Mod_LoadBrushModel (mod, buf);
+
+ Mem_Free(buf);
+