Fixes a bug in string splitting that broke the texture selection dialogs in the model editor. They should now populate properly and let you change textures if you want to do a little modding or something of the sort. It also exposed a bug where we had a stack overflow case that was never hit until now. IsValidDirectoryPath() was intended to be calling IsValidDirectoryName() on the consitituent parts of the path, but was calling into itself. The only reason this was never hit in practice is because the bugged Split() function would keep discarding the end character in the strings recursively over the course of execution until the strings were completely empty (oof!). It also turns out that the handler for the indirect texture handling was never hooked up to a slot in the model window. So, not only could the model never have it's indirect texture changed, but would never render it either, since the respective material would never be set. We essentially smoked 3 bugs with a one-liner at the same time.
Prime World Editor
Prime World Editor is a custom editor suite for Retro Studios' GameCube and Wii games, including the Metroid Prime series and Donkey Kong Country Returns.
Clone Submodules First!
Builders on all platforms should ensure submodules are up to date with the current PrimeWorldEditor
by running git submodule update --init --recursive.
Building on Windows
Requirements
64-bit Note: Except for Visual Studio and the Qt installer, ensure 64-bit (x86-64, x64) packages are installed.
- Visual Studio 2022 (Desktop development with C++)
- Qt 6.5+ (MSVC 2022 64-bit specification)
- LLVM 6.0.1 x86-64 installation; currently must be installed to
C:\Program Files\LLVM\ - Python 3 x86-64
Build using Qt Creator
Compiler Note: Before starting, it is wise to select the 64-bit compiler by opening Tools > Kits > Kits tab. The C and C++ compilers should be set to Visual Studio Community 2022 (amd64).
CMake Note: At the time of writing, Qt Creator will search for a user-installed CMake but this is not necessary.
The CMake that comes with Visual Studio may be manually selected by opening Tools > Kits > CMake tab, then adding
a manual CMake with the path:
C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe.
Debugger Note: To use Qt Creator for debugging, Debugging Tools for Windows must be installed from the Windows SDK package. Once installed, the Qt Creator kit should automatically detect CDB. Make sure the x64 version is selected.
- File > Open File or Project
- Select CMakeLists.txt at root of cloned PrimeWorldEditor
- Select desired build configurations within the Desktop Qt Kit. It is generally fine to just check Debug and Release.
- Click Configure Project
- Wait for dependencies to build and CMake project to generate (this may take a while).
- Edit/Build/Debug/Run
Build using Visual Studio
Qt Note: It may be necessary to edit both CMAKE_PREFIX_PATH entries in the CMakeSettings.json file.
They should be set to C:/Qt/<QT VERSION>/msvc2022_64/lib/cmake/Qt6.
- File > Open > CMake
- Select CMakeLists.txt at root of cloned PrimeWorldEditor
- Wait for dependencies to build and CMake project to generate (this may take a while).
- Edit/Build/Debug/Run
Build using Command Line
- Launch x64 Native Tools Command Prompt for VS 2022
cd <PATH TO PrimeWorldEditor ROOT>mkdir buildcd buildcmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=C:/Qt/<QT VERSION>/msvc2022_64/lib/cmake/Qt6 ..ninja- PrimeWorldEditor.exe is found in the
build/bindirectory.
Building on macOS
Requirements
- Xcode 10.2+
- Qt 6.5+ (macOS specification)
- cmake, ninja and python installed using Homebrew
Build using Xcode
cd <PATH TO PrimeWorldEditor ROOT>mkdir buildcd buildcmake -G Xcode -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/Qt/<QT VERSION>/clang_64/lib/cmake/Qt6 ..- Open PrimeWorldEditor.xcodeproj
- Edit/Build/Debug/Run
Build using Command Line
cd <PATH TO PrimeWorldEditor ROOT>mkdir buildcd buildcmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=~/Qt/<QT VERSION>/clang_64/lib/cmake/Qt6 ..ninja- PrimeWorldEditor.app is found in the
build/bindirectory.
Building on Linux
Requirements
- A working compiler toolchain (GCC or Clang)
- cmake, ninja, python3, qt6 (dev), clang (dev) packages
Build using Command Line
cd <PATH TO PrimeWorldEditor ROOT>mkdir buildcd buildcmake -G Ninja -DCMAKE_BUILD_TYPE=Release ..ninja- PrimeWorldEditor is found in the
build/bindirectory.