I'm pretty sure my posting said the exact opposite of botman's response.

"Precacheing only allocates a name slot for model.  It doesn't force it to
be in memory.  The HL engine demand loads model data only when needed."

It rarely happens, but you can't count on the pointer being valid between
subsequent calls to g_engfuncs.pfnGetModelPointer(), since the engine can
move or throw away model data if something else needs the memory.  In
theory, each call to g_engfuncs.pfnGetModelPointer() could force a cache
flush and any pointers it returned earlier will no longer be valid.

I also recommend against loading a private copy of the model, you should
just write your code so it calls Mod_g_engfuncs.pfnGetModelPointer() when it
needs  a pointer to your model data.

-----Original Message-----
From: botman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 28, 2003 10:30 AM
To: [EMAIL PROTECTED]
Subject: Re: [hlcoders] Models and memory management


> Does the model data for monsters remain in memory for the duration of a
> map, or is it dynamically loaded/unloaded?  I'm guessing that the player
> model remains in memory.  What I really need to know is, if I use
> g_engfuncs.pfnGetModelPointer, will that pointer remain valid or do I need
> to call it each time I need the data?  I'm trying to decide whether to use
> the engine's copy of the model or just load it myself - it just seems a
> waste of memory to have the same thing loaded twice.

Everything that get's precached stays loaded into memory until the level is
unloaded.  There was a discussion a few months ago in this group about
precacheing and when memory is allocated for parts of a model.  Here's Ken's
reply...

http://list.valvesoftware.com/mailman/private/hlcoders/2002-October/004928.h
tml

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to