Attempted optimization broke the Visual Themes coding in Release builds.
This commit is contained in:
parent
a1e4ffe59a
commit
297d2f2d55
|
@ -3,29 +3,13 @@
|
|||
#include "gui.h"
|
||||
|
||||
extern bool rightClickEnabled; //Declared in window.cpp and only an extern here
|
||||
|
||||
/**
|
||||
* Processes information from the GUI options dialog after
|
||||
* the dialog was closed.
|
||||
*
|
||||
* @param hwndDlg Handle of the dialog window.
|
||||
**/
|
||||
char* ManifestFilePath()
|
||||
{
|
||||
char tempfilepath[2048];
|
||||
GetModuleFileName(0, tempfilepath, 2048);
|
||||
//std::string TestFilepath = tempfilepath;
|
||||
|
||||
strcat(tempfilepath,".manifest");
|
||||
|
||||
return tempfilepath;
|
||||
}
|
||||
char ManifestFilePath[2048];
|
||||
|
||||
bool ManifestFileExists()
|
||||
{
|
||||
long endPos = 0;
|
||||
|
||||
FILE * stream = fopen( ManifestFilePath(), "r" );
|
||||
FILE * stream = fopen( ManifestFilePath, "r" );
|
||||
if (stream) {
|
||||
fseek( stream, 0L, SEEK_END );
|
||||
endPos = ftell( stream );
|
||||
|
@ -35,6 +19,12 @@ bool ManifestFileExists()
|
|||
return (endPos > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes information from the GUI options dialog after
|
||||
* the dialog was closed.
|
||||
*
|
||||
* @param hwndDlg Handle of the dialog window.
|
||||
**/
|
||||
void CloseGuiDialog(HWND hwndDlg)
|
||||
{
|
||||
if(IsDlgButtonChecked(hwndDlg, CB_LOAD_FILE_OPEN) == BST_CHECKED)
|
||||
|
@ -79,7 +69,7 @@ void CloseGuiDialog(HWND hwndDlg)
|
|||
|
||||
if(IsDlgButtonChecked(hwndDlg, CB_PARTIALVISUALTHEME)==BST_CHECKED)
|
||||
{
|
||||
FILE * stream = fopen( ManifestFilePath(), "w" );
|
||||
FILE * stream = fopen( ManifestFilePath, "w" );
|
||||
if (stream) {
|
||||
fputs ("<\?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"\?>\n<assembly\n xmlns=\"urn:schemas-microsoft-com:asm.v1\"\n manifestVersion=\"1.0\">\n<assemblyIdentity\n name=\"FCEUX\"\n processorArchitecture=\"x86\"\n version=\"1.0.0.0\"\n type=\"win32\"/>\n<description>FCEUX</description>\n</assembly>\n",stream);
|
||||
fclose(stream);
|
||||
|
@ -88,7 +78,7 @@ void CloseGuiDialog(HWND hwndDlg)
|
|||
|
||||
else
|
||||
{
|
||||
remove(ManifestFilePath());
|
||||
remove(ManifestFilePath);
|
||||
}
|
||||
|
||||
|
||||
|
@ -129,7 +119,12 @@ BOOL CALLBACK GUIConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
CheckDlgButton(hwndDlg, CB_ENABLECONTEXTMENU, BST_CHECKED);
|
||||
}
|
||||
|
||||
if(ManifestFileExists() > 0) {
|
||||
GetModuleFileName(0, ManifestFilePath, 2048);
|
||||
//std::string TestFilepath = tempfilepath;
|
||||
|
||||
strcat((char*)ManifestFilePath,".manifest");
|
||||
|
||||
if(ManifestFileExists()) {
|
||||
CheckDlgButton(hwndDlg, CB_PARTIALVISUALTHEME, BST_CHECKED);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue