From 297e98e8487b79c0016226b4c97da071b32e50cb Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 26 Dec 2019 04:50:35 +0100 Subject: [PATCH] Compile Windows binery as a GUI with icon --- CMake/mingwcc.cmake | 1 + CMakeLists.txt | 7 ++++--- Packaging/windows/devilutionx.rc | 1 + Packaging/windows/icon.ico | Bin 0 -> 766 bytes README.md | 4 ++-- 5 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 Packaging/windows/devilutionx.rc create mode 100644 Packaging/windows/icon.ico diff --git a/CMake/mingwcc.cmake b/CMake/mingwcc.cmake index e3349b473..24e2df525 100644 --- a/CMake/mingwcc.cmake +++ b/CMake/mingwcc.cmake @@ -9,6 +9,7 @@ list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "${CROSS_PREFIX}/i686-w64-min SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc") SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++") +set(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") SET(CMAKE_FIND_ROOT_PATH "${CROSS_PREFIX}/i686-w64-mingw32" "${CROSS_PREFIX}/i686-w64-mingw32/i686-w64-mingw32") diff --git a/CMakeLists.txt b/CMakeLists.txt index c346de8db..508f9d966 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -278,8 +278,9 @@ set(devilutionx_SRCS SourceX/DiabloUI/title.cpp SourceX/DiabloUI/ttf_render_wrapped.cpp SourceX/main.cpp - ./Packaging/macOS/AppIcon.icns - ./Packaging/resources/CharisSILB.ttf) + Packaging/macOS/AppIcon.icns + Packaging/resources/CharisSILB.ttf + Packaging/windows/devilutionx.rc) if(NOT NONET) list(APPEND devilutionx_SRCS @@ -298,7 +299,7 @@ if(SWITCH) set(BIN_TARGET devilutionx.elf) endif() -add_executable(${BIN_TARGET} MACOSX_BUNDLE ${devilutionx_SRCS}) +add_executable(${BIN_TARGET} WIN32 MACOSX_BUNDLE ${devilutionx_SRCS}) configure_file(SourceS/config.h.in config.h @ONLY) target_include_directories(devilution PUBLIC Source SourceS ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/Packaging/windows/devilutionx.rc b/Packaging/windows/devilutionx.rc new file mode 100644 index 000000000..46a5a428b --- /dev/null +++ b/Packaging/windows/devilutionx.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "icon.ico" diff --git a/Packaging/windows/icon.ico b/Packaging/windows/icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..3fec6d7d0f623ba9e7c1bfa35b234b86a3899dee GIT binary patch literal 766 zcmaiyJ#ND=427R76&>rMKxe~KM**UD1ETfWewrVSnB!}u=4~gx`OFFPJ~<-mJh@za&o=AaTJZQN@t?awM67ZS$Fxe z(rfYMSgPG5W}uY6r+Bf9=1# LU2i!zJ8FLc1K(6q literal 0 HcmV?d00001 diff --git a/README.md b/README.md index b4e4432f0..5c0739f20 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ Nightly builds | Platform ![Discord Channel](https://avatars3.githubusercontent.com/u/1965106?s=16&v=4) [Discord Chat Channel](https://discord.gg/aQBQdDe) # How To Play: - - Copy diabdat.mpq from your CD, or GoG install folder, to the DevilutionX install folder or data folder; make sure it is all lowercase. The DeviliutionX install is the one that contains the DevilutionX executable. The data folder path may differ depending on OS version and security setting, but will normally be as following: + - Copy diabdat.mpq from your CD, or GoG install folder, to the DevilutionX install folder or data folder; make sure it is all lowercase. The DeviliutionX install folder is the one that contains the DevilutionX executable. The data folder path may differ depending on OS version and security setting, but will normally be as following: - macOS `~/Library/Application Support/diasurgical/devilution` - Linux `~/.local/share/diasurgical/devilution/` - - Windows `C:\Users[username]\AppData\Roaming\diasurgical\devilution` + - Windows `C:\Users\[username]\AppData\Roaming\diasurgical\devilution` - [Download DevilutionX](https://github.com/diasurgical/devilutionX/releases), or build from source - Install [SDL2](https://www.libsdl.org/download-2.0.php) (including [SDL2_mixer](https://www.libsdl.org/projects/SDL_mixer/) and [SDL2_ttf](https://www.libsdl.org/projects/SDL_ttf/)) - Run `./devilutionx`