Copy the version string obtained from svnversion at runtime instead of
using it as a constant in several places. Saves a few bytes and the time it takes to recompile a bunch of files whenever svnversion twitches. Using the SVN version string as an integer is not portable as the Unix svnversion always includes e.g. the "M" suffix for a modified tree. Windows people, please check my change to Plugin_VideoDX9/Src/main.cpp as I don't really understand how _T() and the %hs format string work. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5852 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
75be9ce40d
commit
39ae36398f
|
@ -888,6 +888,10 @@
|
||||||
RelativePath=".\Src\Timer.h"
|
RelativePath=".\Src\Timer.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath=".\Src\Version.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\Src\x64Analyzer.cpp"
|
RelativePath=".\Src\x64Analyzer.cpp"
|
||||||
>
|
>
|
||||||
|
|
|
@ -25,6 +25,10 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
// SVN version number
|
||||||
|
extern const char *svn_rev_str;
|
||||||
|
extern const char *netplay_dolphin_ver;
|
||||||
|
|
||||||
// Force enable logging in the right modes. For some reason, something had changed
|
// Force enable logging in the right modes. For some reason, something had changed
|
||||||
// so that debugfast no longer logged.
|
// so that debugfast no longer logged.
|
||||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
#if defined(_DEBUG) || defined(DEBUGFAST)
|
||||||
|
|
|
@ -34,6 +34,7 @@ files = [
|
||||||
"Thunk.cpp",
|
"Thunk.cpp",
|
||||||
"Timer.cpp",
|
"Timer.cpp",
|
||||||
"Thread.cpp",
|
"Thread.cpp",
|
||||||
|
"Version.cpp",
|
||||||
"x64Emitter.cpp",
|
"x64Emitter.cpp",
|
||||||
"x64Analyzer.cpp",
|
"x64Analyzer.cpp",
|
||||||
"Crypto/bn.cpp",
|
"Crypto/bn.cpp",
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
#define SVN_REV $WCREV$
|
|
||||||
#define SVN_REV_STR "$WCMODS?$WCREV$M:$WCREV$$"
|
#define SVN_REV_STR "$WCMODS?$WCREV$M:$WCREV$$"
|
||||||
|
|
|
@ -1,7 +0,0 @@
|
||||||
REV=`svnversion -n ./`
|
|
||||||
echo $REV
|
|
||||||
|
|
||||||
cat > Src/svnrev.h <<EOF
|
|
||||||
#define SVN_REV $REV
|
|
||||||
#define SVN_REV_STR "$REV"
|
|
||||||
EOF
|
|
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
#include "AboutDolphin.h"
|
#include "AboutDolphin.h"
|
||||||
#include "svnrev.h"
|
|
||||||
#include "CPUDetect.h"
|
#include "CPUDetect.h"
|
||||||
#include "../resources/dolphin_logo.cpp"
|
#include "../resources/dolphin_logo.cpp"
|
||||||
|
|
||||||
|
@ -49,7 +48,7 @@ void AboutDolphin::CreateGUIControls()
|
||||||
wxBitmap(iDolphinLogo), wxDefaultPosition, wxDefaultSize, 0);
|
wxBitmap(iDolphinLogo), wxDefaultPosition, wxDefaultSize, 0);
|
||||||
|
|
||||||
std::string Text = std::string("") +
|
std::string Text = std::string("") +
|
||||||
"Dolphin SVN revision " + SVN_REV_STR + "\n"
|
"Dolphin SVN revision " + svn_rev_str + "\n"
|
||||||
"Copyright (c) 2003-2010+ Dolphin Team\n"
|
"Copyright (c) 2003-2010+ Dolphin Team\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Dolphin is a Gamecube/Wii emulator, which was\n"
|
"Dolphin is a Gamecube/Wii emulator, which was\n"
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "svnrev.h"
|
|
||||||
|
|
||||||
#include "Common.h" // Common
|
#include "Common.h" // Common
|
||||||
|
|
||||||
|
@ -358,15 +357,6 @@ bool DolphinApp::OnInit()
|
||||||
|
|
||||||
SetEnableAlert(SConfig::GetInstance().m_LocalCoreStartupParameter.bUsePanicHandlers);
|
SetEnableAlert(SConfig::GetInstance().m_LocalCoreStartupParameter.bUsePanicHandlers);
|
||||||
|
|
||||||
// Create the window title
|
|
||||||
#ifdef _DEBUG
|
|
||||||
const char *title = "Dolphin Debug SVN R " SVN_REV_STR;
|
|
||||||
#elif defined DEBUGFAST
|
|
||||||
const char *title = "Dolphin Debugfast SVN R " SVN_REV_STR;
|
|
||||||
#else
|
|
||||||
const char *title = "Dolphin SVN R " SVN_REV_STR;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int x = SConfig::GetInstance().m_LocalCoreStartupParameter.iPosX;
|
int x = SConfig::GetInstance().m_LocalCoreStartupParameter.iPosX;
|
||||||
int y = SConfig::GetInstance().m_LocalCoreStartupParameter.iPosY;
|
int y = SConfig::GetInstance().m_LocalCoreStartupParameter.iPosY;
|
||||||
int w = SConfig::GetInstance().m_LocalCoreStartupParameter.iWidth;
|
int w = SConfig::GetInstance().m_LocalCoreStartupParameter.iWidth;
|
||||||
|
@ -383,8 +373,10 @@ bool DolphinApp::OnInit()
|
||||||
x = y = -1;
|
x = y = -1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
main_frame = new CFrame((wxFrame*)NULL, wxID_ANY, wxString::FromAscii(title),
|
main_frame = new CFrame((wxFrame*)NULL, wxID_ANY,
|
||||||
wxPoint(x, y), wxSize(w, h), UseDebugger, UseLogger);
|
wxString::FromAscii(svn_rev_str),
|
||||||
|
wxPoint(x, y), wxSize(w, h),
|
||||||
|
UseDebugger, UseLogger);
|
||||||
SetTopWindow(main_frame);
|
SetTopWindow(main_frame);
|
||||||
|
|
||||||
#if defined HAVE_X11 && HAVE_X11
|
#if defined HAVE_X11 && HAVE_X11
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#include <SFML/Network.hpp>
|
#include <SFML/Network.hpp>
|
||||||
|
|
||||||
#include "GCPadStatus.h"
|
#include "GCPadStatus.h"
|
||||||
#include "svnrev.h"
|
|
||||||
|
|
||||||
//#include <wx/wx.h>
|
//#include <wx/wx.h>
|
||||||
|
|
||||||
|
@ -41,20 +40,6 @@ typedef std::vector<Rpt> NetWiimote;
|
||||||
|
|
||||||
#define NETPLAY_VERSION "Dolphin NetPlay 2.2"
|
#define NETPLAY_VERSION "Dolphin NetPlay 2.2"
|
||||||
|
|
||||||
#ifdef _M_X64
|
|
||||||
#define NP_ARCH "x64"
|
|
||||||
#else
|
|
||||||
#define NP_ARCH "x86"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#define NETPLAY_DOLPHIN_VER SVN_REV_STR" W"NP_ARCH
|
|
||||||
#elif __APPLE__
|
|
||||||
#define NETPLAY_DOLPHIN_VER SVN_REV_STR" M"NP_ARCH
|
|
||||||
#else
|
|
||||||
#define NETPLAY_DOLPHIN_VER SVN_REV_STR" L"NP_ARCH
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// messages
|
// messages
|
||||||
#define NP_MSG_PLAYER_JOIN 0x10
|
#define NP_MSG_PLAYER_JOIN 0x10
|
||||||
#define NP_MSG_PLAYER_LEAVE 0x11
|
#define NP_MSG_PLAYER_LEAVE 0x11
|
||||||
|
|
|
@ -24,7 +24,7 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, const s
|
||||||
// send connect message
|
// send connect message
|
||||||
sf::Packet spac;
|
sf::Packet spac;
|
||||||
spac << NETPLAY_VERSION;
|
spac << NETPLAY_VERSION;
|
||||||
spac << NETPLAY_DOLPHIN_VER;
|
spac << netplay_dolphin_ver;
|
||||||
spac << name;
|
spac << name;
|
||||||
m_socket.Send(spac);
|
m_socket.Send(spac);
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ NetPlayClient::NetPlayClient(const std::string& address, const u16 port, const s
|
||||||
Player player;
|
Player player;
|
||||||
player.name = name;
|
player.name = name;
|
||||||
player.pid = m_pid;
|
player.pid = m_pid;
|
||||||
player.revision = NETPLAY_DOLPHIN_VER;
|
player.revision = netplay_dolphin_ver;
|
||||||
|
|
||||||
// add self to player list
|
// add self to player list
|
||||||
m_players[m_pid] = player;
|
m_players[m_pid] = player;
|
||||||
|
|
|
@ -24,7 +24,7 @@ NetPlayServer::NetPlayServer(const u16 port, const std::string& name, NetPlayDia
|
||||||
{
|
{
|
||||||
Client player;
|
Client player;
|
||||||
player.pid = 0;
|
player.pid = 0;
|
||||||
player.revision = NETPLAY_DOLPHIN_VER;
|
player.revision = netplay_dolphin_ver;
|
||||||
player.socket = m_socket;
|
player.socket = m_socket;
|
||||||
player.name = name;
|
player.name = name;
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
#include "Thread.h"
|
#include "Thread.h"
|
||||||
#include "LogManager.h"
|
#include "LogManager.h"
|
||||||
|
|
||||||
#include "svnrev.h"
|
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "VideoConfig.h"
|
#include "VideoConfig.h"
|
||||||
|
@ -162,7 +161,7 @@ unsigned int Callback_PeekMessages()
|
||||||
void UpdateFPSDisplay(const char* text)
|
void UpdateFPSDisplay(const char* text)
|
||||||
{
|
{
|
||||||
char temp[512];
|
char temp[512];
|
||||||
sprintf_s(temp, 512, "SVN R%i: DX11: %s", SVN_REV, text);
|
sprintf_s(temp, 512, "SVN R%s: DX11: %s", svn_rev_str, text);
|
||||||
SetWindowTextA(EmuWindow::GetWnd(), temp);
|
SetWindowTextA(EmuWindow::GetWnd(), temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,14 +26,11 @@
|
||||||
GFXConfigDialogDX *m_ConfigFrame = NULL;
|
GFXConfigDialogDX *m_ConfigFrame = NULL;
|
||||||
#endif // HAVE_WX
|
#endif // HAVE_WX
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
#if defined(HAVE_WX) && HAVE_WX
|
||||||
#include "Debugger/Debugger.h"
|
#include "Debugger/Debugger.h"
|
||||||
GFXDebuggerDX9 *m_DebuggerFrame = NULL;
|
GFXDebuggerDX9 *m_DebuggerFrame = NULL;
|
||||||
#endif // HAVE_WX
|
#endif // HAVE_WX
|
||||||
|
|
||||||
#include "svnrev.h"
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "VideoConfig.h"
|
#include "VideoConfig.h"
|
||||||
#include "Fifo.h"
|
#include "Fifo.h"
|
||||||
|
@ -165,8 +162,7 @@ unsigned int Callback_PeekMessages()
|
||||||
void UpdateFPSDisplay(const char *text)
|
void UpdateFPSDisplay(const char *text)
|
||||||
{
|
{
|
||||||
TCHAR temp[512];
|
TCHAR temp[512];
|
||||||
swprintf_s(temp, 512, _T("SVN R%i: DX9: %hs"), SVN_REV, text);
|
swprintf_s(temp, 512, _T("SVN R%s: DX9: %hs"), svn_rev_str, text);
|
||||||
SetWindowText(EmuWindow::GetWnd(), temp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetDllInfo (PLUGIN_INFO* _PluginInfo)
|
void GetDllInfo (PLUGIN_INFO* _PluginInfo)
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#include "VideoConfig.h"
|
#include "VideoConfig.h"
|
||||||
#include "IniFile.h"
|
#include "IniFile.h"
|
||||||
#include "svnrev.h"
|
|
||||||
#include "Setup.h"
|
#include "Setup.h"
|
||||||
|
|
||||||
#include "Render.h"
|
#include "Render.h"
|
||||||
|
@ -113,7 +112,7 @@ unsigned int Callback_PeekMessages()
|
||||||
void UpdateFPSDisplay(const char *text)
|
void UpdateFPSDisplay(const char *text)
|
||||||
{
|
{
|
||||||
char temp[512];
|
char temp[512];
|
||||||
sprintf(temp, "SVN R%s: GL: %s", SVN_REV_STR, text);
|
sprintf(temp, "SVN R%s: GL: %s", svn_rev_str, text);
|
||||||
OpenGL_SetWindowText(temp);
|
OpenGL_SetWindowText(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "VideoConfig.h"
|
#include "VideoConfig.h"
|
||||||
#include "IniFile.h"
|
#include "IniFile.h"
|
||||||
#include "svnrev.h"
|
|
||||||
#include "Setup.h"
|
#include "Setup.h"
|
||||||
|
|
||||||
//#include "Render.h"
|
//#include "Render.h"
|
||||||
|
@ -113,7 +112,7 @@ unsigned int Callback_PeekMessages()
|
||||||
void UpdateFPSDisplay(const char *text)
|
void UpdateFPSDisplay(const char *text)
|
||||||
{
|
{
|
||||||
char temp[512];
|
char temp[512];
|
||||||
sprintf(temp, "SVN R%s: SW: %s", SVN_REV_STR, text);
|
sprintf(temp, "SVN R%s: SW: %s", svn_rev_str, text);
|
||||||
OpenGL_SetWindowText(temp);
|
OpenGL_SetWindowText(temp);
|
||||||
}
|
}
|
||||||
// =========================
|
// =========================
|
||||||
|
|
Loading…
Reference in New Issue