mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-03 00:30:26 +02:00
Compare commits
28 Commits
Author | SHA1 | Date | |
---|---|---|---|
275e152523 | |||
4ca90e3dfd | |||
679dfd3343 | |||
f9d7a632f5 | |||
dc43583a2c | |||
03fd4ff533 | |||
b7292226b4 | |||
7298b46504 | |||
af20d9ff86 | |||
00dd1f8ef3 | |||
364cb37698 | |||
7ce9169d8d | |||
ebdb2e410b | |||
a28b8f9e91 | |||
6cd27d5dca | |||
04ab99f218 | |||
d753c8b782 | |||
6a3ed6428f | |||
3492fd0d2d | |||
c6b06533f3 | |||
e609f5f263 | |||
ddecc0fae2 | |||
dd3a34d674 | |||
0735220f86 | |||
0740d055ac | |||
1d4672bd92 | |||
ef3bab610d | |||
d98dc90b38 |
44
.github/workflows/build.yml
vendored
44
.github/workflows/build.yml
vendored
@ -137,49 +137,37 @@ jobs:
|
||||
cd bin/Linux
|
||||
LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest ogles2
|
||||
|
||||
win32:
|
||||
mingw:
|
||||
name: "MinGW ${{matrix.config.variant}}${{matrix.config.extras}}"
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- {variant: win32, arch: i686}
|
||||
- {variant: win64, arch: x86_64}
|
||||
- {variant: win32, arch: i686, extras: "-sdl"}
|
||||
- {variant: win64, arch: x86_64, extras: "-sdl"}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install compiler
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install cmake -qyy
|
||||
wget http://minetest.kitsunemimi.pw/mingw-w64-i686_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
|
||||
wget http://minetest.kitsunemimi.pw/mingw-w64-${{matrix.config.arch}}_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
|
||||
sudo tar -xaf mingw.tar.xz -C /usr
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
./scripts/ci-build-mingw.sh package
|
||||
env:
|
||||
CC: i686-w64-mingw32-gcc
|
||||
CXX: i686-w64-mingw32-g++
|
||||
CC: ${{matrix.config.arch}}-w64-mingw32-gcc
|
||||
CXX: ${{matrix.config.arch}}-w64-mingw32-g++
|
||||
extras: ${{matrix.config.extras}}
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: irrlicht-win32
|
||||
path: ./irrlicht-win32.zip
|
||||
|
||||
win64:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install compiler
|
||||
run: |
|
||||
sudo apt-get update && sudo apt-get install cmake -qyy
|
||||
wget http://minetest.kitsunemimi.pw/mingw-w64-x86_64_11.2.0_ubuntu20.04.tar.xz -O mingw.tar.xz
|
||||
sudo tar -xaf mingw.tar.xz -C /usr
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
./scripts/ci-build-mingw.sh package
|
||||
env:
|
||||
CC: x86_64-w64-mingw32-gcc
|
||||
CXX: x86_64-w64-mingw32-g++
|
||||
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: irrlicht-win64
|
||||
path: ./irrlicht-win64.zip
|
||||
name: irrlicht-${{matrix.config.variant}}${{matrix.config.extras}}
|
||||
path: ./irrlicht-${{matrix.config.variant}}${{matrix.config.extras}}.zip
|
||||
|
||||
macos:
|
||||
runs-on: macos-latest
|
||||
|
27
build.sh
Executable file
27
build.sh
Executable file
@ -0,0 +1,27 @@
|
||||
#!/bin/bash -e
|
||||
args=(-DBUILD_EXAMPLES=ON -DENABLE_OPENGL=OFF -DBUILD_SHARED_LIBS=OFF)
|
||||
|
||||
export CC=afl-clang-fast
|
||||
export CXX=afl-clang-fast++
|
||||
export LD=$CXX
|
||||
unset AFL_USE_ASAN
|
||||
if ! grep -Fq '/afl-' build2/CMakeCache.txt; then
|
||||
rm -rf build2
|
||||
cmake -S . -B build2 "${args[@]}"
|
||||
fi
|
||||
nice make -C build2 clean
|
||||
nice make -C build2 -j10
|
||||
for f in build2/bin/Linux/*; do
|
||||
ln -snfv "../../$f" "bin/Linux/${f##*/}_noasan"
|
||||
done
|
||||
|
||||
export CC=afl-clang-lto
|
||||
export CXX=afl-clang-lto++
|
||||
export LD=$CXX
|
||||
export AFL_USE_ASAN=1
|
||||
if ! grep -Fq '/afl-' CMakeCache.txt; then
|
||||
rm -f CMakeCache.txt
|
||||
cmake . "${args[@]}"
|
||||
fi
|
||||
nice make clean
|
||||
nice make -j10
|
@ -2,9 +2,10 @@ set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(IRREXAMPLES
|
||||
# removed
|
||||
LoadTexture
|
||||
LoadMesh
|
||||
)
|
||||
if(UNIX)
|
||||
if(FALSE)
|
||||
list(APPEND IRREXAMPLES AutomatedTest)
|
||||
endif()
|
||||
|
||||
|
44
examples/LoadMesh/main.cpp
Normal file
44
examples/LoadMesh/main.cpp
Normal file
@ -0,0 +1,44 @@
|
||||
#include <irrlicht.h>
|
||||
#include <iostream>
|
||||
|
||||
using namespace irr;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc < 2)
|
||||
return 1;
|
||||
|
||||
SIrrlichtCreationParameters p;
|
||||
p.DriverType = video::EDT_NULL;
|
||||
p.WindowSize = core::dimension2du(640, 480);
|
||||
p.LoggingLevel = ELL_DEBUG;
|
||||
|
||||
auto *device = createDeviceEx(p);
|
||||
if (!device)
|
||||
return 1;
|
||||
auto *smgr = device->getSceneManager();
|
||||
|
||||
while (__AFL_LOOP(10000)) {
|
||||
auto *mfile = device->getFileSystem()->createAndOpenFile(argv[1]);
|
||||
if (!mfile)
|
||||
continue;
|
||||
scene::IAnimatedMesh *mesh;
|
||||
// Irrlicht matches on file extension so we have to do this by hand
|
||||
for (u32 i = 0; i < smgr->getMeshLoaderCount(); i++) {
|
||||
mfile->seek(0);
|
||||
mesh = smgr->getMeshLoader(i)->createMesh(mfile);
|
||||
if (mesh) {
|
||||
core::stringc msg("Loaded using loader #");
|
||||
msg += core::stringc(i);
|
||||
device->getLogger()->log(msg.c_str(), ELL_DEBUG);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (mesh)
|
||||
mesh->drop();
|
||||
mfile->drop();
|
||||
}
|
||||
|
||||
device->drop();
|
||||
return 0;
|
||||
}
|
29
examples/LoadTexture/main.cpp
Normal file
29
examples/LoadTexture/main.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
#include <irrlicht.h>
|
||||
#include <iostream>
|
||||
|
||||
using namespace irr;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc < 2)
|
||||
return 1;
|
||||
|
||||
SIrrlichtCreationParameters p;
|
||||
p.DriverType = video::EDT_NULL;
|
||||
p.WindowSize = core::dimension2du(640, 480);
|
||||
p.LoggingLevel = ELL_DEBUG;
|
||||
|
||||
auto *device = createDeviceEx(p);
|
||||
if (!device)
|
||||
return 1;
|
||||
auto *driver = device->getVideoDriver();
|
||||
|
||||
while (__AFL_LOOP(10000)) {
|
||||
auto *tex = driver->getTexture(argv[1]);
|
||||
if (tex)
|
||||
driver->removeTexture(tex);
|
||||
}
|
||||
|
||||
device->drop();
|
||||
return 0;
|
||||
}
|
@ -20,13 +20,6 @@ namespace video
|
||||
render and display any graphics. */
|
||||
EDT_NULL,
|
||||
|
||||
// obsolete constants to make some code happy
|
||||
// TODO delete
|
||||
EDT_SOFTWARE,
|
||||
EDT_BURNINGSVIDEO,
|
||||
DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS,
|
||||
EDT_DIRECT3D9,
|
||||
|
||||
//! OpenGL device, available on most platforms.
|
||||
/** Performs hardware accelerated rendering of 3D and 2D
|
||||
primitives. */
|
||||
|
@ -36,20 +36,6 @@ namespace scene
|
||||
//! Explicitly set all vertices for each triangle.
|
||||
EPT_TRIANGLES,
|
||||
|
||||
//! After the first two vertices each further two vertices create a quad with the preceding two.
|
||||
//! Not supported by Direct3D
|
||||
EPT_QUAD_STRIP,
|
||||
|
||||
//! Every four vertices create a quad.
|
||||
//! Not supported by Direct3D
|
||||
//! Deprecated with newer OpenGL drivers
|
||||
EPT_QUADS,
|
||||
|
||||
//! Just as LINE_LOOP, but filled.
|
||||
//! Not supported by Direct3D
|
||||
//! Deprecated with newer OpenGL drivers
|
||||
EPT_POLYGON,
|
||||
|
||||
//! The single vertices are expanded to quad billboards on the GPU.
|
||||
EPT_POINT_SPRITES
|
||||
};
|
||||
|
@ -59,10 +59,6 @@ namespace scene
|
||||
IBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id=-1) :
|
||||
ISceneNode(parent, mgr, id),positionHint(-1),scaleHint(-1),rotationHint(-1) { }
|
||||
|
||||
//! Get the name of the bone
|
||||
/** \deprecated Use getName instead. This method may be removed by Irrlicht 1.9 */
|
||||
_IRR_DEPRECATED_ virtual const c8* getBoneName() const { return getName(); }
|
||||
|
||||
//! Get the index of the bone
|
||||
virtual u32 getBoneIndex() const = 0;
|
||||
|
||||
|
@ -210,58 +210,6 @@ public:
|
||||
\return A pointer to the specified loader, 0 if the index is incorrect. */
|
||||
virtual IArchiveLoader* getArchiveLoader(u32 index) const = 0;
|
||||
|
||||
//! Adds a zip archive to the file system.
|
||||
/** \deprecated This function is provided for compatibility
|
||||
with older versions of Irrlicht and may be removed in Irrlicht 1.9,
|
||||
you should use addFileArchive instead.
|
||||
After calling this, the Irrlicht Engine will search and open files directly from this archive too.
|
||||
This is useful for hiding data from the end user, speeding up file access and making it possible to
|
||||
access for example Quake3 .pk3 files, which are no different than .zip files.
|
||||
\param filename: Filename of the zip archive to add to the file system.
|
||||
\param ignoreCase: If set to true, files in the archive can be accessed without
|
||||
writing all letters in the right case.
|
||||
\param ignorePaths: If set to true, files in the added archive can be accessed
|
||||
without its complete path.
|
||||
\return True if the archive was added successfully, false if not. */
|
||||
_IRR_DEPRECATED_ virtual bool addZipFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
|
||||
{
|
||||
return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_ZIP);
|
||||
}
|
||||
|
||||
//! Adds an unzipped archive (or basedirectory with subdirectories..) to the file system.
|
||||
/** \deprecated This function is provided for compatibility
|
||||
with older versions of Irrlicht and may be removed in Irrlicht 1.9,
|
||||
you should use addFileArchive instead.
|
||||
Useful for handling data which will be in a zip file
|
||||
\param filename: Filename of the unzipped zip archive base directory to add to the file system.
|
||||
\param ignoreCase: If set to true, files in the archive can be accessed without
|
||||
writing all letters in the right case.
|
||||
\param ignorePaths: If set to true, files in the added archive can be accessed
|
||||
without its complete path.
|
||||
\return True if the archive was added successful, false if not. */
|
||||
_IRR_DEPRECATED_ virtual bool addFolderFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
|
||||
{
|
||||
return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_FOLDER);
|
||||
}
|
||||
|
||||
//! Adds a pak archive to the file system.
|
||||
/** \deprecated This function is provided for compatibility
|
||||
with older versions of Irrlicht and may be removed in Irrlicht 1.9,
|
||||
you should use addFileArchive instead.
|
||||
After calling this, the Irrlicht Engine will search and open files directly from this archive too.
|
||||
This is useful for hiding data from the end user, speeding up file access and making it possible to
|
||||
access for example Quake2/KingPin/Hexen2 .pak files
|
||||
\param filename: Filename of the pak archive to add to the file system.
|
||||
\param ignoreCase: If set to true, files in the archive can be accessed without
|
||||
writing all letters in the right case.
|
||||
\param ignorePaths: If set to true, files in the added archive can be accessed
|
||||
without its complete path.(should not use with Quake2 paks
|
||||
\return True if the archive was added successful, false if not. */
|
||||
_IRR_DEPRECATED_ virtual bool addPakFileArchive(const c8* filename, bool ignoreCase=true, bool ignorePaths=true)
|
||||
{
|
||||
return addFileArchive(filename, ignoreCase, ignorePaths, EFAT_PAK);
|
||||
}
|
||||
|
||||
//! Get the current working directory.
|
||||
/** \return Current working directory as a string. */
|
||||
virtual const path& getWorkingDirectory() =0;
|
||||
|
@ -41,12 +41,12 @@ namespace gui
|
||||
|
||||
//! Insert an existing tab
|
||||
/** Note that it will also add the tab as a child of this TabControl.
|
||||
\param idx Index at which tab will be inserted. Later tabs will be moved.
|
||||
Previous active tab will stay active unless this is the first
|
||||
\param idx Index at which tab will be inserted. Later tabs will be moved.
|
||||
Previous active tab will stay active unless this is the first
|
||||
element to be inserted in which case it becomes active.
|
||||
\param tab New tab to insert.
|
||||
\param serializationMode Internally used for serialization. You should not need this.
|
||||
When true it reserves space for the index, doesn't move but replaces tabs
|
||||
When true it reserves space for the index, doesn't move but replaces tabs
|
||||
and it doesn't change the active tab.
|
||||
\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=false) = 0;
|
||||
@ -67,8 +67,8 @@ namespace gui
|
||||
virtual IGUITab* getTab(s32 idx) const = 0;
|
||||
|
||||
//! For given element find if it's a tab and return it's zero-based index (or -1 for not found)
|
||||
/** \param tab Tab for which we are looking (usually you will look for an IGUITab* type as only
|
||||
those can be tabs, but we allow looking for any kind of IGUIElement* as there are some
|
||||
/** \param tab Tab for which we are looking (usually you will look for an IGUITab* type as only
|
||||
those can be tabs, but we allow looking for any kind of IGUIElement* as there are some
|
||||
use-cases for that even if it just returns 0. For example this way you can check for
|
||||
all children of this gui-element if they are tabs or some non-tab children.*/
|
||||
virtual s32 getTabIndex(const IGUIElement *tab) const = 0;
|
||||
@ -129,15 +129,6 @@ namespace gui
|
||||
IGUITab(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle)
|
||||
: IGUIElement(EGUIET_TAB, environment, parent, id, rectangle) {}
|
||||
|
||||
//! Returns zero based index of tab if in tabcontrol.
|
||||
/** \deprecated Deprecated in 1.9, use IGUITabControl::getTabIndex instead*/
|
||||
_IRR_DEPRECATED_ virtual s32 getNumber() const
|
||||
{
|
||||
if (Parent && Parent->getType() == EGUIET_TAB_CONTROL)
|
||||
return static_cast<IGUITabControl*>(Parent)->getTabIndex(this);
|
||||
return -1;
|
||||
}
|
||||
|
||||
//! sets if the tab should draw its background
|
||||
virtual void setDrawBackground(bool draw=true) = 0;
|
||||
|
||||
|
@ -183,24 +183,6 @@ public:
|
||||
return Data;
|
||||
}
|
||||
|
||||
//! Lock function. Use this to get a pointer to the image data.
|
||||
/** Use getData instead.
|
||||
\return Pointer to the image data. What type of data is pointed to
|
||||
depends on the color format of the image. For example if the color
|
||||
format is ECF_A8R8G8B8, it is of u32. Be sure to call unlock() after
|
||||
you don't need the pointer any more. */
|
||||
_IRR_DEPRECATED_ void* lock()
|
||||
{
|
||||
return getData();
|
||||
}
|
||||
|
||||
//! Unlock function.
|
||||
/** Should be called after the pointer received by lock() is not
|
||||
needed anymore. */
|
||||
_IRR_DEPRECATED_ void unlock()
|
||||
{
|
||||
}
|
||||
|
||||
//! Get the mipmap size for this image for a certain mipmap level
|
||||
/** level 0 will be full image size. Every further level is half the size.
|
||||
Doesn't care if the image actually has mipmaps, just which size would be needed. */
|
||||
@ -367,19 +349,6 @@ public:
|
||||
//! fills the surface with given color
|
||||
virtual void fill(const SColor &color) =0;
|
||||
|
||||
//! Inform whether the image is compressed
|
||||
_IRR_DEPRECATED_ bool isCompressed() const
|
||||
{
|
||||
return IImage::isCompressedFormat(Format);
|
||||
}
|
||||
|
||||
//! Check whether the image has MipMaps
|
||||
/** \return True if image has MipMaps, else false. */
|
||||
_IRR_DEPRECATED_ bool hasMipMaps() const
|
||||
{
|
||||
return (getMipMapsData() != 0);
|
||||
}
|
||||
|
||||
//! get the amount of Bits per Pixel of the given color format
|
||||
static u32 getBitsPerPixelFromFormat(const ECOLOR_FORMAT format)
|
||||
{
|
||||
|
@ -115,30 +115,6 @@ public:
|
||||
\param constantAmount Amount of registers to be set. One register consists of 4 floats. */
|
||||
virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) = 0;
|
||||
|
||||
//! \deprecated. This method may be removed by Irrlicht 2.0
|
||||
_IRR_DEPRECATED_ bool setVertexShaderConstant(const c8* name, const f32* floats, int count)
|
||||
{
|
||||
return setVertexShaderConstant(getVertexShaderConstantID(name), floats, count);
|
||||
}
|
||||
|
||||
//! \deprecated. This method may be removed by Irrlicht 2.0
|
||||
_IRR_DEPRECATED_ bool setVertexShaderConstant(const c8* name, const s32* ints, int count)
|
||||
{
|
||||
return setVertexShaderConstant(getVertexShaderConstantID(name), ints, count);
|
||||
}
|
||||
|
||||
//! \deprecated. This method may be removed by Irrlicht 2.0
|
||||
_IRR_DEPRECATED_ bool setPixelShaderConstant(const c8* name, const f32* floats, int count)
|
||||
{
|
||||
return setPixelShaderConstant(getPixelShaderConstantID(name), floats, count);
|
||||
}
|
||||
|
||||
//! \deprecated. This method may be removed by Irrlicht 2.0
|
||||
_IRR_DEPRECATED_ bool setPixelShaderConstant(const c8* name, const s32* ints, int count)
|
||||
{
|
||||
return setPixelShaderConstant(getPixelShaderConstantID(name), ints, count);
|
||||
}
|
||||
|
||||
//! Get pointer to the IVideoDriver interface
|
||||
/** \return Pointer to the IVideoDriver interface */
|
||||
virtual IVideoDriver* getVideoDriver() = 0;
|
||||
|
@ -172,9 +172,6 @@ namespace scene
|
||||
case scene::EPT_TRIANGLE_STRIP: return (indexCount-2);
|
||||
case scene::EPT_TRIANGLE_FAN: return (indexCount-2);
|
||||
case scene::EPT_TRIANGLES: return indexCount/3;
|
||||
case scene::EPT_QUAD_STRIP: return (indexCount-2)/2;
|
||||
case scene::EPT_QUADS: return indexCount/4;
|
||||
case scene::EPT_POLYGON: return indexCount; // (not really primitives, that would be 1, works like line_strip)
|
||||
case scene::EPT_POINT_SPRITES: return indexCount;
|
||||
}
|
||||
return 0;
|
||||
|
@ -78,46 +78,6 @@ namespace scene
|
||||
number. */
|
||||
virtual IAnimatedMesh* getMeshByIndex(u32 index) = 0;
|
||||
|
||||
//! Returns a mesh based on its name (often a filename).
|
||||
/** \deprecated Use getMeshByName() instead. This method may be removed by
|
||||
Irrlicht 1.9 */
|
||||
_IRR_DEPRECATED_ IAnimatedMesh* getMeshByFilename(const io::path& filename)
|
||||
{
|
||||
return getMeshByName(filename);
|
||||
}
|
||||
|
||||
//! Get the name of a loaded mesh, based on its index. (Name is often identical to the filename).
|
||||
/** \deprecated Use getMeshName() instead. This method may be removed by
|
||||
Irrlicht 1.9 */
|
||||
_IRR_DEPRECATED_ const io::path& getMeshFilename(u32 index) const
|
||||
{
|
||||
return getMeshName(index).getInternalName();
|
||||
}
|
||||
|
||||
//! Get the name of a loaded mesh, if there is any. (Name is often identical to the filename).
|
||||
/** \deprecated Use getMeshName() instead. This method may be removed by
|
||||
Irrlicht 1.9 */
|
||||
_IRR_DEPRECATED_ const io::path& getMeshFilename(const IMesh* const mesh) const
|
||||
{
|
||||
return getMeshName(mesh).getInternalName();
|
||||
}
|
||||
|
||||
//! Renames a loaded mesh.
|
||||
/** \deprecated Use renameMesh() instead. This method may be removed by
|
||||
Irrlicht 1.9 */
|
||||
_IRR_DEPRECATED_ bool setMeshFilename(u32 index, const io::path& filename)
|
||||
{
|
||||
return renameMesh(index, filename);
|
||||
}
|
||||
|
||||
//! Renames a loaded mesh.
|
||||
/** \deprecated Use renameMesh() instead. This method may be removed by
|
||||
Irrlicht 1.9 */
|
||||
_IRR_DEPRECATED_ bool setMeshFilename(const IMesh* const mesh, const io::path& filename)
|
||||
{
|
||||
return renameMesh(mesh, filename);
|
||||
}
|
||||
|
||||
//! Returns a mesh based on its name.
|
||||
/** \param name Name of the mesh. Usually a filename.
|
||||
\return Pointer to the mesh or 0 if there is none with this number. */
|
||||
|
@ -18,13 +18,6 @@ public:
|
||||
//! Get the current operation system version as string.
|
||||
virtual const core::stringc& getOperatingSystemVersion() const = 0;
|
||||
|
||||
//! Get the current operation system version as string.
|
||||
/** \deprecated Use getOperatingSystemVersion instead. This method will be removed in Irrlicht 1.9. */
|
||||
_IRR_DEPRECATED_ const wchar_t* getOperationSystemVersion() const
|
||||
{
|
||||
return core::stringw(getOperatingSystemVersion()).c_str();
|
||||
}
|
||||
|
||||
//! Copies text to the clipboard
|
||||
//! \param text: text in utf-8
|
||||
virtual void copyToClipboard(const c8* text) const = 0;
|
||||
|
@ -97,14 +97,6 @@ enum E_TEXTURE_CREATION_FLAG
|
||||
*/
|
||||
ETCF_AUTO_GENERATE_MIP_MAPS = 0x00000100,
|
||||
|
||||
//! Enable support for vertex shader texture sampling on some drivers
|
||||
/** Default is false.
|
||||
This adds a small costs to all texture switches.
|
||||
Currently only affects D3D9.
|
||||
On OpenGL vertex shaders use the same texture unit as pixel shaders, so support there only depends on GL version and not on this flag
|
||||
*/
|
||||
ETCF_SUPPORT_VERTEXT_TEXTURE = 0x00000200,
|
||||
|
||||
/** This flag is never used, it only forces the compiler to compile
|
||||
these enumeration values to 32 bit. */
|
||||
ETCF_FORCE_32_BIT_DO_NOT_USE = 0x7fffffff
|
||||
|
@ -21,41 +21,6 @@ public:
|
||||
*/
|
||||
virtual u32 getRealTime() const = 0;
|
||||
|
||||
enum EWeekday
|
||||
{
|
||||
EWD_SUNDAY=0,
|
||||
EWD_MONDAY,
|
||||
EWD_TUESDAY,
|
||||
EWD_WEDNESDAY,
|
||||
EWD_THURSDAY,
|
||||
EWD_FRIDAY,
|
||||
EWD_SATURDAY
|
||||
};
|
||||
|
||||
struct RealTimeDate
|
||||
{
|
||||
// Hour of the day, from 0 to 23
|
||||
u32 Hour;
|
||||
// Minute of the hour, from 0 to 59
|
||||
u32 Minute;
|
||||
// Second of the minute, due to extra seconds from 0 to 61
|
||||
u32 Second;
|
||||
// Year of the Gregorian calender
|
||||
s32 Year;
|
||||
// Month of the year, from 1 to 12
|
||||
u32 Month;
|
||||
// Day of the month, from 1 to 31
|
||||
u32 Day;
|
||||
// Weekday for the current day
|
||||
EWeekday Weekday;
|
||||
// Day of the year, from 1 to 366
|
||||
u32 Yearday;
|
||||
// Whether daylight saving is on
|
||||
bool IsDST;
|
||||
};
|
||||
|
||||
virtual RealTimeDate getRealTimeAndDate() const = 0;
|
||||
|
||||
//! Returns current virtual time in milliseconds.
|
||||
/** This value starts with 0 and can be manipulated using setTime(),
|
||||
stopTimer(), startTimer(), etc. This value depends on the set speed of
|
||||
|
@ -265,24 +265,10 @@ namespace video
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual ITexture* getTexture(io::IReadFile* file) =0;
|
||||
|
||||
//! Returns a texture by index
|
||||
/** \param index: Index of the texture, must be smaller than
|
||||
getTextureCount() Please note that this index might change when
|
||||
adding or removing textures
|
||||
\return Pointer to the texture, or 0 if the texture was not
|
||||
set or index is out of bounds. This pointer should not be
|
||||
dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual ITexture* getTextureByIndex(u32 index) =0;
|
||||
|
||||
//! Returns amount of textures currently loaded
|
||||
/** \return Amount of textures currently loaded */
|
||||
virtual u32 getTextureCount() const = 0;
|
||||
|
||||
//! Renames a texture
|
||||
/** \param texture Pointer to the texture to rename.
|
||||
\param newName New name for the texture. This should be a unique name. */
|
||||
virtual void renameTexture(ITexture* texture, const io::path& newName) = 0;
|
||||
|
||||
//! Creates an empty texture of specified size.
|
||||
/** \param size: Size of the texture.
|
||||
\param name A name for the texture. Later calls to
|
||||
@ -297,24 +283,6 @@ namespace video
|
||||
virtual ITexture* addTexture(const core::dimension2d<u32>& size,
|
||||
const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) = 0;
|
||||
|
||||
//! Creates a texture from an IImage.
|
||||
/** \param name A name for the texture. Later calls of
|
||||
getTexture() with this name will return this texture.
|
||||
The name can _not_ be empty.
|
||||
\param image Image the texture is created from.
|
||||
\param mipmapData Optional pointer to a mipmaps data.
|
||||
If this parameter is not given, the mipmaps are derived from image.
|
||||
\return Pointer to the newly created texture. This pointer
|
||||
should not be dropped. See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
_IRR_DEPRECATED_ ITexture* addTexture(const io::path& name, IImage* image, void* mipmapData)
|
||||
{
|
||||
if (image)
|
||||
image->setMipMapsData(mipmapData, false);
|
||||
|
||||
return addTexture(name, image);
|
||||
}
|
||||
|
||||
//! Creates a texture from an IImage.
|
||||
/** \param name A name for the texture. Later calls of
|
||||
getTexture() with this name will return this texture.
|
||||
@ -366,8 +334,7 @@ namespace video
|
||||
const io::path& name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) =0;
|
||||
|
||||
//! Adds a new render target texture with 6 sides for a cubemap map to the texture cache.
|
||||
/** NOTE: Only supported on D3D9 so far.
|
||||
\param sideLen Length of one cubemap side.
|
||||
/** \param sideLen Length of one cubemap side.
|
||||
\param name A name for the texture. Later calls of getTexture() with this name will return this texture.
|
||||
The name can _not_ be empty.
|
||||
\param format The color format of the render target. Floating point formats are supported.
|
||||
@ -459,15 +426,9 @@ namespace video
|
||||
color values may not be exactly the same in the engine and for
|
||||
example in picture edit programs. To avoid this problem, you
|
||||
could use the makeColorKeyTexture method, which takes the
|
||||
position of a pixel instead a color value.
|
||||
\param zeroTexels (deprecated) If set to true, then any texels that match
|
||||
the color key will have their color, as well as their alpha, set to zero
|
||||
(i.e. black). This behavior matches the legacy (buggy) behavior prior
|
||||
to release 1.5 and is provided for backwards compatibility only.
|
||||
This parameter may be removed by Irrlicht 1.9. */
|
||||
position of a pixel instead a color value. */
|
||||
virtual void makeColorKeyTexture(video::ITexture* texture,
|
||||
video::SColor color,
|
||||
bool zeroTexels = false) const =0;
|
||||
video::SColor color) const =0;
|
||||
|
||||
//! Sets a boolean alpha channel on the texture based on the color at a position.
|
||||
/** This makes the texture fully transparent at the texels where
|
||||
@ -476,15 +437,9 @@ namespace video
|
||||
\param texture Texture whose alpha channel is modified.
|
||||
\param colorKeyPixelPos Position of a pixel with the color key
|
||||
color. Every texel with this color will become fully transparent as
|
||||
described above.
|
||||
\param zeroTexels (deprecated) If set to true, then any texels that match
|
||||
the color key will have their color, as well as their alpha, set to zero
|
||||
(i.e. black). This behavior matches the legacy (buggy) behavior prior
|
||||
to release 1.5 and is provided for backwards compatibility only.
|
||||
This parameter may be removed by Irrlicht 1.9. */
|
||||
described above. */
|
||||
virtual void makeColorKeyTexture(video::ITexture* texture,
|
||||
core::position2d<s32> colorKeyPixelPos,
|
||||
bool zeroTexels = false) const =0;
|
||||
core::position2d<s32> colorKeyPixelPos) const =0;
|
||||
|
||||
//! Set a render target.
|
||||
/** This will only work if the driver supports the
|
||||
@ -1032,27 +987,6 @@ namespace video
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IImage* createImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size) =0;
|
||||
|
||||
//! Creates a software image by converting it to given format from another image.
|
||||
/** \deprecated Create an empty image and use copyTo(). This method may be removed by Irrlicht 1.9.
|
||||
\param format Desired color format of the image.
|
||||
\param imageToCopy Image to copy to the new image.
|
||||
\return The created image.
|
||||
If you no longer need the image, you should call IImage::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
_IRR_DEPRECATED_ virtual IImage* createImage(ECOLOR_FORMAT format, IImage *imageToCopy) =0;
|
||||
|
||||
//! Creates a software image from a part of another image.
|
||||
/** \deprecated Create an empty image and use copyTo(). This method may be removed by Irrlicht 1.9.
|
||||
\param imageToCopy Image to copy to the new image in part.
|
||||
\param pos Position of rectangle to copy.
|
||||
\param size Extents of rectangle to copy.
|
||||
\return The created image.
|
||||
If you no longer need the image, you should call IImage::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
_IRR_DEPRECATED_ virtual IImage* createImage(IImage* imageToCopy,
|
||||
const core::position2d<s32>& pos,
|
||||
const core::dimension2d<u32>& size) =0;
|
||||
|
||||
//! Creates a software image from a part of a texture.
|
||||
/**
|
||||
\param texture Texture to copy to the new image in part.
|
||||
@ -1156,23 +1090,6 @@ namespace video
|
||||
//! Clear the color, depth and/or stencil buffers.
|
||||
virtual void clearBuffers(u16 flag, SColor color = SColor(255,0,0,0), f32 depth = 1.f, u8 stencil = 0) = 0;
|
||||
|
||||
//! Clear the color, depth and/or stencil buffers.
|
||||
_IRR_DEPRECATED_ void clearBuffers(bool backBuffer, bool depthBuffer, bool stencilBuffer, SColor color)
|
||||
{
|
||||
u16 flag = 0;
|
||||
|
||||
if (backBuffer)
|
||||
flag |= ECBF_COLOR;
|
||||
|
||||
if (depthBuffer)
|
||||
flag |= ECBF_DEPTH;
|
||||
|
||||
if (stencilBuffer)
|
||||
flag |= ECBF_STENCIL;
|
||||
|
||||
clearBuffers(flag, color);
|
||||
}
|
||||
|
||||
//! Clears the ZBuffer.
|
||||
/** Note that you usually need not to call this method, as it
|
||||
is automatically done in IVideoDriver::beginScene() or
|
||||
|
@ -5,12 +5,6 @@
|
||||
#ifndef __S_EXPOSED_VIDEO_DATA_H_INCLUDED__
|
||||
#define __S_EXPOSED_VIDEO_DATA_H_INCLUDED__
|
||||
|
||||
// forward declarations for internal pointers
|
||||
struct IDirect3D9;
|
||||
struct IDirect3DDevice9;
|
||||
struct IDirect3D8;
|
||||
struct IDirect3DDevice8;
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
@ -27,19 +21,6 @@ struct SExposedVideoData
|
||||
SExposedVideoData() {OpenGLWin32.HDc=0; OpenGLWin32.HRc=0; OpenGLWin32.HWnd=0;}
|
||||
explicit SExposedVideoData(void* Window) {OpenGLWin32.HDc=0; OpenGLWin32.HRc=0; OpenGLWin32.HWnd=Window;}
|
||||
|
||||
struct SD3D9
|
||||
{
|
||||
//! Pointer to the IDirect3D9 interface
|
||||
IDirect3D9* D3D9;
|
||||
|
||||
//! Pointer to the IDirect3DDevice9 interface
|
||||
IDirect3DDevice9* D3DDev9;
|
||||
|
||||
//! Window handle.
|
||||
/** Get with for example HWND h = reinterpret_cast<HWND>(exposedData.D3D9.HWnd) */
|
||||
void* HWnd;
|
||||
};
|
||||
|
||||
struct SOpenGLWin32
|
||||
{
|
||||
//! Private GDI Device Context.
|
||||
@ -87,7 +68,6 @@ struct SExposedVideoData
|
||||
|
||||
union
|
||||
{
|
||||
SD3D9 D3D9;
|
||||
SOpenGLWin32 OpenGLWin32;
|
||||
SOpenGLLinux OpenGLLinux;
|
||||
SOpenGLOSX OpenGLOSX;
|
||||
|
@ -40,7 +40,6 @@ namespace irr
|
||||
Doublebuffer(true),
|
||||
IgnoreInput(false),
|
||||
Stereobuffer(false),
|
||||
HighPrecisionFPU(false),
|
||||
EventReceiver(0),
|
||||
WindowId(0),
|
||||
#ifdef _DEBUG
|
||||
@ -48,9 +47,6 @@ namespace irr
|
||||
#else
|
||||
LoggingLevel(ELL_INFORMATION),
|
||||
#endif
|
||||
DisplayAdapter(0),
|
||||
DriverMultithreaded(false),
|
||||
UsePerformanceTimer(true),
|
||||
SDK_version_do_not_use(IRRLICHT_SDK_VERSION),
|
||||
PrivateData(0),
|
||||
#ifdef IRR_MOBILE_PATHS
|
||||
@ -84,13 +80,9 @@ namespace irr
|
||||
Doublebuffer = other.Doublebuffer;
|
||||
IgnoreInput = other.IgnoreInput;
|
||||
Stereobuffer = other.Stereobuffer;
|
||||
HighPrecisionFPU = other.HighPrecisionFPU;
|
||||
EventReceiver = other.EventReceiver;
|
||||
WindowId = other.WindowId;
|
||||
LoggingLevel = other.LoggingLevel;
|
||||
DisplayAdapter = other.DisplayAdapter;
|
||||
DriverMultithreaded = other.DriverMultithreaded;
|
||||
UsePerformanceTimer = other.UsePerformanceTimer;
|
||||
PrivateData = other.PrivateData;
|
||||
OGLES2ShaderPath = other.OGLES2ShaderPath;
|
||||
return *this;
|
||||
@ -108,9 +100,6 @@ namespace irr
|
||||
E_DEVICE_TYPE DeviceType;
|
||||
|
||||
//! Type of video driver used to render graphics.
|
||||
/** This can currently be video::EDT_NULL, video::EDT_SOFTWARE,
|
||||
video::EDT_BURNINGSVIDEO, video::EDT_DIRECT3D9, and video::EDT_OPENGL.
|
||||
Default: EDT_BURNINGSVIDEO. */
|
||||
video::E_DRIVER_TYPE DriverType;
|
||||
|
||||
//! Size of the window or the video mode in fullscreen mode. Default: 800x600
|
||||
@ -219,15 +208,6 @@ namespace irr
|
||||
Default value: false */
|
||||
bool Stereobuffer;
|
||||
|
||||
//! Specifies if the device should use high precision FPU setting
|
||||
/** This is only relevant for DirectX Devices, which switch to
|
||||
low FPU precision by default for performance reasons. However,
|
||||
this may lead to problems with the other computations of the
|
||||
application. In this case setting this flag to true should help
|
||||
- on the expense of performance loss, though.
|
||||
Default value: false */
|
||||
bool HighPrecisionFPU;
|
||||
|
||||
//! A user created event receiver.
|
||||
IEventReceiver* EventReceiver;
|
||||
|
||||
@ -292,23 +272,6 @@ namespace irr
|
||||
*/
|
||||
ELOG_LEVEL LoggingLevel;
|
||||
|
||||
//! Allows to select which graphic card is used for rendering when more than one card is in the system.
|
||||
/** So far only supported on D3D */
|
||||
u32 DisplayAdapter;
|
||||
|
||||
//! Create the driver multithreaded.
|
||||
/** Default is false. Enabling this can slow down your application.
|
||||
Note that this does _not_ make Irrlicht threadsafe, but only the underlying driver-API for the graphiccard.
|
||||
So far only supported on D3D. */
|
||||
bool DriverMultithreaded;
|
||||
|
||||
//! Enables use of high performance timers on Windows platform.
|
||||
/** When performance timers are not used, standard GetTickCount()
|
||||
is used instead which usually has worse resolution, but also less
|
||||
problems with speed stepping and other techniques.
|
||||
*/
|
||||
bool UsePerformanceTimer;
|
||||
|
||||
//! Don't use or change this parameter.
|
||||
/** Always set it to IRRLICHT_SDK_VERSION, which is done by default.
|
||||
This is needed for sdk version checks. */
|
||||
|
@ -228,19 +228,6 @@ namespace video
|
||||
ECM_DIFFUSE_AND_AMBIENT
|
||||
};
|
||||
|
||||
//! DEPRECATED. Will be removed after Irrlicht 1.9.
|
||||
/** Flags for the definition of the polygon offset feature. These flags define whether the offset should be into the screen, or towards the eye. */
|
||||
enum E_POLYGON_OFFSET
|
||||
{
|
||||
//! Push pixel towards the far plane, away from the eye
|
||||
/** This is typically used for rendering inner areas. */
|
||||
EPO_BACK=0,
|
||||
//! Pull pixels towards the camera.
|
||||
/** This is typically used for polygons which should appear on top
|
||||
of other elements, such as decals. */
|
||||
EPO_FRONT=1
|
||||
};
|
||||
|
||||
//! Names for polygon offset direction
|
||||
const c8* const PolygonOffsetDirectionNames[] =
|
||||
{
|
||||
@ -289,17 +276,17 @@ namespace video
|
||||
{
|
||||
public:
|
||||
//! Default constructor. Creates a solid, lit material with white colors
|
||||
SMaterial()
|
||||
: MaterialType(EMT_SOLID), AmbientColor(255,255,255,255), DiffuseColor(255,255,255,255),
|
||||
EmissiveColor(0,0,0,0), SpecularColor(255,255,255,255),
|
||||
Shininess(0.0f), MaterialTypeParam(0.0f), Thickness(1.0f),
|
||||
ZBuffer(ECFN_LESSEQUAL), AntiAliasing(EAAM_SIMPLE), ColorMask(ECP_ALL),
|
||||
ColorMaterial(ECM_DIFFUSE), BlendOperation(EBO_NONE), BlendFactor(0.0f),
|
||||
PolygonOffsetFactor(0), PolygonOffsetDirection(EPO_FRONT),
|
||||
PolygonOffsetDepthBias(0.f), PolygonOffsetSlopeScale(0.f),
|
||||
Wireframe(false), PointCloud(false), GouraudShading(true),
|
||||
Lighting(true), ZWriteEnable(EZW_AUTO), BackfaceCulling(true), FrontfaceCulling(false),
|
||||
FogEnable(false), NormalizeNormals(false), UseMipMaps(true)
|
||||
SMaterial() :
|
||||
MaterialType(EMT_SOLID), AmbientColor(255, 255, 255, 255),
|
||||
DiffuseColor(255, 255, 255, 255), EmissiveColor(0, 0, 0, 0),
|
||||
SpecularColor(255, 255, 255, 255), Shininess(0.0f),
|
||||
MaterialTypeParam(0.0f), Thickness(1.0f), ZBuffer(ECFN_LESSEQUAL),
|
||||
AntiAliasing(EAAM_SIMPLE), ColorMask(ECP_ALL), ColorMaterial(ECM_DIFFUSE),
|
||||
BlendOperation(EBO_NONE), BlendFactor(0.0f), PolygonOffsetDepthBias(0.f),
|
||||
PolygonOffsetSlopeScale(0.f), Wireframe(false), PointCloud(false),
|
||||
GouraudShading(true), Lighting(true), ZWriteEnable(EZW_AUTO),
|
||||
BackfaceCulling(true), FrontfaceCulling(false), FogEnable(false),
|
||||
NormalizeNormals(false), UseMipMaps(true)
|
||||
{ }
|
||||
|
||||
//! Texture layer array.
|
||||
@ -385,28 +372,16 @@ namespace video
|
||||
|
||||
//! Store the blend factors
|
||||
/** textureBlendFunc/textureBlendFuncSeparate functions should be used to write
|
||||
properly blending factors to this parameter.
|
||||
Due to historical reasons this parameter is not used for material type
|
||||
properly blending factors to this parameter.
|
||||
Due to historical reasons this parameter is not used for material type
|
||||
EMT_ONETEXTURE_BLEND which uses MaterialTypeParam instead for the blend factor.
|
||||
It's generally used only for materials without any blending otherwise (like EMT_SOLID).
|
||||
It's main use is to allow having shader materials which can enable/disable
|
||||
blending after they have been created.
|
||||
It's main use is to allow having shader materials which can enable/disable
|
||||
blending after they have been created.
|
||||
When you set this you usually also have to set BlendOperation to a value != EBO_NONE
|
||||
(setting it to EBO_ADD is probably the most common one value). */
|
||||
f32 BlendFactor;
|
||||
|
||||
//! DEPRECATED. Will be removed after Irrlicht 1.9. Please use PolygonOffsetDepthBias instead.
|
||||
/** Factor specifying how far the polygon offset should be made.
|
||||
Specifying 0 disables the polygon offset. The direction is specified separately.
|
||||
The factor can be from 0 to 7.
|
||||
Note: This probably never worked on Direct3D9 (was coded for D3D8 which had different value ranges) */
|
||||
u8 PolygonOffsetFactor:3;
|
||||
|
||||
//! DEPRECATED. Will be removed after Irrlicht 1.9.
|
||||
/** Flag defining the direction the polygon offset is applied to.
|
||||
Can be to front or to back, specified by values from E_POLYGON_OFFSET. */
|
||||
E_POLYGON_OFFSET PolygonOffsetDirection:1;
|
||||
|
||||
//! A constant z-buffer offset for a polygon/line/point
|
||||
/** The range of the value is driver specific.
|
||||
On OpenGL you get units which are multiplied by the smallest value that is guaranteed to produce a resolvable offset.
|
||||
@ -438,7 +413,7 @@ namespace video
|
||||
bool Lighting:1;
|
||||
|
||||
//! Is the zbuffer writable or is it read-only. Default: EZW_AUTO.
|
||||
/** If this parameter is not EZW_OFF, you probably also want to set ZBuffer
|
||||
/** If this parameter is not EZW_OFF, you probably also want to set ZBuffer
|
||||
to values other than ECFN_DISABLED */
|
||||
E_ZWRITE ZWriteEnable:2;
|
||||
|
||||
@ -546,8 +521,6 @@ namespace video
|
||||
ColorMaterial != b.ColorMaterial ||
|
||||
BlendOperation != b.BlendOperation ||
|
||||
BlendFactor != b.BlendFactor ||
|
||||
PolygonOffsetFactor != b.PolygonOffsetFactor ||
|
||||
PolygonOffsetDirection != b.PolygonOffsetDirection ||
|
||||
PolygonOffsetDepthBias != b.PolygonOffsetDepthBias ||
|
||||
PolygonOffsetSlopeScale != b.PolygonOffsetSlopeScale ||
|
||||
UseMipMaps != b.UseMipMaps
|
||||
|
@ -232,16 +232,6 @@ namespace video
|
||||
if the value is positive. */
|
||||
s8 LODBias;
|
||||
|
||||
//! Sets the MinFilter, MagFilter and AnisotropicFilter properties according
|
||||
//! to the three relevant boolean values found in the Minetest settings.
|
||||
/** The value of `trilinear` takes precedence over the value of `bilinear`. */
|
||||
void setFiltersMinetest(bool bilinear, bool trilinear, bool anisotropic) {
|
||||
MinFilter = trilinear ? ETMINF_LINEAR_MIPMAP_LINEAR :
|
||||
(bilinear ? ETMINF_LINEAR_MIPMAP_NEAREST : ETMINF_NEAREST_MIPMAP_NEAREST);
|
||||
MagFilter = (trilinear || bilinear) ? ETMAGF_LINEAR : ETMAGF_NEAREST;
|
||||
AnisotropicFilter = anisotropic ? 0xFF : 0;
|
||||
}
|
||||
|
||||
private:
|
||||
friend class SMaterial;
|
||||
|
||||
|
@ -35,10 +35,10 @@ namespace video
|
||||
u16 EnablePasses;
|
||||
|
||||
//! Global enable flag, overwritten by the SceneManager in each pass
|
||||
/** NOTE: This is generally _not_ set by users of the engine, but the
|
||||
Scenemanager uses the EnablePass array and sets Enabled to true if the
|
||||
/** NOTE: This is generally _not_ set by users of the engine, but the
|
||||
Scenemanager uses the EnablePass array and sets Enabled to true if the
|
||||
Override material is enabled in the current pass.
|
||||
As user you generally _only_ set EnablePasses.
|
||||
As user you generally _only_ set EnablePasses.
|
||||
The exception is when rendering without SceneManager but using draw calls in the VideoDriver. */
|
||||
bool Enabled;
|
||||
|
||||
@ -47,7 +47,7 @@ namespace video
|
||||
SMaterialTypeReplacement(s32 original, u32 replacement) : Original(original), Replacement(replacement) {}
|
||||
SMaterialTypeReplacement(u32 replacement) : Original(-1), Replacement(replacement) {}
|
||||
|
||||
//! SMaterial.MaterialType to replace.
|
||||
//! SMaterial.MaterialType to replace.
|
||||
//! -1 for all types or a specific value to only replace that one (which is either one of E_MATERIAL_TYPE or a shader material id)
|
||||
s32 Original;
|
||||
|
||||
@ -151,8 +151,6 @@ namespace video
|
||||
case EMP_BLEND_OPERATION: material.BlendOperation = Material.BlendOperation; break;
|
||||
case EMP_BLEND_FACTOR: material.BlendFactor = Material.BlendFactor; break;
|
||||
case EMP_POLYGON_OFFSET:
|
||||
material.PolygonOffsetDirection = Material.PolygonOffsetDirection;
|
||||
material.PolygonOffsetFactor = Material.PolygonOffsetFactor;
|
||||
material.PolygonOffsetDepthBias = Material.PolygonOffsetDepthBias;
|
||||
material.PolygonOffsetSlopeScale = Material.PolygonOffsetSlopeScale;
|
||||
break;
|
||||
|
@ -597,7 +597,7 @@ public:
|
||||
return difference_type();
|
||||
|
||||
_Iter i = iter;
|
||||
difference_type ret;
|
||||
difference_type ret{};
|
||||
|
||||
// Walk up.
|
||||
if (pos > i.pos)
|
||||
|
@ -255,8 +255,7 @@ namespace irr
|
||||
//! Creates an Irrlicht device. The Irrlicht device is the root object for using the engine.
|
||||
/** If you need more parameters to be passed to the creation of the Irrlicht Engine device,
|
||||
use the createDeviceEx() function.
|
||||
\param driverType: Type of the video driver to use. This can currently be video::EDT_NULL,
|
||||
video::EDT_SOFTWARE, video::EDT_BURNINGSVIDEO, video::EDT_DIRECT3D9 and video::EDT_OPENGL.
|
||||
\param driverType: Type of the video driver to use.
|
||||
\param windowSize: Size of the window or the video mode in fullscreen mode.
|
||||
\param bits: Bits per pixel in fullscreen mode. Ignored if windowed mode.
|
||||
\param fullscreen: Should be set to true if the device should run in fullscreen. Otherwise
|
||||
@ -280,16 +279,6 @@ namespace irr
|
||||
bool vsync = false,
|
||||
IEventReceiver* receiver = 0);
|
||||
|
||||
//! typedef for Function Pointer
|
||||
typedef IrrlichtDevice* (IRRCALLCONV *funcptr_createDevice )(
|
||||
video::E_DRIVER_TYPE driverType,
|
||||
const core::dimension2d<u32>& windowSize,
|
||||
u32 bits,
|
||||
bool fullscreen,
|
||||
bool stencilbuffer,
|
||||
bool vsync,
|
||||
IEventReceiver* receiver);
|
||||
|
||||
|
||||
//! Creates an Irrlicht device with the option to specify advanced parameters.
|
||||
/** Usually you should used createDevice() for creating an Irrlicht Engine device.
|
||||
@ -302,10 +291,6 @@ namespace irr
|
||||
extern "C" IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDeviceEx(
|
||||
const SIrrlichtCreationParameters& parameters);
|
||||
|
||||
//! typedef for Function Pointer
|
||||
typedef IrrlichtDevice* (IRRCALLCONV *funcptr_createDeviceEx )( const SIrrlichtCreationParameters& parameters );
|
||||
|
||||
|
||||
// THE FOLLOWING IS AN EMPTY LIST OF ALL SUB NAMESPACES
|
||||
// EXISTING ONLY FOR THE DOCUMENTATION SOFTWARE DOXYGEN.
|
||||
|
||||
|
@ -151,7 +151,7 @@ namespace core
|
||||
CMatrix4<T> operator*(const CMatrix4<T>& other) const;
|
||||
|
||||
//! Multiply by another matrix.
|
||||
/** Like calling: (*this) = (*this) * other
|
||||
/** Like calling: (*this) = (*this) * other
|
||||
*/
|
||||
CMatrix4<T>& operator*=(const CMatrix4<T>& other);
|
||||
|
||||
@ -190,10 +190,10 @@ namespace core
|
||||
|
||||
//! Get the rotation, as set by setRotation() when you already know the scale used to create the matrix
|
||||
/** NOTE: The scale needs to be the correct one used to create this matrix.
|
||||
You can _not_ use the result of getScale(), but have to save your scale
|
||||
You can _not_ use the result of getScale(), but have to save your scale
|
||||
variable in another place (like ISceneNode does).
|
||||
NOTE: No scale value can be 0 or the result is undefined.
|
||||
NOTE: It does not necessarily return the *same* Euler angles as those set by setRotationDegrees(),
|
||||
NOTE: It does not necessarily return the *same* Euler angles as those set by setRotationDegrees(),
|
||||
but the rotation will be equivalent, i.e. will have the same result when used to rotate a vector or node.
|
||||
NOTE: It will (usually) give wrong results when further transformations have been added in the matrix (like shear).
|
||||
WARNING: There have been troubles with this function over the years and we may still have missed some corner cases.
|
||||
@ -203,9 +203,9 @@ namespace core
|
||||
|
||||
//! Returns the rotation, as set by setRotation().
|
||||
/** NOTE: You will have the same end-rotation as used in setRotation, but it might not use the same axis values.
|
||||
NOTE: This only works correct if no other matrix operations have been done on the inner 3x3 matrix besides
|
||||
NOTE: This only works correct if no other matrix operations have been done on the inner 3x3 matrix besides
|
||||
setting rotation (so no scale/shear). Thought it (probably) works as long as scale doesn't flip handedness.
|
||||
NOTE: It does not necessarily return the *same* Euler angles as those set by setRotationDegrees(),
|
||||
NOTE: It does not necessarily return the *same* Euler angles as those set by setRotationDegrees(),
|
||||
but the rotation will be equivalent, i.e. will have the same result when used to rotate a vector or node.
|
||||
*/
|
||||
core::vector3d<T> getRotationDegrees() const;
|
||||
@ -278,13 +278,6 @@ namespace core
|
||||
void transformPlane( const core::plane3d<f32> &in, core::plane3d<f32> &out) const;
|
||||
|
||||
//! Transforms a axis aligned bounding box
|
||||
/** The result box of this operation may not be accurate at all. For
|
||||
correct results, use transformBoxEx() */
|
||||
void transformBox(core::aabbox3d<f32>& box) const;
|
||||
|
||||
//! Transforms a axis aligned bounding box
|
||||
/** The result box of this operation should be accurate, but this operation
|
||||
is slower than transformBox(). */
|
||||
void transformBoxEx(core::aabbox3d<f32>& box) const;
|
||||
|
||||
//! Multiplies this matrix by a 1x4 matrix
|
||||
@ -906,8 +899,8 @@ namespace core
|
||||
|
||||
|
||||
//! Returns a rotation which (mostly) works in combination with the given scale
|
||||
/**
|
||||
This code was originally written by by Chev (assuming no scaling back then,
|
||||
/**
|
||||
This code was originally written by by Chev (assuming no scaling back then,
|
||||
we can be blamed for all problems added by regarding scale)
|
||||
*/
|
||||
template <class T>
|
||||
@ -953,17 +946,17 @@ namespace core
|
||||
template <class T>
|
||||
inline core::vector3d<T> CMatrix4<T>::getRotationDegrees() const
|
||||
{
|
||||
// Note: Using getScale() here make it look like it could do matrix decomposition.
|
||||
// It can't! It works (or should work) as long as rotation doesn't flip the handedness
|
||||
// aka scale swapping 1 or 3 axes. (I think we could catch that as well by comparing
|
||||
// Note: Using getScale() here make it look like it could do matrix decomposition.
|
||||
// It can't! It works (or should work) as long as rotation doesn't flip the handedness
|
||||
// aka scale swapping 1 or 3 axes. (I think we could catch that as well by comparing
|
||||
// crossproduct of first 2 axes to direction of third axis, but TODO)
|
||||
// And maybe it should also offer the solution for the simple calculation
|
||||
// And maybe it should also offer the solution for the simple calculation
|
||||
// without regarding scaling as Irrlicht did before 1.7
|
||||
core::vector3d<T> scale(getScale());
|
||||
|
||||
// We assume the matrix uses rotations instead of negative scaling 2 axes.
|
||||
// Otherwise it fails even for some simple cases, like rotating around
|
||||
// 2 axes by 180<EFBFBD> which getScale thinks is a negative scaling.
|
||||
// Otherwise it fails even for some simple cases, like rotating around
|
||||
// 2 axes by 180° which getScale thinks is a negative scaling.
|
||||
if (scale.Y<0 && scale.Z<0)
|
||||
{
|
||||
scale.Y =-scale.Y;
|
||||
@ -1278,22 +1271,6 @@ namespace core
|
||||
transformPlane( out );
|
||||
}
|
||||
|
||||
//! Transforms the edge-points of a bounding box
|
||||
//! Deprecated as it's usually not what people need (regards only 2 corners, but other corners might be outside the box after transformation)
|
||||
//! Use transformBoxEx instead.
|
||||
template <class T>
|
||||
_IRR_DEPRECATED_ inline void CMatrix4<T>::transformBox(core::aabbox3d<f32>& box) const
|
||||
{
|
||||
#if defined ( USE_MATRIX_TEST )
|
||||
if (isIdentity())
|
||||
return;
|
||||
#endif
|
||||
|
||||
transformVect(box.MinEdge);
|
||||
transformVect(box.MaxEdge);
|
||||
box.repair();
|
||||
}
|
||||
|
||||
//! Transforms a axis aligned bounding box more accurately than transformBox()
|
||||
template <class T>
|
||||
inline void CMatrix4<T>::transformBoxEx(core::aabbox3d<f32>& box) const
|
||||
|
@ -100,8 +100,7 @@ namespace core
|
||||
//! Check if a point is inside the triangle (border-points count also as inside)
|
||||
/** This method uses a barycentric coordinate system.
|
||||
It is faster than isPointInside but is more susceptible to floating point rounding
|
||||
errors. This will especially be noticeable when the FPU is in single precision mode
|
||||
(which is for example set on default by Direct3D).
|
||||
errors.
|
||||
\param p Point to test. Assumes that this point is already
|
||||
on the plane of the triangle.
|
||||
\return True if point is inside the triangle, otherwise false. */
|
||||
|
34
repro.sh
Executable file
34
repro.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
aflout=out/default
|
||||
myout=out_rep
|
||||
exe=./bin/Linux/LoadMesh
|
||||
rm -rf "$myout" && mkdir -p "$myout"
|
||||
find $aflout/crashes -name 'id:*' -print | \
|
||||
while read file; do
|
||||
echo "➤ Testing $file..."
|
||||
short=${file##*/}
|
||||
short=${short%%,*}
|
||||
fout=$myout/$short.txt
|
||||
$exe "$file" >"$fout" 2>&1
|
||||
r=$?
|
||||
if grep -Fq '==ERROR: AddressSanitizer: SEGV on unknown address' "$fout"; then
|
||||
gdb -q --batch -iex 'set confirm off' -ex r -ex bt --args \
|
||||
${exe}_noasan "$file" >"$fout" 2>&1
|
||||
if grep -Eq '^(Thread|Program).*received signal' "$fout"; then
|
||||
cp "$file" "$myout/$short.bin"
|
||||
echo "✔ Reproduced (gdb)"
|
||||
else
|
||||
echo "✗ Not reproduced (gdb)"
|
||||
rm -f "$fout"
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
grep -Fq '==ABORTING' "$fout" && r=1
|
||||
if [ $r -eq 0 ]; then
|
||||
echo "✗ Not reproduced (asan)"
|
||||
rm -f "$fout"
|
||||
continue
|
||||
fi
|
||||
cp "$file" "$myout/$short.bin"
|
||||
echo "✔ Reproduced (asan)"
|
||||
done
|
17
run.sh
Executable file
17
run.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
export AFL_SKIP_CPUFREQ=1
|
||||
export AFL_TMPDIR=/dev/shm
|
||||
exe=./bin/Linux/LoadMesh
|
||||
opts=(
|
||||
-t 100
|
||||
-i sample_u/
|
||||
-o out/
|
||||
)
|
||||
if ! [ -d sample_u ]; then
|
||||
mkdir sample_u
|
||||
afl-cmin.bash -T 4 -i sample/ -o sample_u/ -- $exe @@
|
||||
echo; echo
|
||||
fi
|
||||
exec afl-fuzz \
|
||||
"${opts[@]}" "$@" \
|
||||
-- $exe @@
|
@ -4,9 +4,14 @@
|
||||
|
||||
variant=win32
|
||||
[[ "$(basename "$CXX")" == "x86_64-"* ]] && variant=win64
|
||||
with_sdl=0
|
||||
[[ "$extras" == *"-sdl"* ]] && with_sdl=1
|
||||
#with_gl3=0
|
||||
#[[ "$extras" == *"-gl3"* ]] && with_gl3=1
|
||||
|
||||
libjpeg_version=2.1.5.1
|
||||
libpng_version=1.6.39
|
||||
sdl2_version=2.28.1
|
||||
zlib_version=1.2.13
|
||||
|
||||
mkdir -p libs
|
||||
@ -16,10 +21,13 @@ libs=$PWD
|
||||
wget "http://minetest.kitsunemimi.pw/libjpeg-$libjpeg_version-$variant.zip" -O libjpeg.zip
|
||||
[ -e libpng.zip ] || \
|
||||
wget "http://minetest.kitsunemimi.pw/libpng-$libpng_version-$variant.zip" -O libpng.zip
|
||||
[[ $with_sdl -eq 0 || -e sdl2.zip ]] || \
|
||||
wget "http://minetest.kitsunemimi.pw/sdl2-$sdl2_version-$variant.zip" -O sdl2.zip
|
||||
[ -e zlib.zip ] || \
|
||||
wget "http://minetest.kitsunemimi.pw/zlib-$zlib_version-$variant.zip" -O zlib.zip
|
||||
[ -d libjpeg ] || unzip -o libjpeg.zip -d libjpeg
|
||||
[ -d libpng ] || unzip -o libpng.zip -d libpng
|
||||
[[ $with_sdl -eq 0 || -d sdl2 ]] || unzip -o sdl2.zip -d sdl2
|
||||
[ -d zlib ] || unzip -o zlib.zip -d zlib
|
||||
popd
|
||||
|
||||
@ -32,6 +40,11 @@ tmp=(
|
||||
-DZLIB_LIBRARY=$libs/zlib/lib/libz.dll.a \
|
||||
-DZLIB_INCLUDE_DIR=$libs/zlib/include
|
||||
)
|
||||
[ $with_sdl -eq 1 ] && tmp+=(
|
||||
-DUSE_SDL2=ON
|
||||
-DCMAKE_PREFIX_PATH=$libs/sdl2/lib/cmake
|
||||
)
|
||||
#[ $with_gl3 -eq 1 ] && tmp+=(-DENABLE_OPENGL=OFF -DENABLE_OPENGL3=ON)
|
||||
|
||||
cmake . "${tmp[@]}"
|
||||
make -j$(nproc)
|
||||
@ -41,8 +54,9 @@ if [ "$1" = "package" ]; then
|
||||
# strip library
|
||||
"${CXX%-*}-strip" --strip-unneeded _install/usr/local/lib/*.dll
|
||||
# bundle the DLLs that are specific to Irrlicht (kind of a hack)
|
||||
cp -p $libs/*/bin/lib{jpeg,png}*.dll _install/usr/local/lib/
|
||||
shopt -s nullglob
|
||||
cp -p $libs/*/bin/{libjpeg,libpng,SDL}*.dll _install/usr/local/lib/
|
||||
# create a ZIP
|
||||
(cd _install/usr/local; zip -9r "$OLDPWD"/irrlicht-$variant.zip -- *)
|
||||
(cd _install/usr/local; zip -9r "$OLDPWD/irrlicht-$variant$extras.zip" -- *)
|
||||
fi
|
||||
exit 0
|
||||
|
@ -535,11 +535,7 @@ void CIrrDeviceAndroid::createDriver()
|
||||
case video::EDT_NULL:
|
||||
VideoDriver = video::createNullDriver(FileSystem, CreationParams.WindowSize);
|
||||
break;
|
||||
case video::EDT_SOFTWARE:
|
||||
case video::EDT_BURNINGSVIDEO:
|
||||
case video::EDT_OPENGL:
|
||||
case video::DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS:
|
||||
case video::EDT_DIRECT3D9:
|
||||
os::Printer::log("This driver is not available in Android. Try OpenGL ES 1.0 or ES 2.0.", ELL_ERROR);
|
||||
break;
|
||||
default:
|
||||
|
@ -19,8 +19,7 @@ CCameraSceneNode::CCameraSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 i
|
||||
: ICameraSceneNode(parent, mgr, id, position),
|
||||
BoundingBox(core::vector3df(0, 0, 0)), // Camera has no size. Still not sure if FLT_MAX might be the better variant
|
||||
Target(lookat), UpVector(0.0f, 1.0f, 0.0f), ZNear(1.0f), ZFar(3000.0f),
|
||||
InputReceiverEnabled(true), TargetAndRotationAreBound(false),
|
||||
HasD3DStyleProjectionMatrix(true)
|
||||
InputReceiverEnabled(true), TargetAndRotationAreBound(false)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
setDebugName("CCameraSceneNode");
|
||||
@ -36,7 +35,6 @@ CCameraSceneNode::CCameraSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 i
|
||||
if ( d->getCurrentRenderTargetSize().Height )
|
||||
Aspect = (f32)d->getCurrentRenderTargetSize().Width /
|
||||
(f32)d->getCurrentRenderTargetSize().Height;
|
||||
HasD3DStyleProjectionMatrix = d->getDriverType() != video::EDT_OPENGL;
|
||||
}
|
||||
|
||||
ViewArea.setFarNearDistance(ZFar - ZNear);
|
||||
@ -223,7 +221,7 @@ void CCameraSceneNode::setFOV(f32 f)
|
||||
|
||||
void CCameraSceneNode::recalculateProjectionMatrix()
|
||||
{
|
||||
ViewArea.getTransform ( video::ETS_PROJECTION ).buildProjectionMatrixPerspectiveFovLH(Fovy, Aspect, ZNear, ZFar, HasD3DStyleProjectionMatrix);
|
||||
ViewArea.getTransform ( video::ETS_PROJECTION ).buildProjectionMatrixPerspectiveFovLH(Fovy, Aspect, ZNear, ZFar, false);
|
||||
IsOrthogonal = false;
|
||||
}
|
||||
|
||||
@ -296,7 +294,7 @@ void CCameraSceneNode::recalculateViewArea()
|
||||
core::matrix4 m(core::matrix4::EM4CONST_NOTHING);
|
||||
m.setbyproduct_nocheck(ViewArea.getTransform(video::ETS_PROJECTION),
|
||||
ViewArea.getTransform(video::ETS_VIEW));
|
||||
ViewArea.setFrom(m, HasD3DStyleProjectionMatrix);
|
||||
ViewArea.setFrom(m, false);
|
||||
}
|
||||
|
||||
|
||||
|
@ -161,8 +161,6 @@ namespace scene
|
||||
|
||||
bool InputReceiverEnabled;
|
||||
bool TargetAndRotationAreBound;
|
||||
|
||||
bool HasD3DStyleProjectionMatrix; // true: projection from 0 to w; false: -w to w
|
||||
};
|
||||
|
||||
} // end namespace
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
#include "CEGLManager.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_EGL_MANAGER_
|
||||
|
||||
#include "irrString.h"
|
||||
#include "irrArray.h"
|
||||
#include "os.h"
|
||||
@ -44,7 +42,7 @@ bool CEGLManager::initialize(const SIrrlichtCreationParameters& params, const SE
|
||||
return true;
|
||||
|
||||
// Window is depend on platform.
|
||||
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
|
||||
#if defined(_IRR_WINDOWS_API_)
|
||||
EglWindow = (NativeWindowType)Data.OpenGLWin32.HWnd;
|
||||
Data.OpenGLWin32.HDc = GetDC((HWND)EglWindow);
|
||||
EglDisplay = eglGetDisplay((NativeDisplayType)Data.OpenGLWin32.HDc);
|
||||
@ -99,7 +97,7 @@ void CEGLManager::terminate()
|
||||
EglDisplay = EGL_NO_DISPLAY;
|
||||
}
|
||||
|
||||
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
|
||||
#if defined(_IRR_WINDOWS_API_)
|
||||
if (Data.OpenGLWin32.HDc)
|
||||
{
|
||||
ReleaseDC((HWND)EglWindow, (HDC)Data.OpenGLWin32.HDc);
|
||||
@ -664,4 +662,3 @@ bool CEGLManager::testEGLError()
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_EGL_MANAGER_
|
||||
|
||||
#include <EGL/egl.h>
|
||||
|
||||
#include "SIrrCreationParameters.h"
|
||||
@ -111,4 +109,3 @@ namespace video
|
||||
};
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -332,7 +332,7 @@ void CIrrDeviceLinux::setupTopLevelXorgWindow()
|
||||
|
||||
Atom NET_WM_PID = XInternAtom(XDisplay, "_NET_WM_PID", false);
|
||||
|
||||
pid_t pid = getpid();
|
||||
long pid = static_cast<long>(getpid());
|
||||
|
||||
XChangeProperty(XDisplay, XWindow, NET_WM_PID,
|
||||
XA_CARDINAL, 32, PropModeReplace,
|
||||
@ -633,11 +633,6 @@ void CIrrDeviceLinux::createDriver()
|
||||
os::Printer::log("No WebGL1 support compiled in.", ELL_ERROR);
|
||||
#endif
|
||||
break;
|
||||
case video::DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS:
|
||||
case video::EDT_DIRECT3D9:
|
||||
os::Printer::log("This driver is not available in Linux. Try OpenGL or Software renderer.",
|
||||
ELL_ERROR);
|
||||
break;
|
||||
case video::EDT_NULL:
|
||||
VideoDriver = video::createNullDriver(FileSystem, CreationParams.WindowSize);
|
||||
break;
|
||||
@ -1485,7 +1480,7 @@ void CIrrDeviceLinux::createKeyMap()
|
||||
KeyMap.push_back(SKeyMap(XK_Next, KEY_NEXT));
|
||||
KeyMap.push_back(SKeyMap(XK_Page_Down, KEY_NEXT));
|
||||
KeyMap.push_back(SKeyMap(XK_End, KEY_END));
|
||||
KeyMap.push_back(SKeyMap(XK_Begin, KEY_HOME));
|
||||
KeyMap.push_back(SKeyMap(XK_Begin, KEY_NUMPAD5));
|
||||
KeyMap.push_back(SKeyMap(XK_Num_Lock, KEY_NUMLOCK));
|
||||
KeyMap.push_back(SKeyMap(XK_KP_Space, KEY_SPACE));
|
||||
KeyMap.push_back(SKeyMap(XK_KP_Tab, KEY_TAB));
|
||||
@ -1505,7 +1500,7 @@ void CIrrDeviceLinux::createKeyMap()
|
||||
KeyMap.push_back(SKeyMap(XK_KP_Next, KEY_NEXT));
|
||||
KeyMap.push_back(SKeyMap(XK_KP_Page_Down, KEY_NEXT));
|
||||
KeyMap.push_back(SKeyMap(XK_KP_End, KEY_END));
|
||||
KeyMap.push_back(SKeyMap(XK_KP_Begin, KEY_HOME));
|
||||
KeyMap.push_back(SKeyMap(XK_KP_Begin, KEY_NUMPAD5));
|
||||
KeyMap.push_back(SKeyMap(XK_KP_Insert, KEY_INSERT));
|
||||
KeyMap.push_back(SKeyMap(XK_KP_Delete, KEY_DELETE));
|
||||
KeyMap.push_back(SKeyMap(XK_KP_Equal, 0)); // ???
|
||||
|
@ -758,8 +758,6 @@ void CIrrDeviceMacOSX::createDriver()
|
||||
#endif
|
||||
break;
|
||||
|
||||
case video::DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS:
|
||||
case video::EDT_DIRECT3D9:
|
||||
case video::EDT_OGLES1:
|
||||
case video::EDT_OGLES2:
|
||||
os::Printer::log("This driver is not available in OSX. Try OpenGL or Software renderer.", ELL_ERROR);
|
||||
|
@ -24,7 +24,7 @@ CIrrDeviceStub::CIrrDeviceStub(const SIrrlichtCreationParameters& params)
|
||||
InputReceivingSceneManager(0), ContextManager(0),
|
||||
CreationParams(params), Close(false)
|
||||
{
|
||||
Timer = new CTimer(params.UsePerformanceTimer);
|
||||
Timer = new CTimer();
|
||||
if (os::Printer::Logger)
|
||||
{
|
||||
os::Printer::Logger->grab();
|
||||
|
@ -3,7 +3,6 @@
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
|
||||
|
||||
#if defined (__STRICT_ANSI__)
|
||||
#error Compiling with __STRICT_ANSI__ not supported. g++ does set this when compiling with -std=c++11 or -std=c++0x. Use instead -std=gnu++11 or -std=gnu++0x. Or use -U__STRICT_ANSI__ to disable strict ansi.
|
||||
@ -42,10 +41,6 @@ namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_
|
||||
IVideoDriver* createDirectX9Driver(const irr::SIrrlichtCreationParameters& params, io::IFileSystem* io, HWND window);
|
||||
#endif
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_OPENGL_
|
||||
IVideoDriver* createOpenGLDriver(const irr::SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager);
|
||||
#endif
|
||||
@ -951,19 +946,6 @@ void CIrrDeviceWin32::createDriver()
|
||||
{
|
||||
switch(CreationParams.DriverType)
|
||||
{
|
||||
case video::DEPRECATED_EDT_DIRECT3D8_NO_LONGER_EXISTS:
|
||||
os::Printer::log("DIRECT3D8 Driver is no longer supported in Irrlicht. Try another one.", ELL_ERROR);
|
||||
break;
|
||||
case video::EDT_DIRECT3D9:
|
||||
#ifdef _IRR_COMPILE_WITH_DIRECT3D_9_
|
||||
VideoDriver = video::createDirectX9Driver(CreationParams, FileSystem, HWnd);
|
||||
|
||||
if (!VideoDriver)
|
||||
os::Printer::log("Could not create DIRECT3D9 Driver.", ELL_ERROR);
|
||||
#else
|
||||
os::Printer::log("DIRECT3D9 Driver was not compiled into this dll. Try another one.", ELL_ERROR);
|
||||
#endif
|
||||
break;
|
||||
case video::EDT_OPENGL:
|
||||
#ifdef _IRR_COMPILE_WITH_OPENGL_
|
||||
switchToFullScreen();
|
||||
@ -1615,4 +1597,3 @@ core::dimension2di CIrrDeviceWin32::CCursorControl::getSupportedIconSize() const
|
||||
|
||||
} // end namespace
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_WINDOWS_DEVICE_
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
|
||||
|
||||
#include "CIrrDeviceStub.h"
|
||||
#include "IrrlichtDevice.h"
|
||||
|
||||
@ -425,5 +423,3 @@ namespace irr
|
||||
};
|
||||
|
||||
} // end namespace irr
|
||||
|
||||
#endif // _IRR_COMPILE_WITH_WINDOWS_DEVICE_
|
||||
|
@ -78,6 +78,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
|
||||
set(SOLARIS TRUE)
|
||||
endif()
|
||||
|
||||
# EGL
|
||||
|
||||
set(ENABLE_EGL OFF)
|
||||
|
||||
# Device
|
||||
|
||||
if(WIN32)
|
||||
@ -92,8 +96,11 @@ elseif(ANDROID)
|
||||
message(FATAL_ERROR "SDL2 device is not (yet) supported on Android")
|
||||
endif()
|
||||
set(DEVICE "ANDROID")
|
||||
# EGL is required for Android
|
||||
set(ENABLE_EGL ON)
|
||||
elseif(EMSCRIPTEN)
|
||||
add_definitions(-D_IRR_EMSCRIPTEN_PLATFORM_ -D_IRR_COMPILE_WITH_EGL_MANAGER_)
|
||||
add_definitions(-D_IRR_EMSCRIPTEN_PLATFORM_)
|
||||
set(ENABLE_EGL ON)
|
||||
set(LINUX_PLATFORM TRUE)
|
||||
set(DEVICE "SDL")
|
||||
elseif(SOLARIS)
|
||||
@ -178,7 +185,7 @@ endif()
|
||||
if(ENABLE_OPENGL)
|
||||
add_definitions(-D_IRR_COMPILE_WITH_OPENGL_)
|
||||
if(DEVICE STREQUAL "WINDOWS")
|
||||
add_definitions(-D_IRR_COMPILE_WITH_WGL_MANAGER_ -D_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
add_definitions(-D_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
elseif(DEVICE STREQUAL "X11")
|
||||
add_definitions(-D_IRR_COMPILE_WITH_GLX_MANAGER_ -D_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
elseif(DEVICE STREQUAL "OSX")
|
||||
@ -202,18 +209,22 @@ if(ENABLE_GLES1)
|
||||
endif()
|
||||
add_definitions(-D_IRR_COMPILE_WITH_OGLES1_)
|
||||
if(DEVICE MATCHES "^(WINDOWS|X11|ANDROID)$")
|
||||
add_definitions(-D_IRR_COMPILE_WITH_EGL_MANAGER_ -D_IRR_OGLES1_USE_EXTPOINTER_)
|
||||
add_definitions(-D_IRR_OGLES1_USE_EXTPOINTER_)
|
||||
endif()
|
||||
# We need EGL for GLES1
|
||||
set(ENABLE_EGL ON)
|
||||
endif()
|
||||
|
||||
if(ENABLE_GLES2)
|
||||
add_definitions(-D_IRR_COMPILE_WITH_OGLES2_)
|
||||
if(DEVICE MATCHES "^(WINDOWS|X11|ANDROID)$" OR EMSCRIPTEN)
|
||||
add_definitions(-D_IRR_COMPILE_WITH_EGL_MANAGER_ -D_IRR_OGLES2_USE_EXTPOINTER_)
|
||||
add_definitions(-D_IRR_OGLES2_USE_EXTPOINTER_)
|
||||
elseif(DEVICE STREQUAL "SDL")
|
||||
set(USE_SDLGL ON)
|
||||
set(USE_SDLGLES2 ON)
|
||||
endif()
|
||||
# We need EGL for GLES2
|
||||
set(ENABLE_EGL ON)
|
||||
endif()
|
||||
|
||||
if(ENABLE_WEBGL1)
|
||||
@ -241,6 +252,7 @@ elseif (ENABLE_GLES2)
|
||||
else()
|
||||
message(STATUS "OpenGL ES 2: OFF")
|
||||
endif()
|
||||
message(STATUS "EGL: ${ENABLE_EGL}")
|
||||
message(STATUS "WebGL: ${ENABLE_WEBGL1}")
|
||||
|
||||
# Required libs
|
||||
@ -352,12 +364,21 @@ add_library(IRROBJ OBJECT
|
||||
set(IRRDRVROBJ
|
||||
CNullDriver.cpp
|
||||
CGLXManager.cpp
|
||||
CWGLManager.cpp
|
||||
CEGLManager.cpp
|
||||
CSDLManager.cpp
|
||||
mt_opengl_loader.cpp
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(IRRDRVROBJ ${IRRDRVROBJ}
|
||||
CIrrDeviceWin32.cpp
|
||||
)
|
||||
if(ENABLE_OPENGL)
|
||||
set(IRRDRVROBJ ${IRRDRVROBJ}
|
||||
CWGLManager.cpp
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(ENABLE_OPENGL)
|
||||
set(IRRDRVROBJ
|
||||
${IRRDRVROBJ}
|
||||
@ -377,6 +398,14 @@ if(ENABLE_GLES1)
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
if(ENABLE_EGL)
|
||||
set(IRRDRVROBJ
|
||||
${IRRDRVROBJ}
|
||||
CEGLManager.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
set(IRRIMAGEOBJ
|
||||
CColorConverter.cpp
|
||||
CImage.cpp
|
||||
@ -440,7 +469,6 @@ add_library(IRROTHEROBJ OBJECT
|
||||
CIrrDeviceSDL.cpp
|
||||
CIrrDeviceLinux.cpp
|
||||
CIrrDeviceStub.cpp
|
||||
CIrrDeviceWin32.cpp
|
||||
CLogger.cpp
|
||||
COSOperator.cpp
|
||||
Irrlicht.cpp
|
||||
|
@ -283,11 +283,15 @@ void CNullDriver::removeTexture(ITexture* texture)
|
||||
{
|
||||
if (!texture)
|
||||
return;
|
||||
SSurface s;
|
||||
s.Surface = texture;
|
||||
|
||||
for (u32 i=0; i<Textures.size(); ++i)
|
||||
{
|
||||
if (Textures[i].Surface == texture)
|
||||
{
|
||||
s32 last;
|
||||
s32 first = Textures.binary_search_multi(s, last);
|
||||
if (first == -1)
|
||||
return;
|
||||
for (u32 i = first; i <= (u32)last; i++) {
|
||||
if (Textures[i].Surface == texture) {
|
||||
texture->drop();
|
||||
Textures.erase(i);
|
||||
return;
|
||||
@ -305,16 +309,6 @@ void CNullDriver::removeAllTextures()
|
||||
}
|
||||
|
||||
|
||||
//! Returns a texture by index
|
||||
ITexture* CNullDriver::getTextureByIndex(u32 i)
|
||||
{
|
||||
if ( i < Textures.size() )
|
||||
return Textures[i].Surface;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//! Returns amount of textures currently loaded
|
||||
u32 CNullDriver::getTextureCount() const
|
||||
{
|
||||
@ -322,19 +316,6 @@ u32 CNullDriver::getTextureCount() const
|
||||
}
|
||||
|
||||
|
||||
//! Renames a texture
|
||||
void CNullDriver::renameTexture(ITexture* texture, const io::path& newName)
|
||||
{
|
||||
// we can do a const_cast here safely, the name of the ITexture interface
|
||||
// is just readonly to prevent the user changing the texture name without invoking
|
||||
// this method, because the textures will need resorting afterwards
|
||||
|
||||
io::SNamedPath& name = const_cast<io::SNamedPath&>(texture->getName());
|
||||
name.setPath(newName);
|
||||
|
||||
Textures.sort();
|
||||
}
|
||||
|
||||
ITexture* CNullDriver::addTexture(const core::dimension2d<u32>& size, const io::path& name, ECOLOR_FORMAT format)
|
||||
{
|
||||
if (0 == name.size())
|
||||
@ -580,10 +561,7 @@ void CNullDriver::addTexture(video::ITexture* texture)
|
||||
|
||||
// the new texture is now at the end of the texture list. when searching for
|
||||
// the next new texture, the texture array will be sorted and the index of this texture
|
||||
// will be changed. to let the order be more consistent to the user, sort
|
||||
// the textures now already although this isn't necessary:
|
||||
|
||||
Textures.sort();
|
||||
// will be changed.
|
||||
}
|
||||
}
|
||||
|
||||
@ -869,8 +847,7 @@ const wchar_t* CNullDriver::getName() const
|
||||
|
||||
//! Creates a boolean alpha channel of the texture based of an color key.
|
||||
void CNullDriver::makeColorKeyTexture(video::ITexture* texture,
|
||||
video::SColor color,
|
||||
bool zeroTexels) const
|
||||
video::SColor color) const
|
||||
{
|
||||
if (!texture)
|
||||
return;
|
||||
@ -905,12 +882,7 @@ void CNullDriver::makeColorKeyTexture(video::ITexture* texture,
|
||||
// If the color matches the reference color, ignoring alphas,
|
||||
// set the alpha to zero.
|
||||
if(((*p) & 0x7fff) == refZeroAlpha)
|
||||
{
|
||||
if(zeroTexels)
|
||||
(*p) = 0;
|
||||
else
|
||||
(*p) = refZeroAlpha;
|
||||
}
|
||||
(*p) = refZeroAlpha;
|
||||
|
||||
++p;
|
||||
}
|
||||
@ -939,12 +911,7 @@ void CNullDriver::makeColorKeyTexture(video::ITexture* texture,
|
||||
// If the color matches the reference color, ignoring alphas,
|
||||
// set the alpha to zero.
|
||||
if(((*p) & 0x00ffffff) == refZeroAlpha)
|
||||
{
|
||||
if(zeroTexels)
|
||||
(*p) = 0;
|
||||
else
|
||||
(*p) = refZeroAlpha;
|
||||
}
|
||||
|
||||
++p;
|
||||
}
|
||||
@ -958,8 +925,7 @@ void CNullDriver::makeColorKeyTexture(video::ITexture* texture,
|
||||
|
||||
//! Creates an boolean alpha channel of the texture based of an color key position.
|
||||
void CNullDriver::makeColorKeyTexture(video::ITexture* texture,
|
||||
core::position2d<s32> colorKeyPixelPos,
|
||||
bool zeroTexels) const
|
||||
core::position2d<s32> colorKeyPixelPos) const
|
||||
{
|
||||
if (!texture)
|
||||
return;
|
||||
@ -1004,7 +970,7 @@ void CNullDriver::makeColorKeyTexture(video::ITexture* texture,
|
||||
}
|
||||
|
||||
texture->unlock();
|
||||
makeColorKeyTexture(texture, colorKey, zeroTexels);
|
||||
makeColorKeyTexture(texture, colorKey);
|
||||
}
|
||||
|
||||
|
||||
@ -1242,27 +1208,6 @@ IImage* CNullDriver::createImage(ECOLOR_FORMAT format, const core::dimension2d<u
|
||||
}
|
||||
|
||||
|
||||
//! Creates a software image from another image.
|
||||
IImage* CNullDriver::createImage(ECOLOR_FORMAT format, IImage *imageToCopy)
|
||||
{
|
||||
os::Printer::log("Deprecated method, please create an empty image instead and use copyTo().", ELL_WARNING);
|
||||
|
||||
CImage* tmp = new CImage(format, imageToCopy->getDimension());
|
||||
imageToCopy->copyTo(tmp);
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
//! Creates a software image from part of another image.
|
||||
IImage* CNullDriver::createImage(IImage* imageToCopy, const core::position2d<s32>& pos, const core::dimension2d<u32>& size)
|
||||
{
|
||||
os::Printer::log("Deprecated method, please create an empty image instead and use copyTo().", ELL_WARNING);
|
||||
CImage* tmp = new CImage(imageToCopy->getColorFormat(), imageToCopy->getDimension());
|
||||
imageToCopy->copyTo(tmp, core::position2di(0,0), core::recti(pos,size));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
||||
//! Creates a software image from part of a texture.
|
||||
IImage* CNullDriver::createImage(ITexture* texture, const core::position2d<s32>& pos, const core::dimension2d<u32>& size)
|
||||
{
|
||||
|
@ -79,15 +79,9 @@ namespace video
|
||||
//! loads a Texture
|
||||
ITexture* getTexture(io::IReadFile* file) override;
|
||||
|
||||
//! Returns a texture by index
|
||||
ITexture* getTextureByIndex(u32 index) override;
|
||||
|
||||
//! Returns amount of textures currently loaded
|
||||
u32 getTextureCount() const override;
|
||||
|
||||
//! Renames a texture
|
||||
void renameTexture(ITexture* texture, const io::path& newName) override;
|
||||
|
||||
ITexture* addTexture(const core::dimension2d<u32>& size, const io::path& name, ECOLOR_FORMAT format = ECF_A8R8G8B8) override;
|
||||
|
||||
ITexture* addTexture(const io::path& name, IImage* image) override;
|
||||
@ -296,11 +290,11 @@ namespace video
|
||||
const io::path& name, const ECOLOR_FORMAT format) override;
|
||||
|
||||
//! Creates an 1bit alpha channel of the texture based of an color key.
|
||||
void makeColorKeyTexture(video::ITexture* texture, video::SColor color, bool zeroTexels) const override;
|
||||
void makeColorKeyTexture(video::ITexture* texture, video::SColor color) const override;
|
||||
|
||||
//! Creates an 1bit alpha channel of the texture based of an color key position.
|
||||
virtual void makeColorKeyTexture(video::ITexture* texture, core::position2d<s32> colorKeyPixelPos,
|
||||
bool zeroTexels) const override;
|
||||
virtual void makeColorKeyTexture(video::ITexture* texture,
|
||||
core::position2d<s32> colorKeyPixelPos) const override;
|
||||
|
||||
//! Returns the maximum amount of primitives (mostly vertices) which
|
||||
//! the device is able to render with one drawIndexedTriangleList
|
||||
@ -328,14 +322,6 @@ namespace video
|
||||
//! Creates an empty software image.
|
||||
IImage* createImage(ECOLOR_FORMAT format, const core::dimension2d<u32>& size) override;
|
||||
|
||||
//! Creates a software image from another image.
|
||||
IImage* createImage(ECOLOR_FORMAT format, IImage *imageToCopy) override;
|
||||
|
||||
//! Creates a software image from part of another image.
|
||||
virtual IImage* createImage(IImage* imageToCopy,
|
||||
const core::position2d<s32>& pos,
|
||||
const core::dimension2d<u32>& size) override;
|
||||
|
||||
//! Creates a software image from part of a texture.
|
||||
virtual IImage* createImage(ITexture* texture,
|
||||
const core::position2d<s32>& pos,
|
||||
|
@ -83,7 +83,7 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file)
|
||||
bool mtlChanged=false;
|
||||
bool useGroups = !SceneManager->getParameters()->getAttributeAsBool(OBJ_LOADER_IGNORE_GROUPS);
|
||||
bool useMaterials = !SceneManager->getParameters()->getAttributeAsBool(OBJ_LOADER_IGNORE_MATERIAL_FILES);
|
||||
irr::u32 lineNr = 1; // only counts non-empty lines, still useful in debugging to locate errors
|
||||
[[maybe_unused]] irr::u32 lineNr = 1; // only counts non-empty lines, still useful in debugging to locate errors
|
||||
core::array<int> faceCorners;
|
||||
faceCorners.reallocate(32); // should be large enough
|
||||
const core::stringc TAG_OFF = "off";
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "fast_atof.h"
|
||||
|
||||
#if defined(_IRR_OGLES1_USE_EXTPOINTER_)
|
||||
#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
|
||||
#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(_IRR_WINDOWS_API_)
|
||||
#include <EGL/egl.h>
|
||||
#else
|
||||
#include <GLES/egl.h>
|
||||
|
@ -48,7 +48,7 @@ bool COpenGLDriver::initDriver()
|
||||
|
||||
genericDriverInit();
|
||||
|
||||
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_) || defined(_IRR_COMPILE_WITH_X11_DEVICE_)
|
||||
#if defined(_IRR_WINDOWS_API_) || defined(_IRR_COMPILE_WITH_X11_DEVICE_)
|
||||
extGlSwapInterval(Params.Vsync ? 1 : 0);
|
||||
#endif
|
||||
|
||||
@ -1034,15 +1034,6 @@ void COpenGLDriver::renderArray(const void* indexList, u32 primitiveCount,
|
||||
case scene::EPT_TRIANGLES:
|
||||
glDrawElements(GL_TRIANGLES, primitiveCount*3, indexSize, indexList);
|
||||
break;
|
||||
case scene::EPT_QUAD_STRIP:
|
||||
glDrawElements(GL_QUAD_STRIP, primitiveCount*2+2, indexSize, indexList);
|
||||
break;
|
||||
case scene::EPT_QUADS:
|
||||
glDrawElements(GL_QUADS, primitiveCount*4, indexSize, indexList);
|
||||
break;
|
||||
case scene::EPT_POLYGON:
|
||||
glDrawElements(GL_POLYGON, primitiveCount, indexSize, indexList);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2532,8 +2523,6 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
|
||||
|
||||
// Polygon Offset
|
||||
if (queryFeature(EVDF_POLYGON_OFFSET) && (resetAllRenderStates ||
|
||||
lastmaterial.PolygonOffsetDirection != material.PolygonOffsetDirection ||
|
||||
lastmaterial.PolygonOffsetFactor != material.PolygonOffsetFactor ||
|
||||
lastmaterial.PolygonOffsetSlopeScale != material.PolygonOffsetSlopeScale ||
|
||||
lastmaterial.PolygonOffsetDepthBias != material.PolygonOffsetDepthBias ))
|
||||
{
|
||||
@ -2544,15 +2533,6 @@ void COpenGLDriver::setBasicRenderStates(const SMaterial& material, const SMater
|
||||
|
||||
glPolygonOffset(material.PolygonOffsetSlopeScale, material.PolygonOffsetDepthBias);
|
||||
}
|
||||
else if (material.PolygonOffsetFactor)
|
||||
{
|
||||
glEnable(material.Wireframe?GL_POLYGON_OFFSET_LINE:material.PointCloud?GL_POLYGON_OFFSET_POINT:GL_POLYGON_OFFSET_FILL);
|
||||
|
||||
if (material.PolygonOffsetDirection==EPO_BACK)
|
||||
glPolygonOffset(1.0f, (GLfloat)material.PolygonOffsetFactor);
|
||||
else
|
||||
glPolygonOffset(-1.0f, (GLfloat)-material.PolygonOffsetFactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
glPolygonOffset(0.0f, 0.f);
|
||||
@ -3893,12 +3873,6 @@ GLenum COpenGLDriver::primitiveTypeToGL(scene::E_PRIMITIVE_TYPE type) const
|
||||
return GL_TRIANGLE_FAN;
|
||||
case scene::EPT_TRIANGLES:
|
||||
return GL_TRIANGLES;
|
||||
case scene::EPT_QUAD_STRIP:
|
||||
return GL_QUAD_STRIP;
|
||||
case scene::EPT_QUADS:
|
||||
return GL_QUADS;
|
||||
case scene::EPT_POLYGON:
|
||||
return GL_POLYGON;
|
||||
case scene::EPT_POINT_SPRITES:
|
||||
#ifdef GL_ARB_point_sprite
|
||||
return GL_POINT_SPRITE_ARB;
|
||||
|
@ -3391,7 +3391,7 @@ inline void COpenGLExtensionHandler::extGlGenerateTextureMipmap(GLuint texture,
|
||||
inline void COpenGLExtensionHandler::extGlSwapInterval(int interval)
|
||||
{
|
||||
// we have wglext, so try to use that
|
||||
#if defined(_IRR_WINDOWS_API_) && defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_)
|
||||
#if defined(_IRR_WINDOWS_API_)
|
||||
#ifdef WGL_EXT_swap_control
|
||||
if (pWglSwapIntervalEXT)
|
||||
pWglSwapIntervalEXT(interval);
|
||||
|
@ -14,9 +14,9 @@ namespace irr
|
||||
{
|
||||
public:
|
||||
|
||||
CTimer(bool usePerformanceTimer=true)
|
||||
CTimer()
|
||||
{
|
||||
os::Timer::initTimer(usePerformanceTimer);
|
||||
os::Timer::initTimer();
|
||||
}
|
||||
|
||||
//! Returns current real time in milliseconds of the system.
|
||||
@ -28,12 +28,6 @@ namespace irr
|
||||
return os::Timer::getRealTime();
|
||||
}
|
||||
|
||||
//! Get current time and date in calendar form
|
||||
RealTimeDate getRealTimeAndDate() const override
|
||||
{
|
||||
return os::Timer::getRealTimeAndDate();
|
||||
}
|
||||
|
||||
//! Returns current virtual time in milliseconds.
|
||||
/** This value starts with 0 and can be manipulated using setTime(), stopTimer(),
|
||||
startTimer(), etc. This value depends on the set speed of the timer if the timer
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
#include "CWGLManager.h"
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_WGL_MANAGER_
|
||||
|
||||
#include "os.h"
|
||||
|
||||
#include <GL/gl.h>
|
||||
@ -507,5 +505,3 @@ bool CWGLManager::swapBuffers()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -4,8 +4,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_WGL_MANAGER_
|
||||
|
||||
#include "SIrrCreationParameters.h"
|
||||
#include "SExposedVideoData.h"
|
||||
#include "IContextManager.h"
|
||||
@ -72,5 +70,3 @@ namespace video
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -13,7 +13,7 @@ static const char* const copyright = "Irrlicht Engine (c) 2002-2017 Nikolaus Geb
|
||||
#endif
|
||||
|
||||
#include "irrlicht.h"
|
||||
#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
|
||||
#ifdef _IRR_WINDOWS_API_
|
||||
#include "CIrrDeviceWin32.h"
|
||||
#endif
|
||||
|
||||
@ -60,7 +60,7 @@ namespace irr
|
||||
|
||||
IrrlichtDevice* dev = 0;
|
||||
|
||||
#ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_
|
||||
#ifdef _IRR_WINDOWS_API_
|
||||
if (params.DeviceType == EIDT_WIN32 || (!dev && params.DeviceType == EIDT_BEST))
|
||||
dev = new CIrrDeviceWin32(params);
|
||||
#endif
|
||||
|
@ -16,7 +16,6 @@
|
||||
#define bswap_16(X) _byteswap_ushort(X)
|
||||
#define bswap_32(X) _byteswap_ulong(X)
|
||||
#define bswap_64(X) _byteswap_uint64(X)
|
||||
#define localtime _localtime_s
|
||||
#elif defined(_IRR_OSX_PLATFORM_)
|
||||
#include <libkern/OSByteOrder.h>
|
||||
#define bswap_16(X) OSReadSwapInt16(&X,0)
|
||||
@ -51,9 +50,6 @@ namespace os
|
||||
u64 Byteswap::byteswap(u64 num) {return bswap_64(num);}
|
||||
s64 Byteswap::byteswap(s64 num) {return bswap_64(num);}
|
||||
f32 Byteswap::byteswap(f32 num) {u32 tmp=IR(num); tmp=bswap_32(tmp); return (FR(tmp));}
|
||||
// prevent accidental byte swapping of chars
|
||||
u8 Byteswap::byteswap(u8 num) {return num;}
|
||||
c8 Byteswap::byteswap(c8 num) {return num;}
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,12 +78,9 @@ namespace os
|
||||
static LARGE_INTEGER HighPerformanceFreq;
|
||||
static BOOL HighPerformanceTimerSupport = FALSE;
|
||||
|
||||
void Timer::initTimer(bool usePerformanceTimer)
|
||||
void Timer::initTimer()
|
||||
{
|
||||
if (usePerformanceTimer)
|
||||
HighPerformanceTimerSupport = QueryPerformanceFrequency(&HighPerformanceFreq);
|
||||
else
|
||||
HighPerformanceTimerSupport = FALSE;
|
||||
HighPerformanceTimerSupport = QueryPerformanceFrequency(&HighPerformanceFreq);
|
||||
initVirtualTimer();
|
||||
}
|
||||
|
||||
@ -158,7 +151,7 @@ namespace os
|
||||
__android_log_print(LogLevel, "Irrlicht", "%s\n", &message[start]);
|
||||
}
|
||||
|
||||
void Timer::initTimer(bool usePerformanceTimer)
|
||||
void Timer::initTimer()
|
||||
{
|
||||
initVirtualTimer();
|
||||
}
|
||||
@ -211,7 +204,7 @@ namespace os
|
||||
emscripten_log(log_level, "%s", message); // Note: not adding \n as emscripten_log seems to do that already.
|
||||
}
|
||||
|
||||
void Timer::initTimer(bool usePerformanceTimer)
|
||||
void Timer::initTimer()
|
||||
{
|
||||
initVirtualTimer();
|
||||
}
|
||||
@ -244,7 +237,7 @@ namespace os
|
||||
printf("%s\n", message);
|
||||
}
|
||||
|
||||
void Timer::initTimer(bool usePerformanceTimer)
|
||||
void Timer::initTimer()
|
||||
{
|
||||
initVirtualTimer();
|
||||
}
|
||||
@ -297,35 +290,6 @@ namespace os
|
||||
u32 Timer::StartRealTime = 0;
|
||||
u32 Timer::StaticTime = 0;
|
||||
|
||||
//! Get real time and date in calendar form
|
||||
ITimer::RealTimeDate Timer::getRealTimeAndDate()
|
||||
{
|
||||
time_t rawtime;
|
||||
time(&rawtime);
|
||||
|
||||
struct tm * timeinfo;
|
||||
timeinfo = localtime(&rawtime);
|
||||
|
||||
// init with all 0 to indicate error
|
||||
ITimer::RealTimeDate date;
|
||||
memset(&date, 0, sizeof(date));
|
||||
// at least Windows returns NULL on some illegal dates
|
||||
if (timeinfo)
|
||||
{
|
||||
// set useful values if succeeded
|
||||
date.Hour=(u32)timeinfo->tm_hour;
|
||||
date.Minute=(u32)timeinfo->tm_min;
|
||||
date.Second=(u32)timeinfo->tm_sec;
|
||||
date.Day=(u32)timeinfo->tm_mday;
|
||||
date.Month=(u32)timeinfo->tm_mon+1;
|
||||
date.Year=(u32)timeinfo->tm_year+1900;
|
||||
date.Weekday=(ITimer::EWeekday)timeinfo->tm_wday;
|
||||
date.Yearday=(u32)timeinfo->tm_yday+1;
|
||||
date.IsDST=timeinfo->tm_isdst != 0;
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
//! returns current virtual time
|
||||
u32 Timer::getTime()
|
||||
{
|
||||
|
@ -26,8 +26,8 @@ namespace os
|
||||
static s64 byteswap(s64 num);
|
||||
static f32 byteswap(f32 num);
|
||||
// prevent accidental swapping of chars
|
||||
static u8 byteswap(u8 num);
|
||||
static c8 byteswap(c8 num);
|
||||
static inline u8 byteswap(u8 num) { return num; }
|
||||
static inline c8 byteswap(c8 num) { return num; }
|
||||
};
|
||||
|
||||
class Printer
|
||||
@ -51,11 +51,8 @@ namespace os
|
||||
//! returns the current time in milliseconds
|
||||
static u32 getTime();
|
||||
|
||||
//! get current time and date in calendar form
|
||||
static ITimer::RealTimeDate getRealTimeAndDate();
|
||||
|
||||
//! initializes the real timer
|
||||
static void initTimer(bool usePerformanceTimer=true);
|
||||
static void initTimer();
|
||||
|
||||
//! sets the current virtual (game) time
|
||||
static void setTime(u32 time);
|
||||
|
Reference in New Issue
Block a user