diff --git a/irr/include/EVideoTypes.h b/irr/include/EVideoTypes.h new file mode 100644 index 000000000..fe90f0652 --- /dev/null +++ b/irr/include/EVideoTypes.h @@ -0,0 +1,75 @@ +// Copyright (C) 2002-2012 Nikolaus Gebhardt +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#pragma once + +#include "SMaterial.h" // MATERIAL_MAX_TEXTURES + +namespace irr::video +{ + +//! enumeration for geometry transformation states +enum E_TRANSFORMATION_STATE +{ + //! View transformation + ETS_VIEW = 0, + //! World transformation + ETS_WORLD, + //! Projection transformation + ETS_PROJECTION, + //! Texture 0 transformation + //! Use E_TRANSFORMATION_STATE(ETS_TEXTURE_0 + texture_number) to access other texture transformations + ETS_TEXTURE_0, + //! Only used internally + ETS_COUNT = ETS_TEXTURE_0 + MATERIAL_MAX_TEXTURES +}; + +//! Special render targets, which usually map to dedicated hardware +/** These render targets (besides 0 and 1) need not be supported by gfx cards */ +enum E_RENDER_TARGET +{ + //! Render target is the main color frame buffer + ERT_FRAME_BUFFER = 0, + //! Render target is a render texture + ERT_RENDER_TEXTURE, + //! Multi-Render target textures + ERT_MULTI_RENDER_TEXTURES, + //! Render target is the main color frame buffer + ERT_STEREO_LEFT_BUFFER, + //! Render target is the right color buffer (left is the main buffer) + ERT_STEREO_RIGHT_BUFFER, + //! Render to both stereo buffers at once + ERT_STEREO_BOTH_BUFFERS, + //! Auxiliary buffer 0 + ERT_AUX_BUFFER0, + //! Auxiliary buffer 1 + ERT_AUX_BUFFER1, + //! Auxiliary buffer 2 + ERT_AUX_BUFFER2, + //! Auxiliary buffer 3 + ERT_AUX_BUFFER3, + //! Auxiliary buffer 4 + ERT_AUX_BUFFER4 +}; + +//! Enum for the flags of clear buffer +enum E_CLEAR_BUFFER_FLAG +{ + ECBF_NONE = 0, + ECBF_COLOR = 1, + ECBF_DEPTH = 2, + ECBF_STENCIL = 4, + ECBF_ALL = ECBF_COLOR | ECBF_DEPTH | ECBF_STENCIL +}; + +//! Enum for the types of fog distributions to choose from +enum E_FOG_TYPE +{ + EFT_FOG_EXP = 0, + EFT_FOG_LINEAR, + EFT_FOG_EXP2 +}; + +} // irr::video + diff --git a/irr/include/IVideoDriver.h b/irr/include/IVideoDriver.h index 7b15fdd1b..6d2182e8a 100644 --- a/irr/include/IVideoDriver.h +++ b/irr/include/IVideoDriver.h @@ -9,14 +9,16 @@ #include "ITexture.h" #include "irrArray.h" #include "matrix4.h" -#include "plane3d.h" #include "dimension2d.h" #include "position2d.h" -#include "IMeshBuffer.h" #include "EDriverTypes.h" #include "EDriverFeatures.h" +#include "EPrimitiveTypes.h" +#include "EVideoTypes.h" #include "SExposedVideoData.h" #include "SOverrideMaterial.h" +#include "S3DVertex.h" // E_VERTEX_TYPE +#include "SVertexIndex.h" // E_INDEX_TYPE namespace irr { @@ -36,77 +38,12 @@ class ISceneNode; namespace video { -struct S3DVertex; -struct S3DVertex2TCoords; -struct S3DVertexTangents; class IImageLoader; class IImageWriter; class IMaterialRenderer; class IGPUProgrammingServices; class IRenderTarget; -//! enumeration for geometry transformation states -enum E_TRANSFORMATION_STATE -{ - //! View transformation - ETS_VIEW = 0, - //! World transformation - ETS_WORLD, - //! Projection transformation - ETS_PROJECTION, - //! Texture 0 transformation - //! Use E_TRANSFORMATION_STATE(ETS_TEXTURE_0 + texture_number) to access other texture transformations - ETS_TEXTURE_0, - //! Only used internally - ETS_COUNT = ETS_TEXTURE_0 + MATERIAL_MAX_TEXTURES -}; - -//! Special render targets, which usually map to dedicated hardware -/** These render targets (besides 0 and 1) need not be supported by gfx cards */ -enum E_RENDER_TARGET -{ - //! Render target is the main color frame buffer - ERT_FRAME_BUFFER = 0, - //! Render target is a render texture - ERT_RENDER_TEXTURE, - //! Multi-Render target textures - ERT_MULTI_RENDER_TEXTURES, - //! Render target is the main color frame buffer - ERT_STEREO_LEFT_BUFFER, - //! Render target is the right color buffer (left is the main buffer) - ERT_STEREO_RIGHT_BUFFER, - //! Render to both stereo buffers at once - ERT_STEREO_BOTH_BUFFERS, - //! Auxiliary buffer 0 - ERT_AUX_BUFFER0, - //! Auxiliary buffer 1 - ERT_AUX_BUFFER1, - //! Auxiliary buffer 2 - ERT_AUX_BUFFER2, - //! Auxiliary buffer 3 - ERT_AUX_BUFFER3, - //! Auxiliary buffer 4 - ERT_AUX_BUFFER4 -}; - -//! Enum for the flags of clear buffer -enum E_CLEAR_BUFFER_FLAG -{ - ECBF_NONE = 0, - ECBF_COLOR = 1, - ECBF_DEPTH = 2, - ECBF_STENCIL = 4, - ECBF_ALL = ECBF_COLOR | ECBF_DEPTH | ECBF_STENCIL -}; - -//! Enum for the types of fog distributions to choose from -enum E_FOG_TYPE -{ - EFT_FOG_EXP = 0, - EFT_FOG_LINEAR, - EFT_FOG_EXP2 -}; - const c8 *const FogTypeNames[] = { "FogExp", "FogLinear", diff --git a/irr/include/IrrlichtDevice.h b/irr/include/IrrlichtDevice.h index 11619010c..777a23420 100644 --- a/irr/include/IrrlichtDevice.h +++ b/irr/include/IrrlichtDevice.h @@ -6,14 +6,16 @@ #include "IReferenceCounted.h" #include "dimension2d.h" -#include "IVideoDriver.h" #include "EDriverTypes.h" #include "EDeviceTypes.h" #include "IEventReceiver.h" #include "ICursorControl.h" #include "ITimer.h" #include "IOSOperator.h" +#include "irrArray.h" #include "IrrCompileConfig.h" +#include "position2d.h" +#include "SColor.h" // video::ECOLOR_FORMAT namespace irr { @@ -38,6 +40,9 @@ class ISceneManager; namespace video { class IContextManager; +class IImage; +class ITexture; +class IVideoDriver; extern "C" IRRLICHT_API bool IRRCALLCONV isDriverSupported(E_DRIVER_TYPE driver); } // end namespace video diff --git a/irr/include/SViewFrustum.h b/irr/include/SViewFrustum.h index 06983cc5e..cd898e032 100644 --- a/irr/include/SViewFrustum.h +++ b/irr/include/SViewFrustum.h @@ -9,7 +9,7 @@ #include "line3d.h" #include "aabbox3d.h" #include "matrix4.h" -#include "IVideoDriver.h" +#include "EVideoTypes.h" namespace irr { diff --git a/irr/src/CIrrDeviceLinux.cpp b/irr/src/CIrrDeviceLinux.cpp index 5e3afae36..6ecb499b2 100644 --- a/irr/src/CIrrDeviceLinux.cpp +++ b/irr/src/CIrrDeviceLinux.cpp @@ -26,6 +26,7 @@ #include "IGUISpriteBank.h" #include "IImageLoader.h" #include "IFileSystem.h" +#include "IVideoDriver.h" #include #include diff --git a/irr/src/CIrrDeviceSDL.cpp b/irr/src/CIrrDeviceSDL.cpp index 58fba4f25..14d996e47 100644 --- a/irr/src/CIrrDeviceSDL.cpp +++ b/irr/src/CIrrDeviceSDL.cpp @@ -10,6 +10,7 @@ #include "IGUIEnvironment.h" #include "IImageLoader.h" #include "IFileSystem.h" +#include "IVideoDriver.h" #include "os.h" #include "CTimer.h" #include "irrString.h" diff --git a/irr/src/CIrrDeviceStub.cpp b/irr/src/CIrrDeviceStub.cpp index 1ff120d10..fd8e458c8 100644 --- a/irr/src/CIrrDeviceStub.cpp +++ b/irr/src/CIrrDeviceStub.cpp @@ -8,6 +8,7 @@ #include "IFileSystem.h" #include "IGUIElement.h" #include "IGUIEnvironment.h" +#include "IVideoDriver.h" #include "os.h" #include "CTimer.h" #include "CLogger.h" diff --git a/irr/src/CIrrDeviceWin32.cpp b/irr/src/CIrrDeviceWin32.cpp index fe5293988..366be8013 100644 --- a/irr/src/CIrrDeviceWin32.cpp +++ b/irr/src/CIrrDeviceWin32.cpp @@ -17,6 +17,7 @@ #include "COSOperator.h" #include "dimension2d.h" #include "IGUISpriteBank.h" +#include "IVideoDriver.h" #include #include "SExposedVideoData.h" diff --git a/irr/src/CSceneCollisionManager.cpp b/irr/src/CSceneCollisionManager.cpp index 692f3c44f..77549a7dc 100644 --- a/irr/src/CSceneCollisionManager.cpp +++ b/irr/src/CSceneCollisionManager.cpp @@ -6,7 +6,6 @@ #include "ICameraSceneNode.h" #include "SViewFrustum.h" -#include "os.h" #include "irrMath.h" namespace irr diff --git a/src/client/camera.cpp b/src/client/camera.cpp index 5e724d05e..f13046848 100644 --- a/src/client/camera.cpp +++ b/src/client/camera.cpp @@ -38,6 +38,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "script/scripting_client.h" #include "gettext.h" #include +#include #define CAMERA_OFFSET_STEP 200 #define WIELDMESH_OFFSET_X 55.0f diff --git a/src/client/clientmap.cpp b/src/client/clientmap.cpp index cdad3146c..7d40dec92 100644 --- a/src/client/clientmap.cpp +++ b/src/client/clientmap.cpp @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "client/mesh.h" #include "mapblock_mesh.h" #include +#include #include #include "mapsector.h" #include "mapblock.h" @@ -192,6 +193,13 @@ void ClientMap::OnRegisterSceneNode() // we have other way to find it } +void ClientMap::render() +{ + video::IVideoDriver* driver = SceneManager->getVideoDriver(); + driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); + renderMap(driver, SceneManager->getSceneNodeRenderPass()); +} + void ClientMap::getBlocksInViewRange(v3s16 cam_pos_nodes, v3s16 *p_blocks_min, v3s16 *p_blocks_max, float range) { diff --git a/src/client/clientmap.h b/src/client/clientmap.h index 7456902c8..8fac5a471 100644 --- a/src/client/clientmap.h +++ b/src/client/clientmap.h @@ -75,12 +75,7 @@ public: virtual void OnRegisterSceneNode() override; - virtual void render() override - { - video::IVideoDriver* driver = SceneManager->getVideoDriver(); - driver->setTransform(video::ETS_WORLD, AbsoluteTransformation); - renderMap(driver, SceneManager->getSceneNodeRenderPass()); - } + virtual void render() override; virtual const aabb3f &getBoundingBox() const override { diff --git a/src/client/imagefilters.cpp b/src/client/imagefilters.cpp index db6523ad3..57e444151 100644 --- a/src/client/imagefilters.cpp +++ b/src/client/imagefilters.cpp @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include +#include // Simple 2D bitmap class with just the functionality needed here class Bitmap { diff --git a/src/client/render/anaglyph.cpp b/src/client/render/anaglyph.cpp index 4cb42db50..b1117998f 100644 --- a/src/client/render/anaglyph.cpp +++ b/src/client/render/anaglyph.cpp @@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "anaglyph.h" #include "client/camera.h" +#include /// SetColorMaskStep step diff --git a/src/client/render/core.h b/src/client/render/core.h index c5617bcb2..fb60b274e 100644 --- a/src/client/render/core.h +++ b/src/client/render/core.h @@ -21,6 +21,11 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #include "irrlichttypes_extrabloated.h" +namespace irr +{ + class IrrlichtDevice; +} + class ShadowRenderer; class Camera; class Client; diff --git a/src/client/render/pipeline.h b/src/client/render/pipeline.h index abb108652..d0e3b2c38 100644 --- a/src/client/render/pipeline.h +++ b/src/client/render/pipeline.h @@ -19,6 +19,8 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #include "irrlichttypes_extrabloated.h" +#include // used in all render/*.cpp +#include // used in all render/*.cpp #include #include @@ -31,6 +33,11 @@ class Client; class Hud; class ShadowRenderer; +namespace irr::video +{ + class IRenderTarget; +} + struct PipelineContext { PipelineContext(IrrlichtDevice *_device, Client *_client, Hud *_hud, ShadowRenderer *_shadow_renderer, video::SColor _color, v2u32 _target_size) diff --git a/src/client/renderingengine.h b/src/client/renderingengine.h index 1a2a63513..7f7518f61 100644 --- a/src/client/renderingengine.h +++ b/src/client/renderingengine.h @@ -29,6 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "client/render/core.h" // include the shadow mapper classes too #include "client/shadows/dynamicshadowsrender.h" +#include #ifdef SERVER #error Do not include in server builds diff --git a/src/client/shadows/dynamicshadows.cpp b/src/client/shadows/dynamicshadows.cpp index 11db9bea7..ffe7d4de5 100644 --- a/src/client/shadows/dynamicshadows.cpp +++ b/src/client/shadows/dynamicshadows.cpp @@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "client/clientenvironment.h" #include "client/clientmap.h" #include "client/camera.h" +#include using m4f = core::matrix4; diff --git a/src/client/shadows/dynamicshadowsrender.cpp b/src/client/shadows/dynamicshadowsrender.cpp index 91992bc08..cfa54dfb7 100644 --- a/src/client/shadows/dynamicshadowsrender.cpp +++ b/src/client/shadows/dynamicshadowsrender.cpp @@ -32,6 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "EShaderTypes.h" #include "IGPUProgrammingServices.h" #include "IMaterialRenderer.h" +#include ShadowRenderer::ShadowRenderer(IrrlichtDevice *device, Client *client) : m_smgr(device->getSceneManager()), m_driver(device->getVideoDriver()), diff --git a/src/client/shadows/dynamicshadowsrender.h b/src/client/shadows/dynamicshadowsrender.h index fc139e28b..c4ffb39e2 100644 --- a/src/client/shadows/dynamicshadowsrender.h +++ b/src/client/shadows/dynamicshadowsrender.h @@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include +#include #include "irrlichttypes_extrabloated.h" #include "client/shadows/dynamicshadows.h" diff --git a/src/client/shadows/shadowsScreenQuad.cpp b/src/client/shadows/shadowsScreenQuad.cpp index 5f6d38157..f0eb9ab4a 100644 --- a/src/client/shadows/shadowsScreenQuad.cpp +++ b/src/client/shadows/shadowsScreenQuad.cpp @@ -18,6 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "shadowsScreenQuad.h" +#include shadowScreenQuad::shadowScreenQuad() { diff --git a/src/gui/guiAnimatedImage.cpp b/src/gui/guiAnimatedImage.cpp index 5e14d2ef2..1c13531dc 100644 --- a/src/gui/guiAnimatedImage.cpp +++ b/src/gui/guiAnimatedImage.cpp @@ -6,6 +6,7 @@ #include "util/string.h" #include #include +#include GUIAnimatedImage::GUIAnimatedImage(gui::IGUIEnvironment *env, gui::IGUIElement *parent, s32 id, const core::rect &rectangle) : diff --git a/src/gui/guiBox.cpp b/src/gui/guiBox.cpp index 443f1064f..972eb4538 100644 --- a/src/gui/guiBox.cpp +++ b/src/gui/guiBox.cpp @@ -18,6 +18,7 @@ with this program; if not, write to the Free Software Foundation, Inc., */ #include "guiBox.h" +#include GUIBox::GUIBox(gui::IGUIEnvironment *env, gui::IGUIElement *parent, s32 id, const core::rect &rectangle, diff --git a/src/gui/guiFormSpecMenu.h b/src/gui/guiFormSpecMenu.h index 8c4fda32e..30045a168 100644 --- a/src/gui/guiFormSpecMenu.h +++ b/src/gui/guiFormSpecMenu.h @@ -37,6 +37,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "util/string.h" #include "util/enriched_string.h" #include "StyleSpec.h" +#include // gui::ECURSOR_ICON #include class InventoryManager; diff --git a/src/gui/guiInventoryList.cpp b/src/gui/guiInventoryList.cpp index 02505d436..e5ed6e6ef 100644 --- a/src/gui/guiInventoryList.cpp +++ b/src/gui/guiInventoryList.cpp @@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "guiFormSpecMenu.h" #include "client/hud.h" #include "client/client.h" +#include GUIInventoryList::GUIInventoryList(gui::IGUIEnvironment *env, gui::IGUIElement *parent, diff --git a/src/gui/guiKeyChangeMenu.cpp b/src/gui/guiKeyChangeMenu.cpp index 97e1ae8e0..08ae5987e 100644 --- a/src/gui/guiKeyChangeMenu.cpp +++ b/src/gui/guiKeyChangeMenu.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include "settings.h" #include diff --git a/src/gui/guiOpenURL.cpp b/src/gui/guiOpenURL.cpp index f91d31391..7ce79b0e5 100644 --- a/src/gui/guiOpenURL.cpp +++ b/src/gui/guiOpenURL.cpp @@ -20,6 +20,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "guiEditBoxWithScrollbar.h" #include #include +#include #include "client/renderingengine.h" #include "porting.h" #include "gettext.h" diff --git a/src/gui/guiPasswordChange.cpp b/src/gui/guiPasswordChange.cpp index 414ff36a8..a9b73dfe8 100644 --- a/src/gui/guiPasswordChange.cpp +++ b/src/gui/guiPasswordChange.cpp @@ -24,6 +24,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include +#include #include "porting.h" #include "gettext.h" diff --git a/src/gui/guiScene.cpp b/src/gui/guiScene.cpp index 239fbe015..a26cfa93f 100644 --- a/src/gui/guiScene.cpp +++ b/src/gui/guiScene.cpp @@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include +#include #include "porting.h" GUIScene::GUIScene(gui::IGUIEnvironment *env, scene::ISceneManager *smgr, diff --git a/src/gui/guiVolumeChange.cpp b/src/gui/guiVolumeChange.cpp index a6608dd18..4d1139dce 100644 --- a/src/gui/guiVolumeChange.cpp +++ b/src/gui/guiVolumeChange.cpp @@ -27,6 +27,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include #include +#include #include "settings.h" #include "gettext.h" diff --git a/src/gui/profilergraph.cpp b/src/gui/profilergraph.cpp index e6fdf9ae8..ab4796cb9 100644 --- a/src/gui/profilergraph.cpp +++ b/src/gui/profilergraph.cpp @@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "porting.h" #include "profilergraph.h" +#include "IVideoDriver.h" #include "util/string.h" void ProfilerGraph::put(const Profiler::GraphValues &values) diff --git a/src/gui/profilergraph.h b/src/gui/profilergraph.h index 6354ac9ef..c92cbf837 100644 --- a/src/gui/profilergraph.h +++ b/src/gui/profilergraph.h @@ -23,9 +23,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include -#include #include "profiler.h" +namespace irr::video { + class IVideoDriver; +} + /* Profiler display */ class ProfilerGraph { diff --git a/src/gui/touchcontrols.cpp b/src/gui/touchcontrols.cpp index b96ced1bf..1e4f8a99b 100644 --- a/src/gui/touchcontrols.cpp +++ b/src/gui/touchcontrols.cpp @@ -34,6 +34,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "gettext.h" #include "IGUIStaticText.h" #include "IGUIFont.h" +#include #include #include diff --git a/src/gui/touchcontrols.h b/src/gui/touchcontrols.h index ebc251bb6..0a86fe34e 100644 --- a/src/gui/touchcontrols.h +++ b/src/gui/touchcontrols.h @@ -25,7 +25,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include #include -#include #include #include @@ -35,6 +34,11 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "itemdef.h" #include "client/game.h" +namespace irr +{ + class IrrlichtDevice; +} + using namespace irr; using namespace irr::core; using namespace irr::gui; diff --git a/src/irrlichttypes_extrabloated.h b/src/irrlichttypes_extrabloated.h index b03ba7955..a3de2c3c8 100644 --- a/src/irrlichttypes_extrabloated.h +++ b/src/irrlichttypes_extrabloated.h @@ -24,7 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef SERVER #include #include -#include #include #include #include