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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
be07a23e
Commit
be07a23e
authored
Apr 10, 2020
by
fickleheart
Browse files
Options
Downloads
Patches
Plain Diff
Make a separate function instead of clogging up IdentifyVersion
parent
6845aca6
No related branches found
No related tags found
2 merge requests
!892
Funny shaders master merge
,
!858
srb2:// server URLs
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/d_main.c
+16
-8
16 additions, 8 deletions
src/d_main.c
with
16 additions
and
8 deletions
src/d_main.c
+
16
−
8
View file @
be07a23e
...
...
@@ -880,15 +880,10 @@ static inline void D_CleanFile(void)
}
}
// ==========================================================================
// Identify the SRB2 version, and IWAD file to use.
// ==========================================================================
static
void
IdentifyVersion
(
void
)
///\brief Checks if a netgame URL is being handled, and changes working directory to the EXE's if so.
/// Done because browsers (at least, Firefox on Windows) launch the game from the browser's directory, which causes problems.
static
void
ChangeDirForUrlHandler
(
void
)
{
char
*
srb2wad
;
const
char
*
srb2waddir
=
NULL
;
// URL handlers are opened by web browsers (at least Firefox) from the browser's working directory, not the game's stored directory,
// so chdir to that directory unless overridden.
if
(
M_GetUrlProtocolArg
()
!=
NULL
&&
!
M_CheckParm
(
"-nochdir"
))
...
...
@@ -917,6 +912,16 @@ static void IdentifyVersion(void)
I_OutputMsg
(
"Couldn't change working directory
\n
"
);
#endif
}
}
// ==========================================================================
// Identify the SRB2 version, and IWAD file to use.
// ==========================================================================
static
void
IdentifyVersion
(
void
)
{
char
*
srb2wad
;
const
char
*
srb2waddir
=
NULL
;
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
// change to the directory where 'srb2.pk3' is found
...
...
@@ -1097,6 +1102,9 @@ void D_SRB2Main(void)
// Test Dehacked lists
DEH_Check
();
// Netgame URL special case: change working dir to EXE folder.
ChangeDirForUrlHandler
();
// identify the main IWAD file to use
IdentifyVersion
();
...
...
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