From 71d4553b8ea86356ddc9c7f546dcc544cb788885 Mon Sep 17 00:00:00 2001 From: Cory Petkovsek <632766+TokisanGames@users.noreply.github.com> Date: Thu, 10 Oct 2024 01:07:10 +0700 Subject: [PATCH] Fix clang warnings. Build on PRs --- .github/workflows/build.yml | 7 ++++++- src/terrain_3d_data.h | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bff8e058..c5bcd446 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,10 @@ name: 🛠️ Build All -on: [push, workflow_dispatch] +on: + push: + branches: [ master ] + pull_request: + paths: [ '**' ] + workflow_dispatch: concurrency: group: ${{ github.ref }} diff --git a/src/terrain_3d_data.h b/src/terrain_3d_data.h index f1319253..487d95b5 100644 --- a/src/terrain_3d_data.h +++ b/src/terrain_3d_data.h @@ -150,9 +150,9 @@ class Terrain3DData : public Object { // Control Map void set_control_base_id(const Vector3 &p_global_position, const uint8_t p_base); - uint8_t get_control_base_id(const Vector3 &p_global_position) const; + uint32_t get_control_base_id(const Vector3 &p_global_position) const; void set_control_overlay_id(const Vector3 &p_global_position, const uint8_t p_overlay); - uint8_t get_control_overlay_id(const Vector3 &p_global_position) const; + uint32_t get_control_overlay_id(const Vector3 &p_global_position) const; void set_control_blend(const Vector3 &p_global_position, const real_t p_blend); real_t get_control_blend(const Vector3 &p_global_position) const; void set_control_angle(const Vector3 &p_global_position, const real_t p_angle); @@ -273,7 +273,7 @@ inline void Terrain3DData::set_control_base_id(const Vector3 &p_global_position, set_control(p_global_position, (control & ~(0x1F << 27)) | enc_base(base)); } -inline uint8_t Terrain3DData::get_control_base_id(const Vector3 &p_global_position) const { +inline uint32_t Terrain3DData::get_control_base_id(const Vector3 &p_global_position) const { uint32_t control = get_control(p_global_position); return control == UINT32_MAX ? UINT32_MAX : get_base(control); } @@ -284,7 +284,7 @@ inline void Terrain3DData::set_control_overlay_id(const Vector3 &p_global_positi set_control(p_global_position, (control & ~(0x1F << 22)) | enc_base(overlay)); } -inline uint8_t Terrain3DData::get_control_overlay_id(const Vector3 &p_global_position) const { +inline uint32_t Terrain3DData::get_control_overlay_id(const Vector3 &p_global_position) const { uint32_t control = get_control(p_global_position); return control == UINT32_MAX ? UINT32_MAX : get_overlay(control); }