Skip to content

Commit

Permalink
[RaZ] Updated RaZ (commit b8354bc)
Browse files Browse the repository at this point in the history
- Replicated RaZ's necessary CI changes
  • Loading branch information
Razakhel committed Dec 30, 2023
1 parent 4d80280 commit 8a32148
Show file tree
Hide file tree
Showing 13 changed files with 94 additions and 70 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,28 @@ jobs:
- Release

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Pulling RaZ
run: git submodule update --init --recursive

# Defining the timezone to Europe/Paris, which is required by apt (Ubuntu 20.04):
# sudo ln -snf /usr/share/zoneinfo/Europe/Paris /etc/localtime && echo Europe/Paris > /etc/timezone
# Updating the packages list (needed at the moment for libinput to be found), & installing the needed packages for RaZ:
# Installing the needed packages:
# - Ninja to build the project
# - GLEW & X11 as graphical dependencies
# - OpenAL-soft to handle the audio part
# Installing Qt5 for RaZor
- name: Packages installation
run: |
sudo apt update &&
sudo apt install -y --no-install-recommends \
sudo apt update && sudo apt install -y --no-install-recommends \
ninja-build \
libglew-dev libxi-dev libxcursor-dev libxrandr-dev libxinerama-dev libxxf86vm-dev \
libopenal-dev \
qtbase5-dev qttools5-dev
# Installing the FBX SDK (in /usr)
# The installation asks for software user agreement (send 'yes'), then afterwards if the README file should be opened (send 'n')
# The installation asks for software user agreement (send 'yes'), then afterward if the README file should be opened (send 'n')
#- name: FBX SDK setup
# run: |
# wget http://download.autodesk.com/us/fbx/2019/2019.0/fbx20190_fbxsdk_linux.tar.gz -O ./fbx_sdk.tar.gz &&
Expand All @@ -53,9 +54,13 @@ jobs:
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake -G "Unix Makefiles" -DCMAKE_C_COMPILER=${{ matrix.compiler.c }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DRAZOR_BUILD_RAZ=ON -DENABLE_DEBUG_INFO=ON \
$GITHUB_WORKSPACE &&
cmake -GNinja \
-DCMAKE_C_COMPILER=${{ matrix.compiler.c }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DRAZOR_BUILD_RAZ=ON \
-DRAZ_USE_AUDIO=ON \
-DENABLE_DEBUG_INFO=ON \
$GITHUB_WORKSPACE &&
cmake --build . --target RaZor_PrintDebugInfo --config ${{ matrix.build_type }}
- name: Build
Expand Down Expand Up @@ -88,7 +93,7 @@ jobs:
RaZor-linux-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}/
- name: Upload build
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: RaZor-linux-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}
path: RaZor-linux-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}.tar
41 changes: 30 additions & 11 deletions .github/workflows/Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ jobs:
windows:
name: Windows (${{ matrix.compiler.c }}, ${{ matrix.build_type }})
runs-on: windows-2022
env:
OPENAL_VERSION: 1.23.1

strategy:
fail-fast: false
Expand All @@ -17,13 +19,13 @@ jobs:
- Release

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Pulling RaZ
run: git submodule update --init --recursive

- name: Installing Qt
uses: jurplel/install-qt-action@v2
uses: jurplel/install-qt-action@v3
with:
host: windows
target: desktop
Expand All @@ -32,20 +34,37 @@ jobs:
install-deps: true
dir: ${{ runner.workspace }}

# Installing OpenAL-soft to handle the audio part
- name: Build setup
# Caching OpenAL-Soft's installation; this avoids reinstalling it on every build
- name: OpenAL-Soft caching
uses: actions/cache@v3
id: openal-soft
with:
path: C:/OpenAL
key: openal-soft-${{ env.OPENAL_VERSION }}
restore-keys: |
openal-soft-${{ env.OPENAL_VERSION }}
# Downloading & installing OpenAL-Soft to handle the audio part; only done when failed to find its cached installation
- name: OpenAL-Soft setup
if: steps.openal-soft.outputs.cache-hit != 'true'
run: |
curl --silent --insecure https://www.openal-soft.org/openal-binaries/openal-soft-1.21.0-bin.zip -O &&
7z x openal-soft-1.21.0-bin.zip &&
mv openal-soft-1.21.0-bin C:/OpenAL;
cmake -E make_directory ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
curl -sSkLO https://github.com/kcat/openal-soft/releases/download/${{ env.OPENAL_VERSION }}/openal-soft-${{ env.OPENAL_VERSION }}-bin.zip &&
7z x openal-soft-${{ env.OPENAL_VERSION }}-bin.zip &&
mv openal-soft-${{ env.OPENAL_VERSION }}-bin C:/OpenAL
- name: Build setup
run: cmake -E make_directory ${{ runner.workspace }}/build-${{ matrix.compiler.c }}

- name: Configuration
shell: bash
working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
run: |
cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DRAZOR_BUILD_RAZ=ON -DENABLE_DEBUG_INFO=ON \
$GITHUB_WORKSPACE &&
cmake -G"Visual Studio 17 2022" -A x64 \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DRAZOR_BUILD_RAZ=ON \
-DRAZ_USE_AUDIO=ON \
-DENABLE_DEBUG_INFO=ON \
$GITHUB_WORKSPACE &&
cmake --build . --target RaZor_PrintDebugInfo --config ${{ matrix.build_type }}
- name: Build
Expand All @@ -65,7 +84,7 @@ jobs:
rm C:/RaZor/lib -r
- name: Upload build
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: RaZor-windows-${{ matrix.compiler.c }}-${{ matrix.build_type }}-${{ github.run_id }}
path: |
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,8 @@ else ()
set(RAZ_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(RAZ_GEN_DOC OFF CACHE BOOL "" FORCE)

# Qt will handle all the windowing part; GLFW & ImGui must not be used
set(RAZ_USE_GLFW OFF CACHE BOOL "" FORCE)
# Qt will handle all the UI part; disabling windowing & overlay capabilities
set(RAZ_USE_WINDOW OFF CACHE BOOL "" FORCE)
set(RAZ_USE_IMGUI OFF CACHE BOOL "" FORCE)

add_subdirectory("${RAZ_ROOT}")
Expand Down
16 changes: 8 additions & 8 deletions assets/translations/english.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</message>
<message>
<location filename="../../src/RaZor/Interface/Component/AppComponents.cpp" line="104"/>
<location filename="../../src/RaZor/Interface/AppWindow.cpp" line="403"/>
<location filename="../../src/RaZor/Interface/AppWindow.cpp" line="401"/>
<source>Failed to import mesh</source>
<translation>Failed to import mesh</translation>
</message>
Expand Down Expand Up @@ -216,37 +216,37 @@
<context>
<name>ColliderGroup</name>
<message>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="91"/>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="92"/>
<source>Line</source>
<translation>Line</translation>
</message>
<message>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="93"/>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="94"/>
<source>Plane</source>
<translation>Plane</translation>
</message>
<message>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="94"/>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="95"/>
<source>Sphere</source>
<translation>Sphere</translation>
</message>
<message>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="96"/>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="97"/>
<source>Triangle</source>
<translation>Triangle</translation>
</message>
<message>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="98"/>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="99"/>
<source>Quad</source>
<translation>Quad</translation>
</message>
<message>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="100"/>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="101"/>
<source>AABB</source>
<translation>AABB</translation>
</message>
<message>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="101"/>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="102"/>
<source>OBB</source>
<translation>OBB</translation>
</message>
Expand Down
16 changes: 8 additions & 8 deletions assets/translations/french.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</message>
<message>
<location filename="../../src/RaZor/Interface/Component/AppComponents.cpp" line="104"/>
<location filename="../../src/RaZor/Interface/AppWindow.cpp" line="403"/>
<location filename="../../src/RaZor/Interface/AppWindow.cpp" line="401"/>
<source>Failed to import mesh</source>
<translation>Échec de l&apos;import du maillage</translation>
</message>
Expand Down Expand Up @@ -216,37 +216,37 @@
<context>
<name>ColliderGroup</name>
<message>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="91"/>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="92"/>
<source>Line</source>
<translation>Ligne</translation>
</message>
<message>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="93"/>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="94"/>
<source>Plane</source>
<translation>Plan</translation>
</message>
<message>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="94"/>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="95"/>
<source>Sphere</source>
<translation>Sphère</translation>
</message>
<message>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="96"/>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="97"/>
<source>Triangle</source>
<translation>Triangle</translation>
</message>
<message>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="98"/>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="99"/>
<source>Quad</source>
<translation>Carré</translation>
</message>
<message>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="100"/>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="101"/>
<source>AABB</source>
<translation>AABB</translation>
</message>
<message>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="101"/>
<location filename="../../src/RaZor/Interface/Component/ColliderGroup.cpp" line="102"/>
<source>OBB</source>
<translation>OBB</translation>
</message>
Expand Down
2 changes: 1 addition & 1 deletion extern/RaZ
Submodule RaZ updated 353 files
28 changes: 13 additions & 15 deletions src/RaZor/Interface/AppWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <RaZ/Audio/AudioSystem.hpp>
#include <RaZ/Audio/Listener.hpp>
#include <RaZ/Audio/Sound.hpp>
#include <RaZ/Data/Image.hpp>
#include <RaZ/Data/ImageFormat.hpp>
#include <RaZ/Data/Mesh.hpp>
#include <RaZ/Data/MeshFormat.hpp>
Expand Down Expand Up @@ -64,10 +65,7 @@ void AppWindow::initialize() {
m_cameraEntity->addComponent<Raz::Listener>(m_cameraTrans->getPosition(), Raz::Mat3f(m_cameraTrans->computeTransformMatrix()));

Raz::Entity& light = addEntity("Light");
light.addComponent<Raz::Light>(Raz::LightType::DIRECTIONAL, // Type
Raz::Vec3f(0.f, 0.f, -1.f), // Direction
1.f, // Energy
Raz::Vec3f(1.f)); // Color (RGB)
light.addComponent<Raz::Light>(Raz::LightType::DIRECTIONAL, -Raz::Axis::Z, 1.f, Raz::ColorPreset::White);
light.addComponent<Raz::Transform>(Raz::Vec3f(0.f, 1.f, 0.f));

// Copying the resources to files on disk, to be imported into RaZ objects. This is dirty, but is the best way for now
Expand Down Expand Up @@ -158,7 +156,7 @@ void AppWindow::render() {
}

void AppWindow::updateLights() const {
m_application.getWorlds().back().getSystem<Raz::RenderSystem>().updateLights();
m_application.getWorlds().back()->getSystem<Raz::RenderSystem>().updateLights();
}

Raz::Entity& AppWindow::addEntity(QString name) {
Expand All @@ -171,7 +169,7 @@ Raz::Entity& AppWindow::addEntity(QString name) {

m_parentWindow->m_window.entitiesList->addEntity(name);

Raz::Entity& entity = m_application.getWorlds().back().addEntity();
Raz::Entity& entity = m_application.getWorlds().back()->addEntity();
m_entities.emplace(std::move(name), &entity);

return entity;
Expand All @@ -198,7 +196,7 @@ void AppWindow::removeEntity(const QString& name) {
Raz::Entity& entity = recoverEntity(name);
const bool hasLight = entity.hasComponent<Raz::Light>();

m_application.getWorlds().front().removeEntity(entity);
m_application.getWorlds().front()->removeEntity(entity);
m_entities.erase(name);

if (hasLight)
Expand Down Expand Up @@ -387,8 +385,8 @@ void AppWindow::exposeEvent(QExposeEvent*) {
}

void AppWindow::resizeEvent(QResizeEvent* event) {
m_application.getWorlds().back().getSystem<Raz::RenderSystem>().resizeViewport(static_cast<unsigned int>(event->size().width()),
static_cast<unsigned int>(event->size().height()));
m_application.getWorlds().back()->getSystem<Raz::RenderSystem>().resizeViewport(static_cast<unsigned int>(event->size().width()),
static_cast<unsigned int>(event->size().height()));
}

void AppWindow::addEntityWithMesh(const Raz::FilePath& filePath) {
Expand All @@ -407,12 +405,12 @@ void AppWindow::addEntityWithMesh(const Raz::FilePath& filePath) {
void AppWindow::loadCubemap(const Raz::FilePath& rightTexturePath, const Raz::FilePath& leftTexturePath,
const Raz::FilePath& topTexturePath, const Raz::FilePath& bottomTexturePath,
const Raz::FilePath& frontTexturePath, const Raz::FilePath& backTexturePath) {
m_application.getWorlds().back().getSystem<Raz::RenderSystem>().setCubemap(Raz::Cubemap(Raz::ImageFormat::load(rightTexturePath),
Raz::ImageFormat::load(leftTexturePath),
Raz::ImageFormat::load(topTexturePath),
Raz::ImageFormat::load(bottomTexturePath),
Raz::ImageFormat::load(frontTexturePath),
Raz::ImageFormat::load(backTexturePath)));
m_application.getWorlds().back()->getSystem<Raz::RenderSystem>().setCubemap(Raz::Cubemap(Raz::ImageFormat::load(rightTexturePath),
Raz::ImageFormat::load(leftTexturePath),
Raz::ImageFormat::load(topTexturePath),
Raz::ImageFormat::load(bottomTexturePath),
Raz::ImageFormat::load(frontTexturePath),
Raz::ImageFormat::load(backTexturePath)));
}

void AppWindow::processActions() {
Expand Down
2 changes: 1 addition & 1 deletion src/RaZor/Interface/Component/AppComponents.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void AppWindow::loadComponents(const QString& entityName) {
if (remainingComponentCount > 0)
m_parentWindow->m_window.componentsLayout->addWidget(new QLabel(QString::number(remainingComponentCount) + tr(" component(s) not displayed.")));

showAddComponent(entity, entityName, m_application.getWorlds().back().getSystem<Raz::RenderSystem>());
showAddComponent(entity, entityName, m_application.getWorlds().back()->getSystem<Raz::RenderSystem>());
}

void AppWindow::importMesh(const Raz::FilePath& filePath, Raz::Entity& entity) {
Expand Down
1 change: 1 addition & 0 deletions src/RaZor/Interface/Component/ColliderGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <RaZ/Math/Transform.hpp>
#include <RaZ/Physics/Collider.hpp>
#include <RaZ/Utils/Shape.hpp>

#include <QStandardItemModel>

Expand Down
10 changes: 5 additions & 5 deletions src/RaZor/Interface/Component/LightGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LightGroup::LightGroup(Raz::Entity& entity, AppWindow& appWindow) : ComponentGro
lightComp.setupUi(this);

auto& light = m_entity.getComponent<Raz::Light>();
const Raz::RenderSystem& renderSystem = appWindow.getApplication().getWorlds().back().getSystem<Raz::RenderSystem>();
const Raz::RenderSystem& renderSystem = appWindow.getApplication().getWorlds().back()->getSystem<Raz::RenderSystem>();

// Direction

Expand Down Expand Up @@ -42,16 +42,16 @@ LightGroup::LightGroup(Raz::Entity& entity, AppWindow& appWindow) : ComponentGro

// Color

lightComp.colorR->setValue(static_cast<int>(light.getColor()[0] * static_cast<float>(lightComp.colorR->maximum())));
lightComp.colorG->setValue(static_cast<int>(light.getColor()[1] * static_cast<float>(lightComp.colorG->maximum())));
lightComp.colorB->setValue(static_cast<int>(light.getColor()[2] * static_cast<float>(lightComp.colorB->maximum())));
lightComp.colorR->setValue(static_cast<int>(light.getColor().red() * static_cast<float>(lightComp.colorR->maximum())));
lightComp.colorG->setValue(static_cast<int>(light.getColor().green() * static_cast<float>(lightComp.colorG->maximum())));
lightComp.colorB->setValue(static_cast<int>(light.getColor().blue() * static_cast<float>(lightComp.colorB->maximum())));

const auto updateLightColor = [lightComp, &light, &renderSystem] (int) {
const float colorR = static_cast<float>(lightComp.colorR->value()) / static_cast<float>(lightComp.colorR->maximum());
const float colorG = static_cast<float>(lightComp.colorG->value()) / static_cast<float>(lightComp.colorG->maximum());
const float colorB = static_cast<float>(lightComp.colorB->value()) / static_cast<float>(lightComp.colorB->maximum());

light.setColor(Raz::Vec3f(colorR, colorG, colorB));
light.setColor(Raz::Color(colorR, colorG, colorB));
renderSystem.updateLights();
};

Expand Down
1 change: 1 addition & 0 deletions src/RaZor/Interface/Component/ListenerGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <RaZ/Entity.hpp>
#include <RaZ/Audio/Listener.hpp>
#include <RaZ/Math/Vector.hpp>

#include <QPushButton>

Expand Down
Loading

0 comments on commit 8a32148

Please sign in to comment.