mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-04 17:20:25 +02:00
Compare commits
40 Commits
Author | SHA1 | Date | |
---|---|---|---|
1d43ea17ca | |||
09e6eeb65b | |||
839bdc1a65 | |||
ea297196b7 | |||
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 | |||
3225007e8d | |||
e9f205f952 | |||
d733e03430 | |||
f0766c845f |
61
.github/workflows/build.yml
vendored
61
.github/workflows/build.yml
vendored
@ -8,13 +8,16 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
linux-gl:
|
linux-gl:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ubuntu:bionic
|
||||||
|
env: { LANG: "C.UTF-8" }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
apt-get update
|
||||||
sudo apt-get install g++ cmake libxi-dev libgl1-mesa-dev libpng-dev libjpeg-dev zlib1g-dev -qyy
|
apt-get install g++ cmake libxi-dev libgl1-mesa-dev libpng-dev libjpeg-dev zlib1g-dev -qyy
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
@ -26,19 +29,22 @@ jobs:
|
|||||||
make DESTDIR=$PWD/_install install
|
make DESTDIR=$PWD/_install install
|
||||||
tar -c -I "gzip -9" -f irrlicht-linux.tar.gz -C ./_install/usr/local .
|
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:
|
with:
|
||||||
name: irrlicht-linux
|
name: irrlicht-linux
|
||||||
path: ./irrlicht-linux.tar.gz
|
path: ./irrlicht-linux.tar.gz
|
||||||
|
|
||||||
linux-gles:
|
linux-gles:
|
||||||
runs-on: ubuntu-18.04
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: ubuntu:bionic
|
||||||
|
env: { LANG: "C.UTF-8" }
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
apt-get update
|
||||||
sudo apt-get install g++ cmake libxi-dev libgles2-mesa-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
|
apt-get install g++ cmake libxi-dev libgles2-mesa-dev libpng-dev libjpeg-dev zlib1g-dev xvfb -qyy
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
@ -57,10 +63,33 @@ jobs:
|
|||||||
cd bin/Linux
|
cd bin/Linux
|
||||||
LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest
|
LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest
|
||||||
|
|
||||||
|
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: |
|
||||||
|
sed '/#define _IRR_COMPILE_WITH_SDL_DEVICE_/ s|^//||g' -i include/IrrCompileConfig.h
|
||||||
|
cmake . -DBUILD_EXAMPLES=1
|
||||||
|
make -j2
|
||||||
|
|
||||||
|
- name: Test (headless)
|
||||||
|
run: |
|
||||||
|
cd bin/Linux
|
||||||
|
./AutomatedTest null
|
||||||
|
|
||||||
win32:
|
win32:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Install compiler
|
- name: Install compiler
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update && sudo apt-get install cmake -qyy
|
sudo apt-get update && sudo apt-get install cmake -qyy
|
||||||
@ -74,7 +103,7 @@ jobs:
|
|||||||
CC: i686-w64-mingw32-gcc
|
CC: i686-w64-mingw32-gcc
|
||||||
CXX: i686-w64-mingw32-g++
|
CXX: i686-w64-mingw32-g++
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: irrlicht-win32
|
name: irrlicht-win32
|
||||||
path: ./irrlicht-win32.zip
|
path: ./irrlicht-win32.zip
|
||||||
@ -82,7 +111,7 @@ jobs:
|
|||||||
win64:
|
win64:
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Install compiler
|
- name: Install compiler
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update && sudo apt-get install cmake -qyy
|
sudo apt-get update && sudo apt-get install cmake -qyy
|
||||||
@ -96,15 +125,15 @@ jobs:
|
|||||||
CC: x86_64-w64-mingw32-gcc
|
CC: x86_64-w64-mingw32-gcc
|
||||||
CXX: x86_64-w64-mingw32-g++
|
CXX: x86_64-w64-mingw32-g++
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: irrlicht-win64
|
name: irrlicht-win64
|
||||||
path: ./irrlicht-win64.zip
|
path: ./irrlicht-win64.zip
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
runs-on: macos-10.15
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: |
|
run: |
|
||||||
brew update
|
brew update
|
||||||
@ -173,7 +202,7 @@ jobs:
|
|||||||
run: move include artifact/
|
run: move include artifact/
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: msvc-${{ matrix.config.arch }}
|
name: msvc-${{ matrix.config.arch }}
|
||||||
path: artifact/
|
path: artifact/
|
||||||
|
@ -7,7 +7,7 @@ else()
|
|||||||
cmake_policy(VERSION 3.9)
|
cmake_policy(VERSION 3.9)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(IRRLICHTMT_REVISION 7)
|
set(IRRLICHTMT_REVISION 10)
|
||||||
|
|
||||||
project(Irrlicht
|
project(Irrlicht
|
||||||
VERSION 1.9.0.${IRRLICHTMT_REVISION}
|
VERSION 1.9.0.${IRRLICHTMT_REVISION}
|
||||||
|
15
README.md
15
README.md
@ -30,6 +30,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.
|
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
|
Platforms
|
||||||
---------
|
---------
|
||||||
|
|
||||||
|
@ -7,7 +7,8 @@ using namespace irr;
|
|||||||
static IrrlichtDevice *device = nullptr;
|
static IrrlichtDevice *device = nullptr;
|
||||||
static int test_fail = 0;
|
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(const char *arg_)
|
||||||
{
|
{
|
||||||
@ -32,7 +33,14 @@ static inline void check(bool ok, const char *msg)
|
|||||||
|
|
||||||
void run_unit_tests() {
|
void run_unit_tests() {
|
||||||
std::cout << "Running unit tests:" << std::endl;
|
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[])
|
int main(int argc, char *argv[])
|
||||||
@ -99,7 +107,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
while (device->run())
|
while (device->run())
|
||||||
{
|
{
|
||||||
if (device->getTimer()->getTime() >= 1300)
|
if (device->getTimer()->getTime() >= 1000)
|
||||||
{
|
{
|
||||||
device->getTimer()->setTime(0);
|
device->getTimer()->setTime(0);
|
||||||
++n;
|
++n;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "irrArray.h"
|
#include <irrArray.h>
|
||||||
#include "test_helper.h"
|
#include "test_helper.h"
|
||||||
|
|
||||||
using namespace irr;
|
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:
|
public:
|
||||||
core::array<T> Indices;
|
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
|
// push const ref due to compiler problem with gcc 4.6, big endian
|
||||||
Indices.push_back((const T&)element);
|
Indices.push_back((const T&)element);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual u32 operator [](u32 index) const _IRR_OVERRIDE_
|
u32 operator [](u32 index) const override
|
||||||
{
|
{
|
||||||
return (u32)(Indices[index]);
|
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;
|
Indices[index]=(T)value;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void set_used(u32 usedNow) _IRR_OVERRIDE_
|
void set_used(u32 usedNow) override
|
||||||
{
|
{
|
||||||
Indices.set_used(usedNow);
|
Indices.set_used(usedNow);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void reallocate(u32 new_size) _IRR_OVERRIDE_
|
void reallocate(u32 new_size) override
|
||||||
{
|
{
|
||||||
Indices.reallocate(new_size);
|
Indices.reallocate(new_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual u32 allocated_size() const _IRR_OVERRIDE_
|
u32 allocated_size() const override
|
||||||
{
|
{
|
||||||
return Indices.allocated_size();
|
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))
|
if (sizeof(T)==sizeof(u16))
|
||||||
return video::EIT_16BIT;
|
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);
|
||||||
virtual void setType(video::E_INDEX_TYPE IndexType) _IRR_OVERRIDE_
|
void setType(video::E_INDEX_TYPE IndexType) override
|
||||||
{
|
{
|
||||||
IIndexList *NewIndices=0;
|
IIndexList *NewIndices=0;
|
||||||
|
|
||||||
@ -141,78 +141,78 @@ namespace scene
|
|||||||
Indices=NewIndices;
|
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();
|
return Indices->size();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void push_back(const u32 &element) _IRR_OVERRIDE_
|
void push_back(const u32 &element) override
|
||||||
{
|
{
|
||||||
Indices->push_back(element);
|
Indices->push_back(element);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual u32 operator [](u32 index) const _IRR_OVERRIDE_
|
u32 operator [](u32 index) const override
|
||||||
{
|
{
|
||||||
return (*Indices)[index];
|
return (*Indices)[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual u32 getLast() _IRR_OVERRIDE_
|
u32 getLast() override
|
||||||
{
|
{
|
||||||
return Indices->getLast();
|
return Indices->getLast();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setValue(u32 index, u32 value) _IRR_OVERRIDE_
|
void setValue(u32 index, u32 value) override
|
||||||
{
|
{
|
||||||
Indices->setValue(index, value);
|
Indices->setValue(index, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void set_used(u32 usedNow) _IRR_OVERRIDE_
|
void set_used(u32 usedNow) override
|
||||||
{
|
{
|
||||||
Indices->set_used(usedNow);
|
Indices->set_used(usedNow);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void reallocate(u32 new_size) _IRR_OVERRIDE_
|
void reallocate(u32 new_size) override
|
||||||
{
|
{
|
||||||
Indices->reallocate(new_size);
|
Indices->reallocate(new_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual u32 allocated_size() const _IRR_OVERRIDE_
|
u32 allocated_size() const override
|
||||||
{
|
{
|
||||||
return Indices->allocated_size();
|
return Indices->allocated_size();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void* pointer() _IRR_OVERRIDE_
|
void* pointer() override
|
||||||
{
|
{
|
||||||
return Indices->pointer();
|
return Indices->pointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! get the current hardware mapping hint
|
//! get the current hardware mapping hint
|
||||||
virtual E_HARDWARE_MAPPING getHardwareMappingHint() const _IRR_OVERRIDE_
|
E_HARDWARE_MAPPING getHardwareMappingHint() const override
|
||||||
{
|
{
|
||||||
return MappingHint;
|
return MappingHint;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! set the hardware mapping hint, for driver
|
//! 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;
|
MappingHint=NewMappingHint;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! flags the mesh as changed, reloads hardware buffers
|
//! flags the mesh as changed, reloads hardware buffers
|
||||||
virtual void setDirty() _IRR_OVERRIDE_
|
void setDirty() override
|
||||||
{
|
{
|
||||||
++ChangedID;
|
++ChangedID;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get the currently used ID for identification of changes.
|
//! Get the currently used ID for identification of changes.
|
||||||
/** This shouldn't be used for anything outside the VideoDriver. */
|
/** 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;
|
E_HARDWARE_MAPPING MappingHint;
|
||||||
u32 ChangedID;
|
u32 ChangedID;
|
||||||
|
@ -32,7 +32,7 @@ namespace scene
|
|||||||
|
|
||||||
//! Get material of this meshbuffer
|
//! Get material of this meshbuffer
|
||||||
/** \return Material of this buffer */
|
/** \return Material of this buffer */
|
||||||
virtual const video::SMaterial& getMaterial() const _IRR_OVERRIDE_
|
const video::SMaterial& getMaterial() const override
|
||||||
{
|
{
|
||||||
return Material;
|
return Material;
|
||||||
}
|
}
|
||||||
@ -40,7 +40,7 @@ namespace scene
|
|||||||
|
|
||||||
//! Get material of this meshbuffer
|
//! Get material of this meshbuffer
|
||||||
/** \return Material of this buffer */
|
/** \return Material of this buffer */
|
||||||
virtual video::SMaterial& getMaterial() _IRR_OVERRIDE_
|
video::SMaterial& getMaterial() override
|
||||||
{
|
{
|
||||||
return Material;
|
return Material;
|
||||||
}
|
}
|
||||||
@ -48,7 +48,7 @@ namespace scene
|
|||||||
|
|
||||||
//! Get pointer to vertices
|
//! Get pointer to vertices
|
||||||
/** \return Pointer to vertices. */
|
/** \return Pointer to vertices. */
|
||||||
virtual const void* getVertices() const _IRR_OVERRIDE_
|
const void* getVertices() const override
|
||||||
{
|
{
|
||||||
return Vertices.const_pointer();
|
return Vertices.const_pointer();
|
||||||
}
|
}
|
||||||
@ -56,7 +56,7 @@ namespace scene
|
|||||||
|
|
||||||
//! Get pointer to vertices
|
//! Get pointer to vertices
|
||||||
/** \return Pointer to vertices. */
|
/** \return Pointer to vertices. */
|
||||||
virtual void* getVertices() _IRR_OVERRIDE_
|
void* getVertices() override
|
||||||
{
|
{
|
||||||
return Vertices.pointer();
|
return Vertices.pointer();
|
||||||
}
|
}
|
||||||
@ -64,21 +64,21 @@ namespace scene
|
|||||||
|
|
||||||
//! Get number of vertices
|
//! Get number of vertices
|
||||||
/** \return Number of vertices. */
|
/** \return Number of vertices. */
|
||||||
virtual u32 getVertexCount() const _IRR_OVERRIDE_
|
u32 getVertexCount() const override
|
||||||
{
|
{
|
||||||
return Vertices.size();
|
return Vertices.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get type of index data which is stored in this meshbuffer.
|
//! Get type of index data which is stored in this meshbuffer.
|
||||||
/** \return Index type of this buffer. */
|
/** \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;
|
return video::EIT_16BIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get pointer to indices
|
//! Get pointer to indices
|
||||||
/** \return Pointer to indices. */
|
/** \return Pointer to indices. */
|
||||||
virtual const u16* getIndices() const _IRR_OVERRIDE_
|
const u16* getIndices() const override
|
||||||
{
|
{
|
||||||
return Indices.const_pointer();
|
return Indices.const_pointer();
|
||||||
}
|
}
|
||||||
@ -86,7 +86,7 @@ namespace scene
|
|||||||
|
|
||||||
//! Get pointer to indices
|
//! Get pointer to indices
|
||||||
/** \return Pointer to indices. */
|
/** \return Pointer to indices. */
|
||||||
virtual u16* getIndices() _IRR_OVERRIDE_
|
u16* getIndices() override
|
||||||
{
|
{
|
||||||
return Indices.pointer();
|
return Indices.pointer();
|
||||||
}
|
}
|
||||||
@ -94,7 +94,7 @@ namespace scene
|
|||||||
|
|
||||||
//! Get number of indices
|
//! Get number of indices
|
||||||
/** \return Number of indices. */
|
/** \return Number of indices. */
|
||||||
virtual u32 getIndexCount() const _IRR_OVERRIDE_
|
u32 getIndexCount() const override
|
||||||
{
|
{
|
||||||
return Indices.size();
|
return Indices.size();
|
||||||
}
|
}
|
||||||
@ -102,7 +102,7 @@ namespace scene
|
|||||||
|
|
||||||
//! Get the axis aligned bounding box
|
//! Get the axis aligned bounding box
|
||||||
/** \return Axis aligned bounding box of this buffer. */
|
/** \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;
|
return BoundingBox;
|
||||||
}
|
}
|
||||||
@ -111,7 +111,7 @@ namespace scene
|
|||||||
//! Set the axis aligned bounding box
|
//! Set the axis aligned bounding box
|
||||||
/** \param box New axis aligned bounding box for this buffer. */
|
/** \param box New axis aligned bounding box for this buffer. */
|
||||||
//! set user axis aligned bounding box
|
//! set user axis aligned bounding box
|
||||||
virtual void setBoundingBox(const core::aabbox3df& box) _IRR_OVERRIDE_
|
void setBoundingBox(const core::aabbox3df& box) override
|
||||||
{
|
{
|
||||||
BoundingBox = box;
|
BoundingBox = box;
|
||||||
}
|
}
|
||||||
@ -119,7 +119,7 @@ namespace scene
|
|||||||
|
|
||||||
//! Recalculate the bounding box.
|
//! Recalculate the bounding box.
|
||||||
/** should be called if the mesh changed. */
|
/** should be called if the mesh changed. */
|
||||||
virtual void recalculateBoundingBox() _IRR_OVERRIDE_
|
void recalculateBoundingBox() override
|
||||||
{
|
{
|
||||||
if (!Vertices.empty())
|
if (!Vertices.empty())
|
||||||
{
|
{
|
||||||
@ -136,43 +136,43 @@ namespace scene
|
|||||||
|
|
||||||
//! Get type of vertex data stored in this buffer.
|
//! Get type of vertex data stored in this buffer.
|
||||||
/** \return Type of vertex data. */
|
/** \return Type of vertex data. */
|
||||||
virtual video::E_VERTEX_TYPE getVertexType() const _IRR_OVERRIDE_
|
video::E_VERTEX_TYPE getVertexType() const override
|
||||||
{
|
{
|
||||||
return T::getType();
|
return T::getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! returns position of vertex i
|
//! 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;
|
return Vertices[i].Pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! returns position of vertex i
|
//! returns position of vertex i
|
||||||
virtual core::vector3df& getPosition(u32 i) _IRR_OVERRIDE_
|
core::vector3df& getPosition(u32 i) override
|
||||||
{
|
{
|
||||||
return Vertices[i].Pos;
|
return Vertices[i].Pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! returns normal of vertex i
|
//! 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;
|
return Vertices[i].Normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! returns normal of vertex i
|
//! returns normal of vertex i
|
||||||
virtual core::vector3df& getNormal(u32 i) _IRR_OVERRIDE_
|
core::vector3df& getNormal(u32 i) override
|
||||||
{
|
{
|
||||||
return Vertices[i].Normal;
|
return Vertices[i].Normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! returns texture coord of vertex i
|
//! 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;
|
return Vertices[i].TCoords;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! returns texture coord of vertex i
|
//! returns texture coord of vertex i
|
||||||
virtual core::vector2df& getTCoords(u32 i) _IRR_OVERRIDE_
|
core::vector2df& getTCoords(u32 i) override
|
||||||
{
|
{
|
||||||
return Vertices[i].TCoords;
|
return Vertices[i].TCoords;
|
||||||
}
|
}
|
||||||
@ -183,7 +183,7 @@ namespace scene
|
|||||||
or the main buffer is of standard type. Otherwise, behavior is
|
or the main buffer is of standard type. Otherwise, behavior is
|
||||||
undefined.
|
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())
|
if (vertices == getVertices())
|
||||||
return;
|
return;
|
||||||
@ -212,7 +212,7 @@ namespace scene
|
|||||||
undefined.
|
undefined.
|
||||||
\param other Meshbuffer to be appended to this one.
|
\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)
|
if (this==other)
|
||||||
@ -238,19 +238,19 @@ namespace scene
|
|||||||
|
|
||||||
|
|
||||||
//! get the current hardware mapping hint
|
//! 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;
|
return MappingHint_Vertex;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! get the current hardware mapping hint
|
//! 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;
|
return MappingHint_Index;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! set the hardware mapping hint, for driver
|
//! 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)
|
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX)
|
||||||
MappingHint_Vertex=NewMappingHint;
|
MappingHint_Vertex=NewMappingHint;
|
||||||
@ -259,19 +259,19 @@ namespace scene
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Describe what kind of primitive geometry is used by the meshbuffer
|
//! 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;
|
PrimitiveType = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get the kind of primitive geometry which is used by the meshbuffer
|
//! 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;
|
return PrimitiveType;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! flags the mesh as changed, reloads hardware buffers
|
//! 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)
|
if (Buffer==EBT_VERTEX_AND_INDEX ||Buffer==EBT_VERTEX)
|
||||||
++ChangedID_Vertex;
|
++ChangedID_Vertex;
|
||||||
@ -281,17 +281,17 @@ namespace scene
|
|||||||
|
|
||||||
//! Get the currently used ID for identification of changes.
|
//! Get the currently used ID for identification of changes.
|
||||||
/** This shouldn't be used for anything outside the VideoDriver. */
|
/** 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.
|
//! Get the currently used ID for identification of changes.
|
||||||
/** This shouldn't be used for anything outside the VideoDriver. */
|
/** 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;
|
HWBuffer = ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void *getHWBuffer() const _IRR_OVERRIDE_ {
|
void *getHWBuffer() const override {
|
||||||
return HWBuffer;
|
return HWBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,33 +40,33 @@ namespace scene
|
|||||||
public:
|
public:
|
||||||
core::array<T> Vertices;
|
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);}
|
{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];}
|
{return (video::S3DVertex&)Vertices[index];}
|
||||||
|
|
||||||
virtual video::S3DVertex& getLast() _IRR_OVERRIDE_
|
video::S3DVertex& getLast() override
|
||||||
{return (video::S3DVertex&)Vertices.getLast();}
|
{return (video::S3DVertex&)Vertices.getLast();}
|
||||||
|
|
||||||
virtual void set_used(u32 usedNow) _IRR_OVERRIDE_
|
void set_used(u32 usedNow) override
|
||||||
{Vertices.set_used(usedNow);}
|
{Vertices.set_used(usedNow);}
|
||||||
|
|
||||||
virtual void reallocate(u32 new_size) _IRR_OVERRIDE_
|
void reallocate(u32 new_size) override
|
||||||
{Vertices.reallocate(new_size);}
|
{Vertices.reallocate(new_size);}
|
||||||
|
|
||||||
virtual u32 allocated_size() const _IRR_OVERRIDE_
|
u32 allocated_size() const override
|
||||||
{
|
{
|
||||||
return Vertices.allocated_size();
|
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:
|
public:
|
||||||
@ -95,7 +95,7 @@ namespace scene
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
virtual void setType(video::E_VERTEX_TYPE vertexType) _IRR_OVERRIDE_
|
void setType(video::E_VERTEX_TYPE vertexType) override
|
||||||
{
|
{
|
||||||
IVertexList *NewVertices=0;
|
IVertexList *NewVertices=0;
|
||||||
|
|
||||||
@ -130,73 +130,73 @@ namespace scene
|
|||||||
Vertices=NewVertices;
|
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();
|
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);
|
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];
|
return (*Vertices)[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual video::S3DVertex& getLast() _IRR_OVERRIDE_
|
video::S3DVertex& getLast() override
|
||||||
{
|
{
|
||||||
return Vertices->getLast();
|
return Vertices->getLast();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void set_used(u32 usedNow) _IRR_OVERRIDE_
|
void set_used(u32 usedNow) override
|
||||||
{
|
{
|
||||||
Vertices->set_used(usedNow);
|
Vertices->set_used(usedNow);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void reallocate(u32 new_size) _IRR_OVERRIDE_
|
void reallocate(u32 new_size) override
|
||||||
{
|
{
|
||||||
Vertices->reallocate(new_size);
|
Vertices->reallocate(new_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual u32 allocated_size() const _IRR_OVERRIDE_
|
u32 allocated_size() const override
|
||||||
{
|
{
|
||||||
return Vertices->allocated_size();
|
return Vertices->allocated_size();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual video::S3DVertex* pointer() _IRR_OVERRIDE_
|
video::S3DVertex* pointer() override
|
||||||
{
|
{
|
||||||
return Vertices->pointer();
|
return Vertices->pointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! get the current hardware mapping hint
|
//! get the current hardware mapping hint
|
||||||
virtual E_HARDWARE_MAPPING getHardwareMappingHint() const _IRR_OVERRIDE_
|
E_HARDWARE_MAPPING getHardwareMappingHint() const override
|
||||||
{
|
{
|
||||||
return MappingHint;
|
return MappingHint;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! set the hardware mapping hint, for driver
|
//! 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;
|
MappingHint=NewMappingHint;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! flags the mesh as changed, reloads hardware buffers
|
//! flags the mesh as changed, reloads hardware buffers
|
||||||
virtual void setDirty() _IRR_OVERRIDE_
|
void setDirty() override
|
||||||
{
|
{
|
||||||
++ChangedID;
|
++ChangedID;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get the currently used ID for identification of changes.
|
//! Get the currently used ID for identification of changes.
|
||||||
/** This shouldn't be used for anything outside the VideoDriver. */
|
/** 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;
|
E_HARDWARE_MAPPING MappingHint;
|
||||||
u32 ChangedID;
|
u32 ChangedID;
|
||||||
|
@ -91,9 +91,6 @@ enum EGUI_ELEMENT_TYPE
|
|||||||
//! The root of the GUI
|
//! The root of the GUI
|
||||||
EGUIET_ROOT,
|
EGUIET_ROOT,
|
||||||
|
|
||||||
//! IGUIProfiler
|
|
||||||
EGUIET_PROFILER,
|
|
||||||
|
|
||||||
//! Not an element, amount of elements in there
|
//! Not an element, amount of elements in there
|
||||||
EGUIET_COUNT,
|
EGUIET_COUNT,
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ namespace scene
|
|||||||
if getMeshType() returns EAMT_MD2 it's safe to cast the
|
if getMeshType() returns EAMT_MD2 it's safe to cast the
|
||||||
IAnimatedMesh to IAnimatedMeshMD2.
|
IAnimatedMesh to IAnimatedMeshMD2.
|
||||||
\returns Type of the mesh. */
|
\returns Type of the mesh. */
|
||||||
virtual E_ANIMATED_MESH_TYPE getMeshType() const _IRR_OVERRIDE_
|
E_ANIMATED_MESH_TYPE getMeshType() const override
|
||||||
{
|
{
|
||||||
return EAMT_UNKNOWN;
|
return EAMT_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
@ -74,17 +74,17 @@ namespace scene
|
|||||||
virtual E_BONE_ANIMATION_MODE getAnimationMode() const = 0;
|
virtual E_BONE_ANIMATION_MODE getAnimationMode() const = 0;
|
||||||
|
|
||||||
//! Get the axis aligned bounding box of this node
|
//! 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.
|
//! Returns the relative transformation of the scene node.
|
||||||
//virtual core::matrix4 getRelativeTransformation() const = 0;
|
//virtual core::matrix4 getRelativeTransformation() const = 0;
|
||||||
|
|
||||||
//! The animation method.
|
//! The animation method.
|
||||||
virtual void OnAnimate(u32 timeMs) _IRR_OVERRIDE_ =0;
|
void OnAnimate(u32 timeMs) override =0;
|
||||||
|
|
||||||
//! The render method.
|
//! The render method.
|
||||||
/** Does nothing as bones are not visible. */
|
/** Does nothing as bones are not visible. */
|
||||||
virtual void render() _IRR_OVERRIDE_ { }
|
void render() override { }
|
||||||
|
|
||||||
//! How the relative transformation of the bone is used
|
//! How the relative transformation of the bone is used
|
||||||
virtual void setSkinningSpace( E_BONE_SKINNING_SPACE space ) =0;
|
virtual void setSkinningSpace( E_BONE_SKINNING_SPACE space ) =0;
|
||||||
|
@ -72,7 +72,7 @@ namespace scene
|
|||||||
ISceneManager::addCameraSceneNodeFPS, may want to get
|
ISceneManager::addCameraSceneNodeFPS, may want to get
|
||||||
this input for changing their position, look at target or
|
this input for changing their position, look at target or
|
||||||
whatever. */
|
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
|
//! Sets the look at target of the camera
|
||||||
/** If the camera's target and rotation are bound ( @see
|
/** If the camera's target and rotation are bound ( @see
|
||||||
@ -90,7 +90,7 @@ namespace scene
|
|||||||
bindTargetAndRotation() ) then calling this will also change
|
bindTargetAndRotation() ) then calling this will also change
|
||||||
the camera's target to match the rotation.
|
the camera's target to match the rotation.
|
||||||
\param rotation New rotation of the node in degrees. */
|
\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
|
//! Gets the current look at target of the camera
|
||||||
/** \return The current look at target of the camera, in world co-ordinates */
|
/** \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.*/
|
\param rect: A pointer to an reference rectangle or 0 to disable the reference rectangle.*/
|
||||||
virtual void setReferenceRect(core::rect<s32>* rect=0) = 0;
|
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
|
//! Sets the active cursor icon
|
||||||
/** Setting cursor icons is so far only supported on Win32 and Linux */
|
/** Setting cursor icons is so far only supported on Win32 and Linux */
|
||||||
|
@ -545,7 +545,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//! Called if an event happened.
|
//! 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;
|
return Parent ? Parent->OnEvent(event) : false;
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ class IGUIFontBitmap : public IGUIFont
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
//! Returns the type of this font
|
//! 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
|
//! returns the parsed Symbol Information
|
||||||
virtual IGUISpriteBank* getSpriteBank() const = 0;
|
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
|
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.
|
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
|
} // end namespace gui
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#include "position2d.h"
|
#include "position2d.h"
|
||||||
#include "rect.h"
|
#include "rect.h"
|
||||||
#include "SColor.h"
|
#include "SColor.h"
|
||||||
#include "irrAllocator.h"
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
@ -44,7 +43,7 @@ public:
|
|||||||
delete[] Data;
|
delete[] Data;
|
||||||
|
|
||||||
if (DeleteMipMapsMemory)
|
if (DeleteMipMapsMemory)
|
||||||
Allocator.deallocate(MipMapsData);
|
delete[] MipMapsData;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the color format
|
//! Returns the color format
|
||||||
@ -275,13 +274,13 @@ public:
|
|||||||
will by copied internally.
|
will by copied internally.
|
||||||
\param deleteMemory Whether the memory is deallocated upon
|
\param deleteMemory Whether the memory is deallocated upon
|
||||||
destruction. */
|
destruction. */
|
||||||
void setMipMapsData(void* data, bool ownForeignMemory, bool deleteMemory)
|
void setMipMapsData(void* data, bool ownForeignMemory)
|
||||||
{
|
{
|
||||||
if (data != MipMapsData)
|
if (data != MipMapsData)
|
||||||
{
|
{
|
||||||
if (DeleteMipMapsMemory)
|
if (DeleteMipMapsMemory)
|
||||||
{
|
{
|
||||||
Allocator.deallocate(MipMapsData);
|
delete[] MipMapsData;
|
||||||
|
|
||||||
DeleteMipMapsMemory = false;
|
DeleteMipMapsMemory = false;
|
||||||
}
|
}
|
||||||
@ -292,7 +291,7 @@ public:
|
|||||||
{
|
{
|
||||||
MipMapsData = static_cast<u8*>(data);
|
MipMapsData = static_cast<u8*>(data);
|
||||||
|
|
||||||
DeleteMipMapsMemory = deleteMemory;
|
DeleteMipMapsMemory = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -311,7 +310,7 @@ public:
|
|||||||
dataSize += getDataSizeFromFormat(Format, width, height);
|
dataSize += getDataSizeFromFormat(Format, width, height);
|
||||||
} while (width != 1 || height != 1);
|
} while (width != 1 || height != 1);
|
||||||
|
|
||||||
MipMapsData = Allocator.allocate(dataSize);
|
MipMapsData = new u8[dataSize];
|
||||||
memcpy(MipMapsData, data, dataSize);
|
memcpy(MipMapsData, data, dataSize);
|
||||||
|
|
||||||
DeleteMipMapsMemory = true;
|
DeleteMipMapsMemory = true;
|
||||||
@ -578,7 +577,6 @@ protected:
|
|||||||
bool DeleteMemory;
|
bool DeleteMemory;
|
||||||
bool DeleteMipMapsMemory;
|
bool DeleteMipMapsMemory;
|
||||||
|
|
||||||
core::irrAllocator<u8> Allocator;
|
|
||||||
#if defined(IRRLICHT_sRGB)
|
#if defined(IRRLICHT_sRGB)
|
||||||
int Format_sRGB;
|
int Format_sRGB;
|
||||||
#endif
|
#endif
|
||||||
|
@ -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"
|
#include "irrTypes.h"
|
||||||
|
|
||||||
#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_
|
|
||||||
#include "leakHunter.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -50,17 +46,11 @@ namespace irr
|
|||||||
IReferenceCounted()
|
IReferenceCounted()
|
||||||
: DebugName(0), ReferenceCounter(1)
|
: DebugName(0), ReferenceCounter(1)
|
||||||
{
|
{
|
||||||
#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_
|
|
||||||
LeakHunter::addObject(this);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Destructor.
|
//! Destructor.
|
||||||
virtual ~IReferenceCounted()
|
virtual ~IReferenceCounted()
|
||||||
{
|
{
|
||||||
#ifdef _IRR_COMPILE_WITH_LEAK_HUNTER_
|
|
||||||
LeakHunter::removeObject(this);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Grabs the object. Increments the reference counter by one.
|
//! Grabs the object. Increments the reference counter by one.
|
||||||
|
@ -331,7 +331,7 @@ namespace video
|
|||||||
_IRR_DEPRECATED_ ITexture* addTexture(const io::path& name, IImage* image, void* mipmapData)
|
_IRR_DEPRECATED_ ITexture* addTexture(const io::path& name, IImage* image, void* mipmapData)
|
||||||
{
|
{
|
||||||
if (image)
|
if (image)
|
||||||
image->setMipMapsData(mipmapData, false, true);
|
image->setMipMapsData(mipmapData, false);
|
||||||
|
|
||||||
return addTexture(name, image);
|
return addTexture(name, image);
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
#define __IRR_COMPILE_CONFIG_H_INCLUDED__
|
#define __IRR_COMPILE_CONFIG_H_INCLUDED__
|
||||||
|
|
||||||
//! Identifies the IrrlichtMt fork customized for the Minetest engine
|
//! Identifies the IrrlichtMt fork customized for the Minetest engine
|
||||||
#define IRRLICHT_VERSION_MT_REVISION 7
|
#define IRRLICHT_VERSION_MT_REVISION 10
|
||||||
#define IRRLICHT_VERSION_MT "mt7"
|
#define IRRLICHT_VERSION_MT "mt10"
|
||||||
|
|
||||||
//! Irrlicht SDK Version
|
//! Irrlicht SDK Version
|
||||||
#define IRRLICHT_VERSION_MAJOR 1
|
#define IRRLICHT_VERSION_MAJOR 1
|
||||||
|
@ -156,6 +156,12 @@ namespace irr
|
|||||||
/** \return True if window is minimized. */
|
/** \return True if window is minimized. */
|
||||||
virtual bool isWindowMinimized() const = 0;
|
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
|
//! Checks if the Irrlicht window is running in fullscreen mode
|
||||||
/** \return True if window is fullscreen. */
|
/** \return True if window is fullscreen. */
|
||||||
virtual bool isFullscreen() const = 0;
|
virtual bool isFullscreen() const = 0;
|
||||||
|
@ -38,14 +38,14 @@ namespace scene
|
|||||||
|
|
||||||
//! Gets the frame count of the animated mesh.
|
//! Gets the frame count of the animated mesh.
|
||||||
/** \return Amount of frames. If the amount is 1, it is a static, non 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();
|
return Meshes.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Gets the default animation speed of the animated mesh.
|
//! 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. */
|
/** \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;
|
return FramesPerSecond;
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ namespace scene
|
|||||||
//! Gets the frame count of the animated mesh.
|
//! 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.
|
/** \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.*/
|
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;
|
FramesPerSecond=fps;
|
||||||
}
|
}
|
||||||
@ -66,7 +66,7 @@ namespace scene
|
|||||||
\param startFrameLoop: start frame
|
\param startFrameLoop: start frame
|
||||||
\param endFrameLoop: end frame
|
\param endFrameLoop: end frame
|
||||||
\return The animated mesh based on a detail level. */
|
\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())
|
if (Meshes.empty())
|
||||||
return 0;
|
return 0;
|
||||||
@ -86,13 +86,13 @@ namespace scene
|
|||||||
|
|
||||||
//! Returns an axis aligned bounding box of the mesh.
|
//! Returns an axis aligned bounding box of the mesh.
|
||||||
/** \return A bounding box of this mesh is returned. */
|
/** \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;
|
return Box;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! set user axis aligned bounding 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;
|
Box = box;
|
||||||
}
|
}
|
||||||
@ -112,13 +112,13 @@ namespace scene
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the type of the animated mesh.
|
//! 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;
|
return Type;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! returns amount of mesh buffers.
|
//! returns amount of mesh buffers.
|
||||||
virtual u32 getMeshBufferCount() const _IRR_OVERRIDE_
|
u32 getMeshBufferCount() const override
|
||||||
{
|
{
|
||||||
if (Meshes.empty())
|
if (Meshes.empty())
|
||||||
return 0;
|
return 0;
|
||||||
@ -127,7 +127,7 @@ namespace scene
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! returns pointer to a mesh buffer
|
//! returns pointer to a mesh buffer
|
||||||
virtual IMeshBuffer* getMeshBuffer(u32 nr) const _IRR_OVERRIDE_
|
IMeshBuffer* getMeshBuffer(u32 nr) const override
|
||||||
{
|
{
|
||||||
if (Meshes.empty())
|
if (Meshes.empty())
|
||||||
return 0;
|
return 0;
|
||||||
@ -139,7 +139,7 @@ namespace scene
|
|||||||
/** \param material: material to search for
|
/** \param material: material to search for
|
||||||
\return Returns the pointer to the mesh buffer or
|
\return Returns the pointer to the mesh buffer or
|
||||||
NULL if there is no such mesh buffer. */
|
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())
|
if (Meshes.empty())
|
||||||
return 0;
|
return 0;
|
||||||
@ -148,21 +148,21 @@ namespace scene
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Set a material flag for all meshbuffers of this mesh.
|
//! 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)
|
for (u32 i=0; i<Meshes.size(); ++i)
|
||||||
Meshes[i]->setMaterialFlag(flag, newvalue);
|
Meshes[i]->setMaterialFlag(flag, newvalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! set the hardware mapping hint, for driver
|
//! 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)
|
for (u32 i=0; i<Meshes.size(); ++i)
|
||||||
Meshes[i]->setHardwareMappingHint(newMappingHint, buffer);
|
Meshes[i]->setHardwareMappingHint(newMappingHint, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! flags the meshbuffer as changed, reloads hardware buffers
|
//! 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)
|
for (u32 i=0; i<Meshes.size(); ++i)
|
||||||
Meshes[i]->setDirty(buffer);
|
Meshes[i]->setDirty(buffer);
|
||||||
|
@ -30,6 +30,7 @@ namespace irr
|
|||||||
Bits(32),
|
Bits(32),
|
||||||
ZBufferBits(24),
|
ZBufferBits(24),
|
||||||
Fullscreen(false),
|
Fullscreen(false),
|
||||||
|
WindowMaximized(false),
|
||||||
WindowResizable(2),
|
WindowResizable(2),
|
||||||
Stencilbuffer(true),
|
Stencilbuffer(true),
|
||||||
Vsync(false),
|
Vsync(false),
|
||||||
@ -73,6 +74,7 @@ namespace irr
|
|||||||
Bits = other.Bits;
|
Bits = other.Bits;
|
||||||
ZBufferBits = other.ZBufferBits;
|
ZBufferBits = other.ZBufferBits;
|
||||||
Fullscreen = other.Fullscreen;
|
Fullscreen = other.Fullscreen;
|
||||||
|
WindowMaximized = other.WindowMaximized;
|
||||||
WindowResizable = other.WindowResizable;
|
WindowResizable = other.WindowResizable;
|
||||||
Stencilbuffer = other.Stencilbuffer;
|
Stencilbuffer = other.Stencilbuffer;
|
||||||
Vsync = other.Vsync;
|
Vsync = other.Vsync;
|
||||||
@ -127,6 +129,9 @@ namespace irr
|
|||||||
/** Otherwise the device runs in windowed mode. Default: false. */
|
/** Otherwise the device runs in windowed mode. Default: false. */
|
||||||
bool Fullscreen;
|
bool Fullscreen;
|
||||||
|
|
||||||
|
//! Maximised window. (Only supported on SDL.) Default: false
|
||||||
|
bool WindowMaximized;
|
||||||
|
|
||||||
//! Should a non-fullscreen window be resizable.
|
//! Should a non-fullscreen window be resizable.
|
||||||
/** Might not be supported by all devices. Ignored when Fullscreen is true.
|
/** Might not be supported by all devices. Ignored when Fullscreen is true.
|
||||||
Values: 0 = not resizable, 1 = resizable, 2 = system decides default itself
|
Values: 0 = not resizable, 1 = resizable, 2 = system decides default itself
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#define __S_MATERIAL_LAYER_H_INCLUDED__
|
#define __S_MATERIAL_LAYER_H_INCLUDED__
|
||||||
|
|
||||||
#include "matrix4.h"
|
#include "matrix4.h"
|
||||||
#include "irrAllocator.h"
|
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
@ -69,8 +68,7 @@ namespace video
|
|||||||
{
|
{
|
||||||
if ( TextureMatrix )
|
if ( TextureMatrix )
|
||||||
{
|
{
|
||||||
MatrixAllocator.destruct(TextureMatrix);
|
delete TextureMatrix;
|
||||||
MatrixAllocator.deallocate(TextureMatrix);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,8 +88,7 @@ namespace video
|
|||||||
*TextureMatrix = *other.TextureMatrix;
|
*TextureMatrix = *other.TextureMatrix;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MatrixAllocator.destruct(TextureMatrix);
|
delete TextureMatrix;
|
||||||
MatrixAllocator.deallocate(TextureMatrix);
|
|
||||||
TextureMatrix = 0;
|
TextureMatrix = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,8 +96,7 @@ namespace video
|
|||||||
{
|
{
|
||||||
if (other.TextureMatrix)
|
if (other.TextureMatrix)
|
||||||
{
|
{
|
||||||
TextureMatrix = MatrixAllocator.allocate(1);
|
TextureMatrix = new core::matrix4(*other.TextureMatrix);
|
||||||
MatrixAllocator.construct(TextureMatrix,*other.TextureMatrix);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
TextureMatrix = 0;
|
TextureMatrix = 0;
|
||||||
@ -122,8 +118,7 @@ namespace video
|
|||||||
{
|
{
|
||||||
if (!TextureMatrix)
|
if (!TextureMatrix)
|
||||||
{
|
{
|
||||||
TextureMatrix = MatrixAllocator.allocate(1);
|
TextureMatrix = new core::matrix4();
|
||||||
MatrixAllocator.construct(TextureMatrix,core::IdentityMatrix);
|
|
||||||
}
|
}
|
||||||
return *TextureMatrix;
|
return *TextureMatrix;
|
||||||
}
|
}
|
||||||
@ -146,8 +141,7 @@ namespace video
|
|||||||
{
|
{
|
||||||
if (!TextureMatrix)
|
if (!TextureMatrix)
|
||||||
{
|
{
|
||||||
TextureMatrix = MatrixAllocator.allocate(1);
|
TextureMatrix = new core::matrix4(mat);
|
||||||
MatrixAllocator.construct(TextureMatrix,mat);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*TextureMatrix = mat;
|
*TextureMatrix = mat;
|
||||||
@ -216,7 +210,6 @@ namespace video
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
friend class SMaterial;
|
friend class SMaterial;
|
||||||
irr::core::irrAllocator<irr::core::matrix4> MatrixAllocator;
|
|
||||||
|
|
||||||
//! Texture Matrix
|
//! Texture Matrix
|
||||||
/** Do not access this element directly as the internal
|
/** Do not access this element directly as the internal
|
||||||
|
@ -44,20 +44,20 @@ namespace scene
|
|||||||
|
|
||||||
|
|
||||||
//! returns amount of mesh buffers.
|
//! returns amount of mesh buffers.
|
||||||
virtual u32 getMeshBufferCount() const _IRR_OVERRIDE_
|
u32 getMeshBufferCount() const override
|
||||||
{
|
{
|
||||||
return MeshBuffers.size();
|
return MeshBuffers.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! returns pointer to a mesh buffer
|
//! returns pointer to a mesh buffer
|
||||||
virtual IMeshBuffer* getMeshBuffer(u32 nr) const _IRR_OVERRIDE_
|
IMeshBuffer* getMeshBuffer(u32 nr) const override
|
||||||
{
|
{
|
||||||
return MeshBuffers[nr];
|
return MeshBuffers[nr];
|
||||||
}
|
}
|
||||||
|
|
||||||
//! returns a meshbuffer which fits a material
|
//! returns a meshbuffer which fits a material
|
||||||
/** reverse search */
|
/** 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)
|
for (s32 i = (s32)MeshBuffers.size()-1; i >= 0; --i)
|
||||||
{
|
{
|
||||||
@ -69,13 +69,13 @@ namespace scene
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! returns an axis aligned bounding box
|
//! returns an axis aligned bounding box
|
||||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_
|
const core::aabbox3d<f32>& getBoundingBox() const override
|
||||||
{
|
{
|
||||||
return BoundingBox;
|
return BoundingBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! set user axis aligned bounding box
|
//! set user axis aligned bounding box
|
||||||
virtual void setBoundingBox( const core::aabbox3df& box) _IRR_OVERRIDE_
|
void setBoundingBox( const core::aabbox3df& box) override
|
||||||
{
|
{
|
||||||
BoundingBox = box;
|
BoundingBox = box;
|
||||||
}
|
}
|
||||||
@ -118,21 +118,21 @@ namespace scene
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! sets a flag of all contained materials to a new value
|
//! 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)
|
for (u32 i=0; i<MeshBuffers.size(); ++i)
|
||||||
MeshBuffers[i]->getMaterial().setFlag(flag, newvalue);
|
MeshBuffers[i]->getMaterial().setFlag(flag, newvalue);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! set the hardware mapping hint, for driver
|
//! 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)
|
for (u32 i=0; i<MeshBuffers.size(); ++i)
|
||||||
MeshBuffers[i]->setHardwareMappingHint(newMappingHint, buffer);
|
MeshBuffers[i]->setHardwareMappingHint(newMappingHint, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! flags the meshbuffer as changed, reloads hardware buffers
|
//! 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)
|
for (u32 i=0; i<MeshBuffers.size(); ++i)
|
||||||
MeshBuffers[i]->setDirty(buffer);
|
MeshBuffers[i]->setDirty(buffer);
|
||||||
|
@ -32,13 +32,13 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Get Material of this buffer.
|
//! Get Material of this buffer.
|
||||||
virtual const video::SMaterial& getMaterial() const _IRR_OVERRIDE_
|
const video::SMaterial& getMaterial() const override
|
||||||
{
|
{
|
||||||
return Material;
|
return Material;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get Material of this buffer.
|
//! Get Material of this buffer.
|
||||||
virtual video::SMaterial& getMaterial() _IRR_OVERRIDE_
|
video::SMaterial& getMaterial() override
|
||||||
{
|
{
|
||||||
return Material;
|
return Material;
|
||||||
}
|
}
|
||||||
@ -58,7 +58,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Get pointer to vertex array
|
//! Get pointer to vertex array
|
||||||
virtual const void* getVertices() const _IRR_OVERRIDE_
|
const void* getVertices() const override
|
||||||
{
|
{
|
||||||
switch (VertexType)
|
switch (VertexType)
|
||||||
{
|
{
|
||||||
@ -72,7 +72,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Get pointer to vertex array
|
//! Get pointer to vertex array
|
||||||
virtual void* getVertices() _IRR_OVERRIDE_
|
void* getVertices() override
|
||||||
{
|
{
|
||||||
switch (VertexType)
|
switch (VertexType)
|
||||||
{
|
{
|
||||||
@ -86,7 +86,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Get vertex count
|
//! Get vertex count
|
||||||
virtual u32 getVertexCount() const _IRR_OVERRIDE_
|
u32 getVertexCount() const override
|
||||||
{
|
{
|
||||||
switch (VertexType)
|
switch (VertexType)
|
||||||
{
|
{
|
||||||
@ -101,43 +101,43 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||||||
|
|
||||||
//! Get type of index data which is stored in this meshbuffer.
|
//! Get type of index data which is stored in this meshbuffer.
|
||||||
/** \return Index type of this buffer. */
|
/** \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;
|
return video::EIT_16BIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get pointer to index array
|
//! Get pointer to index array
|
||||||
virtual const u16* getIndices() const _IRR_OVERRIDE_
|
const u16* getIndices() const override
|
||||||
{
|
{
|
||||||
return Indices.const_pointer();
|
return Indices.const_pointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get pointer to index array
|
//! Get pointer to index array
|
||||||
virtual u16* getIndices() _IRR_OVERRIDE_
|
u16* getIndices() override
|
||||||
{
|
{
|
||||||
return Indices.pointer();
|
return Indices.pointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get index count
|
//! Get index count
|
||||||
virtual u32 getIndexCount() const _IRR_OVERRIDE_
|
u32 getIndexCount() const override
|
||||||
{
|
{
|
||||||
return Indices.size();
|
return Indices.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get bounding box
|
//! Get bounding box
|
||||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_
|
const core::aabbox3d<f32>& getBoundingBox() const override
|
||||||
{
|
{
|
||||||
return BoundingBox;
|
return BoundingBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Set bounding box
|
//! Set bounding box
|
||||||
virtual void setBoundingBox( const core::aabbox3df& box) _IRR_OVERRIDE_
|
void setBoundingBox( const core::aabbox3df& box) override
|
||||||
{
|
{
|
||||||
BoundingBox = box;
|
BoundingBox = box;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Recalculate bounding box
|
//! Recalculate bounding box
|
||||||
virtual void recalculateBoundingBox() _IRR_OVERRIDE_
|
void recalculateBoundingBox() override
|
||||||
{
|
{
|
||||||
if(!BoundingBoxNeedsRecalculated)
|
if(!BoundingBoxNeedsRecalculated)
|
||||||
return;
|
return;
|
||||||
@ -186,7 +186,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Get vertex type
|
//! Get vertex type
|
||||||
virtual video::E_VERTEX_TYPE getVertexType() const _IRR_OVERRIDE_
|
video::E_VERTEX_TYPE getVertexType() const override
|
||||||
{
|
{
|
||||||
return VertexType;
|
return VertexType;
|
||||||
}
|
}
|
||||||
@ -244,7 +244,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! returns position of vertex i
|
//! 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)
|
switch (VertexType)
|
||||||
{
|
{
|
||||||
@ -258,7 +258,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! returns position of vertex i
|
//! returns position of vertex i
|
||||||
virtual core::vector3df& getPosition(u32 i) _IRR_OVERRIDE_
|
core::vector3df& getPosition(u32 i) override
|
||||||
{
|
{
|
||||||
switch (VertexType)
|
switch (VertexType)
|
||||||
{
|
{
|
||||||
@ -272,7 +272,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! returns normal of vertex i
|
//! 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)
|
switch (VertexType)
|
||||||
{
|
{
|
||||||
@ -286,7 +286,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! returns normal of vertex i
|
//! returns normal of vertex i
|
||||||
virtual core::vector3df& getNormal(u32 i) _IRR_OVERRIDE_
|
core::vector3df& getNormal(u32 i) override
|
||||||
{
|
{
|
||||||
switch (VertexType)
|
switch (VertexType)
|
||||||
{
|
{
|
||||||
@ -300,7 +300,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! returns texture coords of vertex i
|
//! 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)
|
switch (VertexType)
|
||||||
{
|
{
|
||||||
@ -314,7 +314,7 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! returns texture coords of vertex i
|
//! returns texture coords of vertex i
|
||||||
virtual core::vector2df& getTCoords(u32 i) _IRR_OVERRIDE_
|
core::vector2df& getTCoords(u32 i) override
|
||||||
{
|
{
|
||||||
switch (VertexType)
|
switch (VertexType)
|
||||||
{
|
{
|
||||||
@ -328,25 +328,25 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! append the vertices and indices to the current buffer
|
//! 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
|
//! 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
|
//! 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;
|
return MappingHint_Vertex;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! get the current hardware mapping hint for index buffers
|
//! 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;
|
return MappingHint_Index;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! set the hardware mapping hint, for driver
|
//! 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)
|
if (Buffer==EBT_VERTEX)
|
||||||
MappingHint_Vertex=NewMappingHint;
|
MappingHint_Vertex=NewMappingHint;
|
||||||
@ -360,19 +360,19 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Describe what kind of primitive geometry is used by the meshbuffer
|
//! 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;
|
PrimitiveType = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get the kind of primitive geometry which is used by the meshbuffer
|
//! 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;
|
return PrimitiveType;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! flags the mesh as changed, reloads hardware buffers
|
//! 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)
|
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX)
|
||||||
++ChangedID_Vertex;
|
++ChangedID_Vertex;
|
||||||
@ -380,15 +380,15 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
|||||||
++ChangedID_Index;
|
++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;
|
HWBuffer = ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void *getHWBuffer() const _IRR_OVERRIDE_ {
|
void *getHWBuffer() const override {
|
||||||
return HWBuffer;
|
return HWBuffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
@ -112,13 +112,10 @@ For functions: template<class T> _IRR_DEPRECATED_ void test4(void) {}
|
|||||||
#define _IRR_DEPRECATED_
|
#define _IRR_DEPRECATED_
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! Defines an override macro, to protect virtual functions from typos and other mismatches
|
//! deprecated macro for virtual function override
|
||||||
/** Usage in a derived class:
|
/** prefer to use the override keyword for new code */
|
||||||
virtual void somefunc() _IRR_OVERRIDE_;
|
|
||||||
*/
|
|
||||||
#define _IRR_OVERRIDE_ override
|
#define _IRR_OVERRIDE_ override
|
||||||
|
|
||||||
|
|
||||||
//! creates four CC codes used in Irrlicht for simple ids
|
//! creates four CC codes used in Irrlicht for simple ids
|
||||||
/** some compilers can create those by directly writing the
|
/** some compilers can create those by directly writing the
|
||||||
code like 'code', but some generate warnings so we use this macro here */
|
code like 'code', but some generate warnings so we use this macro here */
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -35,7 +35,6 @@
|
|||||||
#include "CMeshBuffer.h"
|
#include "CMeshBuffer.h"
|
||||||
#include "coreutil.h"
|
#include "coreutil.h"
|
||||||
#include "CVertexBuffer.h"
|
#include "CVertexBuffer.h"
|
||||||
#include "IProfiler.h"
|
|
||||||
#include "dimension2d.h"
|
#include "dimension2d.h"
|
||||||
#include "ECullingTypes.h"
|
#include "ECullingTypes.h"
|
||||||
#include "EDebugSceneTypes.h"
|
#include "EDebugSceneTypes.h"
|
||||||
|
@ -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
|
|
@ -54,7 +54,7 @@ namespace io
|
|||||||
virtual void addDirectoryToFileList(const io::path &filename);
|
virtual void addDirectoryToFileList(const io::path &filename);
|
||||||
|
|
||||||
//! return the name (id) of the file Archive
|
//! 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:
|
protected:
|
||||||
//! Android's asset manager
|
//! Android's asset manager
|
||||||
|
@ -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
|
bool CIrrDeviceAndroid::isWindowActive() const
|
||||||
{
|
{
|
||||||
return (Focused && !Paused);
|
return (Focused && !Paused);
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
#include "CIrrDeviceStub.h"
|
#include "CIrrDeviceStub.h"
|
||||||
#include "IrrlichtDevice.h"
|
#include "IrrlichtDevice.h"
|
||||||
#include "IImagePresenter.h"
|
|
||||||
#include "ICursorControl.h"
|
#include "ICursorControl.h"
|
||||||
|
|
||||||
#include <android/sensor.h>
|
#include <android/sensor.h>
|
||||||
@ -19,7 +18,7 @@
|
|||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
class CIrrDeviceAndroid : public CIrrDeviceStub, video::IImagePresenter
|
class CIrrDeviceAndroid : public CIrrDeviceStub
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CIrrDeviceAndroid(const SIrrlichtCreationParameters& param);
|
CIrrDeviceAndroid(const SIrrlichtCreationParameters& param);
|
||||||
@ -34,8 +33,6 @@ namespace irr
|
|||||||
|
|
||||||
virtual void setWindowCaption(const wchar_t* text);
|
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 isWindowActive() const;
|
||||||
|
|
||||||
virtual bool isWindowFocused() const;
|
virtual bool isWindowFocused() const;
|
||||||
|
@ -236,15 +236,6 @@ void CAnimatedMeshSceneNode::OnAnimate(u32 timeMs)
|
|||||||
|
|
||||||
// set CurrentFrameNr
|
// set CurrentFrameNr
|
||||||
buildFrameNr(timeMs-LastTimeMs);
|
buildFrameNr(timeMs-LastTimeMs);
|
||||||
|
|
||||||
// update bbox
|
|
||||||
if (Mesh)
|
|
||||||
{
|
|
||||||
scene::IMesh * mesh = getMeshForCurrentFrame();
|
|
||||||
|
|
||||||
if (mesh)
|
|
||||||
Box = mesh->getBoundingBox();
|
|
||||||
}
|
|
||||||
LastTimeMs = timeMs;
|
LastTimeMs = timeMs;
|
||||||
|
|
||||||
IAnimatedMeshSceneNode::OnAnimate(timeMs);
|
IAnimatedMeshSceneNode::OnAnimate(timeMs);
|
||||||
|
@ -31,114 +31,114 @@ namespace scene
|
|||||||
virtual ~CAnimatedMeshSceneNode();
|
virtual ~CAnimatedMeshSceneNode();
|
||||||
|
|
||||||
//! sets the current frame. from now on the animation is played from this frame.
|
//! 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
|
//! frame
|
||||||
virtual void OnRegisterSceneNode() _IRR_OVERRIDE_;
|
void OnRegisterSceneNode() override;
|
||||||
|
|
||||||
//! OnAnimate() is called just before rendering the whole scene.
|
//! OnAnimate() is called just before rendering the whole scene.
|
||||||
virtual void OnAnimate(u32 timeMs) _IRR_OVERRIDE_;
|
void OnAnimate(u32 timeMs) override;
|
||||||
|
|
||||||
//! renders the node.
|
//! renders the node.
|
||||||
virtual void render() _IRR_OVERRIDE_;
|
void render() override;
|
||||||
|
|
||||||
//! returns the axis aligned bounding box of this node
|
//! 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.
|
//! sets the frames between the animation is looped.
|
||||||
//! the default is 0 - MaximalFrameCount of the mesh.
|
//! 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
|
//! 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,
|
//! Sets looping mode which is on by default. If set to false,
|
||||||
//! animations will not be looped.
|
//! animations will not be looped.
|
||||||
virtual void setLoopMode(bool playAnimationLooped) _IRR_OVERRIDE_;
|
void setLoopMode(bool playAnimationLooped) override;
|
||||||
|
|
||||||
//! returns the current loop mode
|
//! 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
|
//! Sets a callback interface which will be called if an animation
|
||||||
//! playback has ended. Set this to 0 to disable the callback again.
|
//! 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
|
//! 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
|
//! 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
|
//! 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
|
//! returns the material based on the zero based index i. To get the amount
|
||||||
//! of materials used by this scene node, use getMaterialCount().
|
//! of materials used by this scene node, use getMaterialCount().
|
||||||
//! This function is needed for inserting the node into the scene hierarchy on a
|
//! 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
|
//! optimal position for minimizing renderstate changes, but can also be used
|
||||||
//! to directly modify the material of a scene node.
|
//! 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.
|
//! 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
|
//! 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.
|
//! 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
|
//! 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.
|
//! Gets joint count.
|
||||||
virtual u32 getJointCount() const _IRR_OVERRIDE_;
|
u32 getJointCount() const override;
|
||||||
|
|
||||||
//! Removes a child from this scene node.
|
//! Removes a child from this scene node.
|
||||||
//! Implemented here, to be able to remove the shadow properly, if there is one,
|
//! Implemented here, to be able to remove the shadow properly, if there is one,
|
||||||
//! or to remove attached child.
|
//! or to remove attached child.
|
||||||
virtual bool removeChild(ISceneNode* child) _IRR_OVERRIDE_;
|
bool removeChild(ISceneNode* child) override;
|
||||||
|
|
||||||
//! Returns the current displayed frame number.
|
//! Returns the current displayed frame number.
|
||||||
virtual f32 getFrameNr() const _IRR_OVERRIDE_;
|
f32 getFrameNr() const override;
|
||||||
//! Returns the current start frame number.
|
//! Returns the current start frame number.
|
||||||
virtual s32 getStartFrame() const _IRR_OVERRIDE_;
|
s32 getStartFrame() const override;
|
||||||
//! Returns the current end frame number.
|
//! 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.
|
//! 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
|
/* In this way it is possible to change the materials a mesh causing all mesh scene nodes
|
||||||
referencing this mesh to change too. */
|
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
|
//! 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
|
//! Sets a new mesh
|
||||||
virtual void setMesh(IAnimatedMesh* mesh) _IRR_OVERRIDE_;
|
void setMesh(IAnimatedMesh* mesh) override;
|
||||||
|
|
||||||
//! Returns the current mesh
|
//! Returns the current mesh
|
||||||
virtual IAnimatedMesh* getMesh(void) _IRR_OVERRIDE_ { return Mesh; }
|
IAnimatedMesh* getMesh(void) override { return Mesh; }
|
||||||
|
|
||||||
//! Returns type of the scene node
|
//! 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
|
//! 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)
|
//! 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)
|
//! 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
|
//! 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
|
//! 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)
|
//! 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.
|
//! Creates a clone of this scene node and its children.
|
||||||
/** \param newParent An optional new parent.
|
/** \param newParent An optional new parent.
|
||||||
\param newManager An optional new scene manager.
|
\param newManager An optional new scene manager.
|
||||||
\return The newly created clone of this node. */
|
\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:
|
private:
|
||||||
|
|
||||||
|
@ -27,42 +27,42 @@ public:
|
|||||||
setBool(value);
|
setBool(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual s32 getInt() const _IRR_OVERRIDE_
|
s32 getInt() const override
|
||||||
{
|
{
|
||||||
return BoolValue ? 1 : 0;
|
return BoolValue ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual f32 getFloat() const _IRR_OVERRIDE_
|
f32 getFloat() const override
|
||||||
{
|
{
|
||||||
return BoolValue ? 1.0f : 0.0f;
|
return BoolValue ? 1.0f : 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool getBool() const _IRR_OVERRIDE_
|
bool getBool() const override
|
||||||
{
|
{
|
||||||
return BoolValue;
|
return BoolValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setInt(s32 intValue) _IRR_OVERRIDE_
|
void setInt(s32 intValue) override
|
||||||
{
|
{
|
||||||
BoolValue = (intValue != 0);
|
BoolValue = (intValue != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setFloat(f32 floatValue) _IRR_OVERRIDE_
|
void setFloat(f32 floatValue) override
|
||||||
{
|
{
|
||||||
BoolValue = (floatValue != 0);
|
BoolValue = (floatValue != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setBool(bool boolValue) _IRR_OVERRIDE_
|
void setBool(bool boolValue) override
|
||||||
{
|
{
|
||||||
BoolValue = boolValue;
|
BoolValue = boolValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
|
E_ATTRIBUTE_TYPE getType() const override
|
||||||
{
|
{
|
||||||
return EAT_BOOL;
|
return EAT_BOOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const wchar_t* getTypeString() const _IRR_OVERRIDE_
|
const wchar_t* getTypeString() const override
|
||||||
{
|
{
|
||||||
return L"bool";
|
return L"bool";
|
||||||
}
|
}
|
||||||
@ -81,32 +81,32 @@ public:
|
|||||||
setInt(value);
|
setInt(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual s32 getInt() const _IRR_OVERRIDE_
|
s32 getInt() const override
|
||||||
{
|
{
|
||||||
return Value;
|
return Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual f32 getFloat() const _IRR_OVERRIDE_
|
f32 getFloat() const override
|
||||||
{
|
{
|
||||||
return (f32)Value;
|
return (f32)Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setInt(s32 intValue) _IRR_OVERRIDE_
|
void setInt(s32 intValue) override
|
||||||
{
|
{
|
||||||
Value = intValue;
|
Value = intValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setFloat(f32 floatValue) _IRR_OVERRIDE_
|
void setFloat(f32 floatValue) override
|
||||||
{
|
{
|
||||||
Value = (s32)floatValue;
|
Value = (s32)floatValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
|
E_ATTRIBUTE_TYPE getType() const override
|
||||||
{
|
{
|
||||||
return EAT_INT;
|
return EAT_INT;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const wchar_t* getTypeString() const _IRR_OVERRIDE_
|
const wchar_t* getTypeString() const override
|
||||||
{
|
{
|
||||||
return L"int";
|
return L"int";
|
||||||
}
|
}
|
||||||
@ -125,32 +125,32 @@ public:
|
|||||||
setFloat(value);
|
setFloat(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual s32 getInt() const _IRR_OVERRIDE_
|
s32 getInt() const override
|
||||||
{
|
{
|
||||||
return (s32)Value;
|
return (s32)Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual f32 getFloat() const _IRR_OVERRIDE_
|
f32 getFloat() const override
|
||||||
{
|
{
|
||||||
return Value;
|
return Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setInt(s32 intValue) _IRR_OVERRIDE_
|
void setInt(s32 intValue) override
|
||||||
{
|
{
|
||||||
Value = (f32)intValue;
|
Value = (f32)intValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setFloat(f32 floatValue) _IRR_OVERRIDE_
|
void setFloat(f32 floatValue) override
|
||||||
{
|
{
|
||||||
Value = floatValue;
|
Value = floatValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual E_ATTRIBUTE_TYPE getType() const _IRR_OVERRIDE_
|
E_ATTRIBUTE_TYPE getType() const override
|
||||||
{
|
{
|
||||||
return EAT_FLOAT;
|
return EAT_FLOAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const wchar_t* getTypeString() const _IRR_OVERRIDE_
|
const wchar_t* getTypeString() const override
|
||||||
{
|
{
|
||||||
return L"float";
|
return L"float";
|
||||||
}
|
}
|
||||||
|
@ -30,37 +30,37 @@ public:
|
|||||||
~CAttributes();
|
~CAttributes();
|
||||||
|
|
||||||
//! Returns amount of attributes in this collection of attributes.
|
//! Returns amount of attributes in this collection of attributes.
|
||||||
virtual u32 getAttributeCount() const _IRR_OVERRIDE_;
|
u32 getAttributeCount() const override;
|
||||||
|
|
||||||
//! Returns attribute name by index.
|
//! Returns attribute name by index.
|
||||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
//! \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
|
//! Returns the type of an attribute
|
||||||
//! \param attributeName: Name for the 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.
|
//! Returns attribute type by index.
|
||||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
//! \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
|
//! Returns the type string of the attribute
|
||||||
//! \param attributeName: String for the attribute type
|
//! \param attributeName: String for the attribute type
|
||||||
//! \param defaultNotFound Value returned when attributeName was not found
|
//! \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.
|
//! Returns the type string of the attribute by index.
|
||||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
//! \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
|
//! 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
|
//! 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
|
//! Removes all attributes
|
||||||
virtual void clear() _IRR_OVERRIDE_;
|
void clear() override;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -70,23 +70,23 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//! Adds an attribute as integer
|
//! 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
|
//! 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
|
//! Gets an attribute as integer value
|
||||||
//! \param attributeName: Name of the attribute to get.
|
//! \param attributeName: Name of the attribute to get.
|
||||||
//! \param defaultNotFound Value returned when attributeName was not found
|
//! \param defaultNotFound Value returned when attributeName was not found
|
||||||
//! \return Returns value of the attribute previously set by setAttribute()
|
//! \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
|
//! Gets an attribute as integer value
|
||||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
//! \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
|
//! Sets an attribute as integer value
|
||||||
virtual void setAttribute(s32 index, s32 value) _IRR_OVERRIDE_;
|
void setAttribute(s32 index, s32 value) override;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
@ -95,23 +95,23 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//! Adds an attribute as float
|
//! 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
|
//! 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
|
//! Gets an attribute as float value
|
||||||
//! \param attributeName: Name of the attribute to get.
|
//! \param attributeName: Name of the attribute to get.
|
||||||
//! \param defaultNotFound Value returned when attributeName was not found
|
//! \param defaultNotFound Value returned when attributeName was not found
|
||||||
//! \return Returns value of the attribute previously set by setAttribute()
|
//! \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
|
//! Gets an attribute as float value
|
||||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
//! \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
|
//! Sets an attribute as float value
|
||||||
virtual void setAttribute(s32 index, f32 value) _IRR_OVERRIDE_;
|
void setAttribute(s32 index, f32 value) override;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -119,23 +119,23 @@ public:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//! Adds an attribute as bool
|
//! 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
|
//! 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
|
//! Gets an attribute as boolean value
|
||||||
//! \param attributeName: Name of the attribute to get.
|
//! \param attributeName: Name of the attribute to get.
|
||||||
//! \param defaultNotFound Value returned when attributeName was not found
|
//! \param defaultNotFound Value returned when attributeName was not found
|
||||||
//! \return Returns value of the attribute previously set by setAttribute()
|
//! \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
|
//! Gets an attribute as boolean value
|
||||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
//! \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
|
//! Sets an attribute as boolean value
|
||||||
virtual void setAttribute(s32 index, bool value) _IRR_OVERRIDE_;
|
void setAttribute(s32 index, bool value) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ namespace scene
|
|||||||
|
|
||||||
//! Constructor
|
//! Constructor
|
||||||
CB3DMeshFileLoader::CB3DMeshFileLoader(scene::ISceneManager* smgr)
|
CB3DMeshFileLoader::CB3DMeshFileLoader(scene::ISceneManager* smgr)
|
||||||
: AnimatedMesh(0), B3DFile(0), NormalsInFile(false),
|
: AnimatedMesh(0), B3DFile(0), VerticesStart(0), NormalsInFile(false),
|
||||||
HasVertexColors(false), ShowWarning(true)
|
HasVertexColors(false), ShowWarning(true)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
|
@ -33,13 +33,13 @@ public:
|
|||||||
|
|
||||||
//! returns true if the file maybe is able to be loaded by this class
|
//! returns true if the file maybe is able to be loaded by this class
|
||||||
//! based on the file extension (e.g. ".bsp")
|
//! 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.
|
//! creates/loads an animated mesh from the file.
|
||||||
//! \return Pointer to the created mesh. Returns 0 if loading failed.
|
//! \return Pointer to the created mesh. Returns 0 if loading failed.
|
||||||
//! If you no longer need the mesh, you should call IAnimatedMesh::drop().
|
//! If you no longer need the mesh, you should call IAnimatedMesh::drop().
|
||||||
//! See IReferenceCounted::drop() for more information.
|
//! See IReferenceCounted::drop() for more information.
|
||||||
virtual IAnimatedMesh* createMesh(io::IReadFile* file) _IRR_OVERRIDE_;
|
IAnimatedMesh* createMesh(io::IReadFile* file) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -27,10 +27,10 @@ public:
|
|||||||
CB3DMeshWriter();
|
CB3DMeshWriter();
|
||||||
|
|
||||||
//! Returns the type of the mesh writer
|
//! Returns the type of the mesh writer
|
||||||
virtual EMESH_WRITER_TYPE getType() const _IRR_OVERRIDE_;
|
EMESH_WRITER_TYPE getType() const override;
|
||||||
|
|
||||||
//! writes a mesh
|
//! 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:
|
private:
|
||||||
void writeJointChunk(io::IWriteFile* file, ISkinnedMesh* mesh , ISkinnedMesh::SJoint* joint, f32 animationSpeedMultiplier);
|
void writeJointChunk(io::IWriteFile* file, ISkinnedMesh* mesh , ISkinnedMesh::SJoint* joint, f32 animationSpeedMultiplier);
|
||||||
|
@ -28,58 +28,58 @@ public:
|
|||||||
virtual ~CBillboardSceneNode();
|
virtual ~CBillboardSceneNode();
|
||||||
|
|
||||||
//! pre render event
|
//! pre render event
|
||||||
virtual void OnRegisterSceneNode() _IRR_OVERRIDE_;
|
void OnRegisterSceneNode() override;
|
||||||
|
|
||||||
//! render
|
//! render
|
||||||
virtual void render() _IRR_OVERRIDE_;
|
void render() override;
|
||||||
|
|
||||||
//! returns the axis aligned bounding box of this node
|
//! 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
|
//! 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.
|
//! 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
|
//! 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.
|
//! 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.
|
//! 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
|
//! Set the color of all vertices of the billboard
|
||||||
//! \param overallColor: the color to set
|
//! \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
|
//! Set the color of the top and bottom vertices of the billboard
|
||||||
//! \param topColor: the color to set the top vertices
|
//! \param topColor: the color to set the top vertices
|
||||||
//! \param bottomColor: the color to set the bottom vertices
|
//! \param bottomColor: the color to set the bottom vertices
|
||||||
virtual void setColor(const video::SColor& topColor,
|
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
|
//! Gets the color of the top and bottom vertices of the billboard
|
||||||
//! \param[out] topColor: stores the color of the top vertices
|
//! \param[out] topColor: stores the color of the top vertices
|
||||||
//! \param[out] bottomColor: stores the color of the bottom vertices
|
//! \param[out] bottomColor: stores the color of the bottom vertices
|
||||||
virtual void getColor(video::SColor& topColor,
|
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)
|
//! 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.
|
//! Get the amount of mesh buffers.
|
||||||
virtual u32 getMeshBufferCount() const _IRR_OVERRIDE_
|
u32 getMeshBufferCount() const override
|
||||||
{
|
{
|
||||||
return Buffer ? 1 : 0;
|
return Buffer ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get pointer to the mesh buffer.
|
//! Get pointer to the mesh buffer.
|
||||||
virtual IMeshBuffer* getMeshBuffer(u32 nr) const _IRR_OVERRIDE_
|
IMeshBuffer* getMeshBuffer(u32 nr) const override
|
||||||
{
|
{
|
||||||
if ( nr == 0 )
|
if ( nr == 0 )
|
||||||
return Buffer;
|
return Buffer;
|
||||||
@ -87,10 +87,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Returns type of the scene node
|
//! 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.
|
//! 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:
|
protected:
|
||||||
void updateMesh(const irr::scene::ICameraSceneNode* camera);
|
void updateMesh(const irr::scene::ICameraSceneNode* camera);
|
||||||
|
@ -23,33 +23,33 @@ namespace scene
|
|||||||
s32 id=-1, u32 boneIndex=0, const c8* boneName=0);
|
s32 id=-1, u32 boneIndex=0, const c8* boneName=0);
|
||||||
|
|
||||||
//! Returns the index of the bone
|
//! 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.
|
//! 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
|
//! 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
|
//! 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.
|
//! 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
|
//! 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;
|
SkinningSpace=space;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual E_BONE_SKINNING_SPACE getSkinningSpace() const _IRR_OVERRIDE_
|
E_BONE_SKINNING_SPACE getSkinningSpace() const override
|
||||||
{
|
{
|
||||||
return SkinningSpace;
|
return SkinningSpace;
|
||||||
}
|
}
|
||||||
|
@ -30,117 +30,117 @@ namespace scene
|
|||||||
\param projection The new projection matrix of the camera.
|
\param projection The new projection matrix of the camera.
|
||||||
\param isOrthogonal Set this to true if the matrix is an orthogonal one (e.g.
|
\param isOrthogonal Set this to true if the matrix is an orthogonal one (e.g.
|
||||||
from matrix4::buildProjectionMatrixOrthoLH(). */
|
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
|
//! Gets the current projection matrix of the camera
|
||||||
//! \return Returns 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
|
//! Gets the current view matrix of the camera
|
||||||
//! \return Returns 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.
|
//! Sets a custom view matrix affector.
|
||||||
/** \param affector: The affector matrix. */
|
/** \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.
|
//! 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
|
//! 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
|
//! may ignore this input, but camera scene nodes which are created for
|
||||||
//! example with scene::ISceneManager::addMayaCameraSceneNode or
|
//! example with scene::ISceneManager::addMayaCameraSceneNode or
|
||||||
//! scene::ISceneManager::addMeshViewerCameraSceneNode, may want to get this input
|
//! scene::ISceneManager::addMeshViewerCameraSceneNode, may want to get this input
|
||||||
//! for changing their position, look at target or whatever.
|
//! 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
|
//! Sets the look at target of the camera
|
||||||
/** If the camera's target and rotation are bound ( @see bindTargetAndRotation() )
|
/** 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.
|
then calling this will also change the camera's scene node rotation to match the target.
|
||||||
\param pos: Look at target of the camera. */
|
\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.
|
//! Sets the rotation of the node.
|
||||||
/** This only modifies the relative rotation of the node.
|
/** This only modifies the relative rotation of the node.
|
||||||
If the camera's target and rotation are bound ( @see bindTargetAndRotation() )
|
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.
|
then calling this will also change the camera's target to match the rotation.
|
||||||
\param rotation New rotation of the node in degrees. */
|
\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
|
//! Gets the current look at target of the camera
|
||||||
/** \return 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.
|
//! Sets the up vector of the camera.
|
||||||
//! \param pos: New upvector 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.
|
//! Gets the up vector of the camera.
|
||||||
//! \return Returns 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.
|
//! Gets distance from the camera to the near plane.
|
||||||
//! \return Value of the near plane of the camera.
|
//! \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.
|
//! Gets the distance from the camera to the far plane.
|
||||||
//! \return Value of the far plane of the camera.
|
//! \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.
|
//! Get the aspect ratio of the camera.
|
||||||
//! \return 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.
|
//! Gets the field of view of the camera.
|
||||||
//! \return 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)
|
//! 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)
|
//! 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)
|
//! 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)
|
//! Sets the field of view (Default: PI / 3.5f)
|
||||||
virtual void setFOV(f32 fovy) _IRR_OVERRIDE_;
|
void setFOV(f32 fovy) override;
|
||||||
|
|
||||||
//! PreRender event
|
//! PreRender event
|
||||||
virtual void OnRegisterSceneNode() _IRR_OVERRIDE_;
|
void OnRegisterSceneNode() override;
|
||||||
|
|
||||||
//! Render
|
//! Render
|
||||||
virtual void render() _IRR_OVERRIDE_;
|
void render() override;
|
||||||
|
|
||||||
//! Update
|
//! Update
|
||||||
virtual void updateMatrices() _IRR_OVERRIDE_;
|
void updateMatrices() override;
|
||||||
|
|
||||||
//! Returns the axis aligned bounding box of this node
|
//! 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.
|
//! 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.
|
//! Disables or enables the camera to get key or mouse inputs.
|
||||||
//! If this is set to true, the camera will respond to key inputs
|
//! If this is set to true, the camera will respond to key inputs
|
||||||
//! otherwise not.
|
//! 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.
|
//! 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
|
//! 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.
|
//! 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.
|
//! 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.
|
//! 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:
|
protected:
|
||||||
|
|
||||||
|
@ -20,36 +20,36 @@ namespace scene
|
|||||||
CDummyTransformationSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id);
|
CDummyTransformationSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id);
|
||||||
|
|
||||||
//! returns the axis aligned bounding box of this node
|
//! 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.
|
//! Returns a reference to the current relative transformation matrix.
|
||||||
//! This is the matrix, this scene node uses instead of scale, translation
|
//! This is the matrix, this scene node uses instead of scale, translation
|
||||||
//! and rotation.
|
//! and rotation.
|
||||||
virtual core::matrix4& getRelativeTransformationMatrix() _IRR_OVERRIDE_;
|
core::matrix4& getRelativeTransformationMatrix() override;
|
||||||
|
|
||||||
//! Returns the relative transformation of the scene node.
|
//! Returns the relative transformation of the scene node.
|
||||||
virtual core::matrix4 getRelativeTransformation() const _IRR_OVERRIDE_;
|
core::matrix4 getRelativeTransformation() const override;
|
||||||
|
|
||||||
//! does nothing.
|
//! does nothing.
|
||||||
virtual void render() _IRR_OVERRIDE_ {}
|
void render() override {}
|
||||||
|
|
||||||
//! Returns type of the scene node
|
//! 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.
|
//! 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:
|
private:
|
||||||
|
|
||||||
// TODO: We can add least add some warnings to find troubles faster until we have
|
// TODO: We can add least add some warnings to find troubles faster until we have
|
||||||
// fixed bug id 2318691.
|
// fixed bug id 2318691.
|
||||||
virtual const core::vector3df& getScale() const _IRR_OVERRIDE_;
|
const core::vector3df& getScale() const override;
|
||||||
virtual void setScale(const core::vector3df& scale) _IRR_OVERRIDE_;
|
void setScale(const core::vector3df& scale) override;
|
||||||
virtual const core::vector3df& getRotation() const _IRR_OVERRIDE_;
|
const core::vector3df& getRotation() const override;
|
||||||
virtual void setRotation(const core::vector3df& rotation) _IRR_OVERRIDE_;
|
void setRotation(const core::vector3df& rotation) override;
|
||||||
virtual const core::vector3df& getPosition() const _IRR_OVERRIDE_;
|
const core::vector3df& getPosition() const override;
|
||||||
virtual void setPosition(const core::vector3df& newpos) _IRR_OVERRIDE_;
|
void setPosition(const core::vector3df& newpos) override;
|
||||||
|
|
||||||
core::matrix4 RelativeTransformationMatrix;
|
core::matrix4 RelativeTransformationMatrix;
|
||||||
core::aabbox3d<f32> Box;
|
core::aabbox3d<f32> Box;
|
||||||
|
@ -32,42 +32,42 @@ namespace video
|
|||||||
// Initialize EGL.
|
// Initialize EGL.
|
||||||
/* This method initialize EGLand create EGL display, anyway surface and context
|
/* This method initialize EGLand create EGL display, anyway surface and context
|
||||||
aren't create. */
|
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.
|
||||||
/* Terminate EGL context. This method break both existed surface and context. */
|
/* Terminate EGL context. This method break both existed surface and context. */
|
||||||
virtual void terminate() _IRR_OVERRIDE_;
|
void terminate() override;
|
||||||
|
|
||||||
// Create EGL surface.
|
// Create EGL surface.
|
||||||
/* This method create EGL surface. On some platforms eg. Android, we must
|
/* This method create EGL surface. On some platforms eg. Android, we must
|
||||||
recreate surface on each resume, because WindowID may change, so existed
|
recreate surface on each resume, because WindowID may change, so existed
|
||||||
surface may not be valid. If EGL context already exist, this method
|
surface may not be valid. If EGL context already exist, this method
|
||||||
automatically activates it. */
|
automatically activates it. */
|
||||||
virtual bool generateSurface() _IRR_OVERRIDE_;
|
bool generateSurface() override;
|
||||||
|
|
||||||
// Destroy EGL surface.
|
// Destroy EGL surface.
|
||||||
/* This method destroy EGL. On some platforms eg. Android, we should call
|
/* 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.
|
this method on each pause, because after resume this surface may not be valid.
|
||||||
Hovewer this method doesn'r break EGL context. */
|
Hovewer this method doesn'r break EGL context. */
|
||||||
virtual void destroySurface() _IRR_OVERRIDE_;
|
void destroySurface() override;
|
||||||
|
|
||||||
// Create EGL context.
|
// Create EGL context.
|
||||||
/* This method create and activate EGL context. */
|
/* This method create and activate EGL context. */
|
||||||
virtual bool generateContext() _IRR_OVERRIDE_;
|
bool generateContext() override;
|
||||||
|
|
||||||
// Destroy EGL context.
|
// Destroy EGL context.
|
||||||
/* This method 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.
|
// Get procedure address.
|
||||||
virtual void* getProcAddress(const std::string &procName) _IRR_OVERRIDE_;
|
void* getProcAddress(const std::string &procName) override;
|
||||||
|
|
||||||
// Swap buffers.
|
// Swap buffers.
|
||||||
virtual bool swapBuffers() _IRR_OVERRIDE_;
|
bool swapBuffers() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum EConfigStyle
|
enum EConfigStyle
|
||||||
|
@ -20,19 +20,19 @@ namespace scene
|
|||||||
CEmptySceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id);
|
CEmptySceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id);
|
||||||
|
|
||||||
//! returns the axis aligned bounding box of this node
|
//! 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.
|
//! This method is called just before the rendering process of the whole scene.
|
||||||
virtual void OnRegisterSceneNode() _IRR_OVERRIDE_;
|
void OnRegisterSceneNode() override;
|
||||||
|
|
||||||
//! does nothing.
|
//! does nothing.
|
||||||
virtual void render() _IRR_OVERRIDE_;
|
void render() override;
|
||||||
|
|
||||||
//! Returns type of the scene node
|
//! 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.
|
//! 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:
|
private:
|
||||||
|
|
||||||
|
@ -82,37 +82,37 @@ public:
|
|||||||
\param offset The offset where the file is stored in an archive
|
\param offset The offset where the file is stored in an archive
|
||||||
\param size The size of the file in bytes.
|
\param size The size of the file in bytes.
|
||||||
\param id The ID of the file in the archive which owns it */
|
\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
|
//! 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.
|
//! 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.
|
//! 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.
|
//! 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.
|
//! 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
|
//! 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
|
//! 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
|
//! 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
|
//! 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
|
//! Returns the base path of the file list
|
||||||
virtual const io::path& getPath() const _IRR_OVERRIDE_;
|
const io::path& getPath() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -29,101 +29,101 @@ public:
|
|||||||
virtual ~CFileSystem();
|
virtual ~CFileSystem();
|
||||||
|
|
||||||
//! opens a file for read access
|
//! 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.
|
//! 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
|
//! 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.
|
//! 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.
|
//! 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.
|
//! Adds an archive to the file system.
|
||||||
virtual bool addFileArchive(const io::path& filename,
|
virtual bool addFileArchive(const io::path& filename,
|
||||||
bool ignoreCase = true, bool ignorePaths = true,
|
bool ignoreCase = true, bool ignorePaths = true,
|
||||||
E_FILE_ARCHIVE_TYPE archiveType = EFAT_UNKNOWN,
|
E_FILE_ARCHIVE_TYPE archiveType = EFAT_UNKNOWN,
|
||||||
const core::stringc& password="",
|
const core::stringc& password="",
|
||||||
IFileArchive** retArchive = 0) _IRR_OVERRIDE_;
|
IFileArchive** retArchive = 0) override;
|
||||||
|
|
||||||
//! Adds an archive to the file system.
|
//! Adds an archive to the file system.
|
||||||
virtual bool addFileArchive(IReadFile* file, bool ignoreCase=true,
|
virtual bool addFileArchive(IReadFile* file, bool ignoreCase=true,
|
||||||
bool ignorePaths=true,
|
bool ignorePaths=true,
|
||||||
E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN,
|
E_FILE_ARCHIVE_TYPE archiveType=EFAT_UNKNOWN,
|
||||||
const core::stringc& password="",
|
const core::stringc& password="",
|
||||||
IFileArchive** retArchive = 0) _IRR_OVERRIDE_;
|
IFileArchive** retArchive = 0) override;
|
||||||
|
|
||||||
//! Adds an archive to the file system.
|
//! 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
|
//! 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.
|
//! 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.
|
//! Returns the total number of archive loaders added.
|
||||||
virtual u32 getArchiveLoaderCount() const _IRR_OVERRIDE_;
|
u32 getArchiveLoaderCount() const override;
|
||||||
|
|
||||||
//! Gets the archive loader by index.
|
//! 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
|
//! gets the file archive count
|
||||||
virtual u32 getFileArchiveCount() const _IRR_OVERRIDE_;
|
u32 getFileArchiveCount() const override;
|
||||||
|
|
||||||
//! gets an archive
|
//! gets an archive
|
||||||
virtual IFileArchive* getFileArchive(u32 index) _IRR_OVERRIDE_;
|
IFileArchive* getFileArchive(u32 index) override;
|
||||||
|
|
||||||
//! removes an archive from the file system.
|
//! 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.
|
//! 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.
|
//! 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
|
//! 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.
|
//! Changes the current Working Directory to the string given.
|
||||||
//! The string is operating system dependent. Under Windows it will look
|
//! The string is operating system dependent. Under Windows it will look
|
||||||
//! like this: "drive:\directory\sudirectory\"
|
//! 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
|
//! 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.
|
//! Returns the directory a file is located in.
|
||||||
/** \param filename: The file to get the directory from */
|
/** \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
|
//! 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.
|
//! part. If no directory is prefixed, the full name is returned.
|
||||||
/** \param filename: The file to get the basename from */
|
/** \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"
|
//! 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
|
//! 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
|
//! Creates a list of files and directories in the current working directory
|
||||||
//! and returns it.
|
//! and returns it.
|
||||||
virtual IFileList* createFileList() _IRR_OVERRIDE_;
|
IFileList* createFileList() override;
|
||||||
|
|
||||||
//! Creates an empty filelist
|
//! 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.
|
//! 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:
|
private:
|
||||||
|
|
||||||
|
@ -34,34 +34,34 @@ namespace video
|
|||||||
~CGLXManager();
|
~CGLXManager();
|
||||||
|
|
||||||
// Initialize
|
// Initialize
|
||||||
virtual bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) _IRR_OVERRIDE_;
|
bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) override;
|
||||||
|
|
||||||
// Terminate
|
// Terminate
|
||||||
virtual void terminate() _IRR_OVERRIDE_;
|
void terminate() override;
|
||||||
|
|
||||||
// Create surface.
|
// Create surface.
|
||||||
virtual bool generateSurface() _IRR_OVERRIDE_;
|
bool generateSurface() override;
|
||||||
|
|
||||||
// Destroy surface.
|
// Destroy surface.
|
||||||
virtual void destroySurface() _IRR_OVERRIDE_;
|
void destroySurface() override;
|
||||||
|
|
||||||
// Create context.
|
// Create context.
|
||||||
virtual bool generateContext() _IRR_OVERRIDE_;
|
bool generateContext() override;
|
||||||
|
|
||||||
// Destroy context.
|
// Destroy context.
|
||||||
virtual void destroyContext() _IRR_OVERRIDE_;
|
void destroyContext() override;
|
||||||
|
|
||||||
//! Get current context
|
//! 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
|
//! 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.
|
// Get procedure address.
|
||||||
virtual void* getProcAddress(const std::string &procName) _IRR_OVERRIDE_;
|
void* getProcAddress(const std::string &procName) override;
|
||||||
|
|
||||||
// Swap buffers.
|
// Swap buffers.
|
||||||
virtual bool swapBuffers() _IRR_OVERRIDE_;
|
bool swapBuffers() override;
|
||||||
|
|
||||||
XVisualInfo* getVisual() const {return VisualInfo;} // return XVisualInfo
|
XVisualInfo* getVisual() const {return VisualInfo;} // return XVisualInfo
|
||||||
|
|
||||||
|
@ -30,64 +30,64 @@ namespace gui
|
|||||||
virtual ~CGUIButton();
|
virtual ~CGUIButton();
|
||||||
|
|
||||||
//! called if an event happened.
|
//! 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
|
//! 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.
|
//! 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)
|
//! 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
|
//! 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.
|
//! 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
|
//! Gets the override color
|
||||||
virtual video::SColor getOverrideColor(void) const _IRR_OVERRIDE_;
|
video::SColor getOverrideColor(void) const override;
|
||||||
|
|
||||||
//! Gets the currently used text color
|
//! 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.
|
//! 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
|
//! 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.
|
//! 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.
|
//! 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);
|
setImage(EGBIS_IMAGE_UP, image);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets an image which should be displayed on the button when it is in normal state.
|
//! 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);
|
setImage(EGBIS_IMAGE_UP, image, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets an image which should be displayed on the button when it is in pressed state.
|
//! 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);
|
setImage(EGBIS_IMAGE_DOWN, image);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets an image which should be displayed on the button when it is in pressed state.
|
//! 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);
|
setImage(EGBIS_IMAGE_DOWN, image, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the sprite bank used by the button
|
//! 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
|
//! Sets the animated sprite for a specific button state
|
||||||
/** \param index: Number of the sprite within the sprite bank, use -1 for no sprite
|
/** \param index: Number of the sprite within the sprite bank, use -1 for no sprite
|
||||||
@ -97,60 +97,60 @@ namespace gui
|
|||||||
*/
|
*/
|
||||||
virtual void setSprite(EGUI_BUTTON_STATE state, s32 index,
|
virtual void setSprite(EGUI_BUTTON_STATE state, s32 index,
|
||||||
video::SColor color=video::SColor(255,255,255,255),
|
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
|
//! 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.
|
//! 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
|
//! 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
|
//! 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
|
//! 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,
|
//! can be in two states: Normal or Pressed. With a click on the button,
|
||||||
//! the user can change the state of 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
|
//! 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
|
//! 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
|
//! 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
|
//! 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
|
//! 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)
|
//! 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
|
//! 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
|
//! 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
|
//! 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
|
//! 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;
|
return ClickShiftState;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get if the control key was pressed in last EGET_BUTTON_CLICKED event
|
//! 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;
|
return ClickControlState;
|
||||||
}
|
}
|
||||||
|
@ -23,30 +23,30 @@ namespace gui
|
|||||||
CGUICheckBox(bool checked, IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle);
|
CGUICheckBox(bool checked, IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle);
|
||||||
|
|
||||||
//! set if box is checked
|
//! set if box is checked
|
||||||
virtual void setChecked(bool checked) _IRR_OVERRIDE_;
|
void setChecked(bool checked) override;
|
||||||
|
|
||||||
//! returns if box is checked
|
//! returns if box is checked
|
||||||
virtual bool isChecked() const _IRR_OVERRIDE_;
|
bool isChecked() const override;
|
||||||
|
|
||||||
//! Sets whether to draw the background
|
//! Sets whether to draw the background
|
||||||
virtual void setDrawBackground(bool draw) _IRR_OVERRIDE_;
|
void setDrawBackground(bool draw) override;
|
||||||
|
|
||||||
//! Checks if background drawing is enabled
|
//! Checks if background drawing is enabled
|
||||||
/** \return true if background drawing is enabled, false otherwise */
|
/** \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
|
//! Sets whether to draw the border
|
||||||
virtual void setDrawBorder(bool draw) _IRR_OVERRIDE_;
|
void setDrawBorder(bool draw) override;
|
||||||
|
|
||||||
//! Checks if border drawing is enabled
|
//! Checks if border drawing is enabled
|
||||||
/** \return true if border drawing is enabled, false otherwise */
|
/** \return true if border drawing is enabled, false otherwise */
|
||||||
virtual bool isDrawBorderEnabled() const _IRR_OVERRIDE_;
|
bool isDrawBorderEnabled() const override;
|
||||||
|
|
||||||
//! called if an event happened.
|
//! 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
|
//! draws the element and its children
|
||||||
virtual void draw() _IRR_OVERRIDE_;
|
void draw() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -30,49 +30,49 @@ namespace gui
|
|||||||
s32 id, core::rect<s32> rectangle);
|
s32 id, core::rect<s32> rectangle);
|
||||||
|
|
||||||
//! Returns amount of items in box
|
//! 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
|
//! 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
|
//! 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
|
//! 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
|
//! 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.
|
//! 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
|
//! deletes all items in the combo box
|
||||||
virtual void clear() _IRR_OVERRIDE_;
|
void clear() override;
|
||||||
|
|
||||||
//! returns the text of the currently selected item
|
//! 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.
|
//! 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
|
//! 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
|
//! 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
|
//! 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
|
//! 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.
|
//! 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
|
//! draws the element and its children
|
||||||
virtual void draw() _IRR_OVERRIDE_;
|
void draw() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -28,119 +28,119 @@ namespace gui
|
|||||||
virtual ~CGUIEditBox();
|
virtual ~CGUIEditBox();
|
||||||
|
|
||||||
//! Sets another skin independent font.
|
//! Sets another skin independent font.
|
||||||
virtual void setOverrideFont(IGUIFont* font=0) _IRR_OVERRIDE_;
|
void setOverrideFont(IGUIFont* font=0) override;
|
||||||
|
|
||||||
//! Gets the override font (if any)
|
//! Gets the override font (if any)
|
||||||
/** \return The override font (may be 0) */
|
/** \return The override font (may be 0) */
|
||||||
virtual IGUIFont* getOverrideFont() const _IRR_OVERRIDE_;
|
IGUIFont* getOverrideFont() const override;
|
||||||
|
|
||||||
//! Get the font which is used right now for drawing
|
//! Get the font which is used right now for drawing
|
||||||
/** Currently this is the override font when one is set and the
|
/** Currently this is the override font when one is set and the
|
||||||
font of the active skin otherwise */
|
font of the active skin otherwise */
|
||||||
virtual IGUIFont* getActiveFont() const _IRR_OVERRIDE_;
|
IGUIFont* getActiveFont() const override;
|
||||||
|
|
||||||
//! Sets another color for the text.
|
//! Sets another color for the text.
|
||||||
virtual void setOverrideColor(video::SColor color) _IRR_OVERRIDE_;
|
void setOverrideColor(video::SColor color) override;
|
||||||
|
|
||||||
//! Gets the override color
|
//! Gets the override color
|
||||||
virtual video::SColor getOverrideColor() const _IRR_OVERRIDE_;
|
video::SColor getOverrideColor() const override;
|
||||||
|
|
||||||
//! Sets if the text should use the override color or the
|
//! Sets if the text should use the override color or the
|
||||||
//! color in the gui skin.
|
//! color in the gui skin.
|
||||||
virtual void enableOverrideColor(bool enable) _IRR_OVERRIDE_;
|
void enableOverrideColor(bool enable) override;
|
||||||
|
|
||||||
//! Checks if an override color is enabled
|
//! Checks if an override color is enabled
|
||||||
/** \return true if the override color is enabled, false otherwise */
|
/** \return true if the override color is enabled, false otherwise */
|
||||||
virtual bool isOverrideColorEnabled(void) const _IRR_OVERRIDE_;
|
bool isOverrideColorEnabled(void) const override;
|
||||||
|
|
||||||
//! Sets whether to draw the background
|
//! Sets whether to draw the background
|
||||||
virtual void setDrawBackground(bool draw) _IRR_OVERRIDE_;
|
void setDrawBackground(bool draw) override;
|
||||||
|
|
||||||
//! Checks if background drawing is enabled
|
//! Checks if background drawing is enabled
|
||||||
virtual bool isDrawBackgroundEnabled() const _IRR_OVERRIDE_;
|
bool isDrawBackgroundEnabled() const override;
|
||||||
|
|
||||||
//! Turns the border on or off
|
//! Turns the border on or off
|
||||||
virtual void setDrawBorder(bool border) _IRR_OVERRIDE_;
|
void setDrawBorder(bool border) override;
|
||||||
|
|
||||||
//! Checks if border drawing is enabled
|
//! Checks if border drawing is enabled
|
||||||
virtual bool isDrawBorderEnabled() const _IRR_OVERRIDE_;
|
bool isDrawBorderEnabled() const override;
|
||||||
|
|
||||||
//! Enables or disables word wrap for using the edit box as multiline text editor.
|
//! Enables or disables word wrap for using the edit box as multiline text editor.
|
||||||
virtual void setWordWrap(bool enable) _IRR_OVERRIDE_;
|
void setWordWrap(bool enable) override;
|
||||||
|
|
||||||
//! Checks if word wrap is enabled
|
//! Checks if word wrap is enabled
|
||||||
//! \return true if word wrap is enabled, false otherwise
|
//! \return true if word wrap is enabled, false otherwise
|
||||||
virtual bool isWordWrapEnabled() const _IRR_OVERRIDE_;
|
bool isWordWrapEnabled() const override;
|
||||||
|
|
||||||
//! Enables or disables newlines.
|
//! Enables or disables newlines.
|
||||||
/** \param enable: If set to true, the EGET_EDITBOX_ENTER event will not be fired,
|
/** \param enable: If set to true, the EGET_EDITBOX_ENTER event will not be fired,
|
||||||
instead a newline character will be inserted. */
|
instead a newline character will be inserted. */
|
||||||
virtual void setMultiLine(bool enable) _IRR_OVERRIDE_;
|
void setMultiLine(bool enable) override;
|
||||||
|
|
||||||
//! Checks if multi line editing is enabled
|
//! Checks if multi line editing is enabled
|
||||||
//! \return true if mult-line is enabled, false otherwise
|
//! \return true if mult-line is enabled, false otherwise
|
||||||
virtual bool isMultiLineEnabled() const _IRR_OVERRIDE_;
|
bool isMultiLineEnabled() const override;
|
||||||
|
|
||||||
//! Enables or disables automatic scrolling with cursor position
|
//! Enables or disables automatic scrolling with cursor position
|
||||||
//! \param enable: If set to true, the text will move around with the cursor position
|
//! \param enable: If set to true, the text will move around with the cursor position
|
||||||
virtual void setAutoScroll(bool enable) _IRR_OVERRIDE_;
|
void setAutoScroll(bool enable) override;
|
||||||
|
|
||||||
//! Checks to see if automatic scrolling is enabled
|
//! Checks to see if automatic scrolling is enabled
|
||||||
//! \return true if automatic scrolling is enabled, false if not
|
//! \return true if automatic scrolling is enabled, false if not
|
||||||
virtual bool isAutoScrollEnabled() const _IRR_OVERRIDE_;
|
bool isAutoScrollEnabled() const override;
|
||||||
|
|
||||||
//! Gets the size area of the text in the edit box
|
//! Gets the size area of the text in the edit box
|
||||||
//! \return Returns the size in pixels of the text
|
//! \return Returns the size in pixels of the text
|
||||||
virtual core::dimension2du getTextDimension() _IRR_OVERRIDE_;
|
core::dimension2du getTextDimension() override;
|
||||||
|
|
||||||
//! Sets text justification
|
//! Sets text justification
|
||||||
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) _IRR_OVERRIDE_;
|
void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) override;
|
||||||
|
|
||||||
//! called if an event happened.
|
//! 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
|
//! draws the element and its children
|
||||||
virtual void draw() _IRR_OVERRIDE_;
|
void draw() override;
|
||||||
|
|
||||||
//! Sets the new caption of this element.
|
//! Sets the new caption of this element.
|
||||||
virtual void setText(const wchar_t* text) _IRR_OVERRIDE_;
|
void setText(const wchar_t* text) override;
|
||||||
|
|
||||||
//! Sets the maximum amount of characters which may be entered in the box.
|
//! Sets the maximum amount of characters which may be entered in the box.
|
||||||
//! \param max: Maximum amount of characters. If 0, the character amount is
|
//! \param max: Maximum amount of characters. If 0, the character amount is
|
||||||
//! infinity.
|
//! infinity.
|
||||||
virtual void setMax(u32 max) _IRR_OVERRIDE_;
|
void setMax(u32 max) override;
|
||||||
|
|
||||||
//! Returns maximum amount of characters, previously set by setMax();
|
//! Returns maximum amount of characters, previously set by setMax();
|
||||||
virtual u32 getMax() const _IRR_OVERRIDE_;
|
u32 getMax() const override;
|
||||||
|
|
||||||
//! Set the character used for the cursor.
|
//! Set the character used for the cursor.
|
||||||
/** By default it's "_" */
|
/** By default it's "_" */
|
||||||
virtual void setCursorChar(const wchar_t cursorChar) _IRR_OVERRIDE_;
|
void setCursorChar(const wchar_t cursorChar) override;
|
||||||
|
|
||||||
//! Get the character used for the cursor.
|
//! Get the character used for the cursor.
|
||||||
virtual wchar_t getCursorChar() const _IRR_OVERRIDE_;
|
wchar_t getCursorChar() const override;
|
||||||
|
|
||||||
//! Set the blinktime for the cursor. 2x blinktime is one full cycle.
|
//! Set the blinktime for the cursor. 2x blinktime is one full cycle.
|
||||||
//** \param timeMs Blinktime in milliseconds. When set to 0 the cursor is constantly on without blinking */
|
//** \param timeMs Blinktime in milliseconds. When set to 0 the cursor is constantly on without blinking */
|
||||||
virtual void setCursorBlinkTime(irr::u32 timeMs) _IRR_OVERRIDE_;
|
void setCursorBlinkTime(irr::u32 timeMs) override;
|
||||||
|
|
||||||
//! Get the cursor blinktime
|
//! Get the cursor blinktime
|
||||||
virtual irr::u32 getCursorBlinkTime() const _IRR_OVERRIDE_;
|
irr::u32 getCursorBlinkTime() const override;
|
||||||
|
|
||||||
//! Sets whether the edit box is a password box. Setting this to true will
|
//! Sets whether the edit box is a password box. Setting this to true will
|
||||||
/** disable MultiLine, WordWrap and the ability to copy with ctrl+c or ctrl+x
|
/** disable MultiLine, WordWrap and the ability to copy with ctrl+c or ctrl+x
|
||||||
\param passwordBox: true to enable password, false to disable
|
\param passwordBox: true to enable password, false to disable
|
||||||
\param passwordChar: the character that is displayed instead of letters */
|
\param passwordChar: the character that is displayed instead of letters */
|
||||||
virtual void setPasswordBox(bool passwordBox, wchar_t passwordChar = L'*') _IRR_OVERRIDE_;
|
void setPasswordBox(bool passwordBox, wchar_t passwordChar = L'*') override;
|
||||||
|
|
||||||
//! Returns true if the edit box is currently a password box.
|
//! Returns true if the edit box is currently a password box.
|
||||||
virtual bool isPasswordBox() const _IRR_OVERRIDE_;
|
bool isPasswordBox() const override;
|
||||||
|
|
||||||
//! Updates the absolute position, splits text if required
|
//! Updates the absolute position, splits text if required
|
||||||
virtual void updateAbsolutePosition() _IRR_OVERRIDE_;
|
void updateAbsolutePosition() override;
|
||||||
|
|
||||||
//! Returns whether the element takes input from the IME
|
//! Returns whether the element takes input from the IME
|
||||||
virtual bool acceptsIME() _IRR_OVERRIDE_;
|
bool acceptsIME() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//! Breaks the single text line.
|
//! Breaks the single text line.
|
||||||
|
@ -31,143 +31,143 @@ public:
|
|||||||
virtual ~CGUIEnvironment();
|
virtual ~CGUIEnvironment();
|
||||||
|
|
||||||
//! draws all gui elements
|
//! draws all gui elements
|
||||||
virtual void drawAll(bool useScreenSize) _IRR_OVERRIDE_;
|
void drawAll(bool useScreenSize) override;
|
||||||
|
|
||||||
//! returns the current video driver
|
//! returns the current video driver
|
||||||
virtual video::IVideoDriver* getVideoDriver() const _IRR_OVERRIDE_;
|
video::IVideoDriver* getVideoDriver() const override;
|
||||||
|
|
||||||
//! returns pointer to the filesystem
|
//! returns pointer to the filesystem
|
||||||
virtual io::IFileSystem* getFileSystem() const _IRR_OVERRIDE_;
|
io::IFileSystem* getFileSystem() const override;
|
||||||
|
|
||||||
//! returns a pointer to the OS operator
|
//! returns a pointer to the OS operator
|
||||||
virtual IOSOperator* getOSOperator() const _IRR_OVERRIDE_;
|
IOSOperator* getOSOperator() const override;
|
||||||
|
|
||||||
//! posts an input event to the environment
|
//! posts an input event to the environment
|
||||||
virtual bool postEventFromUser(const SEvent& event) _IRR_OVERRIDE_;
|
bool postEventFromUser(const SEvent& event) override;
|
||||||
|
|
||||||
//! This sets a new event receiver for gui events. Usually you do not have to
|
//! This sets a new event receiver for gui events. Usually you do not have to
|
||||||
//! use this method, it is used by the internal engine.
|
//! use this method, it is used by the internal engine.
|
||||||
virtual void setUserEventReceiver(IEventReceiver* evr) _IRR_OVERRIDE_;
|
void setUserEventReceiver(IEventReceiver* evr) override;
|
||||||
|
|
||||||
//! removes all elements from the environment
|
//! removes all elements from the environment
|
||||||
virtual void clear() _IRR_OVERRIDE_;
|
void clear() override;
|
||||||
|
|
||||||
//! called if an event happened.
|
//! called if an event happened.
|
||||||
virtual bool OnEvent(const SEvent& event) _IRR_OVERRIDE_;
|
bool OnEvent(const SEvent& event) override;
|
||||||
|
|
||||||
//! returns the current gui skin
|
//! returns the current gui skin
|
||||||
virtual IGUISkin* getSkin() const _IRR_OVERRIDE_;
|
IGUISkin* getSkin() const override;
|
||||||
|
|
||||||
//! Sets a new GUI Skin
|
//! Sets a new GUI Skin
|
||||||
virtual void setSkin(IGUISkin* skin) _IRR_OVERRIDE_;
|
void setSkin(IGUISkin* skin) override;
|
||||||
|
|
||||||
//! Creates a new GUI Skin based on a template.
|
//! Creates a new GUI Skin based on a template.
|
||||||
/** \return Returns a pointer to the created skin.
|
/** \return Returns a pointer to the created skin.
|
||||||
If you no longer need the skin, you should call IGUISkin::drop().
|
If you no longer need the skin, you should call IGUISkin::drop().
|
||||||
See IReferenceCounted::drop() for more information. */
|
See IReferenceCounted::drop() for more information. */
|
||||||
virtual IGUISkin* createSkin(EGUI_SKIN_TYPE type) _IRR_OVERRIDE_;
|
IGUISkin* createSkin(EGUI_SKIN_TYPE type) override;
|
||||||
|
|
||||||
//! Creates the image list from the given texture.
|
//! Creates the image list from the given texture.
|
||||||
virtual IGUIImageList* createImageList(video::ITexture* texture,
|
virtual IGUIImageList* createImageList(video::ITexture* texture,
|
||||||
core::dimension2d<s32> imageSize, bool useAlphaChannel) _IRR_OVERRIDE_;
|
core::dimension2d<s32> imageSize, bool useAlphaChannel) override;
|
||||||
|
|
||||||
//! returns the font
|
//! returns the font
|
||||||
virtual IGUIFont* getFont(const io::path& filename) _IRR_OVERRIDE_;
|
IGUIFont* getFont(const io::path& filename) override;
|
||||||
|
|
||||||
//! add an externally loaded font
|
//! add an externally loaded font
|
||||||
virtual IGUIFont* addFont(const io::path& name, IGUIFont* font) _IRR_OVERRIDE_;
|
IGUIFont* addFont(const io::path& name, IGUIFont* font) override;
|
||||||
|
|
||||||
//! remove loaded font
|
//! remove loaded font
|
||||||
virtual void removeFont(IGUIFont* font) _IRR_OVERRIDE_;
|
void removeFont(IGUIFont* font) override;
|
||||||
|
|
||||||
//! returns default font
|
//! returns default font
|
||||||
virtual IGUIFont* getBuiltInFont() const _IRR_OVERRIDE_;
|
IGUIFont* getBuiltInFont() const override;
|
||||||
|
|
||||||
//! returns the sprite bank
|
//! returns the sprite bank
|
||||||
virtual IGUISpriteBank* getSpriteBank(const io::path& filename) _IRR_OVERRIDE_;
|
IGUISpriteBank* getSpriteBank(const io::path& filename) override;
|
||||||
|
|
||||||
//! returns the sprite bank
|
//! returns the sprite bank
|
||||||
virtual IGUISpriteBank* addEmptySpriteBank(const io::path& name) _IRR_OVERRIDE_;
|
IGUISpriteBank* addEmptySpriteBank(const io::path& name) override;
|
||||||
|
|
||||||
//! adds an button. The returned pointer must not be dropped.
|
//! adds an button. The returned pointer must not be dropped.
|
||||||
virtual IGUIButton* addButton(const core::rect<s32>& rectangle, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0,const wchar_t* tooltiptext = 0) _IRR_OVERRIDE_;
|
IGUIButton* addButton(const core::rect<s32>& rectangle, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0,const wchar_t* tooltiptext = 0) override;
|
||||||
|
|
||||||
//! adds a scrollbar. The returned pointer must not be dropped.
|
//! adds a scrollbar. The returned pointer must not be dropped.
|
||||||
virtual IGUIScrollBar* addScrollBar(bool horizontal, const core::rect<s32>& rectangle,
|
virtual IGUIScrollBar* addScrollBar(bool horizontal, const core::rect<s32>& rectangle,
|
||||||
IGUIElement* parent=0, s32 id=-1) _IRR_OVERRIDE_;
|
IGUIElement* parent=0, s32 id=-1) override;
|
||||||
|
|
||||||
//! Adds an image element.
|
//! Adds an image element.
|
||||||
virtual IGUIImage* addImage(video::ITexture* image, core::position2d<s32> pos,
|
virtual IGUIImage* addImage(video::ITexture* image, core::position2d<s32> pos,
|
||||||
bool useAlphaChannel=true, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) _IRR_OVERRIDE_;
|
bool useAlphaChannel=true, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) override;
|
||||||
|
|
||||||
//! adds an image. The returned pointer must not be dropped.
|
//! adds an image. The returned pointer must not be dropped.
|
||||||
virtual IGUIImage* addImage(const core::rect<s32>& rectangle,
|
virtual IGUIImage* addImage(const core::rect<s32>& rectangle,
|
||||||
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, bool useAlphaChannel=true) _IRR_OVERRIDE_;
|
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, bool useAlphaChannel=true) override;
|
||||||
|
|
||||||
//! adds a checkbox
|
//! adds a checkbox
|
||||||
virtual IGUICheckBox* addCheckBox(bool checked, const core::rect<s32>& rectangle,
|
virtual IGUICheckBox* addCheckBox(bool checked, const core::rect<s32>& rectangle,
|
||||||
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) _IRR_OVERRIDE_;
|
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) override;
|
||||||
|
|
||||||
//! adds a list box
|
//! adds a list box
|
||||||
virtual IGUIListBox* addListBox(const core::rect<s32>& rectangle,
|
virtual IGUIListBox* addListBox(const core::rect<s32>& rectangle,
|
||||||
IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) _IRR_OVERRIDE_;
|
IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) override;
|
||||||
|
|
||||||
//! Adds a file open dialog.
|
//! Adds a file open dialog.
|
||||||
virtual IGUIFileOpenDialog* addFileOpenDialog(const wchar_t* title = 0,
|
virtual IGUIFileOpenDialog* addFileOpenDialog(const wchar_t* title = 0,
|
||||||
bool modal=true, IGUIElement* parent=0, s32 id=-1,
|
bool modal=true, IGUIElement* parent=0, s32 id=-1,
|
||||||
bool restoreCWD=false, io::path::char_type* startDir=0) _IRR_OVERRIDE_;
|
bool restoreCWD=false, io::path::char_type* startDir=0) override;
|
||||||
|
|
||||||
//! adds a static text. The returned pointer must not be dropped.
|
//! adds a static text. The returned pointer must not be dropped.
|
||||||
virtual IGUIStaticText* addStaticText(const wchar_t* text, const core::rect<s32>& rectangle,
|
virtual IGUIStaticText* addStaticText(const wchar_t* text, const core::rect<s32>& rectangle,
|
||||||
bool border=false, bool wordWrap=true, IGUIElement* parent=0, s32 id=-1, bool drawBackground = false) _IRR_OVERRIDE_;
|
bool border=false, bool wordWrap=true, IGUIElement* parent=0, s32 id=-1, bool drawBackground = false) override;
|
||||||
|
|
||||||
//! Adds an edit box. The returned pointer must not be dropped.
|
//! Adds an edit box. The returned pointer must not be dropped.
|
||||||
virtual IGUIEditBox* addEditBox(const wchar_t* text, const core::rect<s32>& rectangle,
|
virtual IGUIEditBox* addEditBox(const wchar_t* text, const core::rect<s32>& rectangle,
|
||||||
bool border=false, IGUIElement* parent=0, s32 id=-1) _IRR_OVERRIDE_;
|
bool border=false, IGUIElement* parent=0, s32 id=-1) override;
|
||||||
|
|
||||||
//! Adds a tab control to the environment.
|
//! Adds a tab control to the environment.
|
||||||
virtual IGUITabControl* addTabControl(const core::rect<s32>& rectangle,
|
virtual IGUITabControl* addTabControl(const core::rect<s32>& rectangle,
|
||||||
IGUIElement* parent=0, bool fillbackground=false, bool border=true, s32 id=-1) _IRR_OVERRIDE_;
|
IGUIElement* parent=0, bool fillbackground=false, bool border=true, s32 id=-1) override;
|
||||||
|
|
||||||
//! Adds tab to the environment.
|
//! Adds tab to the environment.
|
||||||
virtual IGUITab* addTab(const core::rect<s32>& rectangle,
|
virtual IGUITab* addTab(const core::rect<s32>& rectangle,
|
||||||
IGUIElement* parent=0, s32 id=-1) _IRR_OVERRIDE_;
|
IGUIElement* parent=0, s32 id=-1) override;
|
||||||
|
|
||||||
//! Adds a combo box to the environment.
|
//! Adds a combo box to the environment.
|
||||||
virtual IGUIComboBox* addComboBox(const core::rect<s32>& rectangle,
|
virtual IGUIComboBox* addComboBox(const core::rect<s32>& rectangle,
|
||||||
IGUIElement* parent=0, s32 id=-1) _IRR_OVERRIDE_;
|
IGUIElement* parent=0, s32 id=-1) override;
|
||||||
|
|
||||||
//! sets the focus to an element
|
//! sets the focus to an element
|
||||||
virtual bool setFocus(IGUIElement* element) _IRR_OVERRIDE_;
|
bool setFocus(IGUIElement* element) override;
|
||||||
|
|
||||||
//! removes the focus from an element
|
//! removes the focus from an element
|
||||||
virtual bool removeFocus(IGUIElement* element) _IRR_OVERRIDE_;
|
bool removeFocus(IGUIElement* element) override;
|
||||||
|
|
||||||
//! Returns if the element has focus
|
//! Returns if the element has focus
|
||||||
virtual bool hasFocus(const IGUIElement* element, bool checkSubElements=false) const _IRR_OVERRIDE_;
|
bool hasFocus(const IGUIElement* element, bool checkSubElements=false) const override;
|
||||||
|
|
||||||
//! Returns the element with the focus
|
//! Returns the element with the focus
|
||||||
virtual IGUIElement* getFocus() const _IRR_OVERRIDE_;
|
IGUIElement* getFocus() const override;
|
||||||
|
|
||||||
//! Returns the element last known to be under the mouse
|
//! Returns the element last known to be under the mouse
|
||||||
virtual IGUIElement* getHovered() const _IRR_OVERRIDE_;
|
IGUIElement* getHovered() const override;
|
||||||
|
|
||||||
//! Returns the root gui element.
|
//! Returns the root gui element.
|
||||||
virtual IGUIElement* getRootGUIElement() _IRR_OVERRIDE_;
|
IGUIElement* getRootGUIElement() override;
|
||||||
|
|
||||||
virtual void OnPostRender( u32 time ) _IRR_OVERRIDE_;
|
void OnPostRender( u32 time ) override;
|
||||||
|
|
||||||
//! Find the next element which would be selected when pressing the tab-key
|
//! Find the next element which would be selected when pressing the tab-key
|
||||||
virtual IGUIElement* getNextElement(bool reverse=false, bool group=false) _IRR_OVERRIDE_;
|
IGUIElement* getNextElement(bool reverse=false, bool group=false) override;
|
||||||
|
|
||||||
//! Set the way the gui will handle focus changes
|
//! Set the way the gui will handle focus changes
|
||||||
virtual void setFocusBehavior(u32 flags) _IRR_OVERRIDE_;
|
void setFocusBehavior(u32 flags) override;
|
||||||
|
|
||||||
//! Get the way the gui does handle focus changes
|
//! Get the way the gui does handle focus changes
|
||||||
virtual u32 getFocusBehavior() const _IRR_OVERRIDE_;
|
u32 getFocusBehavior() const override;
|
||||||
|
|
||||||
//! Adds a IGUIElement to deletion queue.
|
//! Adds a IGUIElement to deletion queue.
|
||||||
virtual void addToDeletionQueue(IGUIElement* element) _IRR_OVERRIDE_;
|
void addToDeletionQueue(IGUIElement* element) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ CGUIFileOpenDialog::CGUIFileOpenDialog(const wchar_t* title,
|
|||||||
L"", skin ? skin->getDefaultText(EGDT_WINDOW_CLOSE) : L"Close");
|
L"", skin ? skin->getDefaultText(EGDT_WINDOW_CLOSE) : L"Close");
|
||||||
CloseButton->setSubElement(true);
|
CloseButton->setSubElement(true);
|
||||||
CloseButton->setTabStop(false);
|
CloseButton->setTabStop(false);
|
||||||
if (sprites)
|
if (sprites && skin)
|
||||||
{
|
{
|
||||||
CloseButton->setSpriteBank(sprites);
|
CloseButton->setSpriteBank(sprites);
|
||||||
CloseButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_WINDOW_CLOSE), color);
|
CloseButton->setSprite(EGBS_BUTTON_UP, skin->getIcon(EGDI_WINDOW_CLOSE), color);
|
||||||
|
@ -32,22 +32,22 @@ namespace gui
|
|||||||
virtual ~CGUIFileOpenDialog();
|
virtual ~CGUIFileOpenDialog();
|
||||||
|
|
||||||
//! returns the filename of the selected file. Returns NULL, if no file was selected.
|
//! returns the filename of the selected file. Returns NULL, if no file was selected.
|
||||||
virtual const wchar_t* getFileName() const _IRR_OVERRIDE_;
|
const wchar_t* getFileName() const override;
|
||||||
|
|
||||||
//! Returns the filename of the selected file. Is empty if no file was selected.
|
//! Returns the filename of the selected file. Is empty if no file was selected.
|
||||||
virtual const io::path& getFileNameP() const _IRR_OVERRIDE_;
|
const io::path& getFileNameP() const override;
|
||||||
|
|
||||||
//! Returns the directory of the selected file. Returns NULL, if no directory was selected.
|
//! Returns the directory of the selected file. Returns NULL, if no directory was selected.
|
||||||
virtual const io::path& getDirectoryName() const _IRR_OVERRIDE_;
|
const io::path& getDirectoryName() const override;
|
||||||
|
|
||||||
//! Returns the directory of the selected file converted to wide characters. Returns NULL if no directory was selected.
|
//! Returns the directory of the selected file converted to wide characters. Returns NULL if no directory was selected.
|
||||||
virtual const wchar_t* getDirectoryNameW() const _IRR_OVERRIDE_;
|
const wchar_t* getDirectoryNameW() const override;
|
||||||
|
|
||||||
//! called if an event happened.
|
//! 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
|
//! draws the element and its children
|
||||||
virtual void draw() _IRR_OVERRIDE_;
|
void draw() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -47,32 +47,32 @@ public:
|
|||||||
//! draws an text and clips it to the specified rectangle if wanted
|
//! draws an text and clips it to the specified rectangle if wanted
|
||||||
virtual void draw(const core::stringw& text, const core::rect<s32>& position,
|
virtual void draw(const core::stringw& text, const core::rect<s32>& position,
|
||||||
video::SColor color, bool hcenter=false,
|
video::SColor color, bool hcenter=false,
|
||||||
bool vcenter=false, const core::rect<s32>* clip=0) _IRR_OVERRIDE_;
|
bool vcenter=false, const core::rect<s32>* clip=0) override;
|
||||||
|
|
||||||
//! returns the dimension of a text
|
//! returns the dimension of a text
|
||||||
virtual core::dimension2d<u32> getDimension(const wchar_t* text) const _IRR_OVERRIDE_;
|
core::dimension2d<u32> getDimension(const wchar_t* text) const override;
|
||||||
|
|
||||||
//! Calculates the index of the character in the text which is on a specific position.
|
//! Calculates the index of the character in the text which is on a specific position.
|
||||||
virtual s32 getCharacterFromPos(const wchar_t* text, s32 pixel_x) const _IRR_OVERRIDE_;
|
s32 getCharacterFromPos(const wchar_t* text, s32 pixel_x) const override;
|
||||||
|
|
||||||
//! Returns the type of this font
|
//! 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; }
|
||||||
|
|
||||||
//! set an Pixel Offset on Drawing ( scale position on width )
|
//! set an Pixel Offset on Drawing ( scale position on width )
|
||||||
virtual void setKerningWidth (s32 kerning) _IRR_OVERRIDE_;
|
void setKerningWidth (s32 kerning) override;
|
||||||
virtual void setKerningHeight (s32 kerning) _IRR_OVERRIDE_;
|
void setKerningHeight (s32 kerning) override;
|
||||||
|
|
||||||
//! set an Pixel Offset on Drawing ( scale position on width )
|
//! set an Pixel Offset on Drawing ( scale position on width )
|
||||||
virtual s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) const _IRR_OVERRIDE_;
|
s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) const override;
|
||||||
virtual s32 getKerningHeight() const _IRR_OVERRIDE_;
|
s32 getKerningHeight() const override;
|
||||||
|
|
||||||
//! gets the sprite bank
|
//! gets the sprite bank
|
||||||
virtual IGUISpriteBank* getSpriteBank() const _IRR_OVERRIDE_;
|
IGUISpriteBank* getSpriteBank() const override;
|
||||||
|
|
||||||
//! returns the sprite number from a given character
|
//! returns the sprite number from a given character
|
||||||
virtual u32 getSpriteNoFromChar(const wchar_t *c) const _IRR_OVERRIDE_;
|
u32 getSpriteNoFromChar(const wchar_t *c) const override;
|
||||||
|
|
||||||
virtual void setInvisibleCharacters( const wchar_t *s ) _IRR_OVERRIDE_;
|
void setInvisibleCharacters( const wchar_t *s ) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -26,52 +26,52 @@ namespace gui
|
|||||||
virtual ~CGUIImage();
|
virtual ~CGUIImage();
|
||||||
|
|
||||||
//! sets an image
|
//! sets an image
|
||||||
virtual void setImage(video::ITexture* image) _IRR_OVERRIDE_;
|
void setImage(video::ITexture* image) override;
|
||||||
|
|
||||||
//! Gets the image texture
|
//! Gets the image texture
|
||||||
virtual video::ITexture* getImage() const _IRR_OVERRIDE_;
|
video::ITexture* getImage() const override;
|
||||||
|
|
||||||
//! sets the color of the image
|
//! sets the color of the image
|
||||||
virtual void setColor(video::SColor color) _IRR_OVERRIDE_;
|
void setColor(video::SColor color) override;
|
||||||
|
|
||||||
//! sets if the image should scale to fit the element
|
//! sets if the image should scale to fit the element
|
||||||
virtual void setScaleImage(bool scale) _IRR_OVERRIDE_;
|
void setScaleImage(bool scale) override;
|
||||||
|
|
||||||
//! draws the element and its children
|
//! draws the element and its children
|
||||||
virtual void draw() _IRR_OVERRIDE_;
|
void draw() override;
|
||||||
|
|
||||||
//! sets if the image should use its alpha channel to draw itself
|
//! sets if the image should use its alpha channel to draw itself
|
||||||
virtual void setUseAlphaChannel(bool use) _IRR_OVERRIDE_;
|
void setUseAlphaChannel(bool use) override;
|
||||||
|
|
||||||
//! Gets the color of the image
|
//! Gets the color of the image
|
||||||
virtual video::SColor getColor() const _IRR_OVERRIDE_;
|
video::SColor getColor() const override;
|
||||||
|
|
||||||
//! Returns true if the image is scaled to fit, false if not
|
//! Returns true if the image is scaled to fit, false if not
|
||||||
virtual bool isImageScaled() const _IRR_OVERRIDE_;
|
bool isImageScaled() const override;
|
||||||
|
|
||||||
//! Returns true if the image is using the alpha channel, false if not
|
//! Returns true if the image is using the alpha channel, false if not
|
||||||
virtual bool isAlphaChannelUsed() const _IRR_OVERRIDE_;
|
bool isAlphaChannelUsed() const override;
|
||||||
|
|
||||||
//! Sets the source rectangle of the image. By default the full image is used.
|
//! Sets the source rectangle of the image. By default the full image is used.
|
||||||
virtual void setSourceRect(const core::rect<s32>& sourceRect) _IRR_OVERRIDE_;
|
void setSourceRect(const core::rect<s32>& sourceRect) override;
|
||||||
|
|
||||||
//! Returns the customized source rectangle of the image to be used.
|
//! Returns the customized source rectangle of the image to be used.
|
||||||
virtual core::rect<s32> getSourceRect() const _IRR_OVERRIDE_;
|
core::rect<s32> getSourceRect() const override;
|
||||||
|
|
||||||
//! Restrict drawing-area.
|
//! Restrict drawing-area.
|
||||||
virtual void setDrawBounds(const core::rect<f32>& drawBoundUVs) _IRR_OVERRIDE_;
|
void setDrawBounds(const core::rect<f32>& drawBoundUVs) override;
|
||||||
|
|
||||||
//! Get drawing-area restrictions.
|
//! Get drawing-area restrictions.
|
||||||
virtual core::rect<f32> getDrawBounds() const _IRR_OVERRIDE_;
|
core::rect<f32> getDrawBounds() const override;
|
||||||
|
|
||||||
//! Sets whether to draw a background color (EGDC_3D_DARK_SHADOW) when no texture is set
|
//! Sets whether to draw a background color (EGDC_3D_DARK_SHADOW) when no texture is set
|
||||||
virtual void setDrawBackground(bool draw) _IRR_OVERRIDE_
|
void setDrawBackground(bool draw) override
|
||||||
{
|
{
|
||||||
DrawBackground = draw;
|
DrawBackground = draw;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Checks if a background is drawn when no texture is set
|
//! Checks if a background is drawn when no texture is set
|
||||||
virtual bool isDrawBackgroundEnabled() const _IRR_OVERRIDE_
|
bool isDrawBackgroundEnabled() const override
|
||||||
{
|
{
|
||||||
return DrawBackground;
|
return DrawBackground;
|
||||||
}
|
}
|
||||||
|
@ -38,16 +38,16 @@ public:
|
|||||||
//! \param clip: Optional pointer to a rectangle against which the text will be clipped.
|
//! \param clip: Optional pointer to a rectangle against which the text will be clipped.
|
||||||
//! If the pointer is null, no clipping will be done.
|
//! If the pointer is null, no clipping will be done.
|
||||||
virtual void draw( s32 index, const core::position2d<s32>& destPos,
|
virtual void draw( s32 index, const core::position2d<s32>& destPos,
|
||||||
const core::rect<s32>* clip = 0 ) _IRR_OVERRIDE_;
|
const core::rect<s32>* clip = 0 ) override;
|
||||||
|
|
||||||
//! Returns the count of Images in the list.
|
//! Returns the count of Images in the list.
|
||||||
//! \return Returns the count of Images in the list.
|
//! \return Returns the count of Images in the list.
|
||||||
virtual s32 getImageCount() const _IRR_OVERRIDE_
|
s32 getImageCount() const override
|
||||||
{ return ImageCount; }
|
{ return ImageCount; }
|
||||||
|
|
||||||
//! Returns the size of the images in the list.
|
//! Returns the size of the images in the list.
|
||||||
//! \return Returns the size of the images in the list.
|
//! \return Returns the size of the images in the list.
|
||||||
virtual core::dimension2d<s32> getImageSize() const _IRR_OVERRIDE_
|
core::dimension2d<s32> getImageSize() const override
|
||||||
{ return ImageSize; }
|
{ return ImageSize; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -31,102 +31,102 @@ namespace gui
|
|||||||
virtual ~CGUIListBox();
|
virtual ~CGUIListBox();
|
||||||
|
|
||||||
//! returns amount of list items
|
//! returns amount of list items
|
||||||
virtual u32 getItemCount() const _IRR_OVERRIDE_;
|
u32 getItemCount() const override;
|
||||||
|
|
||||||
//! returns string of a list item. the id may be a value from 0 to itemCount-1
|
//! returns string of a list item. the id may be a value from 0 to itemCount-1
|
||||||
virtual const wchar_t* getListItem(u32 id) const _IRR_OVERRIDE_;
|
const wchar_t* getListItem(u32 id) const override;
|
||||||
|
|
||||||
//! adds an list item, returns id of item
|
//! adds an list item, returns id of item
|
||||||
virtual u32 addItem(const wchar_t* text) _IRR_OVERRIDE_;
|
u32 addItem(const wchar_t* text) override;
|
||||||
|
|
||||||
//! clears the list
|
//! clears the list
|
||||||
virtual void clear() _IRR_OVERRIDE_;
|
void clear() override;
|
||||||
|
|
||||||
//! returns id of selected item. returns -1 if no item is selected.
|
//! 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
|
//! sets the selected item. Set this to -1 if no item should be selected
|
||||||
virtual void setSelected(s32 id) _IRR_OVERRIDE_;
|
void setSelected(s32 id) override;
|
||||||
|
|
||||||
//! sets the selected item. Set this to -1 if no item should be selected
|
//! sets the selected item. Set this to -1 if no item should be selected
|
||||||
virtual void setSelected(const wchar_t *item) _IRR_OVERRIDE_;
|
void setSelected(const wchar_t *item) override;
|
||||||
|
|
||||||
//! called if an event happened.
|
//! 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
|
//! draws the element and its children
|
||||||
virtual void draw() _IRR_OVERRIDE_;
|
void draw() override;
|
||||||
|
|
||||||
//! adds an list item with an icon
|
//! adds an list item with an icon
|
||||||
//! \param text Text of list entry
|
//! \param text Text of list entry
|
||||||
//! \param icon Sprite index of the Icon within the current sprite bank. Set it to -1 if you want no icon
|
//! \param icon Sprite index of the Icon within the current sprite bank. Set it to -1 if you want no icon
|
||||||
//! \return
|
//! \return
|
||||||
//! returns the id of the new created item
|
//! returns the id of the new created item
|
||||||
virtual u32 addItem(const wchar_t* text, s32 icon) _IRR_OVERRIDE_;
|
u32 addItem(const wchar_t* text, s32 icon) override;
|
||||||
|
|
||||||
//! Returns the icon of an item
|
//! Returns the icon of an item
|
||||||
virtual s32 getIcon(u32 id) const _IRR_OVERRIDE_;
|
s32 getIcon(u32 id) const override;
|
||||||
|
|
||||||
//! removes an item from the list
|
//! removes an item from the list
|
||||||
virtual void removeItem(u32 id) _IRR_OVERRIDE_;
|
void removeItem(u32 id) override;
|
||||||
|
|
||||||
//! get the the id of the item at the given absolute coordinates
|
//! get the the id of the item at the given absolute coordinates
|
||||||
virtual s32 getItemAt(s32 xpos, s32 ypos) const _IRR_OVERRIDE_;
|
s32 getItemAt(s32 xpos, s32 ypos) const override;
|
||||||
|
|
||||||
//! Sets the sprite bank which should be used to draw list icons. This font is set to the sprite bank of
|
//! Sets the sprite bank which should be used to draw list icons. This font is set to the sprite bank of
|
||||||
//! the built-in-font by default. A sprite can be displayed in front of every list item.
|
//! the built-in-font by default. A sprite can be displayed in front of every list item.
|
||||||
//! An icon is an index within the icon sprite bank. Several default icons are available in the
|
//! An icon is an index within the icon sprite bank. Several default icons are available in the
|
||||||
//! skin through getIcon
|
//! skin through getIcon
|
||||||
virtual void setSpriteBank(IGUISpriteBank* bank) _IRR_OVERRIDE_;
|
void setSpriteBank(IGUISpriteBank* bank) override;
|
||||||
|
|
||||||
//! set whether the listbox should scroll to newly selected items
|
//! set whether the listbox should scroll to newly selected items
|
||||||
virtual void setAutoScrollEnabled(bool scroll) _IRR_OVERRIDE_;
|
void setAutoScrollEnabled(bool scroll) override;
|
||||||
|
|
||||||
//! returns true if automatic scrolling is enabled, false if not.
|
//! returns true if automatic scrolling is enabled, false if not.
|
||||||
virtual bool isAutoScrollEnabled() const _IRR_OVERRIDE_;
|
bool isAutoScrollEnabled() const override;
|
||||||
|
|
||||||
//! Update the position and size of the listbox, and update the scrollbar
|
//! Update the position and size of the listbox, and update the scrollbar
|
||||||
virtual void updateAbsolutePosition() _IRR_OVERRIDE_;
|
void updateAbsolutePosition() override;
|
||||||
|
|
||||||
//! set all item colors at given index to color
|
//! set all item colors at given index to color
|
||||||
virtual void setItemOverrideColor(u32 index, video::SColor color) _IRR_OVERRIDE_;
|
void setItemOverrideColor(u32 index, video::SColor color) override;
|
||||||
|
|
||||||
//! set all item colors of specified type at given index to color
|
//! set all item colors of specified type at given index to color
|
||||||
virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color) _IRR_OVERRIDE_;
|
void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color) override;
|
||||||
|
|
||||||
//! clear all item colors at index
|
//! clear all item colors at index
|
||||||
virtual void clearItemOverrideColor(u32 index) _IRR_OVERRIDE_;
|
void clearItemOverrideColor(u32 index) override;
|
||||||
|
|
||||||
//! clear item color at index for given colortype
|
//! clear item color at index for given colortype
|
||||||
virtual void clearItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) _IRR_OVERRIDE_;
|
void clearItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) override;
|
||||||
|
|
||||||
//! has the item at index its color overwritten?
|
//! has the item at index its color overwritten?
|
||||||
virtual bool hasItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const _IRR_OVERRIDE_;
|
bool hasItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const override;
|
||||||
|
|
||||||
//! return the overwrite color at given item index.
|
//! return the overwrite color at given item index.
|
||||||
virtual video::SColor getItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const _IRR_OVERRIDE_;
|
video::SColor getItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const override;
|
||||||
|
|
||||||
//! return the default color which is used for the given colorType
|
//! return the default color which is used for the given colorType
|
||||||
virtual video::SColor getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) const _IRR_OVERRIDE_;
|
video::SColor getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) const override;
|
||||||
|
|
||||||
//! set the item at the given index
|
//! set the item at the given index
|
||||||
virtual void setItem(u32 index, const wchar_t* text, s32 icon) _IRR_OVERRIDE_;
|
void setItem(u32 index, const wchar_t* text, s32 icon) override;
|
||||||
|
|
||||||
//! Insert the item at the given index
|
//! Insert the item at the given index
|
||||||
//! Return the index on success or -1 on failure.
|
//! Return the index on success or -1 on failure.
|
||||||
virtual s32 insertItem(u32 index, const wchar_t* text, s32 icon) _IRR_OVERRIDE_;
|
s32 insertItem(u32 index, const wchar_t* text, s32 icon) override;
|
||||||
|
|
||||||
//! Swap the items at the given indices
|
//! Swap the items at the given indices
|
||||||
virtual void swapItems(u32 index1, u32 index2) _IRR_OVERRIDE_;
|
void swapItems(u32 index1, u32 index2) override;
|
||||||
|
|
||||||
//! set global itemHeight
|
//! set global itemHeight
|
||||||
virtual void setItemHeight( s32 height ) _IRR_OVERRIDE_;
|
void setItemHeight( s32 height ) override;
|
||||||
|
|
||||||
//! Sets whether to draw the background
|
//! Sets whether to draw the background
|
||||||
virtual void setDrawBackground(bool draw) _IRR_OVERRIDE_;
|
void setDrawBackground(bool draw) override;
|
||||||
|
|
||||||
//! Access the vertical scrollbar
|
//! Access the vertical scrollbar
|
||||||
virtual IGUIScrollBar* getVerticalScrollBar() const _IRR_OVERRIDE_;
|
IGUIScrollBar* getVerticalScrollBar() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -29,46 +29,46 @@ namespace gui
|
|||||||
virtual ~CGUIScrollBar();
|
virtual ~CGUIScrollBar();
|
||||||
|
|
||||||
//! called if an event happened.
|
//! 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
|
//! draws the element and its children
|
||||||
virtual void draw() _IRR_OVERRIDE_;
|
void draw() override;
|
||||||
|
|
||||||
virtual void OnPostRender(u32 timeMs) _IRR_OVERRIDE_;
|
void OnPostRender(u32 timeMs) override;
|
||||||
|
|
||||||
|
|
||||||
//! gets the maximum value of the scrollbar.
|
//! gets the maximum value of the scrollbar.
|
||||||
virtual s32 getMax() const _IRR_OVERRIDE_;
|
s32 getMax() const override;
|
||||||
|
|
||||||
//! sets the maximum value of the scrollbar.
|
//! sets the maximum value of the scrollbar.
|
||||||
virtual void setMax(s32 max) _IRR_OVERRIDE_;
|
void setMax(s32 max) override;
|
||||||
|
|
||||||
//! gets the minimum value of the scrollbar.
|
//! gets the minimum value of the scrollbar.
|
||||||
virtual s32 getMin() const _IRR_OVERRIDE_;
|
s32 getMin() const override;
|
||||||
|
|
||||||
//! sets the minimum value of the scrollbar.
|
//! sets the minimum value of the scrollbar.
|
||||||
virtual void setMin(s32 min) _IRR_OVERRIDE_;
|
void setMin(s32 min) override;
|
||||||
|
|
||||||
//! gets the small step value
|
//! gets the small step value
|
||||||
virtual s32 getSmallStep() const _IRR_OVERRIDE_;
|
s32 getSmallStep() const override;
|
||||||
|
|
||||||
//! sets the small step value
|
//! sets the small step value
|
||||||
virtual void setSmallStep(s32 step) _IRR_OVERRIDE_;
|
void setSmallStep(s32 step) override;
|
||||||
|
|
||||||
//! gets the large step value
|
//! gets the large step value
|
||||||
virtual s32 getLargeStep() const _IRR_OVERRIDE_;
|
s32 getLargeStep() const override;
|
||||||
|
|
||||||
//! sets the large step value
|
//! sets the large step value
|
||||||
virtual void setLargeStep(s32 step) _IRR_OVERRIDE_;
|
void setLargeStep(s32 step) override;
|
||||||
|
|
||||||
//! gets the current position of the scrollbar
|
//! gets the current position of the scrollbar
|
||||||
virtual s32 getPos() const _IRR_OVERRIDE_;
|
s32 getPos() const override;
|
||||||
|
|
||||||
//! sets the position of the scrollbar
|
//! sets the position of the scrollbar
|
||||||
virtual void setPos(s32 pos) _IRR_OVERRIDE_;
|
void setPos(s32 pos) override;
|
||||||
|
|
||||||
//! updates the rectangle
|
//! updates the rectangle
|
||||||
virtual void updateAbsolutePosition() _IRR_OVERRIDE_;
|
void updateAbsolutePosition() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -30,49 +30,49 @@ namespace gui
|
|||||||
virtual ~CGUISkin();
|
virtual ~CGUISkin();
|
||||||
|
|
||||||
//! returns default color
|
//! returns default color
|
||||||
virtual video::SColor getColor(EGUI_DEFAULT_COLOR color) const _IRR_OVERRIDE_;
|
video::SColor getColor(EGUI_DEFAULT_COLOR color) const override;
|
||||||
|
|
||||||
//! sets a default color
|
//! sets a default color
|
||||||
virtual void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor) _IRR_OVERRIDE_;
|
void setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor) override;
|
||||||
|
|
||||||
//! returns size for the given size type
|
//! returns size for the given size type
|
||||||
virtual s32 getSize(EGUI_DEFAULT_SIZE size) const _IRR_OVERRIDE_;
|
s32 getSize(EGUI_DEFAULT_SIZE size) const override;
|
||||||
|
|
||||||
//! sets a default size
|
//! sets a default size
|
||||||
virtual void setSize(EGUI_DEFAULT_SIZE which, s32 size) _IRR_OVERRIDE_;
|
void setSize(EGUI_DEFAULT_SIZE which, s32 size) override;
|
||||||
|
|
||||||
//! returns the default font
|
//! returns the default font
|
||||||
virtual IGUIFont* getFont(EGUI_DEFAULT_FONT which=EGDF_DEFAULT) const _IRR_OVERRIDE_;
|
IGUIFont* getFont(EGUI_DEFAULT_FONT which=EGDF_DEFAULT) const override;
|
||||||
|
|
||||||
//! sets a default font
|
//! sets a default font
|
||||||
virtual void setFont(IGUIFont* font, EGUI_DEFAULT_FONT which=EGDF_DEFAULT) _IRR_OVERRIDE_;
|
void setFont(IGUIFont* font, EGUI_DEFAULT_FONT which=EGDF_DEFAULT) override;
|
||||||
|
|
||||||
//! sets the sprite bank used for drawing icons
|
//! sets the sprite bank used for drawing icons
|
||||||
virtual void setSpriteBank(IGUISpriteBank* bank) _IRR_OVERRIDE_;
|
void setSpriteBank(IGUISpriteBank* bank) override;
|
||||||
|
|
||||||
//! gets the sprite bank used for drawing icons
|
//! gets the sprite bank used for drawing icons
|
||||||
virtual IGUISpriteBank* getSpriteBank() const _IRR_OVERRIDE_;
|
IGUISpriteBank* getSpriteBank() const override;
|
||||||
|
|
||||||
//! Returns a default icon
|
//! Returns a default icon
|
||||||
/** Returns the sprite index within the sprite bank */
|
/** Returns the sprite index within the sprite bank */
|
||||||
virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const _IRR_OVERRIDE_;
|
u32 getIcon(EGUI_DEFAULT_ICON icon) const override;
|
||||||
|
|
||||||
//! Sets a default icon
|
//! Sets a default icon
|
||||||
/** Sets the sprite index used for drawing icons like arrows,
|
/** Sets the sprite index used for drawing icons like arrows,
|
||||||
close buttons and ticks in checkboxes
|
close buttons and ticks in checkboxes
|
||||||
\param icon: Enum specifying which icon to change
|
\param icon: Enum specifying which icon to change
|
||||||
\param index: The sprite index used to draw this icon */
|
\param index: The sprite index used to draw this icon */
|
||||||
virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index) _IRR_OVERRIDE_;
|
void setIcon(EGUI_DEFAULT_ICON icon, u32 index) override;
|
||||||
|
|
||||||
//! Returns a default text.
|
//! Returns a default text.
|
||||||
/** For example for Message box button captions:
|
/** For example for Message box button captions:
|
||||||
"OK", "Cancel", "Yes", "No" and so on. */
|
"OK", "Cancel", "Yes", "No" and so on. */
|
||||||
virtual const wchar_t* getDefaultText(EGUI_DEFAULT_TEXT text) const _IRR_OVERRIDE_;
|
const wchar_t* getDefaultText(EGUI_DEFAULT_TEXT text) const override;
|
||||||
|
|
||||||
//! Sets a default text.
|
//! Sets a default text.
|
||||||
/** For example for Message box button captions:
|
/** For example for Message box button captions:
|
||||||
"OK", "Cancel", "Yes", "No" and so on. */
|
"OK", "Cancel", "Yes", "No" and so on. */
|
||||||
virtual void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t* newText) _IRR_OVERRIDE_;
|
void setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t* newText) override;
|
||||||
|
|
||||||
//! draws a standard 3d button pane
|
//! draws a standard 3d button pane
|
||||||
/** Used for drawing for example buttons in normal state.
|
/** Used for drawing for example buttons in normal state.
|
||||||
@ -85,7 +85,7 @@ namespace gui
|
|||||||
implementations to find out how to draw the part exactly. */
|
implementations to find out how to draw the part exactly. */
|
||||||
virtual void draw3DButtonPaneStandard(IGUIElement* element,
|
virtual void draw3DButtonPaneStandard(IGUIElement* element,
|
||||||
const core::rect<s32>& rect,
|
const core::rect<s32>& rect,
|
||||||
const core::rect<s32>* clip=0) _IRR_OVERRIDE_;
|
const core::rect<s32>* clip=0) override;
|
||||||
|
|
||||||
//! draws a pressed 3d button pane
|
//! draws a pressed 3d button pane
|
||||||
/** Used for drawing for example buttons in pressed state.
|
/** Used for drawing for example buttons in pressed state.
|
||||||
@ -98,7 +98,7 @@ namespace gui
|
|||||||
implementations to find out how to draw the part exactly. */
|
implementations to find out how to draw the part exactly. */
|
||||||
virtual void draw3DButtonPanePressed(IGUIElement* element,
|
virtual void draw3DButtonPanePressed(IGUIElement* element,
|
||||||
const core::rect<s32>& rect,
|
const core::rect<s32>& rect,
|
||||||
const core::rect<s32>* clip=0) _IRR_OVERRIDE_;
|
const core::rect<s32>* clip=0) override;
|
||||||
|
|
||||||
//! draws a sunken 3d pane
|
//! draws a sunken 3d pane
|
||||||
/** Used for drawing the background of edit, combo or check boxes.
|
/** Used for drawing the background of edit, combo or check boxes.
|
||||||
@ -114,7 +114,7 @@ namespace gui
|
|||||||
video::SColor bgcolor, bool flat,
|
video::SColor bgcolor, bool flat,
|
||||||
bool fillBackGround,
|
bool fillBackGround,
|
||||||
const core::rect<s32>& rect,
|
const core::rect<s32>& rect,
|
||||||
const core::rect<s32>* clip=0) _IRR_OVERRIDE_;
|
const core::rect<s32>* clip=0) override;
|
||||||
|
|
||||||
//! draws a window background
|
//! draws a window background
|
||||||
/** Used for drawing the background of dialogs and windows.
|
/** Used for drawing the background of dialogs and windows.
|
||||||
@ -134,7 +134,7 @@ namespace gui
|
|||||||
bool drawTitleBar, video::SColor titleBarColor,
|
bool drawTitleBar, video::SColor titleBarColor,
|
||||||
const core::rect<s32>& rect,
|
const core::rect<s32>& rect,
|
||||||
const core::rect<s32>* clip,
|
const core::rect<s32>* clip,
|
||||||
core::rect<s32>* checkClientArea) _IRR_OVERRIDE_;
|
core::rect<s32>* checkClientArea) override;
|
||||||
|
|
||||||
//! draws a standard 3d menu pane
|
//! draws a standard 3d menu pane
|
||||||
/** Used for drawing for menus and context menus.
|
/** Used for drawing for menus and context menus.
|
||||||
@ -147,7 +147,7 @@ namespace gui
|
|||||||
\param clip: Clip area. */
|
\param clip: Clip area. */
|
||||||
virtual void draw3DMenuPane(IGUIElement* element,
|
virtual void draw3DMenuPane(IGUIElement* element,
|
||||||
const core::rect<s32>& rect,
|
const core::rect<s32>& rect,
|
||||||
const core::rect<s32>* clip=0) _IRR_OVERRIDE_;
|
const core::rect<s32>* clip=0) override;
|
||||||
|
|
||||||
//! draws a standard 3d tool bar
|
//! draws a standard 3d tool bar
|
||||||
/** Used for drawing for toolbars and menus.
|
/** Used for drawing for toolbars and menus.
|
||||||
@ -158,7 +158,7 @@ namespace gui
|
|||||||
\param clip: Clip area. */
|
\param clip: Clip area. */
|
||||||
virtual void draw3DToolBar(IGUIElement* element,
|
virtual void draw3DToolBar(IGUIElement* element,
|
||||||
const core::rect<s32>& rect,
|
const core::rect<s32>& rect,
|
||||||
const core::rect<s32>* clip=0) _IRR_OVERRIDE_;
|
const core::rect<s32>* clip=0) override;
|
||||||
|
|
||||||
//! draws a tab button
|
//! draws a tab button
|
||||||
/** Used for drawing for tab buttons on top of tabs.
|
/** Used for drawing for tab buttons on top of tabs.
|
||||||
@ -170,7 +170,7 @@ namespace gui
|
|||||||
\param clip: Clip area. */
|
\param clip: Clip area. */
|
||||||
virtual void draw3DTabButton(IGUIElement* element, bool active,
|
virtual void draw3DTabButton(IGUIElement* element, bool active,
|
||||||
const core::rect<s32>& rect, const core::rect<s32>* clip=0,
|
const core::rect<s32>& rect, const core::rect<s32>* clip=0,
|
||||||
EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT) _IRR_OVERRIDE_;
|
EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT) override;
|
||||||
|
|
||||||
//! draws a tab control body
|
//! draws a tab control body
|
||||||
/** \param element: Pointer to the element which wishes to draw this. This parameter
|
/** \param element: Pointer to the element which wishes to draw this. This parameter
|
||||||
@ -182,7 +182,7 @@ namespace gui
|
|||||||
\param clip: Clip area. */
|
\param clip: Clip area. */
|
||||||
virtual void draw3DTabBody(IGUIElement* element, bool border, bool background,
|
virtual void draw3DTabBody(IGUIElement* element, bool border, bool background,
|
||||||
const core::rect<s32>& rect, const core::rect<s32>* clip=0, s32 tabHeight=-1,
|
const core::rect<s32>& rect, const core::rect<s32>* clip=0, s32 tabHeight=-1,
|
||||||
EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT) _IRR_OVERRIDE_;
|
EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT) override;
|
||||||
|
|
||||||
//! draws an icon, usually from the skin's sprite bank
|
//! draws an icon, usually from the skin's sprite bank
|
||||||
/** \param element: Pointer to the element which wishes to draw this icon.
|
/** \param element: Pointer to the element which wishes to draw this icon.
|
||||||
@ -197,7 +197,7 @@ namespace gui
|
|||||||
virtual void drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
|
virtual void drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
|
||||||
const core::position2di position,
|
const core::position2di position,
|
||||||
u32 starttime=0, u32 currenttime=0,
|
u32 starttime=0, u32 currenttime=0,
|
||||||
bool loop=false, const core::rect<s32>* clip=0) _IRR_OVERRIDE_;
|
bool loop=false, const core::rect<s32>* clip=0) override;
|
||||||
|
|
||||||
|
|
||||||
//! draws a 2d rectangle.
|
//! draws a 2d rectangle.
|
||||||
@ -210,11 +210,11 @@ namespace gui
|
|||||||
\param clip: Pointer to rectangle against which the rectangle will be clipped.
|
\param clip: Pointer to rectangle against which the rectangle will be clipped.
|
||||||
If the pointer is null, no clipping will be performed. */
|
If the pointer is null, no clipping will be performed. */
|
||||||
virtual void draw2DRectangle(IGUIElement* element, const video::SColor &color,
|
virtual void draw2DRectangle(IGUIElement* element, const video::SColor &color,
|
||||||
const core::rect<s32>& pos, const core::rect<s32>* clip = 0) _IRR_OVERRIDE_;
|
const core::rect<s32>& pos, const core::rect<s32>* clip = 0) override;
|
||||||
|
|
||||||
|
|
||||||
//! get the type of this skin
|
//! get the type of this skin
|
||||||
virtual EGUI_SKIN_TYPE getType() const _IRR_OVERRIDE_;
|
EGUI_SKIN_TYPE getType() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -32,38 +32,38 @@ public:
|
|||||||
CGUISpriteBank(IGUIEnvironment* env);
|
CGUISpriteBank(IGUIEnvironment* env);
|
||||||
virtual ~CGUISpriteBank();
|
virtual ~CGUISpriteBank();
|
||||||
|
|
||||||
virtual core::array< core::rect<s32> >& getPositions() _IRR_OVERRIDE_;
|
core::array< core::rect<s32> >& getPositions() override;
|
||||||
virtual core::array< SGUISprite >& getSprites() _IRR_OVERRIDE_;
|
core::array< SGUISprite >& getSprites() override;
|
||||||
|
|
||||||
virtual u32 getTextureCount() const _IRR_OVERRIDE_;
|
u32 getTextureCount() const override;
|
||||||
virtual video::ITexture* getTexture(u32 index) const _IRR_OVERRIDE_;
|
video::ITexture* getTexture(u32 index) const override;
|
||||||
virtual void addTexture(video::ITexture* texture) _IRR_OVERRIDE_;
|
void addTexture(video::ITexture* texture) override;
|
||||||
virtual void setTexture(u32 index, video::ITexture* texture) _IRR_OVERRIDE_;
|
void setTexture(u32 index, video::ITexture* texture) override;
|
||||||
|
|
||||||
//! Add the texture and use it for a single non-animated sprite.
|
//! Add the texture and use it for a single non-animated sprite.
|
||||||
virtual s32 addTextureAsSprite(video::ITexture* texture) _IRR_OVERRIDE_;
|
s32 addTextureAsSprite(video::ITexture* texture) override;
|
||||||
|
|
||||||
//! clears sprites, rectangles and textures
|
//! clears sprites, rectangles and textures
|
||||||
virtual void clear() _IRR_OVERRIDE_;
|
void clear() override;
|
||||||
|
|
||||||
//! Draws a sprite in 2d with position and color
|
//! Draws a sprite in 2d with position and color
|
||||||
virtual void draw2DSprite(u32 index, const core::position2di& pos, const core::rect<s32>* clip=0,
|
virtual void draw2DSprite(u32 index, const core::position2di& pos, const core::rect<s32>* clip=0,
|
||||||
const video::SColor& color= video::SColor(255,255,255,255),
|
const video::SColor& color= video::SColor(255,255,255,255),
|
||||||
u32 starttime=0, u32 currenttime=0, bool loop=true, bool center=false) _IRR_OVERRIDE_;
|
u32 starttime=0, u32 currenttime=0, bool loop=true, bool center=false) override;
|
||||||
|
|
||||||
//! Draws a sprite in 2d with destination rectangle and colors
|
//! Draws a sprite in 2d with destination rectangle and colors
|
||||||
virtual void draw2DSprite(u32 index, const core::rect<s32>& destRect,
|
virtual void draw2DSprite(u32 index, const core::rect<s32>& destRect,
|
||||||
const core::rect<s32>* clip=0,
|
const core::rect<s32>* clip=0,
|
||||||
const video::SColor * const colors=0,
|
const video::SColor * const colors=0,
|
||||||
u32 timeTicks = 0,
|
u32 timeTicks = 0,
|
||||||
bool loop=true) _IRR_OVERRIDE_;
|
bool loop=true) override;
|
||||||
|
|
||||||
//! Draws a sprite batch in 2d using an array of positions and a color
|
//! Draws a sprite batch in 2d using an array of positions and a color
|
||||||
virtual void draw2DSpriteBatch(const core::array<u32>& indices, const core::array<core::position2di>& pos,
|
virtual void draw2DSpriteBatch(const core::array<u32>& indices, const core::array<core::position2di>& pos,
|
||||||
const core::rect<s32>* clip=0,
|
const core::rect<s32>* clip=0,
|
||||||
const video::SColor& color= video::SColor(255,255,255,255),
|
const video::SColor& color= video::SColor(255,255,255,255),
|
||||||
u32 starttime=0, u32 currenttime=0,
|
u32 starttime=0, u32 currenttime=0,
|
||||||
bool loop=true, bool center=false) _IRR_OVERRIDE_;
|
bool loop=true, bool center=false) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -28,78 +28,78 @@ namespace gui
|
|||||||
virtual ~CGUIStaticText();
|
virtual ~CGUIStaticText();
|
||||||
|
|
||||||
//! draws the element and its children
|
//! draws the element and its children
|
||||||
virtual void draw() _IRR_OVERRIDE_;
|
void draw() override;
|
||||||
|
|
||||||
//! Sets another skin independent font.
|
//! Sets another skin independent font.
|
||||||
virtual void setOverrideFont(IGUIFont* font=0) _IRR_OVERRIDE_;
|
void setOverrideFont(IGUIFont* font=0) override;
|
||||||
|
|
||||||
//! Gets the override font (if any)
|
//! 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
|
//! 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 text.
|
//! Sets another color for the text.
|
||||||
virtual void setOverrideColor(video::SColor color) _IRR_OVERRIDE_;
|
void setOverrideColor(video::SColor color) override;
|
||||||
|
|
||||||
//! Sets another color for the background.
|
//! Sets another color for the background.
|
||||||
virtual void setBackgroundColor(video::SColor color) _IRR_OVERRIDE_;
|
void setBackgroundColor(video::SColor color) override;
|
||||||
|
|
||||||
//! Sets whether to draw the background
|
//! Sets whether to draw the background
|
||||||
virtual void setDrawBackground(bool draw) _IRR_OVERRIDE_;
|
void setDrawBackground(bool draw) override;
|
||||||
|
|
||||||
//! Gets the background color
|
//! Gets the background color
|
||||||
virtual video::SColor getBackgroundColor() const _IRR_OVERRIDE_;
|
video::SColor getBackgroundColor() const override;
|
||||||
|
|
||||||
//! Checks if background drawing is enabled
|
//! Checks if background drawing is enabled
|
||||||
virtual bool isDrawBackgroundEnabled() const _IRR_OVERRIDE_;
|
bool isDrawBackgroundEnabled() const override;
|
||||||
|
|
||||||
//! Sets whether to draw the border
|
//! Sets whether to draw the border
|
||||||
virtual void setDrawBorder(bool draw) _IRR_OVERRIDE_;
|
void setDrawBorder(bool draw) override;
|
||||||
|
|
||||||
//! Checks if border drawing is enabled
|
//! Checks if border drawing is enabled
|
||||||
virtual bool isDrawBorderEnabled() const _IRR_OVERRIDE_;
|
bool isDrawBorderEnabled() const override;
|
||||||
|
|
||||||
//! Sets alignment mode for text
|
//! Sets alignment mode for text
|
||||||
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) _IRR_OVERRIDE_;
|
void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) override;
|
||||||
|
|
||||||
//! Gets the override color
|
//! Gets the override color
|
||||||
virtual video::SColor getOverrideColor() const _IRR_OVERRIDE_;
|
video::SColor getOverrideColor() const override;
|
||||||
|
|
||||||
//! Gets the currently used text color
|
//! Gets the currently used text color
|
||||||
virtual video::SColor getActiveColor() const _IRR_OVERRIDE_;
|
video::SColor getActiveColor() const override;
|
||||||
|
|
||||||
//! Sets if the static text should use the override color or the
|
//! Sets if the static text should use the override color or the
|
||||||
//! color in the gui skin.
|
//! color in the gui skin.
|
||||||
virtual void enableOverrideColor(bool enable) _IRR_OVERRIDE_;
|
void enableOverrideColor(bool enable) override;
|
||||||
|
|
||||||
//! Checks if an override color is enabled
|
//! Checks if an override color is enabled
|
||||||
virtual bool isOverrideColorEnabled() const _IRR_OVERRIDE_;
|
bool isOverrideColorEnabled() const override;
|
||||||
|
|
||||||
//! Set whether the text in this label should be clipped if it goes outside bounds
|
//! Set whether the text in this label should be clipped if it goes outside bounds
|
||||||
virtual void setTextRestrainedInside(bool restrainedInside) _IRR_OVERRIDE_;
|
void setTextRestrainedInside(bool restrainedInside) override;
|
||||||
|
|
||||||
//! Checks if the text in this label should be clipped if it goes outside bounds
|
//! Checks if the text in this label should be clipped if it goes outside bounds
|
||||||
virtual bool isTextRestrainedInside() const _IRR_OVERRIDE_;
|
bool isTextRestrainedInside() const override;
|
||||||
|
|
||||||
//! Enables or disables word wrap for using the static text as
|
//! Enables or disables word wrap for using the static text as
|
||||||
//! multiline text control.
|
//! multiline text control.
|
||||||
virtual void setWordWrap(bool enable) _IRR_OVERRIDE_;
|
void setWordWrap(bool enable) override;
|
||||||
|
|
||||||
//! Checks if word wrap is enabled
|
//! Checks if word wrap is enabled
|
||||||
virtual bool isWordWrapEnabled() const _IRR_OVERRIDE_;
|
bool isWordWrapEnabled() const override;
|
||||||
|
|
||||||
//! Sets the new caption of this element.
|
//! Sets the new caption of this element.
|
||||||
virtual void setText(const wchar_t* text) _IRR_OVERRIDE_;
|
void setText(const wchar_t* text) override;
|
||||||
|
|
||||||
//! Returns the height of the text in pixels when it is drawn.
|
//! Returns the height of the text in pixels when it is drawn.
|
||||||
virtual s32 getTextHeight() const _IRR_OVERRIDE_;
|
s32 getTextHeight() const override;
|
||||||
|
|
||||||
//! Returns the width of the current text, in the current font
|
//! Returns the width of the current text, in the current font
|
||||||
virtual s32 getTextWidth() const _IRR_OVERRIDE_;
|
s32 getTextWidth() const override;
|
||||||
|
|
||||||
//! Updates the absolute position, splits text if word wrap is enabled
|
//! Updates the absolute position, splits text if word wrap is enabled
|
||||||
virtual void updateAbsolutePosition() _IRR_OVERRIDE_;
|
void updateAbsolutePosition() override;
|
||||||
|
|
||||||
//! Set whether the string should be interpreted as right-to-left (RTL) text
|
//! Set whether the string should be interpreted as right-to-left (RTL) text
|
||||||
/** \note This component does not implement the Unicode bidi standard, the
|
/** \note This component does not implement the Unicode bidi standard, the
|
||||||
@ -107,10 +107,10 @@ namespace gui
|
|||||||
main difference when RTL is enabled is that the linebreaks for multiline
|
main difference when RTL is enabled is that the linebreaks for multiline
|
||||||
elements are performed starting from the end.
|
elements are performed starting from the end.
|
||||||
*/
|
*/
|
||||||
virtual void setRightToLeft(bool rtl) _IRR_OVERRIDE_;
|
void setRightToLeft(bool rtl) override;
|
||||||
|
|
||||||
//! Checks if the text should be interpreted as right-to-left text
|
//! Checks if the text should be interpreted as right-to-left text
|
||||||
virtual bool isRightToLeft() const _IRR_OVERRIDE_;
|
bool isRightToLeft() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -454,7 +454,7 @@ void CGUITabControl::scrollRight()
|
|||||||
recalculateScrollBar();
|
recalculateScrollBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
s32 CGUITabControl::calcTabWidth(s32 pos, IGUIFont* font, const wchar_t* text, bool withScrollControl) const
|
s32 CGUITabControl::calcTabWidth(IGUIFont* font, const wchar_t* text) const
|
||||||
{
|
{
|
||||||
if ( !font )
|
if ( !font )
|
||||||
return 0;
|
return 0;
|
||||||
@ -463,26 +463,11 @@ s32 CGUITabControl::calcTabWidth(s32 pos, IGUIFont* font, const wchar_t* text, b
|
|||||||
if ( TabMaxWidth > 0 && len > TabMaxWidth )
|
if ( TabMaxWidth > 0 && len > TabMaxWidth )
|
||||||
len = TabMaxWidth;
|
len = TabMaxWidth;
|
||||||
|
|
||||||
// check if we miss the place to draw the tab-button
|
|
||||||
if ( withScrollControl && ScrollControl && pos+len > UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 )
|
|
||||||
{
|
|
||||||
s32 tabMinWidth = font->getDimension(L"A").Width;
|
|
||||||
if ( TabExtraWidth > 0 && TabExtraWidth > tabMinWidth )
|
|
||||||
tabMinWidth = TabExtraWidth;
|
|
||||||
|
|
||||||
if ( ScrollControl && pos+tabMinWidth <= UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 )
|
|
||||||
{
|
|
||||||
len = UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 - pos;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CGUITabControl::needScrollControl(s32 startIndex, bool withScrollControl)
|
bool CGUITabControl::needScrollControl(s32 startIndex, bool withScrollControl, s32 *pos_rightmost)
|
||||||
{
|
{
|
||||||
if ( startIndex >= (s32)Tabs.size() )
|
|
||||||
startIndex -= 1;
|
|
||||||
|
|
||||||
if ( startIndex < 0 )
|
if ( startIndex < 0 )
|
||||||
startIndex = 0;
|
startIndex = 0;
|
||||||
|
|
||||||
@ -492,17 +477,18 @@ bool CGUITabControl::needScrollControl(s32 startIndex, bool withScrollControl)
|
|||||||
|
|
||||||
IGUIFont* font = skin->getFont();
|
IGUIFont* font = skin->getFont();
|
||||||
|
|
||||||
core::rect<s32> frameRect(AbsoluteRect);
|
|
||||||
|
|
||||||
if (Tabs.empty())
|
if (Tabs.empty())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!font)
|
if (!font)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
s32 pos = frameRect.UpperLeftCorner.X + 2;
|
s32 pos = AbsoluteRect.UpperLeftCorner.X + 2;
|
||||||
|
const s32 pos_right = withScrollControl ?
|
||||||
|
UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 :
|
||||||
|
AbsoluteRect.LowerRightCorner.X;
|
||||||
|
|
||||||
for (s32 i=startIndex; i<(s32)Tabs.size(); ++i)
|
for (s32 i = startIndex; i < (s32)Tabs.size(); ++i)
|
||||||
{
|
{
|
||||||
// get Text
|
// get Text
|
||||||
const wchar_t* text = 0;
|
const wchar_t* text = 0;
|
||||||
@ -511,26 +497,71 @@ bool CGUITabControl::needScrollControl(s32 startIndex, bool withScrollControl)
|
|||||||
text = Tabs[i]->getText();
|
text = Tabs[i]->getText();
|
||||||
|
|
||||||
// get text length
|
// get text length
|
||||||
s32 len = calcTabWidth(pos, font, text, false); // always without withScrollControl here or len would be shortened
|
s32 len = calcTabWidth(font, text); // always without withScrollControl here or len would be shortened
|
||||||
|
|
||||||
frameRect.LowerRightCorner.X += len;
|
|
||||||
|
|
||||||
frameRect.UpperLeftCorner.X = pos;
|
|
||||||
frameRect.LowerRightCorner.X = frameRect.UpperLeftCorner.X + len;
|
|
||||||
pos += len;
|
pos += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( withScrollControl && pos > UpButton->getAbsolutePosition().UpperLeftCorner.X - 2)
|
if (pos > pos_right)
|
||||||
return true;
|
|
||||||
|
|
||||||
if ( !withScrollControl && pos > AbsoluteRect.LowerRightCorner.X )
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pos_rightmost)
|
||||||
|
*pos_rightmost = pos;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
s32 CGUITabControl::calculateScrollIndexFromActive()
|
||||||
|
{
|
||||||
|
if (!ScrollControl || Tabs.empty())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
IGUISkin *skin = Environment->getSkin();
|
||||||
|
if (!skin)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
IGUIFont *font = skin->getFont();
|
||||||
|
if (!font)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
const s32 pos_left = AbsoluteRect.UpperLeftCorner.X + 2;
|
||||||
|
const s32 pos_right = UpButton->getAbsolutePosition().UpperLeftCorner.X - 2;
|
||||||
|
|
||||||
|
// Move from center to the left border left until it is reached
|
||||||
|
s32 pos_cl = (pos_left + pos_right) / 2;
|
||||||
|
s32 i = ActiveTabIndex;
|
||||||
|
for (; i > 0; --i) {
|
||||||
|
if (!Tabs[i])
|
||||||
|
continue;
|
||||||
|
|
||||||
|
s32 len = calcTabWidth(font, Tabs[i]->getText());
|
||||||
|
if (i == ActiveTabIndex)
|
||||||
|
len /= 2;
|
||||||
|
if (pos_cl - len < pos_left)
|
||||||
|
break;
|
||||||
|
|
||||||
|
pos_cl -= len;
|
||||||
|
}
|
||||||
|
if (i == 0)
|
||||||
|
return i;
|
||||||
|
|
||||||
|
// Is scrolling to right still possible?
|
||||||
|
s32 pos_rr = 0;
|
||||||
|
if (needScrollControl(i, true, &pos_rr))
|
||||||
|
return i; // Yes? -> OK
|
||||||
|
|
||||||
|
// No? -> Decrease "i" more. Append tabs until scrolling becomes necessary
|
||||||
|
for (--i; i > 0; --i) {
|
||||||
|
if (!Tabs[i])
|
||||||
|
continue;
|
||||||
|
|
||||||
|
pos_rr += calcTabWidth(font, Tabs[i]->getText());
|
||||||
|
if (pos_rr > pos_right)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return i + 1;
|
||||||
|
}
|
||||||
|
|
||||||
core::rect<s32> CGUITabControl::calcTabPos()
|
core::rect<s32> CGUITabControl::calcTabPos()
|
||||||
{
|
{
|
||||||
core::rect<s32> r;
|
core::rect<s32> r;
|
||||||
@ -613,7 +644,7 @@ void CGUITabControl::draw()
|
|||||||
IGUITab *activeTab = 0;
|
IGUITab *activeTab = 0;
|
||||||
|
|
||||||
// Draw all tab-buttons except the active one
|
// Draw all tab-buttons except the active one
|
||||||
for (u32 i=CurrentScrollTabIndex; i<Tabs.size(); ++i)
|
for (u32 i = CurrentScrollTabIndex; i < Tabs.size() && !needRightScroll; ++i)
|
||||||
{
|
{
|
||||||
// get Text
|
// get Text
|
||||||
const wchar_t* text = 0;
|
const wchar_t* text = 0;
|
||||||
@ -621,11 +652,13 @@ void CGUITabControl::draw()
|
|||||||
text = Tabs[i]->getText();
|
text = Tabs[i]->getText();
|
||||||
|
|
||||||
// get text length
|
// get text length
|
||||||
s32 len = calcTabWidth(pos, font, text, true);
|
s32 len = calcTabWidth(font, text);
|
||||||
if ( ScrollControl && pos+len > UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 )
|
if (ScrollControl) {
|
||||||
{
|
s32 space = UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 - pos;
|
||||||
needRightScroll = true;
|
if (space < len) {
|
||||||
break;
|
needRightScroll = true;
|
||||||
|
len = space;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
frameRect.LowerRightCorner.X += len;
|
frameRect.LowerRightCorner.X += len;
|
||||||
@ -794,6 +827,7 @@ s32 CGUITabControl::getTabExtraWidth() const
|
|||||||
|
|
||||||
void CGUITabControl::recalculateScrollBar()
|
void CGUITabControl::recalculateScrollBar()
|
||||||
{
|
{
|
||||||
|
// Down: to right, Up: to left
|
||||||
if (!UpButton || !DownButton)
|
if (!UpButton || !DownButton)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -894,7 +928,8 @@ s32 CGUITabControl::getTabAt(s32 xpos, s32 ypos) const
|
|||||||
if (!frameRect.isPointInside(p))
|
if (!frameRect.isPointInside(p))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
for (s32 i=CurrentScrollTabIndex; i<(s32)Tabs.size(); ++i)
|
bool abort = false;
|
||||||
|
for (s32 i = CurrentScrollTabIndex; i < (s32)Tabs.size() && !abort; ++i)
|
||||||
{
|
{
|
||||||
// get Text
|
// get Text
|
||||||
const wchar_t* text = 0;
|
const wchar_t* text = 0;
|
||||||
@ -902,9 +937,15 @@ s32 CGUITabControl::getTabAt(s32 xpos, s32 ypos) const
|
|||||||
text = Tabs[i]->getText();
|
text = Tabs[i]->getText();
|
||||||
|
|
||||||
// get text length
|
// get text length
|
||||||
s32 len = calcTabWidth(pos, font, text, true);
|
s32 len = calcTabWidth(font, text);
|
||||||
if ( ScrollControl && pos+len > UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 )
|
if (ScrollControl) {
|
||||||
return -1;
|
// TODO: merge this with draw() ?
|
||||||
|
s32 space = UpButton->getAbsolutePosition().UpperLeftCorner.X - 2 - pos;
|
||||||
|
if (space < len) {
|
||||||
|
abort = true;
|
||||||
|
len = space;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
frameRect.UpperLeftCorner.X = pos;
|
frameRect.UpperLeftCorner.X = pos;
|
||||||
frameRect.LowerRightCorner.X = frameRect.UpperLeftCorner.X + len;
|
frameRect.LowerRightCorner.X = frameRect.UpperLeftCorner.X + len;
|
||||||
@ -915,6 +956,7 @@ s32 CGUITabControl::getTabAt(s32 xpos, s32 ypos) const
|
|||||||
{
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -948,6 +990,11 @@ bool CGUITabControl::setActiveTab(s32 idx)
|
|||||||
Parent->OnEvent(event);
|
Parent->OnEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ScrollControl) {
|
||||||
|
CurrentScrollTabIndex = calculateScrollIndexFromActive();
|
||||||
|
recalculateScrollBar();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,24 +30,24 @@ namespace gui
|
|||||||
s32 id);
|
s32 id);
|
||||||
|
|
||||||
//! draws the element and its children
|
//! draws the element and its children
|
||||||
virtual void draw() _IRR_OVERRIDE_;
|
void draw() override;
|
||||||
|
|
||||||
//! sets if the tab should draw its background
|
//! sets if the tab should draw its background
|
||||||
virtual void setDrawBackground(bool draw=true) _IRR_OVERRIDE_;
|
void setDrawBackground(bool draw=true) override;
|
||||||
|
|
||||||
//! sets the color of the background, if it should be drawn.
|
//! sets the color of the background, if it should be drawn.
|
||||||
virtual void setBackgroundColor(video::SColor c) _IRR_OVERRIDE_;
|
void setBackgroundColor(video::SColor c) override;
|
||||||
|
|
||||||
//! sets the color of the text
|
//! sets the color of the text
|
||||||
virtual void setTextColor(video::SColor c) _IRR_OVERRIDE_;
|
void setTextColor(video::SColor c) override;
|
||||||
|
|
||||||
//! returns true if the tab is drawing its background, false if not
|
//! returns true if the tab is drawing its background, false if not
|
||||||
virtual bool isDrawingBackground() const _IRR_OVERRIDE_;
|
bool isDrawingBackground() const override;
|
||||||
|
|
||||||
//! returns the color of the background
|
//! returns the color of the background
|
||||||
virtual video::SColor getBackgroundColor() const _IRR_OVERRIDE_;
|
video::SColor getBackgroundColor() const override;
|
||||||
|
|
||||||
virtual video::SColor getTextColor() const _IRR_OVERRIDE_;
|
video::SColor getTextColor() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -72,89 +72,92 @@ namespace gui
|
|||||||
virtual ~CGUITabControl();
|
virtual ~CGUITabControl();
|
||||||
|
|
||||||
//! Adds a tab
|
//! Adds a tab
|
||||||
virtual IGUITab* addTab(const wchar_t* caption, s32 id=-1) _IRR_OVERRIDE_;
|
IGUITab* addTab(const wchar_t* caption, s32 id=-1) override;
|
||||||
|
|
||||||
//! Adds an existing tab
|
//! Adds an existing tab
|
||||||
virtual s32 addTab(IGUITab* tab) _IRR_OVERRIDE_;
|
s32 addTab(IGUITab* tab) override;
|
||||||
|
|
||||||
//! Insert the tab at the given index
|
//! Insert the tab at the given index
|
||||||
virtual IGUITab* insertTab(s32 idx, const wchar_t* caption, s32 id=-1) _IRR_OVERRIDE_;
|
IGUITab* insertTab(s32 idx, const wchar_t* caption, s32 id=-1) override;
|
||||||
|
|
||||||
//! Insert an existing tab
|
//! Insert an existing tab
|
||||||
/** Note that it will also add the tab as a child of this TabControl.
|
/** Note that it will also add the tab as a child of this TabControl.
|
||||||
\return Index of added tab (should be same as the one passed) or -1 for failure*/
|
\return Index of added tab (should be same as the one passed) or -1 for failure*/
|
||||||
virtual s32 insertTab(s32 idx, IGUITab* tab, bool serializationMode) _IRR_OVERRIDE_;
|
s32 insertTab(s32 idx, IGUITab* tab, bool serializationMode) override;
|
||||||
|
|
||||||
//! Removes a tab from the tabcontrol
|
//! Removes a tab from the tabcontrol
|
||||||
virtual void removeTab(s32 idx) _IRR_OVERRIDE_;
|
void removeTab(s32 idx) override;
|
||||||
|
|
||||||
//! Clears the tabcontrol removing all tabs
|
//! Clears the tabcontrol removing all tabs
|
||||||
virtual void clear() _IRR_OVERRIDE_;
|
void clear() override;
|
||||||
|
|
||||||
//! Returns amount of tabs in the tabcontrol
|
//! Returns amount of tabs in the tabcontrol
|
||||||
virtual s32 getTabCount() const _IRR_OVERRIDE_;
|
s32 getTabCount() const override;
|
||||||
|
|
||||||
//! Returns a tab based on zero based index
|
//! Returns a tab based on zero based index
|
||||||
virtual IGUITab* getTab(s32 idx) const _IRR_OVERRIDE_;
|
IGUITab* getTab(s32 idx) const override;
|
||||||
|
|
||||||
//! Brings a tab to front.
|
//! Brings a tab to front.
|
||||||
virtual bool setActiveTab(s32 idx) _IRR_OVERRIDE_;
|
bool setActiveTab(s32 idx) override;
|
||||||
|
|
||||||
//! Brings a tab to front.
|
//! Brings a tab to front.
|
||||||
virtual bool setActiveTab(IGUITab *tab) _IRR_OVERRIDE_;
|
bool setActiveTab(IGUITab *tab) override;
|
||||||
|
|
||||||
//! For given given tab find it's zero-based index (or -1 for not found)
|
//! For given given tab find it's zero-based index (or -1 for not found)
|
||||||
virtual s32 getTabIndex(const IGUIElement *tab) const _IRR_OVERRIDE_;
|
s32 getTabIndex(const IGUIElement *tab) const override;
|
||||||
|
|
||||||
//! Returns which tab is currently active
|
//! Returns which tab is currently active
|
||||||
virtual s32 getActiveTab() const _IRR_OVERRIDE_;
|
s32 getActiveTab() const override;
|
||||||
|
|
||||||
//! get the the id of the tab at the given absolute coordinates
|
//! get the the id of the tab at the given absolute coordinates
|
||||||
virtual s32 getTabAt(s32 xpos, s32 ypos) const _IRR_OVERRIDE_;
|
s32 getTabAt(s32 xpos, s32 ypos) const override;
|
||||||
|
|
||||||
//! called if an event happened.
|
//! 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
|
//! draws the element and its children
|
||||||
virtual void draw() _IRR_OVERRIDE_;
|
void draw() override;
|
||||||
|
|
||||||
//! Removes a child.
|
//! Removes a child.
|
||||||
virtual void removeChild(IGUIElement* child) _IRR_OVERRIDE_;
|
void removeChild(IGUIElement* child) override;
|
||||||
|
|
||||||
//! Set the height of the tabs
|
//! Set the height of the tabs
|
||||||
virtual void setTabHeight( s32 height ) _IRR_OVERRIDE_;
|
void setTabHeight( s32 height ) override;
|
||||||
|
|
||||||
//! Get the height of the tabs
|
//! Get the height of the tabs
|
||||||
virtual s32 getTabHeight() const _IRR_OVERRIDE_;
|
s32 getTabHeight() const override;
|
||||||
|
|
||||||
//! set the maximal width of a tab. Per default width is 0 which means "no width restriction".
|
//! set the maximal width of a tab. Per default width is 0 which means "no width restriction".
|
||||||
virtual void setTabMaxWidth(s32 width ) _IRR_OVERRIDE_;
|
void setTabMaxWidth(s32 width ) override;
|
||||||
|
|
||||||
//! get the maximal width of a tab
|
//! get the maximal width of a tab
|
||||||
virtual s32 getTabMaxWidth() const _IRR_OVERRIDE_;
|
s32 getTabMaxWidth() const override;
|
||||||
|
|
||||||
//! Set the alignment of the tabs
|
//! Set the alignment of the tabs
|
||||||
//! note: EGUIA_CENTER is not an option
|
//! note: EGUIA_CENTER is not an option
|
||||||
virtual void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment ) _IRR_OVERRIDE_;
|
void setTabVerticalAlignment( gui::EGUI_ALIGNMENT alignment ) override;
|
||||||
|
|
||||||
//! Get the alignment of the tabs
|
//! Get the alignment of the tabs
|
||||||
virtual gui::EGUI_ALIGNMENT getTabVerticalAlignment() const _IRR_OVERRIDE_;
|
gui::EGUI_ALIGNMENT getTabVerticalAlignment() const override;
|
||||||
|
|
||||||
//! Set the extra width added to tabs on each side of the text
|
//! Set the extra width added to tabs on each side of the text
|
||||||
virtual void setTabExtraWidth( s32 extraWidth ) _IRR_OVERRIDE_;
|
void setTabExtraWidth( s32 extraWidth ) override;
|
||||||
|
|
||||||
//! Get the extra width added to tabs on each side of the text
|
//! Get the extra width added to tabs on each side of the text
|
||||||
virtual s32 getTabExtraWidth() const _IRR_OVERRIDE_;
|
s32 getTabExtraWidth() const override;
|
||||||
|
|
||||||
//! Update the position of the element, decides scroll button status
|
//! Update the position of the element, decides scroll button status
|
||||||
virtual void updateAbsolutePosition() _IRR_OVERRIDE_;
|
void updateAbsolutePosition() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void scrollLeft();
|
void scrollLeft();
|
||||||
void scrollRight();
|
void scrollRight();
|
||||||
bool needScrollControl( s32 startIndex=0, bool withScrollControl=false );
|
//! Indicates whether the tabs overflow in X direction
|
||||||
s32 calcTabWidth(s32 pos, IGUIFont* font, const wchar_t* text, bool withScrollControl ) const;
|
bool needScrollControl( s32 startIndex=0, bool withScrollControl=false, s32 *pos_rightmost=nullptr );
|
||||||
|
//! Left index calculation based on the selected tab
|
||||||
|
s32 calculateScrollIndexFromActive();
|
||||||
|
s32 calcTabWidth(IGUIFont* font, const wchar_t* text) const;
|
||||||
core::rect<s32> calcTabPos();
|
core::rect<s32> calcTabPos();
|
||||||
void setVisibleTab(s32 idx);
|
void setVisibleTab(s32 idx);
|
||||||
void removeTabButNotChild(s32 idx);
|
void removeTabButNotChild(s32 idx);
|
||||||
|
@ -37,33 +37,33 @@ public:
|
|||||||
CImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size);
|
CImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size);
|
||||||
|
|
||||||
//! returns a pixel
|
//! returns a pixel
|
||||||
virtual SColor getPixel(u32 x, u32 y) const _IRR_OVERRIDE_;
|
SColor getPixel(u32 x, u32 y) const override;
|
||||||
|
|
||||||
//! sets a pixel
|
//! sets a pixel
|
||||||
virtual void setPixel(u32 x, u32 y, const SColor &color, bool blend = false ) _IRR_OVERRIDE_;
|
void setPixel(u32 x, u32 y, const SColor &color, bool blend = false ) override;
|
||||||
|
|
||||||
//! copies this surface into another, scaling it to fit.
|
//! copies this surface into another, scaling it to fit.
|
||||||
virtual void copyToScaling(void* target, u32 width, u32 height, ECOLOR_FORMAT format, u32 pitch=0) _IRR_OVERRIDE_;
|
void copyToScaling(void* target, u32 width, u32 height, ECOLOR_FORMAT format, u32 pitch=0) override;
|
||||||
|
|
||||||
//! copies this surface into another, scaling it to fit.
|
//! copies this surface into another, scaling it to fit.
|
||||||
virtual void copyToScaling(IImage* target) _IRR_OVERRIDE_;
|
void copyToScaling(IImage* target) override;
|
||||||
|
|
||||||
//! copies this surface into another
|
//! copies this surface into another
|
||||||
virtual void copyTo(IImage* target, const core::position2d<s32>& pos=core::position2d<s32>(0,0)) _IRR_OVERRIDE_;
|
void copyTo(IImage* target, const core::position2d<s32>& pos=core::position2d<s32>(0,0)) override;
|
||||||
|
|
||||||
//! copies this surface into another
|
//! copies this surface into another
|
||||||
virtual void copyTo(IImage* target, const core::position2d<s32>& pos, const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect=0) _IRR_OVERRIDE_;
|
void copyTo(IImage* target, const core::position2d<s32>& pos, const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect=0) override;
|
||||||
|
|
||||||
//! copies this surface into another, using the alpha mask, an cliprect and a color to add with
|
//! copies this surface into another, using the alpha mask, an cliprect and a color to add with
|
||||||
virtual void copyToWithAlpha(IImage* target, const core::position2d<s32>& pos,
|
virtual void copyToWithAlpha(IImage* target, const core::position2d<s32>& pos,
|
||||||
const core::rect<s32>& sourceRect, const SColor &color,
|
const core::rect<s32>& sourceRect, const SColor &color,
|
||||||
const core::rect<s32>* clipRect = 0, bool combineAlpha=false) _IRR_OVERRIDE_;
|
const core::rect<s32>* clipRect = 0, bool combineAlpha=false) override;
|
||||||
|
|
||||||
//! copies this surface into another, scaling it to fit, applying a box filter
|
//! copies this surface into another, scaling it to fit, applying a box filter
|
||||||
virtual void copyToScalingBoxFilter(IImage* target, s32 bias = 0, bool blend = false) _IRR_OVERRIDE_;
|
void copyToScalingBoxFilter(IImage* target, s32 bias = 0, bool blend = false) override;
|
||||||
|
|
||||||
//! fills the surface with given color
|
//! fills the surface with given color
|
||||||
virtual void fill(const SColor &color) _IRR_OVERRIDE_;
|
void fill(const SColor &color) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
inline SColor getPixelBox ( s32 x, s32 y, s32 fx, s32 fy, s32 bias ) const;
|
inline SColor getPixelBox ( s32 x, s32 y, s32 fx, s32 fy, s32 bias ) const;
|
||||||
|
@ -75,13 +75,13 @@ public:
|
|||||||
|
|
||||||
//! returns true if the file maybe is able to be loaded by this class
|
//! returns true if the file maybe is able to be loaded by this class
|
||||||
//! based on the file extension (e.g. ".tga")
|
//! based on the file extension (e.g. ".tga")
|
||||||
virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_;
|
bool isALoadableFileExtension(const io::path& filename) const override;
|
||||||
|
|
||||||
//! returns true if the file maybe is able to be loaded by this class
|
//! returns true if the file maybe is able to be loaded by this class
|
||||||
virtual bool isALoadableFileFormat(io::IReadFile* file) const _IRR_OVERRIDE_;
|
bool isALoadableFileFormat(io::IReadFile* file) const override;
|
||||||
|
|
||||||
//! creates a surface from the file
|
//! creates a surface from the file
|
||||||
virtual IImage* loadImage(io::IReadFile* file) const _IRR_OVERRIDE_;
|
IImage* loadImage(io::IReadFile* file) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -39,13 +39,13 @@ public:
|
|||||||
|
|
||||||
//! returns true if the file maybe is able to be loaded by this class
|
//! returns true if the file maybe is able to be loaded by this class
|
||||||
//! based on the file extension (e.g. ".tga")
|
//! based on the file extension (e.g. ".tga")
|
||||||
virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_;
|
bool isALoadableFileExtension(const io::path& filename) const override;
|
||||||
|
|
||||||
//! returns true if the file maybe is able to be loaded by this class
|
//! returns true if the file maybe is able to be loaded by this class
|
||||||
virtual bool isALoadableFileFormat(io::IReadFile* file) const _IRR_OVERRIDE_;
|
bool isALoadableFileFormat(io::IReadFile* file) const override;
|
||||||
|
|
||||||
//! creates a surface from the file
|
//! creates a surface from the file
|
||||||
virtual IImage* loadImage(io::IReadFile* file) const _IRR_OVERRIDE_;
|
IImage* loadImage(io::IReadFile* file) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ void PNGAPI user_read_data_fcn(png_structp png_ptr, png_bytep data, png_size_t l
|
|||||||
|
|
||||||
// changed by zola {
|
// changed by zola {
|
||||||
io::IReadFile* file=(io::IReadFile*)png_get_io_ptr(png_ptr);
|
io::IReadFile* file=(io::IReadFile*)png_get_io_ptr(png_ptr);
|
||||||
check=(png_size_t) file->read((void*)data,(u32)length);
|
check=(png_size_t) file->read((void*)data, length);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if (check != length)
|
if (check != length)
|
||||||
|
@ -27,13 +27,13 @@ public:
|
|||||||
|
|
||||||
//! returns true if the file maybe is able to be loaded by this class
|
//! returns true if the file maybe is able to be loaded by this class
|
||||||
//! based on the file extension (e.g. ".png")
|
//! based on the file extension (e.g. ".png")
|
||||||
virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_;
|
bool isALoadableFileExtension(const io::path& filename) const override;
|
||||||
|
|
||||||
//! returns true if the file maybe is able to be loaded by this class
|
//! returns true if the file maybe is able to be loaded by this class
|
||||||
virtual bool isALoadableFileFormat(io::IReadFile* file) const _IRR_OVERRIDE_;
|
bool isALoadableFileFormat(io::IReadFile* file) const override;
|
||||||
|
|
||||||
//! creates a surface from the file
|
//! creates a surface from the file
|
||||||
virtual IImage* loadImage(io::IReadFile* file) const _IRR_OVERRIDE_;
|
IImage* loadImage(io::IReadFile* file) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -59,13 +59,13 @@ public:
|
|||||||
|
|
||||||
//! returns true if the file maybe is able to be loaded by this class
|
//! returns true if the file maybe is able to be loaded by this class
|
||||||
//! based on the file extension (e.g. ".tga")
|
//! based on the file extension (e.g. ".tga")
|
||||||
virtual bool isALoadableFileExtension(const io::path& filename) const _IRR_OVERRIDE_;
|
bool isALoadableFileExtension(const io::path& filename) const override;
|
||||||
|
|
||||||
//! returns true if the file maybe is able to be loaded by this class
|
//! returns true if the file maybe is able to be loaded by this class
|
||||||
virtual bool isALoadableFileFormat(io::IReadFile* file) const _IRR_OVERRIDE_;
|
bool isALoadableFileFormat(io::IReadFile* file) const override;
|
||||||
|
|
||||||
//! creates a surface from the file
|
//! creates a surface from the file
|
||||||
virtual IImage* loadImage(io::IReadFile* file) const _IRR_OVERRIDE_;
|
IImage* loadImage(io::IReadFile* file) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -23,10 +23,10 @@ public:
|
|||||||
CImageWriterJPG();
|
CImageWriterJPG();
|
||||||
|
|
||||||
//! return true if this writer can write a file with the given extension
|
//! return true if this writer can write a file with the given extension
|
||||||
virtual bool isAWriteableFileExtension(const io::path& filename) const _IRR_OVERRIDE_;
|
bool isAWriteableFileExtension(const io::path& filename) const override;
|
||||||
|
|
||||||
//! write image to file
|
//! write image to file
|
||||||
virtual bool writeImage(io::IWriteFile *file, IImage *image, u32 param) const _IRR_OVERRIDE_;
|
bool writeImage(io::IWriteFile *file, IImage *image, u32 param) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ void PNGAPI user_write_data_fcn(png_structp png_ptr, png_bytep data, png_size_t
|
|||||||
png_size_t check;
|
png_size_t check;
|
||||||
|
|
||||||
io::IWriteFile* file=(io::IWriteFile*)png_get_io_ptr(png_ptr);
|
io::IWriteFile* file=(io::IWriteFile*)png_get_io_ptr(png_ptr);
|
||||||
check=(png_size_t) file->write((const void*)data,(u32)length);
|
check=(png_size_t) file->write((const void*)data, length);
|
||||||
|
|
||||||
if (check != length)
|
if (check != length)
|
||||||
png_error(png_ptr, "Write Error");
|
png_error(png_ptr, "Write Error");
|
||||||
|
@ -23,10 +23,10 @@ public:
|
|||||||
CImageWriterPNG();
|
CImageWriterPNG();
|
||||||
|
|
||||||
//! return true if this writer can write a file with the given extension
|
//! return true if this writer can write a file with the given extension
|
||||||
virtual bool isAWriteableFileExtension(const io::path& filename) const _IRR_OVERRIDE_;
|
bool isAWriteableFileExtension(const io::path& filename) const override;
|
||||||
|
|
||||||
//! write image to file
|
//! write image to file
|
||||||
virtual bool writeImage(io::IWriteFile *file, IImage *image, u32 param) const _IRR_OVERRIDE_;
|
bool writeImage(io::IWriteFile *file, IImage *image, u32 param) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace video
|
} // namespace video
|
||||||
|
@ -110,7 +110,7 @@ namespace irr
|
|||||||
CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters& param)
|
CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters& param)
|
||||||
: CIrrDeviceStub(param),
|
: CIrrDeviceStub(param),
|
||||||
#ifdef _IRR_COMPILE_WITH_X11_
|
#ifdef _IRR_COMPILE_WITH_X11_
|
||||||
XDisplay(0), VisualInfo(0), Screennr(0), XWindow(0), StdHints(0), SoftwareImage(0),
|
XDisplay(0), VisualInfo(0), Screennr(0), XWindow(0), StdHints(0),
|
||||||
XInputMethod(0), XInputContext(0),
|
XInputMethod(0), XInputContext(0),
|
||||||
HasNetWM(false),
|
HasNetWM(false),
|
||||||
#endif
|
#endif
|
||||||
@ -118,7 +118,7 @@ CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters& param)
|
|||||||
currentTouchedCount(0),
|
currentTouchedCount(0),
|
||||||
#endif
|
#endif
|
||||||
Width(param.WindowSize.Width), Height(param.WindowSize.Height),
|
Width(param.WindowSize.Width), Height(param.WindowSize.Height),
|
||||||
WindowHasFocus(false), WindowMinimized(false),
|
WindowHasFocus(false), WindowMinimized(false), WindowMaximized(param.WindowMaximized),
|
||||||
ExternalWindow(false), AutorepeatSupport(0)
|
ExternalWindow(false), AutorepeatSupport(0)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
@ -168,6 +168,9 @@ CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters& param)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
createGUIAndScene();
|
createGUIAndScene();
|
||||||
|
|
||||||
|
if (param.WindowMaximized)
|
||||||
|
maximizeWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -211,9 +214,6 @@ CIrrDeviceLinux::~CIrrDeviceLinux()
|
|||||||
ContextManager->destroySurface();
|
ContextManager->destroySurface();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SoftwareImage)
|
|
||||||
XDestroyImage(SoftwareImage);
|
|
||||||
|
|
||||||
if (!ExternalWindow)
|
if (!ExternalWindow)
|
||||||
{
|
{
|
||||||
XDestroyWindow(XDisplay,XWindow);
|
XDestroyWindow(XDisplay,XWindow);
|
||||||
@ -487,21 +487,6 @@ bool CIrrDeviceLinux::createWindow()
|
|||||||
long num;
|
long num;
|
||||||
XGetWMNormalHints(XDisplay, XWindow, StdHints, &num);
|
XGetWMNormalHints(XDisplay, XWindow, StdHints, &num);
|
||||||
|
|
||||||
// create an XImage for the software renderer
|
|
||||||
//(thx to Nadav for some clues on how to do that!)
|
|
||||||
|
|
||||||
if (CreationParams.DriverType == video::EDT_SOFTWARE || CreationParams.DriverType == video::EDT_BURNINGSVIDEO)
|
|
||||||
{
|
|
||||||
SoftwareImage = XCreateImage(XDisplay,
|
|
||||||
VisualInfo->visual, VisualInfo->depth,
|
|
||||||
ZPixmap, 0, 0, Width, Height,
|
|
||||||
BitmapPad(XDisplay), 0);
|
|
||||||
|
|
||||||
// use malloc because X will free it later on
|
|
||||||
if (SoftwareImage)
|
|
||||||
SoftwareImage->data = (char*) malloc(SoftwareImage->bytes_per_line * SoftwareImage->height * sizeof(char));
|
|
||||||
}
|
|
||||||
|
|
||||||
initXInput2();
|
initXInput2();
|
||||||
|
|
||||||
#endif // #ifdef _IRR_COMPILE_WITH_X11_
|
#endif // #ifdef _IRR_COMPILE_WITH_X11_
|
||||||
@ -515,20 +500,6 @@ void CIrrDeviceLinux::createDriver()
|
|||||||
switch(CreationParams.DriverType)
|
switch(CreationParams.DriverType)
|
||||||
{
|
{
|
||||||
#ifdef _IRR_COMPILE_WITH_X11_
|
#ifdef _IRR_COMPILE_WITH_X11_
|
||||||
case video::EDT_SOFTWARE:
|
|
||||||
#ifdef _IRR_COMPILE_WITH_SOFTWARE_
|
|
||||||
VideoDriver = video::createSoftwareDriver(CreationParams.WindowSize, CreationParams.Fullscreen, FileSystem, this);
|
|
||||||
#else
|
|
||||||
os::Printer::log("No Software driver support compiled in.", ELL_ERROR);
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
case video::EDT_BURNINGSVIDEO:
|
|
||||||
#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_
|
|
||||||
VideoDriver = video::createBurningVideoDriver(CreationParams, FileSystem, this);
|
|
||||||
#else
|
|
||||||
os::Printer::log("Burning's video driver was not compiled in.", ELL_ERROR);
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
case video::EDT_OPENGL:
|
case video::EDT_OPENGL:
|
||||||
#ifdef _IRR_COMPILE_WITH_OPENGL_
|
#ifdef _IRR_COMPILE_WITH_OPENGL_
|
||||||
{
|
{
|
||||||
@ -765,21 +736,6 @@ bool CIrrDeviceLinux::run()
|
|||||||
Width = event.xconfigure.width;
|
Width = event.xconfigure.width;
|
||||||
Height = event.xconfigure.height;
|
Height = event.xconfigure.height;
|
||||||
|
|
||||||
// resize image data
|
|
||||||
if (SoftwareImage)
|
|
||||||
{
|
|
||||||
XDestroyImage(SoftwareImage);
|
|
||||||
|
|
||||||
SoftwareImage = XCreateImage(XDisplay,
|
|
||||||
VisualInfo->visual, VisualInfo->depth,
|
|
||||||
ZPixmap, 0, 0, Width, Height,
|
|
||||||
BitmapPad(XDisplay), 0);
|
|
||||||
|
|
||||||
// use malloc because X will free it later on
|
|
||||||
if (SoftwareImage)
|
|
||||||
SoftwareImage->data = (char*) malloc(SoftwareImage->bytes_per_line * SoftwareImage->height * sizeof(char));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (VideoDriver)
|
if (VideoDriver)
|
||||||
VideoDriver->OnResize(core::dimension2d<u32>(Width, Height));
|
VideoDriver->OnResize(core::dimension2d<u32>(Width, Height));
|
||||||
}
|
}
|
||||||
@ -1219,60 +1175,6 @@ void CIrrDeviceLinux::setWindowCaption(const wchar_t* text)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! presents a surface in the client area
|
|
||||||
bool CIrrDeviceLinux::present(video::IImage* image, void* windowId, core::rect<s32>* srcRect)
|
|
||||||
{
|
|
||||||
#ifdef _IRR_COMPILE_WITH_X11_
|
|
||||||
// this is only necessary for software drivers.
|
|
||||||
if (!SoftwareImage)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// thx to Nadav, who send me some clues of how to display the image
|
|
||||||
// to the X Server.
|
|
||||||
|
|
||||||
const u32 destwidth = SoftwareImage->width;
|
|
||||||
const u32 minWidth = core::min_(image->getDimension().Width, destwidth);
|
|
||||||
const u32 destPitch = SoftwareImage->bytes_per_line;
|
|
||||||
|
|
||||||
video::ECOLOR_FORMAT destColor;
|
|
||||||
switch (SoftwareImage->bits_per_pixel)
|
|
||||||
{
|
|
||||||
case 16:
|
|
||||||
if (SoftwareImage->depth==16)
|
|
||||||
destColor = video::ECF_R5G6B5;
|
|
||||||
else
|
|
||||||
destColor = video::ECF_A1R5G5B5;
|
|
||||||
break;
|
|
||||||
case 24: destColor = video::ECF_R8G8B8; break;
|
|
||||||
case 32: destColor = video::ECF_A8R8G8B8; break;
|
|
||||||
default:
|
|
||||||
os::Printer::log("Unsupported screen depth.");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
u8* srcdata = reinterpret_cast<u8*>(image->getData());
|
|
||||||
u8* destData = reinterpret_cast<u8*>(SoftwareImage->data);
|
|
||||||
|
|
||||||
const u32 destheight = SoftwareImage->height;
|
|
||||||
const u32 srcheight = core::min_(image->getDimension().Height, destheight);
|
|
||||||
const u32 srcPitch = image->getPitch();
|
|
||||||
for (u32 y=0; y!=srcheight; ++y)
|
|
||||||
{
|
|
||||||
video::CColorConverter::convert_viaFormat(srcdata,image->getColorFormat(), minWidth, destData, destColor);
|
|
||||||
srcdata+=srcPitch;
|
|
||||||
destData+=destPitch;
|
|
||||||
}
|
|
||||||
|
|
||||||
GC gc = DefaultGC(XDisplay, DefaultScreen(XDisplay));
|
|
||||||
Window myWindow=XWindow;
|
|
||||||
if (windowId)
|
|
||||||
myWindow = reinterpret_cast<Window>(windowId);
|
|
||||||
XPutImage(XDisplay, myWindow, gc, SoftwareImage, 0, 0, 0, 0, destwidth, destheight);
|
|
||||||
#endif
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//! notifies the device that it should close itself
|
//! notifies the device that it should close itself
|
||||||
void CIrrDeviceLinux::closeDevice()
|
void CIrrDeviceLinux::closeDevice()
|
||||||
{
|
{
|
||||||
@ -1301,6 +1203,13 @@ bool CIrrDeviceLinux::isWindowMinimized() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//! returns last state from maximizeWindow() and restoreWindow()
|
||||||
|
bool CIrrDeviceLinux::isWindowMaximized() const
|
||||||
|
{
|
||||||
|
return WindowMaximized;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//! returns color format of the window.
|
//! returns color format of the window.
|
||||||
video::ECOLOR_FORMAT CIrrDeviceLinux::getColorFormat() const
|
video::ECOLOR_FORMAT CIrrDeviceLinux::getColorFormat() const
|
||||||
{
|
{
|
||||||
@ -1385,6 +1294,8 @@ void CIrrDeviceLinux::maximizeWindow()
|
|||||||
}
|
}
|
||||||
|
|
||||||
XMapWindow(XDisplay, XWindow);
|
XMapWindow(XDisplay, XWindow);
|
||||||
|
|
||||||
|
WindowMaximized = true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1411,6 +1322,8 @@ void CIrrDeviceLinux::restoreWindow()
|
|||||||
}
|
}
|
||||||
|
|
||||||
XMapWindow(XDisplay, XWindow);
|
XMapWindow(XDisplay, XWindow);
|
||||||
|
|
||||||
|
WindowMaximized = false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2118,7 +2031,17 @@ CIrrDeviceLinux::CCursorControl::CCursorControl(CIrrDeviceLinux* dev, bool null)
|
|||||||
if (!Null)
|
if (!Null)
|
||||||
{
|
{
|
||||||
#ifdef _IRR_LINUX_X11_XINPUT2_
|
#ifdef _IRR_LINUX_X11_XINPUT2_
|
||||||
XIGetClientPointer(Device->XDisplay, Device->XWindow, &DeviceId);
|
// XIWarpPointer is entirely broken on multi-head setups (see also [1]),
|
||||||
|
// but behaves better in other cases so we can't just disable it outright.
|
||||||
|
// [1] https://developer.blender.org/rB165caafb99c6846e53d11c4e966990aaffc06cea
|
||||||
|
if (XScreenCount(Device->XDisplay) > 1)
|
||||||
|
{
|
||||||
|
os::Printer::log("Detected classic multi-head setup, not using XIWarpPointer");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
XIGetClientPointer(Device->XDisplay, Device->XWindow, &DeviceId);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
XGCValues values;
|
XGCValues values;
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
#include "CIrrDeviceStub.h"
|
#include "CIrrDeviceStub.h"
|
||||||
#include "IrrlichtDevice.h"
|
#include "IrrlichtDevice.h"
|
||||||
#include "IImagePresenter.h"
|
|
||||||
#include "ICursorControl.h"
|
#include "ICursorControl.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
|
|
||||||
@ -33,7 +32,7 @@
|
|||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
|
|
||||||
class CIrrDeviceLinux : public CIrrDeviceStub, public video::IImagePresenter
|
class CIrrDeviceLinux : public CIrrDeviceStub
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -44,56 +43,56 @@ namespace irr
|
|||||||
virtual ~CIrrDeviceLinux();
|
virtual ~CIrrDeviceLinux();
|
||||||
|
|
||||||
//! runs the device. Returns false if device wants to be deleted
|
//! runs the device. Returns false if device wants to be deleted
|
||||||
virtual bool run() _IRR_OVERRIDE_;
|
bool run() override;
|
||||||
|
|
||||||
//! Cause the device to temporarily pause execution and let other processes to run
|
//! Cause the device to temporarily pause execution and let other processes to run
|
||||||
// This should bring down processor usage without major performance loss for Irrlicht
|
// This should bring down processor usage without major performance loss for Irrlicht
|
||||||
virtual void yield() _IRR_OVERRIDE_;
|
void yield() override;
|
||||||
|
|
||||||
//! Pause execution and let other processes to run for a specified amount of time.
|
//! Pause execution and let other processes to run for a specified amount of time.
|
||||||
virtual void sleep(u32 timeMs, bool pauseTimer) _IRR_OVERRIDE_;
|
void sleep(u32 timeMs, bool pauseTimer) override;
|
||||||
|
|
||||||
//! sets the caption of the window
|
//! sets the caption of the window
|
||||||
virtual void setWindowCaption(const wchar_t* text) _IRR_OVERRIDE_;
|
void setWindowCaption(const wchar_t* text) override;
|
||||||
|
|
||||||
//! returns if window is active. if not, nothing need to be drawn
|
//! returns if window is active. if not, nothing need to be drawn
|
||||||
virtual bool isWindowActive() const _IRR_OVERRIDE_;
|
bool isWindowActive() const override;
|
||||||
|
|
||||||
//! returns if window has focus.
|
//! returns if window has focus.
|
||||||
virtual bool isWindowFocused() const _IRR_OVERRIDE_;
|
bool isWindowFocused() const override;
|
||||||
|
|
||||||
//! returns if window is minimized.
|
//! returns if window is minimized.
|
||||||
virtual bool isWindowMinimized() const _IRR_OVERRIDE_;
|
bool isWindowMinimized() const override;
|
||||||
|
|
||||||
|
//! returns last state from maximizeWindow() and restoreWindow()
|
||||||
|
bool isWindowMaximized() const override;
|
||||||
|
|
||||||
//! returns color format of the window.
|
//! returns color format of the window.
|
||||||
virtual video::ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_;
|
video::ECOLOR_FORMAT getColorFormat() const override;
|
||||||
|
|
||||||
//! presents a surface in the client area
|
|
||||||
virtual bool present(video::IImage* surface, void* windowId=0, core::rect<s32>* src=0 ) _IRR_OVERRIDE_;
|
|
||||||
|
|
||||||
//! notifies the device that it should close itself
|
//! notifies the device that it should close itself
|
||||||
virtual void closeDevice() _IRR_OVERRIDE_;
|
void closeDevice() override;
|
||||||
|
|
||||||
//! Sets if the window should be resizable in windowed mode.
|
//! Sets if the window should be resizable in windowed mode.
|
||||||
virtual void setResizable(bool resize=false) _IRR_OVERRIDE_;
|
void setResizable(bool resize=false) override;
|
||||||
|
|
||||||
//! Resize the render window.
|
//! Resize the render window.
|
||||||
virtual void setWindowSize(const irr::core::dimension2d<u32>& size) _IRR_OVERRIDE_;
|
void setWindowSize(const irr::core::dimension2d<u32>& size) override;
|
||||||
|
|
||||||
//! Minimizes the window.
|
//! Minimizes the window.
|
||||||
virtual void minimizeWindow() _IRR_OVERRIDE_;
|
void minimizeWindow() override;
|
||||||
|
|
||||||
//! Maximizes the window.
|
//! Maximizes the window.
|
||||||
virtual void maximizeWindow() _IRR_OVERRIDE_;
|
void maximizeWindow() override;
|
||||||
|
|
||||||
//! Restores the window size.
|
//! Restores the window size.
|
||||||
virtual void restoreWindow() _IRR_OVERRIDE_;
|
void restoreWindow() override;
|
||||||
|
|
||||||
//! Get the position of this window on screen
|
//! Get the position of this window on screen
|
||||||
virtual core::position2di getWindowPosition() _IRR_OVERRIDE_;
|
core::position2di getWindowPosition() override;
|
||||||
|
|
||||||
//! Activate any joysticks, and generate events for them.
|
//! Activate any joysticks, and generate events for them.
|
||||||
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) _IRR_OVERRIDE_;
|
bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) override;
|
||||||
|
|
||||||
//! gets text from the clipboard
|
//! gets text from the clipboard
|
||||||
//! \return Returns 0 if no string is in there, otherwise utf-8 text.
|
//! \return Returns 0 if no string is in there, otherwise utf-8 text.
|
||||||
@ -105,10 +104,10 @@ namespace irr
|
|||||||
virtual void copyToClipboard(const c8 *text) const;
|
virtual void copyToClipboard(const c8 *text) const;
|
||||||
|
|
||||||
//! Remove all messages pending in the system message loop
|
//! Remove all messages pending in the system message loop
|
||||||
virtual void clearSystemMessages() _IRR_OVERRIDE_;
|
void clearSystemMessages() override;
|
||||||
|
|
||||||
//! Get the device type
|
//! Get the device type
|
||||||
virtual E_DEVICE_TYPE getType() const _IRR_OVERRIDE_
|
E_DEVICE_TYPE getType() const override
|
||||||
{
|
{
|
||||||
return EIDT_X11;
|
return EIDT_X11;
|
||||||
}
|
}
|
||||||
@ -155,7 +154,7 @@ namespace irr
|
|||||||
~CCursorControl();
|
~CCursorControl();
|
||||||
|
|
||||||
//! Changes the visible state of the mouse cursor.
|
//! Changes the visible state of the mouse cursor.
|
||||||
virtual void setVisible(bool visible) _IRR_OVERRIDE_
|
void setVisible(bool visible) override
|
||||||
{
|
{
|
||||||
if (visible==IsVisible)
|
if (visible==IsVisible)
|
||||||
return;
|
return;
|
||||||
@ -172,31 +171,31 @@ namespace irr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Returns if the cursor is currently visible.
|
//! Returns if the cursor is currently visible.
|
||||||
virtual bool isVisible() const _IRR_OVERRIDE_
|
bool isVisible() const override
|
||||||
{
|
{
|
||||||
return IsVisible;
|
return IsVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(const core::position2d<f32> &pos) _IRR_OVERRIDE_
|
void setPosition(const core::position2d<f32> &pos) override
|
||||||
{
|
{
|
||||||
setPosition(pos.X, pos.Y);
|
setPosition(pos.X, pos.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(f32 x, f32 y) _IRR_OVERRIDE_
|
void setPosition(f32 x, f32 y) override
|
||||||
{
|
{
|
||||||
setPosition((s32)(x*Device->Width), (s32)(y*Device->Height));
|
setPosition((s32)(x*Device->Width), (s32)(y*Device->Height));
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(const core::position2d<s32> &pos) _IRR_OVERRIDE_
|
void setPosition(const core::position2d<s32> &pos) override
|
||||||
{
|
{
|
||||||
setPosition(pos.X, pos.Y);
|
setPosition(pos.X, pos.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(s32 x, s32 y) _IRR_OVERRIDE_
|
void setPosition(s32 x, s32 y) override
|
||||||
{
|
{
|
||||||
#ifdef _IRR_COMPILE_WITH_X11_
|
#ifdef _IRR_COMPILE_WITH_X11_
|
||||||
|
|
||||||
@ -261,7 +260,7 @@ namespace irr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the current position of the mouse cursor.
|
//! Returns the current position of the mouse cursor.
|
||||||
virtual const core::position2d<s32>& getPosition(bool updateCursor) _IRR_OVERRIDE_
|
const core::position2d<s32>& getPosition(bool updateCursor) override
|
||||||
{
|
{
|
||||||
if ( updateCursor )
|
if ( updateCursor )
|
||||||
updateCursorPos();
|
updateCursorPos();
|
||||||
@ -269,7 +268,7 @@ namespace irr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the current position of the mouse cursor.
|
//! Returns the current position of the mouse cursor.
|
||||||
virtual core::position2d<f32> getRelativePosition(bool updateCursor) _IRR_OVERRIDE_
|
core::position2d<f32> getRelativePosition(bool updateCursor) override
|
||||||
{
|
{
|
||||||
if ( updateCursor )
|
if ( updateCursor )
|
||||||
updateCursorPos();
|
updateCursorPos();
|
||||||
@ -284,7 +283,7 @@ namespace irr
|
|||||||
CursorPos.Y / (f32)ReferenceRect.getHeight());
|
CursorPos.Y / (f32)ReferenceRect.getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setReferenceRect(core::rect<s32>* rect=0) _IRR_OVERRIDE_
|
void setReferenceRect(core::rect<s32>* rect=0) override
|
||||||
{
|
{
|
||||||
if (rect)
|
if (rect)
|
||||||
{
|
{
|
||||||
@ -304,29 +303,29 @@ namespace irr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the active cursor icon
|
//! Sets the active cursor icon
|
||||||
virtual void setActiveIcon(gui::ECURSOR_ICON iconId) _IRR_OVERRIDE_;
|
void setActiveIcon(gui::ECURSOR_ICON iconId) override;
|
||||||
|
|
||||||
//! Gets the currently active icon
|
//! Gets the currently active icon
|
||||||
virtual gui::ECURSOR_ICON getActiveIcon() const _IRR_OVERRIDE_
|
gui::ECURSOR_ICON getActiveIcon() const override
|
||||||
{
|
{
|
||||||
return ActiveIcon;
|
return ActiveIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Add a custom sprite as cursor icon.
|
//! Add a custom sprite as cursor icon.
|
||||||
virtual gui::ECURSOR_ICON addIcon(const gui::SCursorSprite& icon) _IRR_OVERRIDE_;
|
gui::ECURSOR_ICON addIcon(const gui::SCursorSprite& icon) override;
|
||||||
|
|
||||||
//! replace the given cursor icon.
|
//! replace the given cursor icon.
|
||||||
virtual void changeIcon(gui::ECURSOR_ICON iconId, const gui::SCursorSprite& icon) _IRR_OVERRIDE_;
|
void changeIcon(gui::ECURSOR_ICON iconId, const gui::SCursorSprite& icon) override;
|
||||||
|
|
||||||
//! Return a system-specific size which is supported for cursors. Larger icons will fail, smaller icons might work.
|
//! Return a system-specific size which is supported for cursors. Larger icons will fail, smaller icons might work.
|
||||||
virtual core::dimension2di getSupportedIconSize() const _IRR_OVERRIDE_;
|
core::dimension2di getSupportedIconSize() const override;
|
||||||
|
|
||||||
#ifdef _IRR_COMPILE_WITH_X11_
|
#ifdef _IRR_COMPILE_WITH_X11_
|
||||||
//! Set platform specific behavior flags.
|
//! Set platform specific behavior flags.
|
||||||
virtual void setPlatformBehavior(gui::ECURSOR_PLATFORM_BEHAVIOR behavior) _IRR_OVERRIDE_ {PlatformBehavior = behavior; }
|
void setPlatformBehavior(gui::ECURSOR_PLATFORM_BEHAVIOR behavior) override {PlatformBehavior = behavior; }
|
||||||
|
|
||||||
//! Return platform specific behavior.
|
//! Return platform specific behavior.
|
||||||
virtual gui::ECURSOR_PLATFORM_BEHAVIOR getPlatformBehavior() const _IRR_OVERRIDE_ { return PlatformBehavior; }
|
gui::ECURSOR_PLATFORM_BEHAVIOR getPlatformBehavior() const override { return PlatformBehavior; }
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
void clearCursors();
|
void clearCursors();
|
||||||
@ -410,16 +409,19 @@ namespace irr
|
|||||||
Window XWindow;
|
Window XWindow;
|
||||||
XSetWindowAttributes WndAttributes;
|
XSetWindowAttributes WndAttributes;
|
||||||
XSizeHints* StdHints;
|
XSizeHints* StdHints;
|
||||||
XImage* SoftwareImage;
|
|
||||||
XIM XInputMethod;
|
XIM XInputMethod;
|
||||||
XIC XInputContext;
|
XIC XInputContext;
|
||||||
bool HasNetWM;
|
bool HasNetWM;
|
||||||
// text is utf-8
|
// text is utf-8
|
||||||
mutable core::stringc Clipboard;
|
mutable core::stringc Clipboard;
|
||||||
|
#endif
|
||||||
|
#if defined(_IRR_LINUX_X11_XINPUT2_)
|
||||||
|
int currentTouchedCount;
|
||||||
#endif
|
#endif
|
||||||
u32 Width, Height;
|
u32 Width, Height;
|
||||||
bool WindowHasFocus;
|
bool WindowHasFocus;
|
||||||
bool WindowMinimized;
|
bool WindowMinimized;
|
||||||
|
bool WindowMaximized;
|
||||||
bool ExternalWindow;
|
bool ExternalWindow;
|
||||||
int AutorepeatSupport;
|
int AutorepeatSupport;
|
||||||
|
|
||||||
@ -455,10 +457,6 @@ namespace irr
|
|||||||
};
|
};
|
||||||
core::array<JoystickInfo> ActiveJoysticks;
|
core::array<JoystickInfo> ActiveJoysticks;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_IRR_LINUX_X11_XINPUT2_)
|
|
||||||
int currentTouchedCount;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
#include "CIrrDeviceStub.h"
|
#include "CIrrDeviceStub.h"
|
||||||
#include "IrrlichtDevice.h"
|
#include "IrrlichtDevice.h"
|
||||||
#include "IImagePresenter.h"
|
|
||||||
#include "IGUIEnvironment.h"
|
#include "IGUIEnvironment.h"
|
||||||
#include "ICursorControl.h"
|
#include "ICursorControl.h"
|
||||||
|
|
||||||
@ -36,7 +35,7 @@ namespace irr
|
|||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
class CIrrDeviceMacOSX : public CIrrDeviceStub, video::IImagePresenter
|
class CIrrDeviceMacOSX : public CIrrDeviceStub
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -47,56 +46,53 @@ namespace irr
|
|||||||
virtual ~CIrrDeviceMacOSX();
|
virtual ~CIrrDeviceMacOSX();
|
||||||
|
|
||||||
//! runs the device. Returns false if device wants to be deleted
|
//! runs the device. Returns false if device wants to be deleted
|
||||||
virtual bool run() _IRR_OVERRIDE_;
|
bool run() override;
|
||||||
|
|
||||||
//! Cause the device to temporarily pause execution and let other processes to run
|
//! Cause the device to temporarily pause execution and let other processes to run
|
||||||
// This should bring down processor usage without major performance loss for Irrlicht
|
// This should bring down processor usage without major performance loss for Irrlicht
|
||||||
virtual void yield() _IRR_OVERRIDE_;
|
void yield() override;
|
||||||
|
|
||||||
//! Pause execution and let other processes to run for a specified amount of time.
|
//! Pause execution and let other processes to run for a specified amount of time.
|
||||||
virtual void sleep(u32 timeMs, bool pauseTimer) _IRR_OVERRIDE_;
|
void sleep(u32 timeMs, bool pauseTimer) override;
|
||||||
|
|
||||||
//! sets the caption of the window
|
//! sets the caption of the window
|
||||||
virtual void setWindowCaption(const wchar_t* text) _IRR_OVERRIDE_;
|
void setWindowCaption(const wchar_t* text) override;
|
||||||
|
|
||||||
//! returns if window is active. if not, nothing need to be drawn
|
//! returns if window is active. if not, nothing need to be drawn
|
||||||
virtual bool isWindowActive() const _IRR_OVERRIDE_;
|
bool isWindowActive() const override;
|
||||||
|
|
||||||
//! Checks if the Irrlicht window has focus
|
//! Checks if the Irrlicht window has focus
|
||||||
virtual bool isWindowFocused() const _IRR_OVERRIDE_;
|
bool isWindowFocused() const override;
|
||||||
|
|
||||||
//! Checks if the Irrlicht window is minimized
|
//! Checks if the Irrlicht window is minimized
|
||||||
virtual bool isWindowMinimized() const _IRR_OVERRIDE_;
|
bool isWindowMinimized() const override;
|
||||||
|
|
||||||
//! presents a surface in the client area
|
|
||||||
virtual bool present(video::IImage* surface, void* windowId=0, core::rect<s32>* src=0 ) _IRR_OVERRIDE_;
|
|
||||||
|
|
||||||
//! notifies the device that it should close itself
|
//! notifies the device that it should close itself
|
||||||
virtual void closeDevice() _IRR_OVERRIDE_;
|
void closeDevice() override;
|
||||||
|
|
||||||
//! Sets if the window should be resizable in windowed mode.
|
//! Sets if the window should be resizable in windowed mode.
|
||||||
virtual void setResizable(bool resize) _IRR_OVERRIDE_;
|
void setResizable(bool resize) override;
|
||||||
|
|
||||||
//! Returns true if the window is resizable, false if not
|
//! Returns true if the window is resizable, false if not
|
||||||
virtual bool isResizable() const;
|
virtual bool isResizable() const;
|
||||||
|
|
||||||
//! Minimizes the window if possible
|
//! Minimizes the window if possible
|
||||||
virtual void minimizeWindow() _IRR_OVERRIDE_;
|
void minimizeWindow() override;
|
||||||
|
|
||||||
//! Maximizes the window if possible.
|
//! Maximizes the window if possible.
|
||||||
virtual void maximizeWindow() _IRR_OVERRIDE_;
|
void maximizeWindow() override;
|
||||||
|
|
||||||
//! Restore the window to normal size if possible.
|
//! Restore the window to normal size if possible.
|
||||||
virtual void restoreWindow() _IRR_OVERRIDE_;
|
void restoreWindow() override;
|
||||||
|
|
||||||
//! Get the position of this window on screen
|
//! Get the position of this window on screen
|
||||||
virtual core::position2di getWindowPosition() _IRR_OVERRIDE_;
|
core::position2di getWindowPosition() override;
|
||||||
|
|
||||||
//! Activate any joysticks, and generate events for them.
|
//! Activate any joysticks, and generate events for them.
|
||||||
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) _IRR_OVERRIDE_;
|
bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) override;
|
||||||
|
|
||||||
//! Get the device type
|
//! Get the device type
|
||||||
virtual E_DEVICE_TYPE getType() const _IRR_OVERRIDE_
|
E_DEVICE_TYPE getType() const override
|
||||||
{
|
{
|
||||||
return EIDT_OSX;
|
return EIDT_OSX;
|
||||||
}
|
}
|
||||||
@ -127,39 +123,39 @@ namespace irr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Changes the visible state of the mouse cursor.
|
//! Changes the visible state of the mouse cursor.
|
||||||
virtual void setVisible(bool visible) _IRR_OVERRIDE_
|
void setVisible(bool visible) override
|
||||||
{
|
{
|
||||||
IsVisible = visible;
|
IsVisible = visible;
|
||||||
Device->setCursorVisible(visible);
|
Device->setCursorVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns if the cursor is currently visible.
|
//! Returns if the cursor is currently visible.
|
||||||
virtual bool isVisible() const _IRR_OVERRIDE_
|
bool isVisible() const override
|
||||||
{
|
{
|
||||||
return IsVisible;
|
return IsVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(const core::position2d<f32> &pos) _IRR_OVERRIDE_
|
void setPosition(const core::position2d<f32> &pos) override
|
||||||
{
|
{
|
||||||
setPosition(pos.X, pos.Y);
|
setPosition(pos.X, pos.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(f32 x, f32 y) _IRR_OVERRIDE_
|
void setPosition(f32 x, f32 y) override
|
||||||
{
|
{
|
||||||
setPosition((s32)(x*WindowSize.Width), (s32)(y*WindowSize.Height));
|
setPosition((s32)(x*WindowSize.Width), (s32)(y*WindowSize.Height));
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(const core::position2d<s32> &pos) _IRR_OVERRIDE_
|
void setPosition(const core::position2d<s32> &pos) override
|
||||||
{
|
{
|
||||||
if (CursorPos.X != pos.X || CursorPos.Y != pos.Y)
|
if (CursorPos.X != pos.X || CursorPos.Y != pos.Y)
|
||||||
setPosition(pos.X, pos.Y);
|
setPosition(pos.X, pos.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(s32 x, s32 y) _IRR_OVERRIDE_
|
void setPosition(s32 x, s32 y) override
|
||||||
{
|
{
|
||||||
if (UseReferenceRect)
|
if (UseReferenceRect)
|
||||||
{
|
{
|
||||||
@ -172,13 +168,13 @@ namespace irr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the current position of the mouse cursor.
|
//! Returns the current position of the mouse cursor.
|
||||||
virtual const core::position2d<s32>& getPosition(bool updateCursor) _IRR_OVERRIDE_
|
const core::position2d<s32>& getPosition(bool updateCursor) override
|
||||||
{
|
{
|
||||||
return CursorPos;
|
return CursorPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the current position of the mouse cursor.
|
//! Returns the current position of the mouse cursor.
|
||||||
virtual core::position2d<f32> getRelativePosition(bool updateCursor) _IRR_OVERRIDE_
|
core::position2d<f32> getRelativePosition(bool updateCursor) override
|
||||||
{
|
{
|
||||||
if (!UseReferenceRect)
|
if (!UseReferenceRect)
|
||||||
{
|
{
|
||||||
@ -191,7 +187,7 @@ namespace irr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Sets an absolute reference rect for calculating the cursor position.
|
//! Sets an absolute reference rect for calculating the cursor position.
|
||||||
virtual void setReferenceRect(core::rect<s32>* rect=0) _IRR_OVERRIDE_
|
void setReferenceRect(core::rect<s32>* rect=0) override
|
||||||
{
|
{
|
||||||
if (rect)
|
if (rect)
|
||||||
{
|
{
|
||||||
@ -237,14 +233,12 @@ namespace irr
|
|||||||
|
|
||||||
NSWindow* Window;
|
NSWindow* Window;
|
||||||
CGDirectDisplayID Display;
|
CGDirectDisplayID Display;
|
||||||
NSBitmapImageRep* SoftwareDriverTarget;
|
|
||||||
std::map<int,int> KeyCodes;
|
std::map<int,int> KeyCodes;
|
||||||
int DeviceWidth;
|
int DeviceWidth;
|
||||||
int DeviceHeight;
|
int DeviceHeight;
|
||||||
int ScreenWidth;
|
int ScreenWidth;
|
||||||
int ScreenHeight;
|
int ScreenHeight;
|
||||||
u32 MouseButtonStates;
|
u32 MouseButtonStates;
|
||||||
u32 SoftwareRendererType;
|
|
||||||
bool IsFullscreen;
|
bool IsFullscreen;
|
||||||
bool IsActive;
|
bool IsActive;
|
||||||
bool IsShiftDown;
|
bool IsShiftDown;
|
||||||
|
@ -547,8 +547,8 @@ namespace irr
|
|||||||
//! constructor
|
//! constructor
|
||||||
CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param)
|
CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param)
|
||||||
: CIrrDeviceStub(param), Window(NULL), Display(NULL),
|
: CIrrDeviceStub(param), Window(NULL), Display(NULL),
|
||||||
SoftwareDriverTarget(0), DeviceWidth(0), DeviceHeight(0),
|
DeviceWidth(0), DeviceHeight(0),
|
||||||
ScreenWidth(0), ScreenHeight(0), MouseButtonStates(0), SoftwareRendererType(0),
|
ScreenWidth(0), ScreenHeight(0), MouseButtonStates(0),
|
||||||
IsActive(true), IsFullscreen(false), IsShiftDown(false), IsControlDown(false), IsResizable(false)
|
IsActive(true), IsFullscreen(false), IsShiftDown(false), IsControlDown(false), IsResizable(false)
|
||||||
{
|
{
|
||||||
struct utsname name;
|
struct utsname name;
|
||||||
@ -617,7 +617,6 @@ CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters& param)
|
|||||||
|
|
||||||
CIrrDeviceMacOSX::~CIrrDeviceMacOSX()
|
CIrrDeviceMacOSX::~CIrrDeviceMacOSX()
|
||||||
{
|
{
|
||||||
[SoftwareDriverTarget release];
|
|
||||||
[NSApp setPresentationOptions:(NSApplicationPresentationDefault)];
|
[NSApp setPresentationOptions:(NSApplicationPresentationDefault)];
|
||||||
closeDevice();
|
closeDevice();
|
||||||
#if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
|
#if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
|
||||||
@ -731,24 +730,6 @@ void CIrrDeviceMacOSX::createDriver()
|
|||||||
{
|
{
|
||||||
switch (CreationParams.DriverType)
|
switch (CreationParams.DriverType)
|
||||||
{
|
{
|
||||||
case video::EDT_SOFTWARE:
|
|
||||||
#ifdef _IRR_COMPILE_WITH_SOFTWARE_
|
|
||||||
VideoDriver = video::createSoftwareDriver(CreationParams.WindowSize, CreationParams.Fullscreen, FileSystem, this);
|
|
||||||
SoftwareRendererType = 2;
|
|
||||||
#else
|
|
||||||
os::Printer::log("No Software driver support compiled in.", ELL_ERROR);
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
|
|
||||||
case video::EDT_BURNINGSVIDEO:
|
|
||||||
#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_
|
|
||||||
VideoDriver = video::createBurningVideoDriver(CreationParams, FileSystem, this);
|
|
||||||
SoftwareRendererType = 1;
|
|
||||||
#else
|
|
||||||
os::Printer::log("Burning's video driver was not compiled in.", ELL_ERROR);
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
|
|
||||||
case video::EDT_OPENGL:
|
case video::EDT_OPENGL:
|
||||||
#ifdef _IRR_COMPILE_WITH_OPENGL_
|
#ifdef _IRR_COMPILE_WITH_OPENGL_
|
||||||
{
|
{
|
||||||
@ -1358,87 +1339,6 @@ core::position2di CIrrDeviceMacOSX::getWindowPosition()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool CIrrDeviceMacOSX::present(video::IImage* surface, void* windowId, core::rect<s32>* src )
|
|
||||||
{
|
|
||||||
// todo: implement window ID and src rectangle
|
|
||||||
|
|
||||||
if (!surface)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (SoftwareRendererType > 0)
|
|
||||||
{
|
|
||||||
const u32 colorSamples=3;
|
|
||||||
// do we need to change the size?
|
|
||||||
const bool updateSize = !SoftwareDriverTarget ||
|
|
||||||
s32([SoftwareDriverTarget size].width) != surface->getDimension().Width ||
|
|
||||||
s32([SoftwareDriverTarget size].height) != surface->getDimension().Height;
|
|
||||||
|
|
||||||
NSRect areaRect = NSMakeRect(0.0, 0.0, surface->getDimension().Width, surface->getDimension().Height);
|
|
||||||
const u32 destPitch = (colorSamples * areaRect.size.width);
|
|
||||||
|
|
||||||
// create / update the target
|
|
||||||
if (updateSize)
|
|
||||||
{
|
|
||||||
[SoftwareDriverTarget release];
|
|
||||||
// allocate target for IImage
|
|
||||||
SoftwareDriverTarget = [[NSBitmapImageRep alloc]
|
|
||||||
initWithBitmapDataPlanes: nil
|
|
||||||
pixelsWide: areaRect.size.width
|
|
||||||
pixelsHigh: areaRect.size.height
|
|
||||||
bitsPerSample: 8
|
|
||||||
samplesPerPixel: colorSamples
|
|
||||||
hasAlpha: NO
|
|
||||||
isPlanar: NO
|
|
||||||
colorSpaceName: NSCalibratedRGBColorSpace
|
|
||||||
bytesPerRow: destPitch
|
|
||||||
bitsPerPixel: 8*colorSamples];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (SoftwareDriverTarget==nil)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// get pointer to image data
|
|
||||||
unsigned char* imgData = (unsigned char*)surface->getData();
|
|
||||||
|
|
||||||
u8* srcdata = reinterpret_cast<u8*>(imgData);
|
|
||||||
u8* destData = reinterpret_cast<u8*>([SoftwareDriverTarget bitmapData]);
|
|
||||||
const u32 srcheight = core::min_(surface->getDimension().Height, (u32)areaRect.size.height);
|
|
||||||
const u32 srcPitch = surface->getPitch();
|
|
||||||
const u32 minWidth = core::min_(surface->getDimension().Width, (u32)areaRect.size.width);
|
|
||||||
for (u32 y=0; y!=srcheight; ++y)
|
|
||||||
{
|
|
||||||
if(SoftwareRendererType == 2)
|
|
||||||
{
|
|
||||||
if (surface->getColorFormat() == video::ECF_A8R8G8B8)
|
|
||||||
video::CColorConverter::convert_A8R8G8B8toB8G8R8(srcdata, minWidth, destData);
|
|
||||||
else if (surface->getColorFormat() == video::ECF_A1R5G5B5)
|
|
||||||
video::CColorConverter::convert_A1R5G5B5toB8G8R8(srcdata, minWidth, destData);
|
|
||||||
else
|
|
||||||
video::CColorConverter::convert_viaFormat(srcdata, surface->getColorFormat(), minWidth, destData, video::ECF_R8G8B8);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (surface->getColorFormat() == video::ECF_A8R8G8B8)
|
|
||||||
video::CColorConverter::convert_A8R8G8B8toR8G8B8(srcdata, minWidth, destData);
|
|
||||||
else if (surface->getColorFormat() == video::ECF_A1R5G5B5)
|
|
||||||
video::CColorConverter::convert_A1R5G5B5toR8G8B8(srcdata, minWidth, destData);
|
|
||||||
else
|
|
||||||
video::CColorConverter::convert_viaFormat(srcdata, surface->getColorFormat(), minWidth, destData, video::ECF_R8G8B8);
|
|
||||||
}
|
|
||||||
|
|
||||||
srcdata += srcPitch;
|
|
||||||
destData += destPitch;
|
|
||||||
}
|
|
||||||
|
|
||||||
// todo: draw properly into a sub-view
|
|
||||||
[SoftwareDriverTarget draw];
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#if defined (_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
|
#if defined (_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
|
||||||
static void joystickRemovalCallback(void * target,
|
static void joystickRemovalCallback(void * target,
|
||||||
IOReturn result, void * refcon, void * sender)
|
IOReturn result, void * refcon, void * sender)
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
#include "CIrrDeviceSDL.h"
|
#include "CIrrDeviceSDL.h"
|
||||||
#include "IEventReceiver.h"
|
#include "IEventReceiver.h"
|
||||||
|
#include "IGUIElement.h"
|
||||||
|
#include "IGUIEnvironment.h"
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "CTimer.h"
|
#include "CTimer.h"
|
||||||
#include "irrString.h"
|
#include "irrString.h"
|
||||||
@ -105,13 +107,105 @@ EM_BOOL CIrrDeviceSDL::MouseLeaveCallback(int eventType, const EmscriptenMouseEv
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
bool CIrrDeviceSDL::keyIsKnownSpecial(EKEY_CODE key)
|
||||||
|
{
|
||||||
|
switch ( key )
|
||||||
|
{
|
||||||
|
// keys which are known to have safe special character interpretation
|
||||||
|
// could need changes over time (removals and additions!)
|
||||||
|
case KEY_RETURN:
|
||||||
|
case KEY_PAUSE:
|
||||||
|
case KEY_ESCAPE:
|
||||||
|
case KEY_PRIOR:
|
||||||
|
case KEY_NEXT:
|
||||||
|
case KEY_HOME:
|
||||||
|
case KEY_END:
|
||||||
|
case KEY_LEFT:
|
||||||
|
case KEY_UP:
|
||||||
|
case KEY_RIGHT:
|
||||||
|
case KEY_DOWN:
|
||||||
|
case KEY_TAB:
|
||||||
|
case KEY_PRINT:
|
||||||
|
case KEY_SNAPSHOT:
|
||||||
|
case KEY_INSERT:
|
||||||
|
case KEY_BACK:
|
||||||
|
case KEY_DELETE:
|
||||||
|
case KEY_HELP:
|
||||||
|
case KEY_APPS:
|
||||||
|
case KEY_SLEEP:
|
||||||
|
case KEY_F1:
|
||||||
|
case KEY_F2:
|
||||||
|
case KEY_F3:
|
||||||
|
case KEY_F4:
|
||||||
|
case KEY_F5:
|
||||||
|
case KEY_F6:
|
||||||
|
case KEY_F7:
|
||||||
|
case KEY_F8:
|
||||||
|
case KEY_F9:
|
||||||
|
case KEY_F10:
|
||||||
|
case KEY_F11:
|
||||||
|
case KEY_F12:
|
||||||
|
case KEY_F13:
|
||||||
|
case KEY_F14:
|
||||||
|
case KEY_F15:
|
||||||
|
case KEY_F16:
|
||||||
|
case KEY_F17:
|
||||||
|
case KEY_F18:
|
||||||
|
case KEY_F19:
|
||||||
|
case KEY_F20:
|
||||||
|
case KEY_F21:
|
||||||
|
case KEY_F22:
|
||||||
|
case KEY_F23:
|
||||||
|
case KEY_F24:
|
||||||
|
case KEY_NUMLOCK:
|
||||||
|
case KEY_SCROLL:
|
||||||
|
case KEY_LCONTROL:
|
||||||
|
case KEY_RCONTROL:
|
||||||
|
return true;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int CIrrDeviceSDL::findCharToPassToIrrlicht(int assumedChar, EKEY_CODE key) {
|
||||||
|
// SDL in-place ORs values with no character representation with 1<<30
|
||||||
|
// https://wiki.libsdl.org/SDL2/SDLKeycodeLookup
|
||||||
|
if (assumedChar & (1<<30))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
switch (key) {
|
||||||
|
case KEY_PRIOR:
|
||||||
|
case KEY_NEXT:
|
||||||
|
case KEY_HOME:
|
||||||
|
case KEY_END:
|
||||||
|
case KEY_LEFT:
|
||||||
|
case KEY_UP:
|
||||||
|
case KEY_RIGHT:
|
||||||
|
case KEY_DOWN:
|
||||||
|
case KEY_NUMLOCK:
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return assumedChar;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CIrrDeviceSDL::resetReceiveTextInputEvents() {
|
||||||
|
gui::IGUIElement *elem = GUIEnvironment->getFocus();
|
||||||
|
if (elem && elem->acceptsIME())
|
||||||
|
SDL_StartTextInput();
|
||||||
|
else
|
||||||
|
SDL_StopTextInput();
|
||||||
|
}
|
||||||
|
|
||||||
//! constructor
|
//! constructor
|
||||||
CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
|
CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
|
||||||
: CIrrDeviceStub(param),
|
: CIrrDeviceStub(param),
|
||||||
Window((SDL_Window*)param.WindowId), SDL_Flags(0),
|
Window((SDL_Window*)param.WindowId), SDL_Flags(0),
|
||||||
MouseX(0), MouseY(0), MouseXRel(0), MouseYRel(0), MouseButtonStates(0),
|
MouseX(0), MouseY(0), MouseXRel(0), MouseYRel(0), MouseButtonStates(0),
|
||||||
Width(param.WindowSize.Width), Height(param.WindowSize.Height),
|
Width(param.WindowSize.Width), Height(param.WindowSize.Height),
|
||||||
Resizable(param.WindowResizable == 1 ? true : false), WindowMinimized(false)
|
Resizable(param.WindowResizable == 1 ? true : false)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
setDebugName("CIrrDeviceSDL");
|
setDebugName("CIrrDeviceSDL");
|
||||||
@ -119,13 +213,13 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
|
|||||||
|
|
||||||
if ( ++SDLDeviceInstances == 1 )
|
if ( ++SDLDeviceInstances == 1 )
|
||||||
{
|
{
|
||||||
// Initialize SDL... Timer for sleep, video for the obvious, and
|
u32 flags = SDL_INIT_TIMER | SDL_INIT_EVENTS;
|
||||||
// noparachute prevents SDL from catching fatal errors.
|
if (CreationParams.DriverType != video::EDT_NULL)
|
||||||
if (SDL_Init( SDL_INIT_TIMER|SDL_INIT_VIDEO|
|
flags |= SDL_INIT_VIDEO;
|
||||||
#if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
|
#if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
|
||||||
SDL_INIT_JOYSTICK|
|
flags |= SDL_INIT_JOYSTICK;
|
||||||
#endif
|
#endif
|
||||||
SDL_INIT_NOPARACHUTE ) < 0)
|
if (SDL_Init(flags) < 0)
|
||||||
{
|
{
|
||||||
os::Printer::log( "Unable to initialize SDL!", SDL_GetError());
|
os::Printer::log( "Unable to initialize SDL!", SDL_GetError());
|
||||||
Close = true;
|
Close = true;
|
||||||
@ -139,10 +233,18 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
|
|||||||
// create keymap
|
// create keymap
|
||||||
createKeyMap();
|
createKeyMap();
|
||||||
|
|
||||||
if ( CreationParams.Fullscreen )
|
if (CreationParams.Fullscreen) {
|
||||||
|
#ifdef _IRR_EMSCRIPTEN_PLATFORM_
|
||||||
SDL_Flags |= SDL_WINDOW_FULLSCREEN;
|
SDL_Flags |= SDL_WINDOW_FULLSCREEN;
|
||||||
else if ( Resizable )
|
#else
|
||||||
|
SDL_Flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
if (Resizable)
|
||||||
SDL_Flags |= SDL_WINDOW_RESIZABLE;
|
SDL_Flags |= SDL_WINDOW_RESIZABLE;
|
||||||
|
if (CreationParams.WindowMaximized)
|
||||||
|
SDL_Flags |= SDL_WINDOW_MAXIMIZED;
|
||||||
|
|
||||||
if (CreationParams.DriverType == video::EDT_OPENGL)
|
if (CreationParams.DriverType == video::EDT_OPENGL)
|
||||||
{
|
{
|
||||||
SDL_Flags |= SDL_WINDOW_OPENGL;
|
SDL_Flags |= SDL_WINDOW_OPENGL;
|
||||||
@ -160,6 +262,7 @@ CIrrDeviceSDL::CIrrDeviceSDL(const SIrrlichtCreationParameters& param)
|
|||||||
createWindow();
|
createWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SDL_VERSION(&Info.version);
|
SDL_VERSION(&Info.version);
|
||||||
|
|
||||||
#ifndef _IRR_EMSCRIPTEN_PLATFORM_
|
#ifndef _IRR_EMSCRIPTEN_PLATFORM_
|
||||||
@ -372,22 +475,6 @@ void CIrrDeviceSDL::createDriver()
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case video::EDT_SOFTWARE:
|
|
||||||
#ifdef _IRR_COMPILE_WITH_SOFTWARE_
|
|
||||||
VideoDriver = video::createSoftwareDriver(CreationParams.WindowSize, CreationParams.Fullscreen, FileSystem, this);
|
|
||||||
#else
|
|
||||||
os::Printer::log("No Software driver support compiled in.", ELL_ERROR);
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
|
|
||||||
case video::EDT_BURNINGSVIDEO:
|
|
||||||
#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_
|
|
||||||
VideoDriver = video::createBurningVideoDriver(CreationParams, FileSystem, this);
|
|
||||||
#else
|
|
||||||
os::Printer::log("Burning's video driver was not compiled in.", ELL_ERROR);
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
|
|
||||||
case video::EDT_OPENGL:
|
case video::EDT_OPENGL:
|
||||||
#ifdef _IRR_COMPILE_WITH_OPENGL_
|
#ifdef _IRR_COMPILE_WITH_OPENGL_
|
||||||
ContextManager = new video::CSDLManager(this);
|
ContextManager = new video::CSDLManager(this);
|
||||||
@ -463,7 +550,9 @@ bool CIrrDeviceSDL::run()
|
|||||||
|
|
||||||
switch ( SDL_event.type )
|
switch ( SDL_event.type )
|
||||||
{
|
{
|
||||||
case SDL_MOUSEMOTION:
|
case SDL_MOUSEMOTION: {
|
||||||
|
SDL_Keymod keymod = SDL_GetModState();
|
||||||
|
|
||||||
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||||
irrevent.MouseInput.Event = irr::EMIE_MOUSE_MOVED;
|
irrevent.MouseInput.Event = irr::EMIE_MOUSE_MOVED;
|
||||||
MouseX = irrevent.MouseInput.X = SDL_event.motion.x;
|
MouseX = irrevent.MouseInput.X = SDL_event.motion.x;
|
||||||
@ -471,20 +560,35 @@ bool CIrrDeviceSDL::run()
|
|||||||
MouseXRel = SDL_event.motion.xrel;
|
MouseXRel = SDL_event.motion.xrel;
|
||||||
MouseYRel = SDL_event.motion.yrel;
|
MouseYRel = SDL_event.motion.yrel;
|
||||||
irrevent.MouseInput.ButtonStates = MouseButtonStates;
|
irrevent.MouseInput.ButtonStates = MouseButtonStates;
|
||||||
|
irrevent.MouseInput.Shift = (keymod & KMOD_SHIFT) != 0;
|
||||||
|
irrevent.MouseInput.Control = (keymod & KMOD_CTRL) != 0;
|
||||||
|
|
||||||
postEventFromUser(irrevent);
|
postEventFromUser(irrevent);
|
||||||
break;
|
break;
|
||||||
case SDL_MOUSEWHEEL:
|
}
|
||||||
|
case SDL_MOUSEWHEEL: {
|
||||||
|
SDL_Keymod keymod = SDL_GetModState();
|
||||||
|
|
||||||
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||||
irrevent.MouseInput.Event = irr::EMIE_MOUSE_WHEEL;
|
irrevent.MouseInput.Event = irr::EMIE_MOUSE_WHEEL;
|
||||||
irrevent.MouseInput.Wheel = static_cast<float>(SDL_event.wheel.y);
|
irrevent.MouseInput.Wheel = static_cast<float>(SDL_event.wheel.y);
|
||||||
|
irrevent.MouseInput.Shift = (keymod & KMOD_SHIFT) != 0;
|
||||||
|
irrevent.MouseInput.Control = (keymod & KMOD_CTRL) != 0;
|
||||||
|
irrevent.MouseInput.X = MouseX;
|
||||||
|
irrevent.MouseInput.Y = MouseY;
|
||||||
|
|
||||||
postEventFromUser(irrevent);
|
postEventFromUser(irrevent);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case SDL_MOUSEBUTTONDOWN:
|
case SDL_MOUSEBUTTONDOWN:
|
||||||
case SDL_MOUSEBUTTONUP:
|
case SDL_MOUSEBUTTONUP: {
|
||||||
|
SDL_Keymod keymod = SDL_GetModState();
|
||||||
|
|
||||||
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT;
|
||||||
irrevent.MouseInput.X = SDL_event.button.x;
|
irrevent.MouseInput.X = SDL_event.button.x;
|
||||||
irrevent.MouseInput.Y = SDL_event.button.y;
|
irrevent.MouseInput.Y = SDL_event.button.y;
|
||||||
|
irrevent.MouseInput.Shift = (keymod & KMOD_SHIFT) != 0;
|
||||||
|
irrevent.MouseInput.Control = (keymod & KMOD_CTRL) != 0;
|
||||||
|
|
||||||
irrevent.MouseInput.Event = irr::EMIE_MOUSE_MOVED;
|
irrevent.MouseInput.Event = irr::EMIE_MOUSE_MOVED;
|
||||||
|
|
||||||
@ -579,6 +683,7 @@ bool CIrrDeviceSDL::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case SDL_TEXTINPUT:
|
case SDL_TEXTINPUT:
|
||||||
{
|
{
|
||||||
@ -604,6 +709,10 @@ bool CIrrDeviceSDL::run()
|
|||||||
else
|
else
|
||||||
key = (EKEY_CODE)KeyMap[idx].Win32Key;
|
key = (EKEY_CODE)KeyMap[idx].Win32Key;
|
||||||
|
|
||||||
|
// Make sure to only input special characters if something is in focus, as SDL_TEXTINPUT handles normal unicode already
|
||||||
|
if (SDL_IsTextInputActive() && !keyIsKnownSpecial(key) && (SDL_event.key.keysym.mod & KMOD_CTRL) == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
#ifdef _IRR_WINDOWS_API_
|
#ifdef _IRR_WINDOWS_API_
|
||||||
// handle alt+f4 in Windows, because SDL seems not to
|
// handle alt+f4 in Windows, because SDL seems not to
|
||||||
if ( (SDL_event.key.keysym.mod & KMOD_LALT) && key == KEY_F4)
|
if ( (SDL_event.key.keysym.mod & KMOD_LALT) && key == KEY_F4)
|
||||||
@ -617,12 +726,7 @@ bool CIrrDeviceSDL::run()
|
|||||||
irrevent.KeyInput.PressedDown = (SDL_event.type == SDL_KEYDOWN);
|
irrevent.KeyInput.PressedDown = (SDL_event.type == SDL_KEYDOWN);
|
||||||
irrevent.KeyInput.Shift = (SDL_event.key.keysym.mod & KMOD_SHIFT) != 0;
|
irrevent.KeyInput.Shift = (SDL_event.key.keysym.mod & KMOD_SHIFT) != 0;
|
||||||
irrevent.KeyInput.Control = (SDL_event.key.keysym.mod & KMOD_CTRL ) != 0;
|
irrevent.KeyInput.Control = (SDL_event.key.keysym.mod & KMOD_CTRL ) != 0;
|
||||||
// These keys are handled differently in CGUIEditBox.cpp (may become out of date!)
|
irrevent.KeyInput.Char = findCharToPassToIrrlicht(mp.SDLKey, key);
|
||||||
// Control key is used in special character combinations, so keep that too
|
|
||||||
// Pass through the keysym only then so no extra text gets input
|
|
||||||
irrevent.KeyInput.Char = 0;
|
|
||||||
if (mp.SDLKey == SDLK_DELETE || mp.SDLKey == SDLK_RETURN || mp.SDLKey == SDLK_BACKSPACE || irrevent.KeyInput.Control)
|
|
||||||
irrevent.KeyInput.Char = mp.SDLKey;
|
|
||||||
postEventFromUser(irrevent);
|
postEventFromUser(irrevent);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -634,12 +738,6 @@ bool CIrrDeviceSDL::run()
|
|||||||
case SDL_WINDOWEVENT:
|
case SDL_WINDOWEVENT:
|
||||||
switch (SDL_event.window.event)
|
switch (SDL_event.window.event)
|
||||||
{
|
{
|
||||||
case SDL_WINDOWEVENT_MAXIMIZED:
|
|
||||||
WindowMinimized = true;
|
|
||||||
break;
|
|
||||||
case SDL_WINDOWEVENT_RESTORED:
|
|
||||||
WindowMinimized = false;
|
|
||||||
break;
|
|
||||||
case SDL_WINDOWEVENT_RESIZED:
|
case SDL_WINDOWEVENT_RESIZED:
|
||||||
if ((SDL_event.window.data1 != (int)Width) || (SDL_event.window.data2 != (int)Height))
|
if ((SDL_event.window.data1 != (int)Width) || (SDL_event.window.data2 != (int)Height))
|
||||||
{
|
{
|
||||||
@ -662,7 +760,7 @@ bool CIrrDeviceSDL::run()
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
} // end switch
|
} // end switch
|
||||||
|
resetReceiveTextInputEvents();
|
||||||
} // end while
|
} // end while
|
||||||
|
|
||||||
#if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
|
#if defined(_IRR_COMPILE_WITH_JOYSTICK_EVENTS_)
|
||||||
@ -828,90 +926,6 @@ void CIrrDeviceSDL::setWindowCaption(const wchar_t* text)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! presents a surface in the client area
|
|
||||||
bool CIrrDeviceSDL::present(video::IImage* surface, void* windowId, core::rect<s32>* srcClip)
|
|
||||||
{
|
|
||||||
#ifdef _IRR_EMSCRIPTEN_PLATFORM_
|
|
||||||
return true;
|
|
||||||
#else // !_IRR_EMSCRIPTEN_PLATFORM_
|
|
||||||
SDL_Surface *sdlSurface = SDL_CreateRGBSurfaceFrom(
|
|
||||||
surface->getData(), surface->getDimension().Width, surface->getDimension().Height,
|
|
||||||
surface->getBitsPerPixel(), surface->getPitch(),
|
|
||||||
surface->getRedMask(), surface->getGreenMask(), surface->getBlueMask(), surface->getAlphaMask());
|
|
||||||
if (!sdlSurface)
|
|
||||||
return false;
|
|
||||||
SDL_SetSurfaceAlphaMod(sdlSurface, 0);
|
|
||||||
SDL_SetColorKey(sdlSurface, 0, 0);
|
|
||||||
sdlSurface->format->BitsPerPixel=surface->getBitsPerPixel();
|
|
||||||
sdlSurface->format->BytesPerPixel=surface->getBytesPerPixel();
|
|
||||||
if ((surface->getColorFormat()==video::ECF_R8G8B8) ||
|
|
||||||
(surface->getColorFormat()==video::ECF_A8R8G8B8))
|
|
||||||
{
|
|
||||||
sdlSurface->format->Rloss=0;
|
|
||||||
sdlSurface->format->Gloss=0;
|
|
||||||
sdlSurface->format->Bloss=0;
|
|
||||||
sdlSurface->format->Rshift=16;
|
|
||||||
sdlSurface->format->Gshift=8;
|
|
||||||
sdlSurface->format->Bshift=0;
|
|
||||||
if (surface->getColorFormat()==video::ECF_R8G8B8)
|
|
||||||
{
|
|
||||||
sdlSurface->format->Aloss=8;
|
|
||||||
sdlSurface->format->Ashift=32;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sdlSurface->format->Aloss=0;
|
|
||||||
sdlSurface->format->Ashift=24;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (surface->getColorFormat()==video::ECF_R5G6B5)
|
|
||||||
{
|
|
||||||
sdlSurface->format->Rloss=3;
|
|
||||||
sdlSurface->format->Gloss=2;
|
|
||||||
sdlSurface->format->Bloss=3;
|
|
||||||
sdlSurface->format->Aloss=8;
|
|
||||||
sdlSurface->format->Rshift=11;
|
|
||||||
sdlSurface->format->Gshift=5;
|
|
||||||
sdlSurface->format->Bshift=0;
|
|
||||||
sdlSurface->format->Ashift=16;
|
|
||||||
}
|
|
||||||
else if (surface->getColorFormat()==video::ECF_A1R5G5B5)
|
|
||||||
{
|
|
||||||
sdlSurface->format->Rloss=3;
|
|
||||||
sdlSurface->format->Gloss=3;
|
|
||||||
sdlSurface->format->Bloss=3;
|
|
||||||
sdlSurface->format->Aloss=7;
|
|
||||||
sdlSurface->format->Rshift=10;
|
|
||||||
sdlSurface->format->Gshift=5;
|
|
||||||
sdlSurface->format->Bshift=0;
|
|
||||||
sdlSurface->format->Ashift=15;
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_Surface* scr = (SDL_Surface* )windowId;
|
|
||||||
if (!scr)
|
|
||||||
scr = SDL_GetWindowSurface(Window);
|
|
||||||
if (scr)
|
|
||||||
{
|
|
||||||
if (srcClip)
|
|
||||||
{
|
|
||||||
SDL_Rect sdlsrcClip;
|
|
||||||
sdlsrcClip.x = srcClip->UpperLeftCorner.X;
|
|
||||||
sdlsrcClip.y = srcClip->UpperLeftCorner.Y;
|
|
||||||
sdlsrcClip.w = srcClip->getWidth();
|
|
||||||
sdlsrcClip.h = srcClip->getHeight();
|
|
||||||
SDL_BlitSurface(sdlSurface, &sdlsrcClip, scr, NULL);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
SDL_BlitSurface(sdlSurface, NULL, scr, NULL);
|
|
||||||
SDL_RenderPresent(SDL_GetRenderer(Window));
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_FreeSurface(sdlSurface);
|
|
||||||
return (scr != 0);
|
|
||||||
#endif // !_IRR_EMSCRIPTEN_PLATFORM_
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//! notifies the device that it should close itself
|
//! notifies the device that it should close itself
|
||||||
void CIrrDeviceSDL::closeDevice()
|
void CIrrDeviceSDL::closeDevice()
|
||||||
{
|
{
|
||||||
@ -944,16 +958,16 @@ void CIrrDeviceSDL::setResizable(bool resize)
|
|||||||
//! Minimizes window if possible
|
//! Minimizes window if possible
|
||||||
void CIrrDeviceSDL::minimizeWindow()
|
void CIrrDeviceSDL::minimizeWindow()
|
||||||
{
|
{
|
||||||
if (Window) {
|
if (Window)
|
||||||
SDL_MinimizeWindow(Window);
|
SDL_MinimizeWindow(Window);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! Maximize window
|
//! Maximize window
|
||||||
void CIrrDeviceSDL::maximizeWindow()
|
void CIrrDeviceSDL::maximizeWindow()
|
||||||
{
|
{
|
||||||
// do nothing
|
if (Window)
|
||||||
|
SDL_MaximizeWindow(Window);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get the position of this window on screen
|
//! Get the position of this window on screen
|
||||||
@ -966,7 +980,13 @@ core::position2di CIrrDeviceSDL::getWindowPosition()
|
|||||||
//! Restore original window size
|
//! Restore original window size
|
||||||
void CIrrDeviceSDL::restoreWindow()
|
void CIrrDeviceSDL::restoreWindow()
|
||||||
{
|
{
|
||||||
// do nothing
|
if (Window)
|
||||||
|
SDL_RestoreWindow(Window);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CIrrDeviceSDL::isWindowMaximized() const
|
||||||
|
{
|
||||||
|
return Window && (SDL_GetWindowFlags(Window) & SDL_WINDOW_MAXIMIZED) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CIrrDeviceSDL::isFullscreen() const
|
bool CIrrDeviceSDL::isFullscreen() const
|
||||||
@ -1001,14 +1021,14 @@ bool CIrrDeviceSDL::isWindowActive() const
|
|||||||
//! returns if window has focus.
|
//! returns if window has focus.
|
||||||
bool CIrrDeviceSDL::isWindowFocused() const
|
bool CIrrDeviceSDL::isWindowFocused() const
|
||||||
{
|
{
|
||||||
return SDL_GetWindowFlags(Window) & SDL_WINDOW_INPUT_FOCUS;
|
return Window && (SDL_GetWindowFlags(Window) & SDL_WINDOW_INPUT_FOCUS) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! returns if window is minimized.
|
//! returns if window is minimized.
|
||||||
bool CIrrDeviceSDL::isWindowMinimized() const
|
bool CIrrDeviceSDL::isWindowMinimized() const
|
||||||
{
|
{
|
||||||
return WindowMinimized;
|
return Window && (SDL_GetWindowFlags(Window) & SDL_WINDOW_MINIMIZED) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1179,6 +1199,25 @@ void CIrrDeviceSDL::createKeyMap()
|
|||||||
KeyMap.sort();
|
KeyMap.sort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CIrrDeviceSDL::CCursorControl::initCursors()
|
||||||
|
{
|
||||||
|
Cursors.reserve(gui::ECI_COUNT);
|
||||||
|
|
||||||
|
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_ARROW)); // ECI_NORMAL
|
||||||
|
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_CROSSHAIR)); // ECI_CROSS
|
||||||
|
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_HAND)); // ECI_HAND
|
||||||
|
Cursors.emplace_back(nullptr); // ECI_HELP
|
||||||
|
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_IBEAM)); // ECI_IBEAM
|
||||||
|
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_NO)); // ECI_NO
|
||||||
|
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_WAIT)); // ECI_WAIT
|
||||||
|
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZEALL)); // ECI_SIZEALL
|
||||||
|
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENESW)); // ECI_SIZENESW
|
||||||
|
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENWSE)); // ECI_SIZENWSE
|
||||||
|
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZENS)); // ECI_SIZENS
|
||||||
|
Cursors.emplace_back(SDL_CreateSystemCursor(SDL_SYSTEM_CURSOR_SIZEWE)); // ECI_SIZEWE
|
||||||
|
Cursors.emplace_back(nullptr); // ECI_UP
|
||||||
|
}
|
||||||
|
|
||||||
} // end namespace irr
|
} // end namespace irr
|
||||||
|
|
||||||
#endif // _IRR_COMPILE_WITH_SDL_DEVICE_
|
#endif // _IRR_COMPILE_WITH_SDL_DEVICE_
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
#include "IrrlichtDevice.h"
|
#include "IrrlichtDevice.h"
|
||||||
#include "CIrrDeviceStub.h"
|
#include "CIrrDeviceStub.h"
|
||||||
#include "IImagePresenter.h"
|
|
||||||
#include "ICursorControl.h"
|
#include "ICursorControl.h"
|
||||||
|
|
||||||
#ifdef _IRR_EMSCRIPTEN_PLATFORM_
|
#ifdef _IRR_EMSCRIPTEN_PLATFORM_
|
||||||
@ -23,10 +22,12 @@
|
|||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <SDL_syswm.h>
|
#include <SDL_syswm.h>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
|
|
||||||
class CIrrDeviceSDL : public CIrrDeviceStub, video::IImagePresenter
|
class CIrrDeviceSDL : public CIrrDeviceStub
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -37,59 +38,59 @@ namespace irr
|
|||||||
virtual ~CIrrDeviceSDL();
|
virtual ~CIrrDeviceSDL();
|
||||||
|
|
||||||
//! runs the device. Returns false if device wants to be deleted
|
//! runs the device. Returns false if device wants to be deleted
|
||||||
virtual bool run() _IRR_OVERRIDE_;
|
bool run() override;
|
||||||
|
|
||||||
//! pause execution temporarily
|
//! pause execution temporarily
|
||||||
virtual void yield() _IRR_OVERRIDE_;
|
void yield() override;
|
||||||
|
|
||||||
//! pause execution for a specified time
|
//! pause execution for a specified time
|
||||||
virtual void sleep(u32 timeMs, bool pauseTimer) _IRR_OVERRIDE_;
|
void sleep(u32 timeMs, bool pauseTimer) override;
|
||||||
|
|
||||||
//! sets the caption of the window
|
//! sets the caption of the window
|
||||||
virtual void setWindowCaption(const wchar_t* text) _IRR_OVERRIDE_;
|
void setWindowCaption(const wchar_t* text) override;
|
||||||
|
|
||||||
//! returns if window is active. if not, nothing need to be drawn
|
//! returns if window is active. if not, nothing need to be drawn
|
||||||
virtual bool isWindowActive() const _IRR_OVERRIDE_;
|
bool isWindowActive() const override;
|
||||||
|
|
||||||
//! returns if window has focus.
|
//! returns if window has focus.
|
||||||
bool isWindowFocused() const _IRR_OVERRIDE_;
|
bool isWindowFocused() const override;
|
||||||
|
|
||||||
//! returns if window is minimized.
|
//! returns if window is minimized.
|
||||||
bool isWindowMinimized() const _IRR_OVERRIDE_;
|
bool isWindowMinimized() const override;
|
||||||
|
|
||||||
//! returns color format of the window.
|
//! returns color format of the window.
|
||||||
video::ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_;
|
video::ECOLOR_FORMAT getColorFormat() const override;
|
||||||
|
|
||||||
//! presents a surface in the client area
|
|
||||||
virtual bool present(video::IImage* surface, void* windowId=0, core::rect<s32>* src=0) _IRR_OVERRIDE_;
|
|
||||||
|
|
||||||
//! notifies the device that it should close itself
|
//! notifies the device that it should close itself
|
||||||
virtual void closeDevice() _IRR_OVERRIDE_;
|
void closeDevice() override;
|
||||||
|
|
||||||
//! Sets if the window should be resizable in windowed mode.
|
//! Sets if the window should be resizable in windowed mode.
|
||||||
virtual void setResizable(bool resize=false) _IRR_OVERRIDE_;
|
void setResizable(bool resize=false) override;
|
||||||
|
|
||||||
//! Minimizes the window.
|
//! Minimizes the window.
|
||||||
virtual void minimizeWindow() _IRR_OVERRIDE_;
|
void minimizeWindow() override;
|
||||||
|
|
||||||
//! Maximizes the window.
|
//! Maximizes the window.
|
||||||
virtual void maximizeWindow() _IRR_OVERRIDE_;
|
void maximizeWindow() override;
|
||||||
|
|
||||||
//! Restores the window size.
|
//! Restores the window size.
|
||||||
virtual void restoreWindow() _IRR_OVERRIDE_;
|
void restoreWindow() override;
|
||||||
|
|
||||||
|
//! Checks if the window is maximized.
|
||||||
|
bool isWindowMaximized() const override;
|
||||||
|
|
||||||
//! Checks if the Irrlicht window is running in fullscreen mode
|
//! Checks if the Irrlicht window is running in fullscreen mode
|
||||||
/** \return True if window is fullscreen. */
|
/** \return True if window is fullscreen. */
|
||||||
virtual bool isFullscreen() const _IRR_OVERRIDE_;
|
bool isFullscreen() const override;
|
||||||
|
|
||||||
//! Get the position of this window on screen
|
//! Get the position of this window on screen
|
||||||
virtual core::position2di getWindowPosition() _IRR_OVERRIDE_;
|
core::position2di getWindowPosition() override;
|
||||||
|
|
||||||
//! Activate any joysticks, and generate events for them.
|
//! Activate any joysticks, and generate events for them.
|
||||||
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) _IRR_OVERRIDE_;
|
bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) override;
|
||||||
|
|
||||||
//! Get the device type
|
//! Get the device type
|
||||||
virtual E_DEVICE_TYPE getType() const _IRR_OVERRIDE_
|
E_DEVICE_TYPE getType() const override
|
||||||
{
|
{
|
||||||
return EIDT_SDL;
|
return EIDT_SDL;
|
||||||
}
|
}
|
||||||
@ -104,10 +105,11 @@ namespace irr
|
|||||||
CCursorControl(CIrrDeviceSDL* dev)
|
CCursorControl(CIrrDeviceSDL* dev)
|
||||||
: Device(dev), IsVisible(true)
|
: Device(dev), IsVisible(true)
|
||||||
{
|
{
|
||||||
|
initCursors();
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Changes the visible state of the mouse cursor.
|
//! Changes the visible state of the mouse cursor.
|
||||||
virtual void setVisible(bool visible) _IRR_OVERRIDE_
|
void setVisible(bool visible) override
|
||||||
{
|
{
|
||||||
IsVisible = visible;
|
IsVisible = visible;
|
||||||
if ( visible )
|
if ( visible )
|
||||||
@ -119,37 +121,43 @@ namespace irr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Returns if the cursor is currently visible.
|
//! Returns if the cursor is currently visible.
|
||||||
virtual bool isVisible() const _IRR_OVERRIDE_
|
bool isVisible() const override
|
||||||
{
|
{
|
||||||
return IsVisible;
|
return IsVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(const core::position2d<f32> &pos) _IRR_OVERRIDE_
|
void setPosition(const core::position2d<f32> &pos) override
|
||||||
{
|
{
|
||||||
setPosition(pos.X, pos.Y);
|
setPosition(pos.X, pos.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(f32 x, f32 y) _IRR_OVERRIDE_
|
void setPosition(f32 x, f32 y) override
|
||||||
{
|
{
|
||||||
setPosition((s32)(x*Device->Width), (s32)(y*Device->Height));
|
setPosition((s32)(x*Device->Width), (s32)(y*Device->Height));
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(const core::position2d<s32> &pos) _IRR_OVERRIDE_
|
void setPosition(const core::position2d<s32> &pos) override
|
||||||
{
|
{
|
||||||
setPosition(pos.X, pos.Y);
|
setPosition(pos.X, pos.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(s32 x, s32 y) _IRR_OVERRIDE_
|
void setPosition(s32 x, s32 y) override
|
||||||
{
|
{
|
||||||
SDL_WarpMouseInWindow(Device->Window, x, y);
|
SDL_WarpMouseInWindow(Device->Window, x, y);
|
||||||
|
|
||||||
|
if (SDL_GetRelativeMouseMode()) {
|
||||||
|
// There won't be an event for this warp (details on libsdl-org/SDL/issues/6034)
|
||||||
|
Device->MouseX = x;
|
||||||
|
Device->MouseY = y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the current position of the mouse cursor.
|
//! Returns the current position of the mouse cursor.
|
||||||
virtual const core::position2d<s32>& getPosition(bool updateCursor) _IRR_OVERRIDE_
|
const core::position2d<s32>& getPosition(bool updateCursor) override
|
||||||
{
|
{
|
||||||
if ( updateCursor )
|
if ( updateCursor )
|
||||||
updateCursorPos();
|
updateCursorPos();
|
||||||
@ -157,7 +165,7 @@ namespace irr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the current position of the mouse cursor.
|
//! Returns the current position of the mouse cursor.
|
||||||
virtual core::position2d<f32> getRelativePosition(bool updateCursor) _IRR_OVERRIDE_
|
core::position2d<f32> getRelativePosition(bool updateCursor) override
|
||||||
{
|
{
|
||||||
if ( updateCursor )
|
if ( updateCursor )
|
||||||
updateCursorPos();
|
updateCursorPos();
|
||||||
@ -165,10 +173,37 @@ namespace irr
|
|||||||
CursorPos.Y / (f32)Device->Height);
|
CursorPos.Y / (f32)Device->Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void setReferenceRect(core::rect<s32>* rect=0) _IRR_OVERRIDE_
|
void setReferenceRect(core::rect<s32>* rect=0) override
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void setRelativeMode(bool relative) _IRR_OVERRIDE_
|
||||||
|
{
|
||||||
|
// Only change it when necessary, as it flushes mouse motion when enabled
|
||||||
|
if ( relative != SDL_GetRelativeMouseMode()) {
|
||||||
|
if ( relative )
|
||||||
|
SDL_SetRelativeMouseMode( SDL_TRUE );
|
||||||
|
else
|
||||||
|
SDL_SetRelativeMouseMode( SDL_FALSE );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void setActiveIcon(gui::ECURSOR_ICON iconId) override
|
||||||
|
{
|
||||||
|
ActiveIcon = iconId;
|
||||||
|
if (iconId > Cursors.size() || !Cursors[iconId]) {
|
||||||
|
iconId = gui::ECI_NORMAL;
|
||||||
|
if (iconId > Cursors.size() || !Cursors[iconId])
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
SDL_SetCursor(Cursors[iconId].get());
|
||||||
|
}
|
||||||
|
|
||||||
|
gui::ECURSOR_ICON getActiveIcon() const override
|
||||||
|
{
|
||||||
|
return ActiveIcon;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void updateCursorPos()
|
void updateCursorPos()
|
||||||
@ -205,9 +240,20 @@ namespace irr
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void initCursors();
|
||||||
|
|
||||||
CIrrDeviceSDL* Device;
|
CIrrDeviceSDL* Device;
|
||||||
core::position2d<s32> CursorPos;
|
core::position2d<s32> CursorPos;
|
||||||
bool IsVisible;
|
bool IsVisible;
|
||||||
|
|
||||||
|
struct CursorDeleter {
|
||||||
|
void operator()(SDL_Cursor *ptr) {
|
||||||
|
if (ptr)
|
||||||
|
SDL_FreeCursor(ptr);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
std::vector<std::unique_ptr<SDL_Cursor, CursorDeleter>> Cursors;
|
||||||
|
gui::ECURSOR_ICON ActiveIcon;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -218,6 +264,15 @@ namespace irr
|
|||||||
static EM_BOOL MouseLeaveCallback(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData);
|
static EM_BOOL MouseLeaveCallback(int eventType, const EmscriptenMouseEvent *mouseEvent, void *userData);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
// Check if a key is a known special character with no side effects on text boxes.
|
||||||
|
static bool keyIsKnownSpecial(EKEY_CODE key);
|
||||||
|
|
||||||
|
// Return the Char that should be sent to Irrlicht for the given key (either the one passed in or 0).
|
||||||
|
static int findCharToPassToIrrlicht(int assumedChar, EKEY_CODE key);
|
||||||
|
|
||||||
|
// Check if a text box is in focus. Enable or disable SDL_TEXTINPUT events only if in focus.
|
||||||
|
void resetReceiveTextInputEvents();
|
||||||
|
|
||||||
//! create the driver
|
//! create the driver
|
||||||
void createDriver();
|
void createDriver();
|
||||||
|
|
||||||
@ -240,7 +295,6 @@ namespace irr
|
|||||||
u32 Width, Height;
|
u32 Width, Height;
|
||||||
|
|
||||||
bool Resizable;
|
bool Resizable;
|
||||||
bool WindowMinimized;
|
|
||||||
|
|
||||||
struct SKeyMap
|
struct SKeyMap
|
||||||
{
|
{
|
||||||
|
@ -272,6 +272,13 @@ void CIrrDeviceStub::setInputReceivingSceneManager(scene::ISceneManager* sceneMa
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//! Checks if the window is maximized.
|
||||||
|
bool CIrrDeviceStub::isWindowMaximized() const
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//! Checks if the window is running in fullscreen mode
|
//! Checks if the window is running in fullscreen mode
|
||||||
bool CIrrDeviceStub::isFullscreen() const
|
bool CIrrDeviceStub::isFullscreen() const
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#define __C_IRR_DEVICE_STUB_H_INCLUDED__
|
#define __C_IRR_DEVICE_STUB_H_INCLUDED__
|
||||||
|
|
||||||
#include "IrrlichtDevice.h"
|
#include "IrrlichtDevice.h"
|
||||||
#include "IImagePresenter.h"
|
|
||||||
#include "SIrrCreationParameters.h"
|
#include "SIrrCreationParameters.h"
|
||||||
#include "IContextManager.h"
|
#include "IContextManager.h"
|
||||||
|
|
||||||
@ -36,11 +35,6 @@ namespace irr
|
|||||||
|
|
||||||
namespace video
|
namespace video
|
||||||
{
|
{
|
||||||
IVideoDriver* createSoftwareDriver(const core::dimension2d<u32>& windowSize,
|
|
||||||
bool fullscreen, io::IFileSystem* io,
|
|
||||||
video::IImagePresenter* presenter);
|
|
||||||
IVideoDriver* createBurningVideoDriver(const irr::SIrrlichtCreationParameters& params,
|
|
||||||
io::IFileSystem* io, video::IImagePresenter* presenter);
|
|
||||||
IVideoDriver* createNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& screenSize);
|
IVideoDriver* createNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& screenSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,105 +52,108 @@ namespace irr
|
|||||||
virtual ~CIrrDeviceStub();
|
virtual ~CIrrDeviceStub();
|
||||||
|
|
||||||
//! returns the video driver
|
//! returns the video driver
|
||||||
virtual video::IVideoDriver* getVideoDriver() _IRR_OVERRIDE_;
|
video::IVideoDriver* getVideoDriver() override;
|
||||||
|
|
||||||
//! return file system
|
//! return file system
|
||||||
virtual io::IFileSystem* getFileSystem() _IRR_OVERRIDE_;
|
io::IFileSystem* getFileSystem() override;
|
||||||
|
|
||||||
//! returns the gui environment
|
//! returns the gui environment
|
||||||
virtual gui::IGUIEnvironment* getGUIEnvironment() _IRR_OVERRIDE_;
|
gui::IGUIEnvironment* getGUIEnvironment() override;
|
||||||
|
|
||||||
//! returns the scene manager
|
//! returns the scene manager
|
||||||
virtual scene::ISceneManager* getSceneManager() _IRR_OVERRIDE_;
|
scene::ISceneManager* getSceneManager() override;
|
||||||
|
|
||||||
//! \return Returns a pointer to the mouse cursor control interface.
|
//! \return Returns a pointer to the mouse cursor control interface.
|
||||||
virtual gui::ICursorControl* getCursorControl() _IRR_OVERRIDE_;
|
gui::ICursorControl* getCursorControl() override;
|
||||||
|
|
||||||
//! return the context manager
|
//! return the context manager
|
||||||
virtual video::IContextManager* getContextManager() _IRR_OVERRIDE_;
|
video::IContextManager* getContextManager() override;
|
||||||
|
|
||||||
//! Returns a pointer to the ITimer object. With it the current Time can be received.
|
//! Returns a pointer to the ITimer object. With it the current Time can be received.
|
||||||
virtual ITimer* getTimer() _IRR_OVERRIDE_;
|
ITimer* getTimer() override;
|
||||||
|
|
||||||
//! Returns the version of the engine.
|
//! Returns the version of the engine.
|
||||||
virtual const char* getVersion() const _IRR_OVERRIDE_;
|
const char* getVersion() const override;
|
||||||
|
|
||||||
//! send the event to the right receiver
|
//! send the event to the right receiver
|
||||||
virtual bool postEventFromUser(const SEvent& event) _IRR_OVERRIDE_;
|
bool postEventFromUser(const SEvent& event) override;
|
||||||
|
|
||||||
//! Sets a new event receiver to receive events
|
//! Sets a new event receiver to receive events
|
||||||
virtual void setEventReceiver(IEventReceiver* receiver) _IRR_OVERRIDE_;
|
void setEventReceiver(IEventReceiver* receiver) override;
|
||||||
|
|
||||||
//! Returns pointer to the current event receiver. Returns 0 if there is none.
|
//! Returns pointer to the current event receiver. Returns 0 if there is none.
|
||||||
virtual IEventReceiver* getEventReceiver() _IRR_OVERRIDE_;
|
IEventReceiver* getEventReceiver() override;
|
||||||
|
|
||||||
//! Sets the input receiving scene manager.
|
//! Sets the input receiving scene manager.
|
||||||
/** If set to null, the main scene manager (returned by GetSceneManager()) will receive the input */
|
/** If set to null, the main scene manager (returned by GetSceneManager()) will receive the input */
|
||||||
virtual void setInputReceivingSceneManager(scene::ISceneManager* sceneManager) _IRR_OVERRIDE_;
|
void setInputReceivingSceneManager(scene::ISceneManager* sceneManager) override;
|
||||||
|
|
||||||
//! Returns a pointer to the logger.
|
//! Returns a pointer to the logger.
|
||||||
virtual ILogger* getLogger() _IRR_OVERRIDE_;
|
ILogger* getLogger() override;
|
||||||
|
|
||||||
//! Returns the operation system opertator object.
|
//! Returns the operation system opertator object.
|
||||||
virtual IOSOperator* getOSOperator() _IRR_OVERRIDE_;
|
IOSOperator* getOSOperator() override;
|
||||||
|
|
||||||
|
//! Checks if the window is maximized.
|
||||||
|
bool isWindowMaximized() const override;
|
||||||
|
|
||||||
//! Checks if the window is running in fullscreen mode.
|
//! Checks if the window is running in fullscreen mode.
|
||||||
virtual bool isFullscreen() const _IRR_OVERRIDE_;
|
bool isFullscreen() const override;
|
||||||
|
|
||||||
//! get color format of the current window
|
//! get color format of the current window
|
||||||
virtual video::ECOLOR_FORMAT getColorFormat() const _IRR_OVERRIDE_;
|
video::ECOLOR_FORMAT getColorFormat() const override;
|
||||||
|
|
||||||
//! Activate any joysticks, and generate events for them.
|
//! Activate any joysticks, and generate events for them.
|
||||||
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) _IRR_OVERRIDE_;
|
bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) override;
|
||||||
|
|
||||||
//! Activate accelerometer.
|
//! Activate accelerometer.
|
||||||
virtual bool activateAccelerometer(float updateInterval = 0.016666f) _IRR_OVERRIDE_;
|
bool activateAccelerometer(float updateInterval = 0.016666f) override;
|
||||||
|
|
||||||
//! Deactivate accelerometer.
|
//! Deactivate accelerometer.
|
||||||
virtual bool deactivateAccelerometer() _IRR_OVERRIDE_;
|
bool deactivateAccelerometer() override;
|
||||||
|
|
||||||
//! Is accelerometer active.
|
//! Is accelerometer active.
|
||||||
virtual bool isAccelerometerActive() _IRR_OVERRIDE_;
|
bool isAccelerometerActive() override;
|
||||||
|
|
||||||
//! Is accelerometer available.
|
//! Is accelerometer available.
|
||||||
virtual bool isAccelerometerAvailable() _IRR_OVERRIDE_;
|
bool isAccelerometerAvailable() override;
|
||||||
|
|
||||||
//! Activate gyroscope.
|
//! Activate gyroscope.
|
||||||
virtual bool activateGyroscope(float updateInterval = 0.016666f) _IRR_OVERRIDE_;
|
bool activateGyroscope(float updateInterval = 0.016666f) override;
|
||||||
|
|
||||||
//! Deactivate gyroscope.
|
//! Deactivate gyroscope.
|
||||||
virtual bool deactivateGyroscope() _IRR_OVERRIDE_;
|
bool deactivateGyroscope() override;
|
||||||
|
|
||||||
//! Is gyroscope active.
|
//! Is gyroscope active.
|
||||||
virtual bool isGyroscopeActive() _IRR_OVERRIDE_;
|
bool isGyroscopeActive() override;
|
||||||
|
|
||||||
//! Is gyroscope available.
|
//! Is gyroscope available.
|
||||||
virtual bool isGyroscopeAvailable() _IRR_OVERRIDE_;
|
bool isGyroscopeAvailable() override;
|
||||||
|
|
||||||
//! Activate device motion.
|
//! Activate device motion.
|
||||||
virtual bool activateDeviceMotion(float updateInterval = 0.016666f) _IRR_OVERRIDE_;
|
bool activateDeviceMotion(float updateInterval = 0.016666f) override;
|
||||||
|
|
||||||
//! Deactivate device motion.
|
//! Deactivate device motion.
|
||||||
virtual bool deactivateDeviceMotion() _IRR_OVERRIDE_;
|
bool deactivateDeviceMotion() override;
|
||||||
|
|
||||||
//! Is device motion active.
|
//! Is device motion active.
|
||||||
virtual bool isDeviceMotionActive() _IRR_OVERRIDE_;
|
bool isDeviceMotionActive() override;
|
||||||
|
|
||||||
//! Is device motion available.
|
//! Is device motion available.
|
||||||
virtual bool isDeviceMotionAvailable() _IRR_OVERRIDE_;
|
bool isDeviceMotionAvailable() override;
|
||||||
|
|
||||||
//! Set the maximal elapsed time between 2 clicks to generate doubleclicks for the mouse. It also affects tripleclick behavior.
|
//! Set the maximal elapsed time between 2 clicks to generate doubleclicks for the mouse. It also affects tripleclick behavior.
|
||||||
//! When set to 0 no double- and tripleclicks will be generated.
|
//! When set to 0 no double- and tripleclicks will be generated.
|
||||||
virtual void setDoubleClickTime( u32 timeMs ) _IRR_OVERRIDE_;
|
void setDoubleClickTime( u32 timeMs ) override;
|
||||||
|
|
||||||
//! Get the maximal elapsed time between 2 clicks to generate double- and tripleclicks for the mouse.
|
//! Get the maximal elapsed time between 2 clicks to generate double- and tripleclicks for the mouse.
|
||||||
virtual u32 getDoubleClickTime() const _IRR_OVERRIDE_;
|
u32 getDoubleClickTime() const override;
|
||||||
|
|
||||||
//! Remove all messages pending in the system message loop
|
//! Remove all messages pending in the system message loop
|
||||||
virtual void clearSystemMessages() _IRR_OVERRIDE_;
|
void clearSystemMessages() override;
|
||||||
|
|
||||||
//! Resize the render window.
|
//! Resize the render window.
|
||||||
virtual void setWindowSize(const irr::core::dimension2d<u32>& size) _IRR_OVERRIDE_ {}
|
void setWindowSize(const irr::core::dimension2d<u32>& size) override {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -720,7 +720,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
dev->postEventFromUser(event);
|
dev->postEventFromUser(event);
|
||||||
|
|
||||||
if (message == WM_SYSKEYDOWN || message == WM_SYSKEYUP)
|
if (message == WM_SYSKEYDOWN || message == WM_SYSKEYUP)
|
||||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
return DefWindowProcW(hWnd, message, wParam, lParam);
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -774,7 +774,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
KEYBOARD_INPUT_HKL = GetKeyboardLayout(0);
|
KEYBOARD_INPUT_HKL = GetKeyboardLayout(0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
return DefWindowProcW(hWnd, message, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -784,7 +784,8 @@ namespace irr
|
|||||||
//! constructor
|
//! constructor
|
||||||
CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
|
CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
|
||||||
: CIrrDeviceStub(params), HWnd(0), Resized(false),
|
: CIrrDeviceStub(params), HWnd(0), Resized(false),
|
||||||
ExternalWindow(false), Win32CursorControl(0), JoyControl(0)
|
ExternalWindow(false), Win32CursorControl(0), JoyControl(0),
|
||||||
|
WindowMaximized(params.WindowMaximized)
|
||||||
{
|
{
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
setDebugName("CIrrDeviceWin32");
|
setDebugName("CIrrDeviceWin32");
|
||||||
@ -802,11 +803,11 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
|
|||||||
// create the window if we need to and we do not use the null device
|
// create the window if we need to and we do not use the null device
|
||||||
if (!CreationParams.WindowId && CreationParams.DriverType != video::EDT_NULL)
|
if (!CreationParams.WindowId && CreationParams.DriverType != video::EDT_NULL)
|
||||||
{
|
{
|
||||||
const fschar_t* ClassName = __TEXT("CIrrDeviceWin32");
|
const wchar_t* ClassName = L"CIrrDeviceWin32";
|
||||||
|
|
||||||
// Register Class
|
// Register Class
|
||||||
WNDCLASSEX wcex;
|
WNDCLASSEXW wcex;
|
||||||
wcex.cbSize = sizeof(WNDCLASSEX);
|
wcex.cbSize = sizeof(WNDCLASSEXW);
|
||||||
wcex.style = CS_HREDRAW | CS_VREDRAW;
|
wcex.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
wcex.lpfnWndProc = WndProc;
|
wcex.lpfnWndProc = WndProc;
|
||||||
wcex.cbClsExtra = 0;
|
wcex.cbClsExtra = 0;
|
||||||
@ -820,9 +821,9 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
|
|||||||
wcex.hIconSm = 0;
|
wcex.hIconSm = 0;
|
||||||
|
|
||||||
// if there is an icon, load it
|
// if there is an icon, load it
|
||||||
wcex.hIcon = (HICON)LoadImage(hInstance, __TEXT("irrlicht.ico"), IMAGE_ICON, 0,0, LR_LOADFROMFILE | LR_DEFAULTSIZE);
|
wcex.hIcon = (HICON)LoadImageW(hInstance, L"irrlicht.ico", IMAGE_ICON, 0,0, LR_LOADFROMFILE | LR_DEFAULTSIZE);
|
||||||
|
|
||||||
RegisterClassEx(&wcex);
|
RegisterClassExW(&wcex);
|
||||||
|
|
||||||
// calculate client size
|
// calculate client size
|
||||||
|
|
||||||
@ -857,7 +858,7 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create window
|
// create window
|
||||||
HWnd = CreateWindow( ClassName, __TEXT(""), style, windowLeft, windowTop,
|
HWnd = CreateWindowW( ClassName, L"", style, windowLeft, windowTop,
|
||||||
realWidth, realHeight, NULL, NULL, hInstance, NULL);
|
realWidth, realHeight, NULL, NULL, hInstance, NULL);
|
||||||
if (!HWnd)
|
if (!HWnd)
|
||||||
{
|
{
|
||||||
@ -923,6 +924,9 @@ CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters& params)
|
|||||||
|
|
||||||
// inform driver about the window size etc.
|
// inform driver about the window size etc.
|
||||||
resizeIfNecessary();
|
resizeIfNecessary();
|
||||||
|
|
||||||
|
if (params.WindowMaximized)
|
||||||
|
maximizeWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1009,24 +1013,6 @@ void CIrrDeviceWin32::createDriver()
|
|||||||
case video::EDT_WEBGL1:
|
case video::EDT_WEBGL1:
|
||||||
os::Printer::log("WebGL1 driver not supported on Win32 device.", ELL_ERROR);
|
os::Printer::log("WebGL1 driver not supported on Win32 device.", ELL_ERROR);
|
||||||
break;
|
break;
|
||||||
case video::EDT_SOFTWARE:
|
|
||||||
#ifdef _IRR_COMPILE_WITH_SOFTWARE_
|
|
||||||
switchToFullScreen();
|
|
||||||
|
|
||||||
VideoDriver = video::createSoftwareDriver(CreationParams.WindowSize, CreationParams.Fullscreen, FileSystem, this);
|
|
||||||
#else
|
|
||||||
os::Printer::log("Software driver was not compiled in.", ELL_ERROR);
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
case video::EDT_BURNINGSVIDEO:
|
|
||||||
#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_
|
|
||||||
switchToFullScreen();
|
|
||||||
|
|
||||||
VideoDriver = video::createBurningVideoDriver(CreationParams, FileSystem, this);
|
|
||||||
#else
|
|
||||||
os::Printer::log("Burning's Video driver was not compiled in.", ELL_ERROR);
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
case video::EDT_NULL:
|
case video::EDT_NULL:
|
||||||
VideoDriver = video::createNullDriver(FileSystem, CreationParams.WindowSize);
|
VideoDriver = video::createNullDriver(FileSystem, CreationParams.WindowSize);
|
||||||
break;
|
break;
|
||||||
@ -1127,54 +1113,6 @@ void CIrrDeviceWin32::setWindowCaption(const wchar_t* text)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//! presents a surface in the client area
|
|
||||||
bool CIrrDeviceWin32::present(video::IImage* image, void* windowId, core::rect<s32>* src)
|
|
||||||
{
|
|
||||||
HWND hwnd = HWnd;
|
|
||||||
if ( windowId )
|
|
||||||
hwnd = static_cast<HWND>(windowId);
|
|
||||||
|
|
||||||
HDC dc = GetDC(hwnd);
|
|
||||||
|
|
||||||
if ( dc )
|
|
||||||
{
|
|
||||||
RECT rect;
|
|
||||||
GetClientRect(hwnd, &rect);
|
|
||||||
const void* memory = (const void *)image->getData();
|
|
||||||
|
|
||||||
BITMAPV4HEADER bi;
|
|
||||||
ZeroMemory (&bi, sizeof(bi));
|
|
||||||
bi.bV4Size = sizeof(BITMAPINFOHEADER);
|
|
||||||
bi.bV4BitCount = (WORD)image->getBitsPerPixel();
|
|
||||||
bi.bV4Planes = 1;
|
|
||||||
bi.bV4Width = image->getDimension().Width;
|
|
||||||
bi.bV4Height = -((s32)image->getDimension().Height);
|
|
||||||
bi.bV4V4Compression = BI_BITFIELDS;
|
|
||||||
bi.bV4AlphaMask = image->getAlphaMask();
|
|
||||||
bi.bV4RedMask = image->getRedMask();
|
|
||||||
bi.bV4GreenMask = image->getGreenMask();
|
|
||||||
bi.bV4BlueMask = image->getBlueMask();
|
|
||||||
|
|
||||||
if ( src )
|
|
||||||
{
|
|
||||||
StretchDIBits(dc, 0,0, rect.right, rect.bottom,
|
|
||||||
src->UpperLeftCorner.X, src->UpperLeftCorner.Y,
|
|
||||||
src->getWidth(), src->getHeight(),
|
|
||||||
memory, (const BITMAPINFO*)(&bi), DIB_RGB_COLORS, SRCCOPY);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
StretchDIBits(dc, 0,0, rect.right, rect.bottom,
|
|
||||||
0, 0, image->getDimension().Width, image->getDimension().Height,
|
|
||||||
memory, (const BITMAPINFO*)(&bi), DIB_RGB_COLORS, SRCCOPY);
|
|
||||||
}
|
|
||||||
|
|
||||||
ReleaseDC(hwnd, dc);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//! notifies the device that it should close itself
|
//! notifies the device that it should close itself
|
||||||
void CIrrDeviceWin32::closeDevice()
|
void CIrrDeviceWin32::closeDevice()
|
||||||
{
|
{
|
||||||
@ -1185,9 +1123,9 @@ void CIrrDeviceWin32::closeDevice()
|
|||||||
PostQuitMessage(0);
|
PostQuitMessage(0);
|
||||||
PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE);
|
PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE);
|
||||||
DestroyWindow(HWnd);
|
DestroyWindow(HWnd);
|
||||||
const fschar_t* ClassName = __TEXT("CIrrDeviceWin32");
|
const wchar_t* ClassName = L"CIrrDeviceWin32";
|
||||||
HINSTANCE hInstance = GetModuleHandle(0);
|
HINSTANCE hInstance = GetModuleHandle(0);
|
||||||
UnregisterClass(ClassName, hInstance);
|
UnregisterClassW(ClassName, hInstance);
|
||||||
}
|
}
|
||||||
Close=true;
|
Close=true;
|
||||||
}
|
}
|
||||||
@ -1220,6 +1158,13 @@ bool CIrrDeviceWin32::isWindowMinimized() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//! returns last state from maximizeWindow() and restoreWindow()
|
||||||
|
bool CIrrDeviceWin32::isWindowMaximized() const
|
||||||
|
{
|
||||||
|
return WindowMaximized;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//! switches to fullscreen
|
//! switches to fullscreen
|
||||||
bool CIrrDeviceWin32::switchToFullScreen()
|
bool CIrrDeviceWin32::switchToFullScreen()
|
||||||
{
|
{
|
||||||
@ -1344,6 +1289,8 @@ void CIrrDeviceWin32::maximizeWindow()
|
|||||||
GetWindowPlacement(HWnd, &wndpl);
|
GetWindowPlacement(HWnd, &wndpl);
|
||||||
wndpl.showCmd = SW_SHOWMAXIMIZED;
|
wndpl.showCmd = SW_SHOWMAXIMIZED;
|
||||||
SetWindowPlacement(HWnd, &wndpl);
|
SetWindowPlacement(HWnd, &wndpl);
|
||||||
|
|
||||||
|
WindowMaximized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1355,6 +1302,8 @@ void CIrrDeviceWin32::restoreWindow()
|
|||||||
GetWindowPlacement(HWnd, &wndpl);
|
GetWindowPlacement(HWnd, &wndpl);
|
||||||
wndpl.showCmd = SW_SHOWNORMAL;
|
wndpl.showCmd = SW_SHOWNORMAL;
|
||||||
SetWindowPlacement(HWnd, &wndpl);
|
SetWindowPlacement(HWnd, &wndpl);
|
||||||
|
|
||||||
|
WindowMaximized = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
core::position2di CIrrDeviceWin32::getWindowPosition()
|
core::position2di CIrrDeviceWin32::getWindowPosition()
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
#include "CIrrDeviceStub.h"
|
#include "CIrrDeviceStub.h"
|
||||||
#include "IrrlichtDevice.h"
|
#include "IrrlichtDevice.h"
|
||||||
#include "IImagePresenter.h"
|
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
@ -25,7 +24,7 @@ namespace irr
|
|||||||
{
|
{
|
||||||
struct SJoystickWin32Control;
|
struct SJoystickWin32Control;
|
||||||
|
|
||||||
class CIrrDeviceWin32 : public CIrrDeviceStub, video::IImagePresenter
|
class CIrrDeviceWin32 : public CIrrDeviceStub
|
||||||
{
|
{
|
||||||
friend struct SJoystickWin32Control;
|
friend struct SJoystickWin32Control;
|
||||||
public:
|
public:
|
||||||
@ -37,70 +36,70 @@ namespace irr
|
|||||||
virtual ~CIrrDeviceWin32();
|
virtual ~CIrrDeviceWin32();
|
||||||
|
|
||||||
//! runs the device. Returns false if device wants to be deleted
|
//! runs the device. Returns false if device wants to be deleted
|
||||||
virtual bool run() _IRR_OVERRIDE_;
|
bool run() override;
|
||||||
|
|
||||||
//! Cause the device to temporarily pause execution and let other processes to run
|
//! Cause the device to temporarily pause execution and let other processes to run
|
||||||
// This should bring down processor usage without major performance loss for Irrlicht
|
// This should bring down processor usage without major performance loss for Irrlicht
|
||||||
virtual void yield() _IRR_OVERRIDE_;
|
void yield() override;
|
||||||
|
|
||||||
//! Pause execution and let other processes to run for a specified amount of time.
|
//! Pause execution and let other processes to run for a specified amount of time.
|
||||||
virtual void sleep(u32 timeMs, bool pauseTimer) _IRR_OVERRIDE_;
|
void sleep(u32 timeMs, bool pauseTimer) override;
|
||||||
|
|
||||||
//! sets the caption of the window
|
//! sets the caption of the window
|
||||||
virtual void setWindowCaption(const wchar_t* text) _IRR_OVERRIDE_;
|
void setWindowCaption(const wchar_t* text) override;
|
||||||
|
|
||||||
//! returns if window is active. if not, nothing need to be drawn
|
//! returns if window is active. if not, nothing need to be drawn
|
||||||
virtual bool isWindowActive() const _IRR_OVERRIDE_;
|
bool isWindowActive() const override;
|
||||||
|
|
||||||
//! returns if window has focus
|
//! returns if window has focus
|
||||||
virtual bool isWindowFocused() const _IRR_OVERRIDE_;
|
bool isWindowFocused() const override;
|
||||||
|
|
||||||
//! returns if window is minimized
|
//! returns if window is minimized
|
||||||
virtual bool isWindowMinimized() const _IRR_OVERRIDE_;
|
bool isWindowMinimized() const override;
|
||||||
|
|
||||||
//! presents a surface in the client area
|
//! returns last state from maximizeWindow() and restoreWindow()
|
||||||
virtual bool present(video::IImage* surface, void* windowId=0, core::rect<s32>* src=0) _IRR_OVERRIDE_;
|
bool isWindowMaximized() const override;
|
||||||
|
|
||||||
//! notifies the device that it should close itself
|
//! notifies the device that it should close itself
|
||||||
virtual void closeDevice() _IRR_OVERRIDE_;
|
void closeDevice() override;
|
||||||
|
|
||||||
//! Notifies the device, that it has been resized
|
//! Notifies the device, that it has been resized
|
||||||
/** Must be publis as it is called from free function (event handler) */
|
/** Must be publis as it is called from free function (event handler) */
|
||||||
void OnResized();
|
void OnResized();
|
||||||
|
|
||||||
//! Sets if the window should be resizable in windowed mode.
|
//! Sets if the window should be resizable in windowed mode.
|
||||||
virtual void setResizable(bool resize=false) _IRR_OVERRIDE_;
|
void setResizable(bool resize=false) override;
|
||||||
|
|
||||||
//! Resize the render window.
|
//! Resize the render window.
|
||||||
virtual void setWindowSize(const irr::core::dimension2d<u32>& size) _IRR_OVERRIDE_;
|
void setWindowSize(const irr::core::dimension2d<u32>& size) override;
|
||||||
|
|
||||||
//! Minimizes the window.
|
//! Minimizes the window.
|
||||||
virtual void minimizeWindow() _IRR_OVERRIDE_;
|
void minimizeWindow() override;
|
||||||
|
|
||||||
//! Maximizes the window.
|
//! Maximizes the window.
|
||||||
virtual void maximizeWindow() _IRR_OVERRIDE_;
|
void maximizeWindow() override;
|
||||||
|
|
||||||
//! Restores the window size.
|
//! Restores the window size.
|
||||||
virtual void restoreWindow() _IRR_OVERRIDE_;
|
void restoreWindow() override;
|
||||||
|
|
||||||
//! Get the position of the window on screen
|
//! Get the position of the window on screen
|
||||||
virtual core::position2di getWindowPosition() _IRR_OVERRIDE_;
|
core::position2di getWindowPosition() override;
|
||||||
|
|
||||||
//! Activate any joysticks, and generate events for them.
|
//! Activate any joysticks, and generate events for them.
|
||||||
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) _IRR_OVERRIDE_;
|
bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) override;
|
||||||
|
|
||||||
//! Remove all messages pending in the system message loop
|
//! Remove all messages pending in the system message loop
|
||||||
virtual void clearSystemMessages() _IRR_OVERRIDE_;
|
void clearSystemMessages() override;
|
||||||
|
|
||||||
//! Get the device type
|
//! Get the device type
|
||||||
virtual E_DEVICE_TYPE getType() const _IRR_OVERRIDE_
|
E_DEVICE_TYPE getType() const override
|
||||||
{
|
{
|
||||||
return EIDT_WIN32;
|
return EIDT_WIN32;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Compares to the last call of this function to return double and triple clicks.
|
//! Compares to the last call of this function to return double and triple clicks.
|
||||||
//! \return Returns only 1,2 or 3. A 4th click will start with 1 again.
|
//! \return Returns only 1,2 or 3. A 4th click will start with 1 again.
|
||||||
virtual u32 checkSuccessiveClicks(s32 mouseX, s32 mouseY, EMOUSE_INPUT_EVENT inputEvent ) _IRR_OVERRIDE_
|
u32 checkSuccessiveClicks(s32 mouseX, s32 mouseY, EMOUSE_INPUT_EVENT inputEvent ) override
|
||||||
{
|
{
|
||||||
// we just have to make it public
|
// we just have to make it public
|
||||||
return CIrrDeviceStub::checkSuccessiveClicks(mouseX, mouseY, inputEvent );
|
return CIrrDeviceStub::checkSuccessiveClicks(mouseX, mouseY, inputEvent );
|
||||||
@ -121,7 +120,7 @@ namespace irr
|
|||||||
~CCursorControl();
|
~CCursorControl();
|
||||||
|
|
||||||
//! Changes the visible state of the mouse cursor.
|
//! Changes the visible state of the mouse cursor.
|
||||||
virtual void setVisible(bool visible) _IRR_OVERRIDE_
|
void setVisible(bool visible) override
|
||||||
{
|
{
|
||||||
CURSORINFO info;
|
CURSORINFO info;
|
||||||
info.cbSize = sizeof(CURSORINFO);
|
info.cbSize = sizeof(CURSORINFO);
|
||||||
@ -167,19 +166,19 @@ namespace irr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Returns if the cursor is currently visible.
|
//! Returns if the cursor is currently visible.
|
||||||
virtual bool isVisible() const _IRR_OVERRIDE_
|
bool isVisible() const override
|
||||||
{
|
{
|
||||||
return IsVisible;
|
return IsVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(const core::position2d<f32> &pos) _IRR_OVERRIDE_
|
void setPosition(const core::position2d<f32> &pos) override
|
||||||
{
|
{
|
||||||
setPosition(pos.X, pos.Y);
|
setPosition(pos.X, pos.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(f32 x, f32 y) _IRR_OVERRIDE_
|
void setPosition(f32 x, f32 y) override
|
||||||
{
|
{
|
||||||
if (!UseReferenceRect)
|
if (!UseReferenceRect)
|
||||||
setPosition(core::round32(x*WindowSize.Width), core::round32(y*WindowSize.Height));
|
setPosition(core::round32(x*WindowSize.Width), core::round32(y*WindowSize.Height));
|
||||||
@ -188,13 +187,13 @@ namespace irr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(const core::position2d<s32> &pos) _IRR_OVERRIDE_
|
void setPosition(const core::position2d<s32> &pos) override
|
||||||
{
|
{
|
||||||
setPosition(pos.X, pos.Y);
|
setPosition(pos.X, pos.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Sets the new position of the cursor.
|
//! Sets the new position of the cursor.
|
||||||
virtual void setPosition(s32 x, s32 y) _IRR_OVERRIDE_
|
void setPosition(s32 x, s32 y) override
|
||||||
{
|
{
|
||||||
if (UseReferenceRect)
|
if (UseReferenceRect)
|
||||||
{
|
{
|
||||||
@ -213,7 +212,7 @@ namespace irr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the current position of the mouse cursor.
|
//! Returns the current position of the mouse cursor.
|
||||||
virtual const core::position2d<s32>& getPosition(bool updateCursor) _IRR_OVERRIDE_
|
const core::position2d<s32>& getPosition(bool updateCursor) override
|
||||||
{
|
{
|
||||||
if ( updateCursor )
|
if ( updateCursor )
|
||||||
updateInternalCursorPosition();
|
updateInternalCursorPosition();
|
||||||
@ -221,7 +220,7 @@ namespace irr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Returns the current position of the mouse cursor.
|
//! Returns the current position of the mouse cursor.
|
||||||
virtual core::position2d<f32> getRelativePosition(bool updateCursor) _IRR_OVERRIDE_
|
core::position2d<f32> getRelativePosition(bool updateCursor) override
|
||||||
{
|
{
|
||||||
if ( updateCursor )
|
if ( updateCursor )
|
||||||
updateInternalCursorPosition();
|
updateInternalCursorPosition();
|
||||||
@ -237,7 +236,7 @@ namespace irr
|
|||||||
}
|
}
|
||||||
|
|
||||||
//! Sets an absolute reference rect for calculating the cursor position.
|
//! Sets an absolute reference rect for calculating the cursor position.
|
||||||
virtual void setReferenceRect(core::rect<s32>* rect=0) _IRR_OVERRIDE_
|
void setReferenceRect(core::rect<s32>* rect=0) override
|
||||||
{
|
{
|
||||||
if (rect)
|
if (rect)
|
||||||
{
|
{
|
||||||
@ -300,22 +299,22 @@ namespace irr
|
|||||||
|
|
||||||
|
|
||||||
//! Sets the active cursor icon
|
//! Sets the active cursor icon
|
||||||
virtual void setActiveIcon(gui::ECURSOR_ICON iconId) _IRR_OVERRIDE_;
|
void setActiveIcon(gui::ECURSOR_ICON iconId) override;
|
||||||
|
|
||||||
//! Gets the currently active icon
|
//! Gets the currently active icon
|
||||||
virtual gui::ECURSOR_ICON getActiveIcon() const _IRR_OVERRIDE_
|
gui::ECURSOR_ICON getActiveIcon() const override
|
||||||
{
|
{
|
||||||
return ActiveIcon;
|
return ActiveIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Add a custom sprite as cursor icon.
|
//! Add a custom sprite as cursor icon.
|
||||||
virtual gui::ECURSOR_ICON addIcon(const gui::SCursorSprite& icon) _IRR_OVERRIDE_;
|
gui::ECURSOR_ICON addIcon(const gui::SCursorSprite& icon) override;
|
||||||
|
|
||||||
//! replace the given cursor icon.
|
//! replace the given cursor icon.
|
||||||
virtual void changeIcon(gui::ECURSOR_ICON iconId, const gui::SCursorSprite& icon) _IRR_OVERRIDE_;
|
void changeIcon(gui::ECURSOR_ICON iconId, const gui::SCursorSprite& icon) override;
|
||||||
|
|
||||||
//! Return a system-specific size which is supported for cursors. Larger icons will fail, smaller icons might work.
|
//! Return a system-specific size which is supported for cursors. Larger icons will fail, smaller icons might work.
|
||||||
virtual core::dimension2di getSupportedIconSize() const _IRR_OVERRIDE_;
|
core::dimension2di getSupportedIconSize() const override;
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
@ -417,6 +416,8 @@ namespace irr
|
|||||||
CCursorControl* Win32CursorControl;
|
CCursorControl* Win32CursorControl;
|
||||||
|
|
||||||
SJoystickWin32Control* JoyControl;
|
SJoystickWin32Control* JoyControl;
|
||||||
|
|
||||||
|
bool WindowMaximized;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace irr
|
} // end namespace irr
|
||||||
|
@ -13,53 +13,50 @@
|
|||||||
|
|
||||||
#include "CIrrDeviceStub.h"
|
#include "CIrrDeviceStub.h"
|
||||||
#include "IrrlichtDevice.h"
|
#include "IrrlichtDevice.h"
|
||||||
#include "IImagePresenter.h"
|
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
{
|
{
|
||||||
|
|
||||||
class CIrrDeviceiOS : public CIrrDeviceStub, public video::IImagePresenter
|
class CIrrDeviceiOS : public CIrrDeviceStub
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CIrrDeviceiOS(const SIrrlichtCreationParameters& params);
|
CIrrDeviceiOS(const SIrrlichtCreationParameters& params);
|
||||||
virtual ~CIrrDeviceiOS();
|
virtual ~CIrrDeviceiOS();
|
||||||
|
|
||||||
virtual bool run() _IRR_OVERRIDE_;
|
bool run() override;
|
||||||
virtual void yield() _IRR_OVERRIDE_;
|
void yield() override;
|
||||||
virtual void sleep(u32 timeMs, bool pauseTimer) _IRR_OVERRIDE_;
|
void sleep(u32 timeMs, bool pauseTimer) override;
|
||||||
|
|
||||||
virtual void setWindowCaption(const wchar_t* text) _IRR_OVERRIDE_;
|
void setWindowCaption(const wchar_t* text) override;
|
||||||
|
|
||||||
virtual bool isWindowActive() const _IRR_OVERRIDE_;
|
bool isWindowActive() const override;
|
||||||
virtual bool isWindowFocused() const _IRR_OVERRIDE_;
|
bool isWindowFocused() const override;
|
||||||
virtual bool isWindowMinimized() const _IRR_OVERRIDE_;
|
bool isWindowMinimized() const override;
|
||||||
|
|
||||||
virtual bool present(video::IImage* surface, void * windowId = 0, core::rect<s32>* src = 0) _IRR_OVERRIDE_;
|
void closeDevice() override;
|
||||||
|
|
||||||
virtual void closeDevice() _IRR_OVERRIDE_;
|
void setResizable(bool resize = false) override;
|
||||||
|
|
||||||
virtual void setResizable(bool resize = false) _IRR_OVERRIDE_;
|
void minimizeWindow() override;
|
||||||
|
void maximizeWindow() override;
|
||||||
|
void restoreWindow() override;
|
||||||
|
|
||||||
virtual void minimizeWindow() _IRR_OVERRIDE_;
|
core::position2di getWindowPosition() override;
|
||||||
virtual void maximizeWindow() _IRR_OVERRIDE_;
|
|
||||||
virtual void restoreWindow() _IRR_OVERRIDE_;
|
|
||||||
|
|
||||||
virtual core::position2di getWindowPosition() _IRR_OVERRIDE_;
|
bool activateAccelerometer(float updateInterval = 0.016666f) override;
|
||||||
|
bool deactivateAccelerometer() override;
|
||||||
|
bool isAccelerometerActive() override;
|
||||||
|
bool isAccelerometerAvailable() override;
|
||||||
|
bool activateGyroscope(float updateInterval = 0.016666f) override;
|
||||||
|
bool deactivateGyroscope() override;
|
||||||
|
bool isGyroscopeActive() override;
|
||||||
|
bool isGyroscopeAvailable() override;
|
||||||
|
bool activateDeviceMotion(float updateInterval = 0.016666f) override;
|
||||||
|
bool deactivateDeviceMotion() override;
|
||||||
|
bool isDeviceMotionActive() override;
|
||||||
|
bool isDeviceMotionAvailable() override;
|
||||||
|
|
||||||
virtual bool activateAccelerometer(float updateInterval = 0.016666f) _IRR_OVERRIDE_;
|
E_DEVICE_TYPE getType() const override;
|
||||||
virtual bool deactivateAccelerometer() _IRR_OVERRIDE_;
|
|
||||||
virtual bool isAccelerometerActive() _IRR_OVERRIDE_;
|
|
||||||
virtual bool isAccelerometerAvailable() _IRR_OVERRIDE_;
|
|
||||||
virtual bool activateGyroscope(float updateInterval = 0.016666f) _IRR_OVERRIDE_;
|
|
||||||
virtual bool deactivateGyroscope() _IRR_OVERRIDE_;
|
|
||||||
virtual bool isGyroscopeActive() _IRR_OVERRIDE_;
|
|
||||||
virtual bool isGyroscopeAvailable() _IRR_OVERRIDE_;
|
|
||||||
virtual bool activateDeviceMotion(float updateInterval = 0.016666f) _IRR_OVERRIDE_;
|
|
||||||
virtual bool deactivateDeviceMotion() _IRR_OVERRIDE_;
|
|
||||||
virtual bool isDeviceMotionActive() _IRR_OVERRIDE_;
|
|
||||||
virtual bool isDeviceMotionAvailable() _IRR_OVERRIDE_;
|
|
||||||
|
|
||||||
virtual E_DEVICE_TYPE getType() const _IRR_OVERRIDE_;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void createWindow();
|
void createWindow();
|
||||||
|
@ -480,11 +480,6 @@ namespace irr
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CIrrDeviceiOS::present(video::IImage* image, void * windowId, core::rect<s32>* src)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CIrrDeviceiOS::closeDevice()
|
void CIrrDeviceiOS::closeDevice()
|
||||||
{
|
{
|
||||||
CFRunLoopStop(CFRunLoopGetMain());
|
CFRunLoopStop(CFRunLoopGetMain());
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||||
|
|
||||||
#include "CLimitReadFile.h"
|
#include "CLimitReadFile.h"
|
||||||
|
#include "irrMath.h"
|
||||||
#include "irrString.h"
|
#include "irrString.h"
|
||||||
|
|
||||||
namespace irr
|
namespace irr
|
||||||
|
@ -30,24 +30,24 @@ namespace io
|
|||||||
virtual ~CLimitReadFile();
|
virtual ~CLimitReadFile();
|
||||||
|
|
||||||
//! returns how much was read
|
//! returns how much was read
|
||||||
virtual size_t read(void* buffer, size_t sizeToRead) _IRR_OVERRIDE_;
|
size_t read(void* buffer, size_t sizeToRead) override;
|
||||||
|
|
||||||
//! changes position in file, returns true if successful
|
//! changes position in file, returns true if successful
|
||||||
//! if relativeMovement==true, the pos is changed relative to current pos,
|
//! if relativeMovement==true, the pos is changed relative to current pos,
|
||||||
//! otherwise from begin of file
|
//! otherwise from begin of file
|
||||||
virtual bool seek(long finalPos, bool relativeMovement = false) _IRR_OVERRIDE_;
|
bool seek(long finalPos, bool relativeMovement = false) override;
|
||||||
|
|
||||||
//! returns size of file
|
//! returns size of file
|
||||||
virtual long getSize() const _IRR_OVERRIDE_;
|
long getSize() const override;
|
||||||
|
|
||||||
//! returns where in the file we are.
|
//! returns where in the file we are.
|
||||||
virtual long getPos() const _IRR_OVERRIDE_;
|
long getPos() const override;
|
||||||
|
|
||||||
//! returns name of file
|
//! returns name of file
|
||||||
virtual const io::path& getFileName() const _IRR_OVERRIDE_;
|
const io::path& getFileName() const override;
|
||||||
|
|
||||||
//! Get the type of the class implementing this interface
|
//! Get the type of the class implementing this interface
|
||||||
virtual EREAD_FILE_TYPE getType() const _IRR_OVERRIDE_
|
EREAD_FILE_TYPE getType() const override
|
||||||
{
|
{
|
||||||
return ERFT_LIMIT_READ_FILE;
|
return ERFT_LIMIT_READ_FILE;
|
||||||
}
|
}
|
||||||
|
@ -21,25 +21,25 @@ public:
|
|||||||
CLogger(IEventReceiver* r);
|
CLogger(IEventReceiver* r);
|
||||||
|
|
||||||
//! Returns the current set log level.
|
//! Returns the current set log level.
|
||||||
virtual ELOG_LEVEL getLogLevel() const _IRR_OVERRIDE_;
|
ELOG_LEVEL getLogLevel() const override;
|
||||||
|
|
||||||
//! Sets a new log level. virtual void setLogLevel(ELOG_LEVEL ll) _IRR_OVERRIDE_;
|
//! Sets a new log level. void setLogLevel(ELOG_LEVEL ll) override;
|
||||||
virtual void setLogLevel(ELOG_LEVEL ll) _IRR_OVERRIDE_;
|
void setLogLevel(ELOG_LEVEL ll) override;
|
||||||
|
|
||||||
//! Prints out a text into the log
|
//! Prints out a text into the log
|
||||||
virtual void log(const c8* text, ELOG_LEVEL ll=ELL_INFORMATION) _IRR_OVERRIDE_;
|
void log(const c8* text, ELOG_LEVEL ll=ELL_INFORMATION) override;
|
||||||
|
|
||||||
//! Prints out a text into the log
|
//! Prints out a text into the log
|
||||||
virtual void log(const wchar_t* text, ELOG_LEVEL ll=ELL_INFORMATION) _IRR_OVERRIDE_;
|
void log(const wchar_t* text, ELOG_LEVEL ll=ELL_INFORMATION) override;
|
||||||
|
|
||||||
//! Prints out a text into the log
|
//! Prints out a text into the log
|
||||||
virtual void log(const c8* text, const c8* hint, ELOG_LEVEL ll=ELL_INFORMATION) _IRR_OVERRIDE_;
|
void log(const c8* text, const c8* hint, ELOG_LEVEL ll=ELL_INFORMATION) override;
|
||||||
|
|
||||||
//! Prints out a text into the log
|
//! Prints out a text into the log
|
||||||
virtual void log(const c8* text, const wchar_t* hint, ELOG_LEVEL ll=ELL_INFORMATION) _IRR_OVERRIDE_;
|
void log(const c8* text, const wchar_t* hint, ELOG_LEVEL ll=ELL_INFORMATION) override;
|
||||||
|
|
||||||
//! Prints out a text into the log
|
//! Prints out a text into the log
|
||||||
virtual void log(const wchar_t* text, const wchar_t* hint, ELOG_LEVEL ll=ELL_INFORMATION) _IRR_OVERRIDE_;
|
void log(const wchar_t* text, const wchar_t* hint, ELOG_LEVEL ll=ELL_INFORMATION) override;
|
||||||
|
|
||||||
//! Sets a new event receiver
|
//! Sets a new event receiver
|
||||||
void setReceiver(IEventReceiver* r);
|
void setReceiver(IEventReceiver* r);
|
||||||
|
@ -241,8 +241,6 @@ add_library(IRROTHEROBJ OBJECT
|
|||||||
COSOperator.cpp
|
COSOperator.cpp
|
||||||
Irrlicht.cpp
|
Irrlicht.cpp
|
||||||
os.cpp
|
os.cpp
|
||||||
leakHunter.cpp
|
|
||||||
CProfiler.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if(ANDROID)
|
if(ANDROID)
|
||||||
|
@ -29,28 +29,28 @@ namespace io
|
|||||||
virtual ~CMemoryReadFile();
|
virtual ~CMemoryReadFile();
|
||||||
|
|
||||||
//! returns how much was read
|
//! returns how much was read
|
||||||
virtual size_t read(void* buffer, size_t sizeToRead) _IRR_OVERRIDE_;
|
size_t read(void* buffer, size_t sizeToRead) override;
|
||||||
|
|
||||||
//! changes position in file, returns true if successful
|
//! changes position in file, returns true if successful
|
||||||
virtual bool seek(long finalPos, bool relativeMovement = false) _IRR_OVERRIDE_;
|
bool seek(long finalPos, bool relativeMovement = false) override;
|
||||||
|
|
||||||
//! returns size of file
|
//! returns size of file
|
||||||
virtual long getSize() const _IRR_OVERRIDE_;
|
long getSize() const override;
|
||||||
|
|
||||||
//! returns where in the file we are.
|
//! returns where in the file we are.
|
||||||
virtual long getPos() const _IRR_OVERRIDE_;
|
long getPos() const override;
|
||||||
|
|
||||||
//! returns name of file
|
//! returns name of file
|
||||||
virtual const io::path& getFileName() const _IRR_OVERRIDE_;
|
const io::path& getFileName() const override;
|
||||||
|
|
||||||
//! Get the type of the class implementing this interface
|
//! Get the type of the class implementing this interface
|
||||||
virtual EREAD_FILE_TYPE getType() const _IRR_OVERRIDE_
|
EREAD_FILE_TYPE getType() const override
|
||||||
{
|
{
|
||||||
return ERFT_MEMORY_READ_FILE;
|
return ERFT_MEMORY_READ_FILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Get direct access to internal buffer
|
//! Get direct access to internal buffer
|
||||||
virtual const void *getBuffer() const _IRR_OVERRIDE_
|
const void *getBuffer() const override
|
||||||
{
|
{
|
||||||
return Buffer;
|
return Buffer;
|
||||||
}
|
}
|
||||||
@ -78,18 +78,18 @@ namespace io
|
|||||||
virtual ~CMemoryWriteFile();
|
virtual ~CMemoryWriteFile();
|
||||||
|
|
||||||
//! returns how much was written
|
//! returns how much was written
|
||||||
virtual size_t write(const void* buffer, size_t sizeToWrite) _IRR_OVERRIDE_;
|
size_t write(const void* buffer, size_t sizeToWrite) override;
|
||||||
|
|
||||||
//! changes position in file, returns true if successful
|
//! changes position in file, returns true if successful
|
||||||
virtual bool seek(long finalPos, bool relativeMovement = false) _IRR_OVERRIDE_;
|
bool seek(long finalPos, bool relativeMovement = false) override;
|
||||||
|
|
||||||
//! returns where in the file we are.
|
//! returns where in the file we are.
|
||||||
virtual long getPos() const _IRR_OVERRIDE_;
|
long getPos() const override;
|
||||||
|
|
||||||
//! returns name of file
|
//! returns name of file
|
||||||
virtual const io::path& getFileName() const _IRR_OVERRIDE_;
|
const io::path& getFileName() const override;
|
||||||
|
|
||||||
virtual bool flush() _IRR_OVERRIDE_;
|
bool flush() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -30,42 +30,42 @@ namespace scene
|
|||||||
\param filename: Filename of the mesh. When called ISceneManager::getMesh() with this
|
\param filename: Filename of the mesh. When called ISceneManager::getMesh() with this
|
||||||
parameter, the method will return the mesh parameter given with this method.
|
parameter, the method will return the mesh parameter given with this method.
|
||||||
\param mesh: Pointer to a mesh which will now be referenced by this name. */
|
\param mesh: Pointer to a mesh which will now be referenced by this name. */
|
||||||
virtual void addMesh(const io::path& filename, IAnimatedMesh* mesh) _IRR_OVERRIDE_;
|
void addMesh(const io::path& filename, IAnimatedMesh* mesh) override;
|
||||||
|
|
||||||
//! Removes a mesh from the cache.
|
//! Removes a mesh from the cache.
|
||||||
/** After loading a mesh with getMesh(), the mesh can be removed from the cache
|
/** After loading a mesh with getMesh(), the mesh can be removed from the cache
|
||||||
using this method, freeing a lot of memory. */
|
using this method, freeing a lot of memory. */
|
||||||
virtual void removeMesh(const IMesh* const mesh) _IRR_OVERRIDE_;
|
void removeMesh(const IMesh* const mesh) override;
|
||||||
|
|
||||||
//! Returns amount of loaded meshes in the cache.
|
//! Returns amount of loaded meshes in the cache.
|
||||||
/** You can load new meshes into the cache using getMesh() and addMesh().
|
/** You can load new meshes into the cache using getMesh() and addMesh().
|
||||||
If you ever need to access the internal mesh cache, you can do this using
|
If you ever need to access the internal mesh cache, you can do this using
|
||||||
removeMesh(), getMeshNumber(), getMeshByIndex() and getMeshFilename() */
|
removeMesh(), getMeshNumber(), getMeshByIndex() and getMeshFilename() */
|
||||||
virtual u32 getMeshCount() const _IRR_OVERRIDE_;
|
u32 getMeshCount() const override;
|
||||||
|
|
||||||
//! Returns current index number of the mesh, and -1 if it is not in the cache.
|
//! Returns current index number of the mesh, and -1 if it is not in the cache.
|
||||||
virtual s32 getMeshIndex(const IMesh* const mesh) const _IRR_OVERRIDE_;
|
s32 getMeshIndex(const IMesh* const mesh) const override;
|
||||||
|
|
||||||
//! Returns a mesh based on its index number.
|
//! Returns a mesh based on its index number.
|
||||||
/** \param index: Index of the mesh, number between 0 and getMeshCount()-1.
|
/** \param index: Index of the mesh, number between 0 and getMeshCount()-1.
|
||||||
Note that this number is only valid until a new mesh is loaded or removed *
|
Note that this number is only valid until a new mesh is loaded or removed *
|
||||||
\return Returns pointer to the mesh or 0 if there is none with this number. */
|
\return Returns pointer to the mesh or 0 if there is none with this number. */
|
||||||
virtual IAnimatedMesh* getMeshByIndex(u32 index) _IRR_OVERRIDE_;
|
IAnimatedMesh* getMeshByIndex(u32 index) override;
|
||||||
|
|
||||||
//! Returns a mesh based on its name.
|
//! Returns a mesh based on its name.
|
||||||
/** \param name Name of the mesh. Usually a filename.
|
/** \param name Name of the mesh. Usually a filename.
|
||||||
\return Pointer to the mesh or 0 if there is none with this number. */
|
\return Pointer to the mesh or 0 if there is none with this number. */
|
||||||
virtual IAnimatedMesh* getMeshByName(const io::path& name) _IRR_OVERRIDE_;
|
IAnimatedMesh* getMeshByName(const io::path& name) override;
|
||||||
|
|
||||||
//! Get the name of a loaded mesh, based on its index.
|
//! Get the name of a loaded mesh, based on its index.
|
||||||
/** \param index: Index of the mesh, number between 0 and getMeshCount()-1.
|
/** \param index: Index of the mesh, number between 0 and getMeshCount()-1.
|
||||||
\return The name if mesh was found and has a name, else the path is empty. */
|
\return The name if mesh was found and has a name, else the path is empty. */
|
||||||
virtual const io::SNamedPath& getMeshName(u32 index) const _IRR_OVERRIDE_;
|
const io::SNamedPath& getMeshName(u32 index) const override;
|
||||||
|
|
||||||
//! Get the name of a loaded mesh, if there is any.
|
//! Get the name of a loaded mesh, if there is any.
|
||||||
/** \param mesh Pointer to mesh to query.
|
/** \param mesh Pointer to mesh to query.
|
||||||
\return The name if mesh was found and has a name, else the path is empty. */
|
\return The name if mesh was found and has a name, else the path is empty. */
|
||||||
virtual const io::SNamedPath& getMeshName(const IMesh* const mesh) const _IRR_OVERRIDE_;
|
const io::SNamedPath& getMeshName(const IMesh* const mesh) const override;
|
||||||
|
|
||||||
//! Renames a loaded mesh.
|
//! Renames a loaded mesh.
|
||||||
/** Note that renaming meshes might change the ordering of the
|
/** Note that renaming meshes might change the ordering of the
|
||||||
@ -74,7 +74,7 @@ namespace scene
|
|||||||
\param index The index of the mesh in the cache.
|
\param index The index of the mesh in the cache.
|
||||||
\param name New name for the mesh.
|
\param name New name for the mesh.
|
||||||
\return True if mesh was renamed. */
|
\return True if mesh was renamed. */
|
||||||
virtual bool renameMesh(u32 index, const io::path& name) _IRR_OVERRIDE_;
|
bool renameMesh(u32 index, const io::path& name) override;
|
||||||
|
|
||||||
//! Renames a loaded mesh.
|
//! Renames a loaded mesh.
|
||||||
/** Note that renaming meshes might change the ordering of the
|
/** Note that renaming meshes might change the ordering of the
|
||||||
@ -83,16 +83,16 @@ namespace scene
|
|||||||
\param mesh Mesh to be renamed.
|
\param mesh Mesh to be renamed.
|
||||||
\param name New name for the mesh.
|
\param name New name for the mesh.
|
||||||
\return True if mesh was renamed. */
|
\return True if mesh was renamed. */
|
||||||
virtual bool renameMesh(const IMesh* const mesh, const io::path& name) _IRR_OVERRIDE_;
|
bool renameMesh(const IMesh* const mesh, const io::path& name) override;
|
||||||
|
|
||||||
//! returns if a mesh already was loaded
|
//! returns if a mesh already was loaded
|
||||||
virtual bool isMeshLoaded(const io::path& name) _IRR_OVERRIDE_;
|
bool isMeshLoaded(const io::path& name) override;
|
||||||
|
|
||||||
//! Clears the whole mesh cache, removing all meshes.
|
//! Clears the whole mesh cache, removing all meshes.
|
||||||
virtual void clear() _IRR_OVERRIDE_;
|
void clear() override;
|
||||||
|
|
||||||
//! Clears all meshes that are held in the mesh cache but not used anywhere else.
|
//! Clears all meshes that are held in the mesh cache but not used anywhere else.
|
||||||
virtual void clearUnusedMeshes() _IRR_OVERRIDE_;
|
void clearUnusedMeshes() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -23,24 +23,24 @@ public:
|
|||||||
//! Recalculates all normals of the mesh.
|
//! Recalculates all normals of the mesh.
|
||||||
/** \param mesh: Mesh on which the operation is performed.
|
/** \param mesh: Mesh on which the operation is performed.
|
||||||
\param smooth: Whether to use smoothed normals. */
|
\param smooth: Whether to use smoothed normals. */
|
||||||
virtual void recalculateNormals(scene::IMesh* mesh, bool smooth = false, bool angleWeighted = false) const _IRR_OVERRIDE_;
|
void recalculateNormals(scene::IMesh* mesh, bool smooth = false, bool angleWeighted = false) const override;
|
||||||
|
|
||||||
//! Recalculates all normals of the mesh buffer.
|
//! Recalculates all normals of the mesh buffer.
|
||||||
/** \param buffer: Mesh buffer on which the operation is performed.
|
/** \param buffer: Mesh buffer on which the operation is performed.
|
||||||
\param smooth: Whether to use smoothed normals. */
|
\param smooth: Whether to use smoothed normals. */
|
||||||
virtual void recalculateNormals(IMeshBuffer* buffer, bool smooth = false, bool angleWeighted = false) const _IRR_OVERRIDE_;
|
void recalculateNormals(IMeshBuffer* buffer, bool smooth = false, bool angleWeighted = false) const override;
|
||||||
|
|
||||||
//! Clones a static IMesh into a modifiable SMesh.
|
//! Clones a static IMesh into a modifiable SMesh.
|
||||||
virtual SMesh* createMeshCopy(scene::IMesh* mesh) const _IRR_OVERRIDE_;
|
SMesh* createMeshCopy(scene::IMesh* mesh) const override;
|
||||||
|
|
||||||
//! Returns amount of polygons in mesh.
|
//! Returns amount of polygons in mesh.
|
||||||
virtual s32 getPolyCount(scene::IMesh* mesh) const _IRR_OVERRIDE_;
|
s32 getPolyCount(scene::IMesh* mesh) const override;
|
||||||
|
|
||||||
//! Returns amount of polygons in mesh.
|
//! Returns amount of polygons in mesh.
|
||||||
virtual s32 getPolyCount(scene::IAnimatedMesh* mesh) const _IRR_OVERRIDE_;
|
s32 getPolyCount(scene::IAnimatedMesh* mesh) const override;
|
||||||
|
|
||||||
//! create a new AnimatedMesh and adds the mesh to it
|
//! create a new AnimatedMesh and adds the mesh to it
|
||||||
virtual IAnimatedMesh * createAnimatedMesh(scene::IMesh* mesh,scene::E_ANIMATED_MESH_TYPE type) const _IRR_OVERRIDE_;
|
IAnimatedMesh * createAnimatedMesh(scene::IMesh* mesh,scene::E_ANIMATED_MESH_TYPE type) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // end namespace scene
|
} // end namespace scene
|
||||||
|
@ -27,48 +27,48 @@ namespace scene
|
|||||||
virtual ~CMeshSceneNode();
|
virtual ~CMeshSceneNode();
|
||||||
|
|
||||||
//! frame
|
//! frame
|
||||||
virtual void OnRegisterSceneNode() _IRR_OVERRIDE_;
|
void OnRegisterSceneNode() override;
|
||||||
|
|
||||||
//! renders the node.
|
//! renders the node.
|
||||||
virtual void render() _IRR_OVERRIDE_;
|
void render() override;
|
||||||
|
|
||||||
//! returns the axis aligned bounding box of this node
|
//! 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 material based on the zero based index i. To get the amount
|
//! returns the material based on the zero based index i. To get the amount
|
||||||
//! of materials used by this scene node, use getMaterialCount().
|
//! of materials used by this scene node, use getMaterialCount().
|
||||||
//! This function is needed for inserting the node into the scene hierarchy on a
|
//! 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
|
//! optimal position for minimizing renderstate changes, but can also be used
|
||||||
//! to directly modify the material of a scene node.
|
//! 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.
|
//! returns amount of materials used by this scene node.
|
||||||
virtual u32 getMaterialCount() const _IRR_OVERRIDE_;
|
u32 getMaterialCount() const override;
|
||||||
|
|
||||||
//! Returns type of the scene node
|
//! Returns type of the scene node
|
||||||
virtual ESCENE_NODE_TYPE getType() const _IRR_OVERRIDE_ { return ESNT_MESH; }
|
ESCENE_NODE_TYPE getType() const override { return ESNT_MESH; }
|
||||||
|
|
||||||
//! Sets a new mesh
|
//! Sets a new mesh
|
||||||
virtual void setMesh(IMesh* mesh) _IRR_OVERRIDE_;
|
void setMesh(IMesh* mesh) override;
|
||||||
|
|
||||||
//! Returns the current mesh
|
//! Returns the current mesh
|
||||||
virtual IMesh* getMesh(void) _IRR_OVERRIDE_ { return Mesh; }
|
IMesh* getMesh(void) override { return Mesh; }
|
||||||
|
|
||||||
//! Sets if the scene node should not copy the materials of the mesh but use them in a read only style.
|
//! 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
|
/* In this way it is possible to change the materials a mesh causing all mesh scene nodes
|
||||||
referencing this mesh to change too. */
|
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
|
//! 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;
|
||||||
|
|
||||||
//! Creates a clone of this scene node and its children.
|
//! 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;
|
||||||
|
|
||||||
//! Removes a child from this scene node.
|
//! Removes a child from this scene node.
|
||||||
//! Implemented here, to be able to remove the shadow properly, if there is one,
|
//! Implemented here, to be able to remove the shadow properly, if there is one,
|
||||||
//! or to remove attached child.
|
//! or to remove attached child.
|
||||||
virtual bool removeChild(ISceneNode* child) _IRR_OVERRIDE_;
|
bool removeChild(ISceneNode* child) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -31,34 +31,34 @@ namespace video
|
|||||||
~CNSOGLManager();
|
~CNSOGLManager();
|
||||||
|
|
||||||
// Initialize
|
// Initialize
|
||||||
bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) _IRR_OVERRIDE_;
|
bool initialize(const SIrrlichtCreationParameters& params, const SExposedVideoData& data) override;
|
||||||
|
|
||||||
// Terminate
|
// Terminate
|
||||||
void terminate() _IRR_OVERRIDE_;
|
void terminate() override;
|
||||||
|
|
||||||
// Create surface.
|
// Create surface.
|
||||||
bool generateSurface() _IRR_OVERRIDE_;
|
bool generateSurface() override;
|
||||||
|
|
||||||
// Destroy surface.
|
// Destroy surface.
|
||||||
void destroySurface() _IRR_OVERRIDE_;
|
void destroySurface() override;
|
||||||
|
|
||||||
// Create context.
|
// Create context.
|
||||||
bool generateContext() _IRR_OVERRIDE_;
|
bool generateContext() override;
|
||||||
|
|
||||||
// Destroy EGL context.
|
// Destroy EGL context.
|
||||||
void destroyContext() _IRR_OVERRIDE_;
|
void destroyContext() override;
|
||||||
|
|
||||||
//! Get current context
|
//! Get current context
|
||||||
const SExposedVideoData& getContext() const;
|
const SExposedVideoData& getContext() const;
|
||||||
|
|
||||||
//! Change render context, disable old and activate new defined by videoData
|
//! Change render context, disable old and activate new defined by videoData
|
||||||
bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero) _IRR_OVERRIDE_;
|
bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero) override;
|
||||||
|
|
||||||
// Get procedure address.
|
// Get procedure address.
|
||||||
virtual void* getProcAddress(const std::string &procName) _IRR_OVERRIDE_;
|
void* getProcAddress(const std::string &procName) override;
|
||||||
|
|
||||||
// Swap buffers.
|
// Swap buffers.
|
||||||
bool swapBuffers() _IRR_OVERRIDE_;
|
bool swapBuffers() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SIrrlichtCreationParameters Params;
|
SIrrlichtCreationParameters Params;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user