Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM ubuntu:24.04

RUN apt-get update && apt-get install -y \
ninja-build \
g++ \
git \
qt6-base-dev \
qt6-tools-dev \
qt6-tools-dev-tools \
qt6-multimedia-dev \
&& rm -rf /var/lib/apt/lists/*
102 changes: 102 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: CI

on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]

jobs:
build-linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4.2.2

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build g++ qt6-base-dev qt6-tools-dev qt6-tools-dev-tools qt6-multimedia-dev

- name: Build
run: |
cmake -B build -S editor -DCMAKE_BUILD_TYPE=Release -G Ninja
cmake --build build --parallel

- name: Package
run: |
mkdir -p staging
cp build/waller staging/
cp README.md MANUAL.md LICENSE staging/
[ -d maps ] && cp -r maps staging/
tar -czf waller-linux.tar.gz -C staging .

- name: Upload tarball
uses: actions/upload-artifact@v4.6.2
with:
name: waller-ubuntu
path: waller-linux.tar.gz

build-windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4.2.2

- name: Install Qt6
uses: jurplel/install-qt-action@v4
with:
version: '6.8.*'
arch: win64_msvc2022_64
modules: 'qtmultimedia'
cache: true

- name: Build
run: |
cmake -B build -S editor -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release --parallel

- name: Deploy
run: |
mkdir deploy
copy build\Release\waller.exe deploy\
windeployqt6 --no-quick-import --release --no-system-d3d-compiler --no-system-dxc-compiler --no-compiler-runtime --no-opengl-sw --no-translations deploy\waller.exe
copy README.md deploy\
copy MANUAL.md deploy\
copy LICENSE deploy\
if (Test-Path maps) { Copy-Item -Recurse maps deploy\ }

- name: Package
run: Compress-Archive -Path deploy\* -DestinationPath waller-windows.zip

- name: Upload ZIP
uses: actions/upload-artifact@v4.6.2
with:
name: waller-windows
path: waller-windows.zip

release:
needs: [build-linux, build-windows]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write

steps:
- name: Download tarball
uses: actions/download-artifact@v4.2.1
with:
name: waller-ubuntu
path: artifacts/

- name: Download ZIP
uses: actions/download-artifact@v4.2.1
with:
name: waller-windows
path: artifacts/

- name: Create release
uses: softprops/action-gh-release@v2
with:
files: artifacts/*
67 changes: 67 additions & 0 deletions editor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
cmake_minimum_required(VERSION 3.16)
project(waller LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets SpatialAudio)

set(SOURCES
main.cpp
editor.cpp
walker.cpp
mainwindow.cpp
renderwindow.cpp
wdgmapeditor.cpp
wdgmapview.cpp
wdgtexselector.cpp
wdgtexview.cpp
../common/engine/renderer.cpp
../common/engine/renderer_config.cpp
../common/engine/audio.cpp
../common/engine/map.cpp
../common/engine/map_io.cpp
../common/engine/tags.cpp
../common/engine/env.cpp
../common/engine/workerpool.cpp
../common/engine/gamepad.cpp
mainwindow.ui
renderwindow.ui
resources.qrc
)

if(WIN32)
list(APPEND SOURCES editor.rc)
endif()

qt_add_executable(waller WIN32 ${SOURCES})

target_include_directories(waller PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
../common/engine
../common/game
)

target_link_libraries(waller PRIVATE
Qt6::Core
Qt6::Gui
Qt6::Widgets
Qt6::SpatialAudio
)

if(WIN32)
target_link_libraries(waller PRIVATE xinput winmm ws2_32)
endif()

if(MSVC)
target_compile_options(waller PRIVATE /W4 /MP /WX-)
target_compile_options(waller PRIVATE $<$<CONFIG:Release>:/O2>)
else()
target_compile_options(waller PRIVATE -msse4 -save-temps -Wall -Wextra)
target_compile_options(waller PRIVATE $<$<CONFIG:Release>:-O2>)
target_link_options(waller PRIVATE $<$<CONFIG:Release>:-s>)
endif()
10 changes: 10 additions & 0 deletions editor/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,24 @@

#include <stdint.h>
#include <stdio.h>
#ifdef _MSC_VER
#include <intrin.h>
#else
#include <cpuid.h>
#endif

/*****************************************************************************/
inline bool hasSSE41()
{
#ifdef _MSC_VER
int cpuInfo[4];
__cpuid(cpuInfo, 1);
return (cpuInfo[2] & (1 << 19)) != 0; // SSE4.1 is bit 19 of ECX
#else
uint32_t eax, ebx, ecx, edx;
__cpuid(1, eax, ebx, ecx, edx);
return (ecx & (1 << 19)) != 0; // SSE4.1 is bit 19 of ECX
#endif
}

/*****************************************************************************/
Expand Down
12 changes: 9 additions & 3 deletions editor/waller.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ QT += core gui spatialaudio
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++17
QMAKE_CXXFLAGS_RELEASE *= -O2
QMAKE_LFLAGS_RELEASE *= -s
QMAKE_CXXFLAGS += -msse4 -save-temps -Wall -Wextra

win32-msvc* {
QMAKE_CXXFLAGS_RELEASE *= /O2
QMAKE_CXXFLAGS += /W4 /MP
} else {
QMAKE_CXXFLAGS_RELEASE *= -O2
QMAKE_LFLAGS_RELEASE *= -s
QMAKE_CXXFLAGS += -msse4 -save-temps -Wall -Wextra
}

#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000

Expand Down