-
Notifications
You must be signed in to change notification settings - Fork 22
Some minor changes #54
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
base: x86-64-branch
Are you sure you want to change the base?
Conversation
e669f80 to
bf0c565
Compare
729ee43 to
01fa228
Compare
| #define CULL_ALL_CVARS_NOT_FCVAR_RELEASE | ||
| // RaphaelIT7: Fk this, why would anyone want this in a SDK. | ||
| // #define CULL_ALL_CVARS_NOT_FCVAR_RELEASE |
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.
What's the purpose of this? Can't you just add a FCVAR_RELEASE flag to the convar/concommand?
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.
iirc FCVAR_RELEASE doesn't exist on 32x so if modules don't consider this, they have random issues with their convars being invisible/never registered.
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 can add a simple
#ifndef FCVAR_RELEASE
#define FCVAR_RELEASE 0
#endiflike in the haptics files for the main branch.
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.
It would work, though still on 32x by default this isn't a thing, and adding that would still cause useless debugging/pain when its missing and it doesn't really seem to be necessary to have this for modules.
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 like to avoid making incompatible changes or with different behavior from the original. I'm way beyond the "hopeful" part for the x86-64 branch becoming the main one, but still... Defining a new FCVAR_RELEASE on the main branch is the solution that deviates the least from the regular behavior. If people develop modules for the x86-64 branch, then they must be aware of the caveats of using it.
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.
Maybe having a flag or something to disable this on x86-64 would be useful instead of having to add this on 32x everywhere.
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.
You don't have to add the flag on modules that only use the main branch. If you use the x86-64 branch, then you add the flag, simple. It will do nothing when you build the module for the main branch.
| if TIER1_PROJECTCALLBACK then | ||
| TIER1_PROJECTCALLBACK() | ||
| end |
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 don't like this workaround, specially for something that doesn't seem to be a problem.
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.
Same as above, I might remove this again.
| class ALIGN8 PLATFORM_CLASS CThreadSpinRWLock | ||
| { | ||
| public: | ||
| #ifndef WIN32 |
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.
What are these changes trying to do?
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.
iirc I had some linker issues on Windows where these were already defined in the tier0.lib or another lib file & caused a pain for a while until the best decision seemed to just wrap it with WIN32 which worked.
| int* ConVar_GetConVarFlag() | ||
| { | ||
| return &s_nCVarFlag; | ||
| } | ||
|
|
||
| int* ConVar_GetDLLIdentifier() | ||
| { | ||
| return &s_nDLLIdentifier; | ||
| } | ||
|
|
||
| bool* ConVar_GetIsRegistered() | ||
| { | ||
| return &s_bRegistered; | ||
| } |
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.
These don't seem specially useful, as they won't return the real instances from Garry's Mod.
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.
Example use case: https://github.com/RaphaelIT7/gmod-holylib/blob/main/source/util.cpp#L691
Using ConVar_GetDLLIdentifier, for example, I can iterate over all convars and find all those from my DLL easily.
| return &s_DefaultAccessor; | ||
| } | ||
|
|
||
| #ifndef TIER1_CUSTOMCONVARREGISTER |
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.
Do you have an example of these custom functions?
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 had used them a good while ago, though they then lost their purpose and were removed again.
Tbh I think I can remove the TIER1_CUSTOMCONVARREGISTER stuff since its really not that useful as I first had thought it would be
[+] Added
TIER1_PROJECTCALLBACKThis allows one to add for example definitions for tier0.
Example
[+] Added
TIER1_CUSTOMCONVARREGISTERandTIER1_CUSTOMCONVARUNREGISTERSome people might want to implement custom ConVar_Register and _Unregister functions so why not provide an option.
[+] Exposed some vars from
convar.cppadding functions likeConVar_GetConVarFlagand such.[#] Fixed some windows 64x compile errors
Some of the threadtools stuff caused linker issues as some of the
CThreadSpinRWLockseem to already exists in thetier0.libfile.[-] Removed
CULL_ALL_CVARS_NOT_FCVAR_RELEASEflag fromconvar.cppThis only exists on 64x and any convar without some specific flags will have the development flag automatically added amking them hidden.