View Single Post
Old 27-07-19, 14:33   #526
Krystian
Archaeologist
 
Join Date: May 2010
Posts: 1,151
Default

Quote:
Originally Posted by AkyV View Post
So I can use collaterally each other now Ptr_Lara and GET.Lara for StrItemTr4...
Okay, I get the theory. But, practically: what are the differences?
The difference is that this Ptr_Lara is the direct pointer stored by tomb4 game memory, whereas GET.pLara is the value copied from this Ptr_Lara pointer, but it is updated later, by the trng_dll library. In most cases it doesn't make a difference, but occasionally it does. The subprocesses in trng_dll library get called after native tomb4 game code, so updating of this GET.pLara pointer and its associated values (SpeedH, StateIdCurrent, OrientH, etc.) happens at a later stage.
For most plugin work this isn't necessary, but in some specific instances (e.g. plugins that are done in assembly code called directly from Tomb4 game code) this is a much easier and faster way to access the pLara pointer than using the Get() function and GET structure, and in the need of modifying values, allows to change associate values directly, rather than relying on the GET. structure which updates only in trng_dll (so much after the tomb4 call).

EDIT: TokyoSU was faster this time
Krystian is offline   Reply With Quote