-
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?
Changes from all commits
075b72b
032ee4b
bf0c565
01fa228
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,8 @@ | |
| #endif | ||
|
|
||
| // This enables the l4d style of culling all cvars that are not marked FCVAR_RELEASE : | ||
| #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 | ||
|
Comment on lines
-35
to
+36
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the purpose of this? Can't you just add a
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. iirc
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
||
| //----------------------------------------------------------------------------- | ||
| // Statically constructed list of ConCommandBases, | ||
|
|
@@ -44,6 +45,21 @@ static int s_nCVarFlag = 0; | |
| static int s_nDLLIdentifier = -1; // A unique identifier indicating which DLL this convar came from | ||
| static bool s_bRegistered = false; | ||
|
|
||
| int* ConVar_GetConVarFlag() | ||
| { | ||
| return &s_nCVarFlag; | ||
| } | ||
|
|
||
| int* ConVar_GetDLLIdentifier() | ||
| { | ||
| return &s_nDLLIdentifier; | ||
| } | ||
|
|
||
| bool* ConVar_GetIsRegistered() | ||
| { | ||
| return &s_bRegistered; | ||
| } | ||
|
Comment on lines
+48
to
+61
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| class CDefaultAccessor : public IConCommandBaseAccessor | ||
| { | ||
| public: | ||
|
|
@@ -57,6 +73,12 @@ class CDefaultAccessor : public IConCommandBaseAccessor | |
|
|
||
| static CDefaultAccessor s_DefaultAccessor; | ||
|
|
||
| IConCommandBaseAccessor* ConVar_GetDefaultAccessor() | ||
| { | ||
| return &s_DefaultAccessor; | ||
| } | ||
|
|
||
| #ifndef TIER1_CUSTOMCONVARREGISTER | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have an example of these custom functions?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| //----------------------------------------------------------------------------- | ||
| // Called by the framework to register ConCommandBases with the ICVar | ||
| //----------------------------------------------------------------------------- | ||
|
|
@@ -87,7 +109,9 @@ void ConVar_Register( int nCVarFlag, IConCommandBaseAccessor *pAccessor ) | |
|
|
||
| ConCommandBase::s_pConCommandBases = NULL; | ||
| } | ||
| #endif | ||
|
|
||
| #ifndef TIER1_CUSTOMCONVARUNREGISTER | ||
| void ConVar_Unregister( ) | ||
| { | ||
| if ( !g_pCVar || !s_bRegistered ) | ||
|
|
@@ -101,7 +125,7 @@ void ConVar_Unregister( ) | |
| s_nDLLIdentifier = -1; | ||
| s_bRegistered = false; | ||
| } | ||
|
|
||
| #endif | ||
|
|
||
| //----------------------------------------------------------------------------- | ||
| // Purpose: Default constructor | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,6 +127,10 @@ group("SourceSDK") | |
| ["Header files/*"] = {"../public/tier1/*.h", "../public/*.h", "../common/xbox/*.h"} | ||
| }) | ||
|
|
||
| if TIER1_PROJECTCALLBACK then | ||
| TIER1_PROJECTCALLBACK() | ||
| end | ||
|
Comment on lines
+130
to
+132
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above, I might remove this again. |
||
|
|
||
| IncludeSDKCommonInternal() | ||
| IncludeSDKLZMA() | ||
|
|
||
|
|
||
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.