-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cache Nametags onDraw3D flags. #4847
Conversation
@@ -0,0 +1,64 @@ | |||
/* | |||
* Author: <N/A> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
who's that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I left the author from fnc_onDraw3D becaus I only copied stuff. I also
don't know who that N/A guy is.. He likes negative arrays thats for sure.
Well commy.. Then better make it official.. If its there people gonna use
it.
|
Can't avoid people using internals, but I can shift the blame on them if something breaks in good conscience. Doesn't help the end user, but I can sleep well at night. |
@dedmen - looks good, I pushed some minor changes:
|
* Cache Nametag flags * Remove unused privates * Fix fading, cursorOnly mode, improve cache reset * Fix header
This will cache the Nametag Flags and _maxDistance for 2 seconds instead of reparsing them every Frame.
This will take about 0.0621ms of load from eachFrame and cache it.
After caching the load will be about 0.0323ms per frame.
0.03ms improvement call me crazy if you want.
This will also remove the unused privates from fnc_onDraw3d.
This will create lag from changing Nametag settings to them being visible. Sadly cachedCall can only use 1 Event and I used
cba_events_visionModeEvent
to be also able to cache the _maxDistance variable.Calculating the _maxDistance variable takes 0.0267 ms so it's very worthwhile to be cached.