Compare commits
No commits in common. "e21e7a1aba4180d07947dd50594c05c67c99e6fd" and "16b8807eb7f628680d4e32fdee92e254a3c35ea7" have entirely different histories.
e21e7a1aba
...
16b8807eb7
9 changed files with 19 additions and 63 deletions
|
@ -11,16 +11,4 @@
|
|||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
<asmv3:application>
|
||||
<asmv3:windowsSettings>
|
||||
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">
|
||||
UTF-8
|
||||
</activeCodePage>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||
true/pm</dpiAware> <!-- legacy -->
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
|
||||
permonitorv2,permonitor
|
||||
</dpiAwareness> <!-- falls back to pm if pmv2 is not available -->
|
||||
</asmv3:windowsSettings>
|
||||
</asmv3:application>
|
||||
</assembly>
|
|
@ -27,8 +27,6 @@
|
|||
#include <Magnum/ImGuiIntegration/Integration.h>
|
||||
#include <Magnum/ImGuiIntegration/Context.hpp>
|
||||
|
||||
#include <SDL.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include <shellapi.h>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <Magnum/Platform/Sdl2Application.h>
|
||||
#include <Magnum/ImGuiIntegration/Context.h>
|
||||
|
||||
#include <SDL_timer.h>
|
||||
#include <SDL.h>
|
||||
|
||||
#include <imgui.h>
|
||||
#include <imgui_internal.h>
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
#include <Corrade/Utility/String.h>
|
||||
#include <Corrade/Utility/Unicode.h>
|
||||
|
||||
#include <SDL_events.h>
|
||||
|
||||
#include <fileapi.h>
|
||||
#include <handleapi.h>
|
||||
|
||||
|
|
|
@ -19,9 +19,6 @@
|
|||
#include <Corrade/Utility/Path.h>
|
||||
#include <Corrade/Utility/Unicode.h>
|
||||
|
||||
#include <SDL_events.h>
|
||||
#include <SDL_messagebox.h>
|
||||
|
||||
#include <shlobj.h>
|
||||
|
||||
#include "../FontAwesome/IconsFontAwesome5.h"
|
||||
|
|
|
@ -14,19 +14,20 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "SaveTool.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <Corrade/Containers/Reference.h>
|
||||
#include <Corrade/Utility/Format.h>
|
||||
#include <Corrade/Utility/Path.h>
|
||||
|
||||
#include <SDL_messagebox.h>
|
||||
#include <Corrade/Utility/String.h>
|
||||
|
||||
#include "../FontAwesome/IconsFontAwesome5.h"
|
||||
|
||||
#include "../Maps/LastMissionId.h"
|
||||
#include "../Maps/StoryProgress.h"
|
||||
|
||||
#include "SaveTool.h"
|
||||
|
||||
void SaveTool::drawManager() {
|
||||
ImGui::SetNextWindowPos({0.0f, ImGui::GetItemRectSize().y}, ImGuiCond_Always);
|
||||
ImGui::SetNextWindowSize({Float(windowSize().x()), Float(windowSize().y()) - ImGui::GetItemRectSize().y},
|
||||
|
|
|
@ -14,14 +14,12 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "SaveTool.h"
|
||||
|
||||
#include <Magnum/ImGuiIntegration/Integration.h>
|
||||
|
||||
#include <SDL_messagebox.h>
|
||||
|
||||
#include "../FontAwesome/IconsFontAwesome5.h"
|
||||
|
||||
#include "SaveTool.h"
|
||||
|
||||
extern const ImVec2 center_pivot;
|
||||
|
||||
void SaveTool::drawProfileManager() {
|
||||
|
|
|
@ -16,8 +16,6 @@
|
|||
|
||||
#include <Corrade/Utility/Format.h>
|
||||
|
||||
#include <SDL_events.h>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
#include "SaveTool.h"
|
||||
|
|
36
src/main.cpp
36
src/main.cpp
|
@ -14,28 +14,17 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "SaveTool/SaveTool.h"
|
||||
|
||||
#ifndef SAVETOOL_DEBUG_BUILD
|
||||
#include <fstream>
|
||||
#endif
|
||||
|
||||
#include <SDL_messagebox.h>
|
||||
|
||||
#include <cpuid.h>
|
||||
|
||||
#include <errhandlingapi.h>
|
||||
#include <synchapi.h>
|
||||
#include <winerror.h>
|
||||
|
||||
#include "SaveTool/SaveTool.h"
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
auto str = std::setlocale(LC_ALL, ".utf-8");
|
||||
if(str && !Containers::StringView{str}.hasSuffix(".utf8")) {
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error",
|
||||
"Your system doesn't support UTF-8.", nullptr);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
#ifndef SAVETOOL_DEBUG_BUILD
|
||||
std::ofstream output{"SaveToolLog.txt", std::ios::trunc|std::ios::out};
|
||||
|
||||
|
@ -47,34 +36,23 @@ int main(int argc, char** argv) {
|
|||
Utility::Error e{Utility::Debug::defaultOutput()};
|
||||
#endif
|
||||
|
||||
Utility::Debug{} << "M.A.S.S. Builder Save Tool version " SAVETOOL_VERSION;
|
||||
Utility::Debug{} << "===M.A.S.S. Builder Save Tool version " SAVETOOL_VERSION "===";
|
||||
|
||||
auto mutex_handle = CreateMutexW(nullptr, 0, L"MassBuilderSaveTool");
|
||||
|
||||
if(!mutex_handle) {
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error",
|
||||
"There was an error initialising the single-instance checker.",nullptr);
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error initialising the app",
|
||||
"There was an error initialising the mutex.",nullptr);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if(GetLastError() == ERROR_ALREADY_EXISTS) {
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error",
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error initialising the app",
|
||||
"There can be only one running instance of the application.",nullptr);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
std::uint32_t brand[12];
|
||||
|
||||
if (!__get_cpuid_max(0x80000004, nullptr)) {
|
||||
Utility::Warning{} << "Warning: CPUID features not supported. Can't get the current processor's model.";
|
||||
}
|
||||
else {
|
||||
__get_cpuid(0x80000002, brand+0x0, brand+0x1, brand+0x2, brand+0x3);
|
||||
__get_cpuid(0x80000003, brand+0x4, brand+0x5, brand+0x6, brand+0x7);
|
||||
__get_cpuid(0x80000004, brand+0x8, brand+0x9, brand+0xa, brand+0xb);
|
||||
Utility::Debug{} << "Processor:" << Containers::arrayCast<const char>(brand).data();
|
||||
}
|
||||
|
||||
Utility::Debug{} << "===Initialising OpenGL renderer===";
|
||||
SaveTool app({argc, argv});
|
||||
Int result = app.exec();
|
||||
|
||||
|
|
Loading…
Reference in a new issue