Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
e3d106d5
Commit
e3d106d5
authored
6 years ago
by
Marco Z
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'public-gl/2122-version' into 2122-version
parents
b49cf11f
edbf9073
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!488
Merge in next and don't billboard papersprites in GL
,
!402
Update code versions to 2.1.22
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/command.c
+17
-5
17 additions, 5 deletions
src/command.c
src/command.h
+1
-0
1 addition, 0 deletions
src/command.h
src/doomdef.h
+14
-0
14 additions, 0 deletions
src/doomdef.h
src/m_misc.c
+8
-8
8 additions, 8 deletions
src/m_misc.c
with
40 additions
and
13 deletions
src/command.c
+
17
−
5
View file @
e3d106d5
...
@@ -50,6 +50,7 @@ static void COM_Wait_f(void);
...
@@ -50,6 +50,7 @@ static void COM_Wait_f(void);
static
void
COM_Help_f
(
void
);
static
void
COM_Help_f
(
void
);
static
void
COM_Toggle_f
(
void
);
static
void
COM_Toggle_f
(
void
);
static
void
CV_EnforceExecVersion
(
void
);
static
boolean
CV_FilterVarByVersion
(
consvar_t
*
v
,
const
char
*
valstr
);
static
boolean
CV_FilterVarByVersion
(
consvar_t
*
v
,
const
char
*
valstr
);
static
boolean
CV_Command
(
void
);
static
boolean
CV_Command
(
void
);
static
consvar_t
*
CV_FindVar
(
const
char
*
name
);
static
consvar_t
*
CV_FindVar
(
const
char
*
name
);
...
@@ -64,10 +65,11 @@ CV_PossibleValue_t CV_YesNo[] = {{0, "No"}, {1, "Yes"}, {0, NULL}};
...
@@ -64,10 +65,11 @@ CV_PossibleValue_t CV_YesNo[] = {{0, "No"}, {1, "Yes"}, {0, NULL}};
CV_PossibleValue_t
CV_Unsigned
[]
=
{{
0
,
"MIN"
},
{
999999999
,
"MAX"
},
{
0
,
NULL
}};
CV_PossibleValue_t
CV_Unsigned
[]
=
{{
0
,
"MIN"
},
{
999999999
,
"MAX"
},
{
0
,
NULL
}};
CV_PossibleValue_t
CV_Natural
[]
=
{{
1
,
"MIN"
},
{
999999999
,
"MAX"
},
{
0
,
NULL
}};
CV_PossibleValue_t
CV_Natural
[]
=
{{
1
,
"MIN"
},
{
999999999
,
"MAX"
},
{
0
,
NULL
}};
// Filter consvars by
MOD
VERSION
// Filter consvars by
EXEC
VERSION
// First implementation is 26 (2.1.21), so earlier configs default at 25 (2.1.20)
// First implementation is 26 (2.1.21), so earlier configs default at 25 (2.1.20)
// Also set CV_HIDEN during runtime, after config is loaded
// Also set CV_HIDEN during runtime, after config is loaded
consvar_t
cv_execversion
=
{
"execversion"
,
"25"
,
0
,
CV_Unsigned
,
NULL
,
0
,
NULL
,
NULL
,
0
,
0
,
NULL
};
static
boolean
execversion_enabled
=
false
;
consvar_t
cv_execversion
=
{
"execversion"
,
"25"
,
CV_CALL
,
CV_Unsigned
,
CV_EnforceExecVersion
,
0
,
NULL
,
NULL
,
0
,
0
,
NULL
};
// for default joyaxis detection
// for default joyaxis detection
static
boolean
joyaxis_default
=
false
;
static
boolean
joyaxis_default
=
false
;
...
@@ -1598,10 +1600,21 @@ void CV_InitFilterVar(void)
...
@@ -1598,10 +1600,21 @@ void CV_InitFilterVar(void)
joyaxis_count
=
joyaxis2_count
=
0
;
joyaxis_count
=
joyaxis2_count
=
0
;
}
}
void
CV_ToggleExecVersion
(
boolean
enable
)
{
execversion_enabled
=
enable
;
}
static
void
CV_EnforceExecVersion
(
void
)
{
if
(
!
execversion_enabled
)
CV_StealthSetValue
(
&
cv_execversion
,
EXECVERSION
);
}
static
boolean
CV_FilterJoyAxisVars
(
consvar_t
*
v
,
const
char
*
valstr
)
static
boolean
CV_FilterJoyAxisVars
(
consvar_t
*
v
,
const
char
*
valstr
)
{
{
// If ALL axis settings are previous defaults, set them to the new defaults
// If ALL axis settings are previous defaults, set them to the new defaults
//
MOD
VERSION < 26 (2.1.21)
//
EXEC
VERSION < 26 (2.1.21)
if
(
joyaxis_default
)
if
(
joyaxis_default
)
{
{
...
@@ -1749,8 +1762,7 @@ static boolean CV_FilterVarByVersion(consvar_t *v, const char *valstr)
...
@@ -1749,8 +1762,7 @@ static boolean CV_FilterVarByVersion(consvar_t *v, const char *valstr)
if
(
!
(
v
->
flags
&
CV_SAVE
))
if
(
!
(
v
->
flags
&
CV_SAVE
))
return
true
;
return
true
;
// We go by MODVERSION here
if
(
GETMAJOREXECVERSION
(
cv_execversion
.
value
)
<
26
)
// 26 = 2.1.21
if
(
cv_execversion
.
value
<
26
)
// 26 = 2.1.21
{
{
// MOUSE SETTINGS
// MOUSE SETTINGS
// alwaysfreelook split between first and third person (chasefreelook)
// alwaysfreelook split between first and third person (chasefreelook)
...
...
This diff is collapsed.
Click to expand it.
src/command.h
+
1
−
0
View file @
e3d106d5
...
@@ -130,6 +130,7 @@ extern CV_PossibleValue_t CV_Natural[];
...
@@ -130,6 +130,7 @@ extern CV_PossibleValue_t CV_Natural[];
extern
consvar_t
cv_execversion
;
extern
consvar_t
cv_execversion
;
void
CV_InitFilterVar
(
void
);
void
CV_InitFilterVar
(
void
);
void
CV_ToggleExecVersion
(
boolean
enable
);
// register a variable for use at the console
// register a variable for use at the console
void
CV_RegisterVar
(
consvar_t
*
variable
);
void
CV_RegisterVar
(
consvar_t
*
variable
);
...
...
This diff is collapsed.
Click to expand it.
src/doomdef.h
+
14
−
0
View file @
e3d106d5
...
@@ -216,6 +216,20 @@ extern FILE *logstream;
...
@@ -216,6 +216,20 @@ extern FILE *logstream;
// Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1".
// Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1".
#define MODVERSION 27
#define MODVERSION 27
// To version config.cfg, MAJOREXECVERSION is set equal to MODVERSION automatically.
// Increment MINOREXECVERSION whenever a config change is needed that does not correspond
// to an increment in MODVERSION. This might never happen in practice.
// If MODVERSION increases, set MINOREXECVERSION to 0.
#define MAJOREXECVERSION MODVERSION
#define MINOREXECVERSION 0
// (It would have been nice to use VERSION and SUBVERSION but those are zero'd out for DEVELOP builds)
// Macros
#define GETMAJOREXECVERSION(v) (v & 0xFFFF)
#define GETMINOREXECVERSION(v) (v >> 16)
#define GETEXECVERSION(major,minor) (major + (minor << 16))
#define EXECVERSION GETEXECVERSION(MAJOREXECVERSION, MINOREXECVERSION)
// =========================================================================
// =========================================================================
// The maximum number of players, multiplayer/networking.
// The maximum number of players, multiplayer/networking.
...
...
This diff is collapsed.
Click to expand it.
src/m_misc.c
+
8
−
8
View file @
e3d106d5
...
@@ -443,7 +443,7 @@ void Command_LoadConfig_f(void)
...
@@ -443,7 +443,7 @@ void Command_LoadConfig_f(void)
FIL_ForceExtension
(
configfile
,
".cfg"
);
FIL_ForceExtension
(
configfile
,
".cfg"
);
// temporarily reset execversion to default
// temporarily reset execversion to default
cv_e
xec
v
ersion
.
flags
&=
~
CV_HIDEN
;
CV_ToggleE
xec
V
ersion
(
true
)
;
COM_BufInsertText
(
va
(
"%s
\"
%s
\"\n
"
,
cv_execversion
.
name
,
cv_execversion
.
defaultvalue
));
COM_BufInsertText
(
va
(
"%s
\"
%s
\"\n
"
,
cv_execversion
.
name
,
cv_execversion
.
defaultvalue
));
CV_InitFilterVar
();
CV_InitFilterVar
();
...
@@ -451,8 +451,8 @@ void Command_LoadConfig_f(void)
...
@@ -451,8 +451,8 @@ void Command_LoadConfig_f(void)
COM_BufInsertText
(
va
(
"exec
\"
%s
\"\n
"
,
configfile
));
COM_BufInsertText
(
va
(
"exec
\"
%s
\"\n
"
,
configfile
));
// don't filter anymore vars and don't let this convsvar be changed
// don't filter anymore vars and don't let this convsvar be changed
COM_BufInsertText
(
va
(
"%s
\"
%d
\"\n
"
,
cv_execversion
.
name
,
MOD
VERSION
));
COM_BufInsertText
(
va
(
"%s
\"
%d
\"\n
"
,
cv_execversion
.
name
,
EXEC
VERSION
));
cv_e
xec
v
ersion
.
flags
|=
CV_HIDEN
;
CV_ToggleE
xec
V
ersion
(
false
)
;
}
}
/** Saves the current configuration and loads another.
/** Saves the current configuration and loads another.
...
@@ -494,7 +494,7 @@ void M_FirstLoadConfig(void)
...
@@ -494,7 +494,7 @@ void M_FirstLoadConfig(void)
// temporarily reset execversion to default
// temporarily reset execversion to default
// we shouldn't need to do this, but JUST in case...
// we shouldn't need to do this, but JUST in case...
cv_e
xec
v
ersion
.
flags
&=
~
CV_HIDEN
;
CV_ToggleE
xec
V
ersion
(
true
)
;
COM_BufInsertText
(
va
(
"%s
\"
%s
\"\n
"
,
cv_execversion
.
name
,
cv_execversion
.
defaultvalue
));
COM_BufInsertText
(
va
(
"%s
\"
%s
\"\n
"
,
cv_execversion
.
name
,
cv_execversion
.
defaultvalue
));
CV_InitFilterVar
();
CV_InitFilterVar
();
...
@@ -503,8 +503,8 @@ void M_FirstLoadConfig(void)
...
@@ -503,8 +503,8 @@ void M_FirstLoadConfig(void)
// no COM_BufExecute() needed; that does it right away
// no COM_BufExecute() needed; that does it right away
// don't filter anymore vars and don't let this convsvar be changed
// don't filter anymore vars and don't let this convsvar be changed
COM_BufInsertText
(
va
(
"%s
\"
%d
\"\n
"
,
cv_execversion
.
name
,
MOD
VERSION
));
COM_BufInsertText
(
va
(
"%s
\"
%d
\"\n
"
,
cv_execversion
.
name
,
EXEC
VERSION
));
cv_e
xec
v
ersion
.
flags
|=
CV_HIDEN
;
CV_ToggleE
xec
V
ersion
(
false
)
;
// make sure I_Quit() will write back the correct config
// make sure I_Quit() will write back the correct config
// (do not write back the config if it crash before)
// (do not write back the config if it crash before)
...
@@ -570,8 +570,8 @@ void M_SaveConfig(const char *filename)
...
@@ -570,8 +570,8 @@ void M_SaveConfig(const char *filename)
fprintf
(
f
,
"// SRB2 configuration file.
\n
"
);
fprintf
(
f
,
"// SRB2 configuration file.
\n
"
);
// print execversion FIRST, because subsequent consvars need to be filtered
// print execversion FIRST, because subsequent consvars need to be filtered
// always print current
MOD
VERSION
// always print current
EXEC
VERSION
fprintf
(
f
,
"%s
\"
%d
\"\n
"
,
cv_execversion
.
name
,
MOD
VERSION
);
fprintf
(
f
,
"%s
\"
%d
\"\n
"
,
cv_execversion
.
name
,
EXEC
VERSION
);
// FIXME: save key aliases if ever implemented..
// FIXME: save key aliases if ever implemented..
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment