Skip to content

Commit e711d26

Browse files
committed
Initial Wii Effect Editor source
0 parents  commit e711d26

171 files changed

Lines changed: 21078 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Build and rolling release
2+
3+
on:
4+
push:
5+
branches: ['**']
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: effect-editor-${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build:
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- os: ubuntu-24.04
23+
platform: Linux-x64
24+
- os: macos-14
25+
platform: macOS-arm64
26+
- os: windows-2022
27+
platform: Windows-x64
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
- name: Linux dependencies
32+
if: runner.os == 'Linux'
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y ninja-build pkg-config libasound2-dev libpulse-dev \
36+
libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev \
37+
libxss-dev libxtst-dev libxkbcommon-dev libdrm-dev libgbm-dev libegl1-mesa-dev \
38+
libgl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev libwayland-dev \
39+
libdecor-0-dev xvfb mesa-vulkan-drivers
40+
- name: MSVC environment
41+
if: runner.os == 'Windows'
42+
uses: ilammy/msvc-dev-cmd@v1
43+
- name: Configure
44+
run: >-
45+
cmake -S src -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
46+
-DAURORA_DAWN_PROVIDER=package -DAURORA_SDL3_PROVIDER=vendor
47+
-DAURORA_SDL3_LINKAGE=static
48+
- name: Build
49+
run: cmake --build build --target breff_editor_native --parallel 3
50+
- name: Package runtime dependencies
51+
run: cmake --install build --prefix stage --config Release --component EffectEditor
52+
- name: Linux startup check
53+
if: runner.os == 'Linux'
54+
run: xvfb-run -a timeout 90 ./stage/EffectEditor --smoke-test
55+
- name: Archive
56+
shell: bash
57+
run: |
58+
mkdir -p artifacts
59+
cd stage
60+
cmake -E tar cf "../artifacts/Wii-Effect-Editor-${{ matrix.platform }}.zip" --format=zip .
61+
- uses: actions/upload-artifact@v4
62+
with:
63+
name: Wii-Effect-Editor-${{ matrix.platform }}
64+
path: artifacts/*.zip
65+
if-no-files-found: error
66+
67+
release:
68+
needs: build
69+
if: github.event_name != 'pull_request' && github.ref_name == github.event.repository.default_branch
70+
runs-on: ubuntu-24.04
71+
permissions:
72+
contents: write
73+
steps:
74+
- uses: actions/checkout@v4
75+
- uses: actions/download-artifact@v4
76+
with:
77+
pattern: Wii-Effect-Editor-*
78+
path: artifacts
79+
merge-multiple: true
80+
- name: Update rolling release
81+
env:
82+
GH_TOKEN: ${{ github.token }}
83+
shell: bash
84+
run: |
85+
set -euo pipefail
86+
git tag -f rolling "$GITHUB_SHA"
87+
git push origin refs/tags/rolling --force
88+
printf 'Automatic builds from commit `%s`.\n\nWindows x64, Linux x64 (Ubuntu 24.04 or newer), and macOS Apple Silicon.\n' "$GITHUB_SHA" > release-notes.md
89+
if gh release view rolling >/dev/null 2>&1; then
90+
gh release upload rolling artifacts/*.zip --clobber
91+
gh release edit rolling --title 'Effect Editor — latest build' --notes-file release-notes.md --latest
92+
else
93+
gh release create rolling artifacts/*.zip --verify-tag --title 'Effect Editor — latest build' --notes-file release-notes.md --latest
94+
fi
95+

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/dist/
2+
/.vscode/
3+
/stage/
4+
/artifacts/
5+
CMakeUserPresets.json
6+
*.log
7+
*.pdb
8+
*.ilk
9+
*.obj
10+
*.o
11+
.DS_Store

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<p align="center"><img src="logo.png" width="160" alt="Wii Effect Editor logo"></p>
2+
3+
# Wii Effect Editor
4+
5+
A native C++ editor for Wii BREFF effect and BREFT texture archives, with an interactive preview powered by [Aurora](https://github.com/encounter/aurora).
6+
7+
![Effect Editor playing a fire effect](docs/screenshot.png)
8+
9+
## Features
10+
11+
- Edit effects with structured fields, color pickers, and animation controls, or edit JSON.
12+
- Add, rename, and delete effects and textures. Inspect which effects reference each texture.
13+
- Preview changes immediately, with looping, selectable random seeds, and optional grid and axes.
14+
- Orbit with left-drag, zoom with the mouse wheel, and press **R** over the preview to reset the camera.
15+
- Import and export JSON files as produced by [Actually-Working-BREFF-Converter](https://github.com/NSMBW-Community/Actually-Working-BREFF-Converter)
16+
17+
## Download
18+
19+
Get the latest successful build from the [rolling release](../../releases/tag/rolling). Extract the complete archive, then launch:
20+
21+
| Platform | Application |
22+
| --- | --- |
23+
| Windows x64 | `EffectEditor.exe` |
24+
| Linux x64 | `./EffectEditor` |
25+
| macOS Apple Silicon | `Effect Editor.app` |
26+
27+
Linux builds target Ubuntu 24.04 or newer and need a working Vulkan driver. The macOS application is not Apple-notarized.
28+
29+
## Build
30+
31+
Requires Git, CMake 3.25+, Ninja, and a C++20 compiler. On Windows, use a Visual Studio 2022 developer shell with the C++ workload installed. Linux packages are listed in [the build workflow](.github/workflows/build.yml).
32+
33+
```sh
34+
cmake -S src -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
35+
cmake --build build --target breff_editor_native --parallel
36+
cmake --install build --prefix dist/Wii-Effect-Editor --config Release --component EffectEditor
37+
```
38+
39+
The first configuration downloads Aurora and its dependencies. The NW4R effect runtime is included in the repository.
40+

docs/screenshot.png

335 KB
Loading

logo.png

158 KB
Loading

src/CMakeLists.txt

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
cmake_minimum_required(VERSION 3.25)
2+
project(Wii-Effect-Editor LANGUAGES C CXX)
3+
set(CMAKE_CXX_STANDARD 20)
4+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
5+
include(FetchContent)
6+
7+
set(AURORA_ENABLE_DVD OFF CACHE BOOL "" FORCE)
8+
set(AURORA_ENABLE_CARD OFF CACHE BOOL "" FORCE)
9+
set(AURORA_ENABLE_THP OFF CACHE BOOL "" FORCE)
10+
set(AURORA_ENABLE_RMLUI OFF CACHE BOOL "" FORCE)
11+
FetchContent_Declare(aurora
12+
GIT_REPOSITORY https://github.com/encounter/aurora.git
13+
GIT_TAG d0c931da2ed3f41d0e42736c2ab52a78c7cf1a9d)
14+
FetchContent_Declare(json
15+
URL https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz)
16+
FetchContent_MakeAvailable(aurora json)
17+
add_subdirectory(codec)
18+
add_subdirectory(runtime)
19+
20+
add_executable(breff_editor_native editor/main.cpp editor/preview_view.cpp editor/document.cpp)
21+
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../logo.png" EDITOR_LOGO_HEX HEX)
22+
string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," EDITOR_LOGO_BYTES "${EDITOR_LOGO_HEX}")
23+
configure_file(cmake/logo.h.in generated/logo.h @ONLY)
24+
target_include_directories(breff_editor_native PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/generated")
25+
target_link_libraries(breff_editor_native PRIVATE breff_codec breff_runtime aurora::core aurora::gx aurora::main aurora::vi aurora::mtx nlohmann_json::nlohmann_json PNG::PNG)
26+
if(WIN32)
27+
target_link_libraries(breff_editor_native PRIVATE windowscodecs ole32)
28+
endif()
29+
30+
include(cmake/Package.cmake)
31+
if(WIN32)
32+
include("${aurora_SOURCE_DIR}/cmake/AuroraCopyRuntimeDLLs.cmake")
33+
aurora_copy_runtime_dlls(breff_editor_native)
34+
# Ship the C++ runtime with the application. A newer MSVC mutex ABI can
35+
# crash in an older system MSVCP140.dll before the first frame is drawn.
36+
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
37+
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS TRUE)
38+
include(InstallRequiredSystemLibraries)
39+
if(MSVC AND NOT CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
40+
# Portable MSVC layouts place the target CRT beside cl.exe.
41+
get_filename_component(_compiler_directory "${CMAKE_CXX_COMPILER}" DIRECTORY)
42+
foreach(_crt IN ITEMS msvcp140.dll msvcp140_1.dll msvcp140_2.dll
43+
msvcp140_atomic_wait.dll msvcp140_codecvt_ids.dll
44+
vcruntime140.dll vcruntime140_1.dll vcruntime140_threads.dll)
45+
if(EXISTS "${_compiler_directory}/${_crt}")
46+
list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS "${_compiler_directory}/${_crt}")
47+
endif()
48+
endforeach()
49+
endif()
50+
if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
51+
add_custom_command(TARGET breff_editor_native POST_BUILD
52+
COMMAND ${CMAKE_COMMAND} -E copy_if_different
53+
${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} $<TARGET_FILE_DIR:breff_editor_native>
54+
COMMAND_EXPAND_LISTS)
55+
endif()
56+
endif()
57+

src/cmake/Package.cmake

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Install only the editor component, excluding dependency SDKs and examples.
2+
set_target_properties(breff_editor_native PROPERTIES OUTPUT_NAME "EffectEditor")
3+
if(APPLE)
4+
set_target_properties(breff_editor_native PROPERTIES
5+
MACOSX_BUNDLE TRUE MACOSX_BUNDLE_BUNDLE_NAME "Effect Editor"
6+
MACOSX_BUNDLE_GUI_IDENTIFIER "org.effect-editor.app"
7+
OUTPUT_NAME "Effect Editor")
8+
install(TARGETS breff_editor_native BUNDLE DESTINATION . COMPONENT EffectEditor)
9+
install(CODE [[
10+
include(BundleUtilities)
11+
fixup_bundle("${CMAKE_INSTALL_PREFIX}/Effect Editor.app" "" "")
12+
execute_process(COMMAND codesign --force --deep --sign -
13+
"${CMAKE_INSTALL_PREFIX}/Effect Editor.app" COMMAND_ERROR_IS_FATAL ANY)
14+
]] COMPONENT EffectEditor)
15+
elseif(WIN32)
16+
install(TARGETS breff_editor_native RUNTIME DESTINATION . COMPONENT EffectEditor)
17+
install(CODE "
18+
file(GLOB _dlls \"$<TARGET_FILE_DIR:breff_editor_native>/*.dll\")
19+
file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}\" TYPE FILE FILES \${_dlls})
20+
" COMPONENT EffectEditor)
21+
else()
22+
set_target_properties(breff_editor_native PROPERTIES INSTALL_RPATH "$ORIGIN/lib")
23+
install(TARGETS breff_editor_native
24+
RUNTIME_DEPENDENCY_SET effect_editor_deps
25+
RUNTIME DESTINATION . COMPONENT EffectEditor)
26+
install(RUNTIME_DEPENDENCY_SET effect_editor_deps
27+
PRE_EXCLUDE_REGEXES "^linux-vdso" "^ld-linux"
28+
POST_EXCLUDE_REGEXES "^/lib/" "^/lib64/" "^/usr/lib/" "^/usr/lib64/"
29+
LIBRARY DESTINATION lib COMPONENT EffectEditor)
30+
endif()
31+
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../README.md"
32+
"${CMAKE_CURRENT_SOURCE_DIR}/../logo.png" DESTINATION . COMPONENT EffectEditor)
33+
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/runtime/nw4r/LICENSE"
34+
DESTINATION licenses/nw4r COMPONENT EffectEditor)
35+
foreach(_dependency aurora json fmt sdl3 sdl3_prebuilt dawn_prebuilt png zlib freetype imgui xxhash zstd sqlite3 tracy abseil)
36+
if(DEFINED ${_dependency}_SOURCE_DIR)
37+
file(GLOB _licenses LIST_DIRECTORIES FALSE "${${_dependency}_SOURCE_DIR}/LICENSE*" "${${_dependency}_SOURCE_DIR}/COPYING*")
38+
if(_licenses)
39+
install(FILES ${_licenses} DESTINATION "licenses/${_dependency}" COMPONENT EffectEditor)
40+
endif()
41+
endif()
42+
endforeach()
43+
# Dependencies declared inside Aurora have directory-scoped variables. Collect
44+
# their license files from FetchContent's source directories as well.
45+
file(GLOB _dependency_sources LIST_DIRECTORIES TRUE "${FETCHCONTENT_BASE_DIR}/*-src")
46+
foreach(_source IN LISTS _dependency_sources)
47+
get_filename_component(_name "${_source}" NAME)
48+
string(REGEX REPLACE "-src$" "" _name "${_name}")
49+
file(GLOB _licenses LIST_DIRECTORIES FALSE "${_source}/LICENSE*" "${_source}/COPYING*" "${_source}/COPYRIGHT*")
50+
if(_licenses)
51+
install(FILES ${_licenses} DESTINATION "licenses/${_name}" COMPONENT EffectEditor)
52+
endif()
53+
if(IS_DIRECTORY "${_source}/licenses")
54+
install(DIRECTORY "${_source}/licenses/" DESTINATION "licenses/${_name}" COMPONENT EffectEditor)
55+
endif()
56+
endforeach()
57+

src/cmake/logo.h.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#pragma once
2+
inline constexpr unsigned char editorLogo[] = { @EDITOR_LOGO_BYTES@ };

src/codec/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
add_library(breff_codec STATIC resource_file.cpp records.cpp animation.cpp effect.cpp texture.cpp form.cpp version7.cpp)
2+
target_include_directories(breff_codec PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
3+
target_link_libraries(breff_codec PUBLIC nlohmann_json::nlohmann_json)

0 commit comments

Comments
 (0)