Move Project64 core over so resource file references version info from Version.h

This commit is contained in:
Emmet Young 2015-02-17 19:28:30 +11:00
parent d033a4f2b8
commit 714886e5ca
7 changed files with 69 additions and 34 deletions

View File

@ -201,6 +201,7 @@
<ClInclude Include="Settings.h" /> <ClInclude Include="Settings.h" />
<ClInclude Include="stdafx.h" /> <ClInclude Include="stdafx.h" />
<ClInclude Include="User Interface.h" /> <ClInclude Include="User Interface.h" />
<ClInclude Include="Version.h" />
<ClInclude Include="WTL App.h" /> <ClInclude Include="WTL App.h" />
<ClInclude Include="Settings\Debug Settings.h" /> <ClInclude Include="Settings\Debug Settings.h" />
<ClInclude Include="Settings\Game Settings.h" /> <ClInclude Include="Settings\Game Settings.h" />

View File

@ -833,5 +833,8 @@
<ClInclude Include="Plugins\Plugin Base.h"> <ClInclude Include="Plugins\Plugin Base.h">
<Filter>Header Files\Plugin Headers</Filter> <Filter>Header Files\Plugin Headers</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Version.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -72,6 +72,8 @@ CMainGui::~CMainGui (void)
bool CMainGui::RegisterWinClass ( void ) bool CMainGui::RegisterWinClass ( void )
{ {
stdstr_f VersionDisplay("Project64 %s", VER_FILE_VERSION_STR);
WNDCLASS wcl; WNDCLASS wcl;
wcl.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW; wcl.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
@ -84,7 +86,7 @@ bool CMainGui::RegisterWinClass ( void )
wcl.lpfnWndProc = (WNDPROC)MainGui_Proc; wcl.lpfnWndProc = (WNDPROC)MainGui_Proc;
wcl.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); wcl.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
wcl.lpszMenuName = NULL; wcl.lpszMenuName = NULL;
wcl.lpszClassName = "Project64 2.0"; wcl.lpszClassName = VersionDisplay.c_str();
if (RegisterClass(&wcl) == 0) return false; if (RegisterClass(&wcl) == 0) return false;
return true; return true;
} }
@ -310,7 +312,8 @@ void CMainGui::Caption (LPCSTR Caption) {
void CMainGui::Create (const char * WindowTitle) void CMainGui::Create (const char * WindowTitle)
{ {
m_hMainWindow = (HWND)CreateWindowEx(WS_EX_ACCEPTFILES, "Project64 2.0", WindowTitle, WS_OVERLAPPED | WS_CLIPCHILDREN | stdstr_f VersionDisplay("Project64 %s", VER_FILE_VERSION_STR);
m_hMainWindow = (HWND)CreateWindowEx(WS_EX_ACCEPTFILES, VersionDisplay.c_str(), WindowTitle, WS_OVERLAPPED | WS_CLIPCHILDREN |
WS_CLIPSIBLINGS | WS_SYSMENU | WS_MINIMIZEBOX,5,5,640,480, WS_CLIPSIBLINGS | WS_SYSMENU | WS_MINIMIZEBOX,5,5,640,480,
NULL,NULL,GetModuleHandle(NULL),this ); NULL,NULL,GetModuleHandle(NULL),this );
m_Created = m_hMainWindow != NULL; m_Created = m_hMainWindow != NULL;
@ -1070,8 +1073,7 @@ DWORD CALLBACK AboutBoxProc (HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam)
SendDlgItemMessage(hWnd,IDC_THANK_LIST,WM_SETFONT,(WPARAM)hTextFont,TRUE); SendDlgItemMessage(hWnd,IDC_THANK_LIST,WM_SETFONT,(WPARAM)hTextFont,TRUE);
//SetCapture(hWnd); //SetCapture(hWnd);
stdstr StrVersion(VersionInfo(VERSION_PRODUCT_VERSION)); stdstr_f VersionDisplay("Version: %s", VER_FILE_VERSION_STR);
stdstr_f VersionDisplay("Version: %s",StrVersion.c_str());
SetWindowText(GetDlgItem(hWnd,IDC_VERSION),VersionDisplay.c_str()); SetWindowText(GetDlgItem(hWnd,IDC_VERSION),VersionDisplay.c_str());
} }
break; break;

View File

@ -1,6 +1,7 @@
// Microsoft Visual C++ generated resource script. // Microsoft Visual C++ generated resource script.
// //
#include "resource.h" #include "resource.h"
#include "Version.h"
#define APSTUDIO_READONLY_SYMBOLS #define APSTUDIO_READONLY_SYMBOLS
@ -934,30 +935,25 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,1,0,1 FILEVERSION VER_FILE_VERSION
PRODUCTVERSION 2,1,0,1 PRODUCTVERSION VER_PRODUCT_VERSION
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG FILEFLAGS VER_FILEFLAGS
FILEFLAGS 0x1L FILEOS VER_FILEOS
#else FILETYPE VER_FILETYPE
FILEFLAGS 0x0L FILESUBTYPE 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN BEGIN
BLOCK "StringFileInfo" BLOCK "StringFileInfo"
BEGIN BEGIN
BLOCK "040904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "CompanyName", " " VALUE "FileDescription", VER_FILE_DESCRIPTION_STR "\0"
VALUE "FileDescription", "Project 64" VALUE "FileVersion", VER_FILE_VERSION_STR "\0"
VALUE "FileVersion", "2, 1, 0, 1" VALUE "InternalName", VER_INTERNAL_NAME_STR "\0"
VALUE "InternalName", "Project64" VALUE "LegalCopyright", VER_COPYRIGHT_STR "\0"
VALUE "LegalCopyright", "Copyright © 2013" VALUE "OriginalFilename", VER_ORIGINAL_FILENAME_STR "\0"
VALUE "OriginalFilename", "Project64.exe" VALUE "ProductName", VER_PRODUCTNAME_STR
VALUE "ProductName", " Project64" VALUE "ProductVersion", VER_PRODUCT_VERSION_STR "\0"
VALUE "ProductVersion", "2, 1, 0, 1"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View File

@ -0,0 +1,41 @@
/****************************************************************************
* *
* Project 64 - A Nintendo 64 emulator. *
* http://www.pj64-emu.com/ *
* Copyright (C) 2012 Project64. All rights reserved. *
* *
* License: *
* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html *
* *
****************************************************************************/
#define STRINGIZE2(s) #s
#define STRINGIZE(s) STRINGIZE2(s)
#define VERSION_MAJOR 2
#define VERSION_MINOR 1
#define VERSION_REVISION 0
#define VERSION_BUILD 1
#define VER_FILE_DESCRIPTION_STR "Project 64"
#define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD
#define VER_FILE_VERSION_STR STRINGIZE(VERSION_MAJOR) \
"." STRINGIZE(VERSION_MINOR) \
"." STRINGIZE(VERSION_REVISION) \
"." STRINGIZE(VERSION_BUILD) \
#define VER_PRODUCTNAME_STR "Project64"
#define VER_PRODUCT_VERSION VER_FILE_VERSION
#define VER_PRODUCT_VERSION_STR VER_FILE_VERSION_STR
#define VER_ORIGINAL_FILENAME_STR VER_PRODUCTNAME_STR ".exe"
#define VER_INTERNAL_NAME_STR VER_PRODUCTNAME_STR
#define VER_COPYRIGHT_STR "Copyright (C) 2013"
#ifdef _DEBUG
#define VER_VER_DEBUG VS_FF_DEBUG
#else
#define VER_VER_DEBUG 0
#endif
#define VER_FILEOS VOS_NT_WINDOWS32
#define VER_FILEFLAGS VER_VER_DEBUG
#define VER_FILETYPE VFT_APP

View File

@ -173,16 +173,7 @@ const char * AppName ( void )
static stdstr Name; static stdstr Name;
if (Name.empty()) if (Name.empty())
{ {
stdstr StrVersion(VersionInfo(VERSION_PRODUCT_VERSION)); Name = stdstr_f("Project64 %s", VER_FILE_VERSION_STR);
strvector parts = StrVersion.Tokenize(".");
if (parts.size() == 4)
{
Name = stdstr_f("Project64 %s.%s",parts[0].c_str(),parts[1].c_str());
}
else
{
Name = "Project64";
}
} }
return Name.c_str(); return Name.c_str();
} }
@ -226,7 +217,7 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
WriteTrace(TraceDebug,__FUNCTION__ ": Create Main Window"); WriteTrace(TraceDebug,__FUNCTION__ ": Create Main Window");
stdstr WinTitle(AppName()); stdstr WinTitle(AppName());
WinTitle.Format("Project64 %s",VersionInfo(VERSION_PRODUCT_VERSION).c_str()); WinTitle.Format("Project64 %s", VER_FILE_VERSION_STR);
CMainGui MainWindow(true,WinTitle.c_str()), HiddenWindow(false); CMainGui MainWindow(true,WinTitle.c_str()), HiddenWindow(false);
CMainMenu MainMenu(&MainWindow); CMainMenu MainMenu(&MainWindow);

View File

@ -21,6 +21,7 @@
#include "N64 System.h" #include "N64 System.h"
#include "Plugin.h" #include "Plugin.h"
#include "Support.h" #include "Support.h"
#include "Version.h"
#include <windows.h> #include <windows.h>
#include <mmsystem.h> #include <mmsystem.h>
#include <Aclapi.h> #include <Aclapi.h>