Jump to content

Clearing Map But Saving Models


gamecreator
 Share

Recommended Posts

Say I have models preloaded like so:

preload[0]->Model::Load("player1.mdl");
preload[1]->Model::Load("player2.mdl");
preload[2]->Model::Load("enemy1.mdl");
etc.

This would let me use the same models across multiple maps by keeping them in memory.  I then load a map and play the game.  Everything is fine.

However, when I want to change the map, I need to call world->Clear() but unfortunately that will also wipe the preloads.  How do I prevent this?  Do I call GCSuspend then Clear then reload all the preloads (which, in theory, should be fast since they're already in memory)?  Is there a better way to do this?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...