mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-04 01:00:26 +02:00
Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
f7b46ba22f | |||
f05f84b33b | |||
3006362e25 | |||
ff737e113c | |||
8eaf3db05a | |||
7c428c6dc2 | |||
7f0e0a57b8 | |||
4bdd8af47d | |||
fa7a5dbdef | |||
a3d848ff8b | |||
57ff34b1ed | |||
0335a52479 | |||
4931b34625 | |||
cadbd62271 | |||
0a09f98c74 |
40
.github/workflows/build.yml
vendored
40
.github/workflows/build.yml
vendored
@ -20,6 +20,16 @@ jobs:
|
|||||||
cmake .
|
cmake .
|
||||||
make
|
make
|
||||||
|
|
||||||
|
- name: Package
|
||||||
|
run: |
|
||||||
|
make DESTDIR=$PWD/_install install
|
||||||
|
tar -c -I "gzip -9" -f irrlicht-linux.tar.gz -C ./_install/usr/local .
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: irrlicht-linux
|
||||||
|
path: ./irrlicht-linux.tar.gz
|
||||||
|
|
||||||
linux-gles:
|
linux-gles:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-18.04
|
||||||
steps:
|
steps:
|
||||||
@ -34,3 +44,33 @@ jobs:
|
|||||||
sed '/#define _IRR_COMPILE_WITH_OPENGL_/ s|^|//|g' -i include/IrrCompileConfig.h
|
sed '/#define _IRR_COMPILE_WITH_OPENGL_/ s|^|//|g' -i include/IrrCompileConfig.h
|
||||||
cmake .
|
cmake .
|
||||||
make
|
make
|
||||||
|
|
||||||
|
win32:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install deps
|
||||||
|
run: |
|
||||||
|
sudo apt-get install cmake g++-mingw-w64-i686 -qyy
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
./scripts/ci-build-mingw.sh
|
||||||
|
env:
|
||||||
|
CC: i686-w64-mingw32-gcc
|
||||||
|
CXX: i686-w64-mingw32-g++
|
||||||
|
|
||||||
|
win64:
|
||||||
|
runs-on: ubuntu-18.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install deps
|
||||||
|
run: |
|
||||||
|
sudo apt-get install cmake g++-mingw-w64-x86-64 -qyy
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
./scripts/ci-build-mingw.sh
|
||||||
|
env:
|
||||||
|
CC: x86_64-w64-mingw32-gcc
|
||||||
|
CXX: x86_64-w64-mingw32-g++
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -2,5 +2,5 @@ CMakeFiles
|
|||||||
CMakeCache.txt
|
CMakeCache.txt
|
||||||
cmake_install.cmake
|
cmake_install.cmake
|
||||||
Makefile
|
Makefile
|
||||||
*.so.*
|
*.so*
|
||||||
*.a
|
*.a
|
||||||
|
@ -7,7 +7,7 @@ set(IRRLICHT_VERSION_MINOR 9)
|
|||||||
set(IRRLICHT_VERSION_RELEASE 0)
|
set(IRRLICHT_VERSION_RELEASE 0)
|
||||||
|
|
||||||
set(VERSION "${IRRLICHT_VERSION_MAJOR}.${IRRLICHT_VERSION_MINOR}.${IRRLICHT_VERSION_RELEASE}")
|
set(VERSION "${IRRLICHT_VERSION_MAJOR}.${IRRLICHT_VERSION_MINOR}.${IRRLICHT_VERSION_RELEASE}")
|
||||||
message(STATUS "*** Building Irrlicht ${VERSION} ***")
|
message(STATUS "*** Building IrrlichtMt ${VERSION} ***")
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/Android)
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/Android)
|
||||||
|
11
README.md
11
README.md
@ -1,7 +1,9 @@
|
|||||||
The Irrlicht engine version 1.9
|
IrrlichtMt version 1.9
|
||||||
===============================
|
======================
|
||||||
|
|
||||||
This is a fork of the Irrlicht engine by the [Minetest](https://github.com/minetest) developers that contains features, customizations and fixes specifically for use in Minetest.
|
The Irrlicht Engine is an open source realtime 3D engine written in C++.
|
||||||
|
|
||||||
|
This is a fork by the [Minetest](https://github.com/minetest) developers that contains features, customizations and fixes specifically for use in Minetest.
|
||||||
|
|
||||||
Build
|
Build
|
||||||
-----
|
-----
|
||||||
@ -15,11 +17,12 @@ The following libraries are required to be installed:
|
|||||||
* on Unix: X11
|
* on Unix: X11
|
||||||
|
|
||||||
Aside from standard search options (`ZLIB_INCLUDE_DIR`, `ZLIB_LIBRARY`, ...) the following options are available:
|
Aside from standard search options (`ZLIB_INCLUDE_DIR`, `ZLIB_LIBRARY`, ...) the following options are available:
|
||||||
* `BUILD_SHARED_LIBS` (default: `ON`) - Build Irrlicht as a shared library
|
* `BUILD_SHARED_LIBS` (default: `ON`) - Build IrrlichtMt as a shared library
|
||||||
|
|
||||||
e.g. on a Linux system you might want to build for local use like this:
|
e.g. on a Linux system you might want to build for local use like this:
|
||||||
|
|
||||||
git clone https://github.com/minetest/irrlicht
|
git clone https://github.com/minetest/irrlicht
|
||||||
|
cd irrlicht
|
||||||
cmake . -DBUILD_SHARED_LIBS=OFF
|
cmake . -DBUILD_SHARED_LIBS=OFF
|
||||||
make -j$(nproc)
|
make -j$(nproc)
|
||||||
|
|
||||||
|
@ -156,12 +156,6 @@ namespace scene
|
|||||||
position.X = 0.f;
|
position.X = 0.f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// construct copy constructor
|
|
||||||
SMD3QuaternionTag( const SMD3QuaternionTag & copyMe )
|
|
||||||
{
|
|
||||||
*this = copyMe;
|
|
||||||
}
|
|
||||||
|
|
||||||
// construct for searching
|
// construct for searching
|
||||||
SMD3QuaternionTag( const core::stringc& name )
|
SMD3QuaternionTag( const core::stringc& name )
|
||||||
: Name ( name ) {}
|
: Name ( name ) {}
|
||||||
@ -181,14 +175,6 @@ namespace scene
|
|||||||
return Name == other.Name;
|
return Name == other.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
SMD3QuaternionTag & operator=( const SMD3QuaternionTag & copyMe )
|
|
||||||
{
|
|
||||||
Name = copyMe.Name;
|
|
||||||
position = copyMe.position;
|
|
||||||
rotation = copyMe.rotation;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
core::stringc Name;
|
core::stringc Name;
|
||||||
core::vector3df position;
|
core::vector3df position;
|
||||||
core::quaternion rotation;
|
core::quaternion rotation;
|
||||||
@ -202,12 +188,6 @@ namespace scene
|
|||||||
Container.setAllocStrategy(core::ALLOC_STRATEGY_SAFE);
|
Container.setAllocStrategy(core::ALLOC_STRATEGY_SAFE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// construct copy constructor
|
|
||||||
SMD3QuaternionTagList(const SMD3QuaternionTagList& copyMe)
|
|
||||||
{
|
|
||||||
*this = copyMe;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual ~SMD3QuaternionTagList() {}
|
virtual ~SMD3QuaternionTagList() {}
|
||||||
|
|
||||||
SMD3QuaternionTag* get(const core::stringc& name)
|
SMD3QuaternionTag* get(const core::stringc& name)
|
||||||
@ -250,12 +230,6 @@ namespace scene
|
|||||||
Container.push_back(other);
|
Container.push_back(other);
|
||||||
}
|
}
|
||||||
|
|
||||||
SMD3QuaternionTagList& operator = (const SMD3QuaternionTagList & copyMe)
|
|
||||||
{
|
|
||||||
Container = copyMe.Container;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
core::array < SMD3QuaternionTag > Container;
|
core::array < SMD3QuaternionTag > Container;
|
||||||
};
|
};
|
||||||
|
@ -639,13 +639,6 @@ namespace quake3
|
|||||||
: ID ( 0 ), VarGroup ( 0 ) {}
|
: ID ( 0 ), VarGroup ( 0 ) {}
|
||||||
virtual ~IShader () {}
|
virtual ~IShader () {}
|
||||||
|
|
||||||
void operator = (const IShader &other )
|
|
||||||
{
|
|
||||||
ID = other.ID;
|
|
||||||
VarGroup = other.VarGroup;
|
|
||||||
name = other.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator == (const IShader &other ) const
|
bool operator == (const IShader &other ) const
|
||||||
{
|
{
|
||||||
return 0 == strcmp ( name.c_str(), other.name.c_str () );
|
return 0 == strcmp ( name.c_str(), other.name.c_str () );
|
||||||
|
@ -923,8 +923,8 @@ namespace video
|
|||||||
|
|
||||||
//! Draws a 2d line.
|
//! Draws a 2d line.
|
||||||
/** In theory both start and end will be included in coloring.
|
/** In theory both start and end will be included in coloring.
|
||||||
BUG: Currently hardware drivers (d3d/opengl) ignore the last pixel
|
BUG: Currently d3d ignores the last pixel
|
||||||
(they use the so called "diamond exit rule" for drawing lines).
|
(it uses the so called "diamond exit rule" for drawing lines).
|
||||||
\param start Screen coordinates of the start of the line
|
\param start Screen coordinates of the start of the line
|
||||||
in pixels.
|
in pixels.
|
||||||
\param end Screen coordinates of the start of the line in
|
\param end Screen coordinates of the start of the line in
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
#define __IRR_COMPILE_CONFIG_H_INCLUDED__
|
#define __IRR_COMPILE_CONFIG_H_INCLUDED__
|
||||||
|
|
||||||
//! Identifies Irrlicht fork customized for the Minetest engine
|
//! Identifies Irrlicht fork customized for the Minetest engine
|
||||||
#define IRRLICHT_VERSION_MT_REVISION 0
|
#define IRRLICHT_VERSION_MT_REVISION 1
|
||||||
#define IRRLICHT_VERSION_MT "mt0"
|
#define IRRLICHT_VERSION_MT "mt1"
|
||||||
|
|
||||||
//! Irrlicht SDK Version
|
//! Irrlicht SDK Version
|
||||||
#define IRRLICHT_VERSION_MAJOR 1
|
#define IRRLICHT_VERSION_MAJOR 1
|
||||||
|
@ -328,53 +328,6 @@ namespace video
|
|||||||
*this = other;
|
*this = other;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Assignment operator
|
|
||||||
/** \param other Material to copy from. */
|
|
||||||
SMaterial& operator=(const SMaterial& other)
|
|
||||||
{
|
|
||||||
// Check for self-assignment!
|
|
||||||
if (this == &other)
|
|
||||||
return *this;
|
|
||||||
|
|
||||||
MaterialType = other.MaterialType;
|
|
||||||
|
|
||||||
AmbientColor = other.AmbientColor;
|
|
||||||
DiffuseColor = other.DiffuseColor;
|
|
||||||
EmissiveColor = other.EmissiveColor;
|
|
||||||
SpecularColor = other.SpecularColor;
|
|
||||||
Shininess = other.Shininess;
|
|
||||||
MaterialTypeParam = other.MaterialTypeParam;
|
|
||||||
MaterialTypeParam2 = other.MaterialTypeParam2;
|
|
||||||
Thickness = other.Thickness;
|
|
||||||
for (u32 i=0; i<MATERIAL_MAX_TEXTURES_USED; ++i)
|
|
||||||
{
|
|
||||||
TextureLayer[i] = other.TextureLayer[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
Wireframe = other.Wireframe;
|
|
||||||
PointCloud = other.PointCloud;
|
|
||||||
GouraudShading = other.GouraudShading;
|
|
||||||
Lighting = other.Lighting;
|
|
||||||
ZWriteEnable = other.ZWriteEnable;
|
|
||||||
BackfaceCulling = other.BackfaceCulling;
|
|
||||||
FrontfaceCulling = other.FrontfaceCulling;
|
|
||||||
FogEnable = other.FogEnable;
|
|
||||||
NormalizeNormals = other.NormalizeNormals;
|
|
||||||
ZBuffer = other.ZBuffer;
|
|
||||||
AntiAliasing = other.AntiAliasing;
|
|
||||||
ColorMask = other.ColorMask;
|
|
||||||
ColorMaterial = other.ColorMaterial;
|
|
||||||
BlendOperation = other.BlendOperation;
|
|
||||||
BlendFactor = other.BlendFactor;
|
|
||||||
PolygonOffsetFactor = other.PolygonOffsetFactor;
|
|
||||||
PolygonOffsetDirection = other.PolygonOffsetDirection;
|
|
||||||
PolygonOffsetDepthBias = other.PolygonOffsetDepthBias;
|
|
||||||
PolygonOffsetSlopeScale = other.PolygonOffsetSlopeScale;
|
|
||||||
UseMipMaps = other.UseMipMaps;
|
|
||||||
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Texture layer array.
|
//! Texture layer array.
|
||||||
SMaterialLayer TextureLayer[MATERIAL_MAX_TEXTURES];
|
SMaterialLayer TextureLayer[MATERIAL_MAX_TEXTURES];
|
||||||
|
|
||||||
|
@ -140,9 +140,6 @@ class map
|
|||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy constructor
|
|
||||||
Iterator(const Iterator& src) : Root(src.Root), Cur(src.Cur) {}
|
|
||||||
|
|
||||||
void reset(bool atLowest=true)
|
void reset(bool atLowest=true)
|
||||||
{
|
{
|
||||||
if (atLowest)
|
if (atLowest)
|
||||||
@ -161,13 +158,6 @@ class map
|
|||||||
return Cur;
|
return Cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
Iterator& operator=(const Iterator& src)
|
|
||||||
{
|
|
||||||
Root = src.Root;
|
|
||||||
Cur = src.Cur;
|
|
||||||
return (*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator++(int)
|
void operator++(int)
|
||||||
{
|
{
|
||||||
inc();
|
inc();
|
||||||
@ -287,8 +277,7 @@ class map
|
|||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy constructor
|
// Constructor(Iterator)
|
||||||
ConstIterator(const ConstIterator& src) : Root(src.Root), Cur(src.Cur) {}
|
|
||||||
ConstIterator(const Iterator& src) : Root(src.Root), Cur(src.Cur) {}
|
ConstIterator(const Iterator& src) : Root(src.Root), Cur(src.Cur) {}
|
||||||
|
|
||||||
void reset(bool atLowest=true)
|
void reset(bool atLowest=true)
|
||||||
@ -309,13 +298,6 @@ class map
|
|||||||
return Cur;
|
return Cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConstIterator& operator=(const ConstIterator& src)
|
|
||||||
{
|
|
||||||
Root = src.Root;
|
|
||||||
Cur = src.Cur;
|
|
||||||
return (*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator++(int)
|
void operator++(int)
|
||||||
{
|
{
|
||||||
inc();
|
inc();
|
||||||
@ -453,13 +435,6 @@ class map
|
|||||||
return Cur;
|
return Cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
ParentFirstIterator& operator=(const ParentFirstIterator& src)
|
|
||||||
{
|
|
||||||
Root = src.Root;
|
|
||||||
Cur = src.Cur;
|
|
||||||
return (*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator++(int)
|
void operator++(int)
|
||||||
{
|
{
|
||||||
inc();
|
inc();
|
||||||
@ -552,13 +527,6 @@ class map
|
|||||||
return Cur;
|
return Cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
ParentLastIterator& operator=(const ParentLastIterator& src)
|
|
||||||
{
|
|
||||||
Root = src.Root;
|
|
||||||
Cur = src.Cur;
|
|
||||||
return (*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
void operator++(int)
|
void operator++(int)
|
||||||
{
|
{
|
||||||
inc();
|
inc();
|
||||||
|
3891
include/irrUString.h
Normal file
3891
include/irrUString.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -24,8 +24,6 @@ class line2d
|
|||||||
line2d(T xa, T ya, T xb, T yb) : start(xa, ya), end(xb, yb) {}
|
line2d(T xa, T ya, T xb, T yb) : start(xa, ya), end(xb, yb) {}
|
||||||
//! Constructor for line between the two points given as vectors.
|
//! Constructor for line between the two points given as vectors.
|
||||||
line2d(const vector2d<T>& start, const vector2d<T>& end) : start(start), end(end) {}
|
line2d(const vector2d<T>& start, const vector2d<T>& end) : start(start), end(end) {}
|
||||||
//! Copy constructor.
|
|
||||||
line2d(const line2d<T>& other) : start(other.start), end(other.end) {}
|
|
||||||
|
|
||||||
// operators
|
// operators
|
||||||
|
|
||||||
|
@ -102,9 +102,6 @@ namespace core
|
|||||||
//! Simple operator for linearly accessing every element of the matrix.
|
//! Simple operator for linearly accessing every element of the matrix.
|
||||||
const T& operator[](u32 index) const { return M[index]; }
|
const T& operator[](u32 index) const { return M[index]; }
|
||||||
|
|
||||||
//! Sets this matrix equal to the other matrix.
|
|
||||||
inline CMatrix4<T>& operator=(const CMatrix4<T> &other);
|
|
||||||
|
|
||||||
//! Sets all elements of this matrix to the value.
|
//! Sets all elements of this matrix to the value.
|
||||||
inline CMatrix4<T>& operator=(const T& scalar);
|
inline CMatrix4<T>& operator=(const T& scalar);
|
||||||
|
|
||||||
@ -1504,19 +1501,6 @@ namespace core
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
|
||||||
inline CMatrix4<T>& CMatrix4<T>::operator=(const CMatrix4<T> &other)
|
|
||||||
{
|
|
||||||
if (this==&other)
|
|
||||||
return *this;
|
|
||||||
memcpy(M, other.M, 16*sizeof(T));
|
|
||||||
#if defined ( USE_MATRIX_TEST )
|
|
||||||
definitelyIdentityMatrix=other.definitelyIdentityMatrix;
|
|
||||||
#endif
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
inline CMatrix4<T>& CMatrix4<T>::operator=(const T& scalar)
|
inline CMatrix4<T>& CMatrix4<T>::operator=(const T& scalar)
|
||||||
{
|
{
|
||||||
|
@ -55,9 +55,6 @@ class quaternion
|
|||||||
//! inequality operator
|
//! inequality operator
|
||||||
bool operator!=(const quaternion& other) const;
|
bool operator!=(const quaternion& other) const;
|
||||||
|
|
||||||
//! Assignment operator
|
|
||||||
inline quaternion& operator=(const quaternion& other);
|
|
||||||
|
|
||||||
#ifndef IRR_TEST_BROKEN_QUATERNION_USE
|
#ifndef IRR_TEST_BROKEN_QUATERNION_USE
|
||||||
//! Matrix assignment operator
|
//! Matrix assignment operator
|
||||||
inline quaternion& operator=(const matrix4& other);
|
inline quaternion& operator=(const matrix4& other);
|
||||||
@ -240,16 +237,6 @@ inline bool quaternion::operator!=(const quaternion& other) const
|
|||||||
return !(*this == other);
|
return !(*this == other);
|
||||||
}
|
}
|
||||||
|
|
||||||
// assignment operator
|
|
||||||
inline quaternion& quaternion::operator=(const quaternion& other)
|
|
||||||
{
|
|
||||||
X = other.X;
|
|
||||||
Y = other.Y;
|
|
||||||
Z = other.Z;
|
|
||||||
W = other.W;
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef IRR_TEST_BROKEN_QUATERNION_USE
|
#ifndef IRR_TEST_BROKEN_QUATERNION_USE
|
||||||
// matrix assignment operator
|
// matrix assignment operator
|
||||||
inline quaternion& quaternion::operator=(const matrix4& m)
|
inline quaternion& quaternion::operator=(const matrix4& m)
|
||||||
|
@ -27,8 +27,6 @@ public:
|
|||||||
vector2d(T nx, T ny) : X(nx), Y(ny) {}
|
vector2d(T nx, T ny) : X(nx), Y(ny) {}
|
||||||
//! Constructor with the same value for both members
|
//! Constructor with the same value for both members
|
||||||
explicit vector2d(T n) : X(n), Y(n) {}
|
explicit vector2d(T n) : X(n), Y(n) {}
|
||||||
//! Copy constructor
|
|
||||||
vector2d(const vector2d<T>& other) : X(other.X), Y(other.Y) {}
|
|
||||||
|
|
||||||
vector2d(const dimension2d<T>& other) : X(other.Width), Y(other.Height) {}
|
vector2d(const dimension2d<T>& other) : X(other.Width), Y(other.Height) {}
|
||||||
|
|
||||||
@ -36,8 +34,6 @@ public:
|
|||||||
|
|
||||||
vector2d<T> operator-() const { return vector2d<T>(-X, -Y); }
|
vector2d<T> operator-() const { return vector2d<T>(-X, -Y); }
|
||||||
|
|
||||||
vector2d<T>& operator=(const vector2d<T>& other) { X = other.X; Y = other.Y; return *this; }
|
|
||||||
|
|
||||||
vector2d<T>& operator=(const dimension2d<T>& other) { X = other.Width; Y = other.Height; return *this; }
|
vector2d<T>& operator=(const dimension2d<T>& other) { X = other.Width; Y = other.Height; return *this; }
|
||||||
|
|
||||||
vector2d<T> operator+(const vector2d<T>& other) const { return vector2d<T>(X + other.X, Y + other.Y); }
|
vector2d<T> operator+(const vector2d<T>& other) const { return vector2d<T>(X + other.X, Y + other.Y); }
|
||||||
|
@ -28,15 +28,11 @@ namespace core
|
|||||||
vector3d(T nx, T ny, T nz) : X(nx), Y(ny), Z(nz) {}
|
vector3d(T nx, T ny, T nz) : X(nx), Y(ny), Z(nz) {}
|
||||||
//! Constructor with the same value for all elements
|
//! Constructor with the same value for all elements
|
||||||
explicit vector3d(T n) : X(n), Y(n), Z(n) {}
|
explicit vector3d(T n) : X(n), Y(n), Z(n) {}
|
||||||
//! Copy constructor
|
|
||||||
vector3d(const vector3d<T>& other) : X(other.X), Y(other.Y), Z(other.Z) {}
|
|
||||||
|
|
||||||
// operators
|
// operators
|
||||||
|
|
||||||
vector3d<T> operator-() const { return vector3d<T>(-X, -Y, -Z); }
|
vector3d<T> operator-() const { return vector3d<T>(-X, -Y, -Z); }
|
||||||
|
|
||||||
vector3d<T>& operator=(const vector3d<T>& other) { X = other.X; Y = other.Y; Z = other.Z; return *this; }
|
|
||||||
|
|
||||||
vector3d<T> operator+(const vector3d<T>& other) const { return vector3d<T>(X + other.X, Y + other.Y, Z + other.Z); }
|
vector3d<T> operator+(const vector3d<T>& other) const { return vector3d<T>(X + other.X, Y + other.Y, Z + other.Z); }
|
||||||
vector3d<T>& operator+=(const vector3d<T>& other) { X+=other.X; Y+=other.Y; Z+=other.Z; return *this; }
|
vector3d<T>& operator+=(const vector3d<T>& other) { X+=other.X; Y+=other.Y; Z+=other.Z; return *this; }
|
||||||
vector3d<T> operator+(const T val) const { return vector3d<T>(X + val, Y + val, Z + val); }
|
vector3d<T> operator+(const T val) const { return vector3d<T>(X + val, Y + val, Z + val); }
|
||||||
|
36
scripts/ci-build-mingw.sh
Executable file
36
scripts/ci-build-mingw.sh
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
[[ -z "$CC" || -z "$CXX" ]] && exit 255
|
||||||
|
|
||||||
|
variant=win32
|
||||||
|
[[ "$CXX" == "x86_64-"* ]] && variant=win64
|
||||||
|
|
||||||
|
libjpeg_version=2.0.6
|
||||||
|
libpng_version=1.6.37
|
||||||
|
zlib_version=1.2.11
|
||||||
|
|
||||||
|
mkdir -p libs
|
||||||
|
pushd libs
|
||||||
|
libs=$PWD
|
||||||
|
[ -e libjpeg.zip ] || \
|
||||||
|
wget "http://minetest.kitsunemimi.pw/libjpeg-$libjpeg_version-$variant.zip" -O libjpeg.zip
|
||||||
|
[ -e libpng.zip ] || \
|
||||||
|
wget "http://minetest.kitsunemimi.pw/libpng-$libpng_version-$variant.zip" -O libpng.zip
|
||||||
|
[ -e zlib.zip ] || \
|
||||||
|
wget "http://minetest.kitsunemimi.pw/zlib-$zlib_version-$variant.zip" -O zlib.zip
|
||||||
|
[ -d libjpeg ] || unzip -o libjpeg.zip -d libjpeg
|
||||||
|
[ -d libpng ] || unzip -o libpng.zip -d libpng
|
||||||
|
[ -d zlib ] || unzip -o zlib.zip -d zlib
|
||||||
|
popd
|
||||||
|
|
||||||
|
cmake . \
|
||||||
|
-DCMAKE_SYSTEM_NAME=Windows \
|
||||||
|
-DPNG_LIBRARY=$libs/libpng/lib/libpng.dll.a \
|
||||||
|
-DPNG_PNG_INCLUDE_DIR=$libs/libpng/include \
|
||||||
|
-DJPEG_LIBRARY=$libs/libjpeg/lib/libjpeg.dll.a \
|
||||||
|
-DJPEG_INCLUDE_DIR=$libs/libjpeg/include \
|
||||||
|
-DZLIB_LIBRARY=$libs/zlib/lib/libz.dll.a \
|
||||||
|
-DZLIB_INCLUDE_DIR=$libs/zlib/include
|
||||||
|
|
||||||
|
make -j$(nproc)
|
||||||
|
exit 0
|
@ -296,6 +296,10 @@ bool CGLXManager::generateSurface()
|
|||||||
|
|
||||||
CurrentContext.OpenGLLinux.GLXWindow=GlxWin;
|
CurrentContext.OpenGLLinux.GLXWindow=GlxWin;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CurrentContext.OpenGLLinux.GLXWindow=CurrentContext.OpenGLLinux.X11Window;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,13 +357,14 @@ bool CGLXManager::activateContext(const SExposedVideoData& videoData, bool resto
|
|||||||
{
|
{
|
||||||
if (videoData.OpenGLLinux.X11Display && videoData.OpenGLLinux.X11Context)
|
if (videoData.OpenGLLinux.X11Display && videoData.OpenGLLinux.X11Context)
|
||||||
{
|
{
|
||||||
if (!glXMakeCurrent((Display*)videoData.OpenGLLinux.X11Display, videoData.OpenGLLinux.X11Window, (GLXContext)videoData.OpenGLLinux.X11Context))
|
if (!glXMakeCurrent((Display*)videoData.OpenGLLinux.X11Display, videoData.OpenGLLinux.GLXWindow, (GLXContext)videoData.OpenGLLinux.X11Context))
|
||||||
{
|
{
|
||||||
os::Printer::log("Context activation failed.");
|
os::Printer::log("Context activation failed.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
CurrentContext.OpenGLLinux.GLXWindow = videoData.OpenGLLinux.GLXWindow;
|
||||||
CurrentContext.OpenGLLinux.X11Window = videoData.OpenGLLinux.X11Window;
|
CurrentContext.OpenGLLinux.X11Window = videoData.OpenGLLinux.X11Window;
|
||||||
CurrentContext.OpenGLLinux.X11Display = videoData.OpenGLLinux.X11Display;
|
CurrentContext.OpenGLLinux.X11Display = videoData.OpenGLLinux.X11Display;
|
||||||
}
|
}
|
||||||
@ -367,13 +372,14 @@ bool CGLXManager::activateContext(const SExposedVideoData& videoData, bool resto
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// in case we only got a window ID, try with the existing values for display and context
|
// in case we only got a window ID, try with the existing values for display and context
|
||||||
if (!glXMakeCurrent((Display*)PrimaryContext.OpenGLLinux.X11Display, videoData.OpenGLLinux.X11Window, (GLXContext)PrimaryContext.OpenGLLinux.X11Context))
|
if (!glXMakeCurrent((Display*)PrimaryContext.OpenGLLinux.X11Display, videoData.OpenGLLinux.GLXWindow, (GLXContext)PrimaryContext.OpenGLLinux.X11Context))
|
||||||
{
|
{
|
||||||
os::Printer::log("Context activation failed.");
|
os::Printer::log("Context activation failed.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
CurrentContext.OpenGLLinux.GLXWindow = videoData.OpenGLLinux.GLXWindow;
|
||||||
CurrentContext.OpenGLLinux.X11Window = videoData.OpenGLLinux.X11Window;
|
CurrentContext.OpenGLLinux.X11Window = videoData.OpenGLLinux.X11Window;
|
||||||
CurrentContext.OpenGLLinux.X11Display = PrimaryContext.OpenGLLinux.X11Display;
|
CurrentContext.OpenGLLinux.X11Display = PrimaryContext.OpenGLLinux.X11Display;
|
||||||
}
|
}
|
||||||
@ -425,7 +431,7 @@ void CGLXManager::destroyContext()
|
|||||||
|
|
||||||
bool CGLXManager::swapBuffers()
|
bool CGLXManager::swapBuffers()
|
||||||
{
|
{
|
||||||
glXSwapBuffers((Display*)CurrentContext.OpenGLLinux.X11Display, CurrentContext.OpenGLLinux.X11Window);
|
glXSwapBuffers((Display*)CurrentContext.OpenGLLinux.X11Display, CurrentContext.OpenGLLinux.GLXWindow);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -717,7 +717,7 @@ bool CIrrDeviceLinux::createInputContext()
|
|||||||
XGetIMValues(XInputMethod, XNQueryInputStyle, &im_supported_styles, (char*)NULL);
|
XGetIMValues(XInputMethod, XNQueryInputStyle, &im_supported_styles, (char*)NULL);
|
||||||
XIMStyle bestStyle = 0;
|
XIMStyle bestStyle = 0;
|
||||||
// TODO: If we want to support languages like chinese or japanese as well we probably have to work with callbacks here.
|
// TODO: If we want to support languages like chinese or japanese as well we probably have to work with callbacks here.
|
||||||
XIMStyle supportedStyle = XIMPreeditNone | XIMStatusNone;
|
XIMStyle supportedStyle = XIMPreeditNothing | XIMStatusNothing;
|
||||||
for(int i=0; i < im_supported_styles->count_styles; ++i)
|
for(int i=0; i < im_supported_styles->count_styles; ++i)
|
||||||
{
|
{
|
||||||
XIMStyle style = im_supported_styles->supported_styles[i];
|
XIMStyle style = im_supported_styles->supported_styles[i];
|
||||||
@ -783,23 +783,18 @@ EKEY_CODE CIrrDeviceLinux::getKeyCode(XEvent &event)
|
|||||||
}
|
}
|
||||||
if (keyCode == 0)
|
if (keyCode == 0)
|
||||||
{
|
{
|
||||||
// Any value is better than none, that allows at least using the keys.
|
keyCode = KEY_UNKNOWN;
|
||||||
// Worst case is that some keys will be identical, still better than _all_
|
|
||||||
// unknown keys being identical.
|
|
||||||
if ( !mp.X11Key )
|
if ( !mp.X11Key )
|
||||||
{
|
{
|
||||||
keyCode = (EKEY_CODE)event.xkey.keycode;
|
os::Printer::log("No such X11Key, event keycode", core::stringc(event.xkey.keycode).c_str(), ELL_INFORMATION);
|
||||||
os::Printer::log("No such X11Key, using event keycode", core::stringc(event.xkey.keycode).c_str(), ELL_INFORMATION);
|
|
||||||
}
|
}
|
||||||
else if (idx == -1)
|
else if (idx == -1)
|
||||||
{
|
{
|
||||||
keyCode = (EKEY_CODE)mp.X11Key;
|
os::Printer::log("EKEY_CODE not found, X11 keycode", core::stringc(mp.X11Key).c_str(), ELL_INFORMATION);
|
||||||
os::Printer::log("EKEY_CODE not found, using orig. X11 keycode", core::stringc(mp.X11Key).c_str(), ELL_INFORMATION);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
keyCode = (EKEY_CODE)mp.X11Key;
|
os::Printer::log("EKEY_CODE is 0, X11 keycode", core::stringc(mp.X11Key).c_str(), ELL_INFORMATION);
|
||||||
os::Printer::log("EKEY_CODE is 0, using orig. X11 keycode", core::stringc(mp.X11Key).c_str(), ELL_INFORMATION);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return keyCode;
|
return keyCode;
|
||||||
@ -825,6 +820,8 @@ bool CIrrDeviceLinux::run()
|
|||||||
{
|
{
|
||||||
XEvent event;
|
XEvent event;
|
||||||
XNextEvent(XDisplay, &event);
|
XNextEvent(XDisplay, &event);
|
||||||
|
if (XFilterEvent(&event, XWindow))
|
||||||
|
continue;
|
||||||
|
|
||||||
switch (event.type)
|
switch (event.type)
|
||||||
{
|
{
|
||||||
|
@ -821,6 +821,8 @@ void CIrrDeviceMacOSX::setResize(int width, int height)
|
|||||||
{
|
{
|
||||||
NSRect driverFrame = [Window contentRectForFrameRect:[Window frame]];
|
NSRect driverFrame = [Window contentRectForFrameRect:[Window frame]];
|
||||||
getVideoDriver()->OnResize(core::dimension2d<u32>( (s32)driverFrame.size.width, (s32)driverFrame.size.height));
|
getVideoDriver()->OnResize(core::dimension2d<u32>( (s32)driverFrame.size.width, (s32)driverFrame.size.height));
|
||||||
|
DeviceWidth = (s32)driverFrame.size.width;
|
||||||
|
DeviceHeight = (s32)driverFrame.size.height;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
getVideoDriver()->OnResize(core::dimension2d<u32>( (s32)width, (s32)height));
|
getVideoDriver()->OnResize(core::dimension2d<u32>( (s32)width, (s32)height));
|
||||||
|
@ -14,7 +14,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
|
|||||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
|
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
|
||||||
set(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
|
set(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "-g")
|
set(CMAKE_CXX_FLAGS_DEBUG "-g")
|
||||||
set(CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
|
set(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
|
||||||
|
|
||||||
add_compile_options(-Wall -pipe -fno-exceptions -fno-rtti)
|
add_compile_options(-Wall -pipe -fno-exceptions -fno-rtti)
|
||||||
elseif(MSVC)
|
elseif(MSVC)
|
||||||
@ -22,7 +22,7 @@ elseif(MSVC)
|
|||||||
set(CMAKE_CXX_FLAGS_RELEASE "/GL /MT /Ox")
|
set(CMAKE_CXX_FLAGS_RELEASE "/GL /MT /Ox")
|
||||||
set(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
|
set(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "/MTd /RTC1 /Zi")
|
set(CMAKE_CXX_FLAGS_DEBUG "/MTd /RTC1 /Zi")
|
||||||
set(CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})
|
set(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "/Gd /GF /GR- /GS /Gy /Zl")
|
set(CMAKE_CXX_FLAGS "/Gd /GF /GR- /GS /Gy /Zl")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "/nologo")
|
set(CMAKE_EXE_LINKER_FLAGS "/nologo")
|
||||||
@ -41,6 +41,9 @@ link_libraries(${ZLIB_LIBRARY} ${JPEG_LIBRARY} ${PNG_LIBRARY})
|
|||||||
# include/IrrCompileConfig.h and re-run CMake from a clean state
|
# include/IrrCompileConfig.h and re-run CMake from a clean state
|
||||||
include(CheckSymbolExists)
|
include(CheckSymbolExists)
|
||||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_SOURCE_DIR}/include)
|
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_SOURCE_DIR}/include)
|
||||||
|
unset(OGLES1_ENABLED CACHE)
|
||||||
|
unset(OGLES2_ENABLED CACHE)
|
||||||
|
unset(OGL_ENABLED CACHE)
|
||||||
|
|
||||||
check_symbol_exists(_IRR_COMPILE_WITH_OGLES1_ "IrrCompileConfig.h" OGLES1_ENABLED)
|
check_symbol_exists(_IRR_COMPILE_WITH_OGLES1_ "IrrCompileConfig.h" OGLES1_ENABLED)
|
||||||
if(OGLES1_ENABLED)
|
if(OGLES1_ENABLED)
|
||||||
@ -75,6 +78,8 @@ elseif(APPLE)
|
|||||||
find_library(COCOA_LIB Cocoa REQUIRED)
|
find_library(COCOA_LIB Cocoa REQUIRED)
|
||||||
find_library(IOKIT_LIB IOKit REQUIRED)
|
find_library(IOKIT_LIB IOKit REQUIRED)
|
||||||
link_libraries(${COCOA_LIB} ${IOKIT_LIB})
|
link_libraries(${COCOA_LIB} ${IOKIT_LIB})
|
||||||
|
|
||||||
|
add_definitions(-DGL_SILENCE_DEPRECATION)
|
||||||
elseif(WIN32)
|
elseif(WIN32)
|
||||||
link_libraries(gdi32 winmm)
|
link_libraries(gdi32 winmm)
|
||||||
else()
|
else()
|
||||||
@ -383,7 +388,7 @@ add_library(IRRGUIOBJ OBJECT
|
|||||||
|
|
||||||
option(BUILD_SHARED_LIBS "Build shared library" TRUE)
|
option(BUILD_SHARED_LIBS "Build shared library" TRUE)
|
||||||
|
|
||||||
add_library(Irrlicht
|
add_library(IrrlichtMt
|
||||||
$<TARGET_OBJECTS:IRRMESHOBJ>
|
$<TARGET_OBJECTS:IRRMESHOBJ>
|
||||||
$<TARGET_OBJECTS:IRROBJ>
|
$<TARGET_OBJECTS:IRROBJ>
|
||||||
$<TARGET_OBJECTS:IRRPARTICLEOBJ>
|
$<TARGET_OBJECTS:IRRPARTICLEOBJ>
|
||||||
@ -395,12 +400,17 @@ add_library(Irrlicht
|
|||||||
$<TARGET_OBJECTS:IRRGUIOBJ>
|
$<TARGET_OBJECTS:IRRGUIOBJ>
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(Irrlicht PROPERTIES
|
set_target_properties(IrrlichtMt PROPERTIES
|
||||||
VERSION ${VERSION}
|
VERSION ${VERSION}
|
||||||
SOVERSION ${IRRLICHT_VERSION_MAJOR}.${IRRLICHT_VERSION_MINOR}
|
SOVERSION ${IRRLICHT_VERSION_MAJOR}.${IRRLICHT_VERSION_MINOR}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set_target_properties(IrrlichtMt PROPERTIES PREFIX "") # for DLL name
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Installation
|
||||||
|
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
install(TARGETS Irrlicht DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
install(TARGETS IrrlichtMt DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||||
install(DIRECTORY "${CMAKE_SOURCE_DIR}/include/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/irrlicht")
|
install(DIRECTORY "${CMAKE_SOURCE_DIR}/include/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/irrlichtmt")
|
||||||
|
@ -52,14 +52,14 @@ bool CMemoryReadFile::seek(long finalPos, bool relativeMovement)
|
|||||||
{
|
{
|
||||||
if (relativeMovement)
|
if (relativeMovement)
|
||||||
{
|
{
|
||||||
if (Pos + finalPos > Len)
|
if (Pos + finalPos < 0 || Pos + finalPos > Len)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Pos += finalPos;
|
Pos += finalPos;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (finalPos > Len)
|
if (finalPos < 0 || finalPos > Len)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Pos = finalPos;
|
Pos = finalPos;
|
||||||
@ -133,14 +133,14 @@ bool CMemoryWriteFile::seek(long finalPos, bool relativeMovement)
|
|||||||
{
|
{
|
||||||
if (relativeMovement)
|
if (relativeMovement)
|
||||||
{
|
{
|
||||||
if (Pos + finalPos > Len)
|
if (Pos + finalPos < 0 || Pos + finalPos > Len)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Pos += finalPos;
|
Pos += finalPos;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (finalPos > Len)
|
if (finalPos < 0 || finalPos > Len)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Pos = finalPos;
|
Pos = finalPos;
|
||||||
|
@ -1887,8 +1887,6 @@ void COpenGLDriver::draw2DRectangle(const core::rect<s32>& position,
|
|||||||
void COpenGLDriver::draw2DLine(const core::position2d<s32>& start,
|
void COpenGLDriver::draw2DLine(const core::position2d<s32>& start,
|
||||||
const core::position2d<s32>& end, SColor color)
|
const core::position2d<s32>& end, SColor color)
|
||||||
{
|
{
|
||||||
// TODO: It's not pixel-exact. Reason is the way OpenGL handles line-drawing (search the web for "diamond exit rule").
|
|
||||||
|
|
||||||
if (start==end)
|
if (start==end)
|
||||||
drawPixel(start.X, start.Y, color);
|
drawPixel(start.X, start.Y, color);
|
||||||
else
|
else
|
||||||
@ -1923,6 +1921,9 @@ void COpenGLDriver::draw2DLine(const core::position2d<s32>& start,
|
|||||||
}
|
}
|
||||||
|
|
||||||
glDrawElements(GL_LINES, 2, GL_UNSIGNED_SHORT, Quad2DIndices);
|
glDrawElements(GL_LINES, 2, GL_UNSIGNED_SHORT, Quad2DIndices);
|
||||||
|
|
||||||
|
// Draw non-drawn last pixel (search for "diamond exit rule")
|
||||||
|
glDrawArrays(GL_POINTS, 1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user