mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-12 01:38:37 +12:00
Add more game window title options
This commit is contained in:
parent
dd85e733d3
commit
0dd417e5f2
7 changed files with 93 additions and 32 deletions
|
@ -1,4 +1,4 @@
|
|||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "rpcs3_version.h"
|
||||
#include "git-version.h"
|
||||
#include "Utilities/StrUtil.h"
|
||||
|
@ -26,4 +26,25 @@ namespace rpcs3
|
|||
static constexpr utils::version version{ 0, 0, 8, utils::version_type::alpha, 1, RPCS3_GIT_VERSION };
|
||||
return version;
|
||||
}
|
||||
|
||||
std::string get_version_and_branch()
|
||||
{
|
||||
// Get version by substringing VersionNumber-buildnumber-commithash to get just the part before the dash
|
||||
std::string version = rpcs3::get_version().to_string();
|
||||
const auto last_minus = version.find_last_of('-');
|
||||
|
||||
// Add branch and commit hash to version on frame unless it's master.
|
||||
if (rpcs3::get_branch() != "master"sv && rpcs3::get_branch() != "HEAD"sv)
|
||||
{
|
||||
version = version.substr(0, ~last_minus ? last_minus + 9 : last_minus);
|
||||
version += '-';
|
||||
version += rpcs3::get_branch();
|
||||
}
|
||||
else
|
||||
{
|
||||
version = version.substr(0, last_minus);
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue