mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-03 08:40:26 +02:00
Compare commits
159 Commits
Author | SHA1 | Date | |
---|---|---|---|
2c6efbdf06 | |||
510976f130 | |||
b958fdc271 | |||
1387370260 | |||
49b6ccde72 | |||
acbc90a000 | |||
6a2a569233 | |||
1f15fd0805 | |||
81ad195aa3 | |||
13680ef42d | |||
44f7c22bbf | |||
2e477a07d1 | |||
78d0819a2c | |||
df07b3bf99 | |||
523590e16c | |||
8cf02ea27f | |||
efb660e7ed | |||
5f88555ed3 | |||
4ee1ab261e | |||
ab628e641c | |||
1d782702e1 | |||
c4ab49201b | |||
896c825b9e | |||
7a3fc62ada | |||
09043e3da7 | |||
2d81374b34 | |||
aa1696a7e6 | |||
e01f285c8f | |||
5eb607f86f | |||
fc0440ff89 | |||
462657960d | |||
6a152e8629 | |||
718ba69e1b | |||
54314691ec | |||
36a3a7f349 | |||
ca5f005b74 | |||
e850bd102a | |||
a677f5a01a | |||
f5d3448b17 | |||
3a074e4124 | |||
70ee4b05aa | |||
58a96b7d23 | |||
ba1cd19983 | |||
a67f3003de | |||
4dda28450f | |||
219b7fd7d2 | |||
28d0e0644c | |||
d97d1708d6 | |||
799c8b936f | |||
8da1bcf58b | |||
d86abb40c1 | |||
53b9eaa831 | |||
1967d71cfb | |||
c5373262ca | |||
939b3f7bfb | |||
9c2c91776e | |||
6f3435f349 | |||
9f9d22ca33 | |||
edb381bd50 | |||
8ffa7eafea | |||
2bff147904 | |||
3cf75cdce4 | |||
a7f9afd289 | |||
98df6eae77 | |||
3ce4b2b5dc | |||
424eb85f4d | |||
6a9e0f109c | |||
15e3f15b48 | |||
263f243523 | |||
c5ee8c8397 | |||
b0c03b6f3b | |||
679d3a8ba7 | |||
d1f441787a | |||
739a9eaf7c | |||
0acf0de2db | |||
52a0b9d8e5 | |||
0160cdc51d | |||
5a1565072a | |||
25a7074c9a | |||
df8881898d | |||
ba77d01c91 | |||
f641500d01 | |||
02c6449f0d | |||
2331083837 | |||
d84dc18e13 | |||
ea0ca7f917 | |||
82d1feb933 | |||
d81db9dd6d | |||
6c68217426 | |||
21c61e9973 | |||
5a5a7d04b7 | |||
b279810437 | |||
e484698ba2 | |||
5f76be9380 | |||
6de0afa8b3 | |||
1d43ea17ca | |||
a6d062ebd9 | |||
2e9ed529b1 | |||
ceb53be9e3 | |||
df28a4cc46 | |||
8dd8652f5f | |||
2932065346 | |||
1326dfbcb1 | |||
1bbe341daa | |||
d6716ec31b | |||
620f4869a1 | |||
05384fdc5e | |||
48270029cd | |||
c5ce853148 | |||
4fba496917 | |||
79fdab0551 | |||
608aa150ff | |||
1f750cd7b2 | |||
8c521939b9 | |||
cfa8dd7845 | |||
01295c9ce6 | |||
5a95b40a0e | |||
8efd4527f6 | |||
a0e1e39ea7 | |||
d8e09f14bd | |||
67f852be57 | |||
5a2b807890 | |||
06db7b7ab7 | |||
09e6eeb65b | |||
839bdc1a65 | |||
ea297196b7 | |||
38f18eec56 | |||
5527b9f373 | |||
cd3e784534 | |||
51dffc416a | |||
8f13ae81e5 | |||
3de3ff524a | |||
7d3142b969 | |||
a9230e5f49 | |||
b5a6dc0a15 | |||
ce0d29df93 | |||
2ae816b5a6 | |||
61af99adfa | |||
afbe41019c | |||
05a00a8d91 | |||
07fd32da50 | |||
735af8eec6 | |||
29a448de4d | |||
1579ce2740 | |||
b9e0641203 | |||
6f98515f34 | |||
a549d0bfed | |||
a0af653c3d | |||
cac4e62852 | |||
d6766fb8f4 | |||
e46ab74859 | |||
57705d57cf | |||
e9908ca545 | |||
2709c937d9 | |||
59fc4401f1 | |||
f3a1f9f656 | |||
1128d9deab | |||
9b541f2948 | |||
1cf0f3bef0 |
@ -1,3 +1,5 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
|
||||
|
120
.github/workflows/build.yml
vendored
120
.github/workflows/build.yml
vendored
@ -8,13 +8,16 @@ on:
|
||||
jobs:
|
||||
|
||||
linux-gl:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ubuntu:bionic
|
||||
env: { LANG: "C.UTF-8" }
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install g++ cmake libxi-dev libgl1-mesa-dev libpng-dev libjpeg-dev zlib1g-dev -qyy
|
||||
apt-get update
|
||||
apt-get install g++ cmake libxi-dev libgl1-mesa-dev libpng-dev libjpeg-dev zlib1g-dev -qyy
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
@ -26,25 +29,26 @@ jobs:
|
||||
make DESTDIR=$PWD/_install install
|
||||
tar -c -I "gzip -9" -f irrlicht-linux.tar.gz -C ./_install/usr/local .
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: irrlicht-linux
|
||||
path: ./irrlicht-linux.tar.gz
|
||||
|
||||
linux-gles:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ubuntu:bionic
|
||||
env: { LANG: "C.UTF-8" }
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install g++ cmake libxi-dev libgles2-mesa-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
|
||||
apt-get update
|
||||
apt-get install g++ cmake libxi-dev libgles2-mesa-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
sed '/#define _IRR_COMPILE_WITH_OGLES2_/ s|^//||g' -i include/IrrCompileConfig.h
|
||||
sed '/#define _IRR_COMPILE_WITH_OPENGL_/ s|^|//|g' -i include/IrrCompileConfig.h
|
||||
cmake . -DBUILD_EXAMPLES=1
|
||||
cmake . -DBUILD_EXAMPLES=1 -DENABLE_OPENGL=OFF -DENABLE_GLES2=ON
|
||||
make -j2
|
||||
|
||||
- name: Test (headless)
|
||||
@ -55,12 +59,88 @@ jobs:
|
||||
- name: Test (Xvfb)
|
||||
run: |
|
||||
cd bin/Linux
|
||||
LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest
|
||||
LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest ogles2
|
||||
|
||||
linux-sdl:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ubuntu:jammy
|
||||
env: { LANG: "C.UTF-8" }
|
||||
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
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=ON
|
||||
make -j2
|
||||
|
||||
- name: Test (headless)
|
||||
run: |
|
||||
cd bin/Linux
|
||||
./AutomatedTest null
|
||||
|
||||
linux-sdl-gl3:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ubuntu:jammy
|
||||
env: { LANG: "C.UTF-8" }
|
||||
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
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=ON -DENABLE_OPENGL=OFF -DENABLE_OPENGL3=ON
|
||||
make -j2
|
||||
|
||||
- name: Test (headless)
|
||||
run: |
|
||||
cd bin/Linux
|
||||
./AutomatedTest null
|
||||
|
||||
- name: Test (Xvfb)
|
||||
run: |
|
||||
cd bin/Linux
|
||||
LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest opengl3
|
||||
|
||||
linux-sdl-gles2:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ubuntu:jammy
|
||||
env: { LANG: "C.UTF-8" }
|
||||
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
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=ON -DENABLE_OPENGL=OFF -DENABLE_GLES2=ON
|
||||
make -j2
|
||||
|
||||
- name: Test (headless)
|
||||
run: |
|
||||
cd bin/Linux
|
||||
./AutomatedTest null
|
||||
|
||||
- name: Test (Xvfb)
|
||||
run: |
|
||||
cd bin/Linux
|
||||
LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest ogles2
|
||||
|
||||
win32:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install compiler
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install cmake -qyy
|
||||
@ -74,7 +154,7 @@ jobs:
|
||||
CC: i686-w64-mingw32-gcc
|
||||
CXX: i686-w64-mingw32-g++
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: irrlicht-win32
|
||||
path: ./irrlicht-win32.zip
|
||||
@ -82,7 +162,7 @@ jobs:
|
||||
win64:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install compiler
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install cmake -qyy
|
||||
@ -96,15 +176,15 @@ jobs:
|
||||
CC: x86_64-w64-mingw32-gcc
|
||||
CXX: x86_64-w64-mingw32-g++
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: irrlicht-win64
|
||||
path: ./irrlicht-win64.zip
|
||||
|
||||
macos:
|
||||
runs-on: macos-10.15
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install deps
|
||||
run: |
|
||||
brew update
|
||||
@ -173,7 +253,7 @@ jobs:
|
||||
run: move include artifact/
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: msvc-${{ matrix.config.arch }}
|
||||
path: artifact/
|
||||
|
@ -1,13 +1,13 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
# Set policies up to 3.9 since we want to enable the IPO option
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.9)
|
||||
# >=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.9)
|
||||
cmake_policy(VERSION 3.11)
|
||||
endif()
|
||||
|
||||
set(IRRLICHTMT_REVISION 8)
|
||||
set(IRRLICHTMT_REVISION 11)
|
||||
|
||||
project(Irrlicht
|
||||
VERSION 1.9.0.${IRRLICHTMT_REVISION}
|
||||
|
20
README.md
20
README.md
@ -20,6 +20,11 @@ The following libraries are required to be installed:
|
||||
Aside from standard search options (`ZLIB_INCLUDE_DIR`, `ZLIB_LIBRARY`, ...) the following options are available:
|
||||
* `BUILD_SHARED_LIBS` (default: `ON`) - Build IrrlichtMt as a shared library
|
||||
* `BUILD_EXAMPLES` (default: `OFF`) - Build example applications
|
||||
* `ENABLE_OPENGL` - Enable OpenGL driver
|
||||
* `ENABLE_OPENGL3` (default: `OFF`) - Enable OpenGL 3+ driver
|
||||
* `ENABLE_GLES1` - Enable OpenGL ES driver, legacy
|
||||
* `ENABLE_GLES2` - Enable OpenGL ES 2+ driver
|
||||
* `USE_SDL2` (default: `OFF`) - Use SDL2 instead of native platform device
|
||||
|
||||
e.g. on a Linux system you might want to build for local use like this:
|
||||
|
||||
@ -30,6 +35,21 @@ e.g. on a Linux system you might want to build for local use like this:
|
||||
|
||||
This will put an IrrlichtMtTargets.cmake file into the cmake directory in the current build directory, and it can then be imported from another project by pointing `find_package()` to the build directory, or by setting the `CMAKE_PREFIX_PATH` variable to that same path.
|
||||
|
||||
on Windows system:
|
||||
|
||||
It is highly recommended to use vcpkg as package manager.
|
||||
|
||||
After you successfully built vcpkg you can easily install the required libraries:
|
||||
|
||||
vcpkg install zlib libjpeg-turbo libpng opengl-registry --triplet x64-windows
|
||||
|
||||
Run the following script in PowerShell:
|
||||
|
||||
git clone https://github.com/minetest/irrlicht
|
||||
cd irrlicht
|
||||
cmake -B build -G "Visual Studio 17 2022" -A "Win64" -DCMAKE_TOOLCHAIN_FILE=[vcpkg-root]/scripts/buildsystems/vcpkg.cmake -DBUILD_SHARED_LIBS=OFF
|
||||
cmake --build build --config Release
|
||||
|
||||
Platforms
|
||||
---------
|
||||
|
||||
|
5527
changes.txt
5527
changes.txt
File diff suppressed because it is too large
Load Diff
@ -7,17 +7,22 @@ using namespace irr;
|
||||
static IrrlichtDevice *device = nullptr;
|
||||
static int test_fail = 0;
|
||||
|
||||
extern void test_irr_array();
|
||||
void test_irr_array();
|
||||
void test_irr_string();
|
||||
|
||||
static video::E_DRIVER_TYPE chooseDriver(const char *arg_)
|
||||
static video::E_DRIVER_TYPE chooseDriver(core::stringc arg_)
|
||||
{
|
||||
if (core::stringc(arg_) == "null")
|
||||
if (arg_ == "null")
|
||||
return video::EDT_NULL;
|
||||
|
||||
if (IrrlichtDevice::isDriverSupported(video::EDT_OGLES1))
|
||||
if (arg_ == "ogles1")
|
||||
return video::EDT_OGLES1;
|
||||
if (IrrlichtDevice::isDriverSupported(video::EDT_OGLES2))
|
||||
if (arg_ == "ogles2")
|
||||
return video::EDT_OGLES2;
|
||||
if (arg_ == "opengl")
|
||||
return video::EDT_OPENGL;
|
||||
if (arg_ == "opengl3")
|
||||
return video::EDT_OPENGL3;
|
||||
std::cerr << "Unknown driver type: " << arg_.c_str() << ". Trying OpenGL." << std::endl;
|
||||
return video::EDT_OPENGL;
|
||||
}
|
||||
|
||||
@ -32,7 +37,14 @@ static inline void check(bool ok, const char *msg)
|
||||
|
||||
void run_unit_tests() {
|
||||
std::cout << "Running unit tests:" << std::endl;
|
||||
test_irr_array();
|
||||
try {
|
||||
test_irr_array();
|
||||
test_irr_string();
|
||||
} catch (const std::exception &e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
test_fail++;
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@ -75,8 +87,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
const io::path mediaPath = getExampleMediaPath();
|
||||
|
||||
scene::IAnimatedMesh* mesh = smgr->getMesh(mediaPath + "coolguy_opt.x");
|
||||
auto mesh_file = device->getFileSystem()->createAndOpenFile(mediaPath + "coolguy_opt.x");
|
||||
check(mesh_file, "mesh file loading");
|
||||
scene::IAnimatedMesh* mesh = smgr->getMesh(mesh_file);
|
||||
check(mesh, "mesh loading");
|
||||
if (mesh_file)
|
||||
mesh_file->drop();
|
||||
if (mesh)
|
||||
{
|
||||
video::ITexture* tex = driver->getTexture(mediaPath + "cooltexture.png");
|
||||
@ -99,7 +115,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
while (device->run())
|
||||
{
|
||||
if (device->getTimer()->getTime() >= 1300)
|
||||
if (device->getTimer()->getTime() >= 1000)
|
||||
{
|
||||
device->getTimer()->setTime(0);
|
||||
++n;
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "irrArray.h"
|
||||
#include <irrArray.h>
|
||||
#include "test_helper.h"
|
||||
|
||||
using namespace irr;
|
||||
|
195
examples/AutomatedTest/test_string.cpp
Normal file
195
examples/AutomatedTest/test_string.cpp
Normal file
@ -0,0 +1,195 @@
|
||||
#include <irrString.h>
|
||||
#include <cstring>
|
||||
#include <clocale>
|
||||
#include <vector>
|
||||
#include "test_helper.h"
|
||||
|
||||
using namespace irr;
|
||||
using namespace irr::core;
|
||||
|
||||
#define CMPSTR(a, b) (!strcmp(a, b))
|
||||
#define UASSERTSTR(actual, expected) UASSERTCMP(CMPSTR, actual.c_str(), expected)
|
||||
|
||||
static void test_basics()
|
||||
{
|
||||
// ctor
|
||||
stringc s;
|
||||
UASSERTEQ(s.c_str()[0], '\0');
|
||||
s = stringc(0.1234567);
|
||||
UASSERTSTR(s, "0.123457");
|
||||
s = stringc(0x1p+53);
|
||||
UASSERTSTR(s, "9007199254740992.000000");
|
||||
s = stringc(static_cast<int>(-102400));
|
||||
UASSERTSTR(s, "-102400");
|
||||
s = stringc(static_cast<unsigned int>(102400));
|
||||
UASSERTSTR(s, "102400");
|
||||
s = stringc(static_cast<long>(-1024000));
|
||||
UASSERTSTR(s, "-1024000");
|
||||
s = stringc(static_cast<unsigned long>(1024000));
|
||||
UASSERTSTR(s, "1024000");
|
||||
s = stringc("YESno", 3);
|
||||
UASSERTSTR(s, "YES");
|
||||
s = stringc(L"test", 4);
|
||||
UASSERTSTR(s, "test");
|
||||
s = stringc("Hello World!");
|
||||
UASSERTSTR(s, "Hello World!");
|
||||
// operator=
|
||||
s = stringw(L"abcdef");
|
||||
UASSERTSTR(s, "abcdef");
|
||||
s = L"abcdef";
|
||||
UASSERTSTR(s, "abcdef");
|
||||
s = static_cast<const char*>(nullptr);
|
||||
UASSERTSTR(s, "");
|
||||
// operator+
|
||||
s = s + stringc("foo");
|
||||
UASSERTSTR(s, "foo");
|
||||
s = s + L"bar";
|
||||
UASSERTSTR(s, "foobar");
|
||||
// the rest
|
||||
s = "f";
|
||||
UASSERTEQ(s[0], 'f');
|
||||
const auto &sref = s;
|
||||
UASSERTEQ(sref[0], 'f');
|
||||
UASSERT(sref == "f");
|
||||
UASSERT(sref == stringc("f"));
|
||||
s = "a";
|
||||
UASSERT(sref < stringc("aa"));
|
||||
UASSERT(sref < stringc("b"));
|
||||
UASSERT(stringc("Z") < sref);
|
||||
UASSERT(!(sref < stringc("a")));
|
||||
UASSERT(sref.lower_ignore_case("AA"));
|
||||
UASSERT(sref.lower_ignore_case("B"));
|
||||
UASSERT(!sref.lower_ignore_case("A"));
|
||||
s = "dog";
|
||||
UASSERT(sref != "cat");
|
||||
UASSERT(sref != stringc("cat"));
|
||||
}
|
||||
|
||||
static void test_methods()
|
||||
{
|
||||
stringc s;
|
||||
const auto &sref = s;
|
||||
s = "irrlicht";
|
||||
UASSERTEQ(sref.size(), 8);
|
||||
UASSERT(!sref.empty());
|
||||
s.clear();
|
||||
UASSERTEQ(sref.size(), 0);
|
||||
UASSERT(sref.empty());
|
||||
UASSERT(sref[0] == 0);
|
||||
s = "\tAz#`";
|
||||
s.make_lower();
|
||||
UASSERTSTR(s, "\taz#`");
|
||||
s.make_upper();
|
||||
UASSERTSTR(s, "\tAZ#`");
|
||||
UASSERT(sref.equals_ignore_case("\taz#`"));
|
||||
UASSERT(sref.equals_substring_ignore_case("Z#`", 2));
|
||||
s = "irrlicht";
|
||||
UASSERT(sref.equalsn(stringc("irr"), 3));
|
||||
UASSERT(sref.equalsn("irr", 3));
|
||||
s = "fo";
|
||||
s.append('o');
|
||||
UASSERTSTR(s, "foo");
|
||||
s.append("bar", 1);
|
||||
UASSERTSTR(s, "foob");
|
||||
s.append("ar", 999999);
|
||||
UASSERTSTR(s, "foobar");
|
||||
s = "nyan";
|
||||
s.append(stringc("cat"));
|
||||
UASSERTSTR(s, "nyancat");
|
||||
s.append(stringc("sam"), 1);
|
||||
UASSERTSTR(s, "nyancats");
|
||||
s = "fbar";
|
||||
s.insert(1, "ooXX", 2);
|
||||
UASSERTSTR(s, "foobar");
|
||||
UASSERTEQ(sref.findFirst('o'), 1);
|
||||
UASSERTEQ(sref.findFirst('X'), -1);
|
||||
UASSERTEQ(sref.findFirstChar("abff", 2), 3);
|
||||
UASSERTEQ(sref.findFirstCharNotInList("fobb", 2), 3);
|
||||
UASSERTEQ(sref.findLast('o'), 2);
|
||||
UASSERTEQ(sref.findLast('X'), -1);
|
||||
UASSERTEQ(sref.findLastChar("abrr", 2), 4);
|
||||
UASSERTEQ(sref.findLastCharNotInList("rabb", 2), 3);
|
||||
UASSERTEQ(sref.findNext('o', 2), 2);
|
||||
UASSERTEQ(sref.findLast('o', 1), 1);
|
||||
s = "ob-oob";
|
||||
UASSERTEQ(sref.find("ob", 1), 4);
|
||||
UASSERTEQ(sref.find("ob"), 0);
|
||||
UASSERTEQ(sref.find("?"), -1);
|
||||
s = "HOMEOWNER";
|
||||
stringc s2 = sref.subString(2, 4);
|
||||
UASSERTSTR(s2, "MEOW");
|
||||
s2 = sref.subString(2, 4, true);
|
||||
UASSERTSTR(s2, "meow");
|
||||
s = "land";
|
||||
s.replace('l', 's');
|
||||
UASSERTSTR(s, "sand");
|
||||
s = ">dog<";
|
||||
s.replace("dog", "cat");
|
||||
UASSERTSTR(s, ">cat<");
|
||||
s.replace("cat", "horse");
|
||||
UASSERTSTR(s, ">horse<");
|
||||
s.replace("horse", "gnu");
|
||||
UASSERTSTR(s, ">gnu<");
|
||||
s = " h e l p ";
|
||||
s.remove(' ');
|
||||
UASSERTSTR(s, "help");
|
||||
s.remove("el");
|
||||
UASSERTSTR(s, "hp");
|
||||
s = "irrlicht";
|
||||
s.removeChars("it");
|
||||
UASSERTSTR(s, "rrlch");
|
||||
s = "\r\nfoo bar ";
|
||||
s.trim();
|
||||
UASSERTSTR(s, "foo bar");
|
||||
s = "foxo";
|
||||
s.erase(2);
|
||||
UASSERTSTR(s, "foo");
|
||||
s = "a";
|
||||
s.append('\0');
|
||||
s.append('b');
|
||||
UASSERTEQ(s.size(), 3);
|
||||
s.validate();
|
||||
UASSERTEQ(s.size(), 1);
|
||||
UASSERTEQ(s.lastChar(), 'a');
|
||||
std::vector<stringc> res;
|
||||
s = "a,,b,c";
|
||||
s.split(res, ",aa", 1, true, false);
|
||||
UASSERTEQ(res.size(), 3);
|
||||
UASSERTSTR(res[0], "a");
|
||||
UASSERTSTR(res[2], "c");
|
||||
res.clear();
|
||||
s.split(res, ",", 1, false, true);
|
||||
UASSERTEQ(res.size(), 7);
|
||||
UASSERTSTR(res[0], "a");
|
||||
UASSERTSTR(res[2], "");
|
||||
for (int i = 0; i < 3; i++)
|
||||
UASSERTSTR(res[2*i+1], ",");
|
||||
}
|
||||
|
||||
static void test_conv()
|
||||
{
|
||||
// assumes Unicode and UTF-8 locale
|
||||
setlocale(LC_CTYPE, "");
|
||||
|
||||
stringw out;
|
||||
multibyteToWString(out, "†††");
|
||||
UASSERTEQ(out.size(), 3);
|
||||
for (int i = 0; i < 3; i++)
|
||||
UASSERTEQ(static_cast<u16>(out[i]), 0x2020);
|
||||
stringc out2;
|
||||
wStringToMultibyte(out2, L"†††");
|
||||
UASSERTEQ(out2.size(), 9);
|
||||
for (int i = 0; i < 3; i++) {
|
||||
UASSERTEQ(static_cast<u8>(out2[3*i]), 0xe2);
|
||||
UASSERTEQ(static_cast<u8>(out2[3*i+1]), 0x80);
|
||||
UASSERTEQ(static_cast<u8>(out2[3*i+2]), 0xa0);
|
||||
}
|
||||
}
|
||||
|
||||
void test_irr_string()
|
||||
{
|
||||
test_basics();
|
||||
test_methods();
|
||||
test_conv();
|
||||
std::cout << " test_irr_string PASSED" << std::endl;
|
||||
}
|
@ -39,46 +39,46 @@ namespace scene
|
||||
public:
|
||||
core::array<T> Indices;
|
||||
|
||||
virtual u32 stride() const _IRR_OVERRIDE_ {return sizeof(T);}
|
||||
u32 stride() const override {return sizeof(T);}
|
||||
|
||||
virtual u32 size() const _IRR_OVERRIDE_ {return Indices.size();}
|
||||
u32 size() const override {return Indices.size();}
|
||||
|
||||
virtual void push_back(const u32 &element) _IRR_OVERRIDE_
|
||||
void push_back(const u32 &element) override
|
||||
{
|
||||
// push const ref due to compiler problem with gcc 4.6, big endian
|
||||
Indices.push_back((const T&)element);
|
||||
}
|
||||
|
||||
virtual u32 operator [](u32 index) const _IRR_OVERRIDE_
|
||||
u32 operator [](u32 index) const override
|
||||
{
|
||||
return (u32)(Indices[index]);
|
||||
}
|
||||
|
||||
virtual u32 getLast() _IRR_OVERRIDE_ {return (u32)Indices.getLast();}
|
||||
u32 getLast() override {return (u32)Indices.getLast();}
|
||||
|
||||
virtual void setValue(u32 index, u32 value) _IRR_OVERRIDE_
|
||||
void setValue(u32 index, u32 value) override
|
||||
{
|
||||
Indices[index]=(T)value;
|
||||
}
|
||||
|
||||
virtual void set_used(u32 usedNow) _IRR_OVERRIDE_
|
||||
void set_used(u32 usedNow) override
|
||||
{
|
||||
Indices.set_used(usedNow);
|
||||
}
|
||||
|
||||
virtual void reallocate(u32 new_size) _IRR_OVERRIDE_
|
||||
void reallocate(u32 new_size) override
|
||||
{
|
||||
Indices.reallocate(new_size);
|
||||
}
|
||||
|
||||
virtual u32 allocated_size() const _IRR_OVERRIDE_
|
||||
u32 allocated_size() const override
|
||||
{
|
||||
return Indices.allocated_size();
|
||||
}
|
||||
|
||||
virtual void* pointer() _IRR_OVERRIDE_ {return Indices.pointer();}
|
||||
void* pointer() override {return Indices.pointer();}
|
||||
|
||||
virtual video::E_INDEX_TYPE getType() const _IRR_OVERRIDE_
|
||||
video::E_INDEX_TYPE getType() const override
|
||||
{
|
||||
if (sizeof(T)==sizeof(u16))
|
||||
return video::EIT_16BIT;
|
||||
@ -110,7 +110,7 @@ namespace scene
|
||||
}
|
||||
|
||||
//virtual void setType(video::E_INDEX_TYPE IndexType);
|
||||
virtual void setType(video::E_INDEX_TYPE IndexType) _IRR_OVERRIDE_
|
||||
void setType(video::E_INDEX_TYPE IndexType) override
|
||||
{
|
||||
IIndexList *NewIndices=0;
|
||||
|
||||
@ -141,78 +141,78 @@ namespace scene
|
||||
Indices=NewIndices;
|
||||
}
|
||||
|
||||
virtual void* getData() _IRR_OVERRIDE_ {return Indices->pointer();}
|
||||
void* getData() override {return Indices->pointer();}
|
||||
|
||||
virtual video::E_INDEX_TYPE getType() const _IRR_OVERRIDE_ {return Indices->getType();}
|
||||
video::E_INDEX_TYPE getType() const override {return Indices->getType();}
|
||||
|
||||
virtual u32 stride() const _IRR_OVERRIDE_ {return Indices->stride();}
|
||||
u32 stride() const override {return Indices->stride();}
|
||||
|
||||
virtual u32 size() const _IRR_OVERRIDE_
|
||||
u32 size() const override
|
||||
{
|
||||
return Indices->size();
|
||||
}
|
||||
|
||||
virtual void push_back(const u32 &element) _IRR_OVERRIDE_
|
||||
void push_back(const u32 &element) override
|
||||
{
|
||||
Indices->push_back(element);
|
||||
}
|
||||
|
||||
virtual u32 operator [](u32 index) const _IRR_OVERRIDE_
|
||||
u32 operator [](u32 index) const override
|
||||
{
|
||||
return (*Indices)[index];
|
||||
}
|
||||
|
||||
virtual u32 getLast() _IRR_OVERRIDE_
|
||||
u32 getLast() override
|
||||
{
|
||||
return Indices->getLast();
|
||||
}
|
||||
|
||||
virtual void setValue(u32 index, u32 value) _IRR_OVERRIDE_
|
||||
void setValue(u32 index, u32 value) override
|
||||
{
|
||||
Indices->setValue(index, value);
|
||||
}
|
||||
|
||||
virtual void set_used(u32 usedNow) _IRR_OVERRIDE_
|
||||
void set_used(u32 usedNow) override
|
||||
{
|
||||
Indices->set_used(usedNow);
|
||||
}
|
||||
|
||||
virtual void reallocate(u32 new_size) _IRR_OVERRIDE_
|
||||
void reallocate(u32 new_size) override
|
||||
{
|
||||
Indices->reallocate(new_size);
|
||||
}
|
||||
|
||||
virtual u32 allocated_size() const _IRR_OVERRIDE_
|
||||
u32 allocated_size() const override
|
||||
{
|
||||
return Indices->allocated_size();
|
||||
}
|
||||
|
||||
virtual void* pointer() _IRR_OVERRIDE_
|
||||
void* pointer() override
|
||||
{
|
||||
return Indices->pointer();
|
||||
}
|
||||
|
||||
//! get the current hardware mapping hint
|
||||
virtual E_HARDWARE_MAPPING getHardwareMappingHint() const _IRR_OVERRIDE_
|
||||
E_HARDWARE_MAPPING getHardwareMappingHint() const override
|
||||
{
|
||||
return MappingHint;
|
||||
}
|
||||
|
||||
//! set the hardware mapping hint, for driver
|
||||
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) _IRR_OVERRIDE_
|
||||
void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) override
|
||||
{
|
||||
MappingHint=NewMappingHint;
|
||||
}
|
||||
|
||||
//! flags the mesh as changed, reloads hardware buffers
|
||||
virtual void setDirty() _IRR_OVERRIDE_
|
||||
void setDirty() override
|
||||
{
|
||||
++ChangedID;
|
||||
}
|
||||
|
||||
//! Get the currently used ID for identification of changes.
|
||||
/** This shouldn't be used for anything outside the VideoDriver. */
|
||||
virtual u32 getChangedID() const _IRR_OVERRIDE_ {return ChangedID;}
|
||||
u32 getChangedID() const override {return ChangedID;}
|
||||
|
||||
E_HARDWARE_MAPPING MappingHint;
|
||||
u32 ChangedID;
|
||||
|
@ -32,7 +32,7 @@ namespace scene
|
||||
|
||||
//! Get material of this meshbuffer
|
||||
/** \return Material of this buffer */
|
||||
virtual const video::SMaterial& getMaterial() const _IRR_OVERRIDE_
|
||||
const video::SMaterial& getMaterial() const override
|
||||
{
|
||||
return Material;
|
||||
}
|
||||
@ -40,7 +40,7 @@ namespace scene
|
||||
|
||||
//! Get material of this meshbuffer
|
||||
/** \return Material of this buffer */
|
||||
virtual video::SMaterial& getMaterial() _IRR_OVERRIDE_
|
||||
video::SMaterial& getMaterial() override
|
||||
{
|
||||
return Material;
|
||||
}
|
||||
@ -48,7 +48,7 @@ namespace scene
|
||||
|
||||
//! Get pointer to vertices
|
||||
/** \return Pointer to vertices. */
|
||||
virtual const void* getVertices() const _IRR_OVERRIDE_
|
||||
const void* getVertices() const override
|
||||
{
|
||||
return Vertices.const_pointer();
|
||||
}
|
||||
@ -56,7 +56,7 @@ namespace scene
|
||||
|
||||
//! Get pointer to vertices
|
||||
/** \return Pointer to vertices. */
|
||||
virtual void* getVertices() _IRR_OVERRIDE_
|
||||
void* getVertices() override
|
||||
{
|
||||
return Vertices.pointer();
|
||||
}
|
||||
@ -64,21 +64,21 @@ namespace scene
|
||||
|
||||
//! Get number of vertices
|
||||
/** \return Number of vertices. */
|
||||
virtual u32 getVertexCount() const _IRR_OVERRIDE_
|
||||
u32 getVertexCount() const override
|
||||
{
|
||||
return Vertices.size();
|
||||
}
|
||||
|
||||
//! Get type of index data which is stored in this meshbuffer.
|
||||
/** \return Index type of this buffer. */
|
||||
virtual video::E_INDEX_TYPE getIndexType() const _IRR_OVERRIDE_
|
||||
video::E_INDEX_TYPE getIndexType() const override
|
||||
{
|
||||
return video::EIT_16BIT;
|
||||
}
|
||||
|
||||
//! Get pointer to indices
|
||||
/** \return Pointer to indices. */
|
||||
virtual const u16* getIndices() const _IRR_OVERRIDE_
|
||||
const u16* getIndices() const override
|
||||
{
|
||||
return Indices.const_pointer();
|
||||
}
|
||||
@ -86,7 +86,7 @@ namespace scene
|
||||
|
||||
//! Get pointer to indices
|
||||
/** \return Pointer to indices. */
|
||||
virtual u16* getIndices() _IRR_OVERRIDE_
|
||||
u16* getIndices() override
|
||||
{
|
||||
return Indices.pointer();
|
||||
}
|
||||
@ -94,7 +94,7 @@ namespace scene
|
||||
|
||||
//! Get number of indices
|
||||
/** \return Number of indices. */
|
||||
virtual u32 getIndexCount() const _IRR_OVERRIDE_
|
||||
u32 getIndexCount() const override
|
||||
{
|
||||
return Indices.size();
|
||||
}
|
||||
@ -102,7 +102,7 @@ namespace scene
|
||||
|
||||
//! Get the axis aligned bounding box
|
||||
/** \return Axis aligned bounding box of this buffer. */
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_
|
||||
const core::aabbox3d<f32>& getBoundingBox() const override
|
||||
{
|
||||
return BoundingBox;
|
||||
}
|
||||
@ -111,7 +111,7 @@ namespace scene
|
||||
//! Set the axis aligned bounding box
|
||||
/** \param box New axis aligned bounding box for this buffer. */
|
||||
//! set user axis aligned bounding box
|
||||
virtual void setBoundingBox(const core::aabbox3df& box) _IRR_OVERRIDE_
|
||||
void setBoundingBox(const core::aabbox3df& box) override
|
||||
{
|
||||
BoundingBox = box;
|
||||
}
|
||||
@ -119,7 +119,7 @@ namespace scene
|
||||
|
||||
//! Recalculate the bounding box.
|
||||
/** should be called if the mesh changed. */
|
||||
virtual void recalculateBoundingBox() _IRR_OVERRIDE_
|
||||
void recalculateBoundingBox() override
|
||||
{
|
||||
if (!Vertices.empty())
|
||||
{
|
||||
@ -136,43 +136,43 @@ namespace scene
|
||||
|
||||
//! Get type of vertex data stored in this buffer.
|
||||
/** \return Type of vertex data. */
|
||||
virtual video::E_VERTEX_TYPE getVertexType() const _IRR_OVERRIDE_
|
||||
video::E_VERTEX_TYPE getVertexType() const override
|
||||
{
|
||||
return T::getType();
|
||||
}
|
||||
|
||||
//! returns position of vertex i
|
||||
virtual const core::vector3df& getPosition(u32 i) const _IRR_OVERRIDE_
|
||||
const core::vector3df& getPosition(u32 i) const override
|
||||
{
|
||||
return Vertices[i].Pos;
|
||||
}
|
||||
|
||||
//! returns position of vertex i
|
||||
virtual core::vector3df& getPosition(u32 i) _IRR_OVERRIDE_
|
||||
core::vector3df& getPosition(u32 i) override
|
||||
{
|
||||
return Vertices[i].Pos;
|
||||
}
|
||||
|
||||
//! returns normal of vertex i
|
||||
virtual const core::vector3df& getNormal(u32 i) const _IRR_OVERRIDE_
|
||||
const core::vector3df& getNormal(u32 i) const override
|
||||
{
|
||||
return Vertices[i].Normal;
|
||||
}
|
||||
|
||||
//! returns normal of vertex i
|
||||
virtual core::vector3df& getNormal(u32 i) _IRR_OVERRIDE_
|
||||
core::vector3df& getNormal(u32 i) override
|
||||
{
|
||||
return Vertices[i].Normal;
|
||||
}
|
||||
|
||||
//! returns texture coord of vertex i
|
||||
virtual const core::vector2df& getTCoords(u32 i) const _IRR_OVERRIDE_
|
||||
const core::vector2df& getTCoords(u32 i) const override
|
||||
{
|
||||
return Vertices[i].TCoords;
|
||||
}
|
||||
|
||||
//! returns texture coord of vertex i
|
||||
virtual core::vector2df& getTCoords(u32 i) _IRR_OVERRIDE_
|
||||
core::vector2df& getTCoords(u32 i) override
|
||||
{
|
||||
return Vertices[i].TCoords;
|
||||
}
|
||||
@ -183,7 +183,7 @@ namespace scene
|
||||
or the main buffer is of standard type. Otherwise, behavior is
|
||||
undefined.
|
||||
*/
|
||||
virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) _IRR_OVERRIDE_
|
||||
void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) override
|
||||
{
|
||||
if (vertices == getVertices())
|
||||
return;
|
||||
@ -212,7 +212,7 @@ namespace scene
|
||||
undefined.
|
||||
\param other Meshbuffer to be appended to this one.
|
||||
*/
|
||||
virtual void append(const IMeshBuffer* const other) _IRR_OVERRIDE_
|
||||
void append(const IMeshBuffer* const other) override
|
||||
{
|
||||
/*
|
||||
if (this==other)
|
||||
@ -238,19 +238,19 @@ namespace scene
|
||||
|
||||
|
||||
//! get the current hardware mapping hint
|
||||
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const _IRR_OVERRIDE_
|
||||
E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const override
|
||||
{
|
||||
return MappingHint_Vertex;
|
||||
}
|
||||
|
||||
//! get the current hardware mapping hint
|
||||
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const _IRR_OVERRIDE_
|
||||
E_HARDWARE_MAPPING getHardwareMappingHint_Index() const override
|
||||
{
|
||||
return MappingHint_Index;
|
||||
}
|
||||
|
||||
//! set the hardware mapping hint, for driver
|
||||
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX ) _IRR_OVERRIDE_
|
||||
void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX ) override
|
||||
{
|
||||
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX)
|
||||
MappingHint_Vertex=NewMappingHint;
|
||||
@ -259,19 +259,19 @@ namespace scene
|
||||
}
|
||||
|
||||
//! Describe what kind of primitive geometry is used by the meshbuffer
|
||||
virtual void setPrimitiveType(E_PRIMITIVE_TYPE type) _IRR_OVERRIDE_
|
||||
void setPrimitiveType(E_PRIMITIVE_TYPE type) override
|
||||
{
|
||||
PrimitiveType = type;
|
||||
}
|
||||
|
||||
//! Get the kind of primitive geometry which is used by the meshbuffer
|
||||
virtual E_PRIMITIVE_TYPE getPrimitiveType() const _IRR_OVERRIDE_
|
||||
E_PRIMITIVE_TYPE getPrimitiveType() const override
|
||||
{
|
||||
return PrimitiveType;
|
||||
}
|
||||
|
||||
//! flags the mesh as changed, reloads hardware buffers
|
||||
virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_
|
||||
void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX) override
|
||||
{
|
||||
if (Buffer==EBT_VERTEX_AND_INDEX ||Buffer==EBT_VERTEX)
|
||||
++ChangedID_Vertex;
|
||||
@ -281,17 +281,17 @@ namespace scene
|
||||
|
||||
//! Get the currently used ID for identification of changes.
|
||||
/** This shouldn't be used for anything outside the VideoDriver. */
|
||||
virtual u32 getChangedID_Vertex() const _IRR_OVERRIDE_ {return ChangedID_Vertex;}
|
||||
u32 getChangedID_Vertex() const override {return ChangedID_Vertex;}
|
||||
|
||||
//! Get the currently used ID for identification of changes.
|
||||
/** This shouldn't be used for anything outside the VideoDriver. */
|
||||
virtual u32 getChangedID_Index() const _IRR_OVERRIDE_ {return ChangedID_Index;}
|
||||
u32 getChangedID_Index() const override {return ChangedID_Index;}
|
||||
|
||||
virtual void setHWBuffer(void *ptr) const _IRR_OVERRIDE_ {
|
||||
void setHWBuffer(void *ptr) const override {
|
||||
HWBuffer = ptr;
|
||||
}
|
||||
|
||||
virtual void *getHWBuffer() const _IRR_OVERRIDE_ {
|
||||
void *getHWBuffer() const override {
|
||||
return HWBuffer;
|
||||
}
|
||||
|
||||
|
@ -40,33 +40,33 @@ namespace scene
|
||||
public:
|
||||
core::array<T> Vertices;
|
||||
|
||||
virtual u32 stride() const _IRR_OVERRIDE_ {return sizeof(T);}
|
||||
u32 stride() const override {return sizeof(T);}
|
||||
|
||||
virtual u32 size() const _IRR_OVERRIDE_ {return Vertices.size();}
|
||||
u32 size() const override {return Vertices.size();}
|
||||
|
||||
virtual void push_back (const video::S3DVertex &element) _IRR_OVERRIDE_
|
||||
void push_back (const video::S3DVertex &element) override
|
||||
{Vertices.push_back((T&)element);}
|
||||
|
||||
virtual video::S3DVertex& operator [](const u32 index) const _IRR_OVERRIDE_
|
||||
video::S3DVertex& operator [](const u32 index) const override
|
||||
{return (video::S3DVertex&)Vertices[index];}
|
||||
|
||||
virtual video::S3DVertex& getLast() _IRR_OVERRIDE_
|
||||
video::S3DVertex& getLast() override
|
||||
{return (video::S3DVertex&)Vertices.getLast();}
|
||||
|
||||
virtual void set_used(u32 usedNow) _IRR_OVERRIDE_
|
||||
void set_used(u32 usedNow) override
|
||||
{Vertices.set_used(usedNow);}
|
||||
|
||||
virtual void reallocate(u32 new_size) _IRR_OVERRIDE_
|
||||
void reallocate(u32 new_size) override
|
||||
{Vertices.reallocate(new_size);}
|
||||
|
||||
virtual u32 allocated_size() const _IRR_OVERRIDE_
|
||||
u32 allocated_size() const override
|
||||
{
|
||||
return Vertices.allocated_size();
|
||||
}
|
||||
|
||||
virtual video::S3DVertex* pointer() _IRR_OVERRIDE_ {return Vertices.pointer();}
|
||||
video::S3DVertex* pointer() override {return Vertices.pointer();}
|
||||
|
||||
virtual video::E_VERTEX_TYPE getType() const _IRR_OVERRIDE_ {return T::getType();}
|
||||
video::E_VERTEX_TYPE getType() const override {return T::getType();}
|
||||
};
|
||||
|
||||
public:
|
||||
@ -75,18 +75,18 @@ namespace scene
|
||||
CVertexBuffer(video::E_VERTEX_TYPE vertexType) : Vertices(0),
|
||||
MappingHint(EHM_NEVER), ChangedID(1)
|
||||
{
|
||||
setType(vertexType);
|
||||
CVertexBuffer::setType(vertexType);
|
||||
}
|
||||
|
||||
CVertexBuffer(const IVertexBuffer &VertexBufferCopy) :
|
||||
Vertices(0), MappingHint(EHM_NEVER),
|
||||
ChangedID(1)
|
||||
{
|
||||
setType(VertexBufferCopy.getType());
|
||||
reallocate(VertexBufferCopy.size());
|
||||
CVertexBuffer::setType(VertexBufferCopy.getType());
|
||||
CVertexBuffer::reallocate(VertexBufferCopy.size());
|
||||
|
||||
for (u32 n=0;n<VertexBufferCopy.size();++n)
|
||||
push_back(VertexBufferCopy[n]);
|
||||
CVertexBuffer::push_back(VertexBufferCopy[n]);
|
||||
}
|
||||
|
||||
virtual ~CVertexBuffer()
|
||||
@ -95,8 +95,11 @@ namespace scene
|
||||
}
|
||||
|
||||
|
||||
virtual void setType(video::E_VERTEX_TYPE vertexType) _IRR_OVERRIDE_
|
||||
void setType(video::E_VERTEX_TYPE vertexType) override
|
||||
{
|
||||
if ( Vertices && Vertices->getType() == vertexType )
|
||||
return;
|
||||
|
||||
IVertexList *NewVertices=0;
|
||||
|
||||
switch (vertexType)
|
||||
@ -130,73 +133,73 @@ namespace scene
|
||||
Vertices=NewVertices;
|
||||
}
|
||||
|
||||
virtual void* getData() _IRR_OVERRIDE_ {return Vertices->pointer();}
|
||||
void* getData() override {return Vertices->pointer();}
|
||||
|
||||
virtual video::E_VERTEX_TYPE getType() const _IRR_OVERRIDE_ {return Vertices->getType();}
|
||||
video::E_VERTEX_TYPE getType() const override {return Vertices->getType();}
|
||||
|
||||
virtual u32 stride() const _IRR_OVERRIDE_ {return Vertices->stride();}
|
||||
u32 stride() const override {return Vertices->stride();}
|
||||
|
||||
virtual u32 size() const _IRR_OVERRIDE_
|
||||
u32 size() const override
|
||||
{
|
||||
return Vertices->size();
|
||||
}
|
||||
|
||||
virtual void push_back (const video::S3DVertex &element) _IRR_OVERRIDE_
|
||||
void push_back (const video::S3DVertex &element) override
|
||||
{
|
||||
Vertices->push_back(element);
|
||||
}
|
||||
|
||||
virtual video::S3DVertex& operator [](const u32 index) const _IRR_OVERRIDE_
|
||||
video::S3DVertex& operator [](const u32 index) const override
|
||||
{
|
||||
return (*Vertices)[index];
|
||||
}
|
||||
|
||||
virtual video::S3DVertex& getLast() _IRR_OVERRIDE_
|
||||
video::S3DVertex& getLast() override
|
||||
{
|
||||
return Vertices->getLast();
|
||||
}
|
||||
|
||||
virtual void set_used(u32 usedNow) _IRR_OVERRIDE_
|
||||
void set_used(u32 usedNow) override
|
||||
{
|
||||
Vertices->set_used(usedNow);
|
||||
}
|
||||
|
||||
virtual void reallocate(u32 new_size) _IRR_OVERRIDE_
|
||||
void reallocate(u32 new_size) override
|
||||
{
|
||||
Vertices->reallocate(new_size);
|
||||
}
|
||||
|
||||
virtual u32 allocated_size() const _IRR_OVERRIDE_
|
||||
u32 allocated_size() const override
|
||||
{
|
||||
return Vertices->allocated_size();
|
||||
}
|
||||
|
||||
virtual video::S3DVertex* pointer() _IRR_OVERRIDE_
|
||||
video::S3DVertex* pointer() override
|
||||
{
|
||||
return Vertices->pointer();
|
||||
}
|
||||
|
||||
//! get the current hardware mapping hint
|
||||
virtual E_HARDWARE_MAPPING getHardwareMappingHint() const _IRR_OVERRIDE_
|
||||
E_HARDWARE_MAPPING getHardwareMappingHint() const override
|
||||
{
|
||||
return MappingHint;
|
||||
}
|
||||
|
||||
//! set the hardware mapping hint, for driver
|
||||
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) _IRR_OVERRIDE_
|
||||
void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint ) override
|
||||
{
|
||||
MappingHint=NewMappingHint;
|
||||
}
|
||||
|
||||
//! flags the mesh as changed, reloads hardware buffers
|
||||
virtual void setDirty() _IRR_OVERRIDE_
|
||||
void setDirty() override
|
||||
{
|
||||
++ChangedID;
|
||||
}
|
||||
|
||||
//! Get the currently used ID for identification of changes.
|
||||
/** This shouldn't be used for anything outside the VideoDriver. */
|
||||
virtual u32 getChangedID() const _IRR_OVERRIDE_ {return ChangedID;}
|
||||
u32 getChangedID() const override {return ChangedID;}
|
||||
|
||||
E_HARDWARE_MAPPING MappingHint;
|
||||
u32 ChangedID;
|
||||
|
@ -24,14 +24,10 @@ namespace irr
|
||||
//! A device native to Mac OSX
|
||||
/** This device uses Apple's Cocoa API and works in Mac OSX 10.2 and above. */
|
||||
EIDT_OSX,
|
||||
|
||||
//! A device native to the iOS
|
||||
/** This device should be used with the OpenGL-ES driver. */
|
||||
EIDT_IOS,
|
||||
|
||||
//! A device which uses Simple DirectMedia Layer
|
||||
/** The SDL device works under all platforms supported by SDL but first must be compiled
|
||||
in by defining the _IRR_COMPILE_WITH_SDL_DEVICE_ macro in IrrCompileConfig.h */
|
||||
in by setting the USE_SDL2 CMake option to ON */
|
||||
EIDT_SDL,
|
||||
|
||||
//! This selection allows Irrlicht to choose the best device from the ones available.
|
||||
|
@ -20,31 +20,11 @@ namespace video
|
||||
render and display any graphics. */
|
||||
EDT_NULL,
|
||||
|
||||
//! The Irrlicht Engine Software renderer.
|
||||
/** Runs on all platforms, with every hardware. It should only
|
||||
be used for 2d graphics, but it can also perform some primitive
|
||||
3d functions. These 3d drawing functions are quite fast, but
|
||||
very inaccurate, and don't even support clipping in 3D mode. */
|
||||
// obsolete constants to make some code happy
|
||||
// TODO delete
|
||||
EDT_SOFTWARE,
|
||||
|
||||
//! The Burning's Software Renderer, an alternative software renderer
|
||||
/** Basically it can be described as the Irrlicht Software
|
||||
renderer on steroids. It rasterizes 3D geometry perfectly: It
|
||||
is able to perform correct 3d clipping, perspective correct
|
||||
texture mapping, perspective correct color mapping, and renders
|
||||
sub pixel correct, sub texel correct primitives. In addition,
|
||||
it does bilinear texel filtering and supports more materials
|
||||
than the EDT_SOFTWARE driver. This renderer has been written
|
||||
entirely by Thomas Alten, thanks a lot for this huge
|
||||
contribution. */
|
||||
EDT_BURNINGSVIDEO,
|
||||
|
||||
//! Direct3D8 device is longer supported in Irrlicht. You have to go back to Irrlicht 1.8 if you still need that.
|
||||
DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS, // keep enum to avoid breaking enumeration order (might be used in ini-files, serialization, etc)
|
||||
|
||||
//! Direct3D 9 device, only available on Win32 platforms.
|
||||
/** Performs hardware accelerated rendering of 3D and 2D
|
||||
primitives. */
|
||||
DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS,
|
||||
EDT_DIRECT3D9,
|
||||
|
||||
//! OpenGL device, available on most platforms.
|
||||
@ -52,7 +32,7 @@ namespace video
|
||||
primitives. */
|
||||
EDT_OPENGL,
|
||||
|
||||
//! OpenGL-ES 1.x driver, for embedded and mobile systems
|
||||
//! OpenGL-ES 1.x driver, for embedded and mobile systems
|
||||
EDT_OGLES1,
|
||||
|
||||
//! OpenGL-ES 2.x driver, for embedded and mobile systems
|
||||
@ -62,38 +42,12 @@ namespace video
|
||||
//! WebGL1 friendly subset of OpenGL-ES 2.x driver for Emscripten
|
||||
EDT_WEBGL1,
|
||||
|
||||
EDT_OPENGL3,
|
||||
|
||||
//! No driver, just for counting the elements
|
||||
EDT_COUNT
|
||||
};
|
||||
|
||||
const c8* const DRIVER_TYPE_NAMES[] =
|
||||
{
|
||||
"NullDriver",
|
||||
"Software Renderer",
|
||||
"Burning's Video",
|
||||
"Direct3D 8.1",
|
||||
"Direct3D 9.0c",
|
||||
"OpenGL 1.x/2.x/3.x",
|
||||
"OpenGL ES1",
|
||||
"OpenGL ES2",
|
||||
"WebGL 1",
|
||||
0
|
||||
};
|
||||
|
||||
const c8* const DRIVER_TYPE_NAMES_SHORT[] =
|
||||
{
|
||||
"null",
|
||||
"software",
|
||||
"burning",
|
||||
"d3d8",
|
||||
"d3d9",
|
||||
"opengl",
|
||||
"ogles1",
|
||||
"ogles2",
|
||||
"webgl1",
|
||||
0
|
||||
};
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
||||
|
@ -91,9 +91,6 @@ enum EGUI_ELEMENT_TYPE
|
||||
//! The root of the GUI
|
||||
EGUIET_ROOT,
|
||||
|
||||
//! IGUIProfiler
|
||||
EGUIET_PROFILER,
|
||||
|
||||
//! Not an element, amount of elements in there
|
||||
EGUIET_COUNT,
|
||||
|
||||
|
@ -61,7 +61,7 @@ namespace scene
|
||||
if getMeshType() returns EAMT_MD2 it's safe to cast the
|
||||
IAnimatedMesh to IAnimatedMeshMD2.
|
||||
\returns Type of the mesh. */
|
||||
virtual E_ANIMATED_MESH_TYPE getMeshType() const _IRR_OVERRIDE_
|
||||
E_ANIMATED_MESH_TYPE getMeshType() const override
|
||||
{
|
||||
return EAMT_UNKNOWN;
|
||||
}
|
||||
|
@ -74,17 +74,17 @@ namespace scene
|
||||
virtual E_BONE_ANIMATION_MODE getAnimationMode() const = 0;
|
||||
|
||||
//! Get the axis aligned bounding box of this node
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_ = 0;
|
||||
const core::aabbox3d<f32>& getBoundingBox() const override = 0;
|
||||
|
||||
//! Returns the relative transformation of the scene node.
|
||||
//virtual core::matrix4 getRelativeTransformation() const = 0;
|
||||
|
||||
//! The animation method.
|
||||
virtual void OnAnimate(u32 timeMs) _IRR_OVERRIDE_ =0;
|
||||
void OnAnimate(u32 timeMs) override =0;
|
||||
|
||||
//! The render method.
|
||||
/** Does nothing as bones are not visible. */
|
||||
virtual void render() _IRR_OVERRIDE_ { }
|
||||
void render() override { }
|
||||
|
||||
//! How the relative transformation of the bone is used
|
||||
virtual void setSkinningSpace( E_BONE_SKINNING_SPACE space ) =0;
|
||||
|
@ -72,7 +72,7 @@ namespace scene
|
||||
ISceneManager::addCameraSceneNodeFPS, may want to get
|
||||
this input for changing their position, look at target or
|
||||
whatever. */
|
||||
virtual bool OnEvent(const SEvent& event) _IRR_OVERRIDE_ =0;
|
||||
bool OnEvent(const SEvent& event) override =0;
|
||||
|
||||
//! Sets the look at target of the camera
|
||||
/** If the camera's target and rotation are bound ( @see
|
||||
@ -90,7 +90,7 @@ namespace scene
|
||||
bindTargetAndRotation() ) then calling this will also change
|
||||
the camera's target to match the rotation.
|
||||
\param rotation New rotation of the node in degrees. */
|
||||
virtual void setRotation(const core::vector3df& rotation) _IRR_OVERRIDE_ =0;
|
||||
void setRotation(const core::vector3df& rotation) override =0;
|
||||
|
||||
//! Gets the current look at target of the camera
|
||||
/** \return The current look at target of the camera, in world co-ordinates */
|
||||
|
@ -160,6 +160,9 @@ namespace gui
|
||||
\param rect: A pointer to an reference rectangle or 0 to disable the reference rectangle.*/
|
||||
virtual void setReferenceRect(core::rect<s32>* rect=0) = 0;
|
||||
|
||||
//! Internally fixes the mouse position, and reports relative mouse movement compared to the old position
|
||||
/** Specific to SDL */
|
||||
virtual void setRelativeMode(bool relative) {};
|
||||
|
||||
//! Sets the active cursor icon
|
||||
/** Setting cursor icons is so far only supported on Win32 and Linux */
|
||||
|
@ -452,10 +452,10 @@ struct SEvent
|
||||
/** Unlike other events, joystick events represent the result of polling
|
||||
* each connected joystick once per run() of the device. Joystick events will
|
||||
* not be generated by default. If joystick support is available for the
|
||||
* active device, _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ is defined, and
|
||||
* @ref irr::IrrlichtDevice::activateJoysticks() has been called, an event of
|
||||
* this type will be generated once per joystick per @ref IrrlichtDevice::run()
|
||||
* regardless of whether the state of the joystick has actually changed. */
|
||||
* active device, and @ref irr::IrrlichtDevice::activateJoysticks() has been
|
||||
* called, an event of this type will be generated once per joystick per
|
||||
* @ref IrrlichtDevice::run() regardless of whether the state of the joystick
|
||||
* has actually changed. */
|
||||
struct SJoystickEvent
|
||||
{
|
||||
enum
|
||||
|
@ -54,9 +54,9 @@ namespace gui
|
||||
|
||||
//! Sets text justification of the text area
|
||||
/** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
|
||||
EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.
|
||||
EGUIA_LOWERRIGHT for right justified, or EGUIA_CENTER for centered text.
|
||||
\param vertical: EGUIA_UPPERLEFT to align with top edge,
|
||||
EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */
|
||||
EGUIA_LOWERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */
|
||||
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0;
|
||||
|
||||
//! Set the maximal number of rows for the selection listbox
|
||||
|
@ -433,7 +433,7 @@ public:
|
||||
if (el)
|
||||
{
|
||||
// find the highest element number
|
||||
el->getNextElement(-1, true, IsTabGroup, first, closest, true);
|
||||
el->getNextElement(-1, true, IsTabGroup, first, closest, true, true);
|
||||
if (first)
|
||||
{
|
||||
TabOrder = first->getTabOrder() + 1;
|
||||
@ -545,7 +545,7 @@ public:
|
||||
|
||||
|
||||
//! Called if an event happened.
|
||||
virtual bool OnEvent(const SEvent& event) _IRR_OVERRIDE_
|
||||
bool OnEvent(const SEvent& event) override
|
||||
{
|
||||
return Parent ? Parent->OnEvent(event) : false;
|
||||
}
|
||||
@ -706,7 +706,7 @@ public:
|
||||
}
|
||||
}
|
||||
// search within children
|
||||
if ((*it)->getNextElement(startOrder, reverse, group, first, closest))
|
||||
if ((*it)->getNextElement(startOrder, reverse, group, first, closest, includeInvisible, includeDisabled))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ class IGUIFontBitmap : public IGUIFont
|
||||
public:
|
||||
|
||||
//! Returns the type of this font
|
||||
virtual EGUI_FONT_TYPE getType() const _IRR_OVERRIDE_ { return EGFT_BITMAP; }
|
||||
EGUI_FONT_TYPE getType() const override { return EGFT_BITMAP; }
|
||||
|
||||
//! returns the parsed Symbol Information
|
||||
virtual IGUISpriteBank* getSpriteBank() const = 0;
|
||||
@ -36,7 +36,7 @@ public:
|
||||
kerning value. For example, EGFT_BITMAP will add the right kerning value of previousLetter to the
|
||||
left side kerning value of thisLetter, then add the global value.
|
||||
*/
|
||||
virtual s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) const _IRR_OVERRIDE_ = 0;
|
||||
s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) const override = 0;
|
||||
};
|
||||
|
||||
} // end namespace gui
|
||||
|
@ -88,9 +88,9 @@ namespace gui
|
||||
|
||||
//! Sets text justification mode
|
||||
/** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
|
||||
EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.
|
||||
EGUIA_LOWERRIGHT for right justified, or EGUIA_CENTER for centered text.
|
||||
\param vertical: EGUIA_UPPERLEFT to align with top edge (default),
|
||||
EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text. */
|
||||
EGUIA_LOWERRIGHT for bottom edge, or EGUIA_CENTER for centered text. */
|
||||
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0;
|
||||
|
||||
//! Enables or disables word wrap for using the static text as multiline text control.
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "position2d.h"
|
||||
#include "rect.h"
|
||||
#include "SColor.h"
|
||||
#include "irrAllocator.h"
|
||||
#include <string.h>
|
||||
|
||||
namespace irr
|
||||
@ -44,7 +43,7 @@ public:
|
||||
delete[] Data;
|
||||
|
||||
if (DeleteMipMapsMemory)
|
||||
Allocator.deallocate(MipMapsData);
|
||||
delete[] MipMapsData;
|
||||
}
|
||||
|
||||
//! Returns the color format
|
||||
@ -275,13 +274,13 @@ public:
|
||||
will by copied internally.
|
||||
\param deleteMemory Whether the memory is deallocated upon
|
||||
destruction. */
|
||||
void setMipMapsData(void* data, bool ownForeignMemory, bool deleteMemory)
|
||||
void setMipMapsData(void* data, bool ownForeignMemory)
|
||||
{
|
||||
if (data != MipMapsData)
|
||||
{
|
||||
if (DeleteMipMapsMemory)
|
||||
{
|
||||
Allocator.deallocate(MipMapsData);
|
||||
delete[] MipMapsData;
|
||||
|
||||
DeleteMipMapsMemory = false;
|
||||
}
|
||||
@ -292,7 +291,7 @@ public:
|
||||
{
|
||||
MipMapsData = static_cast<u8*>(data);
|
||||
|
||||
DeleteMipMapsMemory = deleteMemory;
|
||||
DeleteMipMapsMemory = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -311,7 +310,7 @@ public:
|
||||
dataSize += getDataSizeFromFormat(Format, width, height);
|
||||
} while (width != 1 || height != 1);
|
||||
|
||||
MipMapsData = Allocator.allocate(dataSize);
|
||||
MipMapsData = new u8[dataSize];
|
||||
memcpy(MipMapsData, data, dataSize);
|
||||
|
||||
DeleteMipMapsMemory = true;
|
||||
@ -330,6 +329,12 @@ public:
|
||||
//! Sets a pixel
|
||||
virtual void setPixel(u32 x, u32 y, const SColor &color, bool blend = false ) = 0;
|
||||
|
||||
//! Copies this surface into another, if it has the exact same size and format.
|
||||
/** NOTE: mipmaps are ignored
|
||||
\return True if it was copied, false otherwise.
|
||||
*/
|
||||
virtual bool copyToNoScaling(void *target, u32 width, u32 height, ECOLOR_FORMAT format=ECF_A8R8G8B8, u32 pitch=0) const = 0;
|
||||
|
||||
//! Copies the image into the target, scaling the image to fit
|
||||
/** NOTE: mipmaps are ignored */
|
||||
virtual void copyToScaling(void* target, u32 width, u32 height, ECOLOR_FORMAT format=ECF_A8R8G8B8, u32 pitch=0) =0;
|
||||
@ -578,7 +583,6 @@ protected:
|
||||
bool DeleteMemory;
|
||||
bool DeleteMipMapsMemory;
|
||||
|
||||
core::irrAllocator<u8> Allocator;
|
||||
#if defined(IRRLICHT_sRGB)
|
||||
int Format_sRGB;
|
||||
#endif
|
||||
|
@ -45,17 +45,6 @@ public:
|
||||
/** \param file File handle to check.
|
||||
\return Pointer to newly created image, or 0 upon error. */
|
||||
virtual IImage* loadImage(io::IReadFile* file) const = 0;
|
||||
|
||||
//! Creates a multiple surfaces from the file eg. whole cube map.
|
||||
/** \param file File handle to check.
|
||||
\param type Pointer to E_TEXTURE_TYPE where a recommended type of the texture will be stored.
|
||||
\return Array of pointers to newly created images. */
|
||||
virtual core::array<IImage*> loadImages(io::IReadFile* file, E_TEXTURE_TYPE* type) const
|
||||
{
|
||||
core::array<IImage*> image;
|
||||
|
||||
return image;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -26,12 +26,23 @@ public:
|
||||
}
|
||||
|
||||
//! Copies text to the clipboard
|
||||
//! \param text: text in utf-8
|
||||
virtual void copyToClipboard(const c8* text) const = 0;
|
||||
|
||||
//! Copies text to the primary selection
|
||||
//! This is a no-op on some platforms.
|
||||
//! \param text: text in utf-8
|
||||
virtual void copyToPrimarySelection(const c8* text) const = 0;
|
||||
|
||||
//! Get text from the clipboard
|
||||
/** \return Returns 0 if no string is in there. */
|
||||
//! \return Returns 0 if no string is in there, otherwise an utf-8 string.
|
||||
virtual const c8* getTextFromClipboard() const = 0;
|
||||
|
||||
//! Get text from the primary selection
|
||||
//! This is a no-op on some platforms.
|
||||
//! \return Returns 0 if no string is in there, otherwise an utf-8 string.
|
||||
virtual const c8* getTextFromPrimarySelection() const = 0;
|
||||
|
||||
//! Get the total and available system RAM
|
||||
/** \param totalBytes: will contain the total system memory in Kilobytes (1024 B)
|
||||
\param availableBytes: will contain the available memory in Kilobytes (1024 B)
|
||||
|
@ -1,480 +0,0 @@
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
// Written by Michael Zeilfelder
|
||||
|
||||
#ifndef __I_PROFILER_H_INCLUDED__
|
||||
#define __I_PROFILER_H_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
#include "irrString.h"
|
||||
#include "irrArray.h"
|
||||
#include "ITimer.h"
|
||||
#include <limits.h> // for INT_MAX (we should have a S32_MAX...)
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
class ITimer;
|
||||
|
||||
//! Used to store the profile data (and also used for profile group data).
|
||||
struct SProfileData
|
||||
{
|
||||
friend class IProfiler;
|
||||
|
||||
SProfileData()
|
||||
{
|
||||
GroupIndex = 0;
|
||||
reset();
|
||||
}
|
||||
|
||||
bool operator<(const SProfileData& pd) const
|
||||
{
|
||||
return Id < pd.Id;
|
||||
}
|
||||
|
||||
bool operator==(const SProfileData& pd) const
|
||||
{
|
||||
return Id == pd.Id;
|
||||
}
|
||||
|
||||
u32 getGroupIndex() const
|
||||
{
|
||||
return GroupIndex;
|
||||
}
|
||||
|
||||
const core::stringw& getName() const
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
|
||||
//! Each time profiling for this data is stopped it increases the counter by 1.
|
||||
u32 getCallsCounter() const
|
||||
{
|
||||
return CountCalls;
|
||||
}
|
||||
|
||||
//! Longest time a profile call for this id took from start until it was stopped again.
|
||||
u32 getLongestTime() const
|
||||
{
|
||||
return LongestTime;
|
||||
}
|
||||
|
||||
//! Time spend between start/stop
|
||||
u32 getTimeSum() const
|
||||
{
|
||||
return TimeSum;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// just to be used for searching as it does no initialization besides id
|
||||
SProfileData(u32 id) : Id(id) {}
|
||||
|
||||
void reset()
|
||||
{
|
||||
CountCalls = 0;
|
||||
LongestTime = 0;
|
||||
TimeSum = 0;
|
||||
LastTimeStarted = 0;
|
||||
StartStopCounter = 0;
|
||||
}
|
||||
|
||||
s32 Id;
|
||||
u32 GroupIndex;
|
||||
core::stringw Name;
|
||||
|
||||
s32 StartStopCounter; // 0 means stopped > 0 means it runs.
|
||||
u32 CountCalls;
|
||||
u32 LongestTime;
|
||||
u32 TimeSum;
|
||||
|
||||
u32 LastTimeStarted;
|
||||
};
|
||||
|
||||
//! Code-profiler. Please check the example in the Irrlicht examples folder about how to use it.
|
||||
// Implementer notes:
|
||||
// The design is all about allowing to use the central start/stop mechanism with minimal time overhead.
|
||||
// This is why the class works without a virtual functions interface contrary to the usual Irrlicht design.
|
||||
// And also why it works with id's instead of strings in the start/stop functions even if it makes using
|
||||
// the class slightly harder.
|
||||
// The class comes without reference-counting because the profiler instance is never released (TBD).
|
||||
class IProfiler
|
||||
{
|
||||
public:
|
||||
//! Constructor. You could use this to create a new profiler, but usually getProfiler() is used to access the global instance.
|
||||
IProfiler() : Timer(0), NextAutoId(INT_MAX)
|
||||
{}
|
||||
|
||||
virtual ~IProfiler()
|
||||
{}
|
||||
|
||||
//! Add an id with given name and group which can be used for profiling with start/stop
|
||||
/** After calling this once you can start/stop profiling for the given id.
|
||||
\param id: Should be >= 0 as negative id's are reserved for Irrlicht. Also very large numbers (near INT_MAX) might
|
||||
have been added automatically by the other add function.
|
||||
\param name: Name for displaying profile data.
|
||||
\param groupName: Each id belongs into a group - this helps on displaying profile data. */
|
||||
inline void add(s32 id, const core::stringw &name, const core::stringw &groupName);
|
||||
|
||||
//! Add an automatically generated for the given name and group which can be used for profiling with start/stop.
|
||||
/** After calling this once you can start/stop profiling with the returned id.
|
||||
\param name: Name for displaying profile data.
|
||||
\param groupName: Each id belongs into a group - this helps on displaying profile data.
|
||||
\return Automatic id's start at INT_MAX and count down for each new id. If the name already has an id then that id will be returned. */
|
||||
inline s32 add(const core::stringw &name, const core::stringw &groupName);
|
||||
|
||||
//! Return the number of profile data blocks. There is one for each id.
|
||||
u32 getProfileDataCount() const
|
||||
{
|
||||
return ProfileDatas.size();
|
||||
}
|
||||
|
||||
//! Search for the index of the profile data by name
|
||||
/** \param result Receives the resulting data index when one was found.
|
||||
\param name String with name to search for
|
||||
\return true when found, false when not found */
|
||||
inline bool findDataIndex(u32 & result, const core::stringw &name) const;
|
||||
|
||||
//! Get the profile data
|
||||
/** \param index A value between 0 and getProfileDataCount()-1. Indices can change when new id's are added.*/
|
||||
const SProfileData& getProfileDataByIndex(u32 index) const
|
||||
{
|
||||
return ProfileDatas[index];
|
||||
}
|
||||
|
||||
//! Get the profile data
|
||||
/** \param id Same value as used in ::add
|
||||
\return Profile data for the given id or 0 when it does not exist. */
|
||||
inline const SProfileData* getProfileDataById(u32 id);
|
||||
|
||||
//! Get the number of profile groups. Will be at least 1.
|
||||
/** NOTE: The first groups is always L"overview" which is an overview for all existing groups */
|
||||
inline u32 getGroupCount() const
|
||||
{
|
||||
return ProfileGroups.size();
|
||||
}
|
||||
|
||||
//! Get profile data for a group.
|
||||
/** NOTE: The first groups is always L"overview" which is an overview for all existing groups */
|
||||
inline const SProfileData& getGroupData(u32 index) const
|
||||
{
|
||||
return ProfileGroups[index];
|
||||
}
|
||||
|
||||
//! Find the group index by the group-name
|
||||
/** \param result Receives the resulting group index when one was found.
|
||||
\param name String with name to search for
|
||||
\return true when found, false when not found */
|
||||
inline bool findGroupIndex(u32 & result, const core::stringw &name) const;
|
||||
|
||||
|
||||
//! Start profile-timing for the given id
|
||||
/** This increases an internal run-counter for the given id. It will profile as long as that counter is > 0.
|
||||
NOTE: you have to add the id first with one of the ::add functions
|
||||
*/
|
||||
inline void start(s32 id);
|
||||
|
||||
//! Stop profile-timing for the given id
|
||||
/** This increases an internal run-counter for the given id. If it reaches 0 the time since start is recorded.
|
||||
You should have the same amount of start and stop calls. If stop is called more often than start
|
||||
then the additional stop calls will be ignored (counter never goes below 0)
|
||||
*/
|
||||
inline void stop(s32 id);
|
||||
|
||||
//! Reset profile data for the given id
|
||||
inline void resetDataById(s32 id);
|
||||
|
||||
//! Reset profile data for the given index
|
||||
inline void resetDataByIndex(u32 index);
|
||||
|
||||
//! Reset profile data for a whole group
|
||||
inline void resetGroup(u32 index);
|
||||
|
||||
//! Reset all profile data
|
||||
/** NOTE: This is not deleting id's or groups, just resetting all timers to 0. */
|
||||
inline void resetAll();
|
||||
|
||||
//! Write all profile-data into a string
|
||||
/** \param result Receives the result string.
|
||||
\param includeOverview When true a group-overview is attached first
|
||||
\param suppressUncalled When true elements which got never called are not printed */
|
||||
virtual void printAll(core::stringw &result, bool includeOverview=false,bool suppressUncalled=true) const = 0;
|
||||
|
||||
//! Write the profile data of one group into a string
|
||||
/** \param result Receives the result string.
|
||||
\param groupIndex_ */
|
||||
virtual void printGroup(core::stringw &result, u32 groupIndex, bool suppressUncalled) const = 0;
|
||||
|
||||
protected:
|
||||
|
||||
inline u32 addGroup(const core::stringw &name);
|
||||
|
||||
// I would prefer using os::Timer, but os.h is not in the public interface so far.
|
||||
// Timer must be initialized by the implementation.
|
||||
ITimer * Timer;
|
||||
core::array<SProfileData> ProfileDatas;
|
||||
core::array<SProfileData> ProfileGroups;
|
||||
|
||||
private:
|
||||
s32 NextAutoId; // for giving out id's automatically
|
||||
};
|
||||
|
||||
//! Access the Irrlicht profiler object.
|
||||
/** Profiler is always accessible, except in destruction of global objects.
|
||||
If you want to get internal profiling information about the engine itself
|
||||
you will have to re-compile the engine with _IRR_COMPILE_WITH_PROFILING_ enabled.
|
||||
But you can use the profiler for profiling your own projects without that. */
|
||||
IRRLICHT_API IProfiler& IRRCALLCONV getProfiler();
|
||||
|
||||
//! Class where the objects profile their own life-time.
|
||||
/** This is a comfort wrapper around the IProfiler start/stop mechanism which is easier to use
|
||||
when you want to profile a scope. You only have to create an object and it will profile it's own lifetime
|
||||
for the given id. */
|
||||
class CProfileScope
|
||||
{
|
||||
public:
|
||||
//! Construct with an known id.
|
||||
/** This is the fastest scope constructor, but the id must have been added before.
|
||||
\param id Any id which you did add to the profiler before. */
|
||||
CProfileScope(s32 id)
|
||||
: Id(id), Profiler(getProfiler())
|
||||
{
|
||||
Profiler.start(Id);
|
||||
}
|
||||
|
||||
//! Object will create the given name, groupName combination for the id if it doesn't exist already
|
||||
/** \param id: Should be >= 0 as negative id's are reserved for Irrlicht. Also very large numbers (near INT_MAX) might
|
||||
have been created already by the automatic add function of ::IProfiler.
|
||||
\param name: Name for displaying profile data.
|
||||
\param groupName: Each id belongs into a group - this helps on displaying profile data. */
|
||||
CProfileScope(s32 id, const core::stringw &name, const core::stringw &groupName)
|
||||
: Id(id), Profiler(getProfiler())
|
||||
{
|
||||
Profiler.add(Id, name, groupName);
|
||||
Profiler.start(Id);
|
||||
}
|
||||
|
||||
//! Object will create an id for the given name, groupName combination if they don't exist already
|
||||
/** Slowest scope constructor, but usually still fine unless speed is very critical.
|
||||
\param name: Name for displaying profile data.
|
||||
\param groupName: Each id belongs into a group - this helps on displaying profile data. */
|
||||
CProfileScope(const core::stringw &name, const core::stringw &groupName)
|
||||
: Profiler(getProfiler())
|
||||
{
|
||||
Id = Profiler.add(name, groupName);
|
||||
Profiler.start(Id);
|
||||
}
|
||||
|
||||
~CProfileScope()
|
||||
{
|
||||
Profiler.stop(Id);
|
||||
}
|
||||
|
||||
protected:
|
||||
s32 Id;
|
||||
IProfiler& Profiler;
|
||||
};
|
||||
|
||||
|
||||
// IMPLEMENTATION for in-line stuff
|
||||
|
||||
void IProfiler::start(s32 id)
|
||||
{
|
||||
s32 idx = ProfileDatas.binary_search(SProfileData(id));
|
||||
if ( idx >= 0 && Timer )
|
||||
{
|
||||
++ProfileDatas[idx].StartStopCounter;
|
||||
if (ProfileDatas[idx].StartStopCounter == 1 )
|
||||
ProfileDatas[idx].LastTimeStarted = Timer->getRealTime();
|
||||
}
|
||||
}
|
||||
|
||||
void IProfiler::stop(s32 id)
|
||||
{
|
||||
if ( Timer )
|
||||
{
|
||||
u32 timeNow = Timer->getRealTime();
|
||||
s32 idx = ProfileDatas.binary_search(SProfileData(id));
|
||||
if ( idx >= 0 )
|
||||
{
|
||||
SProfileData &data = ProfileDatas[idx];
|
||||
--ProfileDatas[idx].StartStopCounter;
|
||||
if ( data.LastTimeStarted != 0 && ProfileDatas[idx].StartStopCounter == 0)
|
||||
{
|
||||
// update data for this id
|
||||
++data.CountCalls;
|
||||
u32 diffTime = timeNow - data.LastTimeStarted;
|
||||
data.TimeSum += diffTime;
|
||||
if ( diffTime > data.LongestTime )
|
||||
data.LongestTime = diffTime;
|
||||
data.LastTimeStarted = 0;
|
||||
|
||||
// update data of it's group
|
||||
SProfileData & group = ProfileGroups[data.GroupIndex];
|
||||
++group.CountCalls;
|
||||
group.TimeSum += diffTime;
|
||||
if ( diffTime > group.LongestTime )
|
||||
group.LongestTime = diffTime;
|
||||
group.LastTimeStarted = 0;
|
||||
}
|
||||
else if ( ProfileDatas[idx].StartStopCounter < 0 )
|
||||
{
|
||||
// ignore additional stop calls
|
||||
ProfileDatas[idx].StartStopCounter = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 IProfiler::add(const core::stringw &name, const core::stringw &groupName)
|
||||
{
|
||||
u32 index;
|
||||
if ( findDataIndex(index, name) )
|
||||
{
|
||||
add( ProfileDatas[index].Id, name, groupName );
|
||||
return ProfileDatas[index].Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
s32 id = NextAutoId;
|
||||
--NextAutoId;
|
||||
add( id, name, groupName );
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
void IProfiler::add(s32 id, const core::stringw &name, const core::stringw &groupName)
|
||||
{
|
||||
u32 groupIdx;
|
||||
if ( !findGroupIndex(groupIdx, groupName) )
|
||||
{
|
||||
groupIdx = addGroup(groupName);
|
||||
}
|
||||
|
||||
SProfileData data(id);
|
||||
s32 idx = ProfileDatas.binary_search(data);
|
||||
if ( idx < 0 )
|
||||
{
|
||||
data.reset();
|
||||
data.GroupIndex = groupIdx;
|
||||
data.Name = name;
|
||||
|
||||
ProfileDatas.push_back(data);
|
||||
ProfileDatas.sort();
|
||||
}
|
||||
else
|
||||
{
|
||||
// only reset on group changes, otherwise we want to keep the data or coding CProfileScope would become tricky.
|
||||
if ( groupIdx != ProfileDatas[idx].GroupIndex )
|
||||
{
|
||||
resetDataByIndex((u32)idx);
|
||||
ProfileDatas[idx].GroupIndex = groupIdx;
|
||||
}
|
||||
ProfileDatas[idx].Name = name;
|
||||
}
|
||||
}
|
||||
|
||||
u32 IProfiler::addGroup(const core::stringw &name)
|
||||
{
|
||||
SProfileData group;
|
||||
group.Id = -1; // Id for groups doesn't matter so far
|
||||
group.Name = name;
|
||||
ProfileGroups.push_back(group);
|
||||
return ProfileGroups.size()-1;
|
||||
}
|
||||
|
||||
bool IProfiler::findDataIndex(u32 & result, const core::stringw &name) const
|
||||
{
|
||||
for ( u32 i=0; i < ProfileDatas.size(); ++i )
|
||||
{
|
||||
if ( ProfileDatas[i].Name == name )
|
||||
{
|
||||
result = i;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
const SProfileData* IProfiler::getProfileDataById(u32 id)
|
||||
{
|
||||
SProfileData data(id);
|
||||
s32 idx = ProfileDatas.binary_search(data);
|
||||
if ( idx >= 0 )
|
||||
return &ProfileDatas[idx];
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool IProfiler::findGroupIndex(u32 & result, const core::stringw &name) const
|
||||
{
|
||||
for ( u32 i=0; i < ProfileGroups.size(); ++i )
|
||||
{
|
||||
if ( ProfileGroups[i].Name == name )
|
||||
{
|
||||
result = i;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void IProfiler::resetDataById(s32 id)
|
||||
{
|
||||
s32 idx = ProfileDatas.binary_search(SProfileData(id));
|
||||
if ( idx >= 0 )
|
||||
{
|
||||
resetDataByIndex((u32)idx);
|
||||
}
|
||||
}
|
||||
|
||||
void IProfiler::resetDataByIndex(u32 index)
|
||||
{
|
||||
SProfileData &data = ProfileDatas[index];
|
||||
|
||||
SProfileData & group = ProfileGroups[data.GroupIndex];
|
||||
group.CountCalls -= data.CountCalls;
|
||||
group.TimeSum -= data.TimeSum;
|
||||
|
||||
data.reset();
|
||||
}
|
||||
|
||||
//! Reset profile data for a whole group
|
||||
void IProfiler::resetGroup(u32 index)
|
||||
{
|
||||
for ( u32 i=0; i<ProfileDatas.size(); ++i )
|
||||
{
|
||||
if ( ProfileDatas[i].GroupIndex == index )
|
||||
ProfileDatas[i].reset();
|
||||
}
|
||||
if ( index < ProfileGroups.size() )
|
||||
ProfileGroups[index].reset();
|
||||
}
|
||||
|
||||
void IProfiler::resetAll()
|
||||
{
|
||||
for ( u32 i=0; i<ProfileDatas.size(); ++i )
|
||||
{
|
||||
ProfileDatas[i].reset();
|
||||
}
|
||||
|
||||
for ( u32 i=0; i<ProfileGroups.size(); ++i )
|
||||
{
|
||||
ProfileGroups[i].reset();
|
||||
}
|
||||
}
|
||||
|
||||
//! For internal engine use:
|
||||
//! Code inside IRR_PROFILE is only executed when _IRR_COMPILE_WITH_PROFILING_ is set
|
||||
//! This allows disabling all profiler code completely by changing that define.
|
||||
//! It's generally useful to wrap profiler-calls in application code with a similar macro.
|
||||
#ifdef _IRR_COMPILE_WITH_PROFILING_
|
||||
#define IRR_PROFILE(X) X
|
||||
#else
|
||||
#define IRR_PROFILE(X)
|
||||
#endif // IRR_PROFILE
|
||||
|
||||
} // namespace irr
|
||||
|
||||
#endif // __I_PROFILER_H_INCLUDED__
|
@ -7,10 +7,6 @@
|
||||
|
||||
#include "irrTypes.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_
|
||||
#include "leakHunter.h"
|
||||
#endif
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
@ -50,17 +46,11 @@ namespace irr
|
||||
IReferenceCounted()
|
||||
: DebugName(0), ReferenceCounter(1)
|
||||
{
|
||||
#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_
|
||||
LeakHunter::addObject(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
//! Destructor.
|
||||
virtual ~IReferenceCounted()
|
||||
{
|
||||
#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_
|
||||
LeakHunter::removeObject(this);
|
||||
#endif
|
||||
}
|
||||
|
||||
//! Grabs the object. Increments the reference counter by one.
|
||||
|
@ -318,20 +318,10 @@ namespace scene
|
||||
* \endcode
|
||||
* If you would like to implement and add your own file format loader to Irrlicht,
|
||||
* see addExternalMeshLoader().
|
||||
* \param filename: Filename of the mesh to load.
|
||||
* \param alternativeCacheName: In case you want to have the mesh under another name in the cache (to create real copies)
|
||||
* \param file File handle of the mesh to load.
|
||||
* \return Null if failed, otherwise pointer to the mesh.
|
||||
* This pointer should not be dropped. See IReferenceCounted::drop() for more information.
|
||||
**/
|
||||
virtual IAnimatedMesh* getMesh(const io::path& filename, const io::path& alternativeCacheName=io::path("")) = 0;
|
||||
|
||||
//! Get pointer to an animateable mesh. Loads the file if not loaded already.
|
||||
/** Works just as getMesh(const char* filename). If you want to
|
||||
remove a loaded mesh from the cache again, use removeMesh().
|
||||
\param file File handle of the mesh to load.
|
||||
\return NULL if failed and pointer to the mesh if successful.
|
||||
This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IAnimatedMesh* getMesh(io::IReadFile* file) = 0;
|
||||
|
||||
//! Get interface to the mesh cache which is shared between all existing scene managers.
|
||||
@ -345,16 +335,6 @@ namespace scene
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual video::IVideoDriver* getVideoDriver() = 0;
|
||||
|
||||
//! Get the active GUIEnvironment
|
||||
/** \return Pointer to the GUIEnvironment
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual gui::IGUIEnvironment* getGUIEnvironment() = 0;
|
||||
|
||||
//! Get the active FileSystem
|
||||
/** \return Pointer to the FileSystem
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual io::IFileSystem* getFileSystem() = 0;
|
||||
|
||||
//! Adds a scene node for rendering an animated mesh model.
|
||||
/** \param mesh: Pointer to the loaded animated mesh to be displayed.
|
||||
\param parent: Parent of the scene node. Can be NULL if no parent.
|
||||
|
@ -56,32 +56,11 @@ namespace video
|
||||
ETS_WORLD,
|
||||
//! Projection transformation
|
||||
ETS_PROJECTION,
|
||||
//! Texture transformation
|
||||
//! Texture 0 transformation
|
||||
//! Use E_TRANSFORMATION_STATE(ETS_TEXTURE_0 + texture_number) to access other texture transformations
|
||||
ETS_TEXTURE_0,
|
||||
//! Texture transformation
|
||||
ETS_TEXTURE_1,
|
||||
//! Texture transformation
|
||||
ETS_TEXTURE_2,
|
||||
//! Texture transformation
|
||||
ETS_TEXTURE_3,
|
||||
#if _IRR_MATERIAL_MAX_TEXTURES_>4
|
||||
//! Texture transformation
|
||||
ETS_TEXTURE_4,
|
||||
#if _IRR_MATERIAL_MAX_TEXTURES_>5
|
||||
//! Texture transformation
|
||||
ETS_TEXTURE_5,
|
||||
#if _IRR_MATERIAL_MAX_TEXTURES_>6
|
||||
//! Texture transformation
|
||||
ETS_TEXTURE_6,
|
||||
#if _IRR_MATERIAL_MAX_TEXTURES_>7
|
||||
//! Texture transformation
|
||||
ETS_TEXTURE_7,
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
//! Only used internally
|
||||
ETS_COUNT = ETS_TEXTURE_0 + _IRR_MATERIAL_MAX_TEXTURES_
|
||||
ETS_COUNT = ETS_TEXTURE_0 + MATERIAL_MAX_TEXTURES
|
||||
};
|
||||
|
||||
//! Special render targets, which usually map to dedicated hardware
|
||||
@ -331,7 +310,7 @@ namespace video
|
||||
_IRR_DEPRECATED_ ITexture* addTexture(const io::path& name, IImage* image, void* mipmapData)
|
||||
{
|
||||
if (image)
|
||||
image->setMipMapsData(mipmapData, false, true);
|
||||
image->setMipMapsData(mipmapData, false);
|
||||
|
||||
return addTexture(name, image);
|
||||
}
|
||||
@ -738,23 +717,6 @@ namespace video
|
||||
virtual void draw3DLine(const core::vector3df& start,
|
||||
const core::vector3df& end, SColor color = SColor(255,255,255,255)) =0;
|
||||
|
||||
//! Draws a 3d triangle.
|
||||
/** This method calls drawVertexPrimitiveList for some triangles.
|
||||
This method works with all drivers because it simply calls
|
||||
drawVertexPrimitiveList, but it is hence not very fast.
|
||||
Note that the triangle is drawn using the current
|
||||
transformation matrix and material. So if you need to draw it
|
||||
independently of the current transformation, use
|
||||
\code
|
||||
driver->setMaterial(someMaterial);
|
||||
driver->setTransform(video::ETS_WORLD, core::IdentityMatrix);
|
||||
\endcode
|
||||
for some properly set up material before drawing the triangle.
|
||||
\param triangle The triangle to draw.
|
||||
\param color Color of the line. */
|
||||
virtual void draw3DTriangle(const core::triangle3df& triangle,
|
||||
SColor color = SColor(255,255,255,255)) =0;
|
||||
|
||||
//! Draws a 3d axis aligned box.
|
||||
/** This method simply calls draw3DLine for the edges of the
|
||||
box. Note that the box is drawn using the current transformation
|
||||
@ -785,7 +747,7 @@ namespace video
|
||||
\param texture Texture to be drawn.
|
||||
\param destPos Upper left 2d destination position where the
|
||||
image will be drawn.
|
||||
\param sourceRect Source rectangle in the image.
|
||||
\param sourceRect Source rectangle in the texture (based on it's OriginalSize)
|
||||
\param clipRect Pointer to rectangle on the screen where the
|
||||
image is clipped to.
|
||||
If this pointer is NULL the image is not clipped.
|
||||
@ -799,35 +761,6 @@ namespace video
|
||||
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0,
|
||||
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) =0;
|
||||
|
||||
//! Draws a set of 2d images, using a color and the alpha channel of the texture.
|
||||
/** The images are drawn beginning at pos and concatenated in
|
||||
one line. All drawings are clipped against clipRect (if != 0).
|
||||
The subtextures are defined by the array of sourceRects and are
|
||||
chosen by the indices given.
|
||||
\param texture Texture to be drawn.
|
||||
\param pos Upper left 2d destination position where the image
|
||||
will be drawn.
|
||||
\param sourceRects Source rectangles of the image.
|
||||
\param indices List of indices which choose the actual
|
||||
rectangle used each time.
|
||||
\param kerningWidth Offset to Position on X
|
||||
\param clipRect Pointer to rectangle on the screen where the
|
||||
image is clipped to.
|
||||
If this pointer is 0 then the image is not clipped.
|
||||
\param color Color with which the image is drawn.
|
||||
Note that the alpha component is used. If alpha is other than
|
||||
255, the image will be transparent.
|
||||
\param useAlphaChannelOfTexture: If true, the alpha channel of
|
||||
the texture is used to draw the image. */
|
||||
virtual void draw2DImageBatch(const video::ITexture* texture,
|
||||
const core::position2d<s32>& pos,
|
||||
const core::array<core::rect<s32> >& sourceRects,
|
||||
const core::array<s32>& indices,
|
||||
s32 kerningWidth=0,
|
||||
const core::rect<s32>* clipRect=0,
|
||||
SColor color=SColor(255,255,255,255),
|
||||
bool useAlphaChannelOfTexture=false) =0;
|
||||
|
||||
//! Draws a set of 2d images, using a color and the alpha channel of the texture.
|
||||
/** All drawings are clipped against clipRect (if != 0).
|
||||
The subtextures are defined by the array of sourceRects and are
|
||||
@ -835,7 +768,7 @@ namespace video
|
||||
\param texture Texture to be drawn.
|
||||
\param positions Array of upper left 2d destinations where the
|
||||
images will be drawn.
|
||||
\param sourceRects Source rectangles of the image.
|
||||
\param sourceRects Source rectangles of the texture (based on it's OriginalSize)
|
||||
\param clipRect Pointer to rectangle on the screen where the
|
||||
images are clipped to.
|
||||
If this pointer is 0 then the image is not clipped.
|
||||
@ -855,7 +788,7 @@ namespace video
|
||||
/** Suggested and first implemented by zola.
|
||||
\param texture The texture to draw from
|
||||
\param destRect The rectangle to draw into
|
||||
\param sourceRect The rectangle denoting a part of the texture
|
||||
\param sourceRect The rectangle denoting a part of the texture (based on it's OriginalSize)
|
||||
\param clipRect Clips the destination rectangle (may be 0)
|
||||
\param colors Array of 4 colors denoting the color values of
|
||||
the corners of the destRect
|
||||
@ -898,13 +831,6 @@ namespace video
|
||||
SColor colorLeftDown, SColor colorRightDown,
|
||||
const core::rect<s32>* clip =0) =0;
|
||||
|
||||
//! Draws the outline of a 2D rectangle.
|
||||
/** \param pos Position of the rectangle.
|
||||
\param color Color of the rectangle to draw. The alpha component
|
||||
specifies how transparent the rectangle outline will be. */
|
||||
virtual void draw2DRectangleOutline(const core::recti& pos,
|
||||
SColor color=SColor(255,255,255,255)) =0;
|
||||
|
||||
//! Draws a 2d line.
|
||||
/** In theory both start and end will be included in coloring.
|
||||
BUG: Currently d3d ignores the last pixel
|
||||
@ -918,72 +844,6 @@ namespace video
|
||||
const core::position2d<s32>& end,
|
||||
SColor color=SColor(255,255,255,255)) =0;
|
||||
|
||||
//! Draws a pixel.
|
||||
/** \param x The x-position of the pixel.
|
||||
\param y The y-position of the pixel.
|
||||
\param color Color of the pixel to draw. */
|
||||
virtual void drawPixel(u32 x, u32 y, const SColor& color) =0;
|
||||
|
||||
//! Draws a non filled concyclic regular 2d polygon.
|
||||
/** This method can be used to draw circles, but also
|
||||
triangles, tetragons, pentagons, hexagons, heptagons, octagons,
|
||||
enneagons, decagons, hendecagons, dodecagon, triskaidecagons,
|
||||
etc. I think you'll got it now. And all this by simply
|
||||
specifying the vertex count. Welcome to the wonders of
|
||||
geometry.
|
||||
\param center Position of center of circle (pixels).
|
||||
\param radius Radius of circle in pixels.
|
||||
\param color Color of the circle.
|
||||
\param vertexCount Amount of vertices of the polygon. Specify 2
|
||||
to draw a line, 3 to draw a triangle, 4 for tetragons and a lot
|
||||
(>10) for nearly a circle. */
|
||||
virtual void draw2DPolygon(core::position2d<s32> center,
|
||||
f32 radius,
|
||||
video::SColor color=SColor(100,255,255,255),
|
||||
s32 vertexCount=10) =0;
|
||||
|
||||
//! Draws a shadow volume into the stencil buffer.
|
||||
/** To draw a stencil shadow, do this: First, draw all geometry.
|
||||
Then use this method, to draw the shadow volume. Then, use
|
||||
IVideoDriver::drawStencilShadow() to visualize the shadow.
|
||||
Please note that the code for the opengl version of the method
|
||||
is based on free code sent in by Philipp Dortmann, lots of
|
||||
thanks go to him!
|
||||
\param triangles Array of 3d vectors, specifying the shadow
|
||||
volume.
|
||||
\param zfail If set to true, zfail method is used, otherwise
|
||||
zpass.
|
||||
\param debugDataVisible The debug data that is enabled for this
|
||||
shadow node
|
||||
*/
|
||||
virtual void drawStencilShadowVolume(const core::array<core::vector3df>& triangles, bool zfail=true, u32 debugDataVisible=0) =0;
|
||||
|
||||
//! Fills the stencil shadow with color.
|
||||
/** After the shadow volume has been drawn into the stencil
|
||||
buffer using IVideoDriver::drawStencilShadowVolume(), use this
|
||||
to draw the color of the shadow.
|
||||
Please note that the code for the opengl version of the method
|
||||
is based on free code sent in by Philipp Dortmann, lots of
|
||||
thanks go to him!
|
||||
\param clearStencilBuffer Set this to false, if you want to
|
||||
draw every shadow with the same color, and only want to call
|
||||
drawStencilShadow() once after all shadow volumes have been
|
||||
drawn. Set this to true, if you want to paint every shadow with
|
||||
its own color.
|
||||
\param leftUpEdge Color of the shadow in the upper left corner
|
||||
of screen.
|
||||
\param rightUpEdge Color of the shadow in the upper right
|
||||
corner of screen.
|
||||
\param leftDownEdge Color of the shadow in the lower left
|
||||
corner of screen.
|
||||
\param rightDownEdge Color of the shadow in the lower right
|
||||
corner of screen. */
|
||||
virtual void drawStencilShadow(bool clearStencilBuffer=false,
|
||||
video::SColor leftUpEdge = video::SColor(255,0,0,0),
|
||||
video::SColor rightUpEdge = video::SColor(255,0,0,0),
|
||||
video::SColor leftDownEdge = video::SColor(255,0,0,0),
|
||||
video::SColor rightDownEdge = video::SColor(255,0,0,0)) =0;
|
||||
|
||||
//! Draws a mesh buffer
|
||||
/** \param mb Buffer to draw */
|
||||
virtual void drawMeshBuffer(const scene::IMeshBuffer* mb) =0;
|
||||
@ -1099,28 +959,6 @@ namespace video
|
||||
\return The current texture creation flag enabled mode. */
|
||||
virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const =0;
|
||||
|
||||
//! Creates a software images from a file.
|
||||
/** No hardware texture will be created for those images. This
|
||||
method is useful for example if you want to read a heightmap
|
||||
for a terrain renderer.
|
||||
\param filename Name of the file from which the images are created.
|
||||
\param type Pointer to E_TEXTURE_TYPE where a recommended type of the texture will be stored.
|
||||
\return The array of created images.
|
||||
If you no longer need those images, you should call IImage::drop() on each of them.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual core::array<IImage*> createImagesFromFile(const io::path& filename, E_TEXTURE_TYPE* type = 0) = 0;
|
||||
|
||||
//! Creates a software images from a file.
|
||||
/** No hardware texture will be created for those images. This
|
||||
method is useful for example if you want to read a heightmap
|
||||
for a terrain renderer.
|
||||
\param file File from which the image is created.
|
||||
\param type Pointer to E_TEXTURE_TYPE where a recommended type of the texture will be stored.
|
||||
\return The array of created images.
|
||||
If you no longer need those images, you should call IImage::drop() on each of them.
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual core::array<IImage*> createImagesFromFile(io::IReadFile* file, E_TEXTURE_TYPE* type = 0) = 0;
|
||||
|
||||
//! Creates a software image from a file.
|
||||
/** No hardware texture will be created for this image. This
|
||||
method is useful for example if you want to read a heightmap
|
||||
@ -1130,15 +968,7 @@ namespace video
|
||||
\return The created image.
|
||||
If you no longer need the image, you should call IImage::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
IImage* createImageFromFile(const io::path& filename)
|
||||
{
|
||||
core::array<IImage*> imageArray = createImagesFromFile(filename);
|
||||
|
||||
for (u32 i = 1; i < imageArray.size(); ++i)
|
||||
imageArray[i]->drop();
|
||||
|
||||
return (imageArray.size() > 0) ? imageArray[0] : 0;
|
||||
}
|
||||
virtual IImage* createImageFromFile(const io::path& filename) = 0;
|
||||
|
||||
//! Creates a software image from a file.
|
||||
/** No hardware texture will be created for this image. This
|
||||
@ -1148,15 +978,7 @@ namespace video
|
||||
\return The created image.
|
||||
If you no longer need the image, you should call IImage::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
IImage* createImageFromFile(io::IReadFile* file)
|
||||
{
|
||||
core::array<IImage*> imageArray = createImagesFromFile(file);
|
||||
|
||||
for (u32 i = 1; i < imageArray.size(); ++i)
|
||||
imageArray[i]->drop();
|
||||
|
||||
return (imageArray.size() > 0) ? imageArray[0] : 0;
|
||||
}
|
||||
virtual IImage* createImageFromFile(io::IReadFile* file) = 0;
|
||||
|
||||
//! Writes the provided image to a file.
|
||||
/** Requires that there is a suitable image writer registered
|
||||
@ -1300,7 +1122,7 @@ namespace video
|
||||
E_MATERIAL_TYPE enum or a value which was returned by
|
||||
addMaterialRenderer().
|
||||
\param name: New name of the material renderer. */
|
||||
virtual void setMaterialRendererName(s32 idx, const c8* name) =0;
|
||||
virtual void setMaterialRendererName(u32 idx, const c8* name) =0;
|
||||
|
||||
//! Swap the material renderers used for certain id's
|
||||
/** Swap the IMaterialRenderers responsible for rendering specific
|
||||
|
@ -6,8 +6,8 @@
|
||||
#define __IRR_COMPILE_CONFIG_H_INCLUDED__
|
||||
|
||||
//! Identifies the IrrlichtMt fork customized for the Minetest engine
|
||||
#define IRRLICHT_VERSION_MT_REVISION 8
|
||||
#define IRRLICHT_VERSION_MT "mt8"
|
||||
#define IRRLICHT_VERSION_MT_REVISION 11
|
||||
#define IRRLICHT_VERSION_MT "mt11"
|
||||
|
||||
//! Irrlicht SDK Version
|
||||
#define IRRLICHT_VERSION_MAJOR 1
|
||||
@ -20,454 +20,14 @@
|
||||
|
||||
#include <stdio.h> // TODO: Although included elsewhere this is required at least for mingw
|
||||
|
||||
//! The defines for different operating system are:
|
||||
//! _IRR_WINDOWS_ for all irrlicht supported Windows versions
|
||||
//! _IRR_WINDOWS_API_ for Windows or XBox
|
||||
//! _IRR_LINUX_PLATFORM_ for Linux (it is defined here if no other os is defined)
|
||||
//! _IRR_SOLARIS_PLATFORM_ for Solaris
|
||||
//! _IRR_OSX_PLATFORM_ for Apple systems running OSX
|
||||
//! _IRR_IOS_PLATFORM_ for Apple devices running iOS
|
||||
//! _IRR_ANDROID_PLATFORM_ for devices running Android
|
||||
//! _IRR_POSIX_API_ for Posix compatible systems
|
||||
//! Note: PLATFORM defines the OS specific layer, API can group several platforms
|
||||
|
||||
//! DEVICE is the windowing system used, several PLATFORMs support more than one DEVICE
|
||||
//! Irrlicht can be compiled with more than one device
|
||||
//! _IRR_COMPILE_WITH_WINDOWS_DEVICE_ for Windows API based device
|
||||
//! _IRR_COMPILE_WITH_OSX_DEVICE_ for Cocoa native windowing on OSX
|
||||
//! _IRR_COMPILE_WITH_X11_DEVICE_ for Linux X11 based device
|
||||
//! _IRR_COMPILE_WITH_SDL_DEVICE_ for platform independent SDL framework
|
||||
|
||||
//! Passing defines to the compiler which have NO in front of the _IRR definename is an alternative
|
||||
//! way which can be used to disable defines (instead of outcommenting them in this header).
|
||||
//! So defines can be controlled from Makefiles or Projectfiles which allows building
|
||||
//! different library versions without having to change the sources.
|
||||
//! Example: NO_IRR_COMPILE_WITH_X11_ would disable X11
|
||||
|
||||
//! Uncomment this line to compile with the SDL device
|
||||
//#define _IRR_COMPILE_WITH_SDL_DEVICE_
|
||||
#ifdef NO_IRR_COMPILE_WITH_SDL_DEVICE_
|
||||
#undef _IRR_COMPILE_WITH_SDL_DEVICE_
|
||||
#endif
|
||||
|
||||
//! WIN32 for Windows32
|
||||
//! WIN64 for Windows64
|
||||
// The windows platform and API support SDL and WINDOW device
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#define _IRR_WINDOWS_
|
||||
#define _IRR_WINDOWS_API_
|
||||
#ifndef _IRR_COMPILE_WITH_SDL_DEVICE_
|
||||
#define _IRR_COMPILE_WITH_WINDOWS_DEVICE_
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) || defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
|
||||
#define _IRR_IOS_PLATFORM_
|
||||
#define _IRR_COMPILE_WITH_IOS_DEVICE_
|
||||
#define NO_IRR_COMPILE_WITH_OPENGL_
|
||||
// The application state events and following methods: IrrlichtDevice::isWindowActive, IrrlichtDevice::isWindowFocused,
|
||||
// IrrlichtDevice::isWindowMinimized works out of box only if you'll use built-in CIrrDelegateiOS,
|
||||
// so _IRR_COMPILE_WITH_IOS_BUILTIN_MAIN_ must be enabled in this case. If you need a custom UIApplicationDelegate
|
||||
// you must disable _IRR_COMPILE_WITH_IOS_BUILTIN_MAIN_ definition and handle all application events yourself.
|
||||
#define _IRR_COMPILE_WITH_IOS_BUILTIN_MAIN_
|
||||
#else
|
||||
#define _IRR_OSX_PLATFORM_
|
||||
#ifndef _IRR_COMPILE_WITH_SDL_DEVICE_
|
||||
#define _IRR_COMPILE_WITH_OSX_DEVICE_
|
||||
#endif
|
||||
#define NO_IRR_COMPILE_WITH_OGLES1_
|
||||
#define NO_IRR_COMPILE_WITH_OGLES2_
|
||||
#define NO_IRR_COMPILE_WITH_WEBGL1_
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
#define _IRR_EMSCRIPTEN_PLATFORM_
|
||||
#define NO_IRR_COMPILE_WITH_JOYSTICK_EVENTS_
|
||||
#define NO_IRR_COMPILE_WITH_OPENGL_
|
||||
#define NO_IRR_COMPILE_WITH_OGLES1_
|
||||
#define _IRR_COMPILE_WITH_OGLES2_
|
||||
#define _IRR_COMPILE_WITH_WEBGL1_
|
||||
#define _IRR_COMPILE_WITH_EGL_MANAGER_
|
||||
#define _IRR_COMPILE_WITH_SDL_DEVICE_
|
||||
#define NO_IRR_COMPILE_WITH_X11_DEVICE_
|
||||
#define _IRR_LINUX_PLATFORM_ // emscripten basically working like a unix
|
||||
#endif // __EMSCRIPTEN__
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
#define _IRR_ANDROID_PLATFORM_
|
||||
#define _IRR_COMPILE_WITH_ANDROID_DEVICE_
|
||||
#define _IRR_COMPILE_ANDROID_ASSET_READER_
|
||||
#define NO_IRR_COMPILE_WITH_OPENGL_
|
||||
#endif
|
||||
|
||||
#if defined(__SVR4) && defined(__sun)
|
||||
#define _IRR_SOLARIS_PLATFORM_
|
||||
#if defined(__sparc)
|
||||
#define __BIG_ENDIAN__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(_IRR_WINDOWS_API_) && !defined(_IRR_OSX_PLATFORM_) && !defined(_IRR_IOS_PLATFORM_) && !defined(_IRR_ANDROID_PLATFORM_) && !defined(_IRR_EMSCRIPTEN_PLATFORM_)
|
||||
#ifndef _IRR_SOLARIS_PLATFORM_
|
||||
#define _IRR_LINUX_PLATFORM_
|
||||
#endif
|
||||
#define _IRR_POSIX_API_
|
||||
#ifndef _IRR_COMPILE_WITH_SDL_DEVICE_
|
||||
#define _IRR_COMPILE_WITH_X11_DEVICE_
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_JOYSTICK_SUPPORT_ if you want joystick events.
|
||||
#if !(defined(__FreeBSD__) || defined(__OpenBSD__))
|
||||
#define _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
|
||||
#endif
|
||||
#ifdef NO_IRR_COMPILE_WITH_JOYSTICK_EVENTS_
|
||||
#undef _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
|
||||
#endif
|
||||
|
||||
|
||||
//! Maximum number of texture an SMaterial can have, up to 8 are supported by Irrlicht.
|
||||
#define _IRR_MATERIAL_MAX_TEXTURES_ 4
|
||||
|
||||
//! Add a leak-hunter to Irrlicht which helps finding unreleased reference counted objects.
|
||||
//! NOTE: This is slow and should only be used for debugging
|
||||
//#define _IRR_COMPILE_WITH_LEAK_HUNTER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_LEAK_HUNTER_
|
||||
#undef _IRR_COMPILE_WITH_LEAK_HUNTER_
|
||||
#endif
|
||||
|
||||
//! Enable profiling information in the engine
|
||||
/** NOTE: The profiler itself always exists and can be used by applications.
|
||||
This define is about the engine creating profile data
|
||||
while it runs and enabling it will slow down the engine. */
|
||||
//#define _IRR_COMPILE_WITH_PROFILING_
|
||||
#ifdef NO_IRR_COMPILE_WITH_PROFILING_
|
||||
#undef _IRR_COMPILE_WITH_PROFILING_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_DIRECT3D_9_ to compile the Irrlicht engine with DIRECT3D9.
|
||||
/** If you only want to use the software device or opengl you can disable those defines.
|
||||
This switch is mostly disabled because people do not get the g++ compiler compile
|
||||
directX header files, and directX is only available on Windows platforms. If you
|
||||
are using Dev-Cpp, and want to compile this using a DX dev pack, you can define
|
||||
_IRR_COMPILE_WITH_DX9_DEV_PACK_. So you simply need to add something like this
|
||||
to the compiler settings: -DIRR_COMPILE_WITH_DX9_DEV_PACK
|
||||
and this to the linker settings: -ld3dx9
|
||||
*/
|
||||
#if defined(_IRR_WINDOWS_API_) && defined(IRR_COMPILE_WITH_DX9_DEV_PACK)
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ if you want to use DirectInput for joystick handling.
|
||||
/** This only applies to Windows devices, currently only supported under Win32 device.
|
||||
If not defined, Windows Multimedia library is used, which offers also broad support for joystick devices. */
|
||||
#define _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
|
||||
#ifdef NO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
|
||||
#undef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_OPENGL_ to compile the Irrlicht engine with OpenGL.
|
||||
/** If you do not wish the engine to be compiled with OpenGL, comment this
|
||||
define out. */
|
||||
#define _IRR_COMPILE_WITH_OPENGL_
|
||||
#ifdef NO_IRR_COMPILE_WITH_OPENGL_
|
||||
#undef _IRR_COMPILE_WITH_OPENGL_
|
||||
#endif
|
||||
|
||||
//! Define required options for OpenGL drivers.
|
||||
#if defined(_IRR_COMPILE_WITH_OPENGL_)
|
||||
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
|
||||
#define _IRR_OPENGL_USE_EXTPOINTER_
|
||||
#define _IRR_COMPILE_WITH_WGL_MANAGER_
|
||||
#elif defined(_IRR_COMPILE_WITH_X11_DEVICE_)
|
||||
#define _IRR_OPENGL_USE_EXTPOINTER_
|
||||
#define _IRR_COMPILE_WITH_GLX_MANAGER_
|
||||
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
|
||||
#define _IRR_COMPILE_WITH_NSOGL_MANAGER_
|
||||
#elif defined(_IRR_SOLARIS_PLATFORM_)
|
||||
#define _IRR_COMPILE_WITH_GLX_MANAGER_
|
||||
#elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
|
||||
#define _IRR_OPENGL_USE_EXTPOINTER_
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_OGLES1_ to compile the Irrlicht engine with OpenGL ES 1.1.
|
||||
/** If you do not wish the engine to be compiled with OpenGL ES 1.1, comment this
|
||||
define out.
|
||||
Depending on platform you may have to enable _IRR_OGLES1_USE_KHRONOS_API_HEADERS_ as well when using it.
|
||||
*/
|
||||
#if defined(_IRR_ANDROID_PLATFORM_) || defined(_IRR_IOS_PLATFORM_)
|
||||
#define _IRR_COMPILE_WITH_OGLES1_
|
||||
#endif
|
||||
#ifdef NO_IRR_COMPILE_WITH_OGLES1_
|
||||
#undef _IRR_COMPILE_WITH_OGLES1_
|
||||
#endif
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_OGLES1_
|
||||
//! Define _IRR_OGLES1_USE_KHRONOS_API_HEADERS_ to use the OpenGL ES headers from the Debian Khronos-api package
|
||||
//#define _IRR_OGLES1_USE_KHRONOS_API_HEADERS_
|
||||
#endif
|
||||
|
||||
//! Define required options for OpenGL ES 1.1 drivers.
|
||||
#if defined(_IRR_COMPILE_WITH_OGLES1_)
|
||||
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_) || defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_)
|
||||
#define _IRR_OGLES1_USE_EXTPOINTER_
|
||||
#ifndef _IRR_COMPILE_WITH_EGL_MANAGER_
|
||||
#define _IRR_COMPILE_WITH_EGL_MANAGER_
|
||||
#endif
|
||||
#elif defined(_IRR_COMPILE_WITH_IOS_DEVICE_)
|
||||
#ifndef _IRR_COMPILE_WITH_EAGL_MANAGER_
|
||||
#define _IRR_COMPILE_WITH_EAGL_MANAGER_
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_OGLES2_ to compile the Irrlicht engine with OpenGL ES 2.0.
|
||||
/** If you do not wish the engine to be compiled with OpenGL ES 2.0, comment this
|
||||
define out. */
|
||||
#if defined(_IRR_ANDROID_PLATFORM_) || defined(_IRR_IOS_PLATFORM_)
|
||||
#define _IRR_COMPILE_WITH_OGLES2_
|
||||
#else
|
||||
//#define _IRR_COMPILE_WITH_OGLES2_
|
||||
#endif
|
||||
#ifdef NO_IRR_COMPILE_WITH_OGLES2_
|
||||
#undef _IRR_COMPILE_WITH_OGLES2_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_WEBGL1_ to compile Irrlicht engine with a WebGL friendly
|
||||
//! subset of the OpenGL ES 2.0 driver.
|
||||
//#define _IRR_COMPILE_WITH_WEBGL1_
|
||||
#ifdef NO_IRR_COMPILE_WITH_WEBGL1_
|
||||
#undef _IRR_COMPILE_WITH_WEBGL1_
|
||||
#endif
|
||||
#ifdef _IRR_COMPILE_WITH_WEBGL1_
|
||||
#define _IRR_COMPILE_WITH_OGLES2_ // it's a subset of OGL ES2, so always needed when using WebGL
|
||||
#endif
|
||||
|
||||
//! Define required options for OpenGL ES 2.0 drivers.
|
||||
#if defined(_IRR_COMPILE_WITH_OGLES2_)
|
||||
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_) || defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(__EMSCRIPTEN__)
|
||||
#define _IRR_OGLES2_USE_EXTPOINTER_
|
||||
#ifndef _IRR_COMPILE_WITH_EGL_MANAGER_
|
||||
#define _IRR_COMPILE_WITH_EGL_MANAGER_
|
||||
#endif
|
||||
#elif defined(_IRR_COMPILE_WITH_IOS_DEVICE_)
|
||||
#ifndef _IRR_COMPILE_WITH_EAGL_MANAGER_
|
||||
#define _IRR_COMPILE_WITH_EAGL_MANAGER_
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_X11_ to compile the Irrlicht engine with X11 support.
|
||||
/** If you do not wish the engine to be compiled with X11, comment this
|
||||
define out. */
|
||||
// Only used in LinuxDevice.
|
||||
#define _IRR_COMPILE_WITH_X11_
|
||||
#ifdef NO_IRR_COMPILE_WITH_X11_
|
||||
#undef _IRR_COMPILE_WITH_X11_
|
||||
#endif
|
||||
|
||||
#if defined(_IRR_LINUX_PLATFORM_) && defined(_IRR_COMPILE_WITH_X11_)
|
||||
//! XInput2 (library called Xi) is currently only used to support touch-input.
|
||||
#define _IRR_LINUX_X11_XINPUT2_
|
||||
#ifdef NO_IRR_LINUX_X11_XINPUT2_
|
||||
#undef _IRR_LINUX_X11_XINPUT2_
|
||||
#endif
|
||||
|
||||
//! X11 has by default only monochrome cursors, but using the Xcursor library we can also get color cursor support.
|
||||
//! If you have the need for custom color cursors on X11 then enable this and make sure you also link
|
||||
//! to the Xcursor library in your Makefile/Projectfile.
|
||||
//#define _IRR_LINUX_XCURSOR_
|
||||
#ifdef NO_IRR_LINUX_XCURSOR_
|
||||
#undef _IRR_LINUX_XCURSOR_
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_GUI_ to compile the engine with the built-in GUI
|
||||
/** Disable this if you are using an external library to draw the GUI. If you disable this then
|
||||
you will not be able to use anything provided by the GUI Environment, including loading fonts. */
|
||||
#define _IRR_COMPILE_WITH_GUI_
|
||||
#ifdef NO_IRR_COMPILE_WITH_GUI_
|
||||
#undef _IRR_COMPILE_WITH_GUI_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_LIBJPEG_ to enable compiling the engine using libjpeg.
|
||||
/** This enables the engine to read jpeg images. If you comment this out,
|
||||
the engine will no longer read .jpeg images. */
|
||||
#define _IRR_COMPILE_WITH_LIBJPEG_
|
||||
#ifdef NO_IRR_COMPILE_WITH_LIBJPEG_
|
||||
#undef _IRR_COMPILE_WITH_LIBJPEG_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_LIBPNG_ to enable compiling the engine using libpng.
|
||||
/** This enables the engine to read png images. If you comment this out,
|
||||
the engine will no longer read .png images. */
|
||||
#define _IRR_COMPILE_WITH_LIBPNG_
|
||||
#ifdef NO_IRR_COMPILE_WITH_LIBPNG_
|
||||
#undef _IRR_COMPILE_WITH_LIBPNG_
|
||||
#endif
|
||||
|
||||
//! Uncomment the following line if you want to ignore the deprecated warnings
|
||||
//#define IGNORE_DEPRECATED_WARNING
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ to support BillboardSceneNodes
|
||||
#define _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_
|
||||
#ifdef NO_IRR_COMPILE_WITH_BILLBOARD_SCENENODE_
|
||||
#undef _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ if you want to use bone based
|
||||
/** animated meshes. If you compile without this, you will be unable to load
|
||||
B3D, MS3D or X meshes */
|
||||
#define _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
|
||||
#ifdef NO_IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
|
||||
#undef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
|
||||
#endif
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
|
||||
//! Define _IRR_COMPILE_WITH_B3D_LOADER_ if you want to use Blitz3D files
|
||||
#define _IRR_COMPILE_WITH_B3D_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_B3D_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_B3D_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_X_LOADER_ if you want to use Microsoft X files
|
||||
#define _IRR_COMPILE_WITH_X_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_X_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_X_LOADER_
|
||||
#endif
|
||||
#endif // _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_OBJ_LOADER_ if you want to load Wavefront OBJ files
|
||||
#define _IRR_COMPILE_WITH_OBJ_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_OBJ_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_OBJ_LOADER_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_BMP_LOADER_ if you want to load .bmp files
|
||||
//! Disabling this loader will also disable the built-in font
|
||||
#define _IRR_COMPILE_WITH_BMP_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_BMP_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_BMP_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_JPG_LOADER_ if you want to load .jpg files
|
||||
#define _IRR_COMPILE_WITH_JPG_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_JPG_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_JPG_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_PNG_LOADER_ if you want to load .png files
|
||||
#define _IRR_COMPILE_WITH_PNG_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_PNG_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_PNG_LOADER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_TGA_LOADER_ if you want to load .tga files
|
||||
#define _IRR_COMPILE_WITH_TGA_LOADER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_TGA_LOADER_
|
||||
#undef _IRR_COMPILE_WITH_TGA_LOADER_
|
||||
#endif
|
||||
|
||||
//! Define _IRR_COMPILE_WITH_JPG_WRITER_ if you want to write .jpg files
|
||||
#define _IRR_COMPILE_WITH_JPG_WRITER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_JPG_WRITER_
|
||||
#undef _IRR_COMPILE_WITH_JPG_WRITER_
|
||||
#endif
|
||||
//! Define _IRR_COMPILE_WITH_PNG_WRITER_ if you want to write .png files
|
||||
#define _IRR_COMPILE_WITH_PNG_WRITER_
|
||||
#ifdef NO_IRR_COMPILE_WITH_PNG_WRITER_
|
||||
#undef _IRR_COMPILE_WITH_PNG_WRITER_
|
||||
#endif
|
||||
|
||||
//! Define __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ if you want to open ZIP and GZIP archives
|
||||
/** ZIP reading has several more options below to configure. */
|
||||
#define __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_
|
||||
#ifdef NO__IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_
|
||||
#undef __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_
|
||||
#endif
|
||||
#ifdef __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_
|
||||
//! Define _IRR_COMPILE_WITH_ZLIB_ to enable compiling the engine using zlib.
|
||||
/** This enables the engine to read from compressed .zip archives. If you
|
||||
disable this feature, the engine can still read archives, but only uncompressed
|
||||
ones. */
|
||||
#define _IRR_COMPILE_WITH_ZLIB_
|
||||
#ifdef NO_IRR_COMPILE_WITH_ZLIB_
|
||||
#undef _IRR_COMPILE_WITH_ZLIB_
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//! Define __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_ if you want to mount folders as archives
|
||||
#define __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_
|
||||
#ifdef NO__IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_
|
||||
#undef __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_
|
||||
#endif
|
||||
|
||||
// Some cleanup and standard stuff
|
||||
|
||||
#ifdef _IRR_WINDOWS_API_
|
||||
|
||||
// To build Irrlicht as a static library, you must define _IRR_STATIC_LIB_ in both the
|
||||
// Irrlicht build, *and* in the user application, before #including <irrlicht.h>
|
||||
#ifndef _IRR_STATIC_LIB_
|
||||
#ifdef IRRLICHT_EXPORTS
|
||||
#define IRRLICHT_API __declspec(dllexport)
|
||||
#else
|
||||
#define IRRLICHT_API __declspec(dllimport)
|
||||
#endif // IRRLICHT_EXPORT
|
||||
#else
|
||||
#define IRRLICHT_API
|
||||
#endif // _IRR_STATIC_LIB_
|
||||
|
||||
// Declare the calling convention.
|
||||
#if defined(_STDCALL_SUPPORTED)
|
||||
#ifdef _WIN32
|
||||
#define IRRCALLCONV __stdcall
|
||||
#else
|
||||
#define IRRCALLCONV __cdecl
|
||||
#endif // STDCALL_SUPPORTED
|
||||
|
||||
#else // _IRR_WINDOWS_API_
|
||||
|
||||
// Force symbol export in shared libraries built with gcc.
|
||||
#if defined(__GNUC__) && !defined(_IRR_STATIC_LIB_) && defined(IRRLICHT_EXPORTS)
|
||||
#define IRRLICHT_API __attribute__ ((visibility("default")))
|
||||
#else
|
||||
#define IRRLICHT_API
|
||||
#endif
|
||||
|
||||
#define IRRCALLCONV
|
||||
|
||||
#endif // _IRR_WINDOWS_API_
|
||||
|
||||
#if defined(_IRR_SOLARIS_PLATFORM_)
|
||||
#undef _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
|
||||
#endif
|
||||
|
||||
//! Define __IRR_HAS_S64 if the irr::s64 type should be enable (needs long long, available on most platforms, but not part of ISO C++ 98)
|
||||
#define __IRR_HAS_S64
|
||||
#ifdef NO__IRR_HAS_S64
|
||||
#undef __IRR_HAS_S64
|
||||
#endif
|
||||
|
||||
#ifndef __has_feature
|
||||
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
//! A few attributes are written in CSceneManager when _IRR_SCENEMANAGER_DEBUG is enabled
|
||||
// NOTE: Those attributes were used always until 1.8.0 and became a global define for 1.8.1
|
||||
// which is only enabled in debug because it had a large (sometimes >5%) impact on speed.
|
||||
// A better solution in the long run is to break the interface and remove _all_ attribute
|
||||
// access in functions like CSceneManager::drawAll and instead put that information in some
|
||||
// own struct/class or in CSceneManager.
|
||||
// See http://irrlicht.sourceforge.net/forum/viewtopic.php?f=2&t=48211 for the discussion.
|
||||
#define _IRR_SCENEMANAGER_DEBUG
|
||||
#ifdef NO_IRR_SCENEMANAGER_DEBUG
|
||||
#undef _IRR_SCENEMANAGER_DEBUG
|
||||
#endif
|
||||
#ifndef IRRLICHT_API
|
||||
#define IRRLICHT_API
|
||||
#endif
|
||||
|
||||
#endif // __IRR_COMPILE_CONFIG_H_INCLUDED__
|
||||
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "ICursorControl.h"
|
||||
#include "ITimer.h"
|
||||
#include "IOSOperator.h"
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
@ -34,6 +35,7 @@ namespace irr
|
||||
|
||||
namespace video {
|
||||
class IContextManager;
|
||||
extern "C" IRRLICHT_API bool IRRCALLCONV isDriverSupported(E_DRIVER_TYPE driver);
|
||||
} // end namespace video
|
||||
|
||||
//! The Irrlicht device. You can create it with createDevice() or createDeviceEx().
|
||||
@ -130,6 +132,11 @@ namespace irr
|
||||
/** \param text: New text of the window caption. */
|
||||
virtual void setWindowCaption(const wchar_t* text) = 0;
|
||||
|
||||
//! Sets the window icon.
|
||||
/** \param img The icon texture.
|
||||
\return False if no icon was set. */
|
||||
virtual bool setWindowIcon(const video::IImage *img) = 0;
|
||||
|
||||
//! Returns if the window is active.
|
||||
/** If the window is inactive,
|
||||
nothing needs to be drawn. So if you don't want to draw anything
|
||||
@ -156,6 +163,12 @@ namespace irr
|
||||
/** \return True if window is minimized. */
|
||||
virtual bool isWindowMinimized() const = 0;
|
||||
|
||||
//! Checks if the Irrlicht window is maximized
|
||||
//! Only fully works on SDL. Returns false, or the last value set via
|
||||
//! maximizeWindow() and restoreWindow(), on other backends.
|
||||
/** \return True if window is maximized. */
|
||||
virtual bool isWindowMaximized() const = 0;
|
||||
|
||||
//! Checks if the Irrlicht window is running in fullscreen mode
|
||||
/** \return True if window is fullscreen. */
|
||||
virtual bool isFullscreen() const = 0;
|
||||
@ -229,8 +242,8 @@ namespace irr
|
||||
as this would consume joystick info that 3rd party libraries might rely on. Call this method to
|
||||
activate joystick support in Irrlicht and to receive irr::SJoystickEvent events.
|
||||
\param joystickInfo On return, this will contain an array of each joystick that was found and activated.
|
||||
\return true if joysticks are supported on this device and _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
|
||||
is defined, false if joysticks are not supported or support is compiled out.
|
||||
\return true if joysticks are supported on this device, false if joysticks are not
|
||||
supported or support is compiled out.
|
||||
*/
|
||||
virtual bool activateJoysticks(core::array<SJoystickInfo>& joystickInfo) =0;
|
||||
|
||||
@ -299,42 +312,16 @@ namespace irr
|
||||
used. */
|
||||
virtual E_DEVICE_TYPE getType() const = 0;
|
||||
|
||||
//! Get the display density in dots per inch.
|
||||
//! Returns 0.0f on failure.
|
||||
virtual float getDisplayDensity() const = 0;
|
||||
|
||||
//! Check if a driver type is supported by the engine.
|
||||
/** Even if true is returned the driver may not be available
|
||||
for a configuration requested when creating the device. */
|
||||
static bool isDriverSupported(video::E_DRIVER_TYPE driver)
|
||||
{
|
||||
switch (driver)
|
||||
{
|
||||
case video::EDT_NULL:
|
||||
return true;
|
||||
case video::EDT_OPENGL:
|
||||
#ifdef _IRR_COMPILE_WITH_OPENGL_
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
case video::EDT_OGLES1:
|
||||
#ifdef _IRR_COMPILE_WITH_OGLES1_
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
case video::EDT_OGLES2:
|
||||
#ifdef _IRR_COMPILE_WITH_OGLES2_
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
case video::EDT_WEBGL1:
|
||||
#ifdef _IRR_COMPILE_WITH_WEBGL1_
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return video::isDriverSupported(driver);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -25,7 +25,7 @@ enum E_VERTEX_TYPE
|
||||
EVT_2TCOORDS,
|
||||
|
||||
//! Vertex with a tangent and binormal vector, video::S3DVertexTangents.
|
||||
/** Usually used for tangent space normal mapping.
|
||||
/** Usually used for tangent space normal mapping.
|
||||
Usually tangent and binormal get send to shaders as texture coordinate sets 1 and 2.
|
||||
*/
|
||||
EVT_TANGENTS
|
||||
@ -44,7 +44,7 @@ const char* const sBuiltInVertexTypeNames[] =
|
||||
struct S3DVertex
|
||||
{
|
||||
//! default constructor
|
||||
S3DVertex() {}
|
||||
S3DVertex() : Color(0xffffffff) {}
|
||||
|
||||
//! constructor
|
||||
S3DVertex(f32 x, f32 y, f32 z, f32 nx, f32 ny, f32 nz, SColor c, f32 tu, f32 tv)
|
||||
@ -142,7 +142,7 @@ struct S3DVertex2TCoords : public S3DVertex
|
||||
: S3DVertex(pos, normal, color, tcoords), TCoords2(tcoords) {}
|
||||
|
||||
//! constructor from S3DVertex
|
||||
S3DVertex2TCoords(S3DVertex& o) : S3DVertex(o) {}
|
||||
S3DVertex2TCoords(const S3DVertex& o) : S3DVertex(o) {}
|
||||
|
||||
//! Second set of texture coordinates
|
||||
core::vector2d<f32> TCoords2;
|
||||
@ -150,21 +150,21 @@ struct S3DVertex2TCoords : public S3DVertex
|
||||
//! Equality operator
|
||||
bool operator==(const S3DVertex2TCoords& other) const
|
||||
{
|
||||
return ((static_cast<S3DVertex>(*this)==other) &&
|
||||
return ((static_cast<S3DVertex>(*this)==static_cast<const S3DVertex&>(other)) &&
|
||||
(TCoords2 == other.TCoords2));
|
||||
}
|
||||
|
||||
//! Inequality operator
|
||||
bool operator!=(const S3DVertex2TCoords& other) const
|
||||
{
|
||||
return ((static_cast<S3DVertex>(*this)!=other) ||
|
||||
return ((static_cast<S3DVertex>(*this)!=static_cast<const S3DVertex&>(other)) ||
|
||||
(TCoords2 != other.TCoords2));
|
||||
}
|
||||
|
||||
bool operator<(const S3DVertex2TCoords& other) const
|
||||
{
|
||||
return ((static_cast<S3DVertex>(*this) < other) ||
|
||||
((static_cast<S3DVertex>(*this) == other) && (TCoords2 < other.TCoords2)));
|
||||
((static_cast<S3DVertex>(*this) == static_cast<const S3DVertex&>(other)) && (TCoords2 < other.TCoords2)));
|
||||
}
|
||||
|
||||
static E_VERTEX_TYPE getType()
|
||||
@ -186,7 +186,7 @@ struct S3DVertex2TCoords : public S3DVertex
|
||||
|
||||
|
||||
//! Vertex with a tangent and binormal vector.
|
||||
/** Usually used for tangent space normal mapping.
|
||||
/** Usually used for tangent space normal mapping.
|
||||
Usually tangent and binormal get send to shaders as texture coordinate sets 1 and 2.
|
||||
*/
|
||||
struct S3DVertexTangents : public S3DVertex
|
||||
@ -214,6 +214,9 @@ struct S3DVertexTangents : public S3DVertex
|
||||
const core::vector3df& binormal=core::vector3df())
|
||||
: S3DVertex(pos, normal, c, tcoords), Tangent(tangent), Binormal(binormal) { }
|
||||
|
||||
//! constructor from S3DVertex
|
||||
S3DVertexTangents(const S3DVertex& o) : S3DVertex(o) {}
|
||||
|
||||
//! Tangent vector along the x-axis of the texture
|
||||
core::vector3df Tangent;
|
||||
|
||||
@ -222,14 +225,14 @@ struct S3DVertexTangents : public S3DVertex
|
||||
|
||||
bool operator==(const S3DVertexTangents& other) const
|
||||
{
|
||||
return ((static_cast<S3DVertex>(*this)==other) &&
|
||||
return ((static_cast<S3DVertex>(*this)==static_cast<const S3DVertex&>(other)) &&
|
||||
(Tangent == other.Tangent) &&
|
||||
(Binormal == other.Binormal));
|
||||
}
|
||||
|
||||
bool operator!=(const S3DVertexTangents& other) const
|
||||
{
|
||||
return ((static_cast<S3DVertex>(*this)!=other) ||
|
||||
return ((static_cast<S3DVertex>(*this)!=static_cast<const S3DVertex&>(other)) ||
|
||||
(Tangent != other.Tangent) ||
|
||||
(Binormal != other.Binormal));
|
||||
}
|
||||
@ -237,8 +240,8 @@ struct S3DVertexTangents : public S3DVertex
|
||||
bool operator<(const S3DVertexTangents& other) const
|
||||
{
|
||||
return ((static_cast<S3DVertex>(*this) < other) ||
|
||||
((static_cast<S3DVertex>(*this) == other) && (Tangent < other.Tangent)) ||
|
||||
((static_cast<S3DVertex>(*this) == other) && (Tangent == other.Tangent) && (Binormal < other.Binormal)));
|
||||
((static_cast<S3DVertex>(*this) == static_cast<const S3DVertex&>(other)) && (Tangent < other.Tangent)) ||
|
||||
((static_cast<S3DVertex>(*this) == static_cast<const S3DVertex&>(other)) && (Tangent == other.Tangent) && (Binormal < other.Binormal)));
|
||||
}
|
||||
|
||||
static E_VERTEX_TYPE getType()
|
||||
|
@ -38,14 +38,14 @@ namespace scene
|
||||
|
||||
//! Gets the frame count of the animated mesh.
|
||||
/** \return Amount of frames. If the amount is 1, it is a static, non animated mesh. */
|
||||
virtual u32 getFrameCount() const _IRR_OVERRIDE_
|
||||
u32 getFrameCount() const override
|
||||
{
|
||||
return Meshes.size();
|
||||
}
|
||||
|
||||
//! Gets the default animation speed of the animated mesh.
|
||||
/** \return Amount of frames per second. If the amount is 0, it is a static, non animated mesh. */
|
||||
virtual f32 getAnimationSpeed() const _IRR_OVERRIDE_
|
||||
f32 getAnimationSpeed() const override
|
||||
{
|
||||
return FramesPerSecond;
|
||||
}
|
||||
@ -53,7 +53,7 @@ namespace scene
|
||||
//! Gets the frame count of the animated mesh.
|
||||
/** \param fps Frames per second to play the animation with. If the amount is 0, it is not animated.
|
||||
The actual speed is set in the scene node the mesh is instantiated in.*/
|
||||
virtual void setAnimationSpeed(f32 fps) _IRR_OVERRIDE_
|
||||
void setAnimationSpeed(f32 fps) override
|
||||
{
|
||||
FramesPerSecond=fps;
|
||||
}
|
||||
@ -66,7 +66,7 @@ namespace scene
|
||||
\param startFrameLoop: start frame
|
||||
\param endFrameLoop: end frame
|
||||
\return The animated mesh based on a detail level. */
|
||||
virtual IMesh* getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1) _IRR_OVERRIDE_
|
||||
IMesh* getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1) override
|
||||
{
|
||||
if (Meshes.empty())
|
||||
return 0;
|
||||
@ -86,13 +86,13 @@ namespace scene
|
||||
|
||||
//! Returns an axis aligned bounding box of the mesh.
|
||||
/** \return A bounding box of this mesh is returned. */
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_
|
||||
const core::aabbox3d<f32>& getBoundingBox() const override
|
||||
{
|
||||
return Box;
|
||||
}
|
||||
|
||||
//! set user axis aligned bounding box
|
||||
virtual void setBoundingBox(const core::aabbox3df& box) _IRR_OVERRIDE_
|
||||
void setBoundingBox(const core::aabbox3df& box) override
|
||||
{
|
||||
Box = box;
|
||||
}
|
||||
@ -112,13 +112,13 @@ namespace scene
|
||||
}
|
||||
|
||||
//! Returns the type of the animated mesh.
|
||||
virtual E_ANIMATED_MESH_TYPE getMeshType() const _IRR_OVERRIDE_
|
||||
E_ANIMATED_MESH_TYPE getMeshType() const override
|
||||
{
|
||||
return Type;
|
||||
}
|
||||
|
||||
//! returns amount of mesh buffers.
|
||||
virtual u32 getMeshBufferCount() const _IRR_OVERRIDE_
|
||||
u32 getMeshBufferCount() const override
|
||||
{
|
||||
if (Meshes.empty())
|
||||
return 0;
|
||||
@ -127,7 +127,7 @@ namespace scene
|
||||
}
|
||||
|
||||
//! returns pointer to a mesh buffer
|
||||
virtual IMeshBuffer* getMeshBuffer(u32 nr) const _IRR_OVERRIDE_
|
||||
IMeshBuffer* getMeshBuffer(u32 nr) const override
|
||||
{
|
||||
if (Meshes.empty())
|
||||
return 0;
|
||||
@ -139,7 +139,7 @@ namespace scene
|
||||
/** \param material: material to search for
|
||||
\return Returns the pointer to the mesh buffer or
|
||||
NULL if there is no such mesh buffer. */
|
||||
virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const _IRR_OVERRIDE_
|
||||
IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const override
|
||||
{
|
||||
if (Meshes.empty())
|
||||
return 0;
|
||||
@ -148,21 +148,21 @@ namespace scene
|
||||
}
|
||||
|
||||
//! Set a material flag for all meshbuffers of this mesh.
|
||||
virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) _IRR_OVERRIDE_
|
||||
void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) override
|
||||
{
|
||||
for (u32 i=0; i<Meshes.size(); ++i)
|
||||
Meshes[i]->setMaterialFlag(flag, newvalue);
|
||||
}
|
||||
|
||||
//! set the hardware mapping hint, for driver
|
||||
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX ) _IRR_OVERRIDE_
|
||||
void setHardwareMappingHint( E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX ) override
|
||||
{
|
||||
for (u32 i=0; i<Meshes.size(); ++i)
|
||||
Meshes[i]->setHardwareMappingHint(newMappingHint, buffer);
|
||||
}
|
||||
|
||||
//! flags the meshbuffer as changed, reloads hardware buffers
|
||||
virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_
|
||||
void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) override
|
||||
{
|
||||
for (u32 i=0; i<Meshes.size(); ++i)
|
||||
Meshes[i]->setDirty(buffer);
|
||||
|
@ -78,21 +78,6 @@ struct SExposedVideoData
|
||||
//! The EGLNativeWindowType object.
|
||||
void* Window;
|
||||
};
|
||||
|
||||
struct SOpenGLiOS
|
||||
{
|
||||
//! The EAGLContext object.
|
||||
void* Context;
|
||||
|
||||
//! The subview UIView object where the drawing happens.
|
||||
void* View;
|
||||
|
||||
//! The UIViewController object.
|
||||
void* ViewController;
|
||||
|
||||
//! The UIWindow object.
|
||||
void* Window;
|
||||
};
|
||||
|
||||
struct SOGLESAndroid
|
||||
{
|
||||
@ -107,7 +92,6 @@ struct SExposedVideoData
|
||||
SOpenGLLinux OpenGLLinux;
|
||||
SOpenGLOSX OpenGLOSX;
|
||||
SOpenGLFB OpenGLFB;
|
||||
SOpenGLiOS OpenGLiOS;
|
||||
SOGLESAndroid OGLESAndroid;
|
||||
};
|
||||
};
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "ILogger.h"
|
||||
#include "position2d.h"
|
||||
#include "path.h"
|
||||
#include "IrrCompileConfig.h"
|
||||
#include "IrrCompileConfig.h" // for IRRLICHT_SDK_VERSION
|
||||
|
||||
namespace irr
|
||||
{
|
||||
@ -24,12 +24,13 @@ namespace irr
|
||||
//! Constructs a SIrrlichtCreationParameters structure with default values.
|
||||
SIrrlichtCreationParameters() :
|
||||
DeviceType(EIDT_BEST),
|
||||
DriverType(video::EDT_BURNINGSVIDEO),
|
||||
DriverType(video::EDT_OPENGL),
|
||||
WindowSize(core::dimension2d<u32>(800, 600)),
|
||||
WindowPosition(core::position2di(-1,-1)),
|
||||
Bits(32),
|
||||
ZBufferBits(24),
|
||||
Fullscreen(false),
|
||||
WindowMaximized(false),
|
||||
WindowResizable(2),
|
||||
Stencilbuffer(true),
|
||||
Vsync(false),
|
||||
@ -52,7 +53,7 @@ namespace irr
|
||||
UsePerformanceTimer(true),
|
||||
SDK_version_do_not_use(IRRLICHT_SDK_VERSION),
|
||||
PrivateData(0),
|
||||
#if defined(_IRR_COMPILE_WITH_IOS_DEVICE_) || defined(_IRR_ANDROID_PLATFORM_) || defined(_IRR_EMSCRIPTEN_PLATFORM_)
|
||||
#ifdef IRR_MOBILE_PATHS
|
||||
OGLES2ShaderPath("media/Shaders/")
|
||||
#else
|
||||
OGLES2ShaderPath("../../media/Shaders/")
|
||||
@ -73,6 +74,7 @@ namespace irr
|
||||
Bits = other.Bits;
|
||||
ZBufferBits = other.ZBufferBits;
|
||||
Fullscreen = other.Fullscreen;
|
||||
WindowMaximized = other.WindowMaximized;
|
||||
WindowResizable = other.WindowResizable;
|
||||
Stencilbuffer = other.Stencilbuffer;
|
||||
Vsync = other.Vsync;
|
||||
@ -127,6 +129,9 @@ namespace irr
|
||||
/** Otherwise the device runs in windowed mode. Default: false. */
|
||||
bool Fullscreen;
|
||||
|
||||
//! Maximised window. (Only supported on SDL.) Default: false
|
||||
bool WindowMaximized;
|
||||
|
||||
//! Should a non-fullscreen window be resizable.
|
||||
/** Might not be supported by all devices. Ignored when Fullscreen is true.
|
||||
Values: 0 = not resizable, 1 = resizable, 2 = system decides default itself
|
||||
@ -230,7 +235,6 @@ namespace irr
|
||||
/** If this is set to a value other than 0, the Irrlicht Engine
|
||||
will be created in an already existing window.
|
||||
For Windows, set this to the HWND of the window you want.
|
||||
For iOS, assign UIView to this variable.
|
||||
The windowSize and FullScreen options will be ignored when using
|
||||
the WindowId parameter. Default this is set to 0.
|
||||
To make Irrlicht run inside the custom window, you still will
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "EMaterialTypes.h"
|
||||
#include "EMaterialFlags.h"
|
||||
#include "SMaterialLayer.h"
|
||||
#include "IrrCompileConfig.h" // for IRRLICHT_API
|
||||
|
||||
namespace irr
|
||||
{
|
||||
@ -280,7 +281,7 @@ namespace video
|
||||
/** SMaterial might ignore some textures in most function, like assignment and comparison,
|
||||
when SIrrlichtCreationParameters::MaxTextureUnits is set to a lower number.
|
||||
*/
|
||||
const u32 MATERIAL_MAX_TEXTURES = _IRR_MATERIAL_MAX_TEXTURES_;
|
||||
const u32 MATERIAL_MAX_TEXTURES = 4;
|
||||
|
||||
//! Struct for holding parameters for a material renderer
|
||||
// Note for implementors: Serialization is in CNullDriver
|
||||
|
@ -6,7 +6,6 @@
|
||||
#define __S_MATERIAL_LAYER_H_INCLUDED__
|
||||
|
||||
#include "matrix4.h"
|
||||
#include "irrAllocator.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
@ -69,8 +68,7 @@ namespace video
|
||||
{
|
||||
if ( TextureMatrix )
|
||||
{
|
||||
MatrixAllocator.destruct(TextureMatrix);
|
||||
MatrixAllocator.deallocate(TextureMatrix);
|
||||
delete TextureMatrix;
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,8 +88,7 @@ namespace video
|
||||
*TextureMatrix = *other.TextureMatrix;
|
||||
else
|
||||
{
|
||||
MatrixAllocator.destruct(TextureMatrix);
|
||||
MatrixAllocator.deallocate(TextureMatrix);
|
||||
delete TextureMatrix;
|
||||
TextureMatrix = 0;
|
||||
}
|
||||
}
|
||||
@ -99,8 +96,7 @@ namespace video
|
||||
{
|
||||
if (other.TextureMatrix)
|
||||
{
|
||||
TextureMatrix = MatrixAllocator.allocate(1);
|
||||
MatrixAllocator.construct(TextureMatrix,*other.TextureMatrix);
|
||||
TextureMatrix = new core::matrix4(*other.TextureMatrix);
|
||||
}
|
||||
else
|
||||
TextureMatrix = 0;
|
||||
@ -122,8 +118,7 @@ namespace video
|
||||
{
|
||||
if (!TextureMatrix)
|
||||
{
|
||||
TextureMatrix = MatrixAllocator.allocate(1);
|
||||
MatrixAllocator.construct(TextureMatrix,core::IdentityMatrix);
|
||||
TextureMatrix = new core::matrix4();
|
||||
}
|
||||
return *TextureMatrix;
|
||||
}
|
||||
@ -146,8 +141,7 @@ namespace video
|
||||
{
|
||||
if (!TextureMatrix)
|
||||
{
|
||||
TextureMatrix = MatrixAllocator.allocate(1);
|
||||
MatrixAllocator.construct(TextureMatrix,mat);
|
||||
TextureMatrix = new core::matrix4(mat);
|
||||
}
|
||||
else
|
||||
*TextureMatrix = mat;
|
||||
@ -216,7 +210,6 @@ namespace video
|
||||
|
||||
private:
|
||||
friend class SMaterial;
|
||||
irr::core::irrAllocator<irr::core::matrix4> MatrixAllocator;
|
||||
|
||||
//! Texture Matrix
|
||||
/** Do not access this element directly as the internal
|
||||
|
@ -44,20 +44,20 @@ namespace scene
|
||||
|
||||
|
||||
//! returns amount of mesh buffers.
|
||||
virtual u32 getMeshBufferCount() const _IRR_OVERRIDE_
|
||||
u32 getMeshBufferCount() const override
|
||||
{
|
||||
return MeshBuffers.size();
|
||||
}
|
||||
|
||||
//! returns pointer to a mesh buffer
|
||||
virtual IMeshBuffer* getMeshBuffer(u32 nr) const _IRR_OVERRIDE_
|
||||
IMeshBuffer* getMeshBuffer(u32 nr) const override
|
||||
{
|
||||
return MeshBuffers[nr];
|
||||
}
|
||||
|
||||
//! returns a meshbuffer which fits a material
|
||||
/** reverse search */
|
||||
virtual IMeshBuffer* getMeshBuffer( const video::SMaterial & material) const _IRR_OVERRIDE_
|
||||
IMeshBuffer* getMeshBuffer( const video::SMaterial & material) const override
|
||||
{
|
||||
for (s32 i = (s32)MeshBuffers.size()-1; i >= 0; --i)
|
||||
{
|
||||
@ -69,13 +69,13 @@ namespace scene
|
||||
}
|
||||
|
||||
//! returns an axis aligned bounding box
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_
|
||||
const core::aabbox3d<f32>& getBoundingBox() const override
|
||||
{
|
||||
return BoundingBox;
|
||||
}
|
||||
|
||||
//! set user axis aligned bounding box
|
||||
virtual void setBoundingBox( const core::aabbox3df& box) _IRR_OVERRIDE_
|
||||
void setBoundingBox( const core::aabbox3df& box) override
|
||||
{
|
||||
BoundingBox = box;
|
||||
}
|
||||
@ -118,21 +118,21 @@ namespace scene
|
||||
}
|
||||
|
||||
//! sets a flag of all contained materials to a new value
|
||||
virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) _IRR_OVERRIDE_
|
||||
void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) override
|
||||
{
|
||||
for (u32 i=0; i<MeshBuffers.size(); ++i)
|
||||
MeshBuffers[i]->getMaterial().setFlag(flag, newvalue);
|
||||
}
|
||||
|
||||
//! set the hardware mapping hint, for driver
|
||||
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX ) _IRR_OVERRIDE_
|
||||
void setHardwareMappingHint( E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX ) override
|
||||
{
|
||||
for (u32 i=0; i<MeshBuffers.size(); ++i)
|
||||
MeshBuffers[i]->setHardwareMappingHint(newMappingHint, buffer);
|
||||
}
|
||||
|
||||
//! flags the meshbuffer as changed, reloads hardware buffers
|
||||
virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_
|
||||
void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) override
|
||||
{
|
||||
for (u32 i=0; i<MeshBuffers.size(); ++i)
|
||||
MeshBuffers[i]->setDirty(buffer);
|
||||
|
@ -32,13 +32,13 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
}
|
||||
|
||||
//! Get Material of this buffer.
|
||||
virtual const video::SMaterial& getMaterial() const _IRR_OVERRIDE_
|
||||
const video::SMaterial& getMaterial() const override
|
||||
{
|
||||
return Material;
|
||||
}
|
||||
|
||||
//! Get Material of this buffer.
|
||||
virtual video::SMaterial& getMaterial() _IRR_OVERRIDE_
|
||||
video::SMaterial& getMaterial() override
|
||||
{
|
||||
return Material;
|
||||
}
|
||||
@ -58,7 +58,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
}
|
||||
|
||||
//! Get pointer to vertex array
|
||||
virtual const void* getVertices() const _IRR_OVERRIDE_
|
||||
const void* getVertices() const override
|
||||
{
|
||||
switch (VertexType)
|
||||
{
|
||||
@ -72,7 +72,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
}
|
||||
|
||||
//! Get pointer to vertex array
|
||||
virtual void* getVertices() _IRR_OVERRIDE_
|
||||
void* getVertices() override
|
||||
{
|
||||
switch (VertexType)
|
||||
{
|
||||
@ -86,7 +86,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
}
|
||||
|
||||
//! Get vertex count
|
||||
virtual u32 getVertexCount() const _IRR_OVERRIDE_
|
||||
u32 getVertexCount() const override
|
||||
{
|
||||
switch (VertexType)
|
||||
{
|
||||
@ -101,43 +101,43 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
|
||||
//! Get type of index data which is stored in this meshbuffer.
|
||||
/** \return Index type of this buffer. */
|
||||
virtual video::E_INDEX_TYPE getIndexType() const _IRR_OVERRIDE_
|
||||
video::E_INDEX_TYPE getIndexType() const override
|
||||
{
|
||||
return video::EIT_16BIT;
|
||||
}
|
||||
|
||||
//! Get pointer to index array
|
||||
virtual const u16* getIndices() const _IRR_OVERRIDE_
|
||||
const u16* getIndices() const override
|
||||
{
|
||||
return Indices.const_pointer();
|
||||
}
|
||||
|
||||
//! Get pointer to index array
|
||||
virtual u16* getIndices() _IRR_OVERRIDE_
|
||||
u16* getIndices() override
|
||||
{
|
||||
return Indices.pointer();
|
||||
}
|
||||
|
||||
//! Get index count
|
||||
virtual u32 getIndexCount() const _IRR_OVERRIDE_
|
||||
u32 getIndexCount() const override
|
||||
{
|
||||
return Indices.size();
|
||||
}
|
||||
|
||||
//! Get bounding box
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_
|
||||
const core::aabbox3d<f32>& getBoundingBox() const override
|
||||
{
|
||||
return BoundingBox;
|
||||
}
|
||||
|
||||
//! Set bounding box
|
||||
virtual void setBoundingBox( const core::aabbox3df& box) _IRR_OVERRIDE_
|
||||
void setBoundingBox( const core::aabbox3df& box) override
|
||||
{
|
||||
BoundingBox = box;
|
||||
}
|
||||
|
||||
//! Recalculate bounding box
|
||||
virtual void recalculateBoundingBox() _IRR_OVERRIDE_
|
||||
void recalculateBoundingBox() override
|
||||
{
|
||||
if(!BoundingBoxNeedsRecalculated)
|
||||
return;
|
||||
@ -186,7 +186,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
}
|
||||
|
||||
//! Get vertex type
|
||||
virtual video::E_VERTEX_TYPE getVertexType() const _IRR_OVERRIDE_
|
||||
video::E_VERTEX_TYPE getVertexType() const override
|
||||
{
|
||||
return VertexType;
|
||||
}
|
||||
@ -244,7 +244,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
}
|
||||
|
||||
//! returns position of vertex i
|
||||
virtual const core::vector3df& getPosition(u32 i) const _IRR_OVERRIDE_
|
||||
const core::vector3df& getPosition(u32 i) const override
|
||||
{
|
||||
switch (VertexType)
|
||||
{
|
||||
@ -258,7 +258,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
}
|
||||
|
||||
//! returns position of vertex i
|
||||
virtual core::vector3df& getPosition(u32 i) _IRR_OVERRIDE_
|
||||
core::vector3df& getPosition(u32 i) override
|
||||
{
|
||||
switch (VertexType)
|
||||
{
|
||||
@ -272,7 +272,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
}
|
||||
|
||||
//! returns normal of vertex i
|
||||
virtual const core::vector3df& getNormal(u32 i) const _IRR_OVERRIDE_
|
||||
const core::vector3df& getNormal(u32 i) const override
|
||||
{
|
||||
switch (VertexType)
|
||||
{
|
||||
@ -286,7 +286,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
}
|
||||
|
||||
//! returns normal of vertex i
|
||||
virtual core::vector3df& getNormal(u32 i) _IRR_OVERRIDE_
|
||||
core::vector3df& getNormal(u32 i) override
|
||||
{
|
||||
switch (VertexType)
|
||||
{
|
||||
@ -300,7 +300,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
}
|
||||
|
||||
//! returns texture coords of vertex i
|
||||
virtual const core::vector2df& getTCoords(u32 i) const _IRR_OVERRIDE_
|
||||
const core::vector2df& getTCoords(u32 i) const override
|
||||
{
|
||||
switch (VertexType)
|
||||
{
|
||||
@ -314,7 +314,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
}
|
||||
|
||||
//! returns texture coords of vertex i
|
||||
virtual core::vector2df& getTCoords(u32 i) _IRR_OVERRIDE_
|
||||
core::vector2df& getTCoords(u32 i) override
|
||||
{
|
||||
switch (VertexType)
|
||||
{
|
||||
@ -328,25 +328,25 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
}
|
||||
|
||||
//! append the vertices and indices to the current buffer
|
||||
virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) _IRR_OVERRIDE_ {}
|
||||
void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) override {}
|
||||
|
||||
//! append the meshbuffer to the current buffer
|
||||
virtual void append(const IMeshBuffer* const other) _IRR_OVERRIDE_ {}
|
||||
void append(const IMeshBuffer* const other) override {}
|
||||
|
||||
//! get the current hardware mapping hint for vertex buffers
|
||||
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const _IRR_OVERRIDE_
|
||||
E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const override
|
||||
{
|
||||
return MappingHint_Vertex;
|
||||
}
|
||||
|
||||
//! get the current hardware mapping hint for index buffers
|
||||
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const _IRR_OVERRIDE_
|
||||
E_HARDWARE_MAPPING getHardwareMappingHint_Index() const override
|
||||
{
|
||||
return MappingHint_Index;
|
||||
}
|
||||
|
||||
//! set the hardware mapping hint, for driver
|
||||
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX ) _IRR_OVERRIDE_
|
||||
void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX ) override
|
||||
{
|
||||
if (Buffer==EBT_VERTEX)
|
||||
MappingHint_Vertex=NewMappingHint;
|
||||
@ -360,19 +360,19 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
}
|
||||
|
||||
//! Describe what kind of primitive geometry is used by the meshbuffer
|
||||
virtual void setPrimitiveType(E_PRIMITIVE_TYPE type) _IRR_OVERRIDE_
|
||||
void setPrimitiveType(E_PRIMITIVE_TYPE type) override
|
||||
{
|
||||
PrimitiveType = type;
|
||||
}
|
||||
|
||||
//! Get the kind of primitive geometry which is used by the meshbuffer
|
||||
virtual E_PRIMITIVE_TYPE getPrimitiveType() const _IRR_OVERRIDE_
|
||||
E_PRIMITIVE_TYPE getPrimitiveType() const override
|
||||
{
|
||||
return PrimitiveType;
|
||||
}
|
||||
|
||||
//! flags the mesh as changed, reloads hardware buffers
|
||||
virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_
|
||||
void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX) override
|
||||
{
|
||||
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX)
|
||||
++ChangedID_Vertex;
|
||||
@ -380,15 +380,15 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
++ChangedID_Index;
|
||||
}
|
||||
|
||||
virtual u32 getChangedID_Vertex() const _IRR_OVERRIDE_ {return ChangedID_Vertex;}
|
||||
u32 getChangedID_Vertex() const override {return ChangedID_Vertex;}
|
||||
|
||||
virtual u32 getChangedID_Index() const _IRR_OVERRIDE_ {return ChangedID_Index;}
|
||||
u32 getChangedID_Index() const override {return ChangedID_Index;}
|
||||
|
||||
virtual void setHWBuffer(void *ptr) const _IRR_OVERRIDE_ {
|
||||
void setHWBuffer(void *ptr) const override {
|
||||
HWBuffer = ptr;
|
||||
}
|
||||
|
||||
virtual void *getHWBuffer() const _IRR_OVERRIDE_ {
|
||||
void *getHWBuffer() const override {
|
||||
return HWBuffer;
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
#ifndef __EXAMPLE_HELPER_H_INCLUDED__
|
||||
#define __EXAMPLE_HELPER_H_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
#include "path.h"
|
||||
|
||||
namespace irr
|
||||
@ -13,7 +12,7 @@ namespace irr
|
||||
|
||||
static io::path getExampleMediaPath()
|
||||
{
|
||||
#if defined (_IRR_IOS_PLATFORM_) || defined (_IRR_ANDROID_PLATFORM_) || defined (_IRR_OSX_PLATFORM_) || defined (_IRR_EMSCRIPTEN_PLATFORM_)
|
||||
#ifdef IRR_MOBILE_PATHS
|
||||
return io::path("media/");
|
||||
#else
|
||||
return io::path("../../media/");
|
||||
|
@ -1,113 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine" and the "irrXML" project.
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h and irrXML.h
|
||||
|
||||
#ifndef __IRR_ALLOCATOR_H_INCLUDED__
|
||||
#define __IRR_ALLOCATOR_H_INCLUDED__
|
||||
|
||||
#include "irrTypes.h"
|
||||
#include <new>
|
||||
// necessary for older compilers
|
||||
#include <memory.h>
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace core
|
||||
{
|
||||
|
||||
//! Very simple allocator implementation, containers using it can be used across dll boundaries
|
||||
template<typename T>
|
||||
class irrAllocator
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor
|
||||
virtual ~irrAllocator() {}
|
||||
|
||||
//! Allocate memory for an array of objects
|
||||
T* allocate(size_t cnt)
|
||||
{
|
||||
return (T*)internal_new(cnt* sizeof(T));
|
||||
}
|
||||
|
||||
//! Deallocate memory for an array of objects
|
||||
void deallocate(T* ptr)
|
||||
{
|
||||
internal_delete(ptr);
|
||||
}
|
||||
|
||||
//! Construct an element
|
||||
void construct(T* ptr, const T&e)
|
||||
{
|
||||
new ((void*)ptr) T(e);
|
||||
}
|
||||
|
||||
//! Destruct an element
|
||||
void destruct(T* ptr)
|
||||
{
|
||||
ptr->~T();
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
virtual void* internal_new(size_t cnt)
|
||||
{
|
||||
return operator new(cnt);
|
||||
}
|
||||
|
||||
virtual void internal_delete(void* ptr)
|
||||
{
|
||||
operator delete(ptr);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
//! Fast allocator, only to be used in containers inside the same memory heap.
|
||||
/** Containers using it are NOT able to be used it across dll boundaries. Use this
|
||||
when using in an internal class or function or when compiled into a static lib */
|
||||
template<typename T>
|
||||
class irrAllocatorFast
|
||||
{
|
||||
public:
|
||||
|
||||
//! Allocate memory for an array of objects
|
||||
T* allocate(size_t cnt)
|
||||
{
|
||||
return (T*)operator new(cnt* sizeof(T));
|
||||
}
|
||||
|
||||
//! Deallocate memory for an array of objects
|
||||
void deallocate(T* ptr)
|
||||
{
|
||||
operator delete(ptr);
|
||||
}
|
||||
|
||||
//! Construct an element
|
||||
void construct(T* ptr, const T&e)
|
||||
{
|
||||
new ((void*)ptr) T(e);
|
||||
}
|
||||
|
||||
//! Destruct an element
|
||||
void destruct(T* ptr)
|
||||
{
|
||||
ptr->~T();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//! defines an allocation strategy (used only by irr::array so far)
|
||||
enum eAllocStrategy
|
||||
{
|
||||
ALLOC_STRATEGY_SAFE = 0, // increase size by 1
|
||||
ALLOC_STRATEGY_DOUBLE = 1, // double size when under 500 elements, beyond that increase by 1/4th size. Plus a small constant.
|
||||
ALLOC_STRATEGY_SQRT = 2 // not implemented
|
||||
};
|
||||
|
||||
|
||||
} // end namespace core
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
@ -5,7 +5,6 @@
|
||||
#ifndef __IRR_MATH_H_INCLUDED__
|
||||
#define __IRR_MATH_H_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
#include "irrTypes.h"
|
||||
#include <math.h>
|
||||
#include <float.h>
|
||||
@ -21,9 +20,7 @@ namespace core
|
||||
|
||||
const s32 ROUNDING_ERROR_S32 = 0;
|
||||
|
||||
#ifdef __IRR_HAS_S64
|
||||
const s64 ROUNDING_ERROR_S64 = 0;
|
||||
#endif
|
||||
const f32 ROUNDING_ERROR_f32 = 0.000001f;
|
||||
const f64 ROUNDING_ERROR_f64 = 0.00000001;
|
||||
|
||||
@ -186,7 +183,6 @@ namespace core
|
||||
return ROUNDING_ERROR_S32;
|
||||
}
|
||||
|
||||
#ifdef __IRR_HAS_S64
|
||||
template <>
|
||||
inline s64 roundingError()
|
||||
{
|
||||
@ -198,7 +194,6 @@ namespace core
|
||||
{
|
||||
return ROUNDING_ERROR_S64;
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
inline T relativeErrorFactor()
|
||||
@ -310,13 +305,11 @@ namespace core
|
||||
return a <= tolerance;
|
||||
}
|
||||
|
||||
#ifdef __IRR_HAS_S64
|
||||
//! returns if a equals zero, taking rounding errors into account
|
||||
inline bool iszero(const s64 a, const s64 tolerance = 0)
|
||||
{
|
||||
return abs_(a) <= tolerance;
|
||||
}
|
||||
#endif
|
||||
|
||||
inline s32 s32_min(s32 a, s32 b)
|
||||
{
|
||||
@ -406,13 +399,11 @@ namespace core
|
||||
return static_cast<s32>(squareroot(static_cast<f32>(f)));
|
||||
}
|
||||
|
||||
#ifdef __IRR_HAS_S64
|
||||
// calculate: sqrt ( x )
|
||||
REALINLINE s64 squareroot(const s64 f)
|
||||
{
|
||||
return static_cast<s64>(squareroot(static_cast<f64>(f)));
|
||||
}
|
||||
#endif
|
||||
|
||||
// calculate: 1 / sqrt ( x )
|
||||
REALINLINE f64 reciprocal_squareroot(const f64 x)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -5,7 +5,6 @@
|
||||
#ifndef __IRR_TYPES_H_INCLUDED__
|
||||
#define __IRR_TYPES_H_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
#include <stdint.h>
|
||||
|
||||
namespace irr
|
||||
@ -38,13 +37,11 @@ typedef uint32_t u32;
|
||||
typedef int32_t s32;
|
||||
|
||||
|
||||
#ifdef __IRR_HAS_S64
|
||||
//! 64 bit unsigned variable.
|
||||
typedef uint64_t u64;
|
||||
|
||||
//! 64 bit signed variable.
|
||||
typedef int64_t s64;
|
||||
#endif // __IRR_HAS_S64
|
||||
|
||||
|
||||
|
||||
@ -112,13 +109,10 @@ For functions: template<class T> _IRR_DEPRECATED_ void test4(void) {}
|
||||
#define _IRR_DEPRECATED_
|
||||
#endif
|
||||
|
||||
//! Defines an override macro, to protect virtual functions from typos and other mismatches
|
||||
/** Usage in a derived class:
|
||||
virtual void somefunc() _IRR_OVERRIDE_;
|
||||
*/
|
||||
//! deprecated macro for virtual function override
|
||||
/** prefer to use the override keyword for new code */
|
||||
#define _IRR_OVERRIDE_ override
|
||||
|
||||
|
||||
//! creates four CC codes used in Irrlicht for simple ids
|
||||
/** some compilers can create those by directly writing the
|
||||
code like 'code', but some generate warnings so we use this macro here */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -29,13 +29,11 @@
|
||||
#ifndef __IRRLICHT_H_INCLUDED__
|
||||
#define __IRRLICHT_H_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
#include "aabbox3d.h"
|
||||
#include "CIndexBuffer.h"
|
||||
#include "CMeshBuffer.h"
|
||||
#include "coreutil.h"
|
||||
#include "CVertexBuffer.h"
|
||||
#include "IProfiler.h"
|
||||
#include "dimension2d.h"
|
||||
#include "ECullingTypes.h"
|
||||
#include "EDebugSceneTypes.h"
|
||||
@ -136,6 +134,7 @@
|
||||
#include "triangle3d.h"
|
||||
#include "vector2d.h"
|
||||
#include "vector3d.h"
|
||||
#include "IrrCompileConfig.h" // for IRRLICHT_API and IRRCALLCONV
|
||||
|
||||
/*! \mainpage Irrlicht Engine 1.9 API documentation
|
||||
*
|
||||
@ -272,7 +271,7 @@ namespace irr
|
||||
device could not be created.
|
||||
*/
|
||||
extern "C" IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDevice(
|
||||
video::E_DRIVER_TYPE driverType = video::EDT_SOFTWARE,
|
||||
video::E_DRIVER_TYPE driverType = video::EDT_OPENGL,
|
||||
// parentheses are necessary for some compilers
|
||||
const core::dimension2d<u32>& windowSize = (core::dimension2d<u32>(640,480)),
|
||||
u32 bits = 32,
|
||||
|
@ -1,70 +0,0 @@
|
||||
// Copyright (C) 2013 Michael Zeilfelder
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __LEAK_HUNTER_INCLUDED__
|
||||
#define __LEAK_HUNTER_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_
|
||||
|
||||
#include "irrArray.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
class IReferenceCounted;
|
||||
|
||||
//! A class helping to find unreleased objects of type IReferenceCounted.
|
||||
/** To use this you have recompile Irrlicht with _IRR_COMPILE_WITH_LEAK_HUNTER_.
|
||||
Note that this will slow down your application and should only be used for debugging.
|
||||
The way to use is that you can check after you closed and dropped your last Irrlicht device
|
||||
if there are still any IReferenceCounted left over which have not been deleted.
|
||||
*/
|
||||
class LeakHunter
|
||||
{
|
||||
public:
|
||||
friend class IReferenceCounted;
|
||||
|
||||
//! Clear all IReferenceCounted objects inside LeakHunter
|
||||
/** This does not affect the IReferenceCounted themselves only the
|
||||
counting of them. Usually you don't ever need to clear, but
|
||||
sometimes it helps when for example you want to ignore
|
||||
certain leaks.
|
||||
*/
|
||||
static void clearReferenceCountedObjects()
|
||||
{
|
||||
ReferenceCountedObjects.clear();
|
||||
}
|
||||
|
||||
//! Access all objects which are currently reference counted.
|
||||
static inline irr::core::array<const IReferenceCounted*> getReferenceCountedObjects()
|
||||
{
|
||||
return ReferenceCountedObjects;
|
||||
}
|
||||
|
||||
protected:
|
||||
static inline void addObject(const IReferenceCounted* object)
|
||||
{
|
||||
ReferenceCountedObjects.push_back(object);
|
||||
}
|
||||
|
||||
static inline void removeObject(const IReferenceCounted* object)
|
||||
{
|
||||
irr::s32 idx = ReferenceCountedObjects.linear_search(object );
|
||||
if ( idx >= 0 )
|
||||
{
|
||||
irr::core::swap( ReferenceCountedObjects[idx], ReferenceCountedObjects.getLast() );
|
||||
ReferenceCountedObjects.erase( ReferenceCountedObjects.size()-1 );
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
// NOTE: We don't do additional grab()/drop()'s here as we want to supervise reference counted objects and not affect them otherwise.
|
||||
IRRLICHT_API static irr::core::array<const IReferenceCounted*> ReferenceCountedObjects;
|
||||
};
|
||||
} // end namespace irr
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_LEAK_HUNTER_
|
||||
|
||||
#endif
|
@ -12,6 +12,7 @@
|
||||
#include "aabbox3d.h"
|
||||
#include "rect.h"
|
||||
#include "irrString.h"
|
||||
#include "IrrCompileConfig.h" // for IRRLICHT_API
|
||||
|
||||
// enable this to keep track of changes to the matrix
|
||||
// and make simpler identity check for seldom changing matrices
|
||||
@ -142,7 +143,7 @@ namespace core
|
||||
|
||||
//! Set this matrix to the product of two matrices
|
||||
/** Calculate b*a, no optimization used,
|
||||
use it if you know you never have a identity matrix */
|
||||
use it if you know you never have an identity matrix */
|
||||
CMatrix4<T>& setbyproduct_nocheck(const CMatrix4<T>& other_a,const CMatrix4<T>& other_b );
|
||||
|
||||
//! Multiply by another matrix.
|
||||
@ -150,7 +151,8 @@ namespace core
|
||||
CMatrix4<T> operator*(const CMatrix4<T>& other) const;
|
||||
|
||||
//! Multiply by another matrix.
|
||||
/** Calculate and return other*this */
|
||||
/** Like calling: (*this) = (*this) * other
|
||||
*/
|
||||
CMatrix4<T>& operator*=(const CMatrix4<T>& other);
|
||||
|
||||
//! Multiply by scalar.
|
||||
@ -186,14 +188,25 @@ namespace core
|
||||
//! Make a rotation matrix from Euler angles. The 4th row and column are unmodified.
|
||||
CMatrix4<T>& setRotationDegrees( const vector3d<T>& rotation );
|
||||
|
||||
//! Get the rotation, as set by setRotation() when you already know the scale.
|
||||
/** If you already know the scale then this function is faster than the other getRotationDegrees overload.
|
||||
NOTE: You will have the same end-rotation as used in setRotation, but it might not use the same axis values.
|
||||
//! Get the rotation, as set by setRotation() when you already know the scale used to create the matrix
|
||||
/** NOTE: The scale needs to be the correct one used to create this matrix.
|
||||
You can _not_ use the result of getScale(), but have to save your scale
|
||||
variable in another place (like ISceneNode does).
|
||||
NOTE: No scale value can be 0 or the result is undefined.
|
||||
NOTE: It does not necessarily return the *same* Euler angles as those set by setRotationDegrees(),
|
||||
but the rotation will be equivalent, i.e. will have the same result when used to rotate a vector or node.
|
||||
NOTE: It will (usually) give wrong results when further transformations have been added in the matrix (like shear).
|
||||
WARNING: There have been troubles with this function over the years and we may still have missed some corner cases.
|
||||
It's generally safer to keep the rotation and scale you used to create the matrix around and work with those.
|
||||
*/
|
||||
core::vector3d<T> getRotationDegrees(const vector3d<T>& scale) const;
|
||||
|
||||
//! Returns the rotation, as set by setRotation().
|
||||
/** NOTE: You will have the same end-rotation as used in setRotation, but it might not use the same axis values.
|
||||
NOTE: This only works correct if no other matrix operations have been done on the inner 3x3 matrix besides
|
||||
setting rotation (so no scale/shear). Thought it (probably) works as long as scale doesn't flip handedness.
|
||||
NOTE: It does not necessarily return the *same* Euler angles as those set by setRotationDegrees(),
|
||||
but the rotation will be equivalent, i.e. will have the same result when used to rotate a vector or node.
|
||||
*/
|
||||
core::vector3d<T> getRotationDegrees() const;
|
||||
|
||||
@ -827,11 +840,9 @@ namespace core
|
||||
|
||||
//! Returns the absolute values of the scales of the matrix.
|
||||
/**
|
||||
Note that this returns the absolute (positive) values unless only scale is set.
|
||||
Unfortunately it does not appear to be possible to extract any original negative
|
||||
values. The best that we could do would be to arbitrarily make one scale
|
||||
negative if one or three of them were negative.
|
||||
FIXME - return the original values.
|
||||
Note: You only get back original values if the matrix only set the scale.
|
||||
Otherwise the result is a scale you can use to normalize the matrix axes,
|
||||
but it's usually no longer what you did set with setScale.
|
||||
*/
|
||||
template <class T>
|
||||
inline vector3d<T> CMatrix4<T>::getScale() const
|
||||
@ -894,33 +905,16 @@ namespace core
|
||||
}
|
||||
|
||||
|
||||
//! Returns a rotation that is equivalent to that set by setRotationDegrees().
|
||||
/** This code was sent in by Chev. Note that it does not necessarily return
|
||||
the *same* Euler angles as those set by setRotationDegrees(), but the rotation will
|
||||
be equivalent, i.e. will have the same result when used to rotate a vector or node.
|
||||
This code was originally written by by Chev.
|
||||
//! Returns a rotation which (mostly) works in combination with the given scale
|
||||
/**
|
||||
This code was originally written by by Chev (assuming no scaling back then,
|
||||
we can be blamed for all problems added by regarding scale)
|
||||
*/
|
||||
template <class T>
|
||||
inline core::vector3d<T> CMatrix4<T>::getRotationDegrees(const vector3d<T>& scale_) const
|
||||
{
|
||||
const CMatrix4<T> &mat = *this;
|
||||
core::vector3d<T> scale(scale_);
|
||||
// we need to check for negative scale on to axes, which would bring up wrong results
|
||||
if (scale.Y<0 && scale.Z<0)
|
||||
{
|
||||
scale.Y =-scale.Y;
|
||||
scale.Z =-scale.Z;
|
||||
}
|
||||
else if (scale.X<0 && scale.Z<0)
|
||||
{
|
||||
scale.X =-scale.X;
|
||||
scale.Z =-scale.Z;
|
||||
}
|
||||
else if (scale.X<0 && scale.Y<0)
|
||||
{
|
||||
scale.X =-scale.X;
|
||||
scale.Y =-scale.Y;
|
||||
}
|
||||
const core::vector3d<f64> scale(core::iszero(scale_.X) ? FLT_MAX : scale_.X , core::iszero(scale_.Y) ? FLT_MAX : scale_.Y, core::iszero(scale_.Z) ? FLT_MAX : scale_.Z);
|
||||
const core::vector3d<f64> invScale(core::reciprocal(scale.X),core::reciprocal(scale.Y),core::reciprocal(scale.Z));
|
||||
|
||||
f64 Y = -asin(core::clamp(mat[2]*invScale.X, -1.0, 1.0));
|
||||
@ -929,7 +923,7 @@ namespace core
|
||||
|
||||
f64 rotx, roty, X, Z;
|
||||
|
||||
if (!core::iszero(C))
|
||||
if (!core::iszero((T)C))
|
||||
{
|
||||
const f64 invC = core::reciprocal(C);
|
||||
rotx = mat[10] * invC * invScale.Z;
|
||||
@ -956,14 +950,37 @@ namespace core
|
||||
}
|
||||
|
||||
//! Returns a rotation that is equivalent to that set by setRotationDegrees().
|
||||
/** This code was sent in by Chev. Note that it does not necessarily return
|
||||
the *same* Euler angles as those set by setRotationDegrees(), but the rotation will
|
||||
be equivalent, i.e. will have the same result when used to rotate a vector or node.
|
||||
This code was originally written by by Chev. */
|
||||
template <class T>
|
||||
inline core::vector3d<T> CMatrix4<T>::getRotationDegrees() const
|
||||
{
|
||||
return getRotationDegrees(getScale());
|
||||
// Note: Using getScale() here make it look like it could do matrix decomposition.
|
||||
// It can't! It works (or should work) as long as rotation doesn't flip the handedness
|
||||
// aka scale swapping 1 or 3 axes. (I think we could catch that as well by comparing
|
||||
// crossproduct of first 2 axes to direction of third axis, but TODO)
|
||||
// And maybe it should also offer the solution for the simple calculation
|
||||
// without regarding scaling as Irrlicht did before 1.7
|
||||
core::vector3d<T> scale(getScale());
|
||||
|
||||
// We assume the matrix uses rotations instead of negative scaling 2 axes.
|
||||
// Otherwise it fails even for some simple cases, like rotating around
|
||||
// 2 axes by 180<38> which getScale thinks is a negative scaling.
|
||||
if (scale.Y<0 && scale.Z<0)
|
||||
{
|
||||
scale.Y =-scale.Y;
|
||||
scale.Z =-scale.Z;
|
||||
}
|
||||
else if (scale.X<0 && scale.Z<0)
|
||||
{
|
||||
scale.X =-scale.X;
|
||||
scale.Z =-scale.Z;
|
||||
}
|
||||
else if (scale.X<0 && scale.Y<0)
|
||||
{
|
||||
scale.X =-scale.X;
|
||||
scale.Y =-scale.Y;
|
||||
}
|
||||
|
||||
return getRotationDegrees(scale);
|
||||
}
|
||||
|
||||
|
||||
@ -1155,10 +1172,10 @@ namespace core
|
||||
template <class T>
|
||||
inline void CMatrix4<T>::rotateVect( vector3df& vect ) const
|
||||
{
|
||||
vector3df tmp = vect;
|
||||
vect.X = tmp.X*M[0] + tmp.Y*M[4] + tmp.Z*M[8];
|
||||
vect.Y = tmp.X*M[1] + tmp.Y*M[5] + tmp.Z*M[9];
|
||||
vect.Z = tmp.X*M[2] + tmp.Y*M[6] + tmp.Z*M[10];
|
||||
vector3d<T> tmp(static_cast<T>(vect.X), static_cast<T>(vect.Y), static_cast<T>(vect.Z));
|
||||
vect.X = static_cast<f32>(tmp.X*M[0] + tmp.Y*M[4] + tmp.Z*M[8]);
|
||||
vect.Y = static_cast<f32>(tmp.X*M[1] + tmp.Y*M[5] + tmp.Z*M[9]);
|
||||
vect.Z = static_cast<f32>(tmp.X*M[2] + tmp.Y*M[6] + tmp.Z*M[10]);
|
||||
}
|
||||
|
||||
//! An alternate transform vector method, writing into a second vector
|
||||
@ -1182,24 +1199,24 @@ namespace core
|
||||
template <class T>
|
||||
inline void CMatrix4<T>::inverseRotateVect( vector3df& vect ) const
|
||||
{
|
||||
vector3df tmp = vect;
|
||||
vect.X = tmp.X*M[0] + tmp.Y*M[1] + tmp.Z*M[2];
|
||||
vect.Y = tmp.X*M[4] + tmp.Y*M[5] + tmp.Z*M[6];
|
||||
vect.Z = tmp.X*M[8] + tmp.Y*M[9] + tmp.Z*M[10];
|
||||
vector3d<T> tmp(static_cast<T>(vect.X), static_cast<T>(vect.Y), static_cast<T>(vect.Z));
|
||||
vect.X = static_cast<f32>(tmp.X*M[0] + tmp.Y*M[1] + tmp.Z*M[2]);
|
||||
vect.Y = static_cast<f32>(tmp.X*M[4] + tmp.Y*M[5] + tmp.Z*M[6]);
|
||||
vect.Z = static_cast<f32>(tmp.X*M[8] + tmp.Y*M[9] + tmp.Z*M[10]);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline void CMatrix4<T>::transformVect( vector3df& vect) const
|
||||
{
|
||||
f32 vector[3];
|
||||
T vector[3];
|
||||
|
||||
vector[0] = vect.X*M[0] + vect.Y*M[4] + vect.Z*M[8] + M[12];
|
||||
vector[1] = vect.X*M[1] + vect.Y*M[5] + vect.Z*M[9] + M[13];
|
||||
vector[2] = vect.X*M[2] + vect.Y*M[6] + vect.Z*M[10] + M[14];
|
||||
|
||||
vect.X = vector[0];
|
||||
vect.Y = vector[1];
|
||||
vect.Z = vector[2];
|
||||
vect.X = static_cast<f32>(vector[0]);
|
||||
vect.Y = static_cast<f32>(vector[1]);
|
||||
vect.Z = static_cast<f32>(vector[2]);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include "IrrCompileConfig.h"
|
||||
#include "IrrCompileConfig.h" // for IRRLICHT_API
|
||||
#include "irrTypes.h"
|
||||
#include "IContextManager.h"
|
||||
#include <KHR/khrplatform.h>
|
||||
|
75
media/Shaders/OneTextureBlend.fsh
Normal file
75
media/Shaders/OneTextureBlend.fsh
Normal file
@ -0,0 +1,75 @@
|
||||
#version 100
|
||||
|
||||
precision mediump float;
|
||||
|
||||
/* Uniforms */
|
||||
|
||||
uniform int uTextureUsage0;
|
||||
uniform sampler2D uTextureUnit0;
|
||||
uniform int uBlendType;
|
||||
uniform int uFogEnable;
|
||||
uniform int uFogType;
|
||||
uniform vec4 uFogColor;
|
||||
uniform float uFogStart;
|
||||
uniform float uFogEnd;
|
||||
uniform float uFogDensity;
|
||||
|
||||
/* Varyings */
|
||||
|
||||
varying vec2 vTextureCoord0;
|
||||
varying vec4 vVertexColor;
|
||||
varying float vFogCoord;
|
||||
|
||||
float computeFog()
|
||||
{
|
||||
const float LOG2 = 1.442695;
|
||||
float FogFactor = 0.0;
|
||||
|
||||
if (uFogType == 0) // Exp
|
||||
{
|
||||
FogFactor = exp2(-uFogDensity * vFogCoord * LOG2);
|
||||
}
|
||||
else if (uFogType == 1) // Linear
|
||||
{
|
||||
float Scale = 1.0 / (uFogEnd - uFogStart);
|
||||
FogFactor = (uFogEnd - vFogCoord) * Scale;
|
||||
}
|
||||
else if (uFogType == 2) // Exp2
|
||||
{
|
||||
FogFactor = exp2(-uFogDensity * uFogDensity * vFogCoord * vFogCoord * LOG2);
|
||||
}
|
||||
|
||||
FogFactor = clamp(FogFactor, 0.0, 1.0);
|
||||
|
||||
return FogFactor;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 Color0 = vVertexColor;
|
||||
vec4 Color1 = vec4(1.0, 1.0, 1.0, 1.0);
|
||||
|
||||
if (bool(uTextureUsage0))
|
||||
Color1 = texture2D(uTextureUnit0, vTextureCoord0);
|
||||
|
||||
vec4 FinalColor = Color0 * Color1;
|
||||
|
||||
if (uBlendType == 1)
|
||||
{
|
||||
FinalColor.w = Color0.w;
|
||||
}
|
||||
else if (uBlendType == 2)
|
||||
{
|
||||
FinalColor.w = Color1.w;
|
||||
}
|
||||
|
||||
if (bool(uFogEnable))
|
||||
{
|
||||
float FogFactor = computeFog();
|
||||
vec4 FogColor = uFogColor;
|
||||
FogColor.a = 1.0;
|
||||
FinalColor = mix(FogColor, FinalColor, FogFactor);
|
||||
}
|
||||
|
||||
gl_FragColor = FinalColor;
|
||||
}
|
23
media/Shaders/Renderer2D.fsh
Normal file
23
media/Shaders/Renderer2D.fsh
Normal file
@ -0,0 +1,23 @@
|
||||
#version 100
|
||||
|
||||
precision mediump float;
|
||||
|
||||
/* Uniforms */
|
||||
|
||||
uniform int uTextureUsage;
|
||||
uniform sampler2D uTextureUnit;
|
||||
|
||||
/* Varyings */
|
||||
|
||||
varying vec2 vTextureCoord;
|
||||
varying vec4 vVertexColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 Color = vVertexColor;
|
||||
|
||||
if (bool(uTextureUsage))
|
||||
Color *= texture2D(uTextureUnit, vTextureCoord);
|
||||
|
||||
gl_FragColor = Color;
|
||||
}
|
24
media/Shaders/Renderer2D.vsh
Normal file
24
media/Shaders/Renderer2D.vsh
Normal file
@ -0,0 +1,24 @@
|
||||
#version 100
|
||||
|
||||
/* Attributes */
|
||||
|
||||
attribute vec4 inVertexPosition;
|
||||
attribute vec4 inVertexColor;
|
||||
attribute vec2 inTexCoord0;
|
||||
|
||||
/* Uniforms */
|
||||
|
||||
uniform float uThickness;
|
||||
|
||||
/* Varyings */
|
||||
|
||||
varying vec2 vTextureCoord;
|
||||
varying vec4 vVertexColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = inVertexPosition;
|
||||
gl_PointSize = uThickness;
|
||||
vTextureCoord = inTexCoord0;
|
||||
vVertexColor = inVertexColor.bgra;
|
||||
}
|
11
media/Shaders/Renderer2D_noTex.fsh
Normal file
11
media/Shaders/Renderer2D_noTex.fsh
Normal file
@ -0,0 +1,11 @@
|
||||
#version 100
|
||||
|
||||
precision mediump float;
|
||||
|
||||
/* Varyings */
|
||||
varying vec4 vVertexColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_FragColor = vVertexColor;
|
||||
}
|
62
media/Shaders/Solid.fsh
Normal file
62
media/Shaders/Solid.fsh
Normal file
@ -0,0 +1,62 @@
|
||||
#version 100
|
||||
|
||||
precision mediump float;
|
||||
|
||||
/* Uniforms */
|
||||
|
||||
uniform int uTextureUsage0;
|
||||
uniform sampler2D uTextureUnit0;
|
||||
uniform int uFogEnable;
|
||||
uniform int uFogType;
|
||||
uniform vec4 uFogColor;
|
||||
uniform float uFogStart;
|
||||
uniform float uFogEnd;
|
||||
uniform float uFogDensity;
|
||||
|
||||
/* Varyings */
|
||||
|
||||
varying vec2 vTextureCoord0;
|
||||
varying vec4 vVertexColor;
|
||||
varying float vFogCoord;
|
||||
|
||||
float computeFog()
|
||||
{
|
||||
const float LOG2 = 1.442695;
|
||||
float FogFactor = 0.0;
|
||||
|
||||
if (uFogType == 0) // Exp
|
||||
{
|
||||
FogFactor = exp2(-uFogDensity * vFogCoord * LOG2);
|
||||
}
|
||||
else if (uFogType == 1) // Linear
|
||||
{
|
||||
float Scale = 1.0 / (uFogEnd - uFogStart);
|
||||
FogFactor = (uFogEnd - vFogCoord) * Scale;
|
||||
}
|
||||
else if (uFogType == 2) // Exp2
|
||||
{
|
||||
FogFactor = exp2(-uFogDensity * uFogDensity * vFogCoord * vFogCoord * LOG2);
|
||||
}
|
||||
|
||||
FogFactor = clamp(FogFactor, 0.0, 1.0);
|
||||
|
||||
return FogFactor;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 Color = vVertexColor;
|
||||
|
||||
if (bool(uTextureUsage0))
|
||||
Color *= texture2D(uTextureUnit0, vTextureCoord0);
|
||||
|
||||
if (bool(uFogEnable))
|
||||
{
|
||||
float FogFactor = computeFog();
|
||||
vec4 FogColor = uFogColor;
|
||||
FogColor.a = 1.0;
|
||||
Color = mix(FogColor, Color, FogFactor);
|
||||
}
|
||||
|
||||
gl_FragColor = Color;
|
||||
}
|
38
media/Shaders/Solid.vsh
Normal file
38
media/Shaders/Solid.vsh
Normal file
@ -0,0 +1,38 @@
|
||||
#version 100
|
||||
|
||||
/* Attributes */
|
||||
|
||||
attribute vec3 inVertexPosition;
|
||||
attribute vec3 inVertexNormal;
|
||||
attribute vec4 inVertexColor;
|
||||
attribute vec2 inTexCoord0;
|
||||
|
||||
/* Uniforms */
|
||||
|
||||
uniform mat4 uWVPMatrix;
|
||||
uniform mat4 uWVMatrix;
|
||||
uniform mat4 uNMatrix;
|
||||
uniform mat4 uTMatrix0;
|
||||
|
||||
uniform float uThickness;
|
||||
|
||||
/* Varyings */
|
||||
|
||||
varying vec2 vTextureCoord0;
|
||||
varying vec4 vVertexColor;
|
||||
varying float vFogCoord;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = uWVPMatrix * vec4(inVertexPosition, 1.0);
|
||||
gl_PointSize = uThickness;
|
||||
|
||||
vec4 TextureCoord0 = vec4(inTexCoord0.x, inTexCoord0.y, 1.0, 1.0);
|
||||
vTextureCoord0 = vec4(uTMatrix0 * TextureCoord0).xy;
|
||||
|
||||
vVertexColor = inVertexColor.bgra;
|
||||
|
||||
vec3 Position = (uWVMatrix * vec4(inVertexPosition, 1.0)).xyz;
|
||||
|
||||
vFogCoord = length(Position);
|
||||
}
|
69
media/Shaders/TransparentAlphaChannel.fsh
Normal file
69
media/Shaders/TransparentAlphaChannel.fsh
Normal file
@ -0,0 +1,69 @@
|
||||
#version 100
|
||||
|
||||
precision mediump float;
|
||||
|
||||
/* Uniforms */
|
||||
|
||||
uniform float uAlphaRef;
|
||||
uniform int uTextureUsage0;
|
||||
uniform sampler2D uTextureUnit0;
|
||||
uniform int uFogEnable;
|
||||
uniform int uFogType;
|
||||
uniform vec4 uFogColor;
|
||||
uniform float uFogStart;
|
||||
uniform float uFogEnd;
|
||||
uniform float uFogDensity;
|
||||
|
||||
/* Varyings */
|
||||
|
||||
varying vec2 vTextureCoord0;
|
||||
varying vec4 vVertexColor;
|
||||
varying float vFogCoord;
|
||||
|
||||
float computeFog()
|
||||
{
|
||||
const float LOG2 = 1.442695;
|
||||
float FogFactor = 0.0;
|
||||
|
||||
if (uFogType == 0) // Exp
|
||||
{
|
||||
FogFactor = exp2(-uFogDensity * vFogCoord * LOG2);
|
||||
}
|
||||
else if (uFogType == 1) // Linear
|
||||
{
|
||||
float Scale = 1.0 / (uFogEnd - uFogStart);
|
||||
FogFactor = (uFogEnd - vFogCoord) * Scale;
|
||||
}
|
||||
else if (uFogType == 2) // Exp2
|
||||
{
|
||||
FogFactor = exp2(-uFogDensity * uFogDensity * vFogCoord * vFogCoord * LOG2);
|
||||
}
|
||||
|
||||
FogFactor = clamp(FogFactor, 0.0, 1.0);
|
||||
|
||||
return FogFactor;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 Color = vVertexColor;
|
||||
|
||||
if (bool(uTextureUsage0))
|
||||
{
|
||||
Color *= texture2D(uTextureUnit0, vTextureCoord0);
|
||||
|
||||
// TODO: uAlphaRef should rather control sharpness of alpha, don't know how to do that right now and this works in most cases.
|
||||
if (Color.a < uAlphaRef)
|
||||
discard;
|
||||
}
|
||||
|
||||
if (bool(uFogEnable))
|
||||
{
|
||||
float FogFactor = computeFog();
|
||||
vec4 FogColor = uFogColor;
|
||||
FogColor.a = 1.0;
|
||||
Color = mix(FogColor, Color, FogFactor);
|
||||
}
|
||||
|
||||
gl_FragColor = Color;
|
||||
}
|
66
media/Shaders/TransparentAlphaChannelRef.fsh
Normal file
66
media/Shaders/TransparentAlphaChannelRef.fsh
Normal file
@ -0,0 +1,66 @@
|
||||
#version 100
|
||||
|
||||
precision mediump float;
|
||||
|
||||
/* Uniforms */
|
||||
|
||||
uniform float uAlphaRef;
|
||||
uniform int uTextureUsage0;
|
||||
uniform sampler2D uTextureUnit0;
|
||||
uniform int uFogEnable;
|
||||
uniform int uFogType;
|
||||
uniform vec4 uFogColor;
|
||||
uniform float uFogStart;
|
||||
uniform float uFogEnd;
|
||||
uniform float uFogDensity;
|
||||
|
||||
/* Varyings */
|
||||
|
||||
varying vec2 vTextureCoord0;
|
||||
varying vec4 vVertexColor;
|
||||
varying float vFogCoord;
|
||||
|
||||
float computeFog()
|
||||
{
|
||||
const float LOG2 = 1.442695;
|
||||
float FogFactor = 0.0;
|
||||
|
||||
if (uFogType == 0) // Exp
|
||||
{
|
||||
FogFactor = exp2(-uFogDensity * vFogCoord * LOG2);
|
||||
}
|
||||
else if (uFogType == 1) // Linear
|
||||
{
|
||||
float Scale = 1.0 / (uFogEnd - uFogStart);
|
||||
FogFactor = (uFogEnd - vFogCoord) * Scale;
|
||||
}
|
||||
else if (uFogType == 2) // Exp2
|
||||
{
|
||||
FogFactor = exp2(-uFogDensity * uFogDensity * vFogCoord * vFogCoord * LOG2);
|
||||
}
|
||||
|
||||
FogFactor = clamp(FogFactor, 0.0, 1.0);
|
||||
|
||||
return FogFactor;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 Color = vVertexColor;
|
||||
|
||||
if (bool(uTextureUsage0))
|
||||
Color *= texture2D(uTextureUnit0, vTextureCoord0);
|
||||
|
||||
if (Color.a < uAlphaRef)
|
||||
discard;
|
||||
|
||||
if (bool(uFogEnable))
|
||||
{
|
||||
float FogFactor = computeFog();
|
||||
vec4 FogColor = uFogColor;
|
||||
FogColor.a = 1.0;
|
||||
Color = mix(FogColor, Color, FogFactor);
|
||||
}
|
||||
|
||||
gl_FragColor = Color;
|
||||
}
|
62
media/Shaders/TransparentVertexAlpha.fsh
Normal file
62
media/Shaders/TransparentVertexAlpha.fsh
Normal file
@ -0,0 +1,62 @@
|
||||
#version 100
|
||||
|
||||
precision mediump float;
|
||||
|
||||
/* Uniforms */
|
||||
|
||||
uniform int uTextureUsage0;
|
||||
uniform sampler2D uTextureUnit0;
|
||||
uniform int uFogEnable;
|
||||
uniform int uFogType;
|
||||
uniform vec4 uFogColor;
|
||||
uniform float uFogStart;
|
||||
uniform float uFogEnd;
|
||||
uniform float uFogDensity;
|
||||
|
||||
/* Varyings */
|
||||
|
||||
varying vec2 vTextureCoord0;
|
||||
varying vec4 vVertexColor;
|
||||
varying float vFogCoord;
|
||||
|
||||
float computeFog()
|
||||
{
|
||||
const float LOG2 = 1.442695;
|
||||
float FogFactor = 0.0;
|
||||
|
||||
if (uFogType == 0) // Exp
|
||||
{
|
||||
FogFactor = exp2(-uFogDensity * vFogCoord * LOG2);
|
||||
}
|
||||
else if (uFogType == 1) // Linear
|
||||
{
|
||||
float Scale = 1.0 / (uFogEnd - uFogStart);
|
||||
FogFactor = (uFogEnd - vFogCoord) * Scale;
|
||||
}
|
||||
else if (uFogType == 2) // Exp2
|
||||
{
|
||||
FogFactor = exp2(-uFogDensity * uFogDensity * vFogCoord * vFogCoord * LOG2);
|
||||
}
|
||||
|
||||
FogFactor = clamp(FogFactor, 0.0, 1.0);
|
||||
|
||||
return FogFactor;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 Color = vVertexColor;
|
||||
|
||||
if (bool(uTextureUsage0))
|
||||
Color *= texture2D(uTextureUnit0, vTextureCoord0);
|
||||
|
||||
if (bool(uFogEnable))
|
||||
{
|
||||
float FogFactor = computeFog();
|
||||
vec4 FogColor = uFogColor;
|
||||
FogColor.a = 1.0;
|
||||
Color = mix(FogColor, Color, FogFactor);
|
||||
}
|
||||
|
||||
gl_FragColor = Color;
|
||||
}
|
@ -349,7 +349,7 @@ f:write[[
|
||||
|
||||
#include <string>
|
||||
#include <unordered_set>
|
||||
#include "IrrCompileConfig.h"
|
||||
#include "IrrCompileConfig.h" // for IRRLICHT_API
|
||||
#include "irrTypes.h"
|
||||
#include "IContextManager.h"
|
||||
#include <KHR/khrplatform.h>
|
||||
|
@ -5,21 +5,19 @@
|
||||
variant=win32
|
||||
[[ "$(basename "$CXX")" == "x86_64-"* ]] && variant=win64
|
||||
|
||||
libjpeg_version=2.1.2
|
||||
libpng_version=1.6.37
|
||||
zlib_version=1.2.11
|
||||
libjpeg_version=2.1.5.1
|
||||
libpng_version=1.6.39
|
||||
zlib_version=1.2.13
|
||||
|
||||
mkdir -p libs
|
||||
pushd libs
|
||||
libs=$PWD
|
||||
tmp=
|
||||
[ "$variant" = win32 ] && tmp=dw2/
|
||||
[ -e libjpeg.zip ] || \
|
||||
wget "http://minetest.kitsunemimi.pw/libjpeg-$libjpeg_version-$variant.zip" -O libjpeg.zip
|
||||
[ -e libpng.zip ] || \
|
||||
wget "http://minetest.kitsunemimi.pw/${tmp}libpng-$libpng_version-$variant.zip" -O libpng.zip
|
||||
wget "http://minetest.kitsunemimi.pw/libpng-$libpng_version-$variant.zip" -O libpng.zip
|
||||
[ -e zlib.zip ] || \
|
||||
wget "http://minetest.kitsunemimi.pw/${tmp}zlib-$zlib_version-$variant.zip" -O 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
|
||||
|
@ -2,7 +2,6 @@
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_ANDROID_ASSET_READER_
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
#define __C_ANDROID_ASSET_FILE_ARCHIVE_H_INCLUDED__
|
||||
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_ANDROID_ASSET_READER_
|
||||
|
||||
@ -54,7 +53,7 @@ namespace io
|
||||
virtual void addDirectoryToFileList(const io::path &filename);
|
||||
|
||||
//! return the name (id) of the file Archive
|
||||
virtual const io::path& getArchiveName() const _IRR_OVERRIDE_ {return Path;}
|
||||
const io::path& getArchiveName() const override {return Path;}
|
||||
|
||||
protected:
|
||||
//! Android's asset manager
|
||||
|
@ -2,7 +2,6 @@
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_ANDROID_ASSET_READER_
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
#define __C_ANDROID_ASSET_READER_H_INCLUDED__
|
||||
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_ANDROID_ASSET_READER_
|
||||
|
||||
|
@ -180,11 +180,6 @@ void CIrrDeviceAndroid::setWindowCaption(const wchar_t* text)
|
||||
{
|
||||
}
|
||||
|
||||
bool CIrrDeviceAndroid::present(video::IImage* surface, void* windowId, core::rect<s32>* srcClip)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CIrrDeviceAndroid::isWindowActive() const
|
||||
{
|
||||
return (Focused && !Paused);
|
||||
|
@ -5,13 +5,11 @@
|
||||
#ifndef __C_IRR_DEVICE_ANDROID_H_INCLUDED__
|
||||
#define __C_IRR_DEVICE_ANDROID_H_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
|
||||
|
||||
#include "CIrrDeviceStub.h"
|
||||
#include "IrrlichtDevice.h"
|
||||
#include "IImagePresenter.h"
|
||||
#include "ICursorControl.h"
|
||||
|
||||
#include <android/sensor.h>
|
||||
@ -19,7 +17,7 @@
|
||||
|
||||
namespace irr
|
||||
{
|
||||
class CIrrDeviceAndroid : public CIrrDeviceStub, video::IImagePresenter
|
||||
class CIrrDeviceAndroid : public CIrrDeviceStub
|
||||
{
|
||||
public:
|
||||
CIrrDeviceAndroid(const SIrrlichtCreationParameters& param);
|
||||
@ -34,8 +32,6 @@ namespace irr
|
||||
|
||||
virtual void setWindowCaption(const wchar_t* text);
|
||||
|
||||
virtual bool present(video::IImage* surface, void* windowId, core::rect<s32>* srcClip);
|
||||
|
||||
virtual bool isWindowActive() const;
|
||||
|
||||
virtual bool isWindowFocused() const;
|
||||
|
@ -4,7 +4,6 @@
|
||||
#ifndef __C_IRR_KEY_EVENT_WRAPPER_H_INCLUDED__
|
||||
#define __C_IRR_KEY_EVENT_WRAPPER_H_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
|
||||
|
||||
|
@ -5,8 +5,6 @@
|
||||
#ifndef __BUILD_IN_FONT_H_INCLUDED__
|
||||
#define __BUILD_IN_FONT_H_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
#ifdef _IRR_COMPILE_WITH_GUI_
|
||||
|
||||
// header file generated by Bin2H, copyright 2002 by N.Gebhardt.
|
||||
// Bin2H is Freeware. Download it freely from www.code3d.com.
|
||||
@ -16,7 +14,6 @@ namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
#ifdef _IRR_COMPILE_WITH_BMP_LOADER_
|
||||
const u8 BuiltInFontData[] =
|
||||
{
|
||||
0x42, 0x4d, 0x4a, 0x20, 0x00, 0x00, 0x00, 0x00,
|
||||
@ -1056,20 +1053,7 @@ const u8 BuiltInFontData[] =
|
||||
};
|
||||
|
||||
const u32 BuiltInFontDataSize = sizeof(BuiltInFontData);
|
||||
|
||||
#else // !defined(_IRR_COMPILE_WITH_BMP_LOADER_)
|
||||
|
||||
// built-in font cannot be loaded if there is no BMP loader
|
||||
|
||||
const u8 * const BuiltInFontData=0;
|
||||
|
||||
const u32 BuiltInFontDataSize = 0;
|
||||
|
||||
#endif
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_GUI_
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -7,7 +7,9 @@
|
||||
#include "ISceneManager.h"
|
||||
#include "S3DVertex.h"
|
||||
#include "os.h"
|
||||
#ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
|
||||
#include "CSkinnedMesh.h"
|
||||
#endif
|
||||
#include "IDummyTransformationSceneNode.h"
|
||||
#include "IBoneSceneNode.h"
|
||||
#include "IMaterialRenderer.h"
|
||||
@ -236,15 +238,6 @@ void CAnimatedMeshSceneNode::OnAnimate(u32 timeMs)
|
||||
|
||||
// set CurrentFrameNr
|
||||
buildFrameNr(timeMs-LastTimeMs);
|
||||
|
||||
// update bbox
|
||||
if (Mesh)
|
||||
{
|
||||
scene::IMesh * mesh = getMeshForCurrentFrame();
|
||||
|
||||
if (mesh)
|
||||
Box = mesh->getBoundingBox();
|
||||
}
|
||||
LastTimeMs = timeMs;
|
||||
|
||||
IAnimatedMeshSceneNode::OnAnimate(timeMs);
|
||||
|
@ -31,114 +31,114 @@ namespace scene
|
||||
virtual ~CAnimatedMeshSceneNode();
|
||||
|
||||
//! sets the current frame. from now on the animation is played from this frame.
|
||||
virtual void setCurrentFrame(f32 frame) _IRR_OVERRIDE_;
|
||||
void setCurrentFrame(f32 frame) override;
|
||||
|
||||
//! frame
|
||||
virtual void OnRegisterSceneNode() _IRR_OVERRIDE_;
|
||||
void OnRegisterSceneNode() override;
|
||||
|
||||
//! OnAnimate() is called just before rendering the whole scene.
|
||||
virtual void OnAnimate(u32 timeMs) _IRR_OVERRIDE_;
|
||||
void OnAnimate(u32 timeMs) override;
|
||||
|
||||
//! renders the node.
|
||||
virtual void render() _IRR_OVERRIDE_;
|
||||
void render() override;
|
||||
|
||||
//! returns the axis aligned bounding box of this node
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_;
|
||||
const core::aabbox3d<f32>& getBoundingBox() const override;
|
||||
|
||||
//! sets the frames between the animation is looped.
|
||||
//! the default is 0 - MaximalFrameCount of the mesh.
|
||||
//! NOTE: setMesh will also change this value and set it to the full range of animations of the mesh
|
||||
virtual bool setFrameLoop(s32 begin, s32 end) _IRR_OVERRIDE_;
|
||||
bool setFrameLoop(s32 begin, s32 end) override;
|
||||
|
||||
//! Sets looping mode which is on by default. If set to false,
|
||||
//! animations will not be looped.
|
||||
virtual void setLoopMode(bool playAnimationLooped) _IRR_OVERRIDE_;
|
||||
void setLoopMode(bool playAnimationLooped) override;
|
||||
|
||||
//! returns the current loop mode
|
||||
virtual bool getLoopMode() const _IRR_OVERRIDE_;
|
||||
bool getLoopMode() const override;
|
||||
|
||||
//! Sets a callback interface which will be called if an animation
|
||||
//! playback has ended. Set this to 0 to disable the callback again.
|
||||
virtual void setAnimationEndCallback(IAnimationEndCallBack* callback=0) _IRR_OVERRIDE_;
|
||||
void setAnimationEndCallback(IAnimationEndCallBack* callback=0) override;
|
||||
|
||||
//! sets the speed with which the animation is played
|
||||
//! NOTE: setMesh will also change this value and set it to the default speed of the mesh
|
||||
virtual void setAnimationSpeed(f32 framesPerSecond) _IRR_OVERRIDE_;
|
||||
void setAnimationSpeed(f32 framesPerSecond) override;
|
||||
|
||||
//! gets the speed with which the animation is played
|
||||
virtual f32 getAnimationSpeed() const _IRR_OVERRIDE_;
|
||||
f32 getAnimationSpeed() const override;
|
||||
|
||||
//! returns the material based on the zero based index i. To get the amount
|
||||
//! of materials used by this scene node, use getMaterialCount().
|
||||
//! This function is needed for inserting the node into the scene hierarchy on a
|
||||
//! optimal position for minimizing renderstate changes, but can also be used
|
||||
//! to directly modify the material of a scene node.
|
||||
virtual video::SMaterial& getMaterial(u32 i) _IRR_OVERRIDE_;
|
||||
video::SMaterial& getMaterial(u32 i) override;
|
||||
|
||||
//! returns amount of materials used by this scene node.
|
||||
virtual u32 getMaterialCount() const _IRR_OVERRIDE_;
|
||||
u32 getMaterialCount() const override;
|
||||
|
||||
//! Returns a pointer to a child node, which has the same transformation as
|
||||
//! the corresponding joint, if the mesh in this scene node is a skinned mesh.
|
||||
virtual IBoneSceneNode* getJointNode(const c8* jointName) _IRR_OVERRIDE_;
|
||||
IBoneSceneNode* getJointNode(const c8* jointName) override;
|
||||
|
||||
//! same as getJointNode(const c8* jointName), but based on id
|
||||
virtual IBoneSceneNode* getJointNode(u32 jointID) _IRR_OVERRIDE_;
|
||||
IBoneSceneNode* getJointNode(u32 jointID) override;
|
||||
|
||||
//! Gets joint count.
|
||||
virtual u32 getJointCount() const _IRR_OVERRIDE_;
|
||||
u32 getJointCount() const override;
|
||||
|
||||
//! Removes a child from this scene node.
|
||||
//! Implemented here, to be able to remove the shadow properly, if there is one,
|
||||
//! or to remove attached child.
|
||||
virtual bool removeChild(ISceneNode* child) _IRR_OVERRIDE_;
|
||||
bool removeChild(ISceneNode* child) override;
|
||||
|
||||
//! Returns the current displayed frame number.
|
||||
virtual f32 getFrameNr() const _IRR_OVERRIDE_;
|
||||
f32 getFrameNr() const override;
|
||||
//! Returns the current start frame number.
|
||||
virtual s32 getStartFrame() const _IRR_OVERRIDE_;
|
||||
s32 getStartFrame() const override;
|
||||
//! Returns the current end frame number.
|
||||
virtual s32 getEndFrame() const _IRR_OVERRIDE_;
|
||||
s32 getEndFrame() const override;
|
||||
|
||||
//! Sets if the scene node should not copy the materials of the mesh but use them in a read only style.
|
||||
/* In this way it is possible to change the materials a mesh causing all mesh scene nodes
|
||||
referencing this mesh to change too. */
|
||||
virtual void setReadOnlyMaterials(bool readonly) _IRR_OVERRIDE_;
|
||||
void setReadOnlyMaterials(bool readonly) override;
|
||||
|
||||
//! Returns if the scene node should not copy the materials of the mesh but use them in a read only style
|
||||
virtual bool isReadOnlyMaterials() const _IRR_OVERRIDE_;
|
||||
bool isReadOnlyMaterials() const override;
|
||||
|
||||
//! Sets a new mesh
|
||||
virtual void setMesh(IAnimatedMesh* mesh) _IRR_OVERRIDE_;
|
||||
void setMesh(IAnimatedMesh* mesh) override;
|
||||
|
||||
//! Returns the current mesh
|
||||
virtual IAnimatedMesh* getMesh(void) _IRR_OVERRIDE_ { return Mesh; }
|
||||
IAnimatedMesh* getMesh(void) override { return Mesh; }
|
||||
|
||||
//! Returns type of the scene node
|
||||
virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_ANIMATED_MESH; }
|
||||
ESCENE_NODE_TYPE getType() const override { return ESNT_ANIMATED_MESH; }
|
||||
|
||||
//! updates the absolute position based on the relative and the parents position
|
||||
virtual void updateAbsolutePosition() _IRR_OVERRIDE_;
|
||||
void updateAbsolutePosition() override;
|
||||
|
||||
|
||||
//! Set the joint update mode (0-unused, 1-get joints only, 2-set joints only, 3-move and set)
|
||||
virtual void setJointMode(E_JOINT_UPDATE_ON_RENDER mode) _IRR_OVERRIDE_;
|
||||
void setJointMode(E_JOINT_UPDATE_ON_RENDER mode) override;
|
||||
|
||||
//! Sets the transition time in seconds (note: This needs to enable joints, and setJointmode maybe set to 2)
|
||||
//! you must call animateJoints(), or the mesh will not animate
|
||||
virtual void setTransitionTime(f32 Time) _IRR_OVERRIDE_;
|
||||
void setTransitionTime(f32 Time) override;
|
||||
|
||||
//! updates the joint positions of this mesh
|
||||
virtual void animateJoints(bool CalculateAbsolutePositions=true) _IRR_OVERRIDE_;
|
||||
void animateJoints(bool CalculateAbsolutePositions=true) override;
|
||||
|
||||
//! render mesh ignoring its transformation. Used with ragdolls. (culling is unaffected)
|
||||
virtual void setRenderFromIdentity( bool On ) _IRR_OVERRIDE_;
|
||||
void setRenderFromIdentity( bool On ) override;
|
||||
|
||||
//! Creates a clone of this scene node and its children.
|
||||
/** \param newParent An optional new parent.
|
||||
\param newManager An optional new scene manager.
|
||||
\return The newly created clone of this node. */
|
||||
virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) _IRR_OVERRIDE_;
|
||||
ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -27,42 +27,42 @@ public:
|
||||
setBool(value);
|
||||
}
|
||||
|
||||
virtual s32 getInt() const _IRR_OVERRIDE_
|
||||
s32 getInt() const override
|
||||
{
|
||||
return BoolValue ? 1 : 0;
|
||||
}
|
||||
|
||||
virtual f32 getFloat() const _IRR_OVERRIDE_
|
||||
f32 getFloat() const override
|
||||
{
|
||||
return BoolValue ? 1.0f : 0.0f;
|
||||
}
|
||||
|
||||
virtual bool getBool() const _IRR_OVERRIDE_
|
||||
bool getBool() const override
|
||||
{
|
||||
return BoolValue;
|
||||
}
|
||||
|
||||
virtual void setInt(s32 intValue) _IRR_OVERRIDE_
|
||||
void setInt(s32 intValue) override
|
||||
{
|
||||
BoolValue = (intValue != 0);
|
||||
}
|
||||
|
||||
virtual void setFloat(f32 floatValue) _IRR_OVERRIDE_
|
||||
void setFloat(f32 floatValue) override
|
||||
{
|
||||
BoolValue = (floatValue != 0);
|
||||
}
|
||||
|
||||
virtual void setBool(bool boolValue) _IRR_OVERRIDE_
|
||||
void setBool(bool boolValue) override
|
||||
{
|
||||
BoolValue = boolValue;
|
||||
}
|
||||
|
||||
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
|
||||
E_ATTRIBUTE_TYPE getType() const override
|
||||
{
|
||||
return EAT_BOOL;
|
||||
}
|
||||
|
||||
virtual const wchar_t* getTypeString() const _IRR_OVERRIDE_
|
||||
const wchar_t* getTypeString() const override
|
||||
{
|
||||
return L"bool";
|
||||
}
|
||||
@ -81,32 +81,32 @@ public:
|
||||
setInt(value);
|
||||
}
|
||||
|
||||
virtual s32 getInt() const _IRR_OVERRIDE_
|
||||
s32 getInt() const override
|
||||
{
|
||||
return Value;
|
||||
}
|
||||
|
||||
virtual f32 getFloat() const _IRR_OVERRIDE_
|
||||
f32 getFloat() const override
|
||||
{
|
||||
return (f32)Value;
|
||||
}
|
||||
|
||||
virtual void setInt(s32 intValue) _IRR_OVERRIDE_
|
||||
void setInt(s32 intValue) override
|
||||
{
|
||||
Value = intValue;
|
||||
}
|
||||
|
||||
virtual void setFloat(f32 floatValue) _IRR_OVERRIDE_
|
||||
void setFloat(f32 floatValue) override
|
||||
{
|
||||
Value = (s32)floatValue;
|
||||
};
|
||||
|
||||
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
|
||||
E_ATTRIBUTE_TYPE getType() const override
|
||||
{
|
||||
return EAT_INT;
|
||||
}
|
||||
|
||||
virtual const wchar_t* getTypeString() const _IRR_OVERRIDE_
|
||||
const wchar_t* getTypeString() const override
|
||||
{
|
||||
return L"int";
|
||||
}
|
||||
@ -125,32 +125,32 @@ public:
|
||||
setFloat(value);
|
||||
}
|
||||
|
||||
virtual s32 getInt() const _IRR_OVERRIDE_
|
||||
s32 getInt() const override
|
||||
{
|
||||
return (s32)Value;
|
||||
}
|
||||
|
||||
virtual f32 getFloat() const _IRR_OVERRIDE_
|
||||
f32 getFloat() const override
|
||||
{
|
||||
return Value;
|
||||
}
|
||||
|
||||
virtual void setInt(s32 intValue) _IRR_OVERRIDE_
|
||||
void setInt(s32 intValue) override
|
||||
{
|
||||
Value = (f32)intValue;
|
||||
}
|
||||
|
||||
virtual void setFloat(f32 floatValue) _IRR_OVERRIDE_
|
||||
void setFloat(f32 floatValue) override
|
||||
{
|
||||
Value = floatValue;
|
||||
}
|
||||
|
||||
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
|
||||
E_ATTRIBUTE_TYPE getType() const override
|
||||
{
|
||||
return EAT_FLOAT;
|
||||
}
|
||||
|
||||
virtual const wchar_t* getTypeString() const _IRR_OVERRIDE_
|
||||
const wchar_t* getTypeString() const override
|
||||
{
|
||||
return L"float";
|
||||
}
|
||||
|
@ -5,7 +5,6 @@
|
||||
#ifndef __C_ATTRIBUTES_H_INCLUDED__
|
||||
#define __C_ATTRIBUTES_H_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
#include "IAttributes.h"
|
||||
#include "IAttribute.h"
|
||||
@ -30,37 +29,37 @@ public:
|
||||
~CAttributes();
|
||||
|
||||
//! Returns amount of attributes in this collection of attributes.
|
||||
virtual u32 getAttributeCount() const _IRR_OVERRIDE_;
|
||||
u32 getAttributeCount() const override;
|
||||
|
||||
//! Returns attribute name by index.
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual const c8* getAttributeName(s32 index) const _IRR_OVERRIDE_;
|
||||
const c8* getAttributeName(s32 index) const override;
|
||||
|
||||
//! Returns the type of an attribute
|
||||
//! \param attributeName: Name for the attribute
|
||||
virtual E_ATTRIBUTE_TYPE getAttributeType(const c8* attributeName) const _IRR_OVERRIDE_;
|
||||
E_ATTRIBUTE_TYPE getAttributeType(const c8* attributeName) const override;
|
||||
|
||||
//! Returns attribute type by index.
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual E_ATTRIBUTE_TYPE getAttributeType(s32 index) const _IRR_OVERRIDE_;
|
||||
E_ATTRIBUTE_TYPE getAttributeType(s32 index) const override;
|
||||
|
||||
//! Returns the type string of the attribute
|
||||
//! \param attributeName: String for the attribute type
|
||||
//! \param defaultNotFound Value returned when attributeName was not found
|
||||
virtual const wchar_t* getAttributeTypeString(const c8* attributeName, const wchar_t* defaultNotFound = L"unknown") const _IRR_OVERRIDE_;
|
||||
const wchar_t* getAttributeTypeString(const c8* attributeName, const wchar_t* defaultNotFound = L"unknown") const override;
|
||||
|
||||
//! Returns the type string of the attribute by index.
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual const wchar_t* getAttributeTypeString(s32 index, const wchar_t* defaultNotFound = L"unknown") const _IRR_OVERRIDE_;
|
||||
const wchar_t* getAttributeTypeString(s32 index, const wchar_t* defaultNotFound = L"unknown") const override;
|
||||
|
||||
//! Returns if an attribute with a name exists
|
||||
virtual bool existsAttribute(const c8* attributeName) const _IRR_OVERRIDE_;
|
||||
bool existsAttribute(const c8* attributeName) const override;
|
||||
|
||||
//! Returns attribute index from name, -1 if not found
|
||||
virtual s32 findAttribute(const c8* attributeName) const _IRR_OVERRIDE_;
|
||||
s32 findAttribute(const c8* attributeName) const override;
|
||||
|
||||
//! Removes all attributes
|
||||
virtual void clear() _IRR_OVERRIDE_;
|
||||
void clear() override;
|
||||
|
||||
|
||||
/*
|
||||
@ -70,23 +69,23 @@ public:
|
||||
*/
|
||||
|
||||
//! Adds an attribute as integer
|
||||
virtual void addInt(const c8* attributeName, s32 value) _IRR_OVERRIDE_;
|
||||
void addInt(const c8* attributeName, s32 value) override;
|
||||
|
||||
//! Sets an attribute as integer value
|
||||
virtual void setAttribute(const c8* attributeName, s32 value) _IRR_OVERRIDE_;
|
||||
void setAttribute(const c8* attributeName, s32 value) override;
|
||||
|
||||
//! Gets an attribute as integer value
|
||||
//! \param attributeName: Name of the attribute to get.
|
||||
//! \param defaultNotFound Value returned when attributeName was not found
|
||||
//! \return Returns value of the attribute previously set by setAttribute()
|
||||
virtual s32 getAttributeAsInt(const c8* attributeName, irr::s32 defaultNotFound=0) const _IRR_OVERRIDE_;
|
||||
s32 getAttributeAsInt(const c8* attributeName, irr::s32 defaultNotFound=0) const override;
|
||||
|
||||
//! Gets an attribute as integer value
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual s32 getAttributeAsInt(s32 index) const _IRR_OVERRIDE_;
|
||||
s32 getAttributeAsInt(s32 index) const override;
|
||||
|
||||
//! Sets an attribute as integer value
|
||||
virtual void setAttribute(s32 index, s32 value) _IRR_OVERRIDE_;
|
||||
void setAttribute(s32 index, s32 value) override;
|
||||
|
||||
/*
|
||||
|
||||
@ -95,23 +94,23 @@ public:
|
||||
*/
|
||||
|
||||
//! Adds an attribute as float
|
||||
virtual void addFloat(const c8* attributeName, f32 value) _IRR_OVERRIDE_;
|
||||
void addFloat(const c8* attributeName, f32 value) override;
|
||||
|
||||
//! Sets a attribute as float value
|
||||
virtual void setAttribute(const c8* attributeName, f32 value) _IRR_OVERRIDE_;
|
||||
void setAttribute(const c8* attributeName, f32 value) override;
|
||||
|
||||
//! Gets an attribute as float value
|
||||
//! \param attributeName: Name of the attribute to get.
|
||||
//! \param defaultNotFound Value returned when attributeName was not found
|
||||
//! \return Returns value of the attribute previously set by setAttribute()
|
||||
virtual f32 getAttributeAsFloat(const c8* attributeName, irr::f32 defaultNotFound=0.f) const _IRR_OVERRIDE_;
|
||||
f32 getAttributeAsFloat(const c8* attributeName, irr::f32 defaultNotFound=0.f) const override;
|
||||
|
||||
//! Gets an attribute as float value
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual f32 getAttributeAsFloat(s32 index) const _IRR_OVERRIDE_;
|
||||
f32 getAttributeAsFloat(s32 index) const override;
|
||||
|
||||
//! Sets an attribute as float value
|
||||
virtual void setAttribute(s32 index, f32 value) _IRR_OVERRIDE_;
|
||||
void setAttribute(s32 index, f32 value) override;
|
||||
|
||||
|
||||
/*
|
||||
@ -119,23 +118,23 @@ public:
|
||||
*/
|
||||
|
||||
//! Adds an attribute as bool
|
||||
virtual void addBool(const c8* attributeName, bool value) _IRR_OVERRIDE_;
|
||||
void addBool(const c8* attributeName, bool value) override;
|
||||
|
||||
//! Sets an attribute as boolean value
|
||||
virtual void setAttribute(const c8* attributeName, bool value) _IRR_OVERRIDE_;
|
||||
void setAttribute(const c8* attributeName, bool value) override;
|
||||
|
||||
//! Gets an attribute as boolean value
|
||||
//! \param attributeName: Name of the attribute to get.
|
||||
//! \param defaultNotFound Value returned when attributeName was not found
|
||||
//! \return Returns value of the attribute previously set by setAttribute()
|
||||
virtual bool getAttributeAsBool(const c8* attributeName, bool defaultNotFound=false) const _IRR_OVERRIDE_;
|
||||
bool getAttributeAsBool(const c8* attributeName, bool defaultNotFound=false) const override;
|
||||
|
||||
//! Gets an attribute as boolean value
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual bool getAttributeAsBool(s32 index) const _IRR_OVERRIDE_;
|
||||
bool getAttributeAsBool(s32 index) const override;
|
||||
|
||||
//! Sets an attribute as boolean value
|
||||
virtual void setAttribute(s32 index, bool value) _IRR_OVERRIDE_;
|
||||
void setAttribute(s32 index, bool value) override;
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -6,9 +6,6 @@
|
||||
// File format designed by Mark Sibly for the Blitz3D engine and has been
|
||||
// declared public domain
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
#ifdef _IRR_COMPILE_WITH_B3D_LOADER_
|
||||
|
||||
#include "CB3DMeshFileLoader.h"
|
||||
|
||||
#include "IVideoDriver.h"
|
||||
@ -1055,7 +1052,3 @@ void CB3DMeshFileLoader::readFloats(f32* vec, u32 count)
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_B3D_LOADER_
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
// File format designed by Mark Sibly for the Blitz3D engine and has been
|
||||
// declared public domain
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
#ifndef __C_B3D_MESH_LOADER_H_INCLUDED__
|
||||
#define __C_B3D_MESH_LOADER_H_INCLUDED__
|
||||
@ -33,13 +32,13 @@ public:
|
||||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
//! based on the file extension (e.g. ".bsp")
|
||||
virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_;
|
||||
bool isALoadableFileExtension(const io::path& filename) const override;
|
||||
|
||||
//! creates/loads an animated mesh from the file.
|
||||
//! \return Pointer to the created mesh. Returns 0 if loading failed.
|
||||
//! If you no longer need the mesh, you should call IAnimatedMesh::drop().
|
||||
//! See IReferenceCounted::drop() for more information.
|
||||
virtual IAnimatedMesh* createMesh(io::IReadFile* file) _IRR_OVERRIDE_;
|
||||
IAnimatedMesh* createMesh(io::IReadFile* file) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -4,9 +4,6 @@
|
||||
|
||||
// TODO: replace printf's by logging messages
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_B3D_WRITER_
|
||||
|
||||
#include "CB3DMeshWriter.h"
|
||||
#include "os.h"
|
||||
@ -97,7 +94,7 @@ bool CB3DMeshWriter::writeMesh(io::IWriteFile* file, IMesh* const mesh, s32 flag
|
||||
u32 numTexture = texs.size();
|
||||
for (u32 i = 0; i < numTexture; i++)
|
||||
{
|
||||
file->write(texs[i].TextureName.c_str(), texs[i].TextureName.size() + 1);
|
||||
file->write(texs[i].TextureName.c_str(), (size_t)texs[i].TextureName.size() + 1);
|
||||
file->write(&texs[i].Flags, 7*4);
|
||||
}
|
||||
|
||||
@ -479,7 +476,7 @@ core::array<ISkinnedMesh::SJoint*> CB3DMeshWriter::getRootJoints(const ISkinnedM
|
||||
return roots;
|
||||
}
|
||||
|
||||
u32 CB3DMeshWriter::getUVlayerCount(IMesh* mesh)
|
||||
u32 CB3DMeshWriter::getUVlayerCount(const IMesh* mesh)
|
||||
{
|
||||
const u32 numBeshBuffers = mesh->getMeshBufferCount();
|
||||
for (u32 i = 0; i < numBeshBuffers; i++)
|
||||
@ -531,6 +528,3 @@ void CB3DMeshWriter::writeSizeFrom(io::IWriteFile* file, const u32 from, const u
|
||||
|
||||
} // end namespace
|
||||
} // end namespace
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_B3D_WRITER_
|
||||
|
||||
|
@ -27,17 +27,17 @@ public:
|
||||
CB3DMeshWriter();
|
||||
|
||||
//! Returns the type of the mesh writer
|
||||
virtual EMESH_WRITER_TYPE getType() const _IRR_OVERRIDE_;
|
||||
EMESH_WRITER_TYPE getType() const override;
|
||||
|
||||
//! writes a mesh
|
||||
virtual bool writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 flags=EMWF_NONE) _IRR_OVERRIDE_;
|
||||
bool writeMesh(io::IWriteFile* file, scene::IMesh* mesh, s32 flags=EMWF_NONE) override;
|
||||
|
||||
private:
|
||||
void writeJointChunk(io::IWriteFile* file, ISkinnedMesh* mesh , ISkinnedMesh::SJoint* joint, f32 animationSpeedMultiplier);
|
||||
u32 getJointChunkSize(const ISkinnedMesh* mesh, ISkinnedMesh::SJoint* joint);
|
||||
core::array<ISkinnedMesh::SJoint*> getRootJoints(const ISkinnedMesh* mesh);
|
||||
|
||||
u32 getUVlayerCount(IMesh *mesh);
|
||||
u32 getUVlayerCount(const IMesh *mesh);
|
||||
ISkinnedMesh* getSkinned (IMesh *mesh);
|
||||
|
||||
inline void writeVector2(io::IWriteFile* file, const core::vector2df& vec);
|
||||
|
@ -2,8 +2,6 @@
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
#ifdef _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_
|
||||
#include "CBillboardSceneNode.h"
|
||||
#include "IVideoDriver.h"
|
||||
#include "ISceneManager.h"
|
||||
@ -143,7 +141,7 @@ void CBillboardSceneNode::updateMesh(const irr::scene::ICameraSceneNode* camera)
|
||||
//! returns the axis aligned bounding box of this node
|
||||
const core::aabbox3d<f32>& CBillboardSceneNode::getBoundingBox() const
|
||||
{
|
||||
// Really wrong when scaled.
|
||||
// Really wrong when scaled (as the node does not scale it's vertices - maybe it should?)
|
||||
return BBoxSafe;
|
||||
}
|
||||
|
||||
@ -164,9 +162,9 @@ void CBillboardSceneNode::setSize(const core::dimension2d<f32>& size)
|
||||
if (core::equals(Size.Height, 0.0f))
|
||||
Size.Height = 1.0f;
|
||||
|
||||
const f32 avg = (Size.Width + Size.Height)/6;
|
||||
BBoxSafe.MinEdge.set(-avg,-avg,-avg);
|
||||
BBoxSafe.MaxEdge.set(avg,avg,avg);
|
||||
const f32 extent = 0.5f*sqrtf(Size.Width*Size.Width + Size.Height*Size.Height);
|
||||
BBoxSafe.MinEdge.set(-extent,-extent,-extent);
|
||||
BBoxSafe.MaxEdge.set(extent,extent,extent);
|
||||
}
|
||||
|
||||
|
||||
@ -184,9 +182,9 @@ void CBillboardSceneNode::setSize(f32 height, f32 bottomEdgeWidth, f32 topEdgeWi
|
||||
TopEdgeWidth = 1.0f;
|
||||
}
|
||||
|
||||
const f32 avg = (core::max_(Size.Width,TopEdgeWidth) + Size.Height)/6;
|
||||
BBoxSafe.MinEdge.set(-avg,-avg,-avg);
|
||||
BBoxSafe.MaxEdge.set(avg,avg,avg);
|
||||
const f32 extent = 0.5f*sqrtf(Size.Width*Size.Width + Size.Height*Size.Height);
|
||||
BBoxSafe.MinEdge.set(-extent,-extent,-extent);
|
||||
BBoxSafe.MaxEdge.set(extent,extent,extent);
|
||||
}
|
||||
|
||||
|
||||
@ -281,5 +279,3 @@ ISceneNode* CBillboardSceneNode::clone(ISceneNode* newParent, ISceneManager* new
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_
|
||||
|
@ -28,58 +28,58 @@ public:
|
||||
virtual ~CBillboardSceneNode();
|
||||
|
||||
//! pre render event
|
||||
virtual void OnRegisterSceneNode() _IRR_OVERRIDE_;
|
||||
void OnRegisterSceneNode() override;
|
||||
|
||||
//! render
|
||||
virtual void render() _IRR_OVERRIDE_;
|
||||
void render() override;
|
||||
|
||||
//! returns the axis aligned bounding box of this node
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_;
|
||||
const core::aabbox3d<f32>& getBoundingBox() const override;
|
||||
|
||||
//! sets the size of the billboard
|
||||
virtual void setSize(const core::dimension2d<f32>& size) _IRR_OVERRIDE_;
|
||||
void setSize(const core::dimension2d<f32>& size) override;
|
||||
|
||||
//! Sets the widths of the top and bottom edges of the billboard independently.
|
||||
virtual void setSize(f32 height, f32 bottomEdgeWidth, f32 topEdgeWidth) _IRR_OVERRIDE_;
|
||||
void setSize(f32 height, f32 bottomEdgeWidth, f32 topEdgeWidth) override;
|
||||
|
||||
//! gets the size of the billboard
|
||||
virtual const core::dimension2d<f32>& getSize() const _IRR_OVERRIDE_;
|
||||
const core::dimension2d<f32>& getSize() const override;
|
||||
|
||||
//! Gets the widths of the top and bottom edges of the billboard.
|
||||
virtual void getSize(f32& height, f32& bottomEdgeWidth, f32& topEdgeWidth) const _IRR_OVERRIDE_;
|
||||
void getSize(f32& height, f32& bottomEdgeWidth, f32& topEdgeWidth) const override;
|
||||
|
||||
virtual video::SMaterial& getMaterial(u32 i) _IRR_OVERRIDE_;
|
||||
video::SMaterial& getMaterial(u32 i) override;
|
||||
|
||||
//! returns amount of materials used by this scene node.
|
||||
virtual u32 getMaterialCount() const _IRR_OVERRIDE_;
|
||||
u32 getMaterialCount() const override;
|
||||
|
||||
//! Set the color of all vertices of the billboard
|
||||
//! \param overallColor: the color to set
|
||||
virtual void setColor(const video::SColor& overallColor) _IRR_OVERRIDE_;
|
||||
void setColor(const video::SColor& overallColor) override;
|
||||
|
||||
//! Set the color of the top and bottom vertices of the billboard
|
||||
//! \param topColor: the color to set the top vertices
|
||||
//! \param bottomColor: the color to set the bottom vertices
|
||||
virtual void setColor(const video::SColor& topColor,
|
||||
const video::SColor& bottomColor) _IRR_OVERRIDE_;
|
||||
const video::SColor& bottomColor) override;
|
||||
|
||||
//! Gets the color of the top and bottom vertices of the billboard
|
||||
//! \param[out] topColor: stores the color of the top vertices
|
||||
//! \param[out] bottomColor: stores the color of the bottom vertices
|
||||
virtual void getColor(video::SColor& topColor,
|
||||
video::SColor& bottomColor) const _IRR_OVERRIDE_;
|
||||
video::SColor& bottomColor) const override;
|
||||
|
||||
//! Get the real boundingbox used by the billboard (which depends on the active camera)
|
||||
virtual const core::aabbox3d<f32>& getTransformedBillboardBoundingBox(const irr::scene::ICameraSceneNode* camera) _IRR_OVERRIDE_;
|
||||
const core::aabbox3d<f32>& getTransformedBillboardBoundingBox(const irr::scene::ICameraSceneNode* camera) override;
|
||||
|
||||
//! Get the amount of mesh buffers.
|
||||
virtual u32 getMeshBufferCount() const _IRR_OVERRIDE_
|
||||
u32 getMeshBufferCount() const override
|
||||
{
|
||||
return Buffer ? 1 : 0;
|
||||
}
|
||||
|
||||
//! Get pointer to the mesh buffer.
|
||||
virtual IMeshBuffer* getMeshBuffer(u32 nr) const _IRR_OVERRIDE_
|
||||
IMeshBuffer* getMeshBuffer(u32 nr) const override
|
||||
{
|
||||
if ( nr == 0 )
|
||||
return Buffer;
|
||||
@ -87,10 +87,10 @@ public:
|
||||
}
|
||||
|
||||
//! Returns type of the scene node
|
||||
virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_BILLBOARD; }
|
||||
ESCENE_NODE_TYPE getType() const override { return ESNT_BILLBOARD; }
|
||||
|
||||
//! Creates a clone of this scene node and its children.
|
||||
virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) _IRR_OVERRIDE_;
|
||||
ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) override;
|
||||
|
||||
protected:
|
||||
void updateMesh(const irr::scene::ICameraSceneNode* camera);
|
||||
|
@ -2,9 +2,6 @@
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
#ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_
|
||||
|
||||
#include "CBoneSceneNode.h"
|
||||
|
||||
namespace irr
|
||||
@ -98,6 +95,3 @@ void CBoneSceneNode::updateAbsolutePositionOfAllChildren()
|
||||
|
||||
} // namespace scene
|
||||
} // namespace irr
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -23,33 +23,33 @@ namespace scene
|
||||
s32 id=-1, u32 boneIndex=0, const c8* boneName=0);
|
||||
|
||||
//! Returns the index of the bone
|
||||
virtual u32 getBoneIndex() const _IRR_OVERRIDE_;
|
||||
u32 getBoneIndex() const override;
|
||||
|
||||
//! Sets the animation mode of the bone. Returns true if successful.
|
||||
virtual bool setAnimationMode(E_BONE_ANIMATION_MODE mode) _IRR_OVERRIDE_;
|
||||
bool setAnimationMode(E_BONE_ANIMATION_MODE mode) override;
|
||||
|
||||
//! Gets the current animation mode of the bone
|
||||
virtual E_BONE_ANIMATION_MODE getAnimationMode() const _IRR_OVERRIDE_;
|
||||
E_BONE_ANIMATION_MODE getAnimationMode() const override;
|
||||
|
||||
//! returns the axis aligned bounding box of this node
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_;
|
||||
const core::aabbox3d<f32>& getBoundingBox() const override;
|
||||
|
||||
/*
|
||||
//! Returns the relative transformation of the scene node.
|
||||
//virtual core::matrix4 getRelativeTransformation() const _IRR_OVERRIDE_;
|
||||
//core::matrix4 getRelativeTransformation() const override;
|
||||
*/
|
||||
|
||||
virtual void OnAnimate(u32 timeMs) _IRR_OVERRIDE_;
|
||||
void OnAnimate(u32 timeMs) override;
|
||||
|
||||
virtual void updateAbsolutePositionOfAllChildren() _IRR_OVERRIDE_;
|
||||
void updateAbsolutePositionOfAllChildren() override;
|
||||
|
||||
//! How the relative transformation of the bone is used
|
||||
virtual void setSkinningSpace(E_BONE_SKINNING_SPACE space) _IRR_OVERRIDE_
|
||||
void setSkinningSpace(E_BONE_SKINNING_SPACE space) override
|
||||
{
|
||||
SkinningSpace=space;
|
||||
}
|
||||
|
||||
virtual E_BONE_SKINNING_SPACE getSkinningSpace() const _IRR_OVERRIDE_
|
||||
E_BONE_SKINNING_SPACE getSkinningSpace() const override
|
||||
{
|
||||
return SkinningSpace;
|
||||
}
|
||||
|
@ -28,16 +28,16 @@ CCameraSceneNode::CCameraSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 i
|
||||
|
||||
// set default projection
|
||||
Fovy = core::PI / 2.5f; // Field of view, in radians.
|
||||
Aspect = 4.0f / 3.0f; // Aspect ratio.
|
||||
|
||||
const video::IVideoDriver* const d = mgr?mgr->getVideoDriver():0;
|
||||
if (d)
|
||||
{
|
||||
Aspect = (f32)d->getCurrentRenderTargetSize().Width /
|
||||
(f32)d->getCurrentRenderTargetSize().Height;
|
||||
if ( d->getCurrentRenderTargetSize().Height )
|
||||
Aspect = (f32)d->getCurrentRenderTargetSize().Width /
|
||||
(f32)d->getCurrentRenderTargetSize().Height;
|
||||
HasD3DStyleProjectionMatrix = d->getDriverType() != video::EDT_OPENGL;
|
||||
}
|
||||
else
|
||||
Aspect = 4.0f / 3.0f; // Aspect ratio.
|
||||
|
||||
ViewArea.setFarNearDistance(ZFar - ZNear);
|
||||
recalculateProjectionMatrix();
|
||||
|
@ -30,117 +30,117 @@ namespace scene
|
||||
\param projection The new projection matrix of the camera.
|
||||
\param isOrthogonal Set this to true if the matrix is an orthogonal one (e.g.
|
||||
from matrix4::buildProjectionMatrixOrthoLH(). */
|
||||
virtual void setProjectionMatrix(const core::matrix4& projection, bool isOrthogonal = false) _IRR_OVERRIDE_;
|
||||
void setProjectionMatrix(const core::matrix4& projection, bool isOrthogonal = false) override;
|
||||
|
||||
//! Gets the current projection matrix of the camera
|
||||
//! \return Returns the current projection matrix of the camera.
|
||||
virtual const core::matrix4& getProjectionMatrix() const _IRR_OVERRIDE_;
|
||||
const core::matrix4& getProjectionMatrix() const override;
|
||||
|
||||
//! Gets the current view matrix of the camera
|
||||
//! \return Returns the current view matrix of the camera.
|
||||
virtual const core::matrix4& getViewMatrix() const _IRR_OVERRIDE_;
|
||||
const core::matrix4& getViewMatrix() const override;
|
||||
|
||||
//! Sets a custom view matrix affector.
|
||||
/** \param affector: The affector matrix. */
|
||||
virtual void setViewMatrixAffector(const core::matrix4& affector) _IRR_OVERRIDE_;
|
||||
void setViewMatrixAffector(const core::matrix4& affector) override;
|
||||
|
||||
//! Gets the custom view matrix affector.
|
||||
virtual const core::matrix4& getViewMatrixAffector() const _IRR_OVERRIDE_;
|
||||
const core::matrix4& getViewMatrixAffector() const override;
|
||||
|
||||
//! It is possible to send mouse and key events to the camera. Most cameras
|
||||
//! may ignore this input, but camera scene nodes which are created for
|
||||
//! example with scene::ISceneManager::addMayaCameraSceneNode or
|
||||
//! scene::ISceneManager::addMeshViewerCameraSceneNode, may want to get this input
|
||||
//! for changing their position, look at target or whatever.
|
||||
virtual bool OnEvent(const SEvent& event) _IRR_OVERRIDE_;
|
||||
bool OnEvent(const SEvent& event) override;
|
||||
|
||||
//! Sets the look at target of the camera
|
||||
/** If the camera's target and rotation are bound ( @see bindTargetAndRotation() )
|
||||
then calling this will also change the camera's scene node rotation to match the target.
|
||||
\param pos: Look at target of the camera. */
|
||||
virtual void setTarget(const core::vector3df& pos) _IRR_OVERRIDE_;
|
||||
void setTarget(const core::vector3df& pos) override;
|
||||
|
||||
//! Sets the rotation of the node.
|
||||
/** This only modifies the relative rotation of the node.
|
||||
If the camera's target and rotation are bound ( @see bindTargetAndRotation() )
|
||||
then calling this will also change the camera's target to match the rotation.
|
||||
\param rotation New rotation of the node in degrees. */
|
||||
virtual void setRotation(const core::vector3df& rotation) _IRR_OVERRIDE_;
|
||||
void setRotation(const core::vector3df& rotation) override;
|
||||
|
||||
//! Gets the current look at target of the camera
|
||||
/** \return The current look at target of the camera */
|
||||
virtual const core::vector3df& getTarget() const _IRR_OVERRIDE_;
|
||||
const core::vector3df& getTarget() const override;
|
||||
|
||||
//! Sets the up vector of the camera.
|
||||
//! \param pos: New upvector of the camera.
|
||||
virtual void setUpVector(const core::vector3df& pos) _IRR_OVERRIDE_;
|
||||
void setUpVector(const core::vector3df& pos) override;
|
||||
|
||||
//! Gets the up vector of the camera.
|
||||
//! \return Returns the up vector of the camera.
|
||||
virtual const core::vector3df& getUpVector() const _IRR_OVERRIDE_;
|
||||
const core::vector3df& getUpVector() const override;
|
||||
|
||||
//! Gets distance from the camera to the near plane.
|
||||
//! \return Value of the near plane of the camera.
|
||||
virtual f32 getNearValue() const _IRR_OVERRIDE_;
|
||||
f32 getNearValue() const override;
|
||||
|
||||
//! Gets the distance from the camera to the far plane.
|
||||
//! \return Value of the far plane of the camera.
|
||||
virtual f32 getFarValue() const _IRR_OVERRIDE_;
|
||||
f32 getFarValue() const override;
|
||||
|
||||
//! Get the aspect ratio of the camera.
|
||||
//! \return The aspect ratio of the camera.
|
||||
virtual f32 getAspectRatio() const _IRR_OVERRIDE_;
|
||||
f32 getAspectRatio() const override;
|
||||
|
||||
//! Gets the field of view of the camera.
|
||||
//! \return Field of view of the camera
|
||||
virtual f32 getFOV() const _IRR_OVERRIDE_;
|
||||
f32 getFOV() const override;
|
||||
|
||||
//! Sets the value of the near clipping plane. (default: 1.0f)
|
||||
virtual void setNearValue(f32 zn) _IRR_OVERRIDE_;
|
||||
void setNearValue(f32 zn) override;
|
||||
|
||||
//! Sets the value of the far clipping plane (default: 2000.0f)
|
||||
virtual void setFarValue(f32 zf) _IRR_OVERRIDE_;
|
||||
void setFarValue(f32 zf) override;
|
||||
|
||||
//! Sets the aspect ratio (default: 4.0f / 3.0f)
|
||||
virtual void setAspectRatio(f32 aspect) _IRR_OVERRIDE_;
|
||||
void setAspectRatio(f32 aspect) override;
|
||||
|
||||
//! Sets the field of view (Default: PI / 3.5f)
|
||||
virtual void setFOV(f32 fovy) _IRR_OVERRIDE_;
|
||||
void setFOV(f32 fovy) override;
|
||||
|
||||
//! PreRender event
|
||||
virtual void OnRegisterSceneNode() _IRR_OVERRIDE_;
|
||||
void OnRegisterSceneNode() override;
|
||||
|
||||
//! Render
|
||||
virtual void render() _IRR_OVERRIDE_;
|
||||
void render() override;
|
||||
|
||||
//! Update
|
||||
virtual void updateMatrices() _IRR_OVERRIDE_;
|
||||
void updateMatrices() override;
|
||||
|
||||
//! Returns the axis aligned bounding box of this node
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_;
|
||||
const core::aabbox3d<f32>& getBoundingBox() const override;
|
||||
|
||||
//! Returns the view area.
|
||||
virtual const SViewFrustum* getViewFrustum() const _IRR_OVERRIDE_;
|
||||
const SViewFrustum* getViewFrustum() const override;
|
||||
|
||||
//! Disables or enables the camera to get key or mouse inputs.
|
||||
//! If this is set to true, the camera will respond to key inputs
|
||||
//! otherwise not.
|
||||
virtual void setInputReceiverEnabled(bool enabled) _IRR_OVERRIDE_;
|
||||
void setInputReceiverEnabled(bool enabled) override;
|
||||
|
||||
//! Returns if the input receiver of the camera is currently enabled.
|
||||
virtual bool isInputReceiverEnabled() const _IRR_OVERRIDE_;
|
||||
bool isInputReceiverEnabled() const override;
|
||||
|
||||
//! Returns type of the scene node
|
||||
virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_CAMERA; }
|
||||
ESCENE_NODE_TYPE getType() const override { return ESNT_CAMERA; }
|
||||
|
||||
//! Binds the camera scene node's rotation to its target position and vice versa, or unbinds them.
|
||||
virtual void bindTargetAndRotation(bool bound) _IRR_OVERRIDE_;
|
||||
void bindTargetAndRotation(bool bound) override;
|
||||
|
||||
//! Queries if the camera scene node's rotation and its target position are bound together.
|
||||
virtual bool getTargetAndRotationBinding(void) const _IRR_OVERRIDE_;
|
||||
bool getTargetAndRotationBinding(void) const override;
|
||||
|
||||
//! Creates a clone of this scene node and its children.
|
||||
virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) _IRR_OVERRIDE_;
|
||||
ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) override;
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -20,36 +20,36 @@ namespace scene
|
||||
CDummyTransformationSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id);
|
||||
|
||||
//! returns the axis aligned bounding box of this node
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_;
|
||||
const core::aabbox3d<f32>& getBoundingBox() const override;
|
||||
|
||||
//! Returns a reference to the current relative transformation matrix.
|
||||
//! This is the matrix, this scene node uses instead of scale, translation
|
||||
//! and rotation.
|
||||
virtual core::matrix4& getRelativeTransformationMatrix() _IRR_OVERRIDE_;
|
||||
core::matrix4& getRelativeTransformationMatrix() override;
|
||||
|
||||
//! Returns the relative transformation of the scene node.
|
||||
virtual core::matrix4 getRelativeTransformation() const _IRR_OVERRIDE_;
|
||||
core::matrix4 getRelativeTransformation() const override;
|
||||
|
||||
//! does nothing.
|
||||
virtual void render() _IRR_OVERRIDE_ {}
|
||||
void render() override {}
|
||||
|
||||
//! Returns type of the scene node
|
||||
virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_DUMMY_TRANSFORMATION; }
|
||||
ESCENE_NODE_TYPE getType() const override { return ESNT_DUMMY_TRANSFORMATION; }
|
||||
|
||||
//! Creates a clone of this scene node and its children.
|
||||
virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) _IRR_OVERRIDE_;
|
||||
ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) override;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// TODO: We can add least add some warnings to find troubles faster until we have
|
||||
// fixed bug id 2318691.
|
||||
virtual const core::vector3df& getScale() const _IRR_OVERRIDE_;
|
||||
virtual void setScale(const core::vector3df& scale) _IRR_OVERRIDE_;
|
||||
virtual const core::vector3df& getRotation() const _IRR_OVERRIDE_;
|
||||
virtual void setRotation(const core::vector3df& rotation) _IRR_OVERRIDE_;
|
||||
virtual const core::vector3df& getPosition() const _IRR_OVERRIDE_;
|
||||
virtual void setPosition(const core::vector3df& newpos) _IRR_OVERRIDE_;
|
||||
const core::vector3df& getScale() const override;
|
||||
void setScale(const core::vector3df& scale) override;
|
||||
const core::vector3df& getRotation() const override;
|
||||
void setRotation(const core::vector3df& rotation) override;
|
||||
const core::vector3df& getPosition() const override;
|
||||
void setPosition(const core::vector3df& newpos) override;
|
||||
|
||||
core::matrix4 RelativeTransformationMatrix;
|
||||
core::aabbox3d<f32> Box;
|
||||
|
@ -1,87 +0,0 @@
|
||||
// Copyright (C) 2015 Patryk Nadrowski
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in Irrlicht.h
|
||||
|
||||
#ifndef __C_EAGL_MANAGER_H_INCLUDED__
|
||||
#define __C_EAGL_MANAGER_H_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_EAGL_MANAGER_
|
||||
|
||||
#include "SIrrCreationParameters.h"
|
||||
#include "SExposedVideoData.h"
|
||||
#include "IContextManager.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
// EAGL manager.
|
||||
class CEAGLManager : public IContextManager
|
||||
{
|
||||
public:
|
||||
//! Constructor.
|
||||
CEAGLManager();
|
||||
|
||||
//! Destructor.
|
||||
virtual ~CEAGLManager();
|
||||
|
||||
// Initialize EAGL.
|
||||
/* This method checks if a view has CAEAGLLayer and grabs it if it does, anyway surface and context
|
||||
aren't create. */
|
||||
bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data);
|
||||
|
||||
// Terminate EAGL.
|
||||
/* Terminate EAGL context. This method break both existed surface and context. */
|
||||
void terminate();
|
||||
|
||||
// Create EAGL surface.
|
||||
/* This method configure CAEAGLLayer. */
|
||||
bool generateSurface();
|
||||
|
||||
// Destroy EAGL surface.
|
||||
/* This method reset CAEAGLLayer states. */
|
||||
void destroySurface();
|
||||
|
||||
// Create EAGL context.
|
||||
/* This method create and activate EAGL context. */
|
||||
bool generateContext();
|
||||
|
||||
// Destroy EAGL context.
|
||||
/* This method destroy EAGL context. */
|
||||
void destroyContext();
|
||||
|
||||
const SExposedVideoData& getContext() const;
|
||||
|
||||
bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero);
|
||||
|
||||
// Swap buffers.
|
||||
bool swapBuffers();
|
||||
|
||||
private:
|
||||
SIrrlichtCreationParameters Params;
|
||||
SExposedVideoData Data;
|
||||
|
||||
bool Configured;
|
||||
|
||||
void* DataStorage;
|
||||
|
||||
struct SFrameBuffer
|
||||
{
|
||||
SFrameBuffer() : BufferID(0), ColorBuffer(0), DepthBuffer(0)
|
||||
{
|
||||
}
|
||||
|
||||
u32 BufferID;
|
||||
u32 ColorBuffer;
|
||||
u32 DepthBuffer;
|
||||
};
|
||||
|
||||
SFrameBuffer FrameBuffer;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
@ -1,273 +0,0 @@
|
||||
// Copyright (C) 2015 Patryk Nadrowski
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in Irrlicht.h
|
||||
|
||||
#include "CEAGLManager.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_EAGL_MANAGER_
|
||||
|
||||
#include "irrString.h"
|
||||
#include "os.h"
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <OpenGLES/EAGL.h>
|
||||
|
||||
#if defined(_IRR_COMPILE_WITH_OGLES1_)
|
||||
#include <OpenGLES/ES1/gl.h>
|
||||
#include <OpenGLES/ES1/glext.h>
|
||||
#elif defined(_IRR_COMPILE_WITH_OGLES2_)
|
||||
#include <OpenGLES/ES2/gl.h>
|
||||
#include <OpenGLES/ES2/glext.h>
|
||||
#endif
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
struct SEAGLManagerDataStorage
|
||||
{
|
||||
SEAGLManagerDataStorage() : Layer(0), Context(0)
|
||||
{
|
||||
}
|
||||
|
||||
CAEAGLLayer* Layer;
|
||||
EAGLContext* Context;
|
||||
};
|
||||
|
||||
CEAGLManager::CEAGLManager() : IContextManager(), Configured(false), DataStorage(0)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
setDebugName("CEAGLManager");
|
||||
#endif
|
||||
|
||||
DataStorage = new SEAGLManagerDataStorage();
|
||||
}
|
||||
|
||||
CEAGLManager::~CEAGLManager()
|
||||
{
|
||||
destroyContext();
|
||||
destroySurface();
|
||||
terminate();
|
||||
|
||||
delete static_cast<SEAGLManagerDataStorage*>(DataStorage);
|
||||
}
|
||||
|
||||
bool CEAGLManager::initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data)
|
||||
{
|
||||
SEAGLManagerDataStorage* dataStorage = static_cast<SEAGLManagerDataStorage*>(DataStorage);
|
||||
|
||||
if (dataStorage->Layer != nil)
|
||||
return true;
|
||||
|
||||
Params = params;
|
||||
Data = data;
|
||||
|
||||
UIView* view = (__bridge UIView*)data.OpenGLiOS.View;
|
||||
|
||||
if (view == nil || ![[view layer] isKindOfClass:[CAEAGLLayer class]])
|
||||
{
|
||||
os::Printer::log("Could not get EAGL display.");
|
||||
return false;
|
||||
}
|
||||
|
||||
dataStorage->Layer = (CAEAGLLayer*)[view layer];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CEAGLManager::terminate()
|
||||
{
|
||||
SEAGLManagerDataStorage* dataStorage = static_cast<SEAGLManagerDataStorage*>(DataStorage);
|
||||
|
||||
[EAGLContext setCurrentContext:0];
|
||||
|
||||
destroySurface();
|
||||
|
||||
if (dataStorage->Layer != nil)
|
||||
dataStorage->Layer = 0;
|
||||
}
|
||||
|
||||
bool CEAGLManager::generateSurface()
|
||||
{
|
||||
SEAGLManagerDataStorage* dataStorage = static_cast<SEAGLManagerDataStorage*>(DataStorage);
|
||||
CAEAGLLayer* layer = dataStorage->Layer;
|
||||
|
||||
if (layer == nil)
|
||||
return false;
|
||||
|
||||
if (Configured)
|
||||
return true;
|
||||
|
||||
NSDictionary* attribs = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
[NSNumber numberWithBool:NO],
|
||||
kEAGLDrawablePropertyRetainedBacking,
|
||||
(Params.Bits > 16) ? kEAGLColorFormatRGBA8 : kEAGLColorFormatRGB565,
|
||||
kEAGLDrawablePropertyColorFormat,
|
||||
nil];
|
||||
|
||||
[layer setOpaque:(Params.WithAlphaChannel) ? YES : NO];
|
||||
[layer setDrawableProperties:attribs];
|
||||
|
||||
Configured = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CEAGLManager::destroySurface()
|
||||
{
|
||||
SEAGLManagerDataStorage* dataStorage = static_cast<SEAGLManagerDataStorage*>(DataStorage);
|
||||
CAEAGLLayer* layer = dataStorage->Layer;
|
||||
|
||||
if (layer == nil)
|
||||
return;
|
||||
|
||||
[layer setOpaque:NO];
|
||||
[layer setDrawableProperties:nil];
|
||||
|
||||
Configured = false;
|
||||
}
|
||||
|
||||
bool CEAGLManager::generateContext()
|
||||
{
|
||||
SEAGLManagerDataStorage* dataStorage = static_cast<SEAGLManagerDataStorage*>(DataStorage);
|
||||
|
||||
if (dataStorage->Context != nil || !Configured)
|
||||
return false;
|
||||
|
||||
EAGLRenderingAPI OpenGLESVersion = kEAGLRenderingAPIOpenGLES2;
|
||||
|
||||
switch (Params.DriverType)
|
||||
{
|
||||
case EDT_OGLES1:
|
||||
OpenGLESVersion = kEAGLRenderingAPIOpenGLES1;
|
||||
break;
|
||||
case EDT_OGLES2:
|
||||
OpenGLESVersion = kEAGLRenderingAPIOpenGLES2;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
dataStorage->Context = [[EAGLContext alloc] initWithAPI:OpenGLESVersion];
|
||||
|
||||
if (dataStorage->Context == nil)
|
||||
{
|
||||
os::Printer::log("Could not create EAGL context.", ELL_ERROR);
|
||||
return false;
|
||||
}
|
||||
|
||||
Data.OpenGLiOS.Context = (__bridge void*)dataStorage->Context;
|
||||
|
||||
os::Printer::log("EAGL context created with OpenGLESVersion: ", core::stringc(static_cast<int>(OpenGLESVersion)), ELL_DEBUG);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CEAGLManager::destroyContext()
|
||||
{
|
||||
SEAGLManagerDataStorage* dataStorage = static_cast<SEAGLManagerDataStorage*>(DataStorage);
|
||||
|
||||
[dataStorage->Context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:nil];
|
||||
|
||||
if (FrameBuffer.BufferID != 0)
|
||||
{
|
||||
glDeleteFramebuffersOES(1, &FrameBuffer.BufferID);
|
||||
FrameBuffer.BufferID = 0;
|
||||
}
|
||||
|
||||
if (FrameBuffer.ColorBuffer != 0)
|
||||
{
|
||||
glDeleteRenderbuffersOES(1, &FrameBuffer.ColorBuffer);
|
||||
FrameBuffer.ColorBuffer = 0;
|
||||
}
|
||||
|
||||
if (FrameBuffer.DepthBuffer != 0)
|
||||
{
|
||||
glDeleteRenderbuffersOES(1, &FrameBuffer.DepthBuffer);
|
||||
FrameBuffer.DepthBuffer = 0;
|
||||
}
|
||||
|
||||
[EAGLContext setCurrentContext:0];
|
||||
|
||||
if (dataStorage->Context != nil)
|
||||
dataStorage->Context = 0;
|
||||
|
||||
Data.OpenGLiOS.Context = 0;
|
||||
}
|
||||
|
||||
bool CEAGLManager::activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero)
|
||||
{
|
||||
SEAGLManagerDataStorage* dataStorage = static_cast<SEAGLManagerDataStorage*>(DataStorage);
|
||||
EAGLContext* context = dataStorage->Context;
|
||||
|
||||
bool status = false;
|
||||
|
||||
if (context != nil)
|
||||
{
|
||||
status = ([EAGLContext currentContext] == context || [EAGLContext setCurrentContext:context]);
|
||||
}
|
||||
|
||||
if (status)
|
||||
{
|
||||
if (FrameBuffer.ColorBuffer == 0)
|
||||
{
|
||||
glGenRenderbuffersOES(1, &FrameBuffer.ColorBuffer);
|
||||
glBindRenderbufferOES(GL_RENDERBUFFER_OES, FrameBuffer.ColorBuffer);
|
||||
[context renderbufferStorage:GL_RENDERBUFFER_OES fromDrawable:dataStorage->Layer];
|
||||
}
|
||||
|
||||
if (FrameBuffer.DepthBuffer == 0)
|
||||
{
|
||||
GLenum depth = (Params.ZBufferBits >= 24) ? GL_DEPTH_COMPONENT24_OES : GL_DEPTH_COMPONENT16_OES;
|
||||
|
||||
glGenRenderbuffersOES(1, &FrameBuffer.DepthBuffer);
|
||||
glBindRenderbufferOES(GL_RENDERBUFFER_OES, FrameBuffer.DepthBuffer);
|
||||
glRenderbufferStorageOES(GL_RENDERBUFFER_OES, depth, Params.WindowSize.Width, Params.WindowSize.Height);
|
||||
}
|
||||
|
||||
if (FrameBuffer.BufferID == 0)
|
||||
{
|
||||
glGenFramebuffersOES(1, &FrameBuffer.BufferID);
|
||||
glBindFramebufferOES(GL_FRAMEBUFFER_OES, FrameBuffer.BufferID);
|
||||
glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, FrameBuffer.ColorBuffer);
|
||||
glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES, GL_DEPTH_ATTACHMENT_OES, GL_RENDERBUFFER_OES, FrameBuffer.DepthBuffer);
|
||||
}
|
||||
|
||||
glBindFramebufferOES(GL_FRAMEBUFFER_OES, FrameBuffer.BufferID);
|
||||
}
|
||||
else
|
||||
{
|
||||
os::Printer::log("Could not make EGL context current.");
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
const SExposedVideoData& CEAGLManager::getContext() const
|
||||
{
|
||||
return Data;
|
||||
}
|
||||
|
||||
bool CEAGLManager::swapBuffers()
|
||||
{
|
||||
SEAGLManagerDataStorage* dataStorage = static_cast<SEAGLManagerDataStorage*>(DataStorage);
|
||||
EAGLContext* context = dataStorage->Context;
|
||||
|
||||
bool status = false;
|
||||
|
||||
if (context != nil && context == [EAGLContext currentContext])
|
||||
{
|
||||
glBindRenderbufferOES(GL_RENDERBUFFER_OES, FrameBuffer.ColorBuffer);
|
||||
[context presentRenderbuffer:GL_RENDERBUFFER_OES];
|
||||
|
||||
status = true;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -5,7 +5,6 @@
|
||||
#ifndef __C_EGL_MANAGER_H_INCLUDED__
|
||||
#define __C_EGL_MANAGER_H_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_EGL_MANAGER_
|
||||
|
||||
@ -32,42 +31,42 @@ namespace video
|
||||
// Initialize EGL.
|
||||
/* This method initialize EGLand create EGL display, anyway surface and context
|
||||
aren't create. */
|
||||
virtual bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) _IRR_OVERRIDE_;
|
||||
bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) override;
|
||||
|
||||
// Terminate EGL.
|
||||
/* Terminate EGL context. This method break both existed surface and context. */
|
||||
virtual void terminate() _IRR_OVERRIDE_;
|
||||
void terminate() override;
|
||||
|
||||
// Create EGL surface.
|
||||
/* This method create EGL surface. On some platforms eg. Android, we must
|
||||
recreate surface on each resume, because WindowID may change, so existed
|
||||
surface may not be valid. If EGL context already exist, this method
|
||||
automatically activates it. */
|
||||
virtual bool generateSurface() _IRR_OVERRIDE_;
|
||||
bool generateSurface() override;
|
||||
|
||||
// Destroy EGL surface.
|
||||
/* This method destroy EGL. On some platforms eg. Android, we should call
|
||||
this method on each pause, because after resume this surface may not be valid.
|
||||
Hovewer this method doesn'r break EGL context. */
|
||||
virtual void destroySurface() _IRR_OVERRIDE_;
|
||||
void destroySurface() override;
|
||||
|
||||
// Create EGL context.
|
||||
/* This method create and activate EGL context. */
|
||||
virtual bool generateContext() _IRR_OVERRIDE_;
|
||||
bool generateContext() override;
|
||||
|
||||
// Destroy EGL context.
|
||||
/* This method destroy EGL context. */
|
||||
virtual void destroyContext() _IRR_OVERRIDE_;
|
||||
void destroyContext() override;
|
||||
|
||||
virtual const SExposedVideoData& getContext() const _IRR_OVERRIDE_;
|
||||
const SExposedVideoData& getContext() const override;
|
||||
|
||||
virtual bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero) _IRR_OVERRIDE_;
|
||||
bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero) override;
|
||||
|
||||
// Get procedure address.
|
||||
virtual void* getProcAddress(const std::string &procName) _IRR_OVERRIDE_;
|
||||
void* getProcAddress(const std::string &procName) override;
|
||||
|
||||
// Swap buffers.
|
||||
virtual bool swapBuffers() _IRR_OVERRIDE_;
|
||||
bool swapBuffers() override;
|
||||
|
||||
protected:
|
||||
enum EConfigStyle
|
||||
|
@ -20,19 +20,19 @@ namespace scene
|
||||
CEmptySceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id);
|
||||
|
||||
//! returns the axis aligned bounding box of this node
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_;
|
||||
const core::aabbox3d<f32>& getBoundingBox() const override;
|
||||
|
||||
//! This method is called just before the rendering process of the whole scene.
|
||||
virtual void OnRegisterSceneNode() _IRR_OVERRIDE_;
|
||||
void OnRegisterSceneNode() override;
|
||||
|
||||
//! does nothing.
|
||||
virtual void render() _IRR_OVERRIDE_;
|
||||
void render() override;
|
||||
|
||||
//! Returns type of the scene node
|
||||
virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_EMPTY; }
|
||||
ESCENE_NODE_TYPE getType() const override { return ESNT_EMPTY; }
|
||||
|
||||
//! Creates a clone of this scene node and its children.
|
||||
virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) _IRR_OVERRIDE_;
|
||||
ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0) override;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#include "CFileList.h"
|
||||
#include "IrrCompileConfig.h"
|
||||
#include "irrArray.h"
|
||||
#include "coreutil.h"
|
||||
|
||||
|
@ -82,37 +82,37 @@ public:
|
||||
\param offset The offset where the file is stored in an archive
|
||||
\param size The size of the file in bytes.
|
||||
\param id The ID of the file in the archive which owns it */
|
||||
virtual u32 addItem(const io::path& fullPath, u32 offset, u32 size, bool isDirectory, u32 id=0) _IRR_OVERRIDE_;
|
||||
u32 addItem(const io::path& fullPath, u32 offset, u32 size, bool isDirectory, u32 id=0) override;
|
||||
|
||||
//! Sorts the file list. You should call this after adding any items to the file list
|
||||
virtual void sort() _IRR_OVERRIDE_;
|
||||
void sort() override;
|
||||
|
||||
//! Returns the amount of files in the filelist.
|
||||
virtual u32 getFileCount() const _IRR_OVERRIDE_;
|
||||
u32 getFileCount() const override;
|
||||
|
||||
//! Gets the name of a file in the list, based on an index.
|
||||
virtual const io::path& getFileName(u32 index) const _IRR_OVERRIDE_;
|
||||
const io::path& getFileName(u32 index) const override;
|
||||
|
||||
//! Gets the full name of a file in the list, path included, based on an index.
|
||||
virtual const io::path& getFullFileName(u32 index) const _IRR_OVERRIDE_;
|
||||
const io::path& getFullFileName(u32 index) const override;
|
||||
|
||||
//! Returns the ID of a file in the file list, based on an index.
|
||||
virtual u32 getID(u32 index) const _IRR_OVERRIDE_;
|
||||
u32 getID(u32 index) const override;
|
||||
|
||||
//! Returns true if the file is a directory
|
||||
virtual bool isDirectory(u32 index) const _IRR_OVERRIDE_;
|
||||
bool isDirectory(u32 index) const override;
|
||||
|
||||
//! Returns the size of a file
|
||||
virtual u32 getFileSize(u32 index) const _IRR_OVERRIDE_;
|
||||
u32 getFileSize(u32 index) const override;
|
||||
|
||||
//! Returns the offset of a file
|
||||
virtual u32 getFileOffset(u32 index) const _IRR_OVERRIDE_;
|
||||
u32 getFileOffset(u32 index) const override;
|
||||
|
||||
//! Searches for a file or folder within the list, returns the index
|
||||
virtual s32 findFile(const io::path& filename, bool isFolder) const _IRR_OVERRIDE_;
|
||||
s32 findFile(const io::path& filename, bool isFolder) const override;
|
||||
|
||||
//! Returns the base path of the file list
|
||||
virtual const io::path& getPath() const _IRR_OVERRIDE_;
|
||||
const io::path& getPath() const override;
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -2,7 +2,6 @@
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
#include "CFileSystem.h"
|
||||
#include "IReadFile.h"
|
||||
@ -25,7 +24,7 @@
|
||||
#include <direct.h> // for _chdir
|
||||
#include <io.h> // for _access
|
||||
#include <tchar.h>
|
||||
#elif (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_) || defined(_IRR_IOS_PLATFORM_) || defined(_IRR_ANDROID_PLATFORM_))
|
||||
#elif (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_) || defined(_IRR_ANDROID_PLATFORM_))
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -54,9 +53,7 @@ CFileSystem::CFileSystem()
|
||||
//! reset current working directory
|
||||
getWorkingDirectory();
|
||||
|
||||
#ifdef __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_
|
||||
ArchiveLoader.push_back(new CArchiveLoaderZIP(this));
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@ -799,7 +796,7 @@ IFileList* CFileSystem::createFileList()
|
||||
size = buf.st_size;
|
||||
isDirectory = S_ISDIR(buf.st_mode);
|
||||
}
|
||||
#if !defined(_IRR_SOLARIS_PLATFORM_) && !defined(__CYGWIN__)
|
||||
#if !defined(_IRR_SOLARIS_PLATFORM_) && !defined(__CYGWIN__) && !defined(__HAIKU__)
|
||||
// only available on some systems
|
||||
else
|
||||
{
|
||||
|
@ -29,101 +29,101 @@ public:
|
||||
virtual ~CFileSystem();
|
||||
|
||||
//! opens a file for read access
|
||||
virtual IReadFile* createAndOpenFile(const io::path& filename) _IRR_OVERRIDE_;
|
||||
IReadFile* createAndOpenFile(const io::path& filename) override;
|
||||
|
||||
//! Creates an IReadFile interface for accessing memory like a file.
|
||||
virtual IReadFile* createMemoryReadFile(const void* memory, s32 len, const io::path& fileName, bool deleteMemoryWhenDropped = false) _IRR_OVERRIDE_;
|
||||
IReadFile* createMemoryReadFile(const void* memory, s32 len, const io::path& fileName, bool deleteMemoryWhenDropped = false) override;
|
||||
|
||||
//! Creates an IReadFile interface for accessing files inside files
|
||||
virtual IReadFile* createLimitReadFile(const io::path& fileName, IReadFile* alreadyOpenedFile, long pos, long areaSize) _IRR_OVERRIDE_;
|
||||
IReadFile* createLimitReadFile(const io::path& fileName, IReadFile* alreadyOpenedFile, long pos, long areaSize) override;
|
||||
|
||||
//! Creates an IWriteFile interface for accessing memory like a file.
|
||||
virtual IWriteFile* createMemoryWriteFile(void* memory, s32 len, const io::path& fileName, bool deleteMemoryWhenDropped=false) _IRR_OVERRIDE_;
|
||||
IWriteFile* createMemoryWriteFile(void* memory, s32 len, const io::path& fileName, bool deleteMemoryWhenDropped=false) override;
|
||||
|
||||
//! Opens a file for write access.
|
||||
virtual IWriteFile* createAndWriteFile(const io::path& filename, bool append=false) _IRR_OVERRIDE_;
|
||||
IWriteFile* createAndWriteFile(const io::path& filename, bool append=false) override;
|
||||
|
||||
//! Adds an archive to the file system.
|
||||
virtual bool addFileArchive(const io::path& filename,
|
||||
bool ignoreCase = true, bool ignorePaths = true,
|
||||
E_FILE_ARCHIVE_TYPE archiveType = EFAT_UNKNOWN,
|
||||
const core::stringc& password="",
|
||||
IFileArchive** retArchive = 0) _IRR_OVERRIDE_;
|
||||
IFileArchive** retArchive = 0) override;
|
||||
|
||||
//! Adds an archive to the file system.
|
||||
virtual bool addFileArchive(IReadFile* file, bool ignoreCase=true,
|
||||
bool ignorePaths=true,
|
||||
E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN,
|
||||
const core::stringc& password="",
|
||||
IFileArchive** retArchive = 0) _IRR_OVERRIDE_;
|
||||
IFileArchive** retArchive = 0) override;
|
||||
|
||||
//! Adds an archive to the file system.
|
||||
virtual bool addFileArchive(IFileArchive* archive) _IRR_OVERRIDE_;
|
||||
bool addFileArchive(IFileArchive* archive) override;
|
||||
|
||||
//! move the hirarchy of the filesystem. moves sourceIndex relative up or down
|
||||
virtual bool moveFileArchive(u32 sourceIndex, s32 relative) _IRR_OVERRIDE_;
|
||||
bool moveFileArchive(u32 sourceIndex, s32 relative) override;
|
||||
|
||||
//! Adds an external archive loader to the engine.
|
||||
virtual void addArchiveLoader(IArchiveLoader* loader) _IRR_OVERRIDE_;
|
||||
void addArchiveLoader(IArchiveLoader* loader) override;
|
||||
|
||||
//! Returns the total number of archive loaders added.
|
||||
virtual u32 getArchiveLoaderCount() const _IRR_OVERRIDE_;
|
||||
u32 getArchiveLoaderCount() const override;
|
||||
|
||||
//! Gets the archive loader by index.
|
||||
virtual IArchiveLoader* getArchiveLoader(u32 index) const _IRR_OVERRIDE_;
|
||||
IArchiveLoader* getArchiveLoader(u32 index) const override;
|
||||
|
||||
//! gets the file archive count
|
||||
virtual u32 getFileArchiveCount() const _IRR_OVERRIDE_;
|
||||
u32 getFileArchiveCount() const override;
|
||||
|
||||
//! gets an archive
|
||||
virtual IFileArchive* getFileArchive(u32 index) _IRR_OVERRIDE_;
|
||||
IFileArchive* getFileArchive(u32 index) override;
|
||||
|
||||
//! removes an archive from the file system.
|
||||
virtual bool removeFileArchive(u32 index) _IRR_OVERRIDE_;
|
||||
bool removeFileArchive(u32 index) override;
|
||||
|
||||
//! removes an archive from the file system.
|
||||
virtual bool removeFileArchive(const io::path& filename) _IRR_OVERRIDE_;
|
||||
bool removeFileArchive(const io::path& filename) override;
|
||||
|
||||
//! Removes an archive from the file system.
|
||||
virtual bool removeFileArchive(const IFileArchive* archive) _IRR_OVERRIDE_;
|
||||
bool removeFileArchive(const IFileArchive* archive) override;
|
||||
|
||||
//! Returns the string of the current working directory
|
||||
virtual const io::path& getWorkingDirectory() _IRR_OVERRIDE_;
|
||||
const io::path& getWorkingDirectory() override;
|
||||
|
||||
//! Changes the current Working Directory to the string given.
|
||||
//! The string is operating system dependent. Under Windows it will look
|
||||
//! like this: "drive:\directory\sudirectory\"
|
||||
virtual bool changeWorkingDirectoryTo(const io::path& newDirectory) _IRR_OVERRIDE_;
|
||||
bool changeWorkingDirectoryTo(const io::path& newDirectory) override;
|
||||
|
||||
//! Converts a relative path to an absolute (unique) path, resolving symbolic links
|
||||
virtual io::path getAbsolutePath(const io::path& filename) const _IRR_OVERRIDE_;
|
||||
io::path getAbsolutePath(const io::path& filename) const override;
|
||||
|
||||
//! Returns the directory a file is located in.
|
||||
/** \param filename: The file to get the directory from */
|
||||
virtual io::path getFileDir(const io::path& filename) const _IRR_OVERRIDE_;
|
||||
io::path getFileDir(const io::path& filename) const override;
|
||||
|
||||
//! Returns the base part of a filename, i.e. the name without the directory
|
||||
//! part. If no directory is prefixed, the full name is returned.
|
||||
/** \param filename: The file to get the basename from */
|
||||
virtual io::path getFileBasename(const io::path& filename, bool keepExtension=true) const _IRR_OVERRIDE_;
|
||||
io::path getFileBasename(const io::path& filename, bool keepExtension=true) const override;
|
||||
|
||||
//! flatten a path and file name for example: "/you/me/../." becomes "/you"
|
||||
virtual io::path& flattenFilename( io::path& directory, const io::path& root = "/" ) const _IRR_OVERRIDE_;
|
||||
io::path& flattenFilename( io::path& directory, const io::path& root = "/" ) const override;
|
||||
|
||||
//! Get the relative filename, relative to the given directory
|
||||
virtual path getRelativeFilename(const path& filename, const path& directory) const _IRR_OVERRIDE_;
|
||||
path getRelativeFilename(const path& filename, const path& directory) const override;
|
||||
|
||||
virtual EFileSystemType setFileListSystem(EFileSystemType listType) _IRR_OVERRIDE_;
|
||||
EFileSystemType setFileListSystem(EFileSystemType listType) override;
|
||||
|
||||
//! Creates a list of files and directories in the current working directory
|
||||
//! and returns it.
|
||||
virtual IFileList* createFileList() _IRR_OVERRIDE_;
|
||||
IFileList* createFileList() override;
|
||||
|
||||
//! Creates an empty filelist
|
||||
virtual IFileList* createEmptyFileList(const io::path& path, bool ignoreCase, bool ignorePaths) _IRR_OVERRIDE_;
|
||||
IFileList* createEmptyFileList(const io::path& path, bool ignoreCase, bool ignorePaths) override;
|
||||
|
||||
//! determines if a file exists and would be able to be opened.
|
||||
virtual bool existFile(const io::path& filename) const _IRR_OVERRIDE_;
|
||||
bool existFile(const io::path& filename) const override;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -5,7 +5,6 @@
|
||||
#ifndef __C_GLX_MANAGER_H_INCLUDED__
|
||||
#define __C_GLX_MANAGER_H_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_GLX_MANAGER_
|
||||
|
||||
@ -34,34 +33,34 @@ namespace video
|
||||
~CGLXManager();
|
||||
|
||||
// Initialize
|
||||
virtual bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) _IRR_OVERRIDE_;
|
||||
bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) override;
|
||||
|
||||
// Terminate
|
||||
virtual void terminate() _IRR_OVERRIDE_;
|
||||
void terminate() override;
|
||||
|
||||
// Create surface.
|
||||
virtual bool generateSurface() _IRR_OVERRIDE_;
|
||||
bool generateSurface() override;
|
||||
|
||||
// Destroy surface.
|
||||
virtual void destroySurface() _IRR_OVERRIDE_;
|
||||
void destroySurface() override;
|
||||
|
||||
// Create context.
|
||||
virtual bool generateContext() _IRR_OVERRIDE_;
|
||||
bool generateContext() override;
|
||||
|
||||
// Destroy context.
|
||||
virtual void destroyContext() _IRR_OVERRIDE_;
|
||||
void destroyContext() override;
|
||||
|
||||
//! Get current context
|
||||
virtual const SExposedVideoData& getContext() const _IRR_OVERRIDE_;
|
||||
const SExposedVideoData& getContext() const override;
|
||||
|
||||
//! Change render context, disable old and activate new defined by videoData
|
||||
virtual bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero) _IRR_OVERRIDE_;
|
||||
bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero) override;
|
||||
|
||||
// Get procedure address.
|
||||
virtual void* getProcAddress(const std::string &procName) _IRR_OVERRIDE_;
|
||||
void* getProcAddress(const std::string &procName) override;
|
||||
|
||||
// Swap buffers.
|
||||
virtual bool swapBuffers() _IRR_OVERRIDE_;
|
||||
bool swapBuffers() override;
|
||||
|
||||
XVisualInfo* getVisual() const {return VisualInfo;} // return XVisualInfo
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#include "CGUIButton.h"
|
||||
#ifdef _IRR_COMPILE_WITH_GUI_
|
||||
|
||||
#include "IGUISkin.h"
|
||||
#include "IGUIEnvironment.h"
|
||||
@ -558,6 +557,3 @@ bool CGUIButton::isDrawingBorder() const
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_GUI_
|
||||
|
||||
|
@ -5,9 +5,6 @@
|
||||
#ifndef __C_GUI_BUTTON_H_INCLUDED__
|
||||
#define __C_GUI_BUTTON_H_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
#ifdef _IRR_COMPILE_WITH_GUI_
|
||||
|
||||
#include "IGUIButton.h"
|
||||
#include "IGUISpriteBank.h"
|
||||
#include "ITexture.h"
|
||||
@ -30,64 +27,64 @@ namespace gui
|
||||
virtual ~CGUIButton();
|
||||
|
||||
//! called if an event happened.
|
||||
virtual bool OnEvent(const SEvent& event) _IRR_OVERRIDE_;
|
||||
bool OnEvent(const SEvent& event) override;
|
||||
|
||||
//! draws the element and its children
|
||||
virtual void draw() _IRR_OVERRIDE_;
|
||||
void draw() override;
|
||||
|
||||
//! sets another skin independent font. if this is set to zero, the button uses the font of the skin.
|
||||
virtual void setOverrideFont(IGUIFont* font=0) _IRR_OVERRIDE_;
|
||||
void setOverrideFont(IGUIFont* font=0) override;
|
||||
|
||||
//! Gets the override font (if any)
|
||||
virtual IGUIFont* getOverrideFont() const _IRR_OVERRIDE_;
|
||||
IGUIFont* getOverrideFont() const override;
|
||||
|
||||
//! Get the font which is used right now for drawing
|
||||
virtual IGUIFont* getActiveFont() const _IRR_OVERRIDE_;
|
||||
IGUIFont* getActiveFont() const override;
|
||||
|
||||
//! Sets another color for the button text.
|
||||
virtual void setOverrideColor(video::SColor color) _IRR_OVERRIDE_;
|
||||
void setOverrideColor(video::SColor color) override;
|
||||
|
||||
//! Gets the override color
|
||||
virtual video::SColor getOverrideColor(void) const _IRR_OVERRIDE_;
|
||||
video::SColor getOverrideColor(void) const override;
|
||||
|
||||
//! Gets the currently used text color
|
||||
virtual video::SColor getActiveColor() const _IRR_OVERRIDE_;
|
||||
video::SColor getActiveColor() const override;
|
||||
|
||||
//! Sets if the button text should use the override color or the color in the gui skin.
|
||||
virtual void enableOverrideColor(bool enable) _IRR_OVERRIDE_;
|
||||
void enableOverrideColor(bool enable) override;
|
||||
|
||||
//! Checks if an override color is enabled
|
||||
virtual bool isOverrideColorEnabled(void) const _IRR_OVERRIDE_;
|
||||
bool isOverrideColorEnabled(void) const override;
|
||||
|
||||
//! Sets an image which should be displayed on the button when it is in the given state.
|
||||
virtual void setImage(EGUI_BUTTON_IMAGE_STATE state, video::ITexture* image=0, const core::rect<s32>& sourceRect=core::rect<s32>(0,0,0,0)) _IRR_OVERRIDE_;
|
||||
void setImage(EGUI_BUTTON_IMAGE_STATE state, video::ITexture* image=0, const core::rect<s32>& sourceRect=core::rect<s32>(0,0,0,0)) override;
|
||||
|
||||
//! Sets an image which should be displayed on the button when it is in normal state.
|
||||
virtual void setImage(video::ITexture* image=0) _IRR_OVERRIDE_
|
||||
void setImage(video::ITexture* image=0) override
|
||||
{
|
||||
setImage(EGBIS_IMAGE_UP, image);
|
||||
}
|
||||
|
||||
//! Sets an image which should be displayed on the button when it is in normal state.
|
||||
virtual void setImage(video::ITexture* image, const core::rect<s32>& pos) _IRR_OVERRIDE_
|
||||
void setImage(video::ITexture* image, const core::rect<s32>& pos) override
|
||||
{
|
||||
setImage(EGBIS_IMAGE_UP, image, pos);
|
||||
}
|
||||
|
||||
//! Sets an image which should be displayed on the button when it is in pressed state.
|
||||
virtual void setPressedImage(video::ITexture* image=0) _IRR_OVERRIDE_
|
||||
void setPressedImage(video::ITexture* image=0) override
|
||||
{
|
||||
setImage(EGBIS_IMAGE_DOWN, image);
|
||||
}
|
||||
|
||||
//! Sets an image which should be displayed on the button when it is in pressed state.
|
||||
virtual void setPressedImage(video::ITexture* image, const core::rect<s32>& pos) _IRR_OVERRIDE_
|
||||
void setPressedImage(video::ITexture* image, const core::rect<s32>& pos) override
|
||||
{
|
||||
setImage(EGBIS_IMAGE_DOWN, image, pos);
|
||||
}
|
||||
|
||||
//! Sets the sprite bank used by the button
|
||||
virtual void setSpriteBank(IGUISpriteBank* bank=0) _IRR_OVERRIDE_;
|
||||
void setSpriteBank(IGUISpriteBank* bank=0) override;
|
||||
|
||||
//! Sets the animated sprite for a specific button state
|
||||
/** \param index: Number of the sprite within the sprite bank, use -1 for no sprite
|
||||
@ -97,60 +94,60 @@ namespace gui
|
||||
*/
|
||||
virtual void setSprite(EGUI_BUTTON_STATE state, s32 index,
|
||||
video::SColor color=video::SColor(255,255,255,255),
|
||||
bool loop=false, bool scale=false) _IRR_OVERRIDE_;
|
||||
bool loop=false, bool scale=false) override;
|
||||
|
||||
//! Get the sprite-index for the given state or -1 when no sprite is set
|
||||
virtual s32 getSpriteIndex(EGUI_BUTTON_STATE state) const _IRR_OVERRIDE_;
|
||||
s32 getSpriteIndex(EGUI_BUTTON_STATE state) const override;
|
||||
|
||||
//! Get the sprite color for the given state. Color is only used when a sprite is set.
|
||||
virtual video::SColor getSpriteColor(EGUI_BUTTON_STATE state) const _IRR_OVERRIDE_;
|
||||
video::SColor getSpriteColor(EGUI_BUTTON_STATE state) const override;
|
||||
|
||||
//! Returns if the sprite in the given state does loop
|
||||
virtual bool getSpriteLoop(EGUI_BUTTON_STATE state) const _IRR_OVERRIDE_;
|
||||
bool getSpriteLoop(EGUI_BUTTON_STATE state) const override;
|
||||
|
||||
//! Returns if the sprite in the given state is scaled
|
||||
virtual bool getSpriteScale(EGUI_BUTTON_STATE state) const _IRR_OVERRIDE_;
|
||||
bool getSpriteScale(EGUI_BUTTON_STATE state) const override;
|
||||
|
||||
//! Sets if the button should behave like a push button. Which means it
|
||||
//! can be in two states: Normal or Pressed. With a click on the button,
|
||||
//! the user can change the state of the button.
|
||||
virtual void setIsPushButton(bool isPushButton=true) _IRR_OVERRIDE_;
|
||||
void setIsPushButton(bool isPushButton=true) override;
|
||||
|
||||
//! Checks whether the button is a push button
|
||||
virtual bool isPushButton() const _IRR_OVERRIDE_;
|
||||
bool isPushButton() const override;
|
||||
|
||||
//! Sets the pressed state of the button if this is a pushbutton
|
||||
virtual void setPressed(bool pressed=true) _IRR_OVERRIDE_;
|
||||
void setPressed(bool pressed=true) override;
|
||||
|
||||
//! Returns if the button is currently pressed
|
||||
virtual bool isPressed() const _IRR_OVERRIDE_;
|
||||
bool isPressed() const override;
|
||||
|
||||
//! Sets if the button should use the skin to draw its border
|
||||
virtual void setDrawBorder(bool border=true) _IRR_OVERRIDE_;
|
||||
void setDrawBorder(bool border=true) override;
|
||||
|
||||
//! Checks if the button face and border are being drawn
|
||||
virtual bool isDrawingBorder() const _IRR_OVERRIDE_;
|
||||
bool isDrawingBorder() const override;
|
||||
|
||||
//! Sets if the alpha channel should be used for drawing images on the button (default is false)
|
||||
virtual void setUseAlphaChannel(bool useAlphaChannel=true) _IRR_OVERRIDE_;
|
||||
void setUseAlphaChannel(bool useAlphaChannel=true) override;
|
||||
|
||||
//! Checks if the alpha channel should be used for drawing images on the button
|
||||
virtual bool isAlphaChannelUsed() const _IRR_OVERRIDE_;
|
||||
bool isAlphaChannelUsed() const override;
|
||||
|
||||
//! Sets if the button should scale the button images to fit
|
||||
virtual void setScaleImage(bool scaleImage=true) _IRR_OVERRIDE_;
|
||||
void setScaleImage(bool scaleImage=true) override;
|
||||
|
||||
//! Checks whether the button scales the used images
|
||||
virtual bool isScalingImage() const _IRR_OVERRIDE_;
|
||||
bool isScalingImage() const override;
|
||||
|
||||
//! Get if the shift key was pressed in last EGET_BUTTON_CLICKED event
|
||||
virtual bool getClickShiftState() const _IRR_OVERRIDE_
|
||||
bool getClickShiftState() const override
|
||||
{
|
||||
return ClickShiftState;
|
||||
}
|
||||
|
||||
//! Get if the control key was pressed in last EGET_BUTTON_CLICKED event
|
||||
virtual bool getClickControlState() const _IRR_OVERRIDE_
|
||||
bool getClickControlState() const override
|
||||
{
|
||||
return ClickControlState;
|
||||
}
|
||||
@ -244,7 +241,4 @@ namespace gui
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_GUI_
|
||||
|
||||
#endif // __C_GUI_BUTTON_H_INCLUDED__
|
||||
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
#include "CGUICheckBox.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_GUI_
|
||||
|
||||
#include "IGUISkin.h"
|
||||
#include "IGUIEnvironment.h"
|
||||
#include "IVideoDriver.h"
|
||||
@ -227,6 +225,3 @@ bool CGUICheckBox::isDrawBorderEnabled() const
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_GUI_
|
||||
|
||||
|
@ -5,9 +5,6 @@
|
||||
#ifndef __C_GUI_CHECKBOX_H_INCLUDED__
|
||||
#define __C_GUI_CHECKBOX_H_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
#ifdef _IRR_COMPILE_WITH_GUI_
|
||||
|
||||
#include "IGUICheckBox.h"
|
||||
|
||||
namespace irr
|
||||
@ -23,30 +20,30 @@ namespace gui
|
||||
CGUICheckBox(bool checked, IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle);
|
||||
|
||||
//! set if box is checked
|
||||
virtual void setChecked(bool checked) _IRR_OVERRIDE_;
|
||||
void setChecked(bool checked) override;
|
||||
|
||||
//! returns if box is checked
|
||||
virtual bool isChecked() const _IRR_OVERRIDE_;
|
||||
bool isChecked() const override;
|
||||
|
||||
//! Sets whether to draw the background
|
||||
virtual void setDrawBackground(bool draw) _IRR_OVERRIDE_;
|
||||
void setDrawBackground(bool draw) override;
|
||||
|
||||
//! Checks if background drawing is enabled
|
||||
/** \return true if background drawing is enabled, false otherwise */
|
||||
virtual bool isDrawBackgroundEnabled() const _IRR_OVERRIDE_;
|
||||
bool isDrawBackgroundEnabled() const override;
|
||||
|
||||
//! Sets whether to draw the border
|
||||
virtual void setDrawBorder(bool draw) _IRR_OVERRIDE_;
|
||||
void setDrawBorder(bool draw) override;
|
||||
|
||||
//! Checks if border drawing is enabled
|
||||
/** \return true if border drawing is enabled, false otherwise */
|
||||
virtual bool isDrawBorderEnabled() const _IRR_OVERRIDE_;
|
||||
bool isDrawBorderEnabled() const override;
|
||||
|
||||
//! called if an event happened.
|
||||
virtual bool OnEvent(const SEvent& event) _IRR_OVERRIDE_;
|
||||
bool OnEvent(const SEvent& event) override;
|
||||
|
||||
//! draws the element and its children
|
||||
virtual void draw() _IRR_OVERRIDE_;
|
||||
void draw() override;
|
||||
|
||||
private:
|
||||
|
||||
@ -61,5 +58,3 @@ namespace gui
|
||||
} // end namespace irr
|
||||
|
||||
#endif // __C_GUI_CHECKBOX_H_INCLUDED__
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_GUI_
|
||||
|
@ -3,7 +3,6 @@
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#include "CGUIComboBox.h"
|
||||
#ifdef _IRR_COMPILE_WITH_GUI_
|
||||
|
||||
#include "IGUIEnvironment.h"
|
||||
#include "IVideoDriver.h"
|
||||
@ -321,6 +320,10 @@ bool CGUIComboBox::OnEvent(const SEvent& event)
|
||||
}
|
||||
case EMIE_MOUSE_WHEEL:
|
||||
{
|
||||
// Try scrolling parent first
|
||||
if (IGUIElement::OnEvent(event))
|
||||
return true;
|
||||
|
||||
s32 oldSelected = Selected;
|
||||
setSelected( Selected + ((event.MouseInput.Wheel < 0) ? 1 : -1));
|
||||
|
||||
@ -330,11 +333,12 @@ bool CGUIComboBox::OnEvent(const SEvent& event)
|
||||
if (Selected >= (s32)Items.size())
|
||||
setSelected((s32)Items.size() -1);
|
||||
|
||||
if (Selected != oldSelected)
|
||||
{
|
||||
if (Selected != oldSelected) {
|
||||
sendSelectionChangedEvent();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
@ -488,7 +492,3 @@ void CGUIComboBox::openCloseMenu()
|
||||
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_GUI_
|
||||
|
||||
|
@ -5,9 +5,6 @@
|
||||
#ifndef __C_GUI_COMBO_BOX_H_INCLUDED__
|
||||
#define __C_GUI_COMBO_BOX_H_INCLUDED__
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
#ifdef _IRR_COMPILE_WITH_GUI_
|
||||
|
||||
#include "IGUIComboBox.h"
|
||||
#include "IGUIStaticText.h"
|
||||
#include "irrString.h"
|
||||
@ -30,49 +27,49 @@ namespace gui
|
||||
s32 id, core::rect<s32> rectangle);
|
||||
|
||||
//! Returns amount of items in box
|
||||
virtual u32 getItemCount() const _IRR_OVERRIDE_;
|
||||
u32 getItemCount() const override;
|
||||
|
||||
//! returns string of an item. the idx may be a value from 0 to itemCount-1
|
||||
virtual const wchar_t* getItem(u32 idx) const _IRR_OVERRIDE_;
|
||||
const wchar_t* getItem(u32 idx) const override;
|
||||
|
||||
//! Returns item data of an item. the idx may be a value from 0 to itemCount-1
|
||||
virtual u32 getItemData(u32 idx) const _IRR_OVERRIDE_;
|
||||
u32 getItemData(u32 idx) const override;
|
||||
|
||||
//! Returns index based on item data
|
||||
virtual s32 getIndexForItemData( u32 data ) const _IRR_OVERRIDE_;
|
||||
s32 getIndexForItemData( u32 data ) const override;
|
||||
|
||||
//! adds an item and returns the index of it
|
||||
virtual u32 addItem(const wchar_t* text, u32 data) _IRR_OVERRIDE_;
|
||||
u32 addItem(const wchar_t* text, u32 data) override;
|
||||
|
||||
//! Removes an item from the combo box.
|
||||
virtual void removeItem(u32 id) _IRR_OVERRIDE_;
|
||||
void removeItem(u32 id) override;
|
||||
|
||||
//! deletes all items in the combo box
|
||||
virtual void clear() _IRR_OVERRIDE_;
|
||||
void clear() override;
|
||||
|
||||
//! returns the text of the currently selected item
|
||||
virtual const wchar_t* getText() const _IRR_OVERRIDE_;
|
||||
const wchar_t* getText() const override;
|
||||
|
||||
//! returns id of selected item. returns -1 if no item is selected.
|
||||
virtual s32 getSelected() const _IRR_OVERRIDE_;
|
||||
s32 getSelected() const override;
|
||||
|
||||
//! sets the selected item. Set this to -1 if no item should be selected
|
||||
virtual void setSelected(s32 idx) _IRR_OVERRIDE_;
|
||||
void setSelected(s32 idx) override;
|
||||
|
||||
//! sets the text alignment of the text part
|
||||
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) _IRR_OVERRIDE_;
|
||||
void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) override;
|
||||
|
||||
//! Set the maximal number of rows for the selection listbox
|
||||
virtual void setMaxSelectionRows(u32 max) _IRR_OVERRIDE_;
|
||||
void setMaxSelectionRows(u32 max) override;
|
||||
|
||||
//! Get the maximal number of rows for the selection listbox
|
||||
virtual u32 getMaxSelectionRows() const _IRR_OVERRIDE_;
|
||||
u32 getMaxSelectionRows() const override;
|
||||
|
||||
//! called if an event happened.
|
||||
virtual bool OnEvent(const SEvent& event) _IRR_OVERRIDE_;
|
||||
bool OnEvent(const SEvent& event) override;
|
||||
|
||||
//! draws the element and its children
|
||||
virtual void draw() _IRR_OVERRIDE_;
|
||||
void draw() override;
|
||||
|
||||
private:
|
||||
|
||||
@ -107,7 +104,4 @@ namespace gui
|
||||
} // end namespace gui
|
||||
} // end namespace irr
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_GUI_
|
||||
|
||||
#endif // __C_GUI_COMBO_BOX_H_INCLUDED__
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user