Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
rollerozxa authored Feb 10, 2024
2 parents 34b4711 + 6779ac8 commit e9f7f50
Show file tree
Hide file tree
Showing 48 changed files with 613 additions and 1,117 deletions.
104 changes: 74 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@ on:
jobs:

linux-gl:
runs-on: ubuntu-latest
container:
image: ubuntu:bionic
env: { LANG: "C.UTF-8" }
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
apt-get update
apt-get install g++ cmake libxi-dev libgl1-mesa-dev libpng-dev libjpeg-dev zlib1g-dev -qyy
sudo apt-get update
sudo apt-get install g++ cmake libxi-dev libgl1-mesa-dev libpng-dev libjpeg-dev zlib1g-dev -qyy
- name: Build
run: |
Expand All @@ -39,16 +36,14 @@ jobs:
path: ./irrlicht-linux.tar.gz

linux-gles:
runs-on: ubuntu-latest
container:
image: ubuntu:bionic
env: { LANG: "C.UTF-8" }
# Xvfb test is broken on 20.04 for unknown reasons (not our bug)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
apt-get update
apt-get install g++ cmake libxi-dev libgles2-mesa-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
sudo apt-get update
sudo apt-get install g++ cmake libxi-dev libgles2-mesa-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
- name: Build
run: |
Expand All @@ -66,16 +61,13 @@ jobs:
LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest ogles2
linux-sdl:
runs-on: ubuntu-latest
container:
image: ubuntu:jammy
env: { LANG: "C.UTF-8" }
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
apt-get update
apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev -qyy
sudo apt-get update
sudo apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev -qyy
- name: Build
run: |
Expand All @@ -88,16 +80,14 @@ jobs:
./AutomatedTest null
linux-sdl-gl3:
runs-on: ubuntu-latest
container:
image: ubuntu:jammy
env: { LANG: "C.UTF-8" }
# Xvfb test is broken on 20.04 for unknown reasons (not our bug)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
apt-get update
apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
sudo apt-get update
sudo apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
- name: Build
run: |
Expand All @@ -115,16 +105,13 @@ jobs:
LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest opengl3
linux-sdl-gles2:
runs-on: ubuntu-latest
container:
image: ubuntu:jammy
env: { LANG: "C.UTF-8" }
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
apt-get update
apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
sudo apt-get update
sudo apt-get install g++ cmake libsdl2-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
- name: Build
run: |
Expand Down Expand Up @@ -190,6 +177,20 @@ jobs:
run: |
./bin/OSX/AutomatedTest null
macos-sdl:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
brew update
brew install cmake libpng jpeg sdl2
- name: Build
run: |
cmake . -DCMAKE_FIND_FRAMEWORK=LAST -DBUILD_EXAMPLES=1 -DUSE_SDL2=1
make -j3
msvc:
name: VS 2019 ${{ matrix.config.arch }} ${{ matrix.sdl.label }}
runs-on: windows-2019
Expand Down Expand Up @@ -257,3 +258,46 @@ jobs:
with:
name: msvc-${{ matrix.config.arch }}
path: artifact/

android:
name: Android ${{ matrix.arch }}
runs-on: ubuntu-20.04
env:
ndk_version: "r25c"
ANDROID_NDK: ${{ github.workspace }}/android-ndk
strategy:
matrix:
arch: [armeabi-v7a, arm64-v8a, x86, x86_64]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install deps
run: |
sudo rm /var/lib/man-db/auto-update
sudo apt-get update
sudo apt-get install -qyy wget unzip zip gcc-multilib make cmake
- name: Cache NDK
id: cache-ndk
uses: actions/cache@v3
with:
key: android-ndk-${{ env.ndk_version }}-linux
path: ${{ env.ANDROID_NDK }}

- name: Install NDK
run: |
wget --progress=bar:force "http://dl.google.com/android/repository/android-ndk-${ndk_version}-linux.zip"
unzip -q "android-ndk-${ndk_version}-linux.zip"
rm "android-ndk-${ndk_version}-linux.zip"
mv "android-ndk-${ndk_version}" "${ANDROID_NDK}"
if: ${{ steps.cache-ndk.outputs.cache-hit != 'true' }}

- name: Build
run: ./scripts/ci-build-android.sh ${{ matrix.arch }}

#- name: Upload Artifact
# uses: actions/upload-artifact@v3
# with:
# name: irrlicht-android-${{ matrix.arch }}
# path: ${{ runner.temp }}/pkg/${{ matrix.arch }}
11 changes: 2 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.12)

# >=3.9 enables IPO; >=3.11 prefers GLVND
if(${CMAKE_VERSION} VERSION_LESS 3.11)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
else()
cmake_policy(VERSION 3.11)
endif()

set(IRRLICHTMT_REVISION 13)
set(IRRLICHTMT_REVISION 15)

project(Irrlicht
VERSION 1.9.0.${IRRLICHTMT_REVISION}
Expand Down
6 changes: 6 additions & 0 deletions Config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)

if(NOT TARGET IrrlichtMt::IrrlichtMt)
# private dependency only explicitly needed with static libs
if(@USE_SDL2@ AND NOT @BUILD_SHARED_LIBS@)
find_dependency(SDL2)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/IrrlichtMtTargets.cmake")
endif()
15 changes: 0 additions & 15 deletions include/EDriverFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,21 +121,6 @@ namespace video
//! Support for texture coord transformation via texture matrix
EVDF_TEXTURE_MATRIX,

//! Support for DXTn compressed textures.
EVDF_TEXTURE_COMPRESSED_DXT,

//! Support for PVRTC compressed textures.
EVDF_TEXTURE_COMPRESSED_PVRTC,

//! Support for PVRTC2 compressed textures.
EVDF_TEXTURE_COMPRESSED_PVRTC2,

//! Support for ETC1 compressed textures.
EVDF_TEXTURE_COMPRESSED_ETC1,

//! Support for ETC2 compressed textures.
EVDF_TEXTURE_COMPRESSED_ETC2,

//! Support for cube map textures.
EVDF_TEXTURE_CUBEMAP,

Expand Down
103 changes: 4 additions & 99 deletions include/IImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -362,28 +362,6 @@ class IImage : public virtual IReferenceCounted
return 24;
case ECF_A8R8G8B8:
return 32;
case ECF_DXT1:
return 16;
case ECF_DXT2:
case ECF_DXT3:
case ECF_DXT4:
case ECF_DXT5:
return 32;
case ECF_PVRTC_RGB2:
return 12;
case ECF_PVRTC_ARGB2:
case ECF_PVRTC2_ARGB2:
return 16;
case ECF_PVRTC_RGB4:
return 24;
case ECF_PVRTC_ARGB4:
case ECF_PVRTC2_ARGB4:
return 32;
case ECF_ETC1:
case ECF_ETC2_RGB:
return 24;
case ECF_ETC2_ARGB:
return 32;
case ECF_D16:
return 16;
case ECF_D32:
Expand Down Expand Up @@ -418,74 +396,17 @@ class IImage : public virtual IReferenceCounted
//! calculate image data size in bytes for selected format, width and height.
static u32 getDataSizeFromFormat(ECOLOR_FORMAT format, u32 width, u32 height)
{
u32 imageSize = 0;

switch (format)
{
case ECF_DXT1:
imageSize = ((width + 3) / 4) * ((height + 3) / 4) * 8;
break;
case ECF_DXT2:
case ECF_DXT3:
case ECF_DXT4:
case ECF_DXT5:
imageSize = ((width + 3) / 4) * ((height + 3) / 4) * 16;
break;
case ECF_PVRTC_RGB2:
case ECF_PVRTC_ARGB2:
imageSize = (core::max_<u32>(width, 16) * core::max_<u32>(height, 8) * 2 + 7) / 8;
break;
case ECF_PVRTC_RGB4:
case ECF_PVRTC_ARGB4:
imageSize = (core::max_<u32>(width, 8) * core::max_<u32>(height, 8) * 4 + 7) / 8;
break;
case ECF_PVRTC2_ARGB2:
imageSize = core::ceil32(width / 8.0f) * core::ceil32(height / 4.0f) * 8;
break;
case ECF_PVRTC2_ARGB4:
case ECF_ETC1:
case ECF_ETC2_RGB:
imageSize = core::ceil32(width / 4.0f) * core::ceil32(height / 4.0f) * 8;
break;
case ECF_ETC2_ARGB:
imageSize = core::ceil32(width / 4.0f) * core::ceil32(height / 4.0f) * 16;
break;
default: // uncompressed formats
imageSize = getBitsPerPixelFromFormat(format) / 8 * width;
imageSize *= height;
break;
}
// non-compressed formats
u32 imageSize = getBitsPerPixelFromFormat(format) / 8 * width;
imageSize *= height;

return imageSize;
}

// Define to check for all compressed image formats cases in a switch
#define IRR_CASE_IIMAGE_COMPRESSED_FORMAT\
case ECF_DXT1:\
case ECF_DXT2:\
case ECF_DXT3:\
case ECF_DXT4:\
case ECF_DXT5:\
case ECF_PVRTC_RGB2:\
case ECF_PVRTC_ARGB2:\
case ECF_PVRTC2_ARGB2:\
case ECF_PVRTC_RGB4:\
case ECF_PVRTC_ARGB4:\
case ECF_PVRTC2_ARGB4:\
case ECF_ETC1:\
case ECF_ETC2_RGB:\
case ECF_ETC2_ARGB:

//! check if this is compressed color format
static bool isCompressedFormat(const ECOLOR_FORMAT format)
{
switch(format)
{
IRR_CASE_IIMAGE_COMPRESSED_FORMAT
return true;
default:
return false;
}
return false;
}

//! check if the color format is only viable for depth/stencil textures
Expand Down Expand Up @@ -523,22 +444,6 @@ class IImage : public virtual IReferenceCounted
return false;
}

#if defined(PATCH_SUPERTUX_8_0_1_with_1_9_0)
static bool isRenderTargetOnlyFormat(const ECOLOR_FORMAT format)
{
switch (format)
{
case ECF_A1R5G5B5:
case ECF_R5G6B5:
case ECF_R8G8B8:
case ECF_A8R8G8B8:
return false;
default:
return true;
}
}
#endif

protected:
ECOLOR_FORMAT Format;
core::dimension2d<u32> Size;
Expand Down
Loading

0 comments on commit e9f7f50

Please sign in to comment.