Fix Windows
This commit is contained in:
5
external/imgui/CMakeLists.txt
vendored
5
external/imgui/CMakeLists.txt
vendored
@@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.20)
|
||||
project(imgui)
|
||||
|
||||
find_package(SDL2 REQUIRED)
|
||||
find_package(Vulkan REQUIRED FATAL_ERROR)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_search_module(Vulkan REQUIRED vulkan)
|
||||
|
||||
add_library(imgui
|
||||
imgui/imgui_demo.cpp
|
||||
@@ -18,5 +19,5 @@ add_library(imgui
|
||||
imgui/backends/imgui_impl_vulkan.h
|
||||
imgui/backends/imgui_impl_vulkan.cpp)
|
||||
|
||||
target_link_libraries(imgui PUBLIC SDL2 ${Vulkan_LIBRARY})
|
||||
target_link_libraries(imgui PUBLIC SDL2 vulkan)
|
||||
target_include_directories(imgui PUBLIC ${SDL2_INCLUDE_DIRS} imgui imgui/backends)
|
||||
9
external/portable_endian_bswap.h
vendored
9
external/portable_endian_bswap.h
vendored
@@ -63,6 +63,15 @@
|
||||
# include <winsock2.h>
|
||||
# include <sys/param.h>
|
||||
|
||||
|
||||
#if __BIG_ENDIAN__
|
||||
#define htonll(x) (x)
|
||||
#define ntohll(x) (x)
|
||||
#else
|
||||
#define htonll(x) ((((uint64_t)htonl(x&0xFFFFFFFF)) << 32) + htonl(x >> 32))
|
||||
#define ntohll(x) ((((uint64_t)ntohl(x&0xFFFFFFFF)) << 32) + ntohl(x >> 32))
|
||||
#endif
|
||||
|
||||
# if BYTE_ORDER == LITTLE_ENDIAN
|
||||
|
||||
# define htobe16(x) htons(x)
|
||||
|
||||
@@ -7,29 +7,29 @@
|
||||
|
||||
namespace util {
|
||||
enum MessageType : u8 {
|
||||
INFO, WARN, ERROR
|
||||
Info, Warn, Error
|
||||
};
|
||||
|
||||
template <MessageType messageType = INFO, typename ...Args>
|
||||
template <MessageType messageType = Info, typename ...Args>
|
||||
constexpr void print(const std::string& fmt, Args... args) {
|
||||
if constexpr(messageType == ERROR) {
|
||||
if constexpr(messageType == Error) {
|
||||
fmt::print(fmt::emphasis::bold | fg(fmt::color::red), fmt, args...);
|
||||
exit(-1);
|
||||
} else if constexpr(messageType == WARN) {
|
||||
} else if constexpr(messageType == Warn) {
|
||||
fmt::print(fg(fmt::color::yellow), fmt, args...);
|
||||
} else if constexpr(messageType == INFO) {
|
||||
} else if constexpr(messageType == Info) {
|
||||
fmt::print(fmt, args...);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename ...Args>
|
||||
constexpr void panic(const std::string& fmt, Args... args) {
|
||||
print<ERROR>(fmt, args...);
|
||||
print<Error>(fmt, args...);
|
||||
}
|
||||
|
||||
template <typename ...Args>
|
||||
constexpr void warn(const std::string& fmt, Args... args) {
|
||||
print<WARN>(fmt, args...);
|
||||
print<Warn>(fmt, args...);
|
||||
}
|
||||
|
||||
template <typename ...Args>
|
||||
|
||||
@@ -367,7 +367,7 @@ void Window::Update(std::unique_ptr<BaseCore>& core) {
|
||||
if(ImGui::BeginMenu("Open")) {
|
||||
if(ImGui::MenuItem("Nintendo 64")) {
|
||||
nfdchar_t* outpath;
|
||||
const nfdnfilteritem_t filter {"Nintendo 64 roms", "n64,z64,v64,N64,Z64,V64"};
|
||||
const nfdu8filteritem_t filter {"Nintendo 64 roms", "n64,z64,v64,N64,Z64,V64"};
|
||||
nfdresult_t result = NFD_OpenDialog(&outpath, &filter, 1, nullptr);
|
||||
if(result == NFD_OKAY) {
|
||||
core = std::make_unique<n64::Core>(outpath);
|
||||
|
||||
Reference in New Issue
Block a user