diff --git a/meson.build b/meson.build index 9bce9372c..5b9c20e9a 100644 --- a/meson.build +++ b/meson.build @@ -87,7 +87,7 @@ subdir('targets/platform') # MARK: platform configuration -if host_machine.system() == 'linux' +if host_machine.system() in ['linux', 'windows'] platform_fs_dep = platform_fs_std_dep platform_game_dep = platform_game_stub_dep platform_input_dep = platform_input_sdl2_dep @@ -99,7 +99,7 @@ if host_machine.system() == 'linux' platform_storage_dep = platform_storage_stub_dep platform_thread_dep = platform_thread_dep # standardized backend (for now) - app_platform_sources = files('targets/app/linux/main.cpp') + app_platform_sources = files('targets/app/desktop/main.cpp') endif subdir('targets/resources') diff --git a/targets/app/linux/main.cpp b/targets/app/desktop/main.cpp similarity index 100% rename from targets/app/linux/main.cpp rename to targets/app/desktop/main.cpp diff --git a/targets/nbt/include/nbt/CompoundTag.h b/targets/nbt/include/nbt/CompoundTag.h index 8169a5cbe..789366680 100644 --- a/targets/nbt/include/nbt/CompoundTag.h +++ b/targets/nbt/include/nbt/CompoundTag.h @@ -1,5 +1,5 @@ #pragma once -#include +#include #include #include "ByteArrayTag.h" @@ -16,14 +16,14 @@ class CompoundTag : public Tag { private: - std::flat_map> tags; + std::unordered_map> tags; public: CompoundTag() : Tag("") {} CompoundTag(const std::string& name) : Tag(name) {} void write(DataOutput* dos) { - for (auto&& [key, value] : tags) { + for (auto& [key, value] : tags) { Tag::writeNamedTag(value.get(), dos); } dos->writeByte(Tag::TAG_End); @@ -49,7 +49,7 @@ public: std::vector getAllTags() { std::vector ret; ret.reserve(tags.size()); - for (auto&& [key, value] : tags) { + for (auto& [key, value] : tags) { ret.push_back(value.get()); } return ret; @@ -228,7 +228,7 @@ public: Tag* copy() { CompoundTag* tag = new CompoundTag(getName()); - for (auto&& [key, value] : tags) { + for (auto& [key, value] : tags) { tag->put(key, value->copy()); } return tag; @@ -239,7 +239,7 @@ public: CompoundTag* o = (CompoundTag*)obj; if (tags.size() == o->tags.size()) { - for (auto&& [key, value] : tags) { + for (auto& [key, value] : tags) { auto itFind = o->tags.find(key); if (itFind == o->tags.end() || !value->equals(itFind->second.get())) { diff --git a/targets/platform/input/sdl2/SDL2Input.cpp b/targets/platform/input/sdl2/SDL2Input.cpp index ba35895a6..d80ae45b6 100644 --- a/targets/platform/input/sdl2/SDL2Input.cpp +++ b/targets/platform/input/sdl2/SDL2Input.cpp @@ -9,16 +9,16 @@ #include "../../PlatformTypes.h" #include "../InputConstants.h" -#include "SDL2/SDL.h" -#include "SDL2/SDL_events.h" -#include "SDL2/SDL_gamecontroller.h" -#include "SDL2/SDL_joystick.h" -#include "SDL2/SDL_keyboard.h" -#include "SDL2/SDL_mouse.h" -#include "SDL2/SDL_scancode.h" -#include "SDL2/SDL_stdinc.h" -#include "SDL2/SDL_video.h" -#include "SDL2/begin_code.h" +#include "SDL.h" +#include "SDL_events.h" +#include "SDL_gamecontroller.h" +#include "SDL_joystick.h" +#include "SDL_keyboard.h" +#include "SDL_mouse.h" +#include "SDL_scancode.h" +#include "SDL_stdinc.h" +#include "SDL_video.h" +#include "begin_code.h" namespace platform_internal { IPlatformInput& PlatformInput_get() { diff --git a/targets/platform/renderer/gl/gl3_loader.h b/targets/platform/renderer/gl/gl3_loader.h index 6416a1152..bb03b3aad 100644 --- a/targets/platform/renderer/gl/gl3_loader.h +++ b/targets/platform/renderer/gl/gl3_loader.h @@ -1,10 +1,17 @@ #pragma once + +// windows hack: Windows SDK OpenGL headers include WINGDIAPI in their declarations, +// which can only be found in the Windows API +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#endif + #ifndef GL_GLEXT_PROTOTYPES #define GL_GLEXT_PROTOTYPES 1 #endif #include -#include -#include +// #include #include #ifndef GL_ARRAY_BUFFER diff --git a/targets/platform/stubs.h b/targets/platform/stubs.h index 114bb6fe3..49dd2a7e9 100644 --- a/targets/platform/stubs.h +++ b/targets/platform/stubs.h @@ -1,5 +1,12 @@ #pragma once +// windows hack: Windows SDK OpenGL headers include WINGDIAPI in their declarations, +// which can only be found in the Windows API +#ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#endif + #include #include