Raised This Month: $ Target: $400
 0% 

Cvar and Pcvar


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 05-10-2013 , 16:05   Re: Cvar and Pcvar
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
In a fast and simplistic explanation : when you register a cvar, this one is saved in a big list. To access to a specific cvar of this list, you need to search by the cvar name, so comparing each name, until you find the one you want do do things. It's a slow process. Instead, you could point directly on a cvar, like in Pawn you would know the index of an array, here it's not an index, but more a "pointer". That's the point of using pcvar (p for pointer). You don't need to know what is really a pointer in C (that's something you can search). So : get_cvar_* will search by name in the big list to know the "pointer" , get_pcvar_* will access directly to the "pointer" in memory ; that's why it's way faster.
Perfect, thanks
__________________
Jhob94 is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 10:54.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode