Compare commits
8 commits
16b8807eb7
...
e21e7a1aba
Author | SHA1 | Date | |
---|---|---|---|
e21e7a1aba | |||
714d8cc6bb | |||
a33cbdfad6 | |||
b7cd78ca21 | |||
453c5391a4 | |||
05611d59b1 | |||
a5a8db289a | |||
6130734764 |
9 changed files with 63 additions and 19 deletions
|
@ -11,4 +11,16 @@
|
|||
/>
|
||||
</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,6 +27,8 @@
|
|||
#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.h>
|
||||
#include <SDL_timer.h>
|
||||
|
||||
#include <imgui.h>
|
||||
#include <imgui_internal.h>
|
||||
|
|
|
@ -17,6 +17,8 @@
|
|||
#include <Corrade/Utility/String.h>
|
||||
#include <Corrade/Utility/Unicode.h>
|
||||
|
||||
#include <SDL_events.h>
|
||||
|
||||
#include <fileapi.h>
|
||||
#include <handleapi.h>
|
||||
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
#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,20 +14,19 @@
|
|||
// 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 <Corrade/Utility/String.h>
|
||||
|
||||
#include <SDL_messagebox.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,12 +14,14 @@
|
|||
// 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,6 +16,8 @@
|
|||
|
||||
#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,17 +14,28 @@
|
|||
// 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};
|
||||
|
||||
|
@ -36,23 +47,34 @@ 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 initialising the app",
|
||||
"There was an error initialising the mutex.",nullptr);
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error",
|
||||
"There was an error initialising the single-instance checker.",nullptr);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if(GetLastError() == ERROR_ALREADY_EXISTS) {
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error initialising the app",
|
||||
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Error",
|
||||
"There can be only one running instance of the application.",nullptr);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
Utility::Debug{} << "===Initialising OpenGL renderer===";
|
||||
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();
|
||||
}
|
||||
|
||||
SaveTool app({argc, argv});
|
||||
Int result = app.exec();
|
||||
|
||||
|
|
Loading…
Reference in a new issue