From a6d062ebd9513db64a9fb5e1ba7864319905c62c Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Sat, 4 Mar 2023 22:27:43 +0300 Subject: [PATCH 1/8] Apply suggestions from code review Co-authored-by: sfan5 --- source/Irrlicht/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Irrlicht/CMakeLists.txt b/source/Irrlicht/CMakeLists.txt index 7b51145..7a29d37 100644 --- a/source/Irrlicht/CMakeLists.txt +++ b/source/Irrlicht/CMakeLists.txt @@ -200,7 +200,7 @@ endif() if(ENABLE_GLES1) add_definitions(-D_IRR_COMPILE_WITH_OGLES1_) - if(DEVICE MATCHES "^WINDOWS|X11|ANDROID$") + if(DEVICE MATCHES "^(WINDOWS|X11|ANDROID)$") add_definitions(-D_IRR_COMPILE_WITH_EGL_MANAGER_ -D_IRR_OGLES1_USE_EXTPOINTER_) elseif(DEVICE STREQUAL "IOS") add_definitions(-D_IRR_COMPILE_WITH_EAGL_MANAGER_) @@ -209,7 +209,7 @@ endif() if(ENABLE_GLES2) add_definitions(-D_IRR_COMPILE_WITH_OGLES2_) - if(DEVICE MATCHES "^WINDOWS|X11|ANDROID$" OR EMSCRIPTEN) + if(DEVICE MATCHES "^(WINDOWS|X11|ANDROID)$" OR EMSCRIPTEN) add_definitions(-D_IRR_COMPILE_WITH_EGL_MANAGER_ -D_IRR_OGLES2_USE_EXTPOINTER_) elseif(DEVICE STREQUAL "IOS") add_definitions(-D_IRR_COMPILE_WITH_EAGL_MANAGER_) @@ -275,7 +275,7 @@ elseif(APPLE) else() # Unix probably find_package(X11 REQUIRED) - if(${USE_XINPUT2} AND NOT X11_Xi_FOUND) + if(USE_XINPUT2 AND NOT X11_Xi_FOUND) message(FATAL_ERROR "XInput not found") endif() endif() From 1d43ea17ca8ee9a01262e9e34c5c89579b97397f Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 5 Mar 2023 21:44:44 +0100 Subject: [PATCH 2/8] Bump revision --- CMakeLists.txt | 2 +- include/IrrCompileConfig.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b7b244a..a15d263 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ else() cmake_policy(VERSION 3.9) endif() -set(IRRLICHTMT_REVISION 9) +set(IRRLICHTMT_REVISION 10) project(Irrlicht VERSION 1.9.0.${IRRLICHTMT_REVISION} diff --git a/include/IrrCompileConfig.h b/include/IrrCompileConfig.h index fe1e29d..0d308e9 100644 --- a/include/IrrCompileConfig.h +++ b/include/IrrCompileConfig.h @@ -6,8 +6,8 @@ #define __IRR_COMPILE_CONFIG_H_INCLUDED__ //! Identifies the IrrlichtMt fork customized for the Minetest engine -#define IRRLICHT_VERSION_MT_REVISION 9 -#define IRRLICHT_VERSION_MT "mt9" +#define IRRLICHT_VERSION_MT_REVISION 10 +#define IRRLICHT_VERSION_MT "mt10" //! Irrlicht SDK Version #define IRRLICHT_VERSION_MAJOR 1 From 6de0afa8b3b6304b080798024bac41cdc668e823 Mon Sep 17 00:00:00 2001 From: numzero Date: Mon, 6 Mar 2023 13:58:38 +0300 Subject: [PATCH 3/8] Drop ETS_TEXTURE_1 The transformation state itself is still available via ETS_TEXTURE_0+1 --- include/IVideoDriver.h | 4 +--- source/Irrlicht/COGLES2FixedPipelineRenderer.cpp | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/IVideoDriver.h b/include/IVideoDriver.h index e3ea221..b220e5e 100644 --- a/include/IVideoDriver.h +++ b/include/IVideoDriver.h @@ -57,10 +57,8 @@ namespace video //! Projection transformation ETS_PROJECTION, //! Texture 0 transformation - //! Use ETS_TEXTURE_0 + texture_number to access other texture transformations + //! Use E_TRANSFORMATION_STATE(ETS_TEXTURE_0 + texture_number) to access other texture transformations ETS_TEXTURE_0, - //! Texture 1 transformation - ETS_TEXTURE_1, //! Only used internally ETS_COUNT = ETS_TEXTURE_0 + MATERIAL_MAX_TEXTURES }; diff --git a/source/Irrlicht/COGLES2FixedPipelineRenderer.cpp b/source/Irrlicht/COGLES2FixedPipelineRenderer.cpp index 5b275d3..899dfd9 100644 --- a/source/Irrlicht/COGLES2FixedPipelineRenderer.cpp +++ b/source/Irrlicht/COGLES2FixedPipelineRenderer.cpp @@ -176,7 +176,7 @@ void COGLES2MaterialSolid2CB::OnSetConstants(IMaterialRendererServices* services core::matrix4 Matrix = driver->getTransform(ETS_TEXTURE_0); services->setPixelShaderConstant(TMatrix0ID, Matrix.pointer(), 16); - Matrix = driver->getTransform(ETS_TEXTURE_1); + Matrix = driver->getTransform(E_TRANSFORMATION_STATE(ETS_TEXTURE_0 + 1)); services->setPixelShaderConstant(TMatrix1ID, Matrix.pointer(), 16); services->setPixelShaderConstant(TextureUsage0ID, &TextureUsage0, 1); @@ -223,7 +223,7 @@ void COGLES2MaterialLightmapCB::OnSetConstants(IMaterialRendererServices* servic core::matrix4 Matrix = driver->getTransform(ETS_TEXTURE_0); services->setPixelShaderConstant(TMatrix0ID, Matrix.pointer(), 16); - Matrix = driver->getTransform(ETS_TEXTURE_1); + Matrix = driver->getTransform(E_TRANSFORMATION_STATE(ETS_TEXTURE_0 + 1)); services->setPixelShaderConstant(TMatrix1ID, Matrix.pointer(), 16); services->setPixelShaderConstant(ModulateID, &Modulate, 1); From 5f76be9380048bcaf708974177579086043704f2 Mon Sep 17 00:00:00 2001 From: numzero Date: Mon, 6 Mar 2023 14:10:05 +0300 Subject: [PATCH 4/8] Restore isDriverSupported, but in a cpp file --- include/IrrlichtDevice.h | 4 +++- source/Irrlicht/Irrlicht.cpp | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/include/IrrlichtDevice.h b/include/IrrlichtDevice.h index 07d4f9f..c6a1978 100644 --- a/include/IrrlichtDevice.h +++ b/include/IrrlichtDevice.h @@ -14,6 +14,7 @@ #include "ICursorControl.h" #include "ITimer.h" #include "IOSOperator.h" +#include "IrrCompileConfig.h" namespace irr { @@ -34,6 +35,7 @@ namespace irr namespace video { class IContextManager; + extern "C" IRRLICHT_API bool IRRCALLCONV isDriverSupported(E_DRIVER_TYPE driver); } // end namespace video //! The Irrlicht device. You can create it with createDevice() or createDeviceEx(). @@ -310,7 +312,7 @@ namespace irr for a configuration requested when creating the device. */ static bool isDriverSupported(video::E_DRIVER_TYPE driver) { - return true; + return video::isDriverSupported(driver); } }; diff --git a/source/Irrlicht/Irrlicht.cpp b/source/Irrlicht/Irrlicht.cpp index 826414f..50348e7 100644 --- a/source/Irrlicht/Irrlicht.cpp +++ b/source/Irrlicht/Irrlicht.cpp @@ -113,6 +113,26 @@ namespace core namespace video { SMaterial IdentityMaterial; + + extern "C" IRRLICHT_API bool IRRCALLCONV isDriverSupported(E_DRIVER_TYPE driver) + { + switch (driver) { + case EDT_NULL: return true; +#ifdef _IRR_COMPILE_WITH_OPENGL_ + case EDT_OPENGL: return true; +#endif +#ifdef _IRR_COMPILE_WITH_OGLES1_ + case EDT_OGLES1: return true; +#endif +#ifdef _IRR_COMPILE_WITH_OGLES2_ + case EDT_OGLES2: return true; +#endif +#ifdef _IRR_COMPILE_WITH_WEBGL1_ + case EDT_WEBGL1: return true; +#endif + default: return false; + } + } } } // end namespace irr From e484698ba27673b88233bedb571dd1df5edeae64 Mon Sep 17 00:00:00 2001 From: numzero Date: Mon, 6 Mar 2023 14:21:58 +0300 Subject: [PATCH 5/8] Restrict X11 options to X11 device --- source/Irrlicht/CMakeLists.txt | 46 +++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/source/Irrlicht/CMakeLists.txt b/source/Irrlicht/CMakeLists.txt index 7a29d37..cfd3bbe 100644 --- a/source/Irrlicht/CMakeLists.txt +++ b/source/Irrlicht/CMakeLists.txt @@ -113,38 +113,32 @@ else() set(DEVICE "X11") endif() -if(USE_SDL2) - set(DEVICE "SDL") -endif() - -option(USE_X11 "Use X11" TRUE) -if(USE_X11) - add_definitions(-D_IRR_COMPILE_WITH_X11_) -endif() - if(LINUX_PLATFORM) add_definitions(-D_IRR_LINUX_PLATFORM_) endif() +if(USE_SDL2) + set(DEVICE "SDL") +endif() + +add_definitions("-D_IRR_COMPILE_WITH_${DEVICE}_DEVICE_") + +# X11 + +if(DEVICE STREQUAL "X11") + option(USE_X11 "Use X11" TRUE) +else() + set(USE_X11 FALSE) +endif() + if(LINUX_PLATFORM AND USE_X11) - add_definitions(-D_IRR_COMPILE_WITH_X11_) - option(USE_XINPUT2 "Use XInput2" TRUE) - if(USE_XINPUT2) - add_definitions(-D_IRR_LINUX_X11_XINPUT2_) - endif() - option(USE_XCURSOR "Use XCursor" FALSE) - if(USE_XCURSOR) - add_definitions(-D_IRR_LINUX_XCURSOR_) - endif() else() set(USE_XINPUT2 FALSE) set(USE_XCURSOR FALSE) endif() -add_definitions("-D_IRR_COMPILE_WITH_${DEVICE}_DEVICE_") - # Joystick if(NOT (BSD OR SOLARIS OR EMSCRIPTEN)) @@ -421,6 +415,18 @@ elseif(APPLE) ) endif() +if(USE_X11) + target_compile_definitions(IRROTHEROBJ PRIVATE _IRR_COMPILE_WITH_X11_) +endif() + +if(USE_XINPUT2) + target_compile_definitions(IRROTHEROBJ PRIVATE _IRR_LINUX_X11_XINPUT2_) +endif() + +if(USE_XCURSOR) + target_compile_definitions(IRROTHEROBJ PRIVATE _IRR_LINUX_XCURSOR_) +endif() + add_library(IRRGUIOBJ OBJECT CGUIButton.cpp CGUICheckBox.cpp From b27981043772b209d895cf0414e1213878a6354c Mon Sep 17 00:00:00 2001 From: numzero Date: Mon, 6 Mar 2023 17:32:03 +0300 Subject: [PATCH 6/8] Consolidate import/export attribute definitions --- source/Irrlicht/CMakeLists.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/Irrlicht/CMakeLists.txt b/source/Irrlicht/CMakeLists.txt index cfd3bbe..4d2ec7e 100644 --- a/source/Irrlicht/CMakeLists.txt +++ b/source/Irrlicht/CMakeLists.txt @@ -6,13 +6,16 @@ option(USE_SDL2 "Use the SDL2 backend" FALSE) add_definitions(-DIRRLICHT_EXPORTS) if(BUILD_SHARED_LIBS) if(WIN32) - add_definitions("-DIRRLICHT_API=__declspec(dllexport)") + set(API_IMPORT "__declspec(dllimport)") + set(API_EXPORT "__declspec(dllexport)") elseif(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") - add_definitions("-DIRRLICHT_API=__attribute__ ((visibility(\"default\")))") + set(API_EXPORT "__attribute__ ((visibility(\"default\")))") # only necessary if default visibility is set to hidden endif() else() add_definitions(-D_IRR_STATIC_LIB_) endif() +add_definitions("-DIRRLICHT_API=${API_EXPORT}") + if(CMAKE_BUILD_TYPE STREQUAL "Debug") add_definitions(-D_DEBUG) endif() @@ -472,11 +475,9 @@ target_include_directories(IrrlichtMt target_link_libraries(IrrlichtMt PRIVATE ${link_libs}) if(WIN32) - target_compile_definitions(IrrlichtMt INTERFACE _IRR_WINDOWS_API_) -endif() -if(WIN32 AND BUILD_SHARED_LIBS) - target_compile_definitions(IrrlichtMt INTERFACE IRRLICHT_API=__declspec(dllimport)) + target_compile_definitions(IrrlichtMt INTERFACE _IRR_WINDOWS_API_) # used in _IRR_DEBUG_BREAK_IF definition in a public header endif() +target_compile_definitions(IrrlichtMt INTERFACE "IRRLICHT_API=${API_IMPORT}") if(APPLE OR ANDROID OR EMSCRIPTEN) target_compile_definitions(IrrlichtMt PUBLIC IRR_MOBILE_PATHS) endif() From 5a5a7d04b71b576ac9eed1bb58110009f8b46d0b Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Sat, 11 Mar 2023 17:04:09 +0300 Subject: [PATCH 7/8] Drop IrrCompileConfig (#163) --- .github/workflows/build.yml | 9 +- examples/AutomatedTest/main.cpp | 12 +- include/EDeviceTypes.h | 2 +- include/IEventReceiver.h | 8 +- include/IVideoDriver.h | 27 +- include/IrrCompileConfig.h | 446 +----------------- include/IrrlichtDevice.h | 38 +- include/SIrrCreationParameters.h | 4 +- include/SMaterial.h | 3 +- include/exampleHelper.h | 3 +- include/irrMath.h | 9 - include/irrTypes.h | 3 - include/irrUString.h | 4 +- include/irrlicht.h | 2 +- include/matrix4.h | 1 + include/mt_opengl.h | 2 +- scripts/BindingGenerator.lua | 2 +- .../Android/CAndroidAssetFileArchive.cpp | 1 - .../Android/CAndroidAssetFileArchive.h | 1 - .../Irrlicht/Android/CAndroidAssetReader.cpp | 1 - source/Irrlicht/Android/CAndroidAssetReader.h | 1 - source/Irrlicht/Android/CIrrDeviceAndroid.h | 1 - source/Irrlicht/Android/CKeyEventWrapper.h | 1 - source/Irrlicht/BuiltInFont.h | 16 - source/Irrlicht/CAnimatedMeshSceneNode.cpp | 2 + source/Irrlicht/CAttributes.h | 1 - source/Irrlicht/CB3DMeshFileLoader.cpp | 7 - source/Irrlicht/CB3DMeshFileLoader.h | 1 - source/Irrlicht/CB3DMeshWriter.cpp | 6 - source/Irrlicht/CBillboardSceneNode.cpp | 4 - source/Irrlicht/CBoneSceneNode.cpp | 6 - source/Irrlicht/CEAGLManager.h | 1 - source/Irrlicht/CEGLManager.h | 1 - source/Irrlicht/CFileList.cpp | 1 - source/Irrlicht/CFileSystem.cpp | 3 - source/Irrlicht/CGLXManager.h | 1 - source/Irrlicht/CGUIButton.cpp | 4 - source/Irrlicht/CGUIButton.h | 6 - source/Irrlicht/CGUICheckBox.cpp | 5 - source/Irrlicht/CGUICheckBox.h | 5 - source/Irrlicht/CGUIComboBox.cpp | 5 - source/Irrlicht/CGUIComboBox.h | 6 - source/Irrlicht/CGUIEditBox.cpp | 4 - source/Irrlicht/CGUIEditBox.h | 5 - source/Irrlicht/CGUIEnvironment.cpp | 10 +- source/Irrlicht/CGUIEnvironment.h | 7 - source/Irrlicht/CGUIFileOpenDialog.cpp | 3 - source/Irrlicht/CGUIFileOpenDialog.h | 6 - source/Irrlicht/CGUIFont.cpp | 4 - source/Irrlicht/CGUIFont.h | 6 - source/Irrlicht/CGUIImage.cpp | 5 - source/Irrlicht/CGUIImage.h | 5 - source/Irrlicht/CGUIListBox.cpp | 4 - source/Irrlicht/CGUIListBox.h | 5 - source/Irrlicht/CGUIScrollBar.cpp | 4 - source/Irrlicht/CGUIScrollBar.h | 6 - source/Irrlicht/CGUISkin.cpp | 4 - source/Irrlicht/CGUISkin.h | 7 - source/Irrlicht/CGUISpriteBank.cpp | 3 - source/Irrlicht/CGUISpriteBank.h | 6 - source/Irrlicht/CGUIStaticText.cpp | 4 - source/Irrlicht/CGUIStaticText.h | 6 - source/Irrlicht/CGUITabControl.cpp | 4 - source/Irrlicht/CGUITabControl.h | 6 - source/Irrlicht/CImageLoaderBMP.cpp | 5 - source/Irrlicht/CImageLoaderBMP.h | 11 - source/Irrlicht/CImageLoaderJPG.cpp | 41 +- source/Irrlicht/CImageLoaderJPG.h | 17 +- source/Irrlicht/CImageLoaderPNG.cpp | 23 +- source/Irrlicht/CImageLoaderPNG.h | 5 - source/Irrlicht/CImageLoaderTGA.cpp | 5 - source/Irrlicht/CImageLoaderTGA.h | 10 - source/Irrlicht/CImageWriterJPG.cpp | 12 +- source/Irrlicht/CImageWriterJPG.h | 5 - source/Irrlicht/CImageWriterPNG.cpp | 19 +- source/Irrlicht/CImageWriterPNG.h | 5 - source/Irrlicht/CIrrDeviceLinux.h | 1 - source/Irrlicht/CIrrDeviceOSX.h | 1 - source/Irrlicht/CIrrDeviceOSX.mm | 1 - source/Irrlicht/CIrrDeviceSDL.cpp | 1 - source/Irrlicht/CIrrDeviceSDL.h | 1 - source/Irrlicht/CIrrDeviceStub.cpp | 4 +- source/Irrlicht/CIrrDeviceWin32.cpp | 1 - source/Irrlicht/CIrrDeviceWin32.h | 1 - source/Irrlicht/CIrrDeviceiOS.h | 1 - source/Irrlicht/CMakeLists.txt | 228 +++++++-- source/Irrlicht/CNSOGLManager.h | 1 - source/Irrlicht/CNullDriver.cpp | 102 +--- source/Irrlicht/COBJMeshFileLoader.cpp | 6 - source/Irrlicht/COGLES2Common.h | 1 - source/Irrlicht/COGLES2Driver.h | 1 - source/Irrlicht/COGLES2ExtensionHandler.h | 1 - .../Irrlicht/COGLES2FixedPipelineRenderer.cpp | 4 +- .../Irrlicht/COGLES2FixedPipelineRenderer.h | 1 - source/Irrlicht/COGLES2MaterialRenderer.h | 1 - source/Irrlicht/COGLES2Renderer2D.h | 1 - source/Irrlicht/COGLESCommon.h | 1 - source/Irrlicht/COGLESCoreExtensionHandler.h | 1 - source/Irrlicht/COGLESDriver.h | 1 - source/Irrlicht/COGLESExtensionHandler.h | 1 - source/Irrlicht/COGLESMaterialRenderer.h | 1 - source/Irrlicht/COpenGLCacheHandler.h | 1 - source/Irrlicht/COpenGLCommon.h | 1 - source/Irrlicht/COpenGLCoreCacheHandler.h | 1 - source/Irrlicht/COpenGLCoreFeature.h | 1 - source/Irrlicht/COpenGLCoreRenderTarget.h | 1 - source/Irrlicht/COpenGLCoreTexture.h | 1 - source/Irrlicht/COpenGLDriver.h | 1 - source/Irrlicht/COpenGLExtensionHandler.h | 1 - source/Irrlicht/COpenGLMaterialRenderer.h | 1 - source/Irrlicht/COpenGLSLMaterialRenderer.h | 1 - .../Irrlicht/COpenGLShaderMaterialRenderer.h | 1 - source/Irrlicht/CSDLManager.h | 1 - source/Irrlicht/CSceneManager.cpp | 98 +--- source/Irrlicht/CSkinnedMesh.cpp | 6 - source/Irrlicht/CWGLManager.h | 1 - source/Irrlicht/CWebGL1Driver.h | 1 - source/Irrlicht/CWebGLExtensionHandler.h | 1 - source/Irrlicht/CXMeshFileLoader.cpp | 6 - source/Irrlicht/CZipReader.cpp | 15 +- source/Irrlicht/CZipReader.h | 5 - source/Irrlicht/Irrlicht.cpp | 21 +- source/Irrlicht/SB3DStructs.h | 1 - source/Irrlicht/os.cpp | 1 - source/Irrlicht/os.h | 1 - 125 files changed, 288 insertions(+), 1179 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef5d462..41dc3d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,9 +48,7 @@ jobs: - name: Build run: | - sed '/#define _IRR_COMPILE_WITH_OGLES2_/ s|^//||g' -i include/IrrCompileConfig.h - sed '/#define _IRR_COMPILE_WITH_OPENGL_/ s|^|//|g' -i include/IrrCompileConfig.h - cmake . -DBUILD_EXAMPLES=1 + cmake . -DBUILD_EXAMPLES=1 -DENABLE_OPENGL=OFF -DENABLE_GLES2=ON make -j2 - name: Test (headless) @@ -61,7 +59,7 @@ jobs: - name: Test (Xvfb) run: | cd bin/Linux - LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest + LIBGL_ALWAYS_SOFTWARE=true xvfb-run ./AutomatedTest ogles2 linux-sdl: runs-on: ubuntu-latest @@ -77,8 +75,7 @@ jobs: - name: Build run: | - sed '/#define _IRR_COMPILE_WITH_SDL_DEVICE_/ s|^//||g' -i include/IrrCompileConfig.h - cmake . -DBUILD_EXAMPLES=1 + cmake . -DBUILD_EXAMPLES=1 -DUSE_SDL2=ON make -j2 - name: Test (headless) diff --git a/examples/AutomatedTest/main.cpp b/examples/AutomatedTest/main.cpp index e724176..0141b2b 100644 --- a/examples/AutomatedTest/main.cpp +++ b/examples/AutomatedTest/main.cpp @@ -10,15 +10,17 @@ static int test_fail = 0; void test_irr_array(); void test_irr_string(); -static video::E_DRIVER_TYPE chooseDriver(const char *arg_) +static video::E_DRIVER_TYPE chooseDriver(core::stringc arg_) { - if (core::stringc(arg_) == "null") + if (arg_ == "null") return video::EDT_NULL; - - if (IrrlichtDevice::isDriverSupported(video::EDT_OGLES1)) + if (arg_ == "ogles1") return video::EDT_OGLES1; - if (IrrlichtDevice::isDriverSupported(video::EDT_OGLES2)) + if (arg_ == "ogles2") return video::EDT_OGLES2; + if (arg_ == "opengl") + return video::EDT_OPENGL; + std::cerr << "Unknown driver type: " << arg_.c_str() << ". Trying OpenGL." << std::endl; return video::EDT_OPENGL; } diff --git a/include/EDeviceTypes.h b/include/EDeviceTypes.h index be61460..a0c1ca7 100644 --- a/include/EDeviceTypes.h +++ b/include/EDeviceTypes.h @@ -31,7 +31,7 @@ namespace irr //! A device which uses Simple DirectMedia Layer /** The SDL device works under all platforms supported by SDL but first must be compiled - in by defining the _IRR_COMPILE_WITH_SDL_DEVICE_ macro in IrrCompileConfig.h */ + in by setting the USE_SDL2 CMake option to ON */ EIDT_SDL, //! This selection allows Irrlicht to choose the best device from the ones available. diff --git a/include/IEventReceiver.h b/include/IEventReceiver.h index 91588a3..ed82b5f 100644 --- a/include/IEventReceiver.h +++ b/include/IEventReceiver.h @@ -452,10 +452,10 @@ struct SEvent /** Unlike other events, joystick events represent the result of polling * each connected joystick once per run() of the device. Joystick events will * not be generated by default. If joystick support is available for the - * active device, _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ is defined, and - * @ref irr::IrrlichtDevice::activateJoysticks() has been called, an event of - * this type will be generated once per joystick per @ref IrrlichtDevice::run() - * regardless of whether the state of the joystick has actually changed. */ + * active device, and @ref irr::IrrlichtDevice::activateJoysticks() has been + * called, an event of this type will be generated once per joystick per + * @ref IrrlichtDevice::run() regardless of whether the state of the joystick + * has actually changed. */ struct SJoystickEvent { enum diff --git a/include/IVideoDriver.h b/include/IVideoDriver.h index a8cea13..b220e5e 100644 --- a/include/IVideoDriver.h +++ b/include/IVideoDriver.h @@ -56,32 +56,11 @@ namespace video ETS_WORLD, //! Projection transformation ETS_PROJECTION, - //! Texture transformation + //! Texture 0 transformation + //! Use E_TRANSFORMATION_STATE(ETS_TEXTURE_0 + texture_number) to access other texture transformations ETS_TEXTURE_0, - //! Texture transformation - ETS_TEXTURE_1, - //! Texture transformation - ETS_TEXTURE_2, - //! Texture transformation - ETS_TEXTURE_3, -#if _IRR_MATERIAL_MAX_TEXTURES_>4 - //! Texture transformation - ETS_TEXTURE_4, -#if _IRR_MATERIAL_MAX_TEXTURES_>5 - //! Texture transformation - ETS_TEXTURE_5, -#if _IRR_MATERIAL_MAX_TEXTURES_>6 - //! Texture transformation - ETS_TEXTURE_6, -#if _IRR_MATERIAL_MAX_TEXTURES_>7 - //! Texture transformation - ETS_TEXTURE_7, -#endif -#endif -#endif -#endif //! Only used internally - ETS_COUNT = ETS_TEXTURE_0 + _IRR_MATERIAL_MAX_TEXTURES_ + ETS_COUNT = ETS_TEXTURE_0 + MATERIAL_MAX_TEXTURES }; //! Special render targets, which usually map to dedicated hardware diff --git a/include/IrrCompileConfig.h b/include/IrrCompileConfig.h index 0d308e9..33361aa 100644 --- a/include/IrrCompileConfig.h +++ b/include/IrrCompileConfig.h @@ -20,454 +20,14 @@ #include // TODO: Although included elsewhere this is required at least for mingw -//! The defines for different operating system are: -//! _IRR_WINDOWS_ for all irrlicht supported Windows versions -//! _IRR_WINDOWS_API_ for Windows or XBox -//! _IRR_LINUX_PLATFORM_ for Linux (it is defined here if no other os is defined) -//! _IRR_SOLARIS_PLATFORM_ for Solaris -//! _IRR_OSX_PLATFORM_ for Apple systems running OSX -//! _IRR_IOS_PLATFORM_ for Apple devices running iOS -//! _IRR_ANDROID_PLATFORM_ for devices running Android -//! _IRR_POSIX_API_ for Posix compatible systems -//! Note: PLATFORM defines the OS specific layer, API can group several platforms - -//! DEVICE is the windowing system used, several PLATFORMs support more than one DEVICE -//! Irrlicht can be compiled with more than one device -//! _IRR_COMPILE_WITH_WINDOWS_DEVICE_ for Windows API based device -//! _IRR_COMPILE_WITH_OSX_DEVICE_ for Cocoa native windowing on OSX -//! _IRR_COMPILE_WITH_X11_DEVICE_ for Linux X11 based device -//! _IRR_COMPILE_WITH_SDL_DEVICE_ for platform independent SDL framework - -//! Passing defines to the compiler which have NO in front of the _IRR definename is an alternative -//! way which can be used to disable defines (instead of outcommenting them in this header). -//! So defines can be controlled from Makefiles or Projectfiles which allows building -//! different library versions without having to change the sources. -//! Example: NO_IRR_COMPILE_WITH_X11_ would disable X11 - -//! Uncomment this line to compile with the SDL device -//#define _IRR_COMPILE_WITH_SDL_DEVICE_ -#ifdef NO_IRR_COMPILE_WITH_SDL_DEVICE_ -#undef _IRR_COMPILE_WITH_SDL_DEVICE_ -#endif - -//! WIN32 for Windows32 -//! WIN64 for Windows64 -// The windows platform and API support SDL and WINDOW device -#if defined(_WIN32) || defined(_WIN64) -#define _IRR_WINDOWS_ -#define _IRR_WINDOWS_API_ -#ifndef _IRR_COMPILE_WITH_SDL_DEVICE_ -#define _IRR_COMPILE_WITH_WINDOWS_DEVICE_ -#endif -#endif - -#if defined(__APPLE__) -#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) || defined(__IPHONE_OS_VERSION_MIN_REQUIRED) -#define _IRR_IOS_PLATFORM_ -#define _IRR_COMPILE_WITH_IOS_DEVICE_ -#define NO_IRR_COMPILE_WITH_OPENGL_ -// The application state events and following methods: IrrlichtDevice::isWindowActive, IrrlichtDevice::isWindowFocused, -// IrrlichtDevice::isWindowMinimized works out of box only if you'll use built-in CIrrDelegateiOS, -// so _IRR_COMPILE_WITH_IOS_BUILTIN_MAIN_ must be enabled in this case. If you need a custom UIApplicationDelegate -// you must disable _IRR_COMPILE_WITH_IOS_BUILTIN_MAIN_ definition and handle all application events yourself. -#define _IRR_COMPILE_WITH_IOS_BUILTIN_MAIN_ -#else -#define _IRR_OSX_PLATFORM_ -#ifndef _IRR_COMPILE_WITH_SDL_DEVICE_ -#define _IRR_COMPILE_WITH_OSX_DEVICE_ -#endif -#define NO_IRR_COMPILE_WITH_OGLES1_ -#define NO_IRR_COMPILE_WITH_OGLES2_ -#define NO_IRR_COMPILE_WITH_WEBGL1_ -#endif -#endif - -#if defined(__EMSCRIPTEN__) -#define _IRR_EMSCRIPTEN_PLATFORM_ -#define NO_IRR_COMPILE_WITH_JOYSTICK_EVENTS_ -#define NO_IRR_COMPILE_WITH_OPENGL_ -#define NO_IRR_COMPILE_WITH_OGLES1_ -#define _IRR_COMPILE_WITH_OGLES2_ -#define _IRR_COMPILE_WITH_WEBGL1_ -#define _IRR_COMPILE_WITH_EGL_MANAGER_ -#define _IRR_COMPILE_WITH_SDL_DEVICE_ -#define NO_IRR_COMPILE_WITH_X11_DEVICE_ -#define _IRR_LINUX_PLATFORM_ // emscripten basically working like a unix -#endif // __EMSCRIPTEN__ - -#if defined(__ANDROID__) -#define _IRR_ANDROID_PLATFORM_ -#define _IRR_COMPILE_WITH_ANDROID_DEVICE_ -#define _IRR_COMPILE_ANDROID_ASSET_READER_ -#define NO_IRR_COMPILE_WITH_OPENGL_ -#endif - -#if defined(__SVR4) && defined(__sun) -#define _IRR_SOLARIS_PLATFORM_ -#if defined(__sparc) - #define __BIG_ENDIAN__ -#endif -#endif - -#if !defined(_IRR_WINDOWS_API_) && !defined(_IRR_OSX_PLATFORM_) && !defined(_IRR_IOS_PLATFORM_) && !defined(_IRR_ANDROID_PLATFORM_) && !defined(_IRR_EMSCRIPTEN_PLATFORM_) -#ifndef _IRR_SOLARIS_PLATFORM_ -#define _IRR_LINUX_PLATFORM_ -#endif -#define _IRR_POSIX_API_ -#ifndef _IRR_COMPILE_WITH_SDL_DEVICE_ -#define _IRR_COMPILE_WITH_X11_DEVICE_ -#endif -#endif - - -//! Define _IRR_COMPILE_WITH_JOYSTICK_SUPPORT_ if you want joystick events. -#if !(defined(__FreeBSD__) || defined(__OpenBSD__)) -#define _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ -#endif -#ifdef NO_IRR_COMPILE_WITH_JOYSTICK_EVENTS_ -#undef _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ -#endif - - -//! Maximum number of texture an SMaterial can have, up to 8 are supported by Irrlicht. -#define _IRR_MATERIAL_MAX_TEXTURES_ 4 - -//! Add a leak-hunter to Irrlicht which helps finding unreleased reference counted objects. -//! NOTE: This is slow and should only be used for debugging -//#define _IRR_COMPILE_WITH_LEAK_HUNTER_ -#ifdef NO_IRR_COMPILE_WITH_LEAK_HUNTER_ -#undef _IRR_COMPILE_WITH_LEAK_HUNTER_ -#endif - -//! Enable profiling information in the engine -/** NOTE: The profiler itself always exists and can be used by applications. -This define is about the engine creating profile data -while it runs and enabling it will slow down the engine. */ -//#define _IRR_COMPILE_WITH_PROFILING_ -#ifdef NO_IRR_COMPILE_WITH_PROFILING_ -#undef _IRR_COMPILE_WITH_PROFILING_ -#endif - -//! Define _IRR_COMPILE_WITH_DIRECT3D_9_ to compile the Irrlicht engine with DIRECT3D9. -/** If you only want to use the software device or opengl you can disable those defines. -This switch is mostly disabled because people do not get the g++ compiler compile -directX header files, and directX is only available on Windows platforms. If you -are using Dev-Cpp, and want to compile this using a DX dev pack, you can define -_IRR_COMPILE_WITH_DX9_DEV_PACK_. So you simply need to add something like this -to the compiler settings: -DIRR_COMPILE_WITH_DX9_DEV_PACK -and this to the linker settings: -ld3dx9 -*/ -#if defined(_IRR_WINDOWS_API_) && defined(IRR_COMPILE_WITH_DX9_DEV_PACK) - -//! Define _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ if you want to use DirectInput for joystick handling. -/** This only applies to Windows devices, currently only supported under Win32 device. -If not defined, Windows Multimedia library is used, which offers also broad support for joystick devices. */ -#define _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ -#ifdef NO_IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ -#undef _IRR_COMPILE_WITH_DIRECTINPUT_JOYSTICK_ -#endif - -#endif - -//! Define _IRR_COMPILE_WITH_OPENGL_ to compile the Irrlicht engine with OpenGL. -/** If you do not wish the engine to be compiled with OpenGL, comment this -define out. */ -#define _IRR_COMPILE_WITH_OPENGL_ -#ifdef NO_IRR_COMPILE_WITH_OPENGL_ -#undef _IRR_COMPILE_WITH_OPENGL_ -#endif - -//! Define required options for OpenGL drivers. -#if defined(_IRR_COMPILE_WITH_OPENGL_) - #if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_) - #define _IRR_OPENGL_USE_EXTPOINTER_ - #define _IRR_COMPILE_WITH_WGL_MANAGER_ - #elif defined(_IRR_COMPILE_WITH_X11_DEVICE_) - #define _IRR_OPENGL_USE_EXTPOINTER_ - #define _IRR_COMPILE_WITH_GLX_MANAGER_ - #elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_) - #define _IRR_COMPILE_WITH_NSOGL_MANAGER_ - #elif defined(_IRR_SOLARIS_PLATFORM_) - #define _IRR_COMPILE_WITH_GLX_MANAGER_ - #elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) - #define _IRR_OPENGL_USE_EXTPOINTER_ - #endif -#endif - -//! Define _IRR_COMPILE_WITH_OGLES1_ to compile the Irrlicht engine with OpenGL ES 1.1. -/** If you do not wish the engine to be compiled with OpenGL ES 1.1, comment this -define out. -Depending on platform you may have to enable _IRR_OGLES1_USE_KHRONOS_API_HEADERS_ as well when using it. -*/ -#if defined(_IRR_ANDROID_PLATFORM_) || defined(_IRR_IOS_PLATFORM_) -#define _IRR_COMPILE_WITH_OGLES1_ -#endif -#ifdef NO_IRR_COMPILE_WITH_OGLES1_ -#undef _IRR_COMPILE_WITH_OGLES1_ -#endif - -#ifdef _IRR_COMPILE_WITH_OGLES1_ -//! Define _IRR_OGLES1_USE_KHRONOS_API_HEADERS_ to use the OpenGL ES headers from the Debian Khronos-api package -//#define _IRR_OGLES1_USE_KHRONOS_API_HEADERS_ -#endif - -//! Define required options for OpenGL ES 1.1 drivers. -#if defined(_IRR_COMPILE_WITH_OGLES1_) -#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_) || defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) -#define _IRR_OGLES1_USE_EXTPOINTER_ -#ifndef _IRR_COMPILE_WITH_EGL_MANAGER_ -#define _IRR_COMPILE_WITH_EGL_MANAGER_ -#endif -#elif defined(_IRR_COMPILE_WITH_IOS_DEVICE_) -#ifndef _IRR_COMPILE_WITH_EAGL_MANAGER_ -#define _IRR_COMPILE_WITH_EAGL_MANAGER_ -#endif -#endif -#endif - -//! Define _IRR_COMPILE_WITH_OGLES2_ to compile the Irrlicht engine with OpenGL ES 2.0. -/** If you do not wish the engine to be compiled with OpenGL ES 2.0, comment this -define out. */ -#if defined(_IRR_ANDROID_PLATFORM_) || defined(_IRR_IOS_PLATFORM_) -#define _IRR_COMPILE_WITH_OGLES2_ -#else -//#define _IRR_COMPILE_WITH_OGLES2_ -#endif -#ifdef NO_IRR_COMPILE_WITH_OGLES2_ -#undef _IRR_COMPILE_WITH_OGLES2_ -#endif - -//! Define _IRR_COMPILE_WITH_WEBGL1_ to compile Irrlicht engine with a WebGL friendly -//! subset of the OpenGL ES 2.0 driver. -//#define _IRR_COMPILE_WITH_WEBGL1_ -#ifdef NO_IRR_COMPILE_WITH_WEBGL1_ -#undef _IRR_COMPILE_WITH_WEBGL1_ -#endif -#ifdef _IRR_COMPILE_WITH_WEBGL1_ -#define _IRR_COMPILE_WITH_OGLES2_ // it's a subset of OGL ES2, so always needed when using WebGL -#endif - -//! Define required options for OpenGL ES 2.0 drivers. -#if defined(_IRR_COMPILE_WITH_OGLES2_) -#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_) || defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(__EMSCRIPTEN__) -#define _IRR_OGLES2_USE_EXTPOINTER_ -#ifndef _IRR_COMPILE_WITH_EGL_MANAGER_ -#define _IRR_COMPILE_WITH_EGL_MANAGER_ -#endif -#elif defined(_IRR_COMPILE_WITH_IOS_DEVICE_) -#ifndef _IRR_COMPILE_WITH_EAGL_MANAGER_ -#define _IRR_COMPILE_WITH_EAGL_MANAGER_ -#endif -#endif -#endif - - - -//! Define _IRR_COMPILE_WITH_X11_ to compile the Irrlicht engine with X11 support. -/** If you do not wish the engine to be compiled with X11, comment this -define out. */ -// Only used in LinuxDevice. -#define _IRR_COMPILE_WITH_X11_ -#ifdef NO_IRR_COMPILE_WITH_X11_ -#undef _IRR_COMPILE_WITH_X11_ -#endif - -#if defined(_IRR_LINUX_PLATFORM_) && defined(_IRR_COMPILE_WITH_X11_) -//! XInput2 (library called Xi) is currently only used to support touch-input. -#define _IRR_LINUX_X11_XINPUT2_ -#ifdef NO_IRR_LINUX_X11_XINPUT2_ -#undef _IRR_LINUX_X11_XINPUT2_ -#endif - -//! X11 has by default only monochrome cursors, but using the Xcursor library we can also get color cursor support. -//! If you have the need for custom color cursors on X11 then enable this and make sure you also link -//! to the Xcursor library in your Makefile/Projectfile. -//#define _IRR_LINUX_XCURSOR_ -#ifdef NO_IRR_LINUX_XCURSOR_ -#undef _IRR_LINUX_XCURSOR_ -#endif - -#endif - -//! Define _IRR_COMPILE_WITH_GUI_ to compile the engine with the built-in GUI -/** Disable this if you are using an external library to draw the GUI. If you disable this then -you will not be able to use anything provided by the GUI Environment, including loading fonts. */ -#define _IRR_COMPILE_WITH_GUI_ -#ifdef NO_IRR_COMPILE_WITH_GUI_ -#undef _IRR_COMPILE_WITH_GUI_ -#endif - -//! Define _IRR_COMPILE_WITH_LIBJPEG_ to enable compiling the engine using libjpeg. -/** This enables the engine to read jpeg images. If you comment this out, -the engine will no longer read .jpeg images. */ -#define _IRR_COMPILE_WITH_LIBJPEG_ -#ifdef NO_IRR_COMPILE_WITH_LIBJPEG_ -#undef _IRR_COMPILE_WITH_LIBJPEG_ -#endif - -//! Define _IRR_COMPILE_WITH_LIBPNG_ to enable compiling the engine using libpng. -/** This enables the engine to read png images. If you comment this out, -the engine will no longer read .png images. */ -#define _IRR_COMPILE_WITH_LIBPNG_ -#ifdef NO_IRR_COMPILE_WITH_LIBPNG_ -#undef _IRR_COMPILE_WITH_LIBPNG_ -#endif - -//! Uncomment the following line if you want to ignore the deprecated warnings -//#define IGNORE_DEPRECATED_WARNING - -//! Define _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ to support BillboardSceneNodes -#define _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ -#ifdef NO_IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ -#undef _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ -#endif - -//! Define _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ if you want to use bone based -/** animated meshes. If you compile without this, you will be unable to load -B3D, MS3D or X meshes */ -#define _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ -#ifdef NO_IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ -#undef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ -#endif - -#ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ -//! Define _IRR_COMPILE_WITH_B3D_LOADER_ if you want to use Blitz3D files -#define _IRR_COMPILE_WITH_B3D_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_B3D_LOADER_ -#undef _IRR_COMPILE_WITH_B3D_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_X_LOADER_ if you want to use Microsoft X files -#define _IRR_COMPILE_WITH_X_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_X_LOADER_ -#undef _IRR_COMPILE_WITH_X_LOADER_ -#endif -#endif // _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ - -//! Define _IRR_COMPILE_WITH_OBJ_LOADER_ if you want to load Wavefront OBJ files -#define _IRR_COMPILE_WITH_OBJ_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_OBJ_LOADER_ -#undef _IRR_COMPILE_WITH_OBJ_LOADER_ -#endif - -//! Define _IRR_COMPILE_WITH_BMP_LOADER_ if you want to load .bmp files -//! Disabling this loader will also disable the built-in font -#define _IRR_COMPILE_WITH_BMP_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_BMP_LOADER_ -#undef _IRR_COMPILE_WITH_BMP_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_JPG_LOADER_ if you want to load .jpg files -#define _IRR_COMPILE_WITH_JPG_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_JPG_LOADER_ -#undef _IRR_COMPILE_WITH_JPG_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_PNG_LOADER_ if you want to load .png files -#define _IRR_COMPILE_WITH_PNG_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_PNG_LOADER_ -#undef _IRR_COMPILE_WITH_PNG_LOADER_ -#endif -//! Define _IRR_COMPILE_WITH_TGA_LOADER_ if you want to load .tga files -#define _IRR_COMPILE_WITH_TGA_LOADER_ -#ifdef NO_IRR_COMPILE_WITH_TGA_LOADER_ -#undef _IRR_COMPILE_WITH_TGA_LOADER_ -#endif - -//! Define _IRR_COMPILE_WITH_JPG_WRITER_ if you want to write .jpg files -#define _IRR_COMPILE_WITH_JPG_WRITER_ -#ifdef NO_IRR_COMPILE_WITH_JPG_WRITER_ -#undef _IRR_COMPILE_WITH_JPG_WRITER_ -#endif -//! Define _IRR_COMPILE_WITH_PNG_WRITER_ if you want to write .png files -#define _IRR_COMPILE_WITH_PNG_WRITER_ -#ifdef NO_IRR_COMPILE_WITH_PNG_WRITER_ -#undef _IRR_COMPILE_WITH_PNG_WRITER_ -#endif - -//! Define __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ if you want to open ZIP and GZIP archives -/** ZIP reading has several more options below to configure. */ -#define __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ -#ifdef NO__IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ -#undef __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ -#endif -#ifdef __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ -//! Define _IRR_COMPILE_WITH_ZLIB_ to enable compiling the engine using zlib. -/** This enables the engine to read from compressed .zip archives. If you -disable this feature, the engine can still read archives, but only uncompressed -ones. */ -#define _IRR_COMPILE_WITH_ZLIB_ -#ifdef NO_IRR_COMPILE_WITH_ZLIB_ -#undef _IRR_COMPILE_WITH_ZLIB_ -#endif -#endif - -//! Define __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_ if you want to mount folders as archives -#define __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_ -#ifdef NO__IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_ -#undef __IRR_COMPILE_WITH_MOUNT_ARCHIVE_LOADER_ -#endif - -// Some cleanup and standard stuff - -#ifdef _IRR_WINDOWS_API_ - -// To build Irrlicht as a static library, you must define _IRR_STATIC_LIB_ in both the -// Irrlicht build, *and* in the user application, before #including -#ifndef _IRR_STATIC_LIB_ -#ifdef IRRLICHT_EXPORTS -#define IRRLICHT_API __declspec(dllexport) -#else -#define IRRLICHT_API __declspec(dllimport) -#endif // IRRLICHT_EXPORT -#else -#define IRRLICHT_API -#endif // _IRR_STATIC_LIB_ - -// Declare the calling convention. -#if defined(_STDCALL_SUPPORTED) +#ifdef _WIN32 #define IRRCALLCONV __stdcall #else -#define IRRCALLCONV __cdecl -#endif // STDCALL_SUPPORTED - -#else // _IRR_WINDOWS_API_ - -// Force symbol export in shared libraries built with gcc. -#if defined(__GNUC__) && !defined(_IRR_STATIC_LIB_) && defined(IRRLICHT_EXPORTS) -#define IRRLICHT_API __attribute__ ((visibility("default"))) -#else -#define IRRLICHT_API -#endif - #define IRRCALLCONV - -#endif // _IRR_WINDOWS_API_ - -#if defined(_IRR_SOLARIS_PLATFORM_) - #undef _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ #endif -//! Define __IRR_HAS_S64 if the irr::s64 type should be enable (needs long long, available on most platforms, but not part of ISO C++ 98) -#define __IRR_HAS_S64 -#ifdef NO__IRR_HAS_S64 -#undef __IRR_HAS_S64 -#endif - -#ifndef __has_feature - #define __has_feature(x) 0 // Compatibility with non-clang compilers. -#endif - -#ifdef _DEBUG - //! A few attributes are written in CSceneManager when _IRR_SCENEMANAGER_DEBUG is enabled - // NOTE: Those attributes were used always until 1.8.0 and became a global define for 1.8.1 - // which is only enabled in debug because it had a large (sometimes >5%) impact on speed. - // A better solution in the long run is to break the interface and remove _all_ attribute - // access in functions like CSceneManager::drawAll and instead put that information in some - // own struct/class or in CSceneManager. - // See http://irrlicht.sourceforge.net/forum/viewtopic.php?f=2&t=48211 for the discussion. - #define _IRR_SCENEMANAGER_DEBUG - #ifdef NO_IRR_SCENEMANAGER_DEBUG - #undef _IRR_SCENEMANAGER_DEBUG - #endif +#ifndef IRRLICHT_API +#define IRRLICHT_API #endif #endif // __IRR_COMPILE_CONFIG_H_INCLUDED__ - diff --git a/include/IrrlichtDevice.h b/include/IrrlichtDevice.h index b967d70..c6a1978 100644 --- a/include/IrrlichtDevice.h +++ b/include/IrrlichtDevice.h @@ -14,6 +14,7 @@ #include "ICursorControl.h" #include "ITimer.h" #include "IOSOperator.h" +#include "IrrCompileConfig.h" namespace irr { @@ -34,6 +35,7 @@ namespace irr namespace video { class IContextManager; + extern "C" IRRLICHT_API bool IRRCALLCONV isDriverSupported(E_DRIVER_TYPE driver); } // end namespace video //! The Irrlicht device. You can create it with createDevice() or createDeviceEx(). @@ -235,8 +237,8 @@ namespace irr as this would consume joystick info that 3rd party libraries might rely on. Call this method to activate joystick support in Irrlicht and to receive irr::SJoystickEvent events. \param joystickInfo On return, this will contain an array of each joystick that was found and activated. - \return true if joysticks are supported on this device and _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ - is defined, false if joysticks are not supported or support is compiled out. + \return true if joysticks are supported on this device, false if joysticks are not + supported or support is compiled out. */ virtual bool activateJoysticks(core::array& joystickInfo) =0; @@ -310,37 +312,7 @@ namespace irr for a configuration requested when creating the device. */ static bool isDriverSupported(video::E_DRIVER_TYPE driver) { - switch (driver) - { - case video::EDT_NULL: - return true; - case video::EDT_OPENGL: -#ifdef _IRR_COMPILE_WITH_OPENGL_ - return true; -#else - return false; -#endif - case video::EDT_OGLES1: -#ifdef _IRR_COMPILE_WITH_OGLES1_ - return true; -#else - return false; -#endif - case video::EDT_OGLES2: -#ifdef _IRR_COMPILE_WITH_OGLES2_ - return true; -#else - return false; -#endif - case video::EDT_WEBGL1: -#ifdef _IRR_COMPILE_WITH_WEBGL1_ - return true; -#else - return false; -#endif - default: - return false; - } + return video::isDriverSupported(driver); } }; diff --git a/include/SIrrCreationParameters.h b/include/SIrrCreationParameters.h index f99fce5..bad56e3 100644 --- a/include/SIrrCreationParameters.h +++ b/include/SIrrCreationParameters.h @@ -11,7 +11,7 @@ #include "ILogger.h" #include "position2d.h" #include "path.h" -#include "IrrCompileConfig.h" +#include "IrrCompileConfig.h" // for IRRLICHT_SDK_VERSION namespace irr { @@ -53,7 +53,7 @@ namespace irr UsePerformanceTimer(true), SDK_version_do_not_use(IRRLICHT_SDK_VERSION), PrivateData(0), -#if defined(_IRR_COMPILE_WITH_IOS_DEVICE_) || defined(_IRR_ANDROID_PLATFORM_) || defined(_IRR_EMSCRIPTEN_PLATFORM_) +#ifdef IRR_MOBILE_PATHS OGLES2ShaderPath("media/Shaders/") #else OGLES2ShaderPath("../../media/Shaders/") diff --git a/include/SMaterial.h b/include/SMaterial.h index 43dadb6..88460e0 100644 --- a/include/SMaterial.h +++ b/include/SMaterial.h @@ -12,6 +12,7 @@ #include "EMaterialTypes.h" #include "EMaterialFlags.h" #include "SMaterialLayer.h" +#include "IrrCompileConfig.h" // for IRRLICHT_API namespace irr { @@ -280,7 +281,7 @@ namespace video /** SMaterial might ignore some textures in most function, like assignment and comparison, when SIrrlichtCreationParameters::MaxTextureUnits is set to a lower number. */ - const u32 MATERIAL_MAX_TEXTURES = _IRR_MATERIAL_MAX_TEXTURES_; + const u32 MATERIAL_MAX_TEXTURES = 4; //! Struct for holding parameters for a material renderer // Note for implementors: Serialization is in CNullDriver diff --git a/include/exampleHelper.h b/include/exampleHelper.h index e1e7cb2..a98ed96 100755 --- a/include/exampleHelper.h +++ b/include/exampleHelper.h @@ -5,7 +5,6 @@ #ifndef __EXAMPLE_HELPER_H_INCLUDED__ #define __EXAMPLE_HELPER_H_INCLUDED__ -#include "IrrCompileConfig.h" #include "path.h" namespace irr @@ -13,7 +12,7 @@ namespace irr static io::path getExampleMediaPath() { -#if defined (_IRR_IOS_PLATFORM_) || defined (_IRR_ANDROID_PLATFORM_) || defined (_IRR_OSX_PLATFORM_) || defined (_IRR_EMSCRIPTEN_PLATFORM_) +#ifdef IRR_MOBILE_PATHS return io::path("media/"); #else return io::path("../../media/"); diff --git a/include/irrMath.h b/include/irrMath.h index 994f8cd..c4e8619 100644 --- a/include/irrMath.h +++ b/include/irrMath.h @@ -5,7 +5,6 @@ #ifndef __IRR_MATH_H_INCLUDED__ #define __IRR_MATH_H_INCLUDED__ -#include "IrrCompileConfig.h" #include "irrTypes.h" #include #include @@ -21,9 +20,7 @@ namespace core const s32 ROUNDING_ERROR_S32 = 0; -#ifdef __IRR_HAS_S64 const s64 ROUNDING_ERROR_S64 = 0; -#endif const f32 ROUNDING_ERROR_f32 = 0.000001f; const f64 ROUNDING_ERROR_f64 = 0.00000001; @@ -186,7 +183,6 @@ namespace core return ROUNDING_ERROR_S32; } -#ifdef __IRR_HAS_S64 template <> inline s64 roundingError() { @@ -198,7 +194,6 @@ namespace core { return ROUNDING_ERROR_S64; } -#endif template inline T relativeErrorFactor() @@ -310,13 +305,11 @@ namespace core return a <= tolerance; } -#ifdef __IRR_HAS_S64 //! returns if a equals zero, taking rounding errors into account inline bool iszero(const s64 a, const s64 tolerance = 0) { return abs_(a) <= tolerance; } -#endif inline s32 s32_min(s32 a, s32 b) { @@ -406,13 +399,11 @@ namespace core return static_cast(squareroot(static_cast(f))); } -#ifdef __IRR_HAS_S64 // calculate: sqrt ( x ) REALINLINE s64 squareroot(const s64 f) { return static_cast(squareroot(static_cast(f))); } -#endif // calculate: 1 / sqrt ( x ) REALINLINE f64 reciprocal_squareroot(const f64 x) diff --git a/include/irrTypes.h b/include/irrTypes.h index e67b395..98b1ed6 100644 --- a/include/irrTypes.h +++ b/include/irrTypes.h @@ -5,7 +5,6 @@ #ifndef __IRR_TYPES_H_INCLUDED__ #define __IRR_TYPES_H_INCLUDED__ -#include "IrrCompileConfig.h" #include namespace irr @@ -38,13 +37,11 @@ typedef uint32_t u32; typedef int32_t s32; -#ifdef __IRR_HAS_S64 //! 64 bit unsigned variable. typedef uint64_t u64; //! 64 bit signed variable. typedef int64_t s64; -#endif // __IRR_HAS_S64 diff --git a/include/irrUString.h b/include/irrUString.h index 8e553fd..b0b730f 100644 --- a/include/irrUString.h +++ b/include/irrUString.h @@ -174,7 +174,7 @@ inline core::array getUnicodeBOM(EUTF_ENCODE mode) COPY_ARRAY(BOM_ENCODE_UTF8, BOM_ENCODE_UTF8_LEN); break; case EUTFE_UTF16: - #ifdef __BIG_ENDIAN__ + #if __BYTE_ORDER == __BIG_ENDIAN COPY_ARRAY(BOM_ENCODE_UTF16_BE, BOM_ENCODE_UTF16_LEN); #else COPY_ARRAY(BOM_ENCODE_UTF16_LE, BOM_ENCODE_UTF16_LEN); @@ -187,7 +187,7 @@ inline core::array getUnicodeBOM(EUTF_ENCODE mode) COPY_ARRAY(BOM_ENCODE_UTF16_LE, BOM_ENCODE_UTF16_LEN); break; case EUTFE_UTF32: - #ifdef __BIG_ENDIAN__ + #if __BYTE_ORDER == __BIG_ENDIAN COPY_ARRAY(BOM_ENCODE_UTF32_BE, BOM_ENCODE_UTF32_LEN); #else COPY_ARRAY(BOM_ENCODE_UTF32_LE, BOM_ENCODE_UTF32_LEN); diff --git a/include/irrlicht.h b/include/irrlicht.h index 065ed60..e099cf7 100644 --- a/include/irrlicht.h +++ b/include/irrlicht.h @@ -29,7 +29,6 @@ #ifndef __IRRLICHT_H_INCLUDED__ #define __IRRLICHT_H_INCLUDED__ -#include "IrrCompileConfig.h" #include "aabbox3d.h" #include "CIndexBuffer.h" #include "CMeshBuffer.h" @@ -135,6 +134,7 @@ #include "triangle3d.h" #include "vector2d.h" #include "vector3d.h" +#include "IrrCompileConfig.h" // for IRRLICHT_API and IRRCALLCONV /*! \mainpage Irrlicht Engine 1.9 API documentation * diff --git a/include/matrix4.h b/include/matrix4.h index c410973..efd353d 100644 --- a/include/matrix4.h +++ b/include/matrix4.h @@ -12,6 +12,7 @@ #include "aabbox3d.h" #include "rect.h" #include "irrString.h" +#include "IrrCompileConfig.h" // for IRRLICHT_API // enable this to keep track of changes to the matrix // and make simpler identity check for seldom changing matrices diff --git a/include/mt_opengl.h b/include/mt_opengl.h index e7876cf..7b76cd9 100755 --- a/include/mt_opengl.h +++ b/include/mt_opengl.h @@ -5,7 +5,7 @@ #include #include -#include "IrrCompileConfig.h" +#include "IrrCompileConfig.h" // for IRRLICHT_API #include "irrTypes.h" #include "IContextManager.h" #include diff --git a/scripts/BindingGenerator.lua b/scripts/BindingGenerator.lua index 0774cdd..ba77748 100755 --- a/scripts/BindingGenerator.lua +++ b/scripts/BindingGenerator.lua @@ -349,7 +349,7 @@ f:write[[ #include #include -#include "IrrCompileConfig.h" +#include "IrrCompileConfig.h" // for IRRLICHT_API #include "irrTypes.h" #include "IContextManager.h" #include diff --git a/source/Irrlicht/Android/CAndroidAssetFileArchive.cpp b/source/Irrlicht/Android/CAndroidAssetFileArchive.cpp index 53d06f8..f5c02d1 100644 --- a/source/Irrlicht/Android/CAndroidAssetFileArchive.cpp +++ b/source/Irrlicht/Android/CAndroidAssetFileArchive.cpp @@ -2,7 +2,6 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_ANDROID_ASSET_READER_ diff --git a/source/Irrlicht/Android/CAndroidAssetFileArchive.h b/source/Irrlicht/Android/CAndroidAssetFileArchive.h index 7d7ab35..24a62f0 100644 --- a/source/Irrlicht/Android/CAndroidAssetFileArchive.h +++ b/source/Irrlicht/Android/CAndroidAssetFileArchive.h @@ -6,7 +6,6 @@ #define __C_ANDROID_ASSET_FILE_ARCHIVE_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_ANDROID_ASSET_READER_ diff --git a/source/Irrlicht/Android/CAndroidAssetReader.cpp b/source/Irrlicht/Android/CAndroidAssetReader.cpp index ef1529b..55383e2 100644 --- a/source/Irrlicht/Android/CAndroidAssetReader.cpp +++ b/source/Irrlicht/Android/CAndroidAssetReader.cpp @@ -2,7 +2,6 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_ANDROID_ASSET_READER_ diff --git a/source/Irrlicht/Android/CAndroidAssetReader.h b/source/Irrlicht/Android/CAndroidAssetReader.h index c9d96a5..7791a77 100644 --- a/source/Irrlicht/Android/CAndroidAssetReader.h +++ b/source/Irrlicht/Android/CAndroidAssetReader.h @@ -6,7 +6,6 @@ #define __C_ANDROID_ASSET_READER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_ANDROID_ASSET_READER_ diff --git a/source/Irrlicht/Android/CIrrDeviceAndroid.h b/source/Irrlicht/Android/CIrrDeviceAndroid.h index a1f13c3..4a3cd95 100644 --- a/source/Irrlicht/Android/CIrrDeviceAndroid.h +++ b/source/Irrlicht/Android/CIrrDeviceAndroid.h @@ -5,7 +5,6 @@ #ifndef __C_IRR_DEVICE_ANDROID_H_INCLUDED__ #define __C_IRR_DEVICE_ANDROID_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_ diff --git a/source/Irrlicht/Android/CKeyEventWrapper.h b/source/Irrlicht/Android/CKeyEventWrapper.h index bac23ad..b6bc09b 100644 --- a/source/Irrlicht/Android/CKeyEventWrapper.h +++ b/source/Irrlicht/Android/CKeyEventWrapper.h @@ -4,7 +4,6 @@ #ifndef __C_IRR_KEY_EVENT_WRAPPER_H_INCLUDED__ #define __C_IRR_KEY_EVENT_WRAPPER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_ diff --git a/source/Irrlicht/BuiltInFont.h b/source/Irrlicht/BuiltInFont.h index 467a49d..5d88937 100644 --- a/source/Irrlicht/BuiltInFont.h +++ b/source/Irrlicht/BuiltInFont.h @@ -5,8 +5,6 @@ #ifndef __BUILD_IN_FONT_H_INCLUDED__ #define __BUILD_IN_FONT_H_INCLUDED__ -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_GUI_ // header file generated by Bin2H, copyright 2002 by N.Gebhardt. // Bin2H is Freeware. Download it freely from www.code3d.com. @@ -16,7 +14,6 @@ namespace irr { namespace gui { -#ifdef _IRR_COMPILE_WITH_BMP_LOADER_ const u8 BuiltInFontData[] = { 0x42, 0x4d, 0x4a, 0x20, 0x00, 0x00, 0x00, 0x00, @@ -1056,20 +1053,7 @@ const u8 BuiltInFontData[] = }; const u32 BuiltInFontDataSize = sizeof(BuiltInFontData); - -#else // !defined(_IRR_COMPILE_WITH_BMP_LOADER_) - - // built-in font cannot be loaded if there is no BMP loader - - const u8 * const BuiltInFontData=0; - - const u32 BuiltInFontDataSize = 0; - -#endif } // end namespace gui } // end namespace irr -#endif // _IRR_COMPILE_WITH_GUI_ - #endif - diff --git a/source/Irrlicht/CAnimatedMeshSceneNode.cpp b/source/Irrlicht/CAnimatedMeshSceneNode.cpp index 9d92e03..cea8ef2 100644 --- a/source/Irrlicht/CAnimatedMeshSceneNode.cpp +++ b/source/Irrlicht/CAnimatedMeshSceneNode.cpp @@ -7,7 +7,9 @@ #include "ISceneManager.h" #include "S3DVertex.h" #include "os.h" +#ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ #include "CSkinnedMesh.h" +#endif #include "IDummyTransformationSceneNode.h" #include "IBoneSceneNode.h" #include "IMaterialRenderer.h" diff --git a/source/Irrlicht/CAttributes.h b/source/Irrlicht/CAttributes.h index 7156b8e..3d88115 100644 --- a/source/Irrlicht/CAttributes.h +++ b/source/Irrlicht/CAttributes.h @@ -5,7 +5,6 @@ #ifndef __C_ATTRIBUTES_H_INCLUDED__ #define __C_ATTRIBUTES_H_INCLUDED__ -#include "IrrCompileConfig.h" #include "IAttributes.h" #include "IAttribute.h" diff --git a/source/Irrlicht/CB3DMeshFileLoader.cpp b/source/Irrlicht/CB3DMeshFileLoader.cpp index ca86a6a..448030b 100644 --- a/source/Irrlicht/CB3DMeshFileLoader.cpp +++ b/source/Irrlicht/CB3DMeshFileLoader.cpp @@ -6,9 +6,6 @@ // File format designed by Mark Sibly for the Blitz3D engine and has been // declared public domain -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_B3D_LOADER_ - #include "CB3DMeshFileLoader.h" #include "IVideoDriver.h" @@ -1055,7 +1052,3 @@ void CB3DMeshFileLoader::readFloats(f32* vec, u32 count) } // end namespace scene } // end namespace irr - - -#endif // _IRR_COMPILE_WITH_B3D_LOADER_ - diff --git a/source/Irrlicht/CB3DMeshFileLoader.h b/source/Irrlicht/CB3DMeshFileLoader.h index 765405f..d19f190 100644 --- a/source/Irrlicht/CB3DMeshFileLoader.h +++ b/source/Irrlicht/CB3DMeshFileLoader.h @@ -6,7 +6,6 @@ // File format designed by Mark Sibly for the Blitz3D engine and has been // declared public domain -#include "IrrCompileConfig.h" #ifndef __C_B3D_MESH_LOADER_H_INCLUDED__ #define __C_B3D_MESH_LOADER_H_INCLUDED__ diff --git a/source/Irrlicht/CB3DMeshWriter.cpp b/source/Irrlicht/CB3DMeshWriter.cpp index aaca168..ac68f77 100644 --- a/source/Irrlicht/CB3DMeshWriter.cpp +++ b/source/Irrlicht/CB3DMeshWriter.cpp @@ -4,9 +4,6 @@ // TODO: replace printf's by logging messages -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_B3D_WRITER_ #include "CB3DMeshWriter.h" #include "os.h" @@ -531,6 +528,3 @@ void CB3DMeshWriter::writeSizeFrom(io::IWriteFile* file, const u32 from, const u } // end namespace } // end namespace - -#endif // _IRR_COMPILE_WITH_B3D_WRITER_ - diff --git a/source/Irrlicht/CBillboardSceneNode.cpp b/source/Irrlicht/CBillboardSceneNode.cpp index a1464eb..da90c3a 100644 --- a/source/Irrlicht/CBillboardSceneNode.cpp +++ b/source/Irrlicht/CBillboardSceneNode.cpp @@ -2,8 +2,6 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ #include "CBillboardSceneNode.h" #include "IVideoDriver.h" #include "ISceneManager.h" @@ -281,5 +279,3 @@ ISceneNode* CBillboardSceneNode::clone(ISceneNode* newParent, ISceneManager* new } // end namespace scene } // end namespace irr - -#endif // _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ diff --git a/source/Irrlicht/CBoneSceneNode.cpp b/source/Irrlicht/CBoneSceneNode.cpp index 04ef8c7..3d0f812 100644 --- a/source/Irrlicht/CBoneSceneNode.cpp +++ b/source/Irrlicht/CBoneSceneNode.cpp @@ -2,9 +2,6 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ - #include "CBoneSceneNode.h" namespace irr @@ -98,6 +95,3 @@ void CBoneSceneNode::updateAbsolutePositionOfAllChildren() } // namespace scene } // namespace irr - -#endif - diff --git a/source/Irrlicht/CEAGLManager.h b/source/Irrlicht/CEAGLManager.h index c1f8845..65caa7a 100644 --- a/source/Irrlicht/CEAGLManager.h +++ b/source/Irrlicht/CEAGLManager.h @@ -5,7 +5,6 @@ #ifndef __C_EAGL_MANAGER_H_INCLUDED__ #define __C_EAGL_MANAGER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_EAGL_MANAGER_ diff --git a/source/Irrlicht/CEGLManager.h b/source/Irrlicht/CEGLManager.h index 2d61bd2..78e96c8 100755 --- a/source/Irrlicht/CEGLManager.h +++ b/source/Irrlicht/CEGLManager.h @@ -5,7 +5,6 @@ #ifndef __C_EGL_MANAGER_H_INCLUDED__ #define __C_EGL_MANAGER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_EGL_MANAGER_ diff --git a/source/Irrlicht/CFileList.cpp b/source/Irrlicht/CFileList.cpp index 15d5410..720b8bb 100644 --- a/source/Irrlicht/CFileList.cpp +++ b/source/Irrlicht/CFileList.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CFileList.h" -#include "IrrCompileConfig.h" #include "irrArray.h" #include "coreutil.h" diff --git a/source/Irrlicht/CFileSystem.cpp b/source/Irrlicht/CFileSystem.cpp index 45e8680..ba4a332 100644 --- a/source/Irrlicht/CFileSystem.cpp +++ b/source/Irrlicht/CFileSystem.cpp @@ -2,7 +2,6 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#include "IrrCompileConfig.h" #include "CFileSystem.h" #include "IReadFile.h" @@ -54,9 +53,7 @@ CFileSystem::CFileSystem() //! reset current working directory getWorkingDirectory(); -#ifdef __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ ArchiveLoader.push_back(new CArchiveLoaderZIP(this)); -#endif } diff --git a/source/Irrlicht/CGLXManager.h b/source/Irrlicht/CGLXManager.h index 85c3c94..9e4ce74 100644 --- a/source/Irrlicht/CGLXManager.h +++ b/source/Irrlicht/CGLXManager.h @@ -5,7 +5,6 @@ #ifndef __C_GLX_MANAGER_H_INCLUDED__ #define __C_GLX_MANAGER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_GLX_MANAGER_ diff --git a/source/Irrlicht/CGUIButton.cpp b/source/Irrlicht/CGUIButton.cpp index 704fd3d..d6ab543 100644 --- a/source/Irrlicht/CGUIButton.cpp +++ b/source/Irrlicht/CGUIButton.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CGUIButton.h" -#ifdef _IRR_COMPILE_WITH_GUI_ #include "IGUISkin.h" #include "IGUIEnvironment.h" @@ -558,6 +557,3 @@ bool CGUIButton::isDrawingBorder() const } // end namespace gui } // end namespace irr - -#endif // _IRR_COMPILE_WITH_GUI_ - diff --git a/source/Irrlicht/CGUIButton.h b/source/Irrlicht/CGUIButton.h index 9bd8612..0e42957 100644 --- a/source/Irrlicht/CGUIButton.h +++ b/source/Irrlicht/CGUIButton.h @@ -5,9 +5,6 @@ #ifndef __C_GUI_BUTTON_H_INCLUDED__ #define __C_GUI_BUTTON_H_INCLUDED__ -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IGUIButton.h" #include "IGUISpriteBank.h" #include "ITexture.h" @@ -244,7 +241,4 @@ namespace gui } // end namespace gui } // end namespace irr -#endif // _IRR_COMPILE_WITH_GUI_ - #endif // __C_GUI_BUTTON_H_INCLUDED__ - diff --git a/source/Irrlicht/CGUICheckBox.cpp b/source/Irrlicht/CGUICheckBox.cpp index 48ec5e8..6c5271f 100644 --- a/source/Irrlicht/CGUICheckBox.cpp +++ b/source/Irrlicht/CGUICheckBox.cpp @@ -4,8 +4,6 @@ #include "CGUICheckBox.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IGUISkin.h" #include "IGUIEnvironment.h" #include "IVideoDriver.h" @@ -227,6 +225,3 @@ bool CGUICheckBox::isDrawBorderEnabled() const } // end namespace gui } // end namespace irr - -#endif // _IRR_COMPILE_WITH_GUI_ - diff --git a/source/Irrlicht/CGUICheckBox.h b/source/Irrlicht/CGUICheckBox.h index adb46b4..8319243 100644 --- a/source/Irrlicht/CGUICheckBox.h +++ b/source/Irrlicht/CGUICheckBox.h @@ -5,9 +5,6 @@ #ifndef __C_GUI_CHECKBOX_H_INCLUDED__ #define __C_GUI_CHECKBOX_H_INCLUDED__ -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IGUICheckBox.h" namespace irr @@ -61,5 +58,3 @@ namespace gui } // end namespace irr #endif // __C_GUI_CHECKBOX_H_INCLUDED__ - -#endif // _IRR_COMPILE_WITH_GUI_ diff --git a/source/Irrlicht/CGUIComboBox.cpp b/source/Irrlicht/CGUIComboBox.cpp index b35b47a..ecd3a9c 100644 --- a/source/Irrlicht/CGUIComboBox.cpp +++ b/source/Irrlicht/CGUIComboBox.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CGUIComboBox.h" -#ifdef _IRR_COMPILE_WITH_GUI_ #include "IGUIEnvironment.h" #include "IVideoDriver.h" @@ -488,7 +487,3 @@ void CGUIComboBox::openCloseMenu() } // end namespace gui } // end namespace irr - - -#endif // _IRR_COMPILE_WITH_GUI_ - diff --git a/source/Irrlicht/CGUIComboBox.h b/source/Irrlicht/CGUIComboBox.h index dbdae41..2dab66f 100644 --- a/source/Irrlicht/CGUIComboBox.h +++ b/source/Irrlicht/CGUIComboBox.h @@ -5,9 +5,6 @@ #ifndef __C_GUI_COMBO_BOX_H_INCLUDED__ #define __C_GUI_COMBO_BOX_H_INCLUDED__ -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IGUIComboBox.h" #include "IGUIStaticText.h" #include "irrString.h" @@ -107,7 +104,4 @@ namespace gui } // end namespace gui } // end namespace irr -#endif // _IRR_COMPILE_WITH_GUI_ - #endif // __C_GUI_COMBO_BOX_H_INCLUDED__ - diff --git a/source/Irrlicht/CGUIEditBox.cpp b/source/Irrlicht/CGUIEditBox.cpp index a3851e6..cf4b64e 100644 --- a/source/Irrlicht/CGUIEditBox.cpp +++ b/source/Irrlicht/CGUIEditBox.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CGUIEditBox.h" -#ifdef _IRR_COMPILE_WITH_GUI_ #include "IGUISkin.h" #include "IGUIEnvironment.h" @@ -1652,6 +1651,3 @@ bool CGUIEditBox::acceptsIME() } // end namespace gui } // end namespace irr - -#endif // _IRR_COMPILE_WITH_GUI_ - diff --git a/source/Irrlicht/CGUIEditBox.h b/source/Irrlicht/CGUIEditBox.h index b0b5070..4a1b6e8 100644 --- a/source/Irrlicht/CGUIEditBox.h +++ b/source/Irrlicht/CGUIEditBox.h @@ -5,9 +5,6 @@ #ifndef __C_GUI_EDIT_BOX_H_INCLUDED__ #define __C_GUI_EDIT_BOX_H_INCLUDED__ -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IGUIEditBox.h" #include "irrArray.h" #include "IOSOperator.h" @@ -201,6 +198,4 @@ namespace gui } // end namespace gui } // end namespace irr -#endif // _IRR_COMPILE_WITH_GUI_ #endif // __C_GUI_EDIT_BOX_H_INCLUDED__ - diff --git a/source/Irrlicht/CGUIEnvironment.cpp b/source/Irrlicht/CGUIEnvironment.cpp index 6d15706..a7b2804 100644 --- a/source/Irrlicht/CGUIEnvironment.cpp +++ b/source/Irrlicht/CGUIEnvironment.cpp @@ -5,8 +5,6 @@ #include "CGUIEnvironment.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IVideoDriver.h" #include "CGUISkin.h" @@ -25,8 +23,9 @@ #include "CGUIComboBox.h" #include "IWriteFile.h" - +#ifdef IRR_ENABLE_BUILTIN_FONT #include "BuiltInFont.h" +#endif #include "os.h" namespace irr @@ -143,6 +142,7 @@ CGUIEnvironment::~CGUIEnvironment() void CGUIEnvironment::loadBuiltInFont() { +#ifdef IRR_ENABLE_BUILTIN_FONT io::IReadFile* file = FileSystem->createMemoryReadFile(BuiltInFontData, BuiltInFontDataSize, DefaultFontName, false); @@ -161,6 +161,7 @@ void CGUIEnvironment::loadBuiltInFont() Fonts.push_back(f); file->drop(); +#endif } @@ -1107,6 +1108,3 @@ IGUIEnvironment* createGUIEnvironment(io::IFileSystem* fs, } // end namespace gui } // end namespace irr - -#endif // _IRR_COMPILE_WITH_GUI_ - diff --git a/source/Irrlicht/CGUIEnvironment.h b/source/Irrlicht/CGUIEnvironment.h index ab74586..f68b0da 100644 --- a/source/Irrlicht/CGUIEnvironment.h +++ b/source/Irrlicht/CGUIEnvironment.h @@ -5,9 +5,6 @@ #ifndef __C_GUI_ENVIRONMENT_H_INCLUDED__ #define __C_GUI_ENVIRONMENT_H_INCLUDED__ -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IGUIEnvironment.h" #include "IGUIElement.h" #include "irrArray.h" @@ -231,8 +228,4 @@ private: } // end namespace gui } // end namespace irr -#endif // _IRR_COMPILE_WITH_GUI_ - #endif // __C_GUI_ENVIRONMENT_H_INCLUDED__ - - diff --git a/source/Irrlicht/CGUIFileOpenDialog.cpp b/source/Irrlicht/CGUIFileOpenDialog.cpp index 6599bef..e68d7cd 100644 --- a/source/Irrlicht/CGUIFileOpenDialog.cpp +++ b/source/Irrlicht/CGUIFileOpenDialog.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CGUIFileOpenDialog.h" -#ifdef _IRR_COMPILE_WITH_GUI_ #include "IGUISkin.h" #include "IGUIEnvironment.h" @@ -411,5 +410,3 @@ void CGUIFileOpenDialog::sendCancelEvent() } // end namespace gui } // end namespace irr - -#endif // _IRR_COMPILE_WITH_GUI_ diff --git a/source/Irrlicht/CGUIFileOpenDialog.h b/source/Irrlicht/CGUIFileOpenDialog.h index 55b9ffa..a1d633c 100644 --- a/source/Irrlicht/CGUIFileOpenDialog.h +++ b/source/Irrlicht/CGUIFileOpenDialog.h @@ -5,9 +5,6 @@ #ifndef __C_GUI_FILE_OPEN_DIALOG_H_INCLUDED__ #define __C_GUI_FILE_OPEN_DIALOG_H_INCLUDED__ -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IGUIFileOpenDialog.h" #include "IGUIButton.h" #include "IGUIListBox.h" @@ -90,7 +87,4 @@ namespace gui } // end namespace gui } // end namespace irr -#endif // _IRR_COMPILE_WITH_GUI_ - #endif // __C_GUI_FILE_OPEN_DIALOG_H_INCLUDED__ - diff --git a/source/Irrlicht/CGUIFont.cpp b/source/Irrlicht/CGUIFont.cpp index 1becf67..b7b6ed7 100644 --- a/source/Irrlicht/CGUIFont.cpp +++ b/source/Irrlicht/CGUIFont.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CGUIFont.h" -#ifdef _IRR_COMPILE_WITH_GUI_ #include "os.h" #include "coreutil.h" @@ -594,6 +593,3 @@ IGUISpriteBank* CGUIFont::getSpriteBank() const } // end namespace gui } // end namespace irr - -#endif // _IRR_COMPILE_WITH_GUI_ - diff --git a/source/Irrlicht/CGUIFont.h b/source/Irrlicht/CGUIFont.h index 4cf93b8..449df08 100644 --- a/source/Irrlicht/CGUIFont.h +++ b/source/Irrlicht/CGUIFont.h @@ -5,9 +5,6 @@ #ifndef __C_GUI_FONT_H_INCLUDED__ #define __C_GUI_FONT_H_INCLUDED__ -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IGUIFontBitmap.h" #include "irrString.h" #include "IReadFile.h" @@ -111,7 +108,4 @@ private: } // end namespace gui } // end namespace irr -#endif // _IRR_COMPILE_WITH_GUI_ - #endif // __C_GUI_FONT_H_INCLUDED__ - diff --git a/source/Irrlicht/CGUIImage.cpp b/source/Irrlicht/CGUIImage.cpp index 2d2a08c..669428b 100644 --- a/source/Irrlicht/CGUIImage.cpp +++ b/source/Irrlicht/CGUIImage.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CGUIImage.h" -#ifdef _IRR_COMPILE_WITH_GUI_ #include "IGUISkin.h" #include "IGUIEnvironment.h" @@ -177,7 +176,3 @@ core::rect CGUIImage::getDrawBounds() const } // end namespace gui } // end namespace irr - - -#endif // _IRR_COMPILE_WITH_GUI_ - diff --git a/source/Irrlicht/CGUIImage.h b/source/Irrlicht/CGUIImage.h index 581fe1b..c8a46f2 100644 --- a/source/Irrlicht/CGUIImage.h +++ b/source/Irrlicht/CGUIImage.h @@ -5,9 +5,6 @@ #ifndef __C_GUI_IMAGE_H_INCLUDED__ #define __C_GUI_IMAGE_H_INCLUDED__ -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IGUIImage.h" namespace irr @@ -102,6 +99,4 @@ namespace gui } // end namespace gui } // end namespace irr -#endif // _IRR_COMPILE_WITH_GUI_ - #endif // __C_GUI_IMAGE_H_INCLUDED__ diff --git a/source/Irrlicht/CGUIListBox.cpp b/source/Irrlicht/CGUIListBox.cpp index f6f0e77..b00c7e3 100644 --- a/source/Irrlicht/CGUIListBox.cpp +++ b/source/Irrlicht/CGUIListBox.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CGUIListBox.h" -#ifdef _IRR_COMPILE_WITH_GUI_ #include "CGUIListBox.h" #include "IGUISkin.h" @@ -841,6 +840,3 @@ IGUIScrollBar* CGUIListBox::getVerticalScrollBar() const } // end namespace gui } // end namespace irr - -#endif // _IRR_COMPILE_WITH_GUI_ - diff --git a/source/Irrlicht/CGUIListBox.h b/source/Irrlicht/CGUIListBox.h index 8e1566d..a3e7255 100644 --- a/source/Irrlicht/CGUIListBox.h +++ b/source/Irrlicht/CGUIListBox.h @@ -5,9 +5,6 @@ #ifndef __C_GUI_LIST_BOX_H_INCLUDED__ #define __C_GUI_LIST_BOX_H_INCLUDED__ -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IGUIListBox.h" #include "irrArray.h" @@ -178,6 +175,4 @@ namespace gui } // end namespace gui } // end namespace irr -#endif // _IRR_COMPILE_WITH_GUI_ - #endif diff --git a/source/Irrlicht/CGUIScrollBar.cpp b/source/Irrlicht/CGUIScrollBar.cpp index 6d6d367..567251c 100644 --- a/source/Irrlicht/CGUIScrollBar.cpp +++ b/source/Irrlicht/CGUIScrollBar.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CGUIScrollBar.h" -#ifdef _IRR_COMPILE_WITH_GUI_ #include "IGUISkin.h" #include "IGUIEnvironment.h" @@ -534,6 +533,3 @@ void CGUIScrollBar::refreshControls() } // end namespace gui } // end namespace irr - -#endif // _IRR_COMPILE_WITH_GUI_ - diff --git a/source/Irrlicht/CGUIScrollBar.h b/source/Irrlicht/CGUIScrollBar.h index 170a2da..d1d04b8 100644 --- a/source/Irrlicht/CGUIScrollBar.h +++ b/source/Irrlicht/CGUIScrollBar.h @@ -5,9 +5,6 @@ #ifndef __C_GUI_SCROLL_BAR_H_INCLUDED__ #define __C_GUI_SCROLL_BAR_H_INCLUDED__ -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IGUIScrollBar.h" #include "IGUIButton.h" @@ -101,7 +98,4 @@ namespace gui } // end namespace gui } // end namespace irr -#endif // _IRR_COMPILE_WITH_GUI_ - #endif - diff --git a/source/Irrlicht/CGUISkin.cpp b/source/Irrlicht/CGUISkin.cpp index 08a5900..b417b72 100644 --- a/source/Irrlicht/CGUISkin.cpp +++ b/source/Irrlicht/CGUISkin.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CGUISkin.h" -#ifdef _IRR_COMPILE_WITH_GUI_ #include "IGUIFont.h" #include "IGUISpriteBank.h" @@ -973,6 +972,3 @@ void CGUISkin::draw2DRectangle(IGUIElement* element, } // end namespace gui } // end namespace irr - -#endif // _IRR_COMPILE_WITH_GUI_ - diff --git a/source/Irrlicht/CGUISkin.h b/source/Irrlicht/CGUISkin.h index 11cfb26..d6f8ef8 100644 --- a/source/Irrlicht/CGUISkin.h +++ b/source/Irrlicht/CGUISkin.h @@ -5,9 +5,6 @@ #ifndef __C_GUI_SKIN_H_INCLUDED__ #define __C_GUI_SKIN_H_INCLUDED__ -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IGUISkin.h" #include "irrString.h" @@ -234,8 +231,4 @@ namespace gui } // end namespace gui } // end namespace irr -#endif // _IRR_COMPILE_WITH_GUI_ - #endif - - diff --git a/source/Irrlicht/CGUISpriteBank.cpp b/source/Irrlicht/CGUISpriteBank.cpp index c89bb26..8f5fb67 100644 --- a/source/Irrlicht/CGUISpriteBank.cpp +++ b/source/Irrlicht/CGUISpriteBank.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CGUISpriteBank.h" -#ifdef _IRR_COMPILE_WITH_GUI_ #include "IGUIEnvironment.h" #include "IVideoDriver.h" @@ -249,5 +248,3 @@ void CGUISpriteBank::draw2DSpriteBatch( const core::array& indices, } // namespace gui } // namespace irr - -#endif // _IRR_COMPILE_WITH_GUI_ diff --git a/source/Irrlicht/CGUISpriteBank.h b/source/Irrlicht/CGUISpriteBank.h index cfca788..affd6bf 100644 --- a/source/Irrlicht/CGUISpriteBank.h +++ b/source/Irrlicht/CGUISpriteBank.h @@ -5,9 +5,6 @@ #ifndef __C_GUI_SPRITE_BANK_H_INCLUDED__ #define __C_GUI_SPRITE_BANK_H_INCLUDED__ -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IGUISpriteBank.h" namespace irr @@ -99,7 +96,4 @@ protected: } // end namespace gui } // end namespace irr -#endif // _IRR_COMPILE_WITH_GUI_ - #endif // __C_GUI_SPRITE_BANK_H_INCLUDED__ - diff --git a/source/Irrlicht/CGUIStaticText.cpp b/source/Irrlicht/CGUIStaticText.cpp index b9ab35a..29bbdb7 100644 --- a/source/Irrlicht/CGUIStaticText.cpp +++ b/source/Irrlicht/CGUIStaticText.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CGUIStaticText.h" -#ifdef _IRR_COMPILE_WITH_GUI_ #include "IGUISkin.h" #include "IGUIEnvironment.h" @@ -592,6 +591,3 @@ s32 CGUIStaticText::getTextWidth() const } // end namespace gui } // end namespace irr - -#endif // _IRR_COMPILE_WITH_GUI_ - diff --git a/source/Irrlicht/CGUIStaticText.h b/source/Irrlicht/CGUIStaticText.h index 827e95f..8e1babe 100644 --- a/source/Irrlicht/CGUIStaticText.h +++ b/source/Irrlicht/CGUIStaticText.h @@ -5,9 +5,6 @@ #ifndef __C_GUI_STATIC_TEXT_H_INCLUDED__ #define __C_GUI_STATIC_TEXT_H_INCLUDED__ -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IGUIStaticText.h" #include "irrArray.h" @@ -136,7 +133,4 @@ namespace gui } // end namespace gui } // end namespace irr -#endif // _IRR_COMPILE_WITH_GUI_ - #endif - diff --git a/source/Irrlicht/CGUITabControl.cpp b/source/Irrlicht/CGUITabControl.cpp index 30a31c3..c08a579 100644 --- a/source/Irrlicht/CGUITabControl.cpp +++ b/source/Irrlicht/CGUITabControl.cpp @@ -3,7 +3,6 @@ // For conditions of distribution and use, see copyright notice in irrlicht.h #include "CGUITabControl.h" -#ifdef _IRR_COMPILE_WITH_GUI_ #include "CGUIButton.h" #include "IGUISkin.h" @@ -1030,6 +1029,3 @@ void CGUITabControl::updateAbsolutePosition() } // end namespace irr } // end namespace gui - -#endif // _IRR_COMPILE_WITH_GUI_ - diff --git a/source/Irrlicht/CGUITabControl.h b/source/Irrlicht/CGUITabControl.h index d5e8315..4c2a054 100644 --- a/source/Irrlicht/CGUITabControl.h +++ b/source/Irrlicht/CGUITabControl.h @@ -5,9 +5,6 @@ #ifndef __C_GUI_TAB_CONTROL_H_INCLUDED__ #define __C_GUI_TAB_CONTROL_H_INCLUDED__ -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_GUI_ - #include "IGUITabControl.h" #include "irrArray.h" #include "IGUISkin.h" @@ -184,7 +181,4 @@ namespace gui } // end namespace gui } // end namespace irr -#endif // _IRR_COMPILE_WITH_GUI_ - #endif - diff --git a/source/Irrlicht/CImageLoaderBMP.cpp b/source/Irrlicht/CImageLoaderBMP.cpp index 234c515..a913101 100644 --- a/source/Irrlicht/CImageLoaderBMP.cpp +++ b/source/Irrlicht/CImageLoaderBMP.cpp @@ -4,8 +4,6 @@ #include "CImageLoaderBMP.h" -#ifdef _IRR_COMPILE_WITH_BMP_LOADER_ - #include "IReadFile.h" #include "SColor.h" #include "CColorConverter.h" @@ -371,6 +369,3 @@ IImageLoader* createImageLoaderBMP() } // end namespace video } // end namespace irr - -#endif - diff --git a/source/Irrlicht/CImageLoaderBMP.h b/source/Irrlicht/CImageLoaderBMP.h index 5d993ce..1f94403 100644 --- a/source/Irrlicht/CImageLoaderBMP.h +++ b/source/Irrlicht/CImageLoaderBMP.h @@ -5,7 +5,6 @@ #ifndef __C_IMAGE_LOADER_BMP_H_INCLUDED__ #define __C_IMAGE_LOADER_BMP_H_INCLUDED__ -#include "IrrCompileConfig.h" #include "IImageLoader.h" @@ -15,9 +14,6 @@ namespace irr namespace video { -#if defined(_IRR_COMPILE_WITH_BMP_LOADER_) || defined(_IRR_COMPILE_WITH_BMP_WRITER_) - - // byte-align structures #include "irrpack.h" @@ -59,10 +55,6 @@ namespace video // Default alignment #include "irrunpack.h" -#endif // defined with loader or writer - -#ifdef _IRR_COMPILE_WITH_BMP_LOADER_ - /*! Surface Loader for Windows bitmaps */ @@ -91,10 +83,7 @@ private: }; -#endif // compiled with loader - } // end namespace video } // end namespace irr #endif - diff --git a/source/Irrlicht/CImageLoaderJPG.cpp b/source/Irrlicht/CImageLoaderJPG.cpp index 0d19d71..c7b5df2 100644 --- a/source/Irrlicht/CImageLoaderJPG.cpp +++ b/source/Irrlicht/CImageLoaderJPG.cpp @@ -4,8 +4,6 @@ #include "CImageLoaderJPG.h" -#ifdef _IRR_COMPILE_WITH_JPG_LOADER_ - #include "IReadFile.h" #include "CImage.h" #include "os.h" @@ -40,21 +38,18 @@ bool CImageLoaderJPG::isALoadableFileExtension(const io::path& filename) const return core::hasFileExtension ( filename, "jpg", "jpeg" ); } +// struct for handling jpeg errors +struct irr_jpeg_error_mgr +{ + // public jpeg error fields + struct jpeg_error_mgr pub; -#ifdef _IRR_COMPILE_WITH_LIBJPEG_ + // for longjmp, to return to caller on a fatal error + jmp_buf setjmp_buffer; - // struct for handling jpeg errors - struct irr_jpeg_error_mgr - { - // public jpeg error fields - struct jpeg_error_mgr pub; - - // for longjmp, to return to caller on a fatal error - jmp_buf setjmp_buffer; - - // for having access to the filename when printing the error messages - core::stringc* filename; - }; + // for having access to the filename when printing the error messages + core::stringc* filename; +}; void CImageLoaderJPG::init_source (j_decompress_ptr cinfo) { @@ -116,31 +111,20 @@ void CImageLoaderJPG::output_message(j_common_ptr cinfo) errMsg += *myerr->filename; os::Printer::log(errMsg.c_str(),temp1, ELL_ERROR); } -#endif // _IRR_COMPILE_WITH_LIBJPEG_ //! returns true if the file maybe is able to be loaded by this class bool CImageLoaderJPG::isALoadableFileFormat(io::IReadFile* file) const { - #ifndef _IRR_COMPILE_WITH_LIBJPEG_ - return false; - #else - if (!(file && file->seek(0))) return false; unsigned char header[3]; size_t headerLen = file->read(header, sizeof(header)); return headerLen >= 3 && !memcmp(header, "\xFF\xD8\xFF", 3); - #endif } //! creates a surface from the file IImage* CImageLoaderJPG::loadImage(io::IReadFile* file) const { - #ifndef _IRR_COMPILE_WITH_LIBJPEG_ - os::Printer::log("Can't load as not compiled with _IRR_COMPILE_WITH_LIBJPEG_:", file->getFileName(), ELL_DEBUG); - return 0; - #else - if (!file) return 0; @@ -288,8 +272,6 @@ IImage* CImageLoaderJPG::loadImage(io::IReadFile* file) const delete [] input; return image; - - #endif } @@ -302,6 +284,3 @@ IImageLoader* createImageLoaderJPG() } // end namespace video } // end namespace irr - -#endif - diff --git a/source/Irrlicht/CImageLoaderJPG.h b/source/Irrlicht/CImageLoaderJPG.h index 146adbe..0316394 100644 --- a/source/Irrlicht/CImageLoaderJPG.h +++ b/source/Irrlicht/CImageLoaderJPG.h @@ -5,19 +5,12 @@ #ifndef __C_IMAGE_LOADER_JPG_H_INCLUDED__ #define __C_IMAGE_LOADER_JPG_H_INCLUDED__ -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_JPG_LOADER_ #include "IImageLoader.h" #include // required for jpeglib.h -#ifdef _IRR_COMPILE_WITH_LIBJPEG_ -extern "C" { - #include // use system lib - #include -} -#endif // _IRR_COMPILE_WITH_LIBJPEG_ +#include // use system lib +#include namespace irr @@ -48,8 +41,6 @@ public: IImage* loadImage(io::IReadFile* file) const override; private: - -#ifdef _IRR_COMPILE_WITH_LIBJPEG_ // several methods used via function pointers by jpeglib /* Receives control for a fatal error. Information sufficient to @@ -95,8 +86,6 @@ private: /* Terminate source --- called by jpeg_finish_decompress() after all data has been read. Often a no-op. */ static void term_source (j_decompress_ptr cinfo); - - #endif // _IRR_COMPILE_WITH_LIBJPEG_ }; @@ -105,5 +94,3 @@ private: #endif -#endif - diff --git a/source/Irrlicht/CImageLoaderPNG.cpp b/source/Irrlicht/CImageLoaderPNG.cpp index b468017..59709bf 100644 --- a/source/Irrlicht/CImageLoaderPNG.cpp +++ b/source/Irrlicht/CImageLoaderPNG.cpp @@ -4,11 +4,7 @@ #include "CImageLoaderPNG.h" -#ifdef _IRR_COMPILE_WITH_PNG_LOADER_ - -#ifdef _IRR_COMPILE_WITH_LIBPNG_ - #include // use system lib png -#endif // _IRR_COMPILE_WITH_LIBPNG_ +#include // use system lib png #include "CImage.h" #include "CReadFile.h" @@ -19,7 +15,6 @@ namespace irr namespace video { -#ifdef _IRR_COMPILE_WITH_LIBPNG_ // PNG function for error handling static void png_cpexcept_error(png_structp png_ptr, png_const_charp msg) { @@ -46,25 +41,19 @@ void PNGAPI user_read_data_fcn(png_structp png_ptr, png_bytep data, png_size_t l if (check != length) png_error(png_ptr, "Read Error"); } -#endif // _IRR_COMPILE_WITH_LIBPNG_ //! returns true if the file maybe is able to be loaded by this class //! based on the file extension (e.g. ".tga") bool CImageLoaderPng::isALoadableFileExtension(const io::path& filename) const { -#ifdef _IRR_COMPILE_WITH_LIBPNG_ return core::hasFileExtension ( filename, "png" ); -#else - return false; -#endif // _IRR_COMPILE_WITH_LIBPNG_ } //! returns true if the file maybe is able to be loaded by this class bool CImageLoaderPng::isALoadableFileFormat(io::IReadFile* file) const { -#ifdef _IRR_COMPILE_WITH_LIBPNG_ if (!file) return false; @@ -75,16 +64,12 @@ bool CImageLoaderPng::isALoadableFileFormat(io::IReadFile* file) const // Check if it really is a PNG file return !png_sig_cmp(buffer, 0, 8); -#else - return false; -#endif // _IRR_COMPILE_WITH_LIBPNG_ } // load in the image data IImage* CImageLoaderPng::loadImage(io::IReadFile* file) const { -#ifdef _IRR_COMPILE_WITH_LIBPNG_ if (!file) return 0; @@ -267,9 +252,6 @@ IImage* CImageLoaderPng::loadImage(io::IReadFile* file) const png_destroy_read_struct(&png_ptr,&info_ptr, 0); // Clean up memory return image; -#else - return 0; -#endif // _IRR_COMPILE_WITH_LIBPNG_ } @@ -281,6 +263,3 @@ IImageLoader* createImageLoaderPNG() }// end namespace irr }//end namespace video - -#endif - diff --git a/source/Irrlicht/CImageLoaderPNG.h b/source/Irrlicht/CImageLoaderPNG.h index 6e631b7..45a37fd 100644 --- a/source/Irrlicht/CImageLoaderPNG.h +++ b/source/Irrlicht/CImageLoaderPNG.h @@ -9,9 +9,6 @@ #ifndef __C_IMAGE_LOADER_PNG_H_INCLUDED__ #define __C_IMAGE_LOADER_PNG_H_INCLUDED__ -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_PNG_LOADER_ #include "IImageLoader.h" @@ -41,5 +38,3 @@ public: } // end namespace irr #endif -#endif - diff --git a/source/Irrlicht/CImageLoaderTGA.cpp b/source/Irrlicht/CImageLoaderTGA.cpp index af4fad5..3286bdd 100644 --- a/source/Irrlicht/CImageLoaderTGA.cpp +++ b/source/Irrlicht/CImageLoaderTGA.cpp @@ -4,8 +4,6 @@ #include "CImageLoaderTGA.h" -#ifdef _IRR_COMPILE_WITH_TGA_LOADER_ - #include "IReadFile.h" #include "os.h" #include "CColorConverter.h" @@ -238,6 +236,3 @@ IImageLoader* createImageLoaderTGA() } // end namespace video } // end namespace irr - -#endif - diff --git a/source/Irrlicht/CImageLoaderTGA.h b/source/Irrlicht/CImageLoaderTGA.h index d8f7368..4e67579 100644 --- a/source/Irrlicht/CImageLoaderTGA.h +++ b/source/Irrlicht/CImageLoaderTGA.h @@ -5,7 +5,6 @@ #ifndef __C_IMAGE_LOADER_TGA_H_INCLUDED__ #define __C_IMAGE_LOADER_TGA_H_INCLUDED__ -#include "IrrCompileConfig.h" #include "IImageLoader.h" @@ -15,8 +14,6 @@ namespace irr namespace video { -#if defined(_IRR_COMPILE_WITH_TGA_LOADER_) || defined(_IRR_COMPILE_WITH_TGA_WRITER_) - // byte-align structures #include "irrpack.h" @@ -46,10 +43,6 @@ namespace video // Default alignment #include "irrunpack.h" -#endif // compiled with loader or reader - -#ifdef _IRR_COMPILE_WITH_TGA_LOADER_ - /*! Surface Loader for targa images */ @@ -73,10 +66,7 @@ private: u8* loadCompressedImage(io::IReadFile *file, const STGAHeader& header) const; }; -#endif // compiled with loader - } // end namespace video } // end namespace irr #endif - diff --git a/source/Irrlicht/CImageWriterJPG.cpp b/source/Irrlicht/CImageWriterJPG.cpp index 97a64b8..1fb9fb3 100644 --- a/source/Irrlicht/CImageWriterJPG.cpp +++ b/source/Irrlicht/CImageWriterJPG.cpp @@ -4,15 +4,12 @@ #include "CImageWriterJPG.h" -#ifdef _IRR_COMPILE_WITH_JPG_WRITER_ - #include "CColorConverter.h" #include "IWriteFile.h" #include "CImage.h" #include "irrString.h" #include "os.h" -#ifdef _IRR_COMPILE_WITH_LIBJPEG_ #include // required for jpeglib.h extern "C" { @@ -181,7 +178,7 @@ static bool writeJPEGFile(io::IWriteFile* file, IImage* image, u32 quality) } // namespace video } // namespace irr -#endif // _IRR_COMPILE_WITH_LIBJPEG_ + namespace irr { @@ -209,15 +206,8 @@ bool CImageWriterJPG::isAWriteableFileExtension(const io::path& filename) const bool CImageWriterJPG::writeImage(io::IWriteFile *file, IImage *image, u32 quality) const { -#ifndef _IRR_COMPILE_WITH_LIBJPEG_ - return false; -#else return writeJPEGFile(file, image, quality); -#endif } } // namespace video } // namespace irr - -#endif - diff --git a/source/Irrlicht/CImageWriterJPG.h b/source/Irrlicht/CImageWriterJPG.h index ec8a1b8..dd98e91 100644 --- a/source/Irrlicht/CImageWriterJPG.h +++ b/source/Irrlicht/CImageWriterJPG.h @@ -5,9 +5,6 @@ #ifndef _C_IMAGE_WRITER_JPG_H_INCLUDED__ #define _C_IMAGE_WRITER_JPG_H_INCLUDED__ -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_JPG_WRITER_ #include "IImageWriter.h" @@ -33,5 +30,3 @@ public: } #endif // _C_IMAGE_WRITER_JPG_H_INCLUDED__ -#endif - diff --git a/source/Irrlicht/CImageWriterPNG.cpp b/source/Irrlicht/CImageWriterPNG.cpp index 55ae00e..0e2a71e 100644 --- a/source/Irrlicht/CImageWriterPNG.cpp +++ b/source/Irrlicht/CImageWriterPNG.cpp @@ -4,17 +4,13 @@ #include "CImageWriterPNG.h" -#ifdef _IRR_COMPILE_WITH_PNG_WRITER_ - #include "CImageLoaderPNG.h" #include "CColorConverter.h" #include "IWriteFile.h" #include "irrString.h" #include "os.h" // for logging -#ifdef _IRR_COMPILE_WITH_LIBPNG_ - #include // use system lib png -#endif // _IRR_COMPILE_WITH_LIBPNG_ +#include // use system lib png namespace irr { @@ -26,7 +22,6 @@ IImageWriter* createImageWriterPNG() return new CImageWriterPNG; } -#ifdef _IRR_COMPILE_WITH_LIBPNG_ // PNG function for error handling static void png_cpexcept_error(png_structp png_ptr, png_const_charp msg) { @@ -51,7 +46,6 @@ void PNGAPI user_write_data_fcn(png_structp png_ptr, png_bytep data, png_size_t if (check != length) png_error(png_ptr, "Write Error"); } -#endif // _IRR_COMPILE_WITH_LIBPNG_ CImageWriterPNG::CImageWriterPNG() { @@ -62,16 +56,11 @@ CImageWriterPNG::CImageWriterPNG() bool CImageWriterPNG::isAWriteableFileExtension(const io::path& filename) const { -#ifdef _IRR_COMPILE_WITH_LIBPNG_ return core::hasFileExtension ( filename, "png" ); -#else - return false; -#endif } bool CImageWriterPNG::writeImage(io::IWriteFile* file, IImage* image,u32 param) const { -#ifdef _IRR_COMPILE_WITH_LIBPNG_ if (!file || !image) return false; @@ -206,13 +195,7 @@ bool CImageWriterPNG::writeImage(io::IWriteFile* file, IImage* image,u32 param) delete [] tmpImage; png_destroy_write_struct(&png_ptr, &info_ptr); return true; -#else - return false; -#endif } } // namespace video } // namespace irr - -#endif - diff --git a/source/Irrlicht/CImageWriterPNG.h b/source/Irrlicht/CImageWriterPNG.h index eec12ff..181d0c5 100644 --- a/source/Irrlicht/CImageWriterPNG.h +++ b/source/Irrlicht/CImageWriterPNG.h @@ -5,9 +5,6 @@ #ifndef _C_IMAGE_WRITER_PNG_H_INCLUDED__ #define _C_IMAGE_WRITER_PNG_H_INCLUDED__ -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_PNG_WRITER_ #include "IImageWriter.h" @@ -33,5 +30,3 @@ public: } // namespace irr #endif // _C_IMAGE_WRITER_PNG_H_INCLUDED__ -#endif - diff --git a/source/Irrlicht/CIrrDeviceLinux.h b/source/Irrlicht/CIrrDeviceLinux.h index ea50d7c..2d8945c 100644 --- a/source/Irrlicht/CIrrDeviceLinux.h +++ b/source/Irrlicht/CIrrDeviceLinux.h @@ -5,7 +5,6 @@ #ifndef __C_IRR_DEVICE_LINUX_H_INCLUDED__ #define __C_IRR_DEVICE_LINUX_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_X11_DEVICE_ diff --git a/source/Irrlicht/CIrrDeviceOSX.h b/source/Irrlicht/CIrrDeviceOSX.h index b8cdb42..d1b2049 100644 --- a/source/Irrlicht/CIrrDeviceOSX.h +++ b/source/Irrlicht/CIrrDeviceOSX.h @@ -6,7 +6,6 @@ #ifndef __C_IRR_DEVICE_OSX_H_INCLUDED__ #define __C_IRR_DEVICE_OSX_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OSX_DEVICE_ diff --git a/source/Irrlicht/CIrrDeviceOSX.mm b/source/Irrlicht/CIrrDeviceOSX.mm index e3b2a9a..4069cf1 100644 --- a/source/Irrlicht/CIrrDeviceOSX.mm +++ b/source/Irrlicht/CIrrDeviceOSX.mm @@ -4,7 +4,6 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in Irrlicht.h -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OSX_DEVICE_ diff --git a/source/Irrlicht/CIrrDeviceSDL.cpp b/source/Irrlicht/CIrrDeviceSDL.cpp index 1af434b..711cb56 100644 --- a/source/Irrlicht/CIrrDeviceSDL.cpp +++ b/source/Irrlicht/CIrrDeviceSDL.cpp @@ -2,7 +2,6 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_SDL_DEVICE_ diff --git a/source/Irrlicht/CIrrDeviceSDL.h b/source/Irrlicht/CIrrDeviceSDL.h index 7657718..4dbb2e7 100644 --- a/source/Irrlicht/CIrrDeviceSDL.h +++ b/source/Irrlicht/CIrrDeviceSDL.h @@ -7,7 +7,6 @@ #ifndef __C_IRR_DEVICE_SDL_H_INCLUDED__ #define __C_IRR_DEVICE_SDL_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_SDL_DEVICE_ diff --git a/source/Irrlicht/CIrrDeviceStub.cpp b/source/Irrlicht/CIrrDeviceStub.cpp index 877a4bf..92cda75 100644 --- a/source/Irrlicht/CIrrDeviceStub.cpp +++ b/source/Irrlicht/CIrrDeviceStub.cpp @@ -9,10 +9,10 @@ #include "IGUIElement.h" #include "IGUIEnvironment.h" #include "os.h" -#include "IrrCompileConfig.h" #include "CTimer.h" #include "CLogger.h" #include "irrString.h" +#include "IrrCompileConfig.h" // for IRRLICHT_SDK_VERSION namespace irr { @@ -88,10 +88,8 @@ CIrrDeviceStub::~CIrrDeviceStub() void CIrrDeviceStub::createGUIAndScene() { - #ifdef _IRR_COMPILE_WITH_GUI_ // create gui environment GUIEnvironment = gui::createGUIEnvironment(FileSystem, VideoDriver, Operator); - #endif // create Scene manager SceneManager = scene::createSceneManager(VideoDriver, FileSystem, CursorControl, GUIEnvironment); diff --git a/source/Irrlicht/CIrrDeviceWin32.cpp b/source/Irrlicht/CIrrDeviceWin32.cpp index ddff014..1033f9e 100644 --- a/source/Irrlicht/CIrrDeviceWin32.cpp +++ b/source/Irrlicht/CIrrDeviceWin32.cpp @@ -2,7 +2,6 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_ diff --git a/source/Irrlicht/CIrrDeviceWin32.h b/source/Irrlicht/CIrrDeviceWin32.h index 4af8d02..9ca44ac 100644 --- a/source/Irrlicht/CIrrDeviceWin32.h +++ b/source/Irrlicht/CIrrDeviceWin32.h @@ -5,7 +5,6 @@ #ifndef __C_IRR_DEVICE_WIN32_H_INCLUDED__ #define __C_IRR_DEVICE_WIN32_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_WINDOWS_DEVICE_ #include "CIrrDeviceStub.h" diff --git a/source/Irrlicht/CIrrDeviceiOS.h b/source/Irrlicht/CIrrDeviceiOS.h index d383c18..6130d27 100644 --- a/source/Irrlicht/CIrrDeviceiOS.h +++ b/source/Irrlicht/CIrrDeviceiOS.h @@ -7,7 +7,6 @@ #ifndef __C_IRR_DEVICE_IOS_H_INCLUDED__ #define __C_IRR_DEVICE_IOS_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_IOS_DEVICE_ diff --git a/source/Irrlicht/CMakeLists.txt b/source/Irrlicht/CMakeLists.txt index 208b573..4d2ec7e 100644 --- a/source/Irrlicht/CMakeLists.txt +++ b/source/Irrlicht/CMakeLists.txt @@ -1,11 +1,21 @@ option(BUILD_SHARED_LIBS "Build shared library" TRUE) +option(USE_SDL2 "Use the SDL2 backend" FALSE) # Compiler flags add_definitions(-DIRRLICHT_EXPORTS) -if(NOT BUILD_SHARED_LIBS) +if(BUILD_SHARED_LIBS) + if(WIN32) + set(API_IMPORT "__declspec(dllimport)") + set(API_EXPORT "__declspec(dllexport)") + elseif(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") + set(API_EXPORT "__attribute__ ((visibility(\"default\")))") # only necessary if default visibility is set to hidden + endif() +else() add_definitions(-D_IRR_STATIC_LIB_) endif() +add_definitions("-DIRRLICHT_API=${API_EXPORT}") + if(CMAKE_BUILD_TYPE STREQUAL "Debug") add_definitions(-D_DEBUG) endif() @@ -56,46 +66,195 @@ if(NOT REVISION_SANITY_CHECK) message(FATAL_ERROR "IrrlichtMt revision number mismatches between CMake and headers.") endif() +# Platform-independent configuration (hard-coded currently) +add_definitions( + -DIRR_ENABLE_BUILTIN_FONT + -D_IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ + ) + +# Platform-specific configuration + +if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") + set(SOLARIS TRUE) +endif() +if(APPLE AND NOT IOS) + set(OSX TRUE) +endif() + +# Device + +if(WIN32) + add_definitions(-D_IRR_WINDOWS_ -D_IRR_WINDOWS_API_) + set(DEVICE "WINDOWS") +elseif(IOS) + add_definitions(-D_IRR_IOS_PLATFORM_ -D_IRR_COMPILE_WITH_IOS_BUILTIN_MAIN_) + if(USE_SDL2) + message(WARNING "SDL2 backend is not supported on iOS") + set(USE_SDL2 FALSE) + endif() + set(DEVICE "IOS") +elseif(OSX) + add_definitions(-D_IRR_OSX_PLATFORM_) + set(DEVICE "OSX") +elseif(ANDROID) + add_definitions(-D_IRR_ANDROID_PLATFORM_ -D_IRR_COMPILE_ANDROID_ASSET_READER_) + if(USE_SDL2) + message(WARNING "SDL2 backend is not supported on Android") + set(USE_SDL2 FALSE) + endif() + set(DEVICE "Android") +elseif(EMSCRIPTEN) + add_definitions(-D_IRR_EMSCRIPTEN_PLATFORM_ -D_IRR_COMPILE_WITH_EGL_MANAGER_) + set(LINUX_PLATFORM TRUE) + set(DEVICE "SDL") +elseif(SOLARIS) + add_definitions(-D_IRR_SOLARIS_PLATFORM_ -D_IRR_POSIX_API_) + set(DEVICE "X11") +else() + add_definitions(-D_IRR_POSIX_API_) + set(LINUX_PLATFORM TRUE) + set(DEVICE "X11") +endif() + +if(LINUX_PLATFORM) + add_definitions(-D_IRR_LINUX_PLATFORM_) +endif() + +if(USE_SDL2) + set(DEVICE "SDL") +endif() + +add_definitions("-D_IRR_COMPILE_WITH_${DEVICE}_DEVICE_") + +# X11 + +if(DEVICE STREQUAL "X11") + option(USE_X11 "Use X11" TRUE) +else() + set(USE_X11 FALSE) +endif() + +if(LINUX_PLATFORM AND USE_X11) + option(USE_XINPUT2 "Use XInput2" TRUE) + option(USE_XCURSOR "Use XCursor" FALSE) +else() + set(USE_XINPUT2 FALSE) + set(USE_XCURSOR FALSE) +endif() + +# Joystick + +if(NOT (BSD OR SOLARIS OR EMSCRIPTEN)) + add_definitions(-D_IRR_COMPILE_WITH_JOYSTICK_EVENTS_) +endif() + +# OpenGL + +if(IOS OR ANDROID OR EMSCRIPTEN) + set(ENABLE_OPENGL FALSE) +else() + option(ENABLE_OPENGL "Enable OpenGL" TRUE) +endif() + +if(EMSCRIPTEN OR OSX) + set(ENABLE_GLES1 FALSE) +else() + if(ANDROID OR IOS) + set(DEFAULT_GLES1 TRUE) + endif() + option(ENABLE_GLES1 "Enable OpenGL ES" ${DEFAULT_GLES1}) +endif() + +if(OSX) + set(ENABLE_GLES2 FALSE) + set(ENABLE_WEBGL1 FALSE) +else() + if(ANDROID OR IOS OR EMSCRIPTEN) + set(DEFAULT_GLES2 TRUE) + endif() + if(EMSCRIPTEN) + set(DEFAULT_WEBGL1 TRUE) + endif() + option(ENABLE_GLES2 "Enable OpenGL ES 2+" ${DEFAULT_GLES2}) + option(ENABLE_WEBGL1 "Enable WebGL (requires GLES2)" ${DEFAULT_WEBGL1}) + if(ENABLE_WEBGL1) + set(ENABLE_GLES2 TRUE) + endif() +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_) + elseif(DEVICE STREQUAL "X11") + add_definitions(-D_IRR_COMPILE_WITH_GLX_MANAGER_ -D_IRR_OPENGL_USE_EXTPOINTER_) + elseif(DEVICE STREQUAL "OSX") + add_definitions(-D_IRR_COMPILE_WITH_NSOGL_MANAGER_) + elseif(DEVICE STREQUAL "SDL") + add_definitions(-D_IRR_OPENGL_USE_EXTPOINTER_) + endif() +endif() + +if(ENABLE_GLES1) + 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_) + elseif(DEVICE STREQUAL "IOS") + add_definitions(-D_IRR_COMPILE_WITH_EAGL_MANAGER_) + endif() +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_) + elseif(DEVICE STREQUAL "IOS") + add_definitions(-D_IRR_COMPILE_WITH_EAGL_MANAGER_) + endif() +endif() + +if(ENABLE_WEBGL1) + add_definitions(-D_IRR_COMPILE_WITH_WEBGL1_) +endif() + +# Misc + +include(TestBigEndian) +TEST_BIG_ENDIAN(BIG_ENDIAN) +if(BIG_ENDIAN) + add_definitions(-D__BIG_ENDIAN__) +endif() + +# Configuration report + +message(STATUS "Device: ${DEVICE}") +message(STATUS "OpenGL: ${ENABLE_OPENGL}") +message(STATUS "OpenGL ES: ${ENABLE_GLES1}") +message(STATUS "OpenGL ES 2: ${ENABLE_GLES2}") +message(STATUS "WebGL: ${ENABLE_WEBGL1}") + # Required libs find_package(ZLIB REQUIRED) find_package(JPEG REQUIRED) find_package(PNG REQUIRED) -# To configure the features available in this Irrlicht build please edit include/IrrCompileConfig.h. -include(CheckSymbolExists) -set(CMAKE_REQUIRED_INCLUDES ${PROJECT_SOURCE_DIR}/include) -unset(OGLES1_ENABLED CACHE) -unset(OGLES2_ENABLED CACHE) -unset(OGL_ENABLED CACHE) -unset(XINPUT2_ENABLED CACHE) -unset(SDL_ENABLED CACHE) -# tell cmake about the dependency -set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_REQUIRED_INCLUDES}/IrrCompileConfig.h) - -check_symbol_exists(_IRR_COMPILE_WITH_OGLES1_ "IrrCompileConfig.h" OGLES1_ENABLED) -if(OGLES1_ENABLED) +if(ENABLE_GLES1) # only tested on Android, probably works on Linux (is this needed anywhere else?) find_library(OPENGLES_LIBRARY NAMES GLESv1_CM REQUIRED) find_library(EGL_LIBRARY NAMES EGL REQUIRED) message(STATUS "Found OpenGLES: ${OPENGLES_LIBRARY}") endif() -check_symbol_exists(_IRR_COMPILE_WITH_OGLES2_ "IrrCompileConfig.h" OGLES2_ENABLED) -if(OGLES2_ENABLED) +if(ENABLE_GLES2) find_package(OpenGLES2 REQUIRED) endif() -check_symbol_exists(_IRR_COMPILE_WITH_OPENGL_ "IrrCompileConfig.h" OGL_ENABLED) -if(OGL_ENABLED) +if(ENABLE_OPENGL) set(OpenGL_GL_PREFERENCE "LEGACY") find_package(OpenGL REQUIRED) endif() -if(UNIX AND NOT ANDROID AND NOT APPLE) - check_symbol_exists(_IRR_LINUX_X11_XINPUT2_ "IrrCompileConfig.h" XINPUT2_ENABLED) -endif() -check_symbol_exists(_IRR_COMPILE_WITH_SDL_DEVICE_ "IrrCompileConfig.h" SDL_ENABLED) -if(SDL_ENABLED) +if(USE_SDL2) find_package(SDL2 CONFIG REQUIRED) message(STATUS "Found SDL2: ${SDL2_LIBRARIES}") endif() @@ -113,7 +272,7 @@ elseif(APPLE) else() # Unix probably find_package(X11 REQUIRED) - if(XINPUT2_ENABLED AND NOT X11_Xi_FOUND) + if(USE_XINPUT2 AND NOT X11_Xi_FOUND) message(FATAL_ERROR "XInput not found") endif() endif() @@ -259,6 +418,18 @@ elseif(APPLE) ) endif() +if(USE_X11) + target_compile_definitions(IRROTHEROBJ PRIVATE _IRR_COMPILE_WITH_X11_) +endif() + +if(USE_XINPUT2) + target_compile_definitions(IRROTHEROBJ PRIVATE _IRR_LINUX_X11_XINPUT2_) +endif() + +if(USE_XCURSOR) + target_compile_definitions(IRROTHEROBJ PRIVATE _IRR_LINUX_XCURSOR_) +endif() + add_library(IRRGUIOBJ OBJECT CGUIButton.cpp CGUICheckBox.cpp @@ -303,9 +474,12 @@ target_include_directories(IrrlichtMt target_link_libraries(IrrlichtMt PRIVATE ${link_libs}) -# Propagate static library flag to lib users, only needed for Windows -if(NOT BUILD_SHARED_LIBS) - target_compile_definitions(IrrlichtMt INTERFACE _IRR_STATIC_LIB_) +if(WIN32) + target_compile_definitions(IrrlichtMt INTERFACE _IRR_WINDOWS_API_) # used in _IRR_DEBUG_BREAK_IF definition in a public header +endif() +target_compile_definitions(IrrlichtMt INTERFACE "IRRLICHT_API=${API_IMPORT}") +if(APPLE OR ANDROID OR EMSCRIPTEN) + target_compile_definitions(IrrlichtMt PUBLIC IRR_MOBILE_PATHS) endif() set_target_properties(IrrlichtMt PROPERTIES diff --git a/source/Irrlicht/CNSOGLManager.h b/source/Irrlicht/CNSOGLManager.h index efe0b42..8744d16 100644 --- a/source/Irrlicht/CNSOGLManager.h +++ b/source/Irrlicht/CNSOGLManager.h @@ -5,7 +5,6 @@ #ifndef __C_NSOGL_MANAGER_H_INCLUDED__ #define __C_NSOGL_MANAGER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_NSOGL_MANAGER_ diff --git a/source/Irrlicht/CNullDriver.cpp b/source/Irrlicht/CNullDriver.cpp index 775a22c..2cbd47c 100644 --- a/source/Irrlicht/CNullDriver.cpp +++ b/source/Irrlicht/CNullDriver.cpp @@ -32,57 +32,15 @@ IImageLoader* createImageLoaderJPG(); //! creates a loader which is able to load targa images IImageLoader* createImageLoaderTGA(); -//! creates a loader which is able to load psd images -IImageLoader* createImageLoaderPSD(); - -//! creates a loader which is able to load psd images -IImageLoader* createImageLoaderPVR(); - -//! creates a loader which is able to load dds images -IImageLoader* createImageLoaderDDS(); - -//! creates a loader which is able to load pcx images -IImageLoader* createImageLoaderPCX(); - //! creates a loader which is able to load png images IImageLoader* createImageLoaderPNG(); -//! creates a loader which is able to load WAL images -IImageLoader* createImageLoaderWAL(); - -//! creates a loader which is able to load halflife images -IImageLoader* createImageLoaderHalfLife(); - -//! creates a loader which is able to load lmp images -IImageLoader* createImageLoaderLMP(); - -//! creates a loader which is able to load ppm/pgm/pbm images -IImageLoader* createImageLoaderPPM(); - -//! creates a loader which is able to load rgb images -IImageLoader* createImageLoaderRGB(); - - -//! creates a writer which is able to save bmp images -IImageWriter* createImageWriterBMP(); - //! creates a writer which is able to save jpg images IImageWriter* createImageWriterJPG(); -//! creates a writer which is able to save tga images -IImageWriter* createImageWriterTGA(); - -//! creates a writer which is able to save psd images -IImageWriter* createImageWriterPSD(); - -//! creates a writer which is able to save pcx images -IImageWriter* createImageWriterPCX(); - //! creates a writer which is able to save png images IImageWriter* createImageWriterPNG(); -//! creates a writer which is able to save ppm images -IImageWriter* createImageWriterPPM(); //! constructor CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d& screenSize) @@ -95,8 +53,8 @@ CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d& scre #endif DriverAttributes = new io::CAttributes(); - DriverAttributes->addInt("MaxTextures", _IRR_MATERIAL_MAX_TEXTURES_); - DriverAttributes->addInt("MaxSupportedTextures", _IRR_MATERIAL_MAX_TEXTURES_); + DriverAttributes->addInt("MaxTextures", MATERIAL_MAX_TEXTURES); + DriverAttributes->addInt("MaxSupportedTextures", MATERIAL_MAX_TEXTURES); DriverAttributes->addInt("MaxAnisotropy", 1); // DriverAttributes->addInt("MaxUserClipPlanes", 0); // DriverAttributes->addInt("MaxAuxBuffers", 0); @@ -124,68 +82,14 @@ CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d& scre if (FileSystem) FileSystem->grab(); - // create surface loader - -#ifdef _IRR_COMPILE_WITH_WAL_LOADER_ - SurfaceLoader.push_back(video::createImageLoaderHalfLife()); - SurfaceLoader.push_back(video::createImageLoaderWAL()); -#endif -#ifdef _IRR_COMPILE_WITH_LMP_LOADER_ - SurfaceLoader.push_back(video::createImageLoaderLMP()); -#endif -#ifdef _IRR_COMPILE_WITH_PPM_LOADER_ - SurfaceLoader.push_back(video::createImageLoaderPPM()); -#endif -#ifdef _IRR_COMPILE_WITH_RGB_LOADER_ - SurfaceLoader.push_back(video::createImageLoaderRGB()); -#endif -#ifdef _IRR_COMPILE_WITH_PSD_LOADER_ - SurfaceLoader.push_back(video::createImageLoaderPSD()); -#endif -#ifdef _IRR_COMPILE_WITH_PVR_LOADER_ - SurfaceLoader.push_back(video::createImageLoaderPVR()); -#endif -#if defined(_IRR_COMPILE_WITH_DDS_LOADER_) || defined(_IRR_COMPILE_WITH_DDS_DECODER_LOADER_) - SurfaceLoader.push_back(video::createImageLoaderDDS()); -#endif -#ifdef _IRR_COMPILE_WITH_PCX_LOADER_ - SurfaceLoader.push_back(video::createImageLoaderPCX()); -#endif -#ifdef _IRR_COMPILE_WITH_TGA_LOADER_ + // create surface loaders and writers SurfaceLoader.push_back(video::createImageLoaderTGA()); -#endif -#ifdef _IRR_COMPILE_WITH_PNG_LOADER_ SurfaceLoader.push_back(video::createImageLoaderPNG()); -#endif -#ifdef _IRR_COMPILE_WITH_JPG_LOADER_ SurfaceLoader.push_back(video::createImageLoaderJPG()); -#endif -#ifdef _IRR_COMPILE_WITH_BMP_LOADER_ SurfaceLoader.push_back(video::createImageLoaderBMP()); -#endif - -#ifdef _IRR_COMPILE_WITH_PPM_WRITER_ - SurfaceWriter.push_back(video::createImageWriterPPM()); -#endif -#ifdef _IRR_COMPILE_WITH_PCX_WRITER_ - SurfaceWriter.push_back(video::createImageWriterPCX()); -#endif -#ifdef _IRR_COMPILE_WITH_PSD_WRITER_ - SurfaceWriter.push_back(video::createImageWriterPSD()); -#endif -#ifdef _IRR_COMPILE_WITH_TGA_WRITER_ - SurfaceWriter.push_back(video::createImageWriterTGA()); -#endif -#ifdef _IRR_COMPILE_WITH_JPG_WRITER_ SurfaceWriter.push_back(video::createImageWriterJPG()); -#endif -#ifdef _IRR_COMPILE_WITH_PNG_WRITER_ SurfaceWriter.push_back(video::createImageWriterPNG()); -#endif -#ifdef _IRR_COMPILE_WITH_BMP_WRITER_ - SurfaceWriter.push_back(video::createImageWriterBMP()); -#endif // set ExposedData to 0 diff --git a/source/Irrlicht/COBJMeshFileLoader.cpp b/source/Irrlicht/COBJMeshFileLoader.cpp index c4fee23..c4be102 100644 --- a/source/Irrlicht/COBJMeshFileLoader.cpp +++ b/source/Irrlicht/COBJMeshFileLoader.cpp @@ -2,9 +2,6 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_OBJ_LOADER_ - #include "COBJMeshFileLoader.h" #include "IMeshManipulator.h" #include "IVideoDriver.h" @@ -612,6 +609,3 @@ void COBJMeshFileLoader::cleanUp() } // end namespace scene } // end namespace irr - -#endif // _IRR_COMPILE_WITH_OBJ_LOADER_ - diff --git a/source/Irrlicht/COGLES2Common.h b/source/Irrlicht/COGLES2Common.h index 2c844ce..a69f667 100644 --- a/source/Irrlicht/COGLES2Common.h +++ b/source/Irrlicht/COGLES2Common.h @@ -5,7 +5,6 @@ #ifndef __C_OGLES2_COMMON_H_INCLUDED__ #define __C_OGLES2_COMMON_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OGLES2_ diff --git a/source/Irrlicht/COGLES2Driver.h b/source/Irrlicht/COGLES2Driver.h index 8d31ff6..eaf4d99 100644 --- a/source/Irrlicht/COGLES2Driver.h +++ b/source/Irrlicht/COGLES2Driver.h @@ -6,7 +6,6 @@ #ifndef __C_OGLES2_DRIVER_H_INCLUDED__ #define __C_OGLES2_DRIVER_H_INCLUDED__ -#include "IrrCompileConfig.h" #include "SIrrCreationParameters.h" diff --git a/source/Irrlicht/COGLES2ExtensionHandler.h b/source/Irrlicht/COGLES2ExtensionHandler.h index 2e81b37..73db08a 100644 --- a/source/Irrlicht/COGLES2ExtensionHandler.h +++ b/source/Irrlicht/COGLES2ExtensionHandler.h @@ -6,7 +6,6 @@ #ifndef __C_OGLES2_EXTENSION_HANDLER_H_INCLUDED__ #define __C_OGLES2_EXTENSION_HANDLER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OGLES2_ diff --git a/source/Irrlicht/COGLES2FixedPipelineRenderer.cpp b/source/Irrlicht/COGLES2FixedPipelineRenderer.cpp index 5b275d3..899dfd9 100644 --- a/source/Irrlicht/COGLES2FixedPipelineRenderer.cpp +++ b/source/Irrlicht/COGLES2FixedPipelineRenderer.cpp @@ -176,7 +176,7 @@ void COGLES2MaterialSolid2CB::OnSetConstants(IMaterialRendererServices* services core::matrix4 Matrix = driver->getTransform(ETS_TEXTURE_0); services->setPixelShaderConstant(TMatrix0ID, Matrix.pointer(), 16); - Matrix = driver->getTransform(ETS_TEXTURE_1); + Matrix = driver->getTransform(E_TRANSFORMATION_STATE(ETS_TEXTURE_0 + 1)); services->setPixelShaderConstant(TMatrix1ID, Matrix.pointer(), 16); services->setPixelShaderConstant(TextureUsage0ID, &TextureUsage0, 1); @@ -223,7 +223,7 @@ void COGLES2MaterialLightmapCB::OnSetConstants(IMaterialRendererServices* servic core::matrix4 Matrix = driver->getTransform(ETS_TEXTURE_0); services->setPixelShaderConstant(TMatrix0ID, Matrix.pointer(), 16); - Matrix = driver->getTransform(ETS_TEXTURE_1); + Matrix = driver->getTransform(E_TRANSFORMATION_STATE(ETS_TEXTURE_0 + 1)); services->setPixelShaderConstant(TMatrix1ID, Matrix.pointer(), 16); services->setPixelShaderConstant(ModulateID, &Modulate, 1); diff --git a/source/Irrlicht/COGLES2FixedPipelineRenderer.h b/source/Irrlicht/COGLES2FixedPipelineRenderer.h index f5882f1..b50ef74 100644 --- a/source/Irrlicht/COGLES2FixedPipelineRenderer.h +++ b/source/Irrlicht/COGLES2FixedPipelineRenderer.h @@ -5,7 +5,6 @@ #ifndef __C_OGLES2_FIXED_PIPELINE_SHADER_H_INCLUDED__ #define __C_OGLES2_FIXED_PIPELINE_SHADER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OGLES2_ diff --git a/source/Irrlicht/COGLES2MaterialRenderer.h b/source/Irrlicht/COGLES2MaterialRenderer.h index 9c4c2c9..5483263 100644 --- a/source/Irrlicht/COGLES2MaterialRenderer.h +++ b/source/Irrlicht/COGLES2MaterialRenderer.h @@ -5,7 +5,6 @@ #ifndef __C_OGLES2_SL_MATERIAL_RENDERER_H_INCLUDED__ #define __C_OGLES2_SL_MATERIAL_RENDERER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OGLES2_ diff --git a/source/Irrlicht/COGLES2Renderer2D.h b/source/Irrlicht/COGLES2Renderer2D.h index 2521758..1d69828 100644 --- a/source/Irrlicht/COGLES2Renderer2D.h +++ b/source/Irrlicht/COGLES2Renderer2D.h @@ -5,7 +5,6 @@ #ifndef __C_OGLES2_RENDERER_2D_H_INCLUDED__ #define __C_OGLES2_RENDERER_2D_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OGLES2_ diff --git a/source/Irrlicht/COGLESCommon.h b/source/Irrlicht/COGLESCommon.h index a7b8eb3..57e5b7b 100644 --- a/source/Irrlicht/COGLESCommon.h +++ b/source/Irrlicht/COGLESCommon.h @@ -5,7 +5,6 @@ #ifndef __C_OGLES_COMMON_H_INCLUDED__ #define __C_OGLES_COMMON_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OGLES1_ diff --git a/source/Irrlicht/COGLESCoreExtensionHandler.h b/source/Irrlicht/COGLESCoreExtensionHandler.h index a557844..ce6ea1d 100644 --- a/source/Irrlicht/COGLESCoreExtensionHandler.h +++ b/source/Irrlicht/COGLESCoreExtensionHandler.h @@ -5,7 +5,6 @@ #ifndef __E_OGLES_CORE_EXTENSION_HANDLER_H_INCLUDED__ #define __E_OGLES_CORE_EXTENSION_HANDLER_H_INCLUDED__ -#include "IrrCompileConfig.h" // Can be included from different ES versions // (this is also the reason why this file is header-only as correct OGL ES headers have to be included first) diff --git a/source/Irrlicht/COGLESDriver.h b/source/Irrlicht/COGLESDriver.h index eb27f07..7428094 100644 --- a/source/Irrlicht/COGLESDriver.h +++ b/source/Irrlicht/COGLESDriver.h @@ -5,7 +5,6 @@ #ifndef __C_OGLES1_DRIVER_H_INCLUDED__ #define __C_OGLES1_DRIVER_H_INCLUDED__ -#include "IrrCompileConfig.h" #include "SIrrCreationParameters.h" diff --git a/source/Irrlicht/COGLESExtensionHandler.h b/source/Irrlicht/COGLESExtensionHandler.h index efed793..bcc3278 100644 --- a/source/Irrlicht/COGLESExtensionHandler.h +++ b/source/Irrlicht/COGLESExtensionHandler.h @@ -6,7 +6,6 @@ #ifndef __C_OGLES_EXTENSION_HANDLER_H_INCLUDED__ #define __C_OGLES_EXTENSION_HANDLER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OGLES1_ diff --git a/source/Irrlicht/COGLESMaterialRenderer.h b/source/Irrlicht/COGLESMaterialRenderer.h index 5af6f73..b2f8861 100644 --- a/source/Irrlicht/COGLESMaterialRenderer.h +++ b/source/Irrlicht/COGLESMaterialRenderer.h @@ -5,7 +5,6 @@ #ifndef __C_OGLES1_MATERIAL_RENDERER_H_INCLUDED__ #define __C_OGLES1_MATERIAL_RENDERER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OGLES1_ #include "COGLESDriver.h" diff --git a/source/Irrlicht/COpenGLCacheHandler.h b/source/Irrlicht/COpenGLCacheHandler.h index f7d14c0..11c8a29 100644 --- a/source/Irrlicht/COpenGLCacheHandler.h +++ b/source/Irrlicht/COpenGLCacheHandler.h @@ -5,7 +5,6 @@ #ifndef __C_OPENGL_CACHE_HANDLER_H_INCLUDED__ #define __C_OPENGL_CACHE_HANDLER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OPENGL_ diff --git a/source/Irrlicht/COpenGLCommon.h b/source/Irrlicht/COpenGLCommon.h index 6f7b790..52a0604 100644 --- a/source/Irrlicht/COpenGLCommon.h +++ b/source/Irrlicht/COpenGLCommon.h @@ -5,7 +5,6 @@ #ifndef __C_OPENGL_COMMON_H_INCLUDED__ #define __C_OPENGL_COMMON_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OPENGL_ diff --git a/source/Irrlicht/COpenGLCoreCacheHandler.h b/source/Irrlicht/COpenGLCoreCacheHandler.h index 5726e5f..79b2800 100644 --- a/source/Irrlicht/COpenGLCoreCacheHandler.h +++ b/source/Irrlicht/COpenGLCoreCacheHandler.h @@ -5,7 +5,6 @@ #ifndef __C_OGLCORE_CACHE_HANDLER_H_INCLUDED__ #define __C_OGLCORE_CACHE_HANDLER_H_INCLUDED__ -#include "IrrCompileConfig.h" #if defined(_IRR_COMPILE_WITH_OPENGL_) || defined(_IRR_COMPILE_WITH_OGLES1_) || defined(_IRR_COMPILE_WITH_OGLES2_) diff --git a/source/Irrlicht/COpenGLCoreFeature.h b/source/Irrlicht/COpenGLCoreFeature.h index 6ec5822..fe86f95 100644 --- a/source/Irrlicht/COpenGLCoreFeature.h +++ b/source/Irrlicht/COpenGLCoreFeature.h @@ -5,7 +5,6 @@ #ifndef __C_OGLCORE_FEATURE_H_INCLUDED__ #define __C_OGLCORE_FEATURE_H_INCLUDED__ -#include "IrrCompileConfig.h" #if defined(_IRR_COMPILE_WITH_OPENGL_) || defined(_IRR_COMPILE_WITH_OGLES1_) || defined(_IRR_COMPILE_WITH_OGLES2_) diff --git a/source/Irrlicht/COpenGLCoreRenderTarget.h b/source/Irrlicht/COpenGLCoreRenderTarget.h index 6c542f5..0dd08eb 100644 --- a/source/Irrlicht/COpenGLCoreRenderTarget.h +++ b/source/Irrlicht/COpenGLCoreRenderTarget.h @@ -5,7 +5,6 @@ #ifndef __C_OGLCORE_RENDER_TARGET_H_INCLUDED__ #define __C_OGLCORE_RENDER_TARGET_H_INCLUDED__ -#include "IrrCompileConfig.h" #if defined(_IRR_COMPILE_WITH_OPENGL_) || defined(_IRR_COMPILE_WITH_OGLES1_) || defined(_IRR_COMPILE_WITH_OGLES2_) diff --git a/source/Irrlicht/COpenGLCoreTexture.h b/source/Irrlicht/COpenGLCoreTexture.h index 8897c58..c19215b 100644 --- a/source/Irrlicht/COpenGLCoreTexture.h +++ b/source/Irrlicht/COpenGLCoreTexture.h @@ -5,7 +5,6 @@ #ifndef __C_OGLCORE_TEXTURE_H_INCLUDED__ #define __C_OGLCORE_TEXTURE_H_INCLUDED__ -#include "IrrCompileConfig.h" #if defined(_IRR_COMPILE_WITH_OPENGL_) || defined(_IRR_COMPILE_WITH_OGLES1_) || defined(_IRR_COMPILE_WITH_OGLES2_) diff --git a/source/Irrlicht/COpenGLDriver.h b/source/Irrlicht/COpenGLDriver.h index 3454036..c60d2ba 100644 --- a/source/Irrlicht/COpenGLDriver.h +++ b/source/Irrlicht/COpenGLDriver.h @@ -5,7 +5,6 @@ #ifndef __C_VIDEO_OPEN_GL_H_INCLUDED__ #define __C_VIDEO_OPEN_GL_H_INCLUDED__ -#include "IrrCompileConfig.h" #include "SIrrCreationParameters.h" diff --git a/source/Irrlicht/COpenGLExtensionHandler.h b/source/Irrlicht/COpenGLExtensionHandler.h index 960b7f6..5d748d5 100644 --- a/source/Irrlicht/COpenGLExtensionHandler.h +++ b/source/Irrlicht/COpenGLExtensionHandler.h @@ -5,7 +5,6 @@ #ifndef __C_OPEN_GL_FEATURE_MAP_H_INCLUDED__ #define __C_OPEN_GL_FEATURE_MAP_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OPENGL_ diff --git a/source/Irrlicht/COpenGLMaterialRenderer.h b/source/Irrlicht/COpenGLMaterialRenderer.h index ed37e5d..6d33056 100644 --- a/source/Irrlicht/COpenGLMaterialRenderer.h +++ b/source/Irrlicht/COpenGLMaterialRenderer.h @@ -5,7 +5,6 @@ #ifndef __C_OPENGL_MATERIAL_RENDERER_H_INCLUDED__ #define __C_OPENGL_MATERIAL_RENDERER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OPENGL_ #include "IMaterialRenderer.h" diff --git a/source/Irrlicht/COpenGLSLMaterialRenderer.h b/source/Irrlicht/COpenGLSLMaterialRenderer.h index b6a4f82..a870a6e 100644 --- a/source/Irrlicht/COpenGLSLMaterialRenderer.h +++ b/source/Irrlicht/COpenGLSLMaterialRenderer.h @@ -5,7 +5,6 @@ #ifndef __C_OPENGL_SHADER_LANGUAGE_MATERIAL_RENDERER_H_INCLUDED__ #define __C_OPENGL_SHADER_LANGUAGE_MATERIAL_RENDERER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OPENGL_ diff --git a/source/Irrlicht/COpenGLShaderMaterialRenderer.h b/source/Irrlicht/COpenGLShaderMaterialRenderer.h index 80ca433..81f8c81 100644 --- a/source/Irrlicht/COpenGLShaderMaterialRenderer.h +++ b/source/Irrlicht/COpenGLShaderMaterialRenderer.h @@ -5,7 +5,6 @@ #ifndef __C_OPENGL_SHADER_MATERIAL_RENDERER_H_INCLUDED__ #define __C_OPENGL_SHADER_MATERIAL_RENDERER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_OPENGL_ diff --git a/source/Irrlicht/CSDLManager.h b/source/Irrlicht/CSDLManager.h index 6b0f254..3d9648c 100644 --- a/source/Irrlicht/CSDLManager.h +++ b/source/Irrlicht/CSDLManager.h @@ -5,7 +5,6 @@ #ifndef __C_SDL_MANAGER_H_INCLUDED__ #define __C_SDL_MANAGER_H_INCLUDED__ -#include "IrrCompileConfig.h" #if defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && defined(_IRR_COMPILE_WITH_OPENGL_) diff --git a/source/Irrlicht/CSceneManager.cpp b/source/Irrlicht/CSceneManager.cpp index 664e672..e22ddd5 100644 --- a/source/Irrlicht/CSceneManager.cpp +++ b/source/Irrlicht/CSceneManager.cpp @@ -2,7 +2,6 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#include "IrrCompileConfig.h" #include "CSceneManager.h" #include "IVideoDriver.h" #include "IFileSystem.h" @@ -15,27 +14,11 @@ #include "os.h" -// We need this include for the case of skinned mesh support without -// any such loader -#ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ #include "CSkinnedMesh.h" -#endif - -#ifdef _IRR_COMPILE_WITH_X_LOADER_ #include "CXMeshFileLoader.h" -#endif - -#ifdef _IRR_COMPILE_WITH_OBJ_LOADER_ #include "COBJMeshFileLoader.h" -#endif - -#ifdef _IRR_COMPILE_WITH_B3D_LOADER_ #include "CB3DMeshFileLoader.h" -#endif - -#ifdef _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ #include "CBillboardSceneNode.h" -#endif // _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ #include "CAnimatedMeshSceneNode.h" #include "CCameraSceneNode.h" #include "CMeshSceneNode.h" @@ -96,15 +79,9 @@ CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs, // TODO: now that we have multiple scene managers, these should be // shallow copies from the previous manager if there is one. - #ifdef _IRR_COMPILE_WITH_X_LOADER_ MeshLoaderList.push_back(new CXMeshFileLoader(this, FileSystem)); - #endif - #ifdef _IRR_COMPILE_WITH_OBJ_LOADER_ MeshLoaderList.push_back(new COBJMeshFileLoader(this, FileSystem)); - #endif - #ifdef _IRR_COMPILE_WITH_B3D_LOADER_ MeshLoaderList.push_back(new CB3DMeshFileLoader(this)); - #endif } @@ -316,7 +293,6 @@ IBillboardSceneNode* CSceneManager::addBillboardSceneNode(ISceneNode* parent, video::SColor colorTop, video::SColor colorBottom ) { -#ifdef _IRR_COMPILE_WITH_BILLBOARD_SCENENODE_ if (!parent) parent = this; @@ -325,9 +301,6 @@ IBillboardSceneNode* CSceneManager::addBillboardSceneNode(ISceneNode* parent, node->drop(); return node; -#else - return 0; -#endif } @@ -575,17 +548,6 @@ u32 CSceneManager::registerNodeForRendering(ISceneNode* node, E_SCENE_NODE_RENDE break; } -#ifdef _IRR_SCENEMANAGER_DEBUG - s32 index = Parameters->findAttribute("calls"); - Parameters->setAttribute(index, Parameters->getAttributeAsInt(index)+1); - - if (!taken) - { - index = Parameters->findAttribute("culled"); - Parameters->setAttribute(index, Parameters->getAttributeAsInt(index)+1); - } -#endif - return taken; } @@ -606,15 +568,6 @@ void CSceneManager::drawAll() if (!Driver) return; -#ifdef _IRR_SCENEMANAGER_DEBUG - // reset attributes - Parameters->setAttribute("culled", 0); - Parameters->setAttribute("calls", 0); - Parameters->setAttribute("drawn_solid", 0); - Parameters->setAttribute("drawn_transparent", 0); - Parameters->setAttribute("drawn_transparent_effect", 0); -#endif - u32 i; // new ISO for scoping problem in some compilers // reset all transforms @@ -676,9 +629,6 @@ void CSceneManager::drawAll() for (i=0; irender(); -#ifdef _IRR_SCENEMANAGER_DEBUG - Parameters->setAttribute("drawn_solid", (s32) SolidNodeList.size() ); -#endif SolidNodeList.set_used(0); } @@ -691,9 +641,6 @@ void CSceneManager::drawAll() for (i=0; irender(); -#ifdef _IRR_SCENEMANAGER_DEBUG - Parameters->setAttribute ( "drawn_transparent", (s32) TransparentNodeList.size() ); -#endif TransparentNodeList.set_used(0); } @@ -706,9 +653,7 @@ void CSceneManager::drawAll() for (i=0; irender(); -#ifdef _IRR_SCENEMANAGER_DEBUG - Parameters->setAttribute("drawn_transparent_effect", (s32) TransparentEffectNodeList.size()); -#endif + TransparentEffectNodeList.set_used(0); } @@ -719,9 +664,7 @@ void CSceneManager::drawAll() for (i=0; irender(); -#ifdef _IRR_SCENEMANAGER_DEBUG - Parameters->setAttribute("drawn_gui_nodes", (s32) GuiNodeList.size()); -#endif + GuiNodeList.set_used(0); } clearDeletionList(); @@ -971,49 +914,12 @@ const video::SColorf& CSceneManager::getAmbientLight() const //! Get a skinned mesh, which is not available as header-only code ISkinnedMesh* CSceneManager::createSkinnedMesh() { -#ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ return new CSkinnedMesh(); -#else - return 0; -#endif } //! Returns a mesh writer implementation if available IMeshWriter* CSceneManager::createMeshWriter(EMESH_WRITER_TYPE type) { - switch(type) - { - case EMWT_IRR_MESH: - case EMWT_COLLADA: - return 0; - case EMWT_STL: -#ifdef _IRR_COMPILE_WITH_STL_WRITER_ - return new CSTLMeshWriter(this); -#else - return 0; -#endif - case EMWT_OBJ: -#ifdef _IRR_COMPILE_WITH_OBJ_WRITER_ - return new COBJMeshWriter(this, FileSystem); -#else - return 0; -#endif - - case EMWT_PLY: -#ifdef _IRR_COMPILE_WITH_PLY_WRITER_ - return new CPLYMeshWriter(); -#else - return 0; -#endif - - case EMWT_B3D: -#ifdef _IRR_COMPILE_WITH_B3D_WRITER_ - return new CB3DMeshWriter(); -#else - return 0; -#endif - } - return 0; } diff --git a/source/Irrlicht/CSkinnedMesh.cpp b/source/Irrlicht/CSkinnedMesh.cpp index 9f47f3b..f7cf1f0 100644 --- a/source/Irrlicht/CSkinnedMesh.cpp +++ b/source/Irrlicht/CSkinnedMesh.cpp @@ -2,9 +2,6 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ - #include "CSkinnedMesh.h" #include "CBoneSceneNode.h" #include "IAnimatedMeshSceneNode.h" @@ -1539,6 +1536,3 @@ void CSkinnedMesh::calculateTangents( } // end namespace scene } // end namespace irr - -#endif // _IRR_COMPILE_WITH_SKINNED_MESH_SUPPORT_ - diff --git a/source/Irrlicht/CWGLManager.h b/source/Irrlicht/CWGLManager.h index bd75065..e2d1513 100644 --- a/source/Irrlicht/CWGLManager.h +++ b/source/Irrlicht/CWGLManager.h @@ -5,7 +5,6 @@ #ifndef __C_WGL_MANAGER_H_INCLUDED__ #define __C_WGL_MANAGER_H_INCLUDED__ -#include "IrrCompileConfig.h" #ifdef _IRR_COMPILE_WITH_WGL_MANAGER_ diff --git a/source/Irrlicht/CWebGL1Driver.h b/source/Irrlicht/CWebGL1Driver.h index ce26432..73c5a21 100644 --- a/source/Irrlicht/CWebGL1Driver.h +++ b/source/Irrlicht/CWebGL1Driver.h @@ -5,7 +5,6 @@ #ifndef __C_WEBGL1_DRIVER_H_INCLUDED__ #define __C_WEBGL1_DRIVER_H_INCLUDED__ -#include "IrrCompileConfig.h" #include "SIrrCreationParameters.h" diff --git a/source/Irrlicht/CWebGLExtensionHandler.h b/source/Irrlicht/CWebGLExtensionHandler.h index 67ffaf7..9a78df3 100644 --- a/source/Irrlicht/CWebGLExtensionHandler.h +++ b/source/Irrlicht/CWebGLExtensionHandler.h @@ -5,7 +5,6 @@ #ifndef __E_WEGL_EXTENSION_HANDLER_H_INCLUDED__ #define __E_WEGL_EXTENSION_HANDLER_H_INCLUDED__ -#include "IrrCompileConfig.h" #if defined(_IRR_COMPILE_WITH_WEBGL1_) // Note: should also work with WebGL2 once we add that to Irrlicht diff --git a/source/Irrlicht/CXMeshFileLoader.cpp b/source/Irrlicht/CXMeshFileLoader.cpp index 2de099f..7603ec5 100644 --- a/source/Irrlicht/CXMeshFileLoader.cpp +++ b/source/Irrlicht/CXMeshFileLoader.cpp @@ -2,9 +2,6 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#include "IrrCompileConfig.h" - -#ifdef _IRR_COMPILE_WITH_X_LOADER_ #include "CXMeshFileLoader.h" #include "os.h" @@ -2359,6 +2356,3 @@ bool CXMeshFileLoader::readMatrix(core::matrix4& mat) } // end namespace scene } // end namespace irr - -#endif // _IRR_COMPILE_WITH_X_LOADER_ - diff --git a/source/Irrlicht/CZipReader.cpp b/source/Irrlicht/CZipReader.cpp index d394313..071f735 100644 --- a/source/Irrlicht/CZipReader.cpp +++ b/source/Irrlicht/CZipReader.cpp @@ -7,16 +7,11 @@ #include "os.h" -#ifdef __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ - #include "CFileList.h" #include "CReadFile.h" #include "coreutil.h" -#include "IrrCompileConfig.h" -#ifdef _IRR_COMPILE_WITH_ZLIB_ - #include // use system lib -#endif +#include // use system lib namespace irr { @@ -464,8 +459,6 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) } case 8: { - #ifdef _IRR_COMPILE_WITH_ZLIB_ - const u32 uncompressedSize = e.header.DataDescriptor.UncompressedSize; c8* pBuf = new c8[ uncompressedSize ]; if (!pBuf) @@ -531,10 +524,6 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) } else return FileSystem->createMemoryReadFile(pBuf, uncompressedSize, Files[index].FullName, true); - - #else - return 0; // zlib not compiled, we cannot decompress the data. - #endif } case 12: { @@ -560,5 +549,3 @@ IReadFile* CZipReader::createAndOpenFile(u32 index) } // end namespace io } // end namespace irr - -#endif // __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ diff --git a/source/Irrlicht/CZipReader.h b/source/Irrlicht/CZipReader.h index 458b6db..6b16ab9 100644 --- a/source/Irrlicht/CZipReader.h +++ b/source/Irrlicht/CZipReader.h @@ -5,9 +5,6 @@ #ifndef __C_ZIP_READER_H_INCLUDED__ #define __C_ZIP_READER_H_INCLUDED__ -#include "IrrCompileConfig.h" - -#ifdef __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ #include "IReadFile.h" #include "irrArray.h" @@ -226,6 +223,4 @@ namespace io } // end namespace io } // end namespace irr -#endif // __IRR_COMPILE_WITH_ZIP_ARCHIVE_LOADER_ #endif // __C_ZIP_READER_H_INCLUDED__ - diff --git a/source/Irrlicht/Irrlicht.cpp b/source/Irrlicht/Irrlicht.cpp index 4438b51..50348e7 100644 --- a/source/Irrlicht/Irrlicht.cpp +++ b/source/Irrlicht/Irrlicht.cpp @@ -2,7 +2,6 @@ // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h -#include "IrrCompileConfig.h" static const char* const copyright = "Irrlicht Engine (c) 2002-2017 Nikolaus Gebhardt"; // put string in binary @@ -114,6 +113,26 @@ namespace core namespace video { SMaterial IdentityMaterial; + + extern "C" IRRLICHT_API bool IRRCALLCONV isDriverSupported(E_DRIVER_TYPE driver) + { + switch (driver) { + case EDT_NULL: return true; +#ifdef _IRR_COMPILE_WITH_OPENGL_ + case EDT_OPENGL: return true; +#endif +#ifdef _IRR_COMPILE_WITH_OGLES1_ + case EDT_OGLES1: return true; +#endif +#ifdef _IRR_COMPILE_WITH_OGLES2_ + case EDT_OGLES2: return true; +#endif +#ifdef _IRR_COMPILE_WITH_WEBGL1_ + case EDT_WEBGL1: return true; +#endif + default: return false; + } + } } } // end namespace irr diff --git a/source/Irrlicht/SB3DStructs.h b/source/Irrlicht/SB3DStructs.h index 8f88a85..ddd8bd6 100644 --- a/source/Irrlicht/SB3DStructs.h +++ b/source/Irrlicht/SB3DStructs.h @@ -6,7 +6,6 @@ // File format designed by Mark Sibly for the Blitz3D engine and has been // declared public domain -#include "IrrCompileConfig.h" #ifndef SB3DSTRUCTS_H #define SB3DSTRUCTS_H diff --git a/source/Irrlicht/os.cpp b/source/Irrlicht/os.cpp index 2b894bc..6b38657 100644 --- a/source/Irrlicht/os.cpp +++ b/source/Irrlicht/os.cpp @@ -4,7 +4,6 @@ #include "os.h" #include "irrString.h" -#include "IrrCompileConfig.h" #include "irrMath.h" #if defined(_IRR_COMPILE_WITH_SDL_DEVICE_) diff --git a/source/Irrlicht/os.h b/source/Irrlicht/os.h index 77012c2..c0aa83b 100644 --- a/source/Irrlicht/os.h +++ b/source/Irrlicht/os.h @@ -5,7 +5,6 @@ #ifndef __IRR_OS_H_INCLUDED__ #define __IRR_OS_H_INCLUDED__ -#include "IrrCompileConfig.h" // for endian check #include "irrTypes.h" #include "irrString.h" #include "path.h" From 21c61e99735045682e2b9b70180c9af5ca563b5c Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sat, 11 Mar 2023 15:12:05 +0100 Subject: [PATCH 8/8] Bump revision early --- CMakeLists.txt | 2 +- include/IrrCompileConfig.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a15d263..c289434 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ else() cmake_policy(VERSION 3.9) endif() -set(IRRLICHTMT_REVISION 10) +set(IRRLICHTMT_REVISION 11) project(Irrlicht VERSION 1.9.0.${IRRLICHTMT_REVISION} diff --git a/include/IrrCompileConfig.h b/include/IrrCompileConfig.h index 33361aa..da3a602 100644 --- a/include/IrrCompileConfig.h +++ b/include/IrrCompileConfig.h @@ -6,8 +6,8 @@ #define __IRR_COMPILE_CONFIG_H_INCLUDED__ //! Identifies the IrrlichtMt fork customized for the Minetest engine -#define IRRLICHT_VERSION_MT_REVISION 10 -#define IRRLICHT_VERSION_MT "mt10" +#define IRRLICHT_VERSION_MT_REVISION 11 +#define IRRLICHT_VERSION_MT "mt11" //! Irrlicht SDK Version #define IRRLICHT_VERSION_MAJOR 1