- bug fixes for load saved game (now fixes loading on windows) and corrects memory bug for loading saved games on all platforms.

This commit is contained in:
Mark Vejvoda
2012-04-04 15:36:09 +00:00
parent 6c12bfbec8
commit c1f617481e
7 changed files with 29 additions and 10 deletions

View File

@@ -448,7 +448,7 @@ MainWindow::MainWindow( std::pair<string,vector<string> > unitToLoad,
std::auto_ptr<wchar_t> wstr(Ansi2WideString(appPath.c_str()));
wstring launchApp = wstring(wstr.get()) + L" \"%1\"";
DWORD len = launchApp.length() + 1;
DWORD len = (DWORD)launchApp.length() + 1;
RegSetValueEx(keyHandle, NULL, 0, REG_SZ, (PBYTE)launchApp.c_str(), len);
RegCloseKey(keyHandle);
@@ -456,7 +456,7 @@ MainWindow::MainWindow( std::pair<string,vector<string> > unitToLoad,
RegCreateKeyEx(HKEY_CURRENT_USER,subKey.c_str(),0, NULL, 0, KEY_ALL_ACCESS, NULL, &keyHandle, &dwDisposition);
//Set the value.
launchApp = L"megaglest.g3d";
len = launchApp.length() + 1;
len = (DWORD)launchApp.length() + 1;
RegSetValueEx(keyHandle, NULL, 0, REG_SZ, (PBYTE)launchApp.c_str(), len);
RegCloseKey(keyHandle);