mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
Common: Move version strings to their own header
Ideally Common.h wouldn't be a header in the Common library, and instead be renamed to something else, like PlatformCompatibility.h or something, but even then, there's still some things in the header that don't really fall under that label This moves the version strings out to their own version header that doesn't dump a bunch of other unrelated things into scope, like what Common.h was doing. This also places them into the Common namespace, as opposed to letting them sit in the global namespace.
This commit is contained in:
@ -15,9 +15,9 @@
|
||||
|
||||
#include "Common/Analytics.h"
|
||||
#include "Common/CPUDetect.h"
|
||||
#include "Common/Common.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Common/Version.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/HW/GCPad.h"
|
||||
#include "Core/Movie.h"
|
||||
@ -121,10 +121,10 @@ void DolphinAnalytics::MakeBaseBuilder()
|
||||
Common::AnalyticsReportBuilder builder;
|
||||
|
||||
// Version information.
|
||||
builder.AddData("version-desc", scm_desc_str);
|
||||
builder.AddData("version-hash", scm_rev_git_str);
|
||||
builder.AddData("version-branch", scm_branch_str);
|
||||
builder.AddData("version-dist", scm_distributor_str);
|
||||
builder.AddData("version-desc", Common::scm_desc_str);
|
||||
builder.AddData("version-hash", Common::scm_rev_git_str);
|
||||
builder.AddData("version-branch", Common::scm_branch_str);
|
||||
builder.AddData("version-dist", Common::scm_distributor_str);
|
||||
|
||||
// CPU information.
|
||||
builder.AddData("cpu-summary", cpu_info.Summarize());
|
||||
|
@ -45,6 +45,9 @@ IPC_HLE_PERIOD: For the Wii Remote this is the call schedule:
|
||||
|
||||
#include "Core/HW/SystemTimers.h"
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
|
||||
#include "Common/Atomic.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "Common/NandPaths.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Common/Timer.h"
|
||||
#include "Common/Version.h"
|
||||
|
||||
#include "Core/Boot/Boot.h"
|
||||
#include "Core/Config/MainSettings.h"
|
||||
@ -1419,7 +1420,7 @@ void GetSettings()
|
||||
SConfig::GetInstance().m_EXIDevice[1] == ExpansionInterface::EXIDEVICE_MEMORYCARDFOLDER)
|
||||
<< 1;
|
||||
|
||||
std::array<u8, 20> revision = ConvertGitRevisionToBytes(scm_rev_git_str);
|
||||
std::array<u8, 20> revision = ConvertGitRevisionToBytes(Common::scm_rev_git_str);
|
||||
std::copy(std::begin(revision), std::end(revision), std::begin(s_revision));
|
||||
|
||||
if (!Config::Get(Config::MAIN_DSP_HLE))
|
||||
|
@ -5,6 +5,8 @@
|
||||
#include "Core/NetPlayClient.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <cstring>
|
||||
#include <fstream>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
@ -13,7 +15,6 @@
|
||||
|
||||
#include <mbedtls/md5.h>
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/CommonPaths.h"
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/ENetUtil.h"
|
||||
@ -21,6 +22,7 @@
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Common/Timer.h"
|
||||
#include "Common/Version.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/HW/EXI/EXI_DeviceIPL.h"
|
||||
#include "Core/HW/SI/SI.h"
|
||||
@ -175,8 +177,8 @@ bool NetPlayClient::Connect()
|
||||
{
|
||||
// send connect message
|
||||
sf::Packet packet;
|
||||
packet << scm_rev_git_str;
|
||||
packet << netplay_dolphin_ver;
|
||||
packet << Common::scm_rev_git_str;
|
||||
packet << Common::netplay_dolphin_ver;
|
||||
packet << m_player_name;
|
||||
Send(packet);
|
||||
enet_host_flush(m_client);
|
||||
@ -225,7 +227,7 @@ bool NetPlayClient::Connect()
|
||||
Player player;
|
||||
player.name = m_player_name;
|
||||
player.pid = m_pid;
|
||||
player.revision = netplay_dolphin_ver;
|
||||
player.revision = Common::netplay_dolphin_ver;
|
||||
|
||||
// add self to player list
|
||||
m_players[m_pid] = player;
|
||||
|
@ -5,6 +5,8 @@
|
||||
#include "Core/NetPlayServer.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
#include <cstdio>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
@ -12,13 +14,13 @@
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
#include "Common/Common.h"
|
||||
#include "Common/ENetUtil.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
#include "Common/MsgHandler.h"
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Common/UPnP.h"
|
||||
#include "Common/Version.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/HW/Sram.h"
|
||||
#include "Core/NetPlayClient.h" //for NetPlayUI
|
||||
@ -254,7 +256,7 @@ unsigned int NetPlayServer::OnConnect(ENetPeer* socket)
|
||||
std::string npver;
|
||||
rpac >> npver;
|
||||
// Dolphin netplay version
|
||||
if (npver != scm_rev_git_str)
|
||||
if (npver != Common::scm_rev_git_str)
|
||||
return CON_ERR_VERSION_MISMATCH;
|
||||
|
||||
// game is currently running
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "Common/StringUtil.h"
|
||||
#include "Common/Thread.h"
|
||||
#include "Common/Timer.h"
|
||||
#include "Common/Version.h"
|
||||
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
@ -116,7 +117,7 @@ static bool DoStateVersion(PointerWrap& p, std::string* version_created_by)
|
||||
version = cookie - COOKIE_BASE;
|
||||
}
|
||||
|
||||
*version_created_by = scm_rev_str;
|
||||
*version_created_by = Common::scm_rev_str;
|
||||
if (version > 42)
|
||||
p.Do(*version_created_by);
|
||||
else
|
||||
|
Reference in New Issue
Block a user