From 61551cfc3a2212370366b526e90e520cea63baf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= <34514239+appgurueu@users.noreply.github.com> Date: Wed, 9 Jul 2025 10:35:52 +0200 Subject: [PATCH] Remove `irr` namespace (#16309) --- irr/include/CIndexBuffer.h | 3 - irr/include/CMeshBuffer.h | 5 +- irr/include/CVertexBuffer.h | 3 - irr/include/ECullingTypes.h | 3 - irr/include/EDebugSceneTypes.h | 3 - irr/include/EDeviceTypes.h | 5 - irr/include/EDriverFeatures.h | 3 - irr/include/EDriverTypes.h | 3 - irr/include/EFocusFlags.h | 3 - irr/include/EGUIAlignment.h | 3 - irr/include/EGUIElementTypes.h | 3 - irr/include/EHardwareBufferFlags.h | 3 - irr/include/EMaterialProps.h | 3 - irr/include/EMaterialTypes.h | 3 - irr/include/EPrimitiveTypes.h | 3 - irr/include/EReadFileType.h | 3 - irr/include/ESceneNodeTypes.h | 3 - irr/include/EVertexAttributes.h | 3 - irr/include/EVideoTypes.h | 4 +- irr/include/IAnimatedMesh.h | 5 +- irr/include/IAnimatedMeshSceneNode.h | 3 - irr/include/IBillboardSceneNode.h | 5 +- irr/include/IBoneSceneNode.h | 3 - irr/include/ICameraSceneNode.h | 3 - irr/include/IContextManager.h | 5 +- irr/include/ICursorControl.h | 3 - irr/include/IDummyTransformationSceneNode.h | 3 - irr/include/IEventReceiver.h | 14 +- irr/include/IFileArchive.h | 4 - irr/include/IFileList.h | 3 - irr/include/IFileSystem.h | 3 - irr/include/IGPUProgrammingServices.h | 4 - irr/include/IGUIButton.h | 4 - irr/include/IGUICheckBox.h | 3 - irr/include/IGUIComboBox.h | 3 - irr/include/IGUIEditBox.h | 7 +- irr/include/IGUIElement.h | 3 - irr/include/IGUIEnvironment.h | 3 - irr/include/IGUIFileOpenDialog.h | 3 - irr/include/IGUIFont.h | 3 - irr/include/IGUIFontBitmap.h | 3 - irr/include/IGUIImage.h | 3 - irr/include/IGUIImageList.h | 3 - irr/include/IGUIListBox.h | 3 - irr/include/IGUIScrollBar.h | 3 - irr/include/IGUISkin.h | 3 - irr/include/IGUISpriteBank.h | 4 - irr/include/IGUIStaticText.h | 3 - irr/include/IGUITabControl.h | 3 - irr/include/IGUIToolbar.h | 3 - irr/include/IImage.h | 3 - irr/include/IImageLoader.h | 3 - irr/include/IImageWriter.h | 3 - irr/include/IIndexBuffer.h | 4 - irr/include/ILogger.h | 5 - irr/include/IMaterialRenderer.h | 3 - irr/include/IMaterialRendererServices.h | 3 - irr/include/IMemoryReadFile.h | 3 - irr/include/IMesh.h | 3 - irr/include/IMeshBuffer.h | 3 - irr/include/IMeshCache.h | 4 - irr/include/IMeshLoader.h | 3 - irr/include/IMeshManipulator.h | 3 - irr/include/IMeshSceneNode.h | 3 - irr/include/IOSOperator.h | 5 - irr/include/IReadFile.h | 3 - irr/include/IReferenceCounted.h | 5 - irr/include/IRenderTarget.h | 3 - irr/include/ISceneCollisionManager.h | 4 - irr/include/ISceneManager.h | 3 - irr/include/ISceneNode.h | 7 +- irr/include/IShaderConstantSetCallBack.h | 3 - irr/include/ITexture.h | 3 - irr/include/ITimer.h | 5 - irr/include/IVertexBuffer.h | 3 - irr/include/IVideoDriver.h | 11 +- irr/include/IWriteFile.h | 3 - irr/include/IrrlichtDevice.h | 12 +- irr/include/Keycodes.h | 5 - irr/include/S3DVertex.h | 3 - irr/include/SColor.h | 3 - irr/include/SExposedVideoData.h | 3 - irr/include/SIrrCreationParameters.h | 6 +- irr/include/SMaterial.h | 13 +- irr/include/SMaterialLayer.h | 3 - irr/include/SMesh.h | 3 - irr/include/SOverrideMaterial.h | 3 - irr/include/SSkinMeshBuffer.h | 3 - irr/include/SVertexIndex.h | 3 - irr/include/SVertexManipulator.h | 3 - irr/include/SViewFrustum.h | 3 - irr/include/SkinnedMesh.h | 3 - irr/include/Transform.h | 3 - irr/include/aabbox3d.h | 3 - irr/include/coreutil.h | 3 - irr/include/dimension2d.h | 5 +- irr/include/fast_atof.h | 3 - irr/include/irrArray.h | 5 +- irr/include/irrMath.h | 11 +- irr/include/irrString.h | 3 - irr/include/irrTypes.h | 14 +- irr/include/irr_ptr.h | 6 +- irr/include/irrlicht.h | 5 +- irr/include/line2d.h | 5 +- irr/include/line3d.h | 3 - irr/include/matrix4.h | 3 - irr/include/mt_opengl.h | 2 +- irr/include/path.h | 3 - irr/include/plane3d.h | 3 - irr/include/position2d.h | 3 - irr/include/quaternion.h | 3 - irr/include/rect.h | 3 - irr/include/vector2d.h | 15 +- irr/include/vector3d.h | 7 +- irr/scripts/BindingGenerator.lua | 4 +- irr/src/BuiltInFont.h | 3 - irr/src/CAnimatedMeshSceneNode.cpp | 3 - irr/src/CAnimatedMeshSceneNode.h | 3 - irr/src/CB3DMeshFileLoader.cpp | 3 - irr/src/CB3DMeshFileLoader.h | 4 - irr/src/CBillboardSceneNode.cpp | 7 +- irr/src/CBillboardSceneNode.h | 7 +- irr/src/CBlit.h | 5 - irr/src/CBoneSceneNode.h | 3 - irr/src/CCameraSceneNode.cpp | 3 - irr/src/CCameraSceneNode.h | 3 - irr/src/CColorConverter.cpp | 3 - irr/src/CColorConverter.h | 3 - irr/src/CDummyTransformationSceneNode.cpp | 3 - irr/src/CDummyTransformationSceneNode.h | 3 - irr/src/CEGLManager.cpp | 5 +- irr/src/CEGLManager.h | 7 +- irr/src/CEmptySceneNode.cpp | 3 - irr/src/CEmptySceneNode.h | 3 - irr/src/CFPSCounter.cpp | 3 - irr/src/CFPSCounter.h | 3 - irr/src/CFileList.cpp | 3 - irr/src/CFileList.h | 3 - irr/src/CFileSystem.cpp | 3 - irr/src/CFileSystem.h | 3 - irr/src/CGLTFMeshFileLoader.cpp | 4 - irr/src/CGLTFMeshFileLoader.h | 5 - irr/src/CGLXManager.cpp | 3 - irr/src/CGLXManager.h | 3 - irr/src/CGUIButton.cpp | 5 +- irr/src/CGUIButton.h | 3 - irr/src/CGUICheckBox.cpp | 3 - irr/src/CGUICheckBox.h | 3 - irr/src/CGUIComboBox.cpp | 3 - irr/src/CGUIComboBox.h | 3 - irr/src/CGUIEditBox.cpp | 21 +- irr/src/CGUIEditBox.h | 9 +- irr/src/CGUIEnvironment.cpp | 3 - irr/src/CGUIEnvironment.h | 4 - irr/src/CGUIFileOpenDialog.cpp | 9 +- irr/src/CGUIFileOpenDialog.h | 9 +- irr/src/CGUIFont.cpp | 3 - irr/src/CGUIFont.h | 4 - irr/src/CGUIImage.cpp | 3 - irr/src/CGUIImage.h | 3 - irr/src/CGUIImageList.cpp | 3 - irr/src/CGUIImageList.h | 3 - irr/src/CGUIListBox.cpp | 3 - irr/src/CGUIListBox.h | 3 - irr/src/CGUIScrollBar.cpp | 3 - irr/src/CGUIScrollBar.h | 3 - irr/src/CGUISkin.cpp | 3 - irr/src/CGUISkin.h | 3 - irr/src/CGUISpriteBank.cpp | 5 +- irr/src/CGUISpriteBank.h | 4 - irr/src/CGUIStaticText.cpp | 5 +- irr/src/CGUIStaticText.h | 3 - irr/src/CGUITabControl.cpp | 3 - irr/src/CGUITabControl.h | 3 - irr/src/CImage.cpp | 5 +- irr/src/CImage.h | 3 - irr/src/CImageLoaderJPG.cpp | 3 - irr/src/CImageLoaderJPG.h | 3 - irr/src/CImageLoaderPNG.cpp | 3 - irr/src/CImageLoaderPNG.h | 3 - irr/src/CImageLoaderTGA.cpp | 9 +- irr/src/CImageLoaderTGA.h | 3 - irr/src/CImageWriterJPG.cpp | 6 - irr/src/CImageWriterJPG.h | 3 - irr/src/CImageWriterPNG.cpp | 3 - irr/src/CImageWriterPNG.h | 3 - irr/src/CIrrDeviceLinux.cpp | 74 +++-- irr/src/CIrrDeviceLinux.h | 13 +- irr/src/CIrrDeviceOSX.h | 13 +- irr/src/CIrrDeviceOSX.mm | 326 ++++++++++---------- irr/src/CIrrDeviceSDL.cpp | 80 +++-- irr/src/CIrrDeviceSDL.h | 5 - irr/src/CIrrDeviceStub.cpp | 6 +- irr/src/CIrrDeviceStub.h | 6 +- irr/src/CIrrDeviceWin32.cpp | 114 ++++--- irr/src/CIrrDeviceWin32.h | 8 +- irr/src/CLimitReadFile.cpp | 3 - irr/src/CLimitReadFile.h | 3 - irr/src/CLogger.cpp | 5 - irr/src/CLogger.h | 5 - irr/src/CMemoryFile.cpp | 3 - irr/src/CMemoryFile.h | 4 - irr/src/CMeshCache.cpp | 3 - irr/src/CMeshCache.h | 4 - irr/src/CMeshManipulator.cpp | 3 - irr/src/CMeshManipulator.h | 3 - irr/src/CMeshSceneNode.cpp | 3 - irr/src/CMeshSceneNode.h | 3 - irr/src/CNSOGLManager.h | 3 - irr/src/CNSOGLManager.mm | 3 - irr/src/CNullDriver.cpp | 11 +- irr/src/CNullDriver.h | 9 +- irr/src/COBJMeshFileLoader.cpp | 17 +- irr/src/COBJMeshFileLoader.h | 3 - irr/src/COGLESCoreExtensionHandler.h | 3 - irr/src/COSOperator.cpp | 5 - irr/src/COSOperator.h | 5 - irr/src/COpenGLCacheHandler.cpp | 3 - irr/src/COpenGLCacheHandler.h | 3 - irr/src/COpenGLCommon.h | 3 - irr/src/COpenGLCoreCacheHandler.h | 9 +- irr/src/COpenGLCoreFeature.h | 3 - irr/src/COpenGLCoreRenderTarget.h | 3 - irr/src/COpenGLCoreTexture.h | 3 - irr/src/COpenGLDriver.cpp | 7 +- irr/src/COpenGLDriver.h | 11 +- irr/src/COpenGLExtensionHandler.cpp | 3 - irr/src/COpenGLExtensionHandler.h | 4 - irr/src/COpenGLMaterialRenderer.h | 3 - irr/src/COpenGLSLMaterialRenderer.cpp | 3 - irr/src/COpenGLSLMaterialRenderer.h | 3 - irr/src/CReadFile.cpp | 3 - irr/src/CReadFile.h | 4 - irr/src/CSDLManager.cpp | 3 - irr/src/CSDLManager.h | 3 - irr/src/CSceneCollisionManager.cpp | 3 - irr/src/CSceneCollisionManager.h | 3 - irr/src/CSceneManager.cpp | 3 - irr/src/CSceneManager.h | 3 - irr/src/CTimer.h | 4 - irr/src/CWGLManager.cpp | 3 - irr/src/CWGLManager.h | 3 - irr/src/CWriteFile.cpp | 3 - irr/src/CWriteFile.h | 4 - irr/src/CXMeshFileLoader.cpp | 5 +- irr/src/CXMeshFileLoader.h | 3 - irr/src/CZipReader.cpp | 3 - irr/src/CZipReader.h | 3 - irr/src/Irrlicht.cpp | 4 - irr/src/OpenGL/Common.h | 3 - irr/src/OpenGL/Driver.cpp | 11 +- irr/src/OpenGL/Driver.h | 11 +- irr/src/OpenGL/ExtensionHandler.cpp | 3 - irr/src/OpenGL/ExtensionHandler.h | 3 - irr/src/OpenGL/FixedPipelineRenderer.cpp | 3 - irr/src/OpenGL/FixedPipelineRenderer.h | 3 - irr/src/OpenGL/MaterialRenderer.cpp | 3 - irr/src/OpenGL/MaterialRenderer.h | 3 - irr/src/OpenGL/Renderer2D.cpp | 3 - irr/src/OpenGL/Renderer2D.h | 3 - irr/src/OpenGL/VBO.cpp | 3 - irr/src/OpenGL/VBO.h | 3 - irr/src/OpenGL3/DriverGL3.cpp | 3 - irr/src/OpenGL3/DriverGL3.h | 3 - irr/src/OpenGLES2/DriverGLES2.cpp | 3 - irr/src/OpenGLES2/DriverGLES2.h | 3 - irr/src/SB3DStructs.h | 3 - irr/src/SkinnedMesh.cpp | 3 - irr/src/SoftwareDriver2_helper.h | 5 - irr/src/mt_opengl_loader.cpp | 2 +- irr/src/os.cpp | 12 - irr/src/os.h | 4 - lib/catch2/catch_amalgamated.hpp | 2 - lib/lua/src/lapi.c | 1 - lib/lua/src/lbaselib.c | 1 - lib/lua/src/ldblib.c | 1 - lib/lua/src/ldebug.c | 1 - lib/lua/src/ldo.c | 1 - lib/lua/src/lfunc.c | 1 - lib/lua/src/liolib.c | 1 - lib/lua/src/llex.c | 1 - lib/lua/src/lmem.c | 1 - lib/lua/src/lobject.c | 1 - lib/lua/src/lparser.c | 1 - lib/lua/src/lstate.h | 1 - lib/lua/src/lstring.c | 1 - lib/lua/src/ltm.c | 1 - lib/lua/src/lua.c | 1 - lib/lua/src/lvm.c | 1 - src/chat.h | 2 +- src/client/camera.cpp | 10 +- src/client/camera.h | 2 +- src/client/clientlauncher.cpp | 4 +- src/client/clientmap.h | 4 +- src/client/clientobject.h | 2 +- src/client/clouds.h | 2 +- src/client/content_cao.h | 2 +- src/client/content_cso.h | 2 +- src/client/fontengine.cpp | 6 +- src/client/fontengine.h | 16 +- src/client/game.cpp | 8 +- src/client/gameui.h | 2 +- src/client/guiscalingfilter.h | 2 +- src/client/hud.cpp | 6 +- src/client/hud.h | 4 +- src/client/imagefilters.h | 2 +- src/client/imagesource.h | 1 - src/client/inputhandler.cpp | 10 +- src/client/item_visuals_manager.h | 2 +- src/client/joystick_controller.cpp | 8 +- src/client/joystick_controller.h | 10 +- src/client/keycode.cpp | 34 +- src/client/keycode.h | 14 +- src/client/mapblock_mesh.cpp | 2 +- src/client/mapblock_mesh.h | 2 +- src/client/mesh.h | 11 +- src/client/minimap.cpp | 2 +- src/client/minimap.h | 16 +- src/client/particles.h | 2 +- src/client/render/core.h | 5 +- src/client/render/pipeline.h | 2 +- src/client/renderingengine.cpp | 12 +- src/client/renderingengine.h | 12 +- src/client/shader.h | 2 +- src/client/sky.cpp | 4 +- src/client/sky.h | 2 +- src/client/texturesource.h | 2 +- src/client/wieldmesh.h | 4 +- src/filesys.h | 4 +- src/gamedef.h | 2 +- src/gui/StyleSpec.h | 24 +- src/gui/guiAnimatedImage.h | 1 - src/gui/guiBackgroundImage.h | 1 - src/gui/guiBox.h | 1 - src/gui/guiButton.cpp | 6 +- src/gui/guiButton.h | 1 - src/gui/guiButtonImage.cpp | 2 +- src/gui/guiButtonImage.h | 1 - src/gui/guiButtonItemImage.cpp | 2 +- src/gui/guiButtonItemImage.h | 1 - src/gui/guiButtonKey.cpp | 2 +- src/gui/guiButtonKey.h | 1 - src/gui/guiChatConsole.cpp | 4 +- src/gui/guiEditBox.cpp | 4 +- src/gui/guiEditBox.h | 4 +- src/gui/guiEditBoxWithScrollbar.cpp | 12 +- src/gui/guiEditBoxWithScrollbar.h | 4 +- src/gui/guiEngine.cpp | 2 +- src/gui/guiEngine.h | 2 +- src/gui/guiFormSpecMenu.cpp | 16 +- src/gui/guiFormSpecMenu.h | 12 +- src/gui/guiHyperText.cpp | 16 +- src/gui/guiHyperText.h | 7 +- src/gui/guiInventoryList.h | 1 - src/gui/guiItemImage.h | 1 - src/gui/guiPasswordChange.cpp | 2 +- src/gui/guiPathSelectMenu.cpp | 2 +- src/gui/guiScene.h | 1 - src/gui/guiScrollBar.h | 2 +- src/gui/mainmenumanager.h | 2 +- src/gui/modalMenu.cpp | 2 +- src/gui/profilergraph.h | 2 +- src/gui/touchcontrols.h | 26 +- src/gui/touchscreeneditor.h | 2 +- src/gui/touchscreenlayout.h | 4 +- src/irr_gui_ptr.h | 2 +- src/irrlicht_changes/CGUITTFont.cpp | 4 +- src/irrlicht_changes/CGUITTFont.h | 5 +- src/irrlicht_changes/printing.h | 2 +- src/irrlicht_changes/static_text.cpp | 8 +- src/irrlicht_changes/static_text.h | 27 +- src/irrlichttypes.h | 1 - src/lighting.h | 1 - src/skyparams.h | 1 - src/unittest/test_irr_gltf_mesh_loader.cpp | 64 ++-- src/unittest/test_irr_x_mesh_loader.cpp | 6 +- src/unittest/test_keycode.cpp | 20 +- src/unittest/test_utilities.cpp | 2 +- src/util/enriched_string.cpp | 6 +- src/util/enriched_string.h | 1 - src/util/string.h | 10 +- 381 files changed, 680 insertions(+), 1632 deletions(-) diff --git a/irr/include/CIndexBuffer.h b/irr/include/CIndexBuffer.h index ba85d49e6..85d127004 100644 --- a/irr/include/CIndexBuffer.h +++ b/irr/include/CIndexBuffer.h @@ -14,8 +14,6 @@ #include "../src/os.h" #endif -namespace irr -{ namespace scene { //! Template implementation of the IIndexBuffer interface @@ -95,4 +93,3 @@ public: typedef CIndexBuffer SIndexBuffer; } // end namespace scene -} // end namespace irr diff --git a/irr/include/CMeshBuffer.h b/irr/include/CMeshBuffer.h index b5ed6d2ef..df8b45ed3 100644 --- a/irr/include/CMeshBuffer.h +++ b/irr/include/CMeshBuffer.h @@ -9,8 +9,6 @@ #include "CVertexBuffer.h" #include "CIndexBuffer.h" -namespace irr -{ namespace scene { //! Template implementation of the IMeshBuffer interface @@ -87,7 +85,7 @@ public: { if (Vertices->getCount()) { BoundingBox.reset(Vertices->getPosition(0)); - const irr::u32 vsize = Vertices->getCount(); + const u32 vsize = Vertices->getCount(); for (u32 i = 1; i < vsize; ++i) BoundingBox.addInternalPoint(Vertices->getPosition(i)); } else @@ -146,4 +144,3 @@ typedef CMeshBuffer SMeshBufferLightMap; //! Meshbuffer with vertices having tangents stored, e.g. for normal mapping typedef CMeshBuffer SMeshBufferTangents; } // end namespace scene -} // end namespace irr diff --git a/irr/include/CVertexBuffer.h b/irr/include/CVertexBuffer.h index 1bface16c..f515f6c31 100644 --- a/irr/include/CVertexBuffer.h +++ b/irr/include/CVertexBuffer.h @@ -14,8 +14,6 @@ #include "../src/os.h" #endif -namespace irr -{ namespace scene { //! Template implementation of the IVertexBuffer interface @@ -128,4 +126,3 @@ typedef CVertexBuffer SVertexBufferLightMap; typedef CVertexBuffer SVertexBufferTangents; } // end namespace scene -} // end namespace irr diff --git a/irr/include/ECullingTypes.h b/irr/include/ECullingTypes.h index 95979bef4..6dac99700 100644 --- a/irr/include/ECullingTypes.h +++ b/irr/include/ECullingTypes.h @@ -6,8 +6,6 @@ #include "irrTypes.h" -namespace irr -{ namespace scene { @@ -32,4 +30,3 @@ const c8 *const AutomaticCullingNames[] = { }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/EDebugSceneTypes.h b/irr/include/EDebugSceneTypes.h index 2994eca6c..0df5f3d5c 100644 --- a/irr/include/EDebugSceneTypes.h +++ b/irr/include/EDebugSceneTypes.h @@ -4,8 +4,6 @@ #pragma once -namespace irr -{ namespace scene { @@ -38,4 +36,3 @@ enum E_DEBUG_SCENE_TYPE }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/EDeviceTypes.h b/irr/include/EDeviceTypes.h index 1eff4f615..c9188a1f2 100644 --- a/irr/include/EDeviceTypes.h +++ b/irr/include/EDeviceTypes.h @@ -4,9 +4,6 @@ #pragma once -namespace irr -{ - //! An enum for the different device types supported by the Irrlicht Engine. enum E_DEVICE_TYPE { @@ -42,5 +39,3 @@ enum E_DEVICE_TYPE May support hw-acceleration via OpenGL-ES */ EIDT_ANDROID, }; - -} // end namespace irr diff --git a/irr/include/EDriverFeatures.h b/irr/include/EDriverFeatures.h index c1fcd464d..47176c6df 100644 --- a/irr/include/EDriverFeatures.h +++ b/irr/include/EDriverFeatures.h @@ -4,8 +4,6 @@ #pragma once -namespace irr -{ namespace video { @@ -140,4 +138,3 @@ enum E_VIDEO_DRIVER_FEATURE }; } // end namespace video -} // end namespace irr diff --git a/irr/include/EDriverTypes.h b/irr/include/EDriverTypes.h index 20c684d4c..79fdeaabd 100644 --- a/irr/include/EDriverTypes.h +++ b/irr/include/EDriverTypes.h @@ -4,8 +4,6 @@ #pragma once -namespace irr -{ namespace video { @@ -36,4 +34,3 @@ enum E_DRIVER_TYPE }; } // end namespace video -} // end namespace irr diff --git a/irr/include/EFocusFlags.h b/irr/include/EFocusFlags.h index 2c229472d..7f68f0154 100644 --- a/irr/include/EFocusFlags.h +++ b/irr/include/EFocusFlags.h @@ -3,8 +3,6 @@ #pragma once -namespace irr -{ namespace gui { @@ -31,4 +29,3 @@ enum EFOCUS_FLAG }; } // namespace gui -} // namespace irr diff --git a/irr/include/EGUIAlignment.h b/irr/include/EGUIAlignment.h index 80be1c189..d7ef77430 100644 --- a/irr/include/EGUIAlignment.h +++ b/irr/include/EGUIAlignment.h @@ -6,8 +6,6 @@ #include "irrTypes.h" -namespace irr -{ namespace gui { enum EGUI_ALIGNMENT @@ -32,4 +30,3 @@ const c8 *const GUIAlignmentNames[] = { }; } // namespace gui -} // namespace irr diff --git a/irr/include/EGUIElementTypes.h b/irr/include/EGUIElementTypes.h index d5c5d94ce..8353b7927 100644 --- a/irr/include/EGUIElementTypes.h +++ b/irr/include/EGUIElementTypes.h @@ -6,8 +6,6 @@ #include "irrTypes.h" -namespace irr -{ namespace gui { @@ -72,4 +70,3 @@ enum EGUI_ELEMENT_TYPE }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/EHardwareBufferFlags.h b/irr/include/EHardwareBufferFlags.h index ae1b602e3..8e78dbcfa 100644 --- a/irr/include/EHardwareBufferFlags.h +++ b/irr/include/EHardwareBufferFlags.h @@ -4,8 +4,6 @@ #pragma once -namespace irr -{ namespace scene { @@ -37,4 +35,3 @@ enum E_BUFFER_TYPE }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/EMaterialProps.h b/irr/include/EMaterialProps.h index 765084340..7fa94d581 100644 --- a/irr/include/EMaterialProps.h +++ b/irr/include/EMaterialProps.h @@ -4,8 +4,6 @@ #pragma once -namespace irr -{ namespace video { @@ -67,4 +65,3 @@ enum E_MATERIAL_PROP }; } // end namespace video -} // end namespace irr diff --git a/irr/include/EMaterialTypes.h b/irr/include/EMaterialTypes.h index cac8233fe..424fce1e4 100644 --- a/irr/include/EMaterialTypes.h +++ b/irr/include/EMaterialTypes.h @@ -6,8 +6,6 @@ #include "irrTypes.h" -namespace irr -{ namespace video { @@ -71,4 +69,3 @@ constexpr u32 numBuiltInMaterials = sizeof(sBuiltInMaterialTypeNames) / sizeof(char *) - 1; } // end namespace video -} // end namespace irr diff --git a/irr/include/EPrimitiveTypes.h b/irr/include/EPrimitiveTypes.h index d4e5f73f4..2e5feb678 100644 --- a/irr/include/EPrimitiveTypes.h +++ b/irr/include/EPrimitiveTypes.h @@ -4,8 +4,6 @@ #pragma once -namespace irr -{ namespace scene { @@ -40,4 +38,3 @@ enum E_PRIMITIVE_TYPE }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/EReadFileType.h b/irr/include/EReadFileType.h index 2241b70bf..cb4f97bf3 100644 --- a/irr/include/EReadFileType.h +++ b/irr/include/EReadFileType.h @@ -6,8 +6,6 @@ #include "irrTypes.h" -namespace irr -{ namespace io { @@ -27,4 +25,3 @@ enum EREAD_FILE_TYPE EFIT_UNKNOWN = MAKE_IRR_ID('u', 'n', 'k', 'n') }; } // end namespace io -} // end namespace irr diff --git a/irr/include/ESceneNodeTypes.h b/irr/include/ESceneNodeTypes.h index b8251d965..8f9a6e7e0 100644 --- a/irr/include/ESceneNodeTypes.h +++ b/irr/include/ESceneNodeTypes.h @@ -6,8 +6,6 @@ #include "irrTypes.h" -namespace irr -{ namespace scene { @@ -46,4 +44,3 @@ enum ESCENE_NODE_TYPE }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/EVertexAttributes.h b/irr/include/EVertexAttributes.h index 75d039fec..2c6eac2cd 100644 --- a/irr/include/EVertexAttributes.h +++ b/irr/include/EVertexAttributes.h @@ -1,7 +1,5 @@ #pragma once -namespace irr -{ namespace video { @@ -31,4 +29,3 @@ const char *const sBuiltInVertexAttributeNames[] = { }; } // end namespace video -} // end namespace irr diff --git a/irr/include/EVideoTypes.h b/irr/include/EVideoTypes.h index fe90f0652..4071fe9b4 100644 --- a/irr/include/EVideoTypes.h +++ b/irr/include/EVideoTypes.h @@ -6,7 +6,7 @@ #include "SMaterial.h" // MATERIAL_MAX_TEXTURES -namespace irr::video +namespace video { //! enumeration for geometry transformation states @@ -71,5 +71,5 @@ enum E_FOG_TYPE EFT_FOG_EXP2 }; -} // irr::video +} // end namespace video diff --git a/irr/include/IAnimatedMesh.h b/irr/include/IAnimatedMesh.h index 0ef0971bd..36bf97dd6 100644 --- a/irr/include/IAnimatedMesh.h +++ b/irr/include/IAnimatedMesh.h @@ -6,14 +6,12 @@ #include "IMesh.h" -namespace irr -{ namespace scene { //! Interface for an animated mesh. /** There are already simple implementations of this interface available so you don't have to implement this interface on your own if you need to: -You might want to use irr::scene::SMesh, irr::scene::SMeshBuffer etc. +You might want to use scene::SMesh, scene::SMeshBuffer etc. */ class IAnimatedMesh : public IMesh { @@ -39,4 +37,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/IAnimatedMeshSceneNode.h b/irr/include/IAnimatedMeshSceneNode.h index 2df8da917..908516d30 100644 --- a/irr/include/IAnimatedMeshSceneNode.h +++ b/irr/include/IAnimatedMeshSceneNode.h @@ -8,8 +8,6 @@ #include "IBoneSceneNode.h" #include "IAnimatedMesh.h" -namespace irr -{ namespace scene { class IAnimatedMeshSceneNode; @@ -133,4 +131,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/IBillboardSceneNode.h b/irr/include/IBillboardSceneNode.h index 3e7026ac3..3a59e17aa 100644 --- a/irr/include/IBillboardSceneNode.h +++ b/irr/include/IBillboardSceneNode.h @@ -6,8 +6,6 @@ #include "ISceneNode.h" -namespace irr -{ namespace scene { class ICameraSceneNode; @@ -72,7 +70,7 @@ public: So we don't know the real boundingboxes before that. Which would be too late for culling. That is why the usual getBoundingBox will return a "safe" boundingbox which is guaranteed to contain the billboard. While this function can return the real one. */ - virtual const core::aabbox3d &getTransformedBillboardBoundingBox(const irr::scene::ICameraSceneNode *camera) = 0; + virtual const core::aabbox3d &getTransformedBillboardBoundingBox(const scene::ICameraSceneNode *camera) = 0; //! Get the amount of mesh buffers. /** \return Amount of mesh buffers (IMeshBuffer) in this mesh. */ @@ -87,4 +85,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/IBoneSceneNode.h b/irr/include/IBoneSceneNode.h index d169b8d30..6ead34636 100644 --- a/irr/include/IBoneSceneNode.h +++ b/irr/include/IBoneSceneNode.h @@ -6,8 +6,6 @@ #include "ISceneNode.h" -namespace irr -{ namespace scene { @@ -49,4 +47,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/ICameraSceneNode.h b/irr/include/ICameraSceneNode.h index a7c72428d..165c37fc4 100644 --- a/irr/include/ICameraSceneNode.h +++ b/irr/include/ICameraSceneNode.h @@ -7,8 +7,6 @@ #include "ISceneNode.h" #include "IEventReceiver.h" -namespace irr -{ namespace scene { struct SViewFrustum; @@ -181,4 +179,3 @@ protected: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/IContextManager.h b/irr/include/IContextManager.h index 85177dc43..56f15f7bd 100644 --- a/irr/include/IContextManager.h +++ b/irr/include/IContextManager.h @@ -8,8 +8,6 @@ #include "SIrrCreationParameters.h" #include -namespace irr -{ namespace video { // For system specific window contexts (used for OpenGL) @@ -43,7 +41,7 @@ public: /** This is mostly used internally by IVideoDriver::beginScene(). But if you want to switch threads which access your OpenGL driver you will have to call this function as follows: - Old thread gives up context with: activateContext(irr::video::SExposedVideoData()); + Old thread gives up context with: activateContext(video::SExposedVideoData()); New thread takes over context with: activateContext(videoDriver->getExposedVideoData()); Note that only 1 thread at a time may access an OpenGL context. */ virtual bool activateContext(const SExposedVideoData &videoData, bool restorePrimaryOnZero = false) = 0; @@ -56,4 +54,3 @@ public: }; } // end namespace video -} // end namespace irr diff --git a/irr/include/ICursorControl.h b/irr/include/ICursorControl.h index 65b8efb7e..dab6d6554 100644 --- a/irr/include/ICursorControl.h +++ b/irr/include/ICursorControl.h @@ -8,8 +8,6 @@ #include "position2d.h" #include "rect.h" -namespace irr -{ namespace gui { @@ -192,4 +190,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IDummyTransformationSceneNode.h b/irr/include/IDummyTransformationSceneNode.h index 88bc37c78..efe0eee0a 100644 --- a/irr/include/IDummyTransformationSceneNode.h +++ b/irr/include/IDummyTransformationSceneNode.h @@ -6,8 +6,6 @@ #include "ISceneNode.h" -namespace irr -{ namespace scene { @@ -33,4 +31,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/IEventReceiver.h b/irr/include/IEventReceiver.h index 332b23158..dc37aa766 100644 --- a/irr/include/IEventReceiver.h +++ b/irr/include/IEventReceiver.h @@ -8,8 +8,6 @@ #include "Keycodes.h" #include "irrString.h" -namespace irr -{ //! Enumeration for all event types there are. enum EEVENT_TYPE { @@ -297,7 +295,7 @@ enum EGUI_EVENT_TYPE }; } // end namespace gui -//! SEvents hold information about an event. See irr::IEventReceiver for details on event handling. +//! SEvents hold information about an event. See IEventReceiver for details on event handling. struct SEvent { //! Any kind of GUI event. @@ -444,7 +442,7 @@ 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, and @ref irr::IrrlichtDevice::activateJoysticks() has been + * active device, and @ref 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. */ @@ -553,7 +551,7 @@ struct SEvent /** Many of the engine's classes inherit IEventReceiver so they are able to process events. Events usually start at a postEventFromUser function and are passed down through a chain of event receivers until OnEvent returns true. See -irr::EEVENT_TYPE for a description of where each type of event starts, and the +EEVENT_TYPE for a description of where each type of event starts, and the path it takes through the system. */ class IEventReceiver { @@ -570,13 +568,13 @@ public: virtual bool OnEvent(const SEvent &event) = 0; }; -//! Information on a joystick, returned from @ref irr::IrrlichtDevice::activateJoysticks() +//! Information on a joystick, returned from @ref IrrlichtDevice::activateJoysticks() struct SJoystickInfo { //! The ID of the joystick /** This is an internal Irrlicht index; it does not map directly * to any particular hardware joystick. It corresponds to the - * irr::SJoystickEvent Joystick ID. */ + * SJoystickEvent Joystick ID. */ u8 Joystick; //! The name that the joystick uses to identify itself. @@ -605,5 +603,3 @@ struct SJoystickInfo POV_HAT_UNKNOWN } PovHat; }; // struct SJoystickInfo - -} // end namespace irr diff --git a/irr/include/IFileArchive.h b/irr/include/IFileArchive.h index 5f505ae91..f9e0a4c1f 100644 --- a/irr/include/IFileArchive.h +++ b/irr/include/IFileArchive.h @@ -7,9 +7,6 @@ #include "IReadFile.h" #include "IFileList.h" -namespace irr -{ - namespace io { @@ -111,4 +108,3 @@ public: }; } // end namespace io -} // end namespace irr diff --git a/irr/include/IFileList.h b/irr/include/IFileList.h index f33b1628f..bd35e17e0 100644 --- a/irr/include/IFileList.h +++ b/irr/include/IFileList.h @@ -7,8 +7,6 @@ #include "IReferenceCounted.h" #include "path.h" -namespace irr -{ namespace io { @@ -85,5 +83,4 @@ public: virtual void sort() = 0; }; -} // end namespace irr } // end namespace io diff --git a/irr/include/IFileSystem.h b/irr/include/IFileSystem.h index 30cace199..2c7854ad7 100644 --- a/irr/include/IFileSystem.h +++ b/irr/include/IFileSystem.h @@ -7,8 +7,6 @@ #include "IReferenceCounted.h" #include "IFileArchive.h" -namespace irr -{ namespace video { class IVideoDriver; @@ -154,4 +152,3 @@ public: }; } // end namespace io -} // end namespace irr diff --git a/irr/include/IGPUProgrammingServices.h b/irr/include/IGPUProgrammingServices.h index ccd134209..5c64d602d 100644 --- a/irr/include/IGPUProgrammingServices.h +++ b/irr/include/IGPUProgrammingServices.h @@ -8,9 +8,6 @@ #include "EPrimitiveTypes.h" #include "path.h" -namespace irr -{ - namespace io { class IReadFile; @@ -141,4 +138,3 @@ public: }; } // end namespace video -} // end namespace irr diff --git a/irr/include/IGUIButton.h b/irr/include/IGUIButton.h index fdee609d9..edaca1183 100644 --- a/irr/include/IGUIButton.h +++ b/irr/include/IGUIButton.h @@ -7,9 +7,6 @@ #include "IGUIElement.h" #include "SColor.h" -namespace irr -{ - namespace video { class ITexture; @@ -254,4 +251,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUICheckBox.h b/irr/include/IGUICheckBox.h index 0e71510b8..59042834b 100644 --- a/irr/include/IGUICheckBox.h +++ b/irr/include/IGUICheckBox.h @@ -6,8 +6,6 @@ #include "IGUIElement.h" -namespace irr -{ namespace gui { @@ -44,4 +42,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUIComboBox.h b/irr/include/IGUIComboBox.h index deeaad2b5..c2ff12afb 100644 --- a/irr/include/IGUIComboBox.h +++ b/irr/include/IGUIComboBox.h @@ -6,8 +6,6 @@ #include "IGUIElement.h" -namespace irr -{ namespace gui { @@ -69,4 +67,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUIEditBox.h b/irr/include/IGUIEditBox.h index c63a905db..b480dfce1 100644 --- a/irr/include/IGUIEditBox.h +++ b/irr/include/IGUIEditBox.h @@ -7,8 +7,6 @@ #include "IGUIElement.h" #include "SColor.h" -namespace irr -{ namespace gui { class IGUIFont; @@ -141,11 +139,10 @@ public: //! Set the blinktime for the cursor. 2x blinktime is one full cycle. //** \param timeMs Blinktime in milliseconds. When set to 0 the cursor is constantly on without blinking */ - virtual void setCursorBlinkTime(irr::u32 timeMs) = 0; + virtual void setCursorBlinkTime(u32 timeMs) = 0; //! Get the cursor blinktime - virtual irr::u32 getCursorBlinkTime() const = 0; + virtual u32 getCursorBlinkTime() const = 0; }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUIElement.h b/irr/include/IGUIElement.h index d90f88bf3..a47345804 100644 --- a/irr/include/IGUIElement.h +++ b/irr/include/IGUIElement.h @@ -14,8 +14,6 @@ #include #include -namespace irr -{ namespace gui { class IGUIEnvironment; @@ -926,4 +924,3 @@ protected: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUIEnvironment.h b/irr/include/IGUIEnvironment.h index 1e1d5467a..b7f384803 100644 --- a/irr/include/IGUIEnvironment.h +++ b/irr/include/IGUIEnvironment.h @@ -11,8 +11,6 @@ #include "IEventReceiver.h" #include "path.h" -namespace irr -{ class IOSOperator; class IEventReceiver; @@ -403,4 +401,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUIFileOpenDialog.h b/irr/include/IGUIFileOpenDialog.h index 04a51ccb4..1a6f0b1a3 100644 --- a/irr/include/IGUIFileOpenDialog.h +++ b/irr/include/IGUIFileOpenDialog.h @@ -7,8 +7,6 @@ #include "IGUIElement.h" #include "path.h" -namespace irr -{ namespace gui { @@ -41,4 +39,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUIFont.h b/irr/include/IGUIFont.h index 5efce9796..a2aaeb39b 100644 --- a/irr/include/IGUIFont.h +++ b/irr/include/IGUIFont.h @@ -9,8 +9,6 @@ #include "rect.h" #include "irrString.h" -namespace irr -{ namespace gui { @@ -93,4 +91,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUIFontBitmap.h b/irr/include/IGUIFontBitmap.h index f7bd70dc3..b7e961c3d 100644 --- a/irr/include/IGUIFontBitmap.h +++ b/irr/include/IGUIFontBitmap.h @@ -6,8 +6,6 @@ #include "IGUIFont.h" -namespace irr -{ namespace gui { class IGUISpriteBank; @@ -27,4 +25,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUIImage.h b/irr/include/IGUIImage.h index cc3c66eb9..2cbb9ef33 100644 --- a/irr/include/IGUIImage.h +++ b/irr/include/IGUIImage.h @@ -7,8 +7,6 @@ #include "IGUIElement.h" #include "SColor.h" -namespace irr -{ namespace video { class ITexture; @@ -80,4 +78,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUIImageList.h b/irr/include/IGUIImageList.h index a13ec57a4..2decc5822 100644 --- a/irr/include/IGUIImageList.h +++ b/irr/include/IGUIImageList.h @@ -7,8 +7,6 @@ #include "rect.h" #include "irrTypes.h" -namespace irr -{ namespace gui { @@ -37,4 +35,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUIListBox.h b/irr/include/IGUIListBox.h index 6271eb560..bcb288f99 100644 --- a/irr/include/IGUIListBox.h +++ b/irr/include/IGUIListBox.h @@ -7,8 +7,6 @@ #include "IGUIElement.h" #include "SColor.h" -namespace irr -{ namespace gui { class IGUISpriteBank; @@ -133,4 +131,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUIScrollBar.h b/irr/include/IGUIScrollBar.h index c7eb4b1b8..89a75f619 100644 --- a/irr/include/IGUIScrollBar.h +++ b/irr/include/IGUIScrollBar.h @@ -6,8 +6,6 @@ #include "IGUIElement.h" -namespace irr -{ namespace gui { @@ -56,4 +54,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUISkin.h b/irr/include/IGUISkin.h index 39d20f0e7..d4c98451d 100644 --- a/irr/include/IGUISkin.h +++ b/irr/include/IGUISkin.h @@ -9,8 +9,6 @@ #include "SColor.h" #include "rect.h" -namespace irr -{ namespace gui { class IGUIFont; @@ -537,4 +535,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUISpriteBank.h b/irr/include/IGUISpriteBank.h index 70d8fd1b9..e46f1ee4d 100644 --- a/irr/include/IGUISpriteBank.h +++ b/irr/include/IGUISpriteBank.h @@ -9,9 +9,6 @@ #include "SColor.h" #include "rect.h" -namespace irr -{ - namespace video { class ITexture; @@ -135,4 +132,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUIStaticText.h b/irr/include/IGUIStaticText.h index 02af9b573..42ed83e34 100644 --- a/irr/include/IGUIStaticText.h +++ b/irr/include/IGUIStaticText.h @@ -7,8 +7,6 @@ #include "IGUIElement.h" #include "SColor.h" -namespace irr -{ namespace gui { class IGUIFont; @@ -130,4 +128,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUITabControl.h b/irr/include/IGUITabControl.h index 274d12695..be6ad5a6a 100644 --- a/irr/include/IGUITabControl.h +++ b/irr/include/IGUITabControl.h @@ -7,8 +7,6 @@ #include "IGUIElement.h" #include "SColor.h" -namespace irr -{ namespace gui { class IGUITab; @@ -145,4 +143,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IGUIToolbar.h b/irr/include/IGUIToolbar.h index 2011f09a1..eafd9d5a4 100644 --- a/irr/include/IGUIToolbar.h +++ b/irr/include/IGUIToolbar.h @@ -6,8 +6,6 @@ #include "IGUIElement.h" -namespace irr -{ namespace video { class ITexture; @@ -31,4 +29,3 @@ public: }; } // end namespace gui -} // end namespace irr diff --git a/irr/include/IImage.h b/irr/include/IImage.h index ef8f6934b..2d137ac10 100644 --- a/irr/include/IImage.h +++ b/irr/include/IImage.h @@ -10,8 +10,6 @@ #include "SColor.h" #include -namespace irr -{ namespace video { @@ -332,4 +330,3 @@ protected: }; } // end namespace video -} // end namespace irr diff --git a/irr/include/IImageLoader.h b/irr/include/IImageLoader.h index 207b648d5..054adab15 100644 --- a/irr/include/IImageLoader.h +++ b/irr/include/IImageLoader.h @@ -8,8 +8,6 @@ #include "IImage.h" #include "path.h" -namespace irr -{ namespace io { class IReadFile; @@ -44,4 +42,3 @@ public: }; } // end namespace video -} // end namespace irr diff --git a/irr/include/IImageWriter.h b/irr/include/IImageWriter.h index 872b50290..e80f76029 100644 --- a/irr/include/IImageWriter.h +++ b/irr/include/IImageWriter.h @@ -7,8 +7,6 @@ #include "IReferenceCounted.h" #include "path.h" -namespace irr -{ namespace io { class IWriteFile; @@ -36,4 +34,3 @@ public: }; } // namespace video -} // namespace irr diff --git a/irr/include/IIndexBuffer.h b/irr/include/IIndexBuffer.h index 917fc10b4..e5bca627f 100644 --- a/irr/include/IIndexBuffer.h +++ b/irr/include/IIndexBuffer.h @@ -9,9 +9,6 @@ #include "EPrimitiveTypes.h" #include "SVertexIndex.h" -namespace irr -{ - namespace scene { @@ -78,4 +75,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/ILogger.h b/irr/include/ILogger.h index 2642f3398..b4f671076 100644 --- a/irr/include/ILogger.h +++ b/irr/include/ILogger.h @@ -6,9 +6,6 @@ #include "IReferenceCounted.h" -namespace irr -{ - //! Possible log levels. //! When used has filter ELL_DEBUG means => log everything and ELL_NONE means => log (nearly) nothing. //! When used to print logging information ELL_DEBUG will have lowest priority while ELL_NONE @@ -71,5 +68,3 @@ public: independent on what level filter is set, use ELL_NONE. */ virtual void log(const c8 *text, const c8 *hint, ELOG_LEVEL ll = ELL_INFORMATION) = 0; }; - -} // end namespace diff --git a/irr/include/IMaterialRenderer.h b/irr/include/IMaterialRenderer.h index ba9c4b74f..bf79413ac 100644 --- a/irr/include/IMaterialRenderer.h +++ b/irr/include/IMaterialRenderer.h @@ -8,8 +8,6 @@ #include "SMaterial.h" #include "S3DVertex.h" -namespace irr -{ namespace video { @@ -98,4 +96,3 @@ public: }; } // end namespace video -} // end namespace irr diff --git a/irr/include/IMaterialRendererServices.h b/irr/include/IMaterialRendererServices.h index 8ed66061d..6bc6b4af7 100644 --- a/irr/include/IMaterialRendererServices.h +++ b/irr/include/IMaterialRendererServices.h @@ -6,8 +6,6 @@ #include "SMaterial.h" -namespace irr -{ namespace video { @@ -76,4 +74,3 @@ public: }; } // end namespace video -} // end namespace irr diff --git a/irr/include/IMemoryReadFile.h b/irr/include/IMemoryReadFile.h index 982b09af3..f485b0e32 100644 --- a/irr/include/IMemoryReadFile.h +++ b/irr/include/IMemoryReadFile.h @@ -6,8 +6,6 @@ #include "IReadFile.h" -namespace irr -{ namespace io { @@ -24,4 +22,3 @@ public: virtual const void *getBuffer() const = 0; }; } // end namespace io -} // end namespace irr diff --git a/irr/include/IMesh.h b/irr/include/IMesh.h index e8656e868..6f904f80b 100644 --- a/irr/include/IMesh.h +++ b/irr/include/IMesh.h @@ -8,8 +8,6 @@ #include "SMaterial.h" #include "EHardwareBufferFlags.h" -namespace irr -{ namespace scene { //! Possible types of meshes. @@ -97,4 +95,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/IMeshBuffer.h b/irr/include/IMeshBuffer.h index afcf28943..65fd55525 100644 --- a/irr/include/IMeshBuffer.h +++ b/irr/include/IMeshBuffer.h @@ -13,8 +13,6 @@ #include "EPrimitiveTypes.h" #include -namespace irr -{ namespace scene { //! Struct for holding a mesh with a single material. @@ -241,4 +239,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/IMeshCache.h b/irr/include/IMeshCache.h index 66052bfac..8fd0aaec9 100644 --- a/irr/include/IMeshCache.h +++ b/irr/include/IMeshCache.h @@ -7,9 +7,6 @@ #include "IReferenceCounted.h" #include "path.h" -namespace irr -{ - namespace scene { class IMesh; @@ -128,4 +125,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/IMeshLoader.h b/irr/include/IMeshLoader.h index d1f2675e9..2e5615607 100644 --- a/irr/include/IMeshLoader.h +++ b/irr/include/IMeshLoader.h @@ -7,8 +7,6 @@ #include "IReferenceCounted.h" #include "path.h" -namespace irr -{ namespace io { class IReadFile; @@ -47,4 +45,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/IMeshManipulator.h b/irr/include/IMeshManipulator.h index 0312a38c8..6d8f21af8 100644 --- a/irr/include/IMeshManipulator.h +++ b/irr/include/IMeshManipulator.h @@ -11,8 +11,6 @@ #include "IMeshBuffer.h" #include "SVertexManipulator.h" -namespace irr -{ namespace scene { @@ -146,4 +144,3 @@ protected: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/IMeshSceneNode.h b/irr/include/IMeshSceneNode.h index 3065f4c07..247b27da6 100644 --- a/irr/include/IMeshSceneNode.h +++ b/irr/include/IMeshSceneNode.h @@ -6,8 +6,6 @@ #include "ISceneNode.h" -namespace irr -{ namespace scene { @@ -47,4 +45,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/IOSOperator.h b/irr/include/IOSOperator.h index 6164af5c9..1316cba69 100644 --- a/irr/include/IOSOperator.h +++ b/irr/include/IOSOperator.h @@ -7,9 +7,6 @@ #include "IReferenceCounted.h" #include "irrString.h" -namespace irr -{ - //! The OSOperator provides OS-specific methods and information. class IOSOperator : public virtual IReferenceCounted { @@ -41,5 +38,3 @@ public: \return True if successful, false if not */ virtual bool getSystemMemory(u32 *totalBytes, u32 *availableBytes) const = 0; }; - -} // end namespace diff --git a/irr/include/IReadFile.h b/irr/include/IReadFile.h index 4431bdb32..d4f0017dd 100644 --- a/irr/include/IReadFile.h +++ b/irr/include/IReadFile.h @@ -8,8 +8,6 @@ #include "EReadFileType.h" #include "path.h" -namespace irr -{ namespace io { @@ -54,4 +52,3 @@ public: IReadFile *createLimitReadFile(const io::path &fileName, IReadFile *alreadyOpenedFile, long pos, long areaSize); } // end namespace io -} // end namespace irr diff --git a/irr/include/IReferenceCounted.h b/irr/include/IReferenceCounted.h index 80454f9ea..584943bce 100644 --- a/irr/include/IReferenceCounted.h +++ b/irr/include/IReferenceCounted.h @@ -7,9 +7,6 @@ #include "irrTypes.h" #include -namespace irr -{ - //! Base class of most objects of the Irrlicht Engine. /** This class provides reference counting through the methods grab() and drop(). It also is able to store a debug string for every instance of an object. @@ -142,5 +139,3 @@ private: //! The reference counter. Mutable to do reference counting on const objects. mutable s32 ReferenceCounter; }; - -} // end namespace irr diff --git a/irr/include/IRenderTarget.h b/irr/include/IRenderTarget.h index d4e5960a2..b39f3ac61 100644 --- a/irr/include/IRenderTarget.h +++ b/irr/include/IRenderTarget.h @@ -8,8 +8,6 @@ #include "EDriverTypes.h" #include "irrArray.h" -namespace irr -{ namespace video { class ITexture; @@ -112,4 +110,3 @@ protected: }; } -} diff --git a/irr/include/ISceneCollisionManager.h b/irr/include/ISceneCollisionManager.h index 3307dc6bb..d5b55ec25 100644 --- a/irr/include/ISceneCollisionManager.h +++ b/irr/include/ISceneCollisionManager.h @@ -8,9 +8,6 @@ #include "position2d.h" #include "line3d.h" -namespace irr -{ - namespace scene { class ICameraSceneNode; @@ -30,4 +27,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/ISceneManager.h b/irr/include/ISceneManager.h index 847666450..17c88b01f 100644 --- a/irr/include/ISceneManager.h +++ b/irr/include/ISceneManager.h @@ -11,8 +11,6 @@ #include "SColor.h" #include "ESceneNodeTypes.h" -namespace irr -{ struct SKeyMap; struct SEvent; @@ -433,4 +431,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/ISceneNode.h b/irr/include/ISceneNode.h index 573715861..4dcc98e09 100644 --- a/irr/include/ISceneNode.h +++ b/irr/include/ISceneNode.h @@ -18,8 +18,6 @@ #include #include -namespace irr -{ namespace scene { class ISceneNode; @@ -417,7 +415,7 @@ public: } //! Sets if debug data like bounding boxes should be drawn. - /** A bitwise OR of the types from @ref irr::scene::E_DEBUG_SCENE_TYPE. + /** A bitwise OR of the types from @ref scene::E_DEBUG_SCENE_TYPE. Please note that not all scene nodes support all debug data types. \param state The debug data visibility state to be used. */ virtual void setDebugDataVisible(u16 state) @@ -427,7 +425,7 @@ public: //! Returns if debug data like bounding boxes are drawn. /** \return A bitwise OR of the debug data values from - @ref irr::scene::E_DEBUG_SCENE_TYPE that are currently visible. */ + @ref scene::E_DEBUG_SCENE_TYPE that are currently visible. */ u16 isDebugDataVisible() const { return DebugDataVisible; @@ -595,4 +593,3 @@ protected: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/IShaderConstantSetCallBack.h b/irr/include/IShaderConstantSetCallBack.h index 2e37a34ae..c6c7cef53 100644 --- a/irr/include/IShaderConstantSetCallBack.h +++ b/irr/include/IShaderConstantSetCallBack.h @@ -6,8 +6,6 @@ #include "IReferenceCounted.h" -namespace irr -{ namespace video { class IMaterialRendererServices; @@ -76,4 +74,3 @@ public: }; } // end namespace video -} // end namespace irr diff --git a/irr/include/ITexture.h b/irr/include/ITexture.h index bdbb72727..21ea319c0 100644 --- a/irr/include/ITexture.h +++ b/irr/include/ITexture.h @@ -10,8 +10,6 @@ #include "EDriverTypes.h" #include "path.h" -namespace irr -{ namespace video { @@ -292,4 +290,3 @@ protected: }; } // end namespace video -} // end namespace irr diff --git a/irr/include/ITimer.h b/irr/include/ITimer.h index 22c79f603..acb9c88ab 100644 --- a/irr/include/ITimer.h +++ b/irr/include/ITimer.h @@ -6,9 +6,6 @@ #include "IReferenceCounted.h" -namespace irr -{ - //! Interface for getting and manipulating the virtual time class ITimer : public virtual IReferenceCounted { @@ -61,5 +58,3 @@ public: but you can call it manually if you don't use this method. */ virtual void tick() = 0; }; - -} // end namespace irr diff --git a/irr/include/IVertexBuffer.h b/irr/include/IVertexBuffer.h index e6f8c633c..02eade137 100644 --- a/irr/include/IVertexBuffer.h +++ b/irr/include/IVertexBuffer.h @@ -8,8 +8,6 @@ #include "EHardwareBufferFlags.h" #include "S3DVertex.h" -namespace irr -{ namespace scene { @@ -71,4 +69,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/IVideoDriver.h b/irr/include/IVideoDriver.h index 02c9a2d4f..2d58940c3 100644 --- a/irr/include/IVideoDriver.h +++ b/irr/include/IVideoDriver.h @@ -21,8 +21,6 @@ #include "S3DVertex.h" // E_VERTEX_TYPE #include "SVertexIndex.h" // E_INDEX_TYPE -namespace irr -{ namespace io { class IReadFile; @@ -69,7 +67,7 @@ struct SFrameStats { the Irrlicht Engine: All rendering and texture manipulation is done with this interface. You are able to use the Irrlicht Engine by only invoking methods of this interface if you like to, although the -irr::scene::ISceneManager interface provides a lot of powerful classes +scene::ISceneManager interface provides a lot of powerful classes and methods to make the programmer's life easier. */ class IVideoDriver : public virtual IReferenceCounted @@ -245,7 +243,7 @@ public: that the driver may choose to create the texture in another color format. \return Pointer to the newly created texture. */ - virtual ITexture *addTextureCubemap(const irr::u32 sideLen, const io::path &name, ECOLOR_FORMAT format = ECF_A8R8G8B8) = 0; + virtual ITexture *addTextureCubemap(const u32 sideLen, const io::path &name, ECOLOR_FORMAT format = ECF_A8R8G8B8) = 0; //! Adds a new render target texture to the texture cache. /** \param size Size of the texture, in pixels. Width and @@ -279,7 +277,7 @@ public: \return Pointer to the created texture or 0 if the texture could not be created. This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ - virtual ITexture *addRenderTargetTextureCubemap(const irr::u32 sideLen, + virtual ITexture *addRenderTargetTextureCubemap(const u32 sideLen, const io::path &name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) = 0; //! Removes a texture from the texture cache and deletes it. @@ -1125,8 +1123,7 @@ public: virtual bool queryTextureFormat(ECOLOR_FORMAT format) const = 0; //! Used by some SceneNodes to check if a material should be rendered in the transparent render pass - virtual bool needsTransparentRenderPass(const irr::video::SMaterial &material) const = 0; + virtual bool needsTransparentRenderPass(const video::SMaterial &material) const = 0; }; } // end namespace video -} // end namespace irr diff --git a/irr/include/IWriteFile.h b/irr/include/IWriteFile.h index cc27e5903..f0a88de90 100644 --- a/irr/include/IWriteFile.h +++ b/irr/include/IWriteFile.h @@ -7,8 +7,6 @@ #include "IReferenceCounted.h" #include "path.h" -namespace irr -{ namespace io { @@ -44,4 +42,3 @@ public: }; } // end namespace io -} // end namespace irr diff --git a/irr/include/IrrlichtDevice.h b/irr/include/IrrlichtDevice.h index ed77f979e..222dc6759 100644 --- a/irr/include/IrrlichtDevice.h +++ b/irr/include/IrrlichtDevice.h @@ -18,8 +18,6 @@ #include #include -namespace irr -{ class ILogger; class IEventReceiver; @@ -78,7 +76,7 @@ public: also simply use your own message loop using GetMessage, DispatchMessage and whatever and simply don't use this method. But note that Irrlicht will not be able to fetch user input - then. See irr::SIrrlichtCreationParameters::WindowId for more + then. See SIrrlichtCreationParameters::WindowId for more information and example code. */ virtual bool run() = 0; @@ -210,7 +208,7 @@ public: //! Sets a new user event receiver which will receive events from the engine. /** Return true in IEventReceiver::OnEvent to prevent the event from continuing along the chain of event receivers. The path that an event takes through the system depends - on its type. See irr::EEVENT_TYPE for details. + on its type. See EEVENT_TYPE for details. \param receiver New receiver to be used. */ virtual void setEventReceiver(IEventReceiver *receiver) = 0; @@ -243,7 +241,7 @@ public: It does set the drawing/clientDC size of the window, the window decorations are added to that. You get the current window size with IVideoDriver::getScreenSize() (might be unified in future) */ - virtual void setWindowSize(const irr::core::dimension2d &size) = 0; + virtual void setWindowSize(const core::dimension2d &size) = 0; //! Minimizes the window if possible. virtual void minimizeWindow() = 0; @@ -260,7 +258,7 @@ public: //! Activate any joysticks, and generate events for them. /** Irrlicht contains support for joysticks, but does not generate joystick events by default, 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. + activate joystick support in Irrlicht and to receive 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, false if joysticks are not supported or support is compiled out. @@ -371,5 +369,3 @@ public: return Keycode(KEY_UNKNOWN, (wchar_t)scancode); } }; - -} // end namespace irr diff --git a/irr/include/Keycodes.h b/irr/include/Keycodes.h index a6a0a5dae..f69331f79 100644 --- a/irr/include/Keycodes.h +++ b/irr/include/Keycodes.h @@ -5,9 +5,6 @@ #pragma once #include -namespace irr -{ - enum EKEY_CODE { KEY_UNKNOWN = 0x0, @@ -208,5 +205,3 @@ public: return code > 0 && code < KEY_KEY_CODES_COUNT; } }; - -} // end namespace irr diff --git a/irr/include/S3DVertex.h b/irr/include/S3DVertex.h index 2039df0e5..0c269a635 100644 --- a/irr/include/S3DVertex.h +++ b/irr/include/S3DVertex.h @@ -8,8 +8,6 @@ #include "vector2d.h" #include "SColor.h" -namespace irr -{ namespace video { @@ -285,4 +283,3 @@ inline u32 getVertexPitchFromType(E_VERTEX_TYPE vertexType) } } // end namespace video -} // end namespace irr diff --git a/irr/include/SColor.h b/irr/include/SColor.h index 0845b31f7..f45d7404b 100644 --- a/irr/include/SColor.h +++ b/irr/include/SColor.h @@ -7,8 +7,6 @@ #include "irrTypes.h" #include "irrMath.h" -namespace irr -{ namespace video { //! An enum for the color format of textures used by the Irrlicht Engine. @@ -655,4 +653,3 @@ inline f32 SColorHSL::toRGB1(f32 rm1, f32 rm2, f32 rh) const } } // end namespace video -} // end namespace irr diff --git a/irr/include/SExposedVideoData.h b/irr/include/SExposedVideoData.h index 9befcb15b..fdeaa5080 100644 --- a/irr/include/SExposedVideoData.h +++ b/irr/include/SExposedVideoData.h @@ -4,8 +4,6 @@ #pragma once -namespace irr -{ namespace video { @@ -79,4 +77,3 @@ struct SExposedVideoData }; } // end namespace video -} // end namespace irr diff --git a/irr/include/SIrrCreationParameters.h b/irr/include/SIrrCreationParameters.h index 4eedde50f..712717a31 100644 --- a/irr/include/SIrrCreationParameters.h +++ b/irr/include/SIrrCreationParameters.h @@ -11,8 +11,6 @@ #include "position2d.h" #include "path.h" -namespace irr -{ class IEventReceiver; //! Structure for holding Irrlicht Device creation parameters. @@ -224,10 +222,8 @@ struct SIrrlichtCreationParameters //! Set the path where default-shaders to simulate the fixed-function pipeline can be found. /** This is about the shaders which can be found in media/Shaders by default. It's only necessary to set when using OGL-ES 2.0 */ - irr::io::path OGLES2ShaderPath; + io::path OGLES2ShaderPath; //! Enable debug and error checks in video driver. bool DriverDebug; }; - -} // end namespace irr diff --git a/irr/include/SMaterial.h b/irr/include/SMaterial.h index 0b032e2b2..98b49a3d7 100644 --- a/irr/include/SMaterial.h +++ b/irr/include/SMaterial.h @@ -11,8 +11,6 @@ #include "EMaterialProps.h" // IWYU pragma: export #include "SMaterialLayer.h" -namespace irr -{ namespace video { class ITexture; @@ -178,7 +176,7 @@ inline bool textureBlendFunc_hasAlpha(const E_BLEND_FACTOR factor) to coverage. Some drivers don't support a per-material setting of the anti-aliasing modes. In those cases, FSAA/multisampling is defined by the device mode -chosen upon creation via irr::SIrrCreationParameters. +chosen upon creation via SIrrCreationParameters. */ enum E_ANTI_ALIASING_MODE : u8 { @@ -474,19 +472,18 @@ public: extern const SMaterial IdentityMaterial; } // end namespace video -} // end namespace irr template<> -struct std::hash +struct std::hash { /// @brief std::hash specialization for video::SMaterial - std::size_t operator()(const irr::video::SMaterial &m) const noexcept + std::size_t operator()(const video::SMaterial &m) const noexcept { std::size_t ret = 0; for (auto h : { // the three members most likely to differ - std::hash{}(m.getTexture(0)), + std::hash{}(m.getTexture(0)), std::hash{}(m.MaterialType), - std::hash{}(m.ColorParam.color) + std::hash{}(m.ColorParam.color) }) { ret += h; ret ^= (ret << 6) + (ret >> 2); // distribute bits diff --git a/irr/include/SMaterialLayer.h b/irr/include/SMaterialLayer.h index 4d43bd820..f657d19b9 100644 --- a/irr/include/SMaterialLayer.h +++ b/irr/include/SMaterialLayer.h @@ -6,8 +6,6 @@ #include "matrix4.h" -namespace irr -{ namespace video { class ITexture; @@ -235,4 +233,3 @@ private: }; } // end namespace video -} // end namespace irr diff --git a/irr/include/SMesh.h b/irr/include/SMesh.h index b22bb7749..12f13f8b7 100644 --- a/irr/include/SMesh.h +++ b/irr/include/SMesh.h @@ -9,8 +9,6 @@ #include "IMeshBuffer.h" #include "aabbox3d.h" -namespace irr -{ namespace scene { //! Simple implementation of the IMesh interface. @@ -146,4 +144,3 @@ struct SMesh final : public IAnimatedMesh }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/SOverrideMaterial.h b/irr/include/SOverrideMaterial.h index 1ae324211..87a74267c 100644 --- a/irr/include/SOverrideMaterial.h +++ b/irr/include/SOverrideMaterial.h @@ -7,8 +7,6 @@ #include #include "SMaterial.h" -namespace irr -{ namespace video { @@ -177,4 +175,3 @@ struct SOverrideMaterial }; } // end namespace video -} // end namespace irr diff --git a/irr/include/SSkinMeshBuffer.h b/irr/include/SSkinMeshBuffer.h index 8b2e26882..614122735 100644 --- a/irr/include/SSkinMeshBuffer.h +++ b/irr/include/SSkinMeshBuffer.h @@ -10,8 +10,6 @@ #include "S3DVertex.h" #include -namespace irr -{ namespace scene { @@ -238,4 +236,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/SVertexIndex.h b/irr/include/SVertexIndex.h index 73db1d23f..e9eca16da 100644 --- a/irr/include/SVertexIndex.h +++ b/irr/include/SVertexIndex.h @@ -4,8 +4,6 @@ #pragma once -namespace irr -{ namespace video { enum E_INDEX_TYPE @@ -15,4 +13,3 @@ enum E_INDEX_TYPE }; } // end namespace video -} // end namespace irr diff --git a/irr/include/SVertexManipulator.h b/irr/include/SVertexManipulator.h index 80111b8ed..908b540f3 100644 --- a/irr/include/SVertexManipulator.h +++ b/irr/include/SVertexManipulator.h @@ -6,8 +6,6 @@ #include "vector3d.h" -namespace irr -{ namespace scene { @@ -39,4 +37,3 @@ private: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/SViewFrustum.h b/irr/include/SViewFrustum.h index c03707d4f..0b2902ac6 100644 --- a/irr/include/SViewFrustum.h +++ b/irr/include/SViewFrustum.h @@ -11,8 +11,6 @@ #include "matrix4.h" #include "EVideoTypes.h" -namespace irr -{ namespace scene { @@ -446,4 +444,3 @@ inline void SViewFrustum::recalculateBoundingSphere() } } // end namespace scene -} // end namespace irr diff --git a/irr/include/SkinnedMesh.h b/irr/include/SkinnedMesh.h index b540e288b..c09f18413 100644 --- a/irr/include/SkinnedMesh.h +++ b/irr/include/SkinnedMesh.h @@ -21,8 +21,6 @@ #include #include -namespace irr -{ namespace scene { @@ -447,4 +445,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/include/Transform.h b/irr/include/Transform.h index 1e96e183d..d5feb9525 100644 --- a/irr/include/Transform.h +++ b/irr/include/Transform.h @@ -5,8 +5,6 @@ #include #include -namespace irr -{ namespace core { @@ -39,4 +37,3 @@ struct Transform { }; } // end namespace core -} // end namespace irr diff --git a/irr/include/aabbox3d.h b/irr/include/aabbox3d.h index cc5aebcc5..2455cff75 100644 --- a/irr/include/aabbox3d.h +++ b/irr/include/aabbox3d.h @@ -8,8 +8,6 @@ #include "plane3d.h" #include "line3d.h" -namespace irr -{ namespace core { @@ -384,4 +382,3 @@ typedef aabbox3d aabbox3df; typedef aabbox3d aabbox3di; } // end namespace core -} // end namespace irr diff --git a/irr/include/coreutil.h b/irr/include/coreutil.h index ca19c00ca..e92b64491 100644 --- a/irr/include/coreutil.h +++ b/irr/include/coreutil.h @@ -6,8 +6,6 @@ #include "path.h" -namespace irr -{ namespace core { @@ -189,4 +187,3 @@ inline bool isupper(s32 c) } } // end namespace core -} // end namespace irr diff --git a/irr/include/dimension2d.h b/irr/include/dimension2d.h index ab6c81c30..ed8feda86 100644 --- a/irr/include/dimension2d.h +++ b/irr/include/dimension2d.h @@ -5,10 +5,8 @@ #pragma once #include "irrTypes.h" -#include "irrMath.h" // for irr::core::equals() +#include "irrMath.h" // for core::equals() -namespace irr -{ namespace core { template @@ -213,4 +211,3 @@ typedef dimension2d dimension2du; typedef dimension2d dimension2di; } // end namespace core -} // end namespace irr diff --git a/irr/include/fast_atof.h b/irr/include/fast_atof.h index 2b517d62d..252d356df 100644 --- a/irr/include/fast_atof.h +++ b/irr/include/fast_atof.h @@ -9,8 +9,6 @@ #include #include -namespace irr -{ namespace core { @@ -342,4 +340,3 @@ inline float fast_atof(const char *floatAsString, const char **out = 0) } } // end namespace core -} // end namespace irr diff --git a/irr/include/irrArray.h b/irr/include/irrArray.h index 2542d0542..b4882cb8b 100644 --- a/irr/include/irrArray.h +++ b/irr/include/irrArray.h @@ -11,8 +11,6 @@ #include "irrTypes.h" #include "irrMath.h" -namespace irr -{ namespace core { @@ -24,7 +22,7 @@ class array { public: static_assert(!std::is_same::value, - "irr::core::array with T = bool not supported. Use std::vector instead."); + "core::array with T = bool not supported. Use std::vector instead."); //! Default constructor for empty array. array() : @@ -407,4 +405,3 @@ private: }; } // end namespace core -} // end namespace irr diff --git a/irr/include/irrMath.h b/irr/include/irrMath.h index 4e74381a6..4523a0182 100644 --- a/irr/include/irrMath.h +++ b/irr/include/irrMath.h @@ -11,8 +11,6 @@ #include // For INT_MAX / UINT_MAX #include -namespace irr -{ namespace core { @@ -199,8 +197,8 @@ union FloatIntUnion32 // Portable sign-extraction bool sign() const { return (i >> 31) != 0; } - irr::s32 i; - irr::f32 f; + s32 i; + f32 f; }; //! We compare the difference in ULP's (spacing between floating-point numbers, aka ULP=1 means there exists no float between). @@ -460,7 +458,6 @@ inline f32 fract(f32 x) } } // end namespace core -} // end namespace irr -using irr::core::FR; -using irr::core::IR; +using core::FR; +using core::IR; diff --git a/irr/include/irrString.h b/irr/include/irrString.h index 465664e87..48c107f55 100644 --- a/irr/include/irrString.h +++ b/irr/include/irrString.h @@ -18,8 +18,6 @@ extern std::wstring utf8_to_wide(std::string_view input); extern std::string wide_to_utf8(std::wstring_view input); /* */ -namespace irr -{ namespace core { @@ -940,4 +938,3 @@ inline size_t wStringToUTF8(stringc &destination, const stringw &source) } } // end namespace core -} // end namespace irr diff --git a/irr/include/irrTypes.h b/irr/include/irrTypes.h index 9018dd151..af5aaec5f 100644 --- a/irr/include/irrTypes.h +++ b/irr/include/irrTypes.h @@ -7,9 +7,6 @@ #include #include -namespace irr -{ - //! 8 bit unsigned variable. typedef uint8_t u8; @@ -46,8 +43,6 @@ typedef float f32; /** This is a typedef for double, it ensures portability of the engine. */ typedef double f64; -} // end namespace irr - //! Defines for snprintf_irr because snprintf method does not match the ISO C //! standard on Windows platforms. //! We want int snprintf_irr(char *str, size_t size, const char *format, ...); @@ -57,15 +52,10 @@ typedef double f64; #define snprintf_irr snprintf #endif // _MSC_VER -namespace irr -{ - //! Type name for character type used by the file system (legacy). typedef char fschar_t; #define _IRR_TEXT(X) X -} // end namespace irr - // Invokes undefined behavior for unreachable code optimization // Note: an assert(false) is included first to catch this in debug builds #if defined(__cpp_lib_unreachable) @@ -86,5 +76,5 @@ typedef char fschar_t; /** some compilers can create those by directly writing the code like 'code', but some generate warnings so we use this macro here */ #define MAKE_IRR_ID(c0, c1, c2, c3) \ - ((irr::u32)(irr::u8)(c0) | ((irr::u32)(irr::u8)(c1) << 8) | \ - ((irr::u32)(irr::u8)(c2) << 16) | ((irr::u32)(irr::u8)(c3) << 24)) + ((u32)(u8)(c0) | ((u32)(u8)(c1) << 8) | \ + ((u32)(u8)(c2) << 16) | ((u32)(u8)(c3) << 24)) diff --git a/irr/include/irr_ptr.h b/irr/include/irr_ptr.h index 48717976b..305e9f798 100644 --- a/irr/include/irr_ptr.h +++ b/irr/include/irr_ptr.h @@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #pragma once #include #include -namespace irr { class IReferenceCounted; } +class IReferenceCounted; /** Shared pointer for IrrLicht objects. * @@ -125,7 +125,7 @@ public: */ void reset(ReferenceCounted *object = nullptr) noexcept { - static_assert(std::is_base_of_v, + static_assert(std::is_base_of_v, "Class is not an IReferenceCounted"); if (value) value->drop(); @@ -137,7 +137,7 @@ public: */ void grab(ReferenceCounted *object) noexcept { - static_assert(std::is_base_of_v, + static_assert(std::is_base_of_v, "Class is not an IReferenceCounted"); if (object) object->grab(); diff --git a/irr/include/irrlicht.h b/irr/include/irrlicht.h index b23402729..dd6be4bf1 100644 --- a/irr/include/irrlicht.h +++ b/irr/include/irrlicht.h @@ -36,8 +36,6 @@ #include "SIrrCreationParameters.h" //! Everything in the Irrlicht Engine can be found in this namespace. -namespace irr -{ //! Creates an Irrlicht device. The Irrlicht device is the root object for using the engine. /** If you need more parameters to be passed to the creation of the Irrlicht Engine device, use the createDeviceEx() function. @@ -70,7 +68,7 @@ extern "C" IrrlichtDevice *createDevice( Use this function only if you wish to specify advanced parameters like a window handle in which the device should be created. \param parameters: Structure containing advanced parameters for the creation of the device. -See irr::SIrrlichtCreationParameters for details. +See SIrrlichtCreationParameters for details. \return Returns pointer to the created IrrlichtDevice or null if the device could not be created. */ extern "C" IrrlichtDevice *createDeviceEx( @@ -103,7 +101,6 @@ namespace scene namespace video { } -} /*! \file irrlicht.h \brief Main header file of the irrlicht, needed to create a device. diff --git a/irr/include/line2d.h b/irr/include/line2d.h index fb58f0b7a..437751f9a 100644 --- a/irr/include/line2d.h +++ b/irr/include/line2d.h @@ -7,8 +7,6 @@ #include "irrTypes.h" #include "vector2d.h" -namespace irr -{ namespace core { @@ -350,7 +348,7 @@ public: // partial specialization to optimize lines (avoiding casts) template <> -inline vector2df line2d::getClosestPoint(const vector2df &point, bool checkOnlySegments) const +inline vector2df line2d::getClosestPoint(const vector2df &point, bool checkOnlySegments) const { const vector2df c = point - start; vector2df v = end - start; @@ -377,4 +375,3 @@ typedef line2d line2df; typedef line2d line2di; } // end namespace core -} // end namespace irr diff --git a/irr/include/line3d.h b/irr/include/line3d.h index ea198fba4..19338077f 100644 --- a/irr/include/line3d.h +++ b/irr/include/line3d.h @@ -7,8 +7,6 @@ #include "irrTypes.h" #include "vector3d.h" -namespace irr -{ namespace core { @@ -162,4 +160,3 @@ typedef line3d line3df; typedef line3d line3di; } // end namespace core -} // end namespace irr diff --git a/irr/include/matrix4.h b/irr/include/matrix4.h index 7d9a11ca5..020e2fde1 100644 --- a/irr/include/matrix4.h +++ b/irr/include/matrix4.h @@ -13,8 +13,6 @@ #include "rect.h" #include -namespace irr -{ namespace core { @@ -1901,4 +1899,3 @@ typedef CMatrix4 matrix4; extern const matrix4 IdentityMatrix; } // end namespace core -} // end namespace irr diff --git a/irr/include/mt_opengl.h b/irr/include/mt_opengl.h index 9fd99c191..bd5371530 100755 --- a/irr/include/mt_opengl.h +++ b/irr/include/mt_opengl.h @@ -782,7 +782,7 @@ private: public: // Call this once after creating the context. - void LoadAllProcedures(irr::video::IContextManager *cmgr); + void LoadAllProcedures(video::IContextManager *cmgr); /// Check if an extension is supported. /// @param ext full extension name e.g. "GL_KHR_no_error" inline bool IsExtensionPresent(const std::string &ext) const diff --git a/irr/include/path.h b/irr/include/path.h index 06476ef7b..70f4f24cc 100644 --- a/irr/include/path.h +++ b/irr/include/path.h @@ -6,8 +6,6 @@ #include "irrString.h" -namespace irr -{ namespace io { @@ -83,4 +81,3 @@ private: }; } // io -} // irr diff --git a/irr/include/plane3d.h b/irr/include/plane3d.h index 4003325b5..fc7018fc4 100644 --- a/irr/include/plane3d.h +++ b/irr/include/plane3d.h @@ -7,8 +7,6 @@ #include "irrMath.h" #include "vector3d.h" -namespace irr -{ namespace core { @@ -241,4 +239,3 @@ typedef plane3d plane3df; typedef plane3d plane3di; } // end namespace core -} // end namespace irr diff --git a/irr/include/position2d.h b/irr/include/position2d.h index ff0d30f4f..89a51998d 100644 --- a/irr/include/position2d.h +++ b/irr/include/position2d.h @@ -9,8 +9,6 @@ #include "vector2d.h" -namespace irr -{ namespace core { @@ -22,7 +20,6 @@ typedef vector2d position2df; //! \deprecated position2d is now a synonym for vector2d, but vector2d should be used directly. typedef vector2d position2di; } // namespace core -} // namespace irr // ...and use a #define to catch the rest, for (e.g.) position2d #define position2d vector2d diff --git a/irr/include/quaternion.h b/irr/include/quaternion.h index 42e0428a9..0328d8ff3 100644 --- a/irr/include/quaternion.h +++ b/irr/include/quaternion.h @@ -19,8 +19,6 @@ // - For uses of getMatrix() you have to use quaternion::getMatrix_transposed instead. // #define IRR_TEST_BROKEN_QUATERNION_USE -namespace irr -{ namespace core { @@ -704,4 +702,3 @@ inline core::quaternion &quaternion::rotationFromTo(const vector3df &from, const } } // end namespace core -} // end namespace irr diff --git a/irr/include/rect.h b/irr/include/rect.h index bced2d59e..15bc5ae66 100644 --- a/irr/include/rect.h +++ b/irr/include/rect.h @@ -8,8 +8,6 @@ #include "dimension2d.h" #include "position2d.h" -namespace irr -{ namespace core { @@ -278,4 +276,3 @@ typedef rect rectf; typedef rect recti; } // end namespace core -} // end namespace irr diff --git a/irr/include/vector2d.h b/irr/include/vector2d.h index 821885719..ef1e12302 100644 --- a/irr/include/vector2d.h +++ b/irr/include/vector2d.h @@ -11,8 +11,6 @@ #include #include -namespace irr -{ namespace core { @@ -301,13 +299,13 @@ public: if (Y > 0) if (X > 0) - return atan((irr::f64)Y / (irr::f64)X) * RADTODEG64; + return atan((f64)Y / (f64)X) * RADTODEG64; else - return 180.0 - atan((irr::f64)Y / -(irr::f64)X) * RADTODEG64; + return 180.0 - atan((f64)Y / -(f64)X) * RADTODEG64; else if (X > 0) - return 360.0 - atan(-(irr::f64)Y / (irr::f64)X) * RADTODEG64; + return 360.0 - atan(-(f64)Y / (f64)X) * RADTODEG64; else - return 180.0 + atan(-(irr::f64)Y / -(irr::f64)X) * RADTODEG64; + return 180.0 + atan(-(f64)Y / -(f64)X) * RADTODEG64; } //! Calculates the angle of this vector in degrees in the counter trigonometric sense. @@ -499,15 +497,14 @@ bool dimension2d::operator==(const vector2d &other) const } } // end namespace core -} // end namespace irr namespace std { template -struct hash> +struct hash> { - size_t operator()(const irr::core::vector2d &vec) const + size_t operator()(const core::vector2d &vec) const { size_t h1 = hash()(vec.X); size_t h2 = hash()(vec.Y); diff --git a/irr/include/vector3d.h b/irr/include/vector3d.h index c9c96fabf..e8bec3876 100644 --- a/irr/include/vector3d.h +++ b/irr/include/vector3d.h @@ -10,8 +10,6 @@ #include #include -namespace irr -{ namespace core { @@ -528,15 +526,14 @@ vector3d operator*(const S scalar, const vector3d &vector) } } // end namespace core -} // end namespace irr namespace std { template -struct hash> +struct hash> { - size_t operator()(const irr::core::vector3d &vec) const + size_t operator()(const core::vector3d &vec) const { size_t h1 = hash()(vec.X); size_t h2 = hash()(vec.Y); diff --git a/irr/scripts/BindingGenerator.lua b/irr/scripts/BindingGenerator.lua index 83c625b06..0f85e90da 100755 --- a/irr/scripts/BindingGenerator.lua +++ b/irr/scripts/BindingGenerator.lua @@ -391,7 +391,7 @@ f:write [[ public: // Call this once after creating the context. - void LoadAllProcedures(irr::video::IContextManager *cmgr); + void LoadAllProcedures(video::IContextManager *cmgr); /// Check if an extension is supported. /// @param ext full extension name e.g. "GL_KHR_no_error" inline bool IsExtensionPresent(const std::string &ext) const @@ -429,7 +429,7 @@ f:write[[ OpenGLProcedures GL; -void OpenGLProcedures::LoadAllProcedures(irr::video::IContextManager *cmgr) +void OpenGLProcedures::LoadAllProcedures(video::IContextManager *cmgr) { ]]; diff --git a/irr/src/BuiltInFont.h b/irr/src/BuiltInFont.h index 1df5b7da4..096642beb 100644 --- a/irr/src/BuiltInFont.h +++ b/irr/src/BuiltInFont.h @@ -7,8 +7,6 @@ // header file generated by xxd // for the source bitmap, see builtInFont.png -namespace irr -{ namespace gui { const u8 BuiltInFontData[] = { @@ -132,4 +130,3 @@ const u8 BuiltInFontData[] = { const u32 BuiltInFontDataSize = sizeof(BuiltInFontData); } // end namespace gui -} // end namespace irr diff --git a/irr/src/CAnimatedMeshSceneNode.cpp b/irr/src/CAnimatedMeshSceneNode.cpp index 7b1d9053a..7808f1fee 100644 --- a/irr/src/CAnimatedMeshSceneNode.cpp +++ b/irr/src/CAnimatedMeshSceneNode.cpp @@ -25,8 +25,6 @@ #include #include -namespace irr -{ namespace scene { @@ -680,4 +678,3 @@ ISceneNode *CAnimatedMeshSceneNode::clone(ISceneNode *newParent, ISceneManager * } } // end namespace scene -} // end namespace irr diff --git a/irr/src/CAnimatedMeshSceneNode.h b/irr/src/CAnimatedMeshSceneNode.h index c67479481..98dc4f42a 100644 --- a/irr/src/CAnimatedMeshSceneNode.h +++ b/irr/src/CAnimatedMeshSceneNode.h @@ -12,8 +12,6 @@ #include "Transform.h" #include "matrix4.h" -namespace irr -{ namespace scene { class IDummyTransformationSceneNode; @@ -192,4 +190,3 @@ private: }; } // end namespace scene -} // end namespace irr diff --git a/irr/src/CB3DMeshFileLoader.cpp b/irr/src/CB3DMeshFileLoader.cpp index 6e3e14791..d55ba753d 100644 --- a/irr/src/CB3DMeshFileLoader.cpp +++ b/irr/src/CB3DMeshFileLoader.cpp @@ -20,8 +20,6 @@ #define _B3D_READER_DEBUG #endif -namespace irr -{ namespace scene { @@ -850,4 +848,3 @@ void CB3DMeshFileLoader::readFloats(f32 *vec, u32 count) } } // end namespace scene -} // end namespace irr diff --git a/irr/src/CB3DMeshFileLoader.h b/irr/src/CB3DMeshFileLoader.h index 55978d743..59dc61c96 100644 --- a/irr/src/CB3DMeshFileLoader.h +++ b/irr/src/CB3DMeshFileLoader.h @@ -14,9 +14,6 @@ #include "SB3DStructs.h" #include "IReadFile.h" -namespace irr -{ - namespace scene { @@ -76,4 +73,3 @@ private: }; } // end namespace scene -} // end namespace irr diff --git a/irr/src/CBillboardSceneNode.cpp b/irr/src/CBillboardSceneNode.cpp index 6769e8f04..c45b65eb8 100644 --- a/irr/src/CBillboardSceneNode.cpp +++ b/irr/src/CBillboardSceneNode.cpp @@ -8,8 +8,6 @@ #include "ICameraSceneNode.h" #include "os.h" -namespace irr -{ namespace scene { @@ -86,7 +84,7 @@ void CBillboardSceneNode::render() } } -void CBillboardSceneNode::updateMesh(const irr::scene::ICameraSceneNode *camera) +void CBillboardSceneNode::updateMesh(const scene::ICameraSceneNode *camera) { // billboard looks toward camera core::vector3df pos = getAbsolutePosition(); @@ -139,7 +137,7 @@ const core::aabbox3d &CBillboardSceneNode::getBoundingBox() const return BBoxSafe; } -const core::aabbox3d &CBillboardSceneNode::getTransformedBillboardBoundingBox(const irr::scene::ICameraSceneNode *camera) +const core::aabbox3d &CBillboardSceneNode::getTransformedBillboardBoundingBox(const scene::ICameraSceneNode *camera) { updateMesh(camera); return Buffer->BoundingBox; @@ -264,4 +262,3 @@ ISceneNode *CBillboardSceneNode::clone(ISceneNode *newParent, ISceneManager *new } } // end namespace scene -} // end namespace irr diff --git a/irr/src/CBillboardSceneNode.h b/irr/src/CBillboardSceneNode.h index 9f23ae74a..f9d625fa2 100644 --- a/irr/src/CBillboardSceneNode.h +++ b/irr/src/CBillboardSceneNode.h @@ -7,8 +7,6 @@ #include "IBillboardSceneNode.h" #include "CMeshBuffer.h" -namespace irr -{ namespace scene { @@ -68,7 +66,7 @@ public: video::SColor &bottomColor) const override; //! Get the real boundingbox used by the billboard (which depends on the active camera) - const core::aabbox3d &getTransformedBillboardBoundingBox(const irr::scene::ICameraSceneNode *camera) override; + const core::aabbox3d &getTransformedBillboardBoundingBox(const scene::ICameraSceneNode *camera) override; //! Get the amount of mesh buffers. u32 getMeshBufferCount() const override @@ -91,7 +89,7 @@ public: ISceneNode *clone(ISceneNode *newParent = 0, ISceneManager *newManager = 0) override; protected: - void updateMesh(const irr::scene::ICameraSceneNode *camera); + void updateMesh(const scene::ICameraSceneNode *camera); private: //! Size.Width is the bottom edge width @@ -110,4 +108,3 @@ private: }; } // end namespace scene -} // end namespace irr diff --git a/irr/src/CBlit.h b/irr/src/CBlit.h index 90450ec2f..58ad176f1 100644 --- a/irr/src/CBlit.h +++ b/irr/src/CBlit.h @@ -6,9 +6,6 @@ #include "SoftwareDriver2_helper.h" -namespace irr -{ - //! f18 - fixpoint 14.18 limit to 16k Textures #define CBLIT_USE_FIXPOINT18 @@ -938,5 +935,3 @@ static s32 Blit(eBlitter operation, return 1; } - -} diff --git a/irr/src/CBoneSceneNode.h b/irr/src/CBoneSceneNode.h index 4151f7372..da2308b12 100644 --- a/irr/src/CBoneSceneNode.h +++ b/irr/src/CBoneSceneNode.h @@ -12,8 +12,6 @@ #include -namespace irr -{ namespace scene { @@ -68,4 +66,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/src/CCameraSceneNode.cpp b/irr/src/CCameraSceneNode.cpp index e1c3c96f6..ae19f1fe8 100644 --- a/irr/src/CCameraSceneNode.cpp +++ b/irr/src/CCameraSceneNode.cpp @@ -7,8 +7,6 @@ #include "IVideoDriver.h" #include "os.h" -namespace irr -{ namespace scene { @@ -307,4 +305,3 @@ ISceneNode *CCameraSceneNode::clone(ISceneNode *newParent, ISceneManager *newMan } } // end namespace -} // end namespace diff --git a/irr/src/CCameraSceneNode.h b/irr/src/CCameraSceneNode.h index 668756300..08697cd2d 100644 --- a/irr/src/CCameraSceneNode.h +++ b/irr/src/CCameraSceneNode.h @@ -7,8 +7,6 @@ #include "ICameraSceneNode.h" #include "SViewFrustum.h" -namespace irr -{ namespace scene { @@ -162,4 +160,3 @@ protected: }; } // end namespace -} // end namespace diff --git a/irr/src/CColorConverter.cpp b/irr/src/CColorConverter.cpp index d1bd302c7..38a178f2d 100644 --- a/irr/src/CColorConverter.cpp +++ b/irr/src/CColorConverter.cpp @@ -16,8 +16,6 @@ // convert_A1R5G5B5toR8G8B8 converts 0bARRRRRGGGGGBBBBB into [R][G][B]. // This also means many conversions may be broken on big endian. -namespace irr -{ namespace video { @@ -650,4 +648,3 @@ void CColorConverter::convert_viaFormat(const void *sP, ECOLOR_FORMAT sF, s32 sN } } // end namespace video -} // end namespace irr diff --git a/irr/src/CColorConverter.h b/irr/src/CColorConverter.h index 8db7af097..804248768 100644 --- a/irr/src/CColorConverter.h +++ b/irr/src/CColorConverter.h @@ -7,8 +7,6 @@ #include "irrTypes.h" #include "IImage.h" -namespace irr -{ namespace video { @@ -81,4 +79,3 @@ public: }; } // end namespace video -} // end namespace irr diff --git a/irr/src/CDummyTransformationSceneNode.cpp b/irr/src/CDummyTransformationSceneNode.cpp index e354038df..5444f5659 100644 --- a/irr/src/CDummyTransformationSceneNode.cpp +++ b/irr/src/CDummyTransformationSceneNode.cpp @@ -5,8 +5,6 @@ #include "CDummyTransformationSceneNode.h" #include "os.h" -namespace irr -{ namespace scene { @@ -95,4 +93,3 @@ void CDummyTransformationSceneNode::setPosition(const core::vector3df &newpos) } } // end namespace scene -} // end namespace irr diff --git a/irr/src/CDummyTransformationSceneNode.h b/irr/src/CDummyTransformationSceneNode.h index a03ed07fa..11c235ecb 100644 --- a/irr/src/CDummyTransformationSceneNode.h +++ b/irr/src/CDummyTransformationSceneNode.h @@ -6,8 +6,6 @@ #include "IDummyTransformationSceneNode.h" -namespace irr -{ namespace scene { @@ -52,4 +50,3 @@ private: }; } // end namespace scene -} // end namespace irr diff --git a/irr/src/CEGLManager.cpp b/irr/src/CEGLManager.cpp index b70a0c091..5770ac3bb 100644 --- a/irr/src/CEGLManager.cpp +++ b/irr/src/CEGLManager.cpp @@ -10,8 +10,6 @@ #include "irrArray.h" #include "os.h" -namespace irr -{ namespace video { @@ -294,7 +292,7 @@ EGLConfig CEGLManager::chooseConfig(EConfigStyle confStyle) return configResult; } -irr::s32 CEGLManager::rateConfig(EGLConfig config, EGLint eglOpenGLBIT, bool log) +s32 CEGLManager::rateConfig(EGLConfig config, EGLint eglOpenGLBIT, bool log) { // some values must be there or we ignore the config #ifdef EGL_VERSION_1_3 @@ -572,7 +570,6 @@ bool CEGLManager::testEGLError() return true; } -} } #endif diff --git a/irr/src/CEGLManager.h b/irr/src/CEGLManager.h index 49371e469..36fff19b7 100644 --- a/irr/src/CEGLManager.h +++ b/irr/src/CEGLManager.h @@ -12,8 +12,6 @@ #include "SExposedVideoData.h" #include "IContextManager.h" -namespace irr -{ namespace video { // EGL manager. @@ -80,13 +78,13 @@ protected: //! Check how close this config is to the parameters we requested //! returns 0 is perfect, larger values are worse and < 0 is unusable. - irr::s32 rateConfig(EGLConfig config, EGLint eglOpenGLBIT, bool log = false); + s32 rateConfig(EGLConfig config, EGLint eglOpenGLBIT, bool log = false); // Helper to sort EGLConfig's. (because we got no std::pair....) struct SConfigRating { EGLConfig config; - irr::s32 rating; + s32 rating; bool operator<(const SConfigRating &other) const { return rating < other.rating; @@ -110,5 +108,4 @@ private: EGLint MinorVersion; }; } -} #endif diff --git a/irr/src/CEmptySceneNode.cpp b/irr/src/CEmptySceneNode.cpp index 70a2ca21d..e1e7101d8 100644 --- a/irr/src/CEmptySceneNode.cpp +++ b/irr/src/CEmptySceneNode.cpp @@ -5,8 +5,6 @@ #include "CEmptySceneNode.h" #include "ISceneManager.h" -namespace irr -{ namespace scene { @@ -58,4 +56,3 @@ ISceneNode *CEmptySceneNode::clone(ISceneNode *newParent, ISceneManager *newMana } } // end namespace scene -} // end namespace irr diff --git a/irr/src/CEmptySceneNode.h b/irr/src/CEmptySceneNode.h index bf5c48e9b..4a1557f9c 100644 --- a/irr/src/CEmptySceneNode.h +++ b/irr/src/CEmptySceneNode.h @@ -6,8 +6,6 @@ #include "ISceneNode.h" -namespace irr -{ namespace scene { @@ -37,4 +35,3 @@ private: }; } // end namespace scene -} // end namespace irr diff --git a/irr/src/CFPSCounter.cpp b/irr/src/CFPSCounter.cpp index 0542fc5cb..b04785b79 100644 --- a/irr/src/CFPSCounter.cpp +++ b/irr/src/CFPSCounter.cpp @@ -5,8 +5,6 @@ #include "CFPSCounter.h" #include "irrMath.h" -namespace irr -{ namespace video { @@ -32,4 +30,3 @@ void CFPSCounter::registerFrame(u32 now) } } // end namespace video -} // end namespace irr diff --git a/irr/src/CFPSCounter.h b/irr/src/CFPSCounter.h index 692aef6bd..071c1c275 100644 --- a/irr/src/CFPSCounter.h +++ b/irr/src/CFPSCounter.h @@ -6,8 +6,6 @@ #include "irrTypes.h" -namespace irr -{ namespace video { @@ -29,4 +27,3 @@ private: }; } // end namespace video -} // end namespace irr diff --git a/irr/src/CFileList.cpp b/irr/src/CFileList.cpp index 9294f3f46..4087cfc2a 100644 --- a/irr/src/CFileList.cpp +++ b/irr/src/CFileList.cpp @@ -8,8 +8,6 @@ #include "os.h" -namespace irr -{ namespace io { @@ -147,5 +145,4 @@ const io::path &CFileList::getPath() const return Path; } -} // end namespace irr } // end namespace io diff --git a/irr/src/CFileList.h b/irr/src/CFileList.h index 1af975b22..bb0e62cb1 100644 --- a/irr/src/CFileList.h +++ b/irr/src/CFileList.h @@ -8,8 +8,6 @@ #include "irrString.h" #include "irrArray.h" -namespace irr -{ namespace io { @@ -124,5 +122,4 @@ protected: core::array Files; }; -} // end namespace irr } // end namespace io diff --git a/irr/src/CFileSystem.cpp b/irr/src/CFileSystem.cpp index d8f04eb1d..16d8e372f 100644 --- a/irr/src/CFileSystem.cpp +++ b/irr/src/CFileSystem.cpp @@ -35,8 +35,6 @@ #include #endif -namespace irr -{ namespace io { @@ -488,5 +486,4 @@ IFileSystem *createFileSystem() return new CFileSystem(); } -} // end namespace irr } // end namespace io diff --git a/irr/src/CFileSystem.h b/irr/src/CFileSystem.h index d2a627e49..adcc47853 100644 --- a/irr/src/CFileSystem.h +++ b/irr/src/CFileSystem.h @@ -7,8 +7,6 @@ #include #include "IFileSystem.h" -namespace irr -{ namespace io { @@ -98,5 +96,4 @@ private: std::vector ArchiveLoader; }; -} // end namespace irr } // end namespace io diff --git a/irr/src/CGLTFMeshFileLoader.cpp b/irr/src/CGLTFMeshFileLoader.cpp index 53ae1b580..238be28d8 100644 --- a/irr/src/CGLTFMeshFileLoader.cpp +++ b/irr/src/CGLTFMeshFileLoader.cpp @@ -30,8 +30,6 @@ #include #include -namespace irr { - /* Notes on the coordinate system. * * glTF uses a right-handed coordinate system where +Z is the @@ -920,5 +918,3 @@ tiniergltf::GlTF SelfType::parseGLTF(io::IReadFile* file) } } // namespace scene - -} // namespace irr diff --git a/irr/src/CGLTFMeshFileLoader.h b/irr/src/CGLTFMeshFileLoader.h index a4eac8baa..c15307b22 100644 --- a/irr/src/CGLTFMeshFileLoader.h +++ b/irr/src/CGLTFMeshFileLoader.h @@ -17,9 +17,6 @@ #include #include -namespace irr -{ - namespace scene { @@ -165,5 +162,3 @@ private: } // namespace scene -} // namespace irr - diff --git a/irr/src/CGLXManager.cpp b/irr/src/CGLXManager.cpp index 89a5cac20..93ec81632 100644 --- a/irr/src/CGLXManager.cpp +++ b/irr/src/CGLXManager.cpp @@ -15,8 +15,6 @@ #include #include -namespace irr -{ namespace video { @@ -391,7 +389,6 @@ bool CGLXManager::swapBuffers() return true; } -} } #endif diff --git a/irr/src/CGLXManager.h b/irr/src/CGLXManager.h index f940d4316..f3e86e7ed 100644 --- a/irr/src/CGLXManager.h +++ b/irr/src/CGLXManager.h @@ -16,8 +16,6 @@ // we can't include glx.h here, because gl.h has incompatible types with ogl es headers and it // cause redefinition errors, thats why we use ugly trick with void* types and casts. -namespace irr -{ namespace video { // GLX manager. @@ -71,6 +69,5 @@ private: XID GlxWin; // GLXWindow }; } -} #endif diff --git a/irr/src/CGUIButton.cpp b/irr/src/CGUIButton.cpp index ea685be94..c5dc18c08 100644 --- a/irr/src/CGUIButton.cpp +++ b/irr/src/CGUIButton.cpp @@ -10,8 +10,6 @@ #include "IGUIFont.h" #include "os.h" -namespace irr -{ namespace gui { @@ -411,7 +409,7 @@ video::SColor CGUIButton::getOverrideColor() const return OverrideColor; } -irr::video::SColor CGUIButton::getActiveColor() const +video::SColor CGUIButton::getActiveColor() const { if (OverrideColorEnabled) return OverrideColor; @@ -494,4 +492,3 @@ bool CGUIButton::isDrawingBorder() const } } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIButton.h b/irr/src/CGUIButton.h index 8a1434025..840131a42 100644 --- a/irr/src/CGUIButton.h +++ b/irr/src/CGUIButton.h @@ -9,8 +9,6 @@ #include "ITexture.h" #include "SColor.h" -namespace irr -{ namespace gui { @@ -234,4 +232,3 @@ private: }; } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUICheckBox.cpp b/irr/src/CGUICheckBox.cpp index 4d407e676..0f23b2b56 100644 --- a/irr/src/CGUICheckBox.cpp +++ b/irr/src/CGUICheckBox.cpp @@ -10,8 +10,6 @@ #include "IGUIFont.h" #include "os.h" -namespace irr -{ namespace gui { @@ -191,4 +189,3 @@ bool CGUICheckBox::isDrawBorderEnabled() const } } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUICheckBox.h b/irr/src/CGUICheckBox.h index 2c2a98f04..f13cdfacd 100644 --- a/irr/src/CGUICheckBox.h +++ b/irr/src/CGUICheckBox.h @@ -6,8 +6,6 @@ #include "IGUICheckBox.h" -namespace irr -{ namespace gui { @@ -52,4 +50,3 @@ private: }; } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIComboBox.cpp b/irr/src/CGUIComboBox.cpp index b55602b0c..0262566de 100644 --- a/irr/src/CGUIComboBox.cpp +++ b/irr/src/CGUIComboBox.cpp @@ -13,8 +13,6 @@ #include "CGUIListBox.h" #include "os.h" -namespace irr -{ namespace gui { @@ -456,4 +454,3 @@ void CGUIComboBox::openCloseMenu() } } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIComboBox.h b/irr/src/CGUIComboBox.h index 77f1eca1a..361924471 100644 --- a/irr/src/CGUIComboBox.h +++ b/irr/src/CGUIComboBox.h @@ -9,8 +9,6 @@ #include "irrString.h" #include "irrArray.h" -namespace irr -{ namespace gui { class IGUIButton; @@ -101,4 +99,3 @@ private: }; } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIEditBox.cpp b/irr/src/CGUIEditBox.cpp index 1bce60a04..34ae5a9c8 100644 --- a/irr/src/CGUIEditBox.cpp +++ b/irr/src/CGUIEditBox.cpp @@ -21,8 +21,6 @@ numerical */ -namespace irr -{ namespace gui { @@ -314,7 +312,7 @@ bool CGUIEditBox::processKey(const SEvent &event) // add the string const c8 *p = Operator->getTextFromClipboard(); if (p) { - irr::core::stringw widep; + core::stringw widep; core::utf8ToWString(widep, p); if (MarkBegin == MarkEnd) { @@ -936,13 +934,13 @@ wchar_t CGUIEditBox::getCursorChar() const } //! Set the blinktime for the cursor. 2x blinktime is one full cycle. -void CGUIEditBox::setCursorBlinkTime(irr::u32 timeMs) +void CGUIEditBox::setCursorBlinkTime(u32 timeMs) { CursorBlinkTime = timeMs; } //! Get the cursor blinktime -irr::u32 CGUIEditBox::getCursorBlinkTime() const +u32 CGUIEditBox::getCursorBlinkTime() const { return CursorBlinkTime; } @@ -950,7 +948,7 @@ irr::u32 CGUIEditBox::getCursorBlinkTime() const bool CGUIEditBox::processMouse(const SEvent &event) { switch (event.MouseInput.Event) { - case irr::EMIE_LMOUSE_LEFT_UP: + case EMIE_LMOUSE_LEFT_UP: if (Environment->hasFocus(this)) { CursorPos = getCursorPos(event.MouseInput.X, event.MouseInput.Y); if (MouseMarking) { @@ -961,7 +959,7 @@ bool CGUIEditBox::processMouse(const SEvent &event) return true; } break; - case irr::EMIE_MOUSE_MOVED: { + case EMIE_MOUSE_MOVED: { if (MouseMarking) { CursorPos = getCursorPos(event.MouseInput.X, event.MouseInput.Y); setTextMarkers(MarkBegin, CursorPos); @@ -1011,7 +1009,7 @@ bool CGUIEditBox::processMouse(const SEvent &event) // paste from the primary selection inputString([&] { - irr::core::stringw inserted_text; + core::stringw inserted_text; if (!Operator) return inserted_text; const c8 *inserted_text_utf8 = Operator->getTextFromPrimarySelection(); @@ -1349,7 +1347,7 @@ void CGUIEditBox::calculateScrollPos() { // get cursor position // get cursor area - irr::u32 cursorWidth = font->getDimension(CursorChar.c_str()).Width; + u32 cursorWidth = font->getDimension(CursorChar.c_str()).Width; core::stringw *txtLine = hasBrokenText ? &BrokenText[cursLine] : &Text; s32 cPos = hasBrokenText ? CursorPos - BrokenTextPositions[cursLine] : CursorPos; // column s32 cStart = font->getDimension(txtLine->subString(0, cPos).c_str()).Width; // pixels from text-start @@ -1380,9 +1378,9 @@ void CGUIEditBox::calculateScrollPos() // calculate vertical scrolling if (hasBrokenText) { - irr::u32 lineHeight = font->getDimension(L"A").Height + font->getKerning(L'A').Y; + u32 lineHeight = font->getDimension(L"A").Height + font->getKerning(L'A').Y; // only up to 1 line fits? - if (lineHeight >= (irr::u32)FrameRect.getHeight()) { + if (lineHeight >= (u32)FrameRect.getHeight()) { VScrollPos = 0; setTextRect(cursLine); s32 unscrolledPos = CurrentTextRect.UpperLeftCorner.Y; @@ -1486,4 +1484,3 @@ bool CGUIEditBox::acceptsIME() } } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIEditBox.h b/irr/src/CGUIEditBox.h index 35ab5f73e..39e21ddec 100644 --- a/irr/src/CGUIEditBox.h +++ b/irr/src/CGUIEditBox.h @@ -8,8 +8,6 @@ #include "irrArray.h" #include "IOSOperator.h" -namespace irr -{ namespace gui { class CGUIEditBox : public IGUIEditBox @@ -117,10 +115,10 @@ public: //! Set the blinktime for the cursor. 2x blinktime is one full cycle. //** \param timeMs Blinktime in milliseconds. When set to 0 the cursor is constantly on without blinking */ - void setCursorBlinkTime(irr::u32 timeMs) override; + void setCursorBlinkTime(u32 timeMs) override; //! Get the cursor blinktime - irr::u32 getCursorBlinkTime() const override; + u32 getCursorBlinkTime() const override; //! Sets whether the edit box is a password box. Setting this to true will /** disable MultiLine, WordWrap and the ability to copy with ctrl+c or ctrl+x @@ -176,7 +174,7 @@ protected: IOSOperator *Operator; u32 BlinkStartTime; - irr::u32 CursorBlinkTime; + u32 CursorBlinkTime; core::stringw CursorChar; // IGUIFont::draw needs stringw instead of wchar_t s32 CursorPos; s32 HScrollPos, VScrollPos; // scroll position in characters @@ -193,4 +191,3 @@ protected: }; } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIEnvironment.cpp b/irr/src/CGUIEnvironment.cpp index abfa0aab9..73b77b1ba 100644 --- a/irr/src/CGUIEnvironment.cpp +++ b/irr/src/CGUIEnvironment.cpp @@ -28,8 +28,6 @@ #endif #include "os.h" -namespace irr -{ namespace gui { @@ -992,4 +990,3 @@ IGUIEnvironment *createGUIEnvironment(io::IFileSystem *fs, } } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIEnvironment.h b/irr/src/CGUIEnvironment.h index 194941599..8d315aef7 100644 --- a/irr/src/CGUIEnvironment.h +++ b/irr/src/CGUIEnvironment.h @@ -10,9 +10,6 @@ #include "IFileSystem.h" #include "IOSOperator.h" -namespace irr -{ - namespace gui { @@ -223,4 +220,3 @@ private: }; } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIFileOpenDialog.cpp b/irr/src/CGUIFileOpenDialog.cpp index 7add9d8e1..f570d4a03 100644 --- a/irr/src/CGUIFileOpenDialog.cpp +++ b/irr/src/CGUIFileOpenDialog.cpp @@ -14,8 +14,6 @@ #include "IFileList.h" #include "os.h" -namespace irr -{ namespace gui { @@ -152,13 +150,13 @@ const wchar_t *CGUIFileOpenDialog::getDirectoryNameW() const return FileDirectoryFlatW.c_str(); } -void CGUIFileOpenDialog::setFileName(const irr::io::path &name) +void CGUIFileOpenDialog::setFileName(const io::path &name) { FileName = name; pathToStringW(FileNameW, FileName); } -void CGUIFileOpenDialog::setDirectoryName(const irr::io::path &name) +void CGUIFileOpenDialog::setDirectoryName(const io::path &name) { FileDirectory = name; FileDirectoryFlat = name; @@ -307,7 +305,7 @@ void CGUIFileOpenDialog::draw() IGUIElement::draw(); } -void CGUIFileOpenDialog::pathToStringW(irr::core::stringw &result, const irr::io::path &p) +void CGUIFileOpenDialog::pathToStringW(core::stringw &result, const io::path &p) { core::multibyteToWString(result, p); } @@ -365,4 +363,3 @@ void CGUIFileOpenDialog::sendCancelEvent() } } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIFileOpenDialog.h b/irr/src/CGUIFileOpenDialog.h index 133509233..dba292eb9 100644 --- a/irr/src/CGUIFileOpenDialog.h +++ b/irr/src/CGUIFileOpenDialog.h @@ -10,8 +10,6 @@ #include "IGUIEditBox.h" #include "IFileSystem.h" -namespace irr -{ namespace gui { @@ -45,11 +43,11 @@ public: void draw() override; protected: - void setFileName(const irr::io::path &name); - void setDirectoryName(const irr::io::path &name); + void setFileName(const io::path &name); + void setDirectoryName(const io::path &name); //! Ensure filenames are converted correct depending on wide-char settings - void pathToStringW(irr::core::stringw &result, const irr::io::path &p); + void pathToStringW(core::stringw &result, const io::path &p); //! fills the listbox with files. void fillListBox(); @@ -81,4 +79,3 @@ protected: }; } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIFont.cpp b/irr/src/CGUIFont.cpp index 9d8b1d488..25d61515f 100644 --- a/irr/src/CGUIFont.cpp +++ b/irr/src/CGUIFont.cpp @@ -11,8 +11,6 @@ #include "IVideoDriver.h" #include "IGUISpriteBank.h" -namespace irr -{ namespace gui { @@ -396,4 +394,3 @@ IGUISpriteBank *CGUIFont::getSpriteBank() const } } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIFont.h b/irr/src/CGUIFont.h index 8a3b8100b..087370a19 100644 --- a/irr/src/CGUIFont.h +++ b/irr/src/CGUIFont.h @@ -10,9 +10,6 @@ #include "irrArray.h" #include -namespace irr -{ - namespace video { class IVideoDriver; @@ -103,4 +100,3 @@ private: }; } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIImage.cpp b/irr/src/CGUIImage.cpp index a17e8f2d0..5c8f4bfb1 100644 --- a/irr/src/CGUIImage.cpp +++ b/irr/src/CGUIImage.cpp @@ -8,8 +8,6 @@ #include "IGUIEnvironment.h" #include "IVideoDriver.h" -namespace irr -{ namespace gui { @@ -157,4 +155,3 @@ core::rect CGUIImage::getDrawBounds() const } } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIImage.h b/irr/src/CGUIImage.h index 967ac40ea..fc6b62e4f 100644 --- a/irr/src/CGUIImage.h +++ b/irr/src/CGUIImage.h @@ -6,8 +6,6 @@ #include "IGUIImage.h" -namespace irr -{ namespace gui { @@ -94,4 +92,3 @@ private: }; } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIImageList.cpp b/irr/src/CGUIImageList.cpp index b11f10b0c..3193c1779 100644 --- a/irr/src/CGUIImageList.cpp +++ b/irr/src/CGUIImageList.cpp @@ -4,8 +4,6 @@ #include "CGUIImageList.h" -namespace irr -{ namespace gui { @@ -77,4 +75,3 @@ void CGUIImageList::draw(s32 index, const core::position2d &destPos, } } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIImageList.h b/irr/src/CGUIImageList.h index afde14e0a..80f0c94c3 100644 --- a/irr/src/CGUIImageList.h +++ b/irr/src/CGUIImageList.h @@ -6,8 +6,6 @@ #include "IGUIImageList.h" #include "IVideoDriver.h" -namespace irr -{ namespace gui { @@ -62,4 +60,3 @@ private: }; } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIListBox.cpp b/irr/src/CGUIListBox.cpp index f8db2cf80..493bbf426 100644 --- a/irr/src/CGUIListBox.cpp +++ b/irr/src/CGUIListBox.cpp @@ -13,8 +13,6 @@ #include "CGUIScrollBar.h" #include "os.h" -namespace irr -{ namespace gui { @@ -738,4 +736,3 @@ IGUIScrollBar *CGUIListBox::getVerticalScrollBar() const } } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIListBox.h b/irr/src/CGUIListBox.h index ea1eaebd0..1fc94f4d5 100644 --- a/irr/src/CGUIListBox.h +++ b/irr/src/CGUIListBox.h @@ -7,8 +7,6 @@ #include "IGUIListBox.h" #include "irrArray.h" -namespace irr -{ namespace gui { @@ -170,4 +168,3 @@ private: }; } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIScrollBar.cpp b/irr/src/CGUIScrollBar.cpp index 5e7737bc1..b2bd464ad 100644 --- a/irr/src/CGUIScrollBar.cpp +++ b/irr/src/CGUIScrollBar.cpp @@ -12,8 +12,6 @@ #include "IGUIFontBitmap.h" #include "os.h" -namespace irr -{ namespace gui { @@ -456,4 +454,3 @@ void CGUIScrollBar::refreshControls() } } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIScrollBar.h b/irr/src/CGUIScrollBar.h index 82c5c5c26..4e3cb00e6 100644 --- a/irr/src/CGUIScrollBar.h +++ b/irr/src/CGUIScrollBar.h @@ -7,8 +7,6 @@ #include "IGUIScrollBar.h" #include "IGUIButton.h" -namespace irr -{ namespace gui { @@ -92,4 +90,3 @@ private: }; } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUISkin.cpp b/irr/src/CGUISkin.cpp index d900a40b1..9fe2312fc 100644 --- a/irr/src/CGUISkin.cpp +++ b/irr/src/CGUISkin.cpp @@ -11,8 +11,6 @@ #include "IGUIElement.h" #include "IVideoDriver.h" -namespace irr -{ namespace gui { @@ -876,4 +874,3 @@ void CGUISkin::getColors(video::SColor* colors) // END PATCH } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUISkin.h b/irr/src/CGUISkin.h index 704a09745..54fc19d82 100644 --- a/irr/src/CGUISkin.h +++ b/irr/src/CGUISkin.h @@ -9,8 +9,6 @@ #include #include "ITexture.h" -namespace irr -{ namespace video { class IVideoDriver; @@ -304,5 +302,4 @@ namespace gui }; } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUISpriteBank.cpp b/irr/src/CGUISpriteBank.cpp index ea3fe8788..afd8ca770 100644 --- a/irr/src/CGUISpriteBank.cpp +++ b/irr/src/CGUISpriteBank.cpp @@ -8,8 +8,6 @@ #include "IVideoDriver.h" #include "ITexture.h" -namespace irr -{ namespace gui { @@ -188,7 +186,7 @@ void CGUISpriteBank::draw2DSpriteBatch(const core::array &indices, u32 starttime, u32 currenttime, bool loop, bool center) { - const irr::u32 drawCount = core::min_(indices.size(), pos.size()); + const u32 drawCount = core::min_(indices.size(), pos.size()); if (!getTextureCount()) return; @@ -239,4 +237,3 @@ void CGUISpriteBank::draw2DSpriteBatch(const core::array &indices, } } // namespace gui -} // namespace irr diff --git a/irr/src/CGUISpriteBank.h b/irr/src/CGUISpriteBank.h index f46ca8b15..f06ac4d2c 100644 --- a/irr/src/CGUISpriteBank.h +++ b/irr/src/CGUISpriteBank.h @@ -6,9 +6,6 @@ #include "IGUISpriteBank.h" -namespace irr -{ - namespace video { class IVideoDriver; @@ -78,4 +75,3 @@ protected: }; } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIStaticText.cpp b/irr/src/CGUIStaticText.cpp index 4cd3f7905..92934be29 100644 --- a/irr/src/CGUIStaticText.cpp +++ b/irr/src/CGUIStaticText.cpp @@ -10,8 +10,6 @@ #include "IVideoDriver.h" #include "rect.h" -namespace irr -{ namespace gui { @@ -222,7 +220,7 @@ video::SColor CGUIStaticText::getOverrideColor() const return OverrideColor; } -irr::video::SColor CGUIStaticText::getActiveColor() const +video::SColor CGUIStaticText::getActiveColor() const { if (OverrideColorEnabled) return OverrideColor; @@ -506,4 +504,3 @@ s32 CGUIStaticText::getTextWidth() const } } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUIStaticText.h b/irr/src/CGUIStaticText.h index c127769f8..2beaf945d 100644 --- a/irr/src/CGUIStaticText.h +++ b/irr/src/CGUIStaticText.h @@ -7,8 +7,6 @@ #include "IGUIStaticText.h" #include "irrArray.h" -namespace irr -{ namespace gui { class CGUIStaticText : public IGUIStaticText @@ -128,4 +126,3 @@ private: }; } // end namespace gui -} // end namespace irr diff --git a/irr/src/CGUITabControl.cpp b/irr/src/CGUITabControl.cpp index bca7f0f21..e122bfa59 100644 --- a/irr/src/CGUITabControl.cpp +++ b/irr/src/CGUITabControl.cpp @@ -12,8 +12,6 @@ #include "rect.h" #include "os.h" -namespace irr -{ namespace gui { @@ -922,5 +920,4 @@ void CGUITabControl::updateAbsolutePosition() recalculateScrollBar(); } -} // end namespace irr } // end namespace gui diff --git a/irr/src/CGUITabControl.h b/irr/src/CGUITabControl.h index 5c167c2a3..e8b76ffde 100644 --- a/irr/src/CGUITabControl.h +++ b/irr/src/CGUITabControl.h @@ -8,8 +8,6 @@ #include "irrArray.h" #include "IGUISkin.h" -namespace irr -{ namespace gui { class CGUITabControl; @@ -172,4 +170,3 @@ private: }; } // end namespace gui -} // end namespace irr diff --git a/irr/src/CImage.cpp b/irr/src/CImage.cpp index 4366809ae..e7b668b0b 100644 --- a/irr/src/CImage.cpp +++ b/irr/src/CImage.cpp @@ -11,8 +11,6 @@ #include -namespace irr -{ namespace video { @@ -128,7 +126,7 @@ void CImage::copyTo(IImage *target, const core::position2d &pos) if (!Blit(BLITTER_TEXTURE, target, 0, &pos, this, 0, 0) && target && pos.X == 0 && pos.Y == 0 && CColorConverter::canConvertFormat(Format, target->getColorFormat())) { // No fast blitting, but copyToScaling uses other color conversions and might work - irr::core::dimension2du dim(target->getDimension()); + core::dimension2du dim(target->getDimension()); copyToScaling(target->getData(), dim.Width, dim.Height, target->getColorFormat(), target->getPitch()); } } @@ -377,4 +375,3 @@ inline SColor CImage::getPixelBox(s32 x, s32 y, s32 fx, s32 fy, s32 bias) const } } // end namespace video -} // end namespace irr diff --git a/irr/src/CImage.h b/irr/src/CImage.h index 33a34386e..a061a27b2 100644 --- a/irr/src/CImage.h +++ b/irr/src/CImage.h @@ -7,8 +7,6 @@ #include "IImage.h" #include "rect.h" -namespace irr -{ namespace video { @@ -71,4 +69,3 @@ private: }; } // end namespace video -} // end namespace irr diff --git a/irr/src/CImageLoaderJPG.cpp b/irr/src/CImageLoaderJPG.cpp index ec1a998b9..b0a70116e 100644 --- a/irr/src/CImageLoaderJPG.cpp +++ b/irr/src/CImageLoaderJPG.cpp @@ -11,8 +11,6 @@ #include "irrString.h" #include -namespace irr -{ namespace video { @@ -259,4 +257,3 @@ IImageLoader *createImageLoaderJPG() } } // end namespace video -} // end namespace irr diff --git a/irr/src/CImageLoaderJPG.h b/irr/src/CImageLoaderJPG.h index ffdc6c95c..3ab4da3d4 100644 --- a/irr/src/CImageLoaderJPG.h +++ b/irr/src/CImageLoaderJPG.h @@ -9,8 +9,6 @@ #include // IWYU pragma: keep (required for jpeglib.h) #include // use system lib -namespace irr -{ namespace video { @@ -83,4 +81,3 @@ private: }; } // end namespace video -} // end namespace irr diff --git a/irr/src/CImageLoaderPNG.cpp b/irr/src/CImageLoaderPNG.cpp index f1951e71b..b3c3d6fb1 100644 --- a/irr/src/CImageLoaderPNG.cpp +++ b/irr/src/CImageLoaderPNG.cpp @@ -11,8 +11,6 @@ #include "coreutil.h" #include "os.h" -namespace irr -{ namespace video { @@ -251,5 +249,4 @@ IImageLoader *createImageLoaderPNG() return new CImageLoaderPng(); } -} // end namespace irr } // end namespace video diff --git a/irr/src/CImageLoaderPNG.h b/irr/src/CImageLoaderPNG.h index f878320ba..4ca472d48 100644 --- a/irr/src/CImageLoaderPNG.h +++ b/irr/src/CImageLoaderPNG.h @@ -10,8 +10,6 @@ #include "IImageLoader.h" -namespace irr -{ namespace video { @@ -31,4 +29,3 @@ public: }; } // end namespace video -} // end namespace irr diff --git a/irr/src/CImageLoaderTGA.cpp b/irr/src/CImageLoaderTGA.cpp index 75b0b5679..81debe667 100644 --- a/irr/src/CImageLoaderTGA.cpp +++ b/irr/src/CImageLoaderTGA.cpp @@ -12,8 +12,6 @@ #define MAX(x, y) (((x) > (y)) ? (x) : (y)) -namespace irr -{ namespace video { @@ -138,13 +136,13 @@ IImage *CImageLoaderTGA::loadImage(io::IReadFile *file) const if (header.ColorMapType) { // Create 32 bit palette // `core::max_()` is not used here because it takes its inputs as references. Since `header` is packed, use the macro `MAX()` instead: - const irr::u16 paletteSize = MAX((u16)256u, header.ColorMapLength); // ColorMapLength can lie, but so far we only use palette for 8-bit, so ensure it has 256 entries + const u16 paletteSize = MAX((u16)256u, header.ColorMapLength); // ColorMapLength can lie, but so far we only use palette for 8-bit, so ensure it has 256 entries palette = new u32[paletteSize]; if (paletteSize > header.ColorMapLength) { // To catch images using palette colors with invalid indices - const irr::u32 errorCol = irr::video::SColor(255, 255, 0, 205).color; // bright magenta - for (irr::u16 i = header.ColorMapLength; i < paletteSize; ++i) + const u32 errorCol = video::SColor(255, 255, 0, 205).color; // bright magenta + for (u16 i = header.ColorMapLength; i < paletteSize; ++i) palette[i] = errorCol; } @@ -251,4 +249,3 @@ IImageLoader *createImageLoaderTGA() } } // end namespace video -} // end namespace irr diff --git a/irr/src/CImageLoaderTGA.h b/irr/src/CImageLoaderTGA.h index 18930da3d..ec85ed0c4 100644 --- a/irr/src/CImageLoaderTGA.h +++ b/irr/src/CImageLoaderTGA.h @@ -6,8 +6,6 @@ #include "IImageLoader.h" -namespace irr -{ namespace video { @@ -63,4 +61,3 @@ private: }; } // end namespace video -} // end namespace irr diff --git a/irr/src/CImageWriterJPG.cpp b/irr/src/CImageWriterJPG.cpp index 778d1fb74..bc1b748ec 100644 --- a/irr/src/CImageWriterJPG.cpp +++ b/irr/src/CImageWriterJPG.cpp @@ -14,8 +14,6 @@ #include #include -namespace irr -{ namespace video { @@ -156,10 +154,7 @@ static bool writeJPEGFile(io::IWriteFile *file, IImage *image, u32 quality) } } // namespace video -} // namespace irr -namespace irr -{ namespace video { @@ -182,4 +177,3 @@ bool CImageWriterJPG::writeImage(io::IWriteFile *file, IImage *image, u32 qualit } } // namespace video -} // namespace irr diff --git a/irr/src/CImageWriterJPG.h b/irr/src/CImageWriterJPG.h index 1d8dde53f..b177bf6bb 100644 --- a/irr/src/CImageWriterJPG.h +++ b/irr/src/CImageWriterJPG.h @@ -6,8 +6,6 @@ #include "IImageWriter.h" -namespace irr -{ namespace video { @@ -25,4 +23,3 @@ public: }; } -} diff --git a/irr/src/CImageWriterPNG.cpp b/irr/src/CImageWriterPNG.cpp index 51332d285..8165054e3 100644 --- a/irr/src/CImageWriterPNG.cpp +++ b/irr/src/CImageWriterPNG.cpp @@ -12,8 +12,6 @@ #include // use system lib png #include -namespace irr -{ namespace video { @@ -179,4 +177,3 @@ bool CImageWriterPNG::writeImage(io::IWriteFile *file, IImage *image, u32 param) } } // namespace video -} // namespace irr diff --git a/irr/src/CImageWriterPNG.h b/irr/src/CImageWriterPNG.h index b0f7348ee..db7d9664a 100644 --- a/irr/src/CImageWriterPNG.h +++ b/irr/src/CImageWriterPNG.h @@ -6,8 +6,6 @@ #include "IImageWriter.h" -namespace irr -{ namespace video { @@ -25,4 +23,3 @@ public: }; } // namespace video -} // namespace irr diff --git a/irr/src/CIrrDeviceLinux.cpp b/irr/src/CIrrDeviceLinux.cpp index f72ccc7a1..3ec9e6481 100644 --- a/irr/src/CIrrDeviceLinux.cpp +++ b/irr/src/CIrrDeviceLinux.cpp @@ -58,7 +58,7 @@ #else // linux/joystick.h includes linux/input.h, which #defines values for various KEY_FOO keys. -// These override the irr::KEY_FOO equivalents, which stops key handling from working. +// These override the KEY_FOO equivalents, which stops key handling from working. // As a workaround, defining _INPUT_H stops linux/input.h from being included; it // doesn't actually seem to be necessary except to pull in sys/ioctl.h. #define _INPUT_H @@ -88,8 +88,6 @@ int XI_EXTENSIONS_OPCODE; #endif } -namespace irr -{ //! constructor CIrrDeviceLinux::CIrrDeviceLinux(const SIrrlichtCreationParameters ¶m) : CIrrDeviceStub(param), @@ -738,17 +736,17 @@ bool CIrrDeviceLinux::run() break; case MotionNotify: - irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT; - irrevent.MouseInput.Event = irr::EMIE_MOUSE_MOVED; + irrevent.EventType = EET_MOUSE_INPUT_EVENT; + irrevent.MouseInput.Event = EMIE_MOUSE_MOVED; irrevent.MouseInput.X = event.xbutton.x; irrevent.MouseInput.Y = event.xbutton.y; irrevent.MouseInput.Control = (event.xkey.state & ControlMask) != 0; irrevent.MouseInput.Shift = (event.xkey.state & ShiftMask) != 0; // mouse button states - irrevent.MouseInput.ButtonStates = (event.xbutton.state & Button1Mask) ? irr::EMBSM_LEFT : 0; - irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button3Mask) ? irr::EMBSM_RIGHT : 0; - irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button2Mask) ? irr::EMBSM_MIDDLE : 0; + irrevent.MouseInput.ButtonStates = (event.xbutton.state & Button1Mask) ? EMBSM_LEFT : 0; + irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button3Mask) ? EMBSM_RIGHT : 0; + irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button2Mask) ? EMBSM_MIDDLE : 0; postEventFromUser(irrevent); break; @@ -756,7 +754,7 @@ bool CIrrDeviceLinux::run() case ButtonPress: case ButtonRelease: - irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT; + irrevent.EventType = EET_MOUSE_INPUT_EVENT; irrevent.MouseInput.X = event.xbutton.x; irrevent.MouseInput.Y = event.xbutton.y; irrevent.MouseInput.Control = (event.xkey.state & ControlMask) != 0; @@ -766,29 +764,29 @@ bool CIrrDeviceLinux::run() // This sets the state which the buttons had _prior_ to the event. // So unlike on Windows the button which just got changed has still the old state here. // We handle that below by flipping the corresponding bit later. - irrevent.MouseInput.ButtonStates = (event.xbutton.state & Button1Mask) ? irr::EMBSM_LEFT : 0; - irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button3Mask) ? irr::EMBSM_RIGHT : 0; - irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button2Mask) ? irr::EMBSM_MIDDLE : 0; + irrevent.MouseInput.ButtonStates = (event.xbutton.state & Button1Mask) ? EMBSM_LEFT : 0; + irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button3Mask) ? EMBSM_RIGHT : 0; + irrevent.MouseInput.ButtonStates |= (event.xbutton.state & Button2Mask) ? EMBSM_MIDDLE : 0; - irrevent.MouseInput.Event = irr::EMIE_COUNT; + irrevent.MouseInput.Event = EMIE_COUNT; switch (event.xbutton.button) { case Button1: irrevent.MouseInput.Event = - (event.type == ButtonPress) ? irr::EMIE_LMOUSE_PRESSED_DOWN : irr::EMIE_LMOUSE_LEFT_UP; - irrevent.MouseInput.ButtonStates ^= irr::EMBSM_LEFT; + (event.type == ButtonPress) ? EMIE_LMOUSE_PRESSED_DOWN : EMIE_LMOUSE_LEFT_UP; + irrevent.MouseInput.ButtonStates ^= EMBSM_LEFT; break; case Button3: irrevent.MouseInput.Event = - (event.type == ButtonPress) ? irr::EMIE_RMOUSE_PRESSED_DOWN : irr::EMIE_RMOUSE_LEFT_UP; - irrevent.MouseInput.ButtonStates ^= irr::EMBSM_RIGHT; + (event.type == ButtonPress) ? EMIE_RMOUSE_PRESSED_DOWN : EMIE_RMOUSE_LEFT_UP; + irrevent.MouseInput.ButtonStates ^= EMBSM_RIGHT; break; case Button2: irrevent.MouseInput.Event = - (event.type == ButtonPress) ? irr::EMIE_MMOUSE_PRESSED_DOWN : irr::EMIE_MMOUSE_LEFT_UP; - irrevent.MouseInput.ButtonStates ^= irr::EMBSM_MIDDLE; + (event.type == ButtonPress) ? EMIE_MMOUSE_PRESSED_DOWN : EMIE_MMOUSE_LEFT_UP; + irrevent.MouseInput.ButtonStates ^= EMBSM_MIDDLE; break; case Button4: @@ -806,7 +804,7 @@ bool CIrrDeviceLinux::run() break; } - if (irrevent.MouseInput.Event != irr::EMIE_COUNT) { + if (irrevent.MouseInput.Event != EMIE_COUNT) { postEventFromUser(irrevent); if (irrevent.MouseInput.Event >= EMIE_LMOUSE_PRESSED_DOWN && irrevent.MouseInput.Event <= EMIE_MMOUSE_PRESSED_DOWN) { @@ -842,7 +840,7 @@ bool CIrrDeviceLinux::run() } } - irrevent.EventType = irr::EET_KEY_INPUT_EVENT; + irrevent.EventType = EET_KEY_INPUT_EVENT; irrevent.KeyInput.PressedDown = false; irrevent.KeyInput.Char = 0; // on release that's undefined irrevent.KeyInput.Control = (event.xkey.state & ControlMask) != 0; @@ -864,7 +862,7 @@ bool CIrrDeviceLinux::run() if (strLen > 0 && (status == XLookupChars || status == XLookupBoth)) { if (strLen > 1) { // Multiple characters: send string event - irrevent.EventType = irr::EET_STRING_INPUT_EVENT; + irrevent.EventType = EET_STRING_INPUT_EVENT; irrevent.StringInput.Str = new core::stringw(buf); postEventFromUser(irrevent); delete irrevent.StringInput.Str; @@ -899,7 +897,7 @@ bool CIrrDeviceLinux::run() irrevent.KeyInput.Char = tmp.wbuf[0]; } - irrevent.EventType = irr::EET_KEY_INPUT_EVENT; + irrevent.EventType = EET_KEY_INPUT_EVENT; irrevent.KeyInput.PressedDown = true; irrevent.KeyInput.Control = (event.xkey.state & ControlMask) != 0; irrevent.KeyInput.Shift = (event.xkey.state & ShiftMask) != 0; @@ -913,7 +911,7 @@ bool CIrrDeviceLinux::run() Close = true; } else { // we assume it's a user message - irrevent.EventType = irr::EET_USER_EVENT; + irrevent.EventType = EET_USER_EVENT; irrevent.UserEvent.UserData1 = static_cast(event.xclient.data.l[0]); irrevent.UserEvent.UserData2 = static_cast(event.xclient.data.l[1]); postEventFromUser(irrevent); @@ -1232,7 +1230,7 @@ void CIrrDeviceLinux::setResizable(bool resize) } //! Resize the render window. -void CIrrDeviceLinux::setWindowSize(const irr::core::dimension2d &size) +void CIrrDeviceLinux::setWindowSize(const core::dimension2d &size) { #ifdef _IRR_COMPILE_WITH_X11_ if (CreationParams.DriverType == video::EDT_NULL || CreationParams.Fullscreen) @@ -1563,7 +1561,7 @@ bool CIrrDeviceLinux::activateJoysticks(core::array &joystickInfo fcntl(info.fd, F_SETFL, O_NONBLOCK); #endif - info.persistentData.EventType = irr::EET_JOYSTICK_INPUT_EVENT; + info.persistentData.EventType = EET_JOYSTICK_INPUT_EVENT; info.persistentData.JoystickEvent.Joystick = ActiveJoysticks.size(); // There's no obvious way to determine which (if any) axes represent a POV @@ -1732,7 +1730,7 @@ const c8 *CIrrDeviceLinux::getTextFromSelection(Atom selection, core::stringc &t bytesLeft, 0, AnyPropertyType, &type, &format, &numItems, &dummy, &data); if (result == Success) - text_buffer = (irr::c8 *)data; + text_buffer = (c8 *)data; XFree(data); } @@ -1909,7 +1907,7 @@ void CIrrDeviceLinux::initXInput2() #ifdef _IRR_COMPILE_WITH_X11_ -Cursor CIrrDeviceLinux::TextureToMonochromeCursor(irr::video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot) +Cursor CIrrDeviceLinux::TextureToMonochromeCursor(video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot) { XImage *sourceImage = XCreateImage(XDisplay, VisualInfo->visual, 1, // depth, @@ -1994,7 +1992,7 @@ Cursor CIrrDeviceLinux::TextureToMonochromeCursor(irr::video::ITexture *tex, con } #ifdef _IRR_LINUX_XCURSOR_ -Cursor CIrrDeviceLinux::TextureToARGBCursor(irr::video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot) +Cursor CIrrDeviceLinux::TextureToARGBCursor(video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot) { XcursorImage *image = XcursorImageCreate(sourceRect.getWidth(), sourceRect.getHeight()); image->xhot = hotspot.X; @@ -2030,7 +2028,7 @@ Cursor CIrrDeviceLinux::TextureToARGBCursor(irr::video::ITexture *tex, const cor } #endif // #ifdef _IRR_LINUX_XCURSOR_ -Cursor CIrrDeviceLinux::TextureToCursor(irr::video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot) +Cursor CIrrDeviceLinux::TextureToCursor(video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot) { #ifdef _IRR_LINUX_XCURSOR_ return TextureToARGBCursor(tex, sourceRect, hotspot); @@ -2165,9 +2163,9 @@ gui::ECURSOR_ICON CIrrDeviceLinux::CCursorControl::addIcon(const gui::SCursorSpr CursorX11 cX11; cX11.FrameTime = icon.SpriteBank->getSprites()[icon.SpriteId].frameTime; for (u32 i = 0; i < icon.SpriteBank->getSprites()[icon.SpriteId].Frames.size(); ++i) { - irr::u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber; - irr::u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber; - irr::core::rect rectIcon = icon.SpriteBank->getPositions()[rectId]; + u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber; + u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber; + core::rect rectIcon = icon.SpriteBank->getPositions()[rectId]; Cursor cursor = Device->TextureToCursor(icon.SpriteBank->getTexture(texId), rectIcon, icon.HotSpot); cX11.Frames.push_back(CursorFrameX11(cursor)); } @@ -2194,9 +2192,9 @@ void CIrrDeviceLinux::CCursorControl::changeIcon(gui::ECURSOR_ICON iconId, const CursorX11 cX11; cX11.FrameTime = icon.SpriteBank->getSprites()[icon.SpriteId].frameTime; for (u32 i = 0; i < icon.SpriteBank->getSprites()[icon.SpriteId].Frames.size(); ++i) { - irr::u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber; - irr::u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber; - irr::core::rect rectIcon = icon.SpriteBank->getPositions()[rectId]; + u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber; + u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber; + core::rect rectIcon = icon.SpriteBank->getPositions()[rectId]; Cursor cursor = Device->TextureToCursor(icon.SpriteBank->getTexture(texId), rectIcon, icon.HotSpot); cX11.Frames.push_back(CursorFrameX11(cursor)); } @@ -2206,7 +2204,7 @@ void CIrrDeviceLinux::CCursorControl::changeIcon(gui::ECURSOR_ICON iconId, const #endif } -irr::core::dimension2di CIrrDeviceLinux::CCursorControl::getSupportedIconSize() const +core::dimension2di CIrrDeviceLinux::CCursorControl::getSupportedIconSize() const { // this returns the closest match that is smaller or same size, so we just pass a value which should be large enough for cursors unsigned int width = 0, height = 0; @@ -2216,6 +2214,4 @@ irr::core::dimension2di CIrrDeviceLinux::CCursorControl::getSupportedIconSize() return core::dimension2di(width, height); } -} // end namespace - #endif // _IRR_COMPILE_WITH_X11_DEVICE_ diff --git a/irr/src/CIrrDeviceLinux.h b/irr/src/CIrrDeviceLinux.h index f5ee81c6b..8745b2f8c 100644 --- a/irr/src/CIrrDeviceLinux.h +++ b/irr/src/CIrrDeviceLinux.h @@ -26,9 +26,6 @@ #define KeySym s32 #endif -namespace irr -{ - class CIrrDeviceLinux : public CIrrDeviceStub { public: @@ -79,7 +76,7 @@ public: void setResizable(bool resize = false) override; //! Resize the render window. - void setWindowSize(const irr::core::dimension2d &size) override; + void setWindowSize(const core::dimension2d &size) override; //! Minimizes the window. void minimizeWindow() override; @@ -128,10 +125,10 @@ public: #ifdef _IRR_COMPILE_WITH_X11_ // convert an Irrlicht texture to a X11 cursor - Cursor TextureToCursor(irr::video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot); - Cursor TextureToMonochromeCursor(irr::video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot); + Cursor TextureToCursor(video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot); + Cursor TextureToMonochromeCursor(video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot); #ifdef _IRR_LINUX_XCURSOR_ - Cursor TextureToARGBCursor(irr::video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot); + Cursor TextureToARGBCursor(video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot); #endif #endif @@ -467,6 +464,4 @@ private: #endif }; -} // end namespace irr - #endif // _IRR_COMPILE_WITH_X11_DEVICE_ diff --git a/irr/src/CIrrDeviceOSX.h b/irr/src/CIrrDeviceOSX.h index f4f159aa2..8e338a9cb 100644 --- a/irr/src/CIrrDeviceOSX.h +++ b/irr/src/CIrrDeviceOSX.h @@ -17,21 +17,16 @@ #include -namespace irr -{ class CIrrDeviceMacOSX; -} @interface CIrrDelegateOSX : NSObject -- (id)initWithDevice:(irr::CIrrDeviceMacOSX *)device; +- (id)initWithDevice:(CIrrDeviceMacOSX *)device; - (void)terminate:(id)sender; - (BOOL)isQuit; @end -namespace irr -{ class CIrrDeviceMacOSX : public CIrrDeviceStub { public: @@ -214,8 +209,8 @@ private: bool createWindow(); void initKeycodes(); void storeMouseLocation(); - void postMouseEvent(void *event, irr::SEvent &ievent); - void postKeyEvent(void *event, irr::SEvent &ievent, bool pressed); + void postMouseEvent(void *event, SEvent &ievent); + void postKeyEvent(void *event, SEvent &ievent, bool pressed); void pollJoysticks(); NSWindow *Window; @@ -233,6 +228,4 @@ private: bool IsResizable; }; -} // end namespace irr - #endif // _IRR_COMPILE_WITH_OSX_DEVICE_ diff --git a/irr/src/CIrrDeviceOSX.mm b/irr/src/CIrrDeviceOSX.mm index 859d9b752..7ee791b40 100644 --- a/irr/src/CIrrDeviceOSX.mm +++ b/irr/src/CIrrDeviceOSX.mm @@ -54,16 +54,16 @@ struct JoystickComponent struct JoystickInfo { - irr::core::array axisComp; - irr::core::array buttonComp; - irr::core::array hatComp; + core::array axisComp; + core::array buttonComp; + core::array hatComp; int hats; int axes; int buttons; int numActiveJoysticks; - irr::SEvent persistentData; + SEvent persistentData; IOHIDDeviceInterface **interface; bool removed; @@ -80,12 +80,12 @@ struct JoystickInfo buttonComp.clear(); hatComp.clear(); - persistentData.EventType = irr::EET_JOYSTICK_INPUT_EVENT; + persistentData.EventType = EET_JOYSTICK_INPUT_EVENT; persistentData.JoystickEvent.POV = 65535; persistentData.JoystickEvent.ButtonStates = 0; } }; -irr::core::array ActiveJoysticks; +core::array ActiveJoysticks; // helper functions for init joystick static IOReturn closeJoystickDevice(JoystickInfo *joyInfo) @@ -97,11 +97,11 @@ static IOReturn closeJoystickDevice(JoystickInfo *joyInfo) if (kIOReturnNotOpen == result) { /* do nothing as device was not opened, thus can't be closed */ } else if (kIOReturnSuccess != result) - irr::os::Printer::log("IOHIDDeviceInterface failed to close", irr::ELL_ERROR); + os::Printer::log("IOHIDDeviceInterface failed to close", ELL_ERROR); /* release the interface */ result = (*(joyInfo->interface))->Release(joyInfo->interface); if (kIOReturnSuccess != result) - irr::os::Printer::log("IOHIDDeviceInterface failed to release", irr::ELL_ERROR); + os::Printer::log("IOHIDDeviceInterface failed to release", ELL_ERROR); joyInfo->interface = NULL; } return result; @@ -202,10 +202,10 @@ static void joystickTopLevelElementHandler(const void *value, void *parameter) return; refCF = CFDictionaryGetValue((CFDictionaryRef)value, CFSTR(kIOHIDElementUsagePageKey)); if (!CFNumberGetValue((CFNumberRef)refCF, kCFNumberLongType, &((JoystickInfo *)parameter)->usagePage)) - irr::os::Printer::log("CFNumberGetValue error retrieving JoystickInfo->usagePage", irr::ELL_ERROR); + os::Printer::log("CFNumberGetValue error retrieving JoystickInfo->usagePage", ELL_ERROR); refCF = CFDictionaryGetValue((CFDictionaryRef)value, CFSTR(kIOHIDElementUsageKey)); if (!CFNumberGetValue((CFNumberRef)refCF, kCFNumberLongType, &((JoystickInfo *)parameter)->usage)) - irr::os::Printer::log("CFNumberGetValue error retrieving JoystickInfo->usage", irr::ELL_ERROR); + os::Printer::log("CFNumberGetValue error retrieving JoystickInfo->usage", ELL_ERROR); } static void getJoystickDeviceInfo(io_object_t hidDevice, CFMutableDictionaryRef hidProperties, JoystickInfo *joyInfo) @@ -231,18 +231,18 @@ static void getJoystickDeviceInfo(io_object_t hidDevice, CFMutableDictionaryRef refCF = CFDictionaryGetValue(usbProperties, CFSTR("USB Product Name")); if (refCF) { if (!CFStringGetCString((CFStringRef)refCF, joyInfo->joystickName, 256, CFStringGetSystemEncoding())) - irr::os::Printer::log("CFStringGetCString error getting joyInfo->joystickName", irr::ELL_ERROR); + os::Printer::log("CFStringGetCString error getting joyInfo->joystickName", ELL_ERROR); } /* get usage page and usage */ refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDPrimaryUsagePageKey)); if (refCF) { if (!CFNumberGetValue((CFNumberRef)refCF, kCFNumberLongType, &joyInfo->usagePage)) - irr::os::Printer::log("CFNumberGetValue error getting joyInfo->usagePage", irr::ELL_ERROR); + os::Printer::log("CFNumberGetValue error getting joyInfo->usagePage", ELL_ERROR); refCF = CFDictionaryGetValue(hidProperties, CFSTR(kIOHIDPrimaryUsageKey)); if (refCF) if (!CFNumberGetValue((CFNumberRef)refCF, kCFNumberLongType, &joyInfo->usage)) - irr::os::Printer::log("CFNumberGetValue error getting joyInfo->usage", irr::ELL_ERROR); + os::Printer::log("CFNumberGetValue error getting joyInfo->usage", ELL_ERROR); } if (NULL == refCF) /* get top level element HID usage page or usage */ @@ -259,12 +259,12 @@ static void getJoystickDeviceInfo(io_object_t hidDevice, CFMutableDictionaryRef CFRelease(usbProperties); } else - irr::os::Printer::log("IORegistryEntryCreateCFProperties failed to create usbProperties", irr::ELL_ERROR); + os::Printer::log("IORegistryEntryCreateCFProperties failed to create usbProperties", ELL_ERROR); if (kIOReturnSuccess != IOObjectRelease(parent2)) - irr::os::Printer::log("IOObjectRelease failed to release parent2", irr::ELL_ERROR); + os::Printer::log("IOObjectRelease failed to release parent2", ELL_ERROR); if (kIOReturnSuccess != IOObjectRelease(parent1)) - irr::os::Printer::log("IOObjectRelease failed to release parent1", irr::ELL_ERROR); + os::Printer::log("IOObjectRelease failed to release parent1", ELL_ERROR); } } @@ -436,11 +436,11 @@ long GetDictionaryLong(CFDictionaryRef theDict, const void *key) static bool firstLaunch = true; @implementation CIrrDelegateOSX { - irr::CIrrDeviceMacOSX *Device; + CIrrDeviceMacOSX *Device; bool Quit; } -- (id)initWithDevice:(irr::CIrrDeviceMacOSX *)device +- (id)initWithDevice:(CIrrDeviceMacOSX *)device { self = [super init]; @@ -513,8 +513,6 @@ static bool firstLaunch = true; @end -namespace irr -{ //! constructor CIrrDeviceMacOSX::CIrrDeviceMacOSX(const SIrrlichtCreationParameters ¶m) : CIrrDeviceStub(param), Window(NULL), Display(NULL), @@ -729,7 +727,7 @@ bool CIrrDeviceMacOSX::run() NSAutoreleasePool *Pool = [[NSAutoreleasePool alloc] init]; NSEvent *event; - irr::SEvent ievent; + SEvent ievent; os::Timer::tick(); storeMouseLocation(); @@ -748,13 +746,13 @@ bool CIrrDeviceMacOSX::run() break; case NSFlagsChanged: - ievent.EventType = irr::EET_KEY_INPUT_EVENT; + ievent.EventType = EET_KEY_INPUT_EVENT; ievent.KeyInput.Shift = ([(NSEvent *)event modifierFlags] & NSShiftKeyMask) != 0; ievent.KeyInput.Control = ([(NSEvent *)event modifierFlags] & NSControlKeyMask) != 0; if (IsShiftDown != ievent.KeyInput.Shift) { - ievent.KeyInput.Char = irr::KEY_SHIFT; - ievent.KeyInput.Key = irr::KEY_SHIFT; + ievent.KeyInput.Char = KEY_SHIFT; + ievent.KeyInput.Key = KEY_SHIFT; ievent.KeyInput.PressedDown = ievent.KeyInput.Shift; IsShiftDown = ievent.KeyInput.Shift; @@ -763,8 +761,8 @@ bool CIrrDeviceMacOSX::run() } if (IsControlDown != ievent.KeyInput.Control) { - ievent.KeyInput.Char = irr::KEY_CONTROL; - ievent.KeyInput.Key = irr::KEY_CONTROL; + ievent.KeyInput.Char = KEY_CONTROL; + ievent.KeyInput.Key = KEY_CONTROL; ievent.KeyInput.PressedDown = ievent.KeyInput.Control; IsControlDown = ievent.KeyInput.Control; @@ -776,34 +774,34 @@ bool CIrrDeviceMacOSX::run() break; case NSLeftMouseDown: - ievent.EventType = irr::EET_MOUSE_INPUT_EVENT; - ievent.MouseInput.Event = irr::EMIE_LMOUSE_PRESSED_DOWN; - MouseButtonStates |= irr::EMBSM_LEFT; + ievent.EventType = EET_MOUSE_INPUT_EVENT; + ievent.MouseInput.Event = EMIE_LMOUSE_PRESSED_DOWN; + MouseButtonStates |= EMBSM_LEFT; ievent.MouseInput.ButtonStates = MouseButtonStates; postMouseEvent(event, ievent); break; case NSLeftMouseUp: - ievent.EventType = irr::EET_MOUSE_INPUT_EVENT; - MouseButtonStates &= !irr::EMBSM_LEFT; + ievent.EventType = EET_MOUSE_INPUT_EVENT; + MouseButtonStates &= !EMBSM_LEFT; ievent.MouseInput.ButtonStates = MouseButtonStates; - ievent.MouseInput.Event = irr::EMIE_LMOUSE_LEFT_UP; + ievent.MouseInput.Event = EMIE_LMOUSE_LEFT_UP; postMouseEvent(event, ievent); break; case NSOtherMouseDown: - ievent.EventType = irr::EET_MOUSE_INPUT_EVENT; - ievent.MouseInput.Event = irr::EMIE_MMOUSE_PRESSED_DOWN; - MouseButtonStates |= irr::EMBSM_MIDDLE; + ievent.EventType = EET_MOUSE_INPUT_EVENT; + ievent.MouseInput.Event = EMIE_MMOUSE_PRESSED_DOWN; + MouseButtonStates |= EMBSM_MIDDLE; ievent.MouseInput.ButtonStates = MouseButtonStates; postMouseEvent(event, ievent); break; case NSOtherMouseUp: - ievent.EventType = irr::EET_MOUSE_INPUT_EVENT; - MouseButtonStates &= !irr::EMBSM_MIDDLE; + ievent.EventType = EET_MOUSE_INPUT_EVENT; + MouseButtonStates &= !EMBSM_MIDDLE; ievent.MouseInput.ButtonStates = MouseButtonStates; - ievent.MouseInput.Event = irr::EMIE_MMOUSE_LEFT_UP; + ievent.MouseInput.Event = EMIE_MMOUSE_LEFT_UP; postMouseEvent(event, ievent); break; @@ -811,31 +809,31 @@ bool CIrrDeviceMacOSX::run() case NSLeftMouseDragged: case NSRightMouseDragged: case NSOtherMouseDragged: - ievent.EventType = irr::EET_MOUSE_INPUT_EVENT; - ievent.MouseInput.Event = irr::EMIE_MOUSE_MOVED; + ievent.EventType = EET_MOUSE_INPUT_EVENT; + ievent.MouseInput.Event = EMIE_MOUSE_MOVED; ievent.MouseInput.ButtonStates = MouseButtonStates; postMouseEvent(event, ievent); break; case NSRightMouseDown: - ievent.EventType = irr::EET_MOUSE_INPUT_EVENT; - ievent.MouseInput.Event = irr::EMIE_RMOUSE_PRESSED_DOWN; - MouseButtonStates |= irr::EMBSM_RIGHT; + ievent.EventType = EET_MOUSE_INPUT_EVENT; + ievent.MouseInput.Event = EMIE_RMOUSE_PRESSED_DOWN; + MouseButtonStates |= EMBSM_RIGHT; ievent.MouseInput.ButtonStates = MouseButtonStates; postMouseEvent(event, ievent); break; case NSRightMouseUp: - ievent.EventType = irr::EET_MOUSE_INPUT_EVENT; - ievent.MouseInput.Event = irr::EMIE_RMOUSE_LEFT_UP; - MouseButtonStates &= !irr::EMBSM_RIGHT; + ievent.EventType = EET_MOUSE_INPUT_EVENT; + ievent.MouseInput.Event = EMIE_RMOUSE_LEFT_UP; + MouseButtonStates &= !EMBSM_RIGHT; ievent.MouseInput.ButtonStates = MouseButtonStates; postMouseEvent(event, ievent); break; case NSScrollWheel: - ievent.EventType = irr::EET_MOUSE_INPUT_EVENT; - ievent.MouseInput.Event = irr::EMIE_MOUSE_WHEEL; + ievent.EventType = EET_MOUSE_INPUT_EVENT; + ievent.MouseInput.Event = EMIE_MOUSE_WHEEL; ievent.MouseInput.Wheel = [(NSEvent *)event deltaY]; if (ievent.MouseInput.Wheel < 1.0f) ievent.MouseInput.Wheel *= 10.0f; @@ -924,7 +922,7 @@ bool CIrrDeviceMacOSX::isWindowMinimized() const return false; } -void CIrrDeviceMacOSX::postKeyEvent(void *event, irr::SEvent &ievent, bool pressed) +void CIrrDeviceMacOSX::postKeyEvent(void *event, SEvent &ievent, bool pressed) { NSString *str; std::map::const_iterator iter; @@ -947,7 +945,7 @@ void CIrrDeviceMacOSX::postKeyEvent(void *event, irr::SEvent &ievent, bool press else { // workaround for period character if (c == 0x2E) { - mkey = irr::KEY_PERIOD; + mkey = KEY_PERIOD; mchar = '.'; } else { cStr = (unsigned char *)[str cStringUsingEncoding:NSWindowsCP1252StringEncoding]; @@ -964,8 +962,8 @@ void CIrrDeviceMacOSX::postKeyEvent(void *event, irr::SEvent &ievent, bool press } } - ievent.EventType = irr::EET_KEY_INPUT_EVENT; - ievent.KeyInput.Key = (irr::EKEY_CODE)mkey; + ievent.EventType = EET_KEY_INPUT_EVENT; + ievent.KeyInput.Key = (EKEY_CODE)mkey; ievent.KeyInput.PressedDown = pressed; ievent.KeyInput.Shift = ([(NSEvent *)event modifierFlags] & NSShiftKeyMask) != 0; ievent.KeyInput.Control = ([(NSEvent *)event modifierFlags] & NSControlKeyMask) != 0; @@ -980,7 +978,7 @@ void CIrrDeviceMacOSX::postKeyEvent(void *event, irr::SEvent &ievent, bool press } } -void CIrrDeviceMacOSX::postMouseEvent(void *event, irr::SEvent &ievent) +void CIrrDeviceMacOSX::postMouseEvent(void *event, SEvent &ievent) { bool post = true; @@ -1033,9 +1031,9 @@ void CIrrDeviceMacOSX::storeMouseLocation() const core::position2di &curr = ((CCursorControl *)CursorControl)->getPosition(true); if (curr.X != x || curr.Y != y) { - irr::SEvent ievent; - ievent.EventType = irr::EET_MOUSE_INPUT_EVENT; - ievent.MouseInput.Event = irr::EMIE_MOUSE_MOVED; + SEvent ievent; + ievent.EventType = EET_MOUSE_INPUT_EVENT; + ievent.MouseInput.Event = EMIE_MOUSE_MOVED; ievent.MouseInput.X = x; ievent.MouseInput.Y = y; ievent.MouseInput.ButtonStates = MouseButtonStates; @@ -1084,119 +1082,119 @@ void CIrrDeviceMacOSX::setWindow(NSWindow *window) void CIrrDeviceMacOSX::initKeycodes() { - KeyCodes[kVK_UpArrow] = irr::KEY_UP; - KeyCodes[kVK_DownArrow] = irr::KEY_DOWN; - KeyCodes[kVK_LeftArrow] = irr::KEY_LEFT; - KeyCodes[kVK_RightArrow] = irr::KEY_RIGHT; - KeyCodes[kVK_F1] = irr::KEY_F1; - KeyCodes[kVK_F2] = irr::KEY_F2; - KeyCodes[kVK_F3] = irr::KEY_F3; - KeyCodes[kVK_F4] = irr::KEY_F4; - KeyCodes[kVK_F5] = irr::KEY_F5; - KeyCodes[kVK_F6] = irr::KEY_F6; - KeyCodes[kVK_F7] = irr::KEY_F7; - KeyCodes[kVK_F8] = irr::KEY_F8; - KeyCodes[kVK_F9] = irr::KEY_F9; - KeyCodes[kVK_F10] = irr::KEY_F10; - KeyCodes[kVK_F11] = irr::KEY_F11; - KeyCodes[kVK_F12] = irr::KEY_F12; - KeyCodes[kVK_F13] = irr::KEY_F13; - KeyCodes[kVK_F14] = irr::KEY_F14; - KeyCodes[kVK_F15] = irr::KEY_F15; - KeyCodes[kVK_F16] = irr::KEY_F16; - KeyCodes[kVK_F17] = irr::KEY_F17; - KeyCodes[kVK_F18] = irr::KEY_F18; - KeyCodes[kVK_F19] = irr::KEY_F19; - KeyCodes[kVK_F20] = irr::KEY_F20; - KeyCodes[kVK_Home] = irr::KEY_HOME; - KeyCodes[kVK_End] = irr::KEY_END; - KeyCodes[NSInsertFunctionKey] = irr::KEY_INSERT; - KeyCodes[kVK_ForwardDelete] = irr::KEY_DELETE; - KeyCodes[kVK_Help] = irr::KEY_HELP; - KeyCodes[NSSelectFunctionKey] = irr::KEY_SELECT; - KeyCodes[NSPrintFunctionKey] = irr::KEY_PRINT; - KeyCodes[NSExecuteFunctionKey] = irr::KEY_EXECUT; - KeyCodes[NSPrintScreenFunctionKey] = irr::KEY_SNAPSHOT; - KeyCodes[NSPauseFunctionKey] = irr::KEY_PAUSE; - KeyCodes[NSScrollLockFunctionKey] = irr::KEY_SCROLL; - KeyCodes[kVK_Delete] = irr::KEY_BACK; - KeyCodes[kVK_Tab] = irr::KEY_TAB; - KeyCodes[kVK_Return] = irr::KEY_RETURN; - KeyCodes[kVK_Escape] = irr::KEY_ESCAPE; - KeyCodes[kVK_Control] = irr::KEY_CONTROL; - KeyCodes[kVK_RightControl] = irr::KEY_RCONTROL; - KeyCodes[kVK_Command] = irr::KEY_MENU; - KeyCodes[kVK_Shift] = irr::KEY_SHIFT; - KeyCodes[kVK_RightShift] = irr::KEY_RSHIFT; - KeyCodes[kVK_Space] = irr::KEY_SPACE; + KeyCodes[kVK_UpArrow] = KEY_UP; + KeyCodes[kVK_DownArrow] = KEY_DOWN; + KeyCodes[kVK_LeftArrow] = KEY_LEFT; + KeyCodes[kVK_RightArrow] = KEY_RIGHT; + KeyCodes[kVK_F1] = KEY_F1; + KeyCodes[kVK_F2] = KEY_F2; + KeyCodes[kVK_F3] = KEY_F3; + KeyCodes[kVK_F4] = KEY_F4; + KeyCodes[kVK_F5] = KEY_F5; + KeyCodes[kVK_F6] = KEY_F6; + KeyCodes[kVK_F7] = KEY_F7; + KeyCodes[kVK_F8] = KEY_F8; + KeyCodes[kVK_F9] = KEY_F9; + KeyCodes[kVK_F10] = KEY_F10; + KeyCodes[kVK_F11] = KEY_F11; + KeyCodes[kVK_F12] = KEY_F12; + KeyCodes[kVK_F13] = KEY_F13; + KeyCodes[kVK_F14] = KEY_F14; + KeyCodes[kVK_F15] = KEY_F15; + KeyCodes[kVK_F16] = KEY_F16; + KeyCodes[kVK_F17] = KEY_F17; + KeyCodes[kVK_F18] = KEY_F18; + KeyCodes[kVK_F19] = KEY_F19; + KeyCodes[kVK_F20] = KEY_F20; + KeyCodes[kVK_Home] = KEY_HOME; + KeyCodes[kVK_End] = KEY_END; + KeyCodes[NSInsertFunctionKey] = KEY_INSERT; + KeyCodes[kVK_ForwardDelete] = KEY_DELETE; + KeyCodes[kVK_Help] = KEY_HELP; + KeyCodes[NSSelectFunctionKey] = KEY_SELECT; + KeyCodes[NSPrintFunctionKey] = KEY_PRINT; + KeyCodes[NSExecuteFunctionKey] = KEY_EXECUT; + KeyCodes[NSPrintScreenFunctionKey] = KEY_SNAPSHOT; + KeyCodes[NSPauseFunctionKey] = KEY_PAUSE; + KeyCodes[NSScrollLockFunctionKey] = KEY_SCROLL; + KeyCodes[kVK_Delete] = KEY_BACK; + KeyCodes[kVK_Tab] = KEY_TAB; + KeyCodes[kVK_Return] = KEY_RETURN; + KeyCodes[kVK_Escape] = KEY_ESCAPE; + KeyCodes[kVK_Control] = KEY_CONTROL; + KeyCodes[kVK_RightControl] = KEY_RCONTROL; + KeyCodes[kVK_Command] = KEY_MENU; + KeyCodes[kVK_Shift] = KEY_SHIFT; + KeyCodes[kVK_RightShift] = KEY_RSHIFT; + KeyCodes[kVK_Space] = KEY_SPACE; - KeyCodes[kVK_ANSI_A] = irr::KEY_KEY_A; - KeyCodes[kVK_ANSI_B] = irr::KEY_KEY_B; - KeyCodes[kVK_ANSI_C] = irr::KEY_KEY_C; - KeyCodes[kVK_ANSI_D] = irr::KEY_KEY_D; - KeyCodes[kVK_ANSI_E] = irr::KEY_KEY_E; - KeyCodes[kVK_ANSI_F] = irr::KEY_KEY_F; - KeyCodes[kVK_ANSI_G] = irr::KEY_KEY_G; - KeyCodes[kVK_ANSI_H] = irr::KEY_KEY_H; - KeyCodes[kVK_ANSI_I] = irr::KEY_KEY_I; - KeyCodes[kVK_ANSI_J] = irr::KEY_KEY_J; - KeyCodes[kVK_ANSI_K] = irr::KEY_KEY_K; - KeyCodes[kVK_ANSI_L] = irr::KEY_KEY_L; - KeyCodes[kVK_ANSI_M] = irr::KEY_KEY_M; - KeyCodes[kVK_ANSI_N] = irr::KEY_KEY_N; - KeyCodes[kVK_ANSI_O] = irr::KEY_KEY_O; - KeyCodes[kVK_ANSI_P] = irr::KEY_KEY_P; - KeyCodes[kVK_ANSI_Q] = irr::KEY_KEY_Q; - KeyCodes[kVK_ANSI_R] = irr::KEY_KEY_R; - KeyCodes[kVK_ANSI_S] = irr::KEY_KEY_S; - KeyCodes[kVK_ANSI_T] = irr::KEY_KEY_T; - KeyCodes[kVK_ANSI_U] = irr::KEY_KEY_U; - KeyCodes[kVK_ANSI_V] = irr::KEY_KEY_V; - KeyCodes[kVK_ANSI_W] = irr::KEY_KEY_W; - KeyCodes[kVK_ANSI_X] = irr::KEY_KEY_X; - KeyCodes[kVK_ANSI_X] = irr::KEY_KEY_X; - KeyCodes[kVK_ANSI_Y] = irr::KEY_KEY_Y; - KeyCodes[kVK_ANSI_Z] = irr::KEY_KEY_Z; + KeyCodes[kVK_ANSI_A] = KEY_KEY_A; + KeyCodes[kVK_ANSI_B] = KEY_KEY_B; + KeyCodes[kVK_ANSI_C] = KEY_KEY_C; + KeyCodes[kVK_ANSI_D] = KEY_KEY_D; + KeyCodes[kVK_ANSI_E] = KEY_KEY_E; + KeyCodes[kVK_ANSI_F] = KEY_KEY_F; + KeyCodes[kVK_ANSI_G] = KEY_KEY_G; + KeyCodes[kVK_ANSI_H] = KEY_KEY_H; + KeyCodes[kVK_ANSI_I] = KEY_KEY_I; + KeyCodes[kVK_ANSI_J] = KEY_KEY_J; + KeyCodes[kVK_ANSI_K] = KEY_KEY_K; + KeyCodes[kVK_ANSI_L] = KEY_KEY_L; + KeyCodes[kVK_ANSI_M] = KEY_KEY_M; + KeyCodes[kVK_ANSI_N] = KEY_KEY_N; + KeyCodes[kVK_ANSI_O] = KEY_KEY_O; + KeyCodes[kVK_ANSI_P] = KEY_KEY_P; + KeyCodes[kVK_ANSI_Q] = KEY_KEY_Q; + KeyCodes[kVK_ANSI_R] = KEY_KEY_R; + KeyCodes[kVK_ANSI_S] = KEY_KEY_S; + KeyCodes[kVK_ANSI_T] = KEY_KEY_T; + KeyCodes[kVK_ANSI_U] = KEY_KEY_U; + KeyCodes[kVK_ANSI_V] = KEY_KEY_V; + KeyCodes[kVK_ANSI_W] = KEY_KEY_W; + KeyCodes[kVK_ANSI_X] = KEY_KEY_X; + KeyCodes[kVK_ANSI_X] = KEY_KEY_X; + KeyCodes[kVK_ANSI_Y] = KEY_KEY_Y; + KeyCodes[kVK_ANSI_Z] = KEY_KEY_Z; - KeyCodes[kVK_ANSI_0] = irr::KEY_KEY_0; - KeyCodes[kVK_ANSI_1] = irr::KEY_KEY_1; - KeyCodes[kVK_ANSI_2] = irr::KEY_KEY_2; - KeyCodes[kVK_ANSI_3] = irr::KEY_KEY_3; - KeyCodes[kVK_ANSI_4] = irr::KEY_KEY_4; - KeyCodes[kVK_ANSI_5] = irr::KEY_KEY_5; - KeyCodes[kVK_ANSI_6] = irr::KEY_KEY_6; - KeyCodes[kVK_ANSI_7] = irr::KEY_KEY_7; - KeyCodes[kVK_ANSI_8] = irr::KEY_KEY_8; - KeyCodes[kVK_ANSI_9] = irr::KEY_KEY_9; + KeyCodes[kVK_ANSI_0] = KEY_KEY_0; + KeyCodes[kVK_ANSI_1] = KEY_KEY_1; + KeyCodes[kVK_ANSI_2] = KEY_KEY_2; + KeyCodes[kVK_ANSI_3] = KEY_KEY_3; + KeyCodes[kVK_ANSI_4] = KEY_KEY_4; + KeyCodes[kVK_ANSI_5] = KEY_KEY_5; + KeyCodes[kVK_ANSI_6] = KEY_KEY_6; + KeyCodes[kVK_ANSI_7] = KEY_KEY_7; + KeyCodes[kVK_ANSI_8] = KEY_KEY_8; + KeyCodes[kVK_ANSI_9] = KEY_KEY_9; - KeyCodes[kVK_ANSI_Slash] = irr::KEY_DIVIDE; - KeyCodes[kVK_ANSI_Comma] = irr::KEY_COMMA; - KeyCodes[kVK_ANSI_Period] = irr::KEY_PERIOD; - KeyCodes[kVK_PageUp] = irr::KEY_PRIOR; - KeyCodes[kVK_PageDown] = irr::KEY_NEXT; + KeyCodes[kVK_ANSI_Slash] = KEY_DIVIDE; + KeyCodes[kVK_ANSI_Comma] = KEY_COMMA; + KeyCodes[kVK_ANSI_Period] = KEY_PERIOD; + KeyCodes[kVK_PageUp] = KEY_PRIOR; + KeyCodes[kVK_PageDown] = KEY_NEXT; - KeyCodes[kVK_ANSI_Keypad0] = irr::KEY_NUMPAD0; - KeyCodes[kVK_ANSI_Keypad1] = irr::KEY_NUMPAD1; - KeyCodes[kVK_ANSI_Keypad2] = irr::KEY_NUMPAD2; - KeyCodes[kVK_ANSI_Keypad3] = irr::KEY_NUMPAD3; - KeyCodes[kVK_ANSI_Keypad4] = irr::KEY_NUMPAD4; - KeyCodes[kVK_ANSI_Keypad5] = irr::KEY_NUMPAD5; - KeyCodes[kVK_ANSI_Keypad6] = irr::KEY_NUMPAD6; - KeyCodes[kVK_ANSI_Keypad7] = irr::KEY_NUMPAD7; - KeyCodes[kVK_ANSI_Keypad8] = irr::KEY_NUMPAD8; - KeyCodes[kVK_ANSI_Keypad9] = irr::KEY_NUMPAD9; + KeyCodes[kVK_ANSI_Keypad0] = KEY_NUMPAD0; + KeyCodes[kVK_ANSI_Keypad1] = KEY_NUMPAD1; + KeyCodes[kVK_ANSI_Keypad2] = KEY_NUMPAD2; + KeyCodes[kVK_ANSI_Keypad3] = KEY_NUMPAD3; + KeyCodes[kVK_ANSI_Keypad4] = KEY_NUMPAD4; + KeyCodes[kVK_ANSI_Keypad5] = KEY_NUMPAD5; + KeyCodes[kVK_ANSI_Keypad6] = KEY_NUMPAD6; + KeyCodes[kVK_ANSI_Keypad7] = KEY_NUMPAD7; + KeyCodes[kVK_ANSI_Keypad8] = KEY_NUMPAD8; + KeyCodes[kVK_ANSI_Keypad9] = KEY_NUMPAD9; - KeyCodes[kVK_ANSI_KeypadDecimal] = irr::KEY_DECIMAL; - KeyCodes[kVK_ANSI_KeypadMultiply] = irr::KEY_MULTIPLY; - KeyCodes[kVK_ANSI_KeypadPlus] = irr::KEY_PLUS; - KeyCodes[kVK_ANSI_KeypadClear] = irr::KEY_OEM_CLEAR; - KeyCodes[kVK_ANSI_KeypadDivide] = irr::KEY_DIVIDE; - KeyCodes[kVK_ANSI_KeypadEnter] = irr::KEY_RETURN; - KeyCodes[kVK_ANSI_KeypadMinus] = irr::KEY_SUBTRACT; + KeyCodes[kVK_ANSI_KeypadDecimal] = KEY_DECIMAL; + KeyCodes[kVK_ANSI_KeypadMultiply] = KEY_MULTIPLY; + KeyCodes[kVK_ANSI_KeypadPlus] = KEY_PLUS; + KeyCodes[kVK_ANSI_KeypadClear] = KEY_OEM_CLEAR; + KeyCodes[kVK_ANSI_KeypadDivide] = KEY_DIVIDE; + KeyCodes[kVK_ANSI_KeypadEnter] = KEY_RETURN; + KeyCodes[kVK_ANSI_KeypadMinus] = KEY_SUBTRACT; - KeyCodes[kVK_ANSI_LeftBracket] = irr::KEY_OEM_4; - KeyCodes[kVK_ANSI_Backslash] = irr::KEY_OEM_5; - KeyCodes[kVK_ANSI_RightBracket] = irr::KEY_OEM_6; + KeyCodes[kVK_ANSI_LeftBracket] = KEY_OEM_4; + KeyCodes[kVK_ANSI_Backslash] = KEY_OEM_5; + KeyCodes[kVK_ANSI_RightBracket] = KEY_OEM_6; } //! Sets if the window should be resizable in windowed mode. @@ -1456,6 +1454,4 @@ void CIrrDeviceMacOSX::pollJoysticks() #endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ } -} // end namespace - #endif // _IRR_COMPILE_WITH_OSX_DEVICE_ diff --git a/irr/src/CIrrDeviceSDL.cpp b/irr/src/CIrrDeviceSDL.cpp index bc7627f73..52f8c217f 100644 --- a/irr/src/CIrrDeviceSDL.cpp +++ b/irr/src/CIrrDeviceSDL.cpp @@ -30,13 +30,13 @@ #include "CSDLManager.h" // Since SDL doesn't have mouse keys as keycodes we need to fall back to EKEY_CODE in some cases. -static inline bool is_fake_key(irr::EKEY_CODE key) { +static inline bool is_fake_key(EKEY_CODE key) { switch (key) { - case irr::KEY_LBUTTON: - case irr::KEY_MBUTTON: - case irr::KEY_RBUTTON: - case irr::KEY_XBUTTON1: - case irr::KEY_XBUTTON2: + case KEY_LBUTTON: + case KEY_MBUTTON: + case KEY_RBUTTON: + case KEY_XBUTTON1: + case KEY_XBUTTON2: return true; default: @@ -46,8 +46,6 @@ static inline bool is_fake_key(irr::EKEY_CODE key) { static int SDLDeviceInstances = 0; -namespace irr -{ #ifdef _IRR_EMSCRIPTEN_PLATFORM_ EM_BOOL CIrrDeviceSDL::MouseUpDownCallback(int eventType, const EmscriptenMouseEvent *event, void *userData) { @@ -63,8 +61,8 @@ EM_BOOL CIrrDeviceSDL::MouseEnterCallback(int eventType, const EmscriptenMouseEv SEvent irrevent; - irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT; - irrevent.MouseInput.Event = irr::EMIE_MOUSE_ENTER_CANVAS; + irrevent.EventType = EET_MOUSE_INPUT_EVENT; + irrevent.MouseInput.Event = EMIE_MOUSE_ENTER_CANVAS; This->MouseX = irrevent.MouseInput.X = mouseEvent->canvasX; This->MouseY = irrevent.MouseInput.Y = mouseEvent->canvasY; This->MouseXRel = mouseEvent->movementX; // should be 0 I guess? Or can it enter while pointer is locked()? @@ -84,8 +82,8 @@ EM_BOOL CIrrDeviceSDL::MouseLeaveCallback(int eventType, const EmscriptenMouseEv SEvent irrevent; - irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT; - irrevent.MouseInput.Event = irr::EMIE_MOUSE_LEAVE_CANVAS; + irrevent.EventType = EET_MOUSE_INPUT_EVENT; + irrevent.MouseInput.Event = EMIE_MOUSE_LEAVE_CANVAS; This->MouseX = irrevent.MouseInput.X = mouseEvent->canvasX; This->MouseY = irrevent.MouseInput.Y = mouseEvent->canvasY; This->MouseXRel = mouseEvent->movementX; // should be 0 I guess? Or can it enter while pointer is locked()? @@ -718,8 +716,8 @@ bool CIrrDeviceSDL::run() case SDL_MOUSEMOTION: { SDL_Keymod keymod = SDL_GetModState(); - irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT; - irrevent.MouseInput.Event = irr::EMIE_MOUSE_MOVED; + irrevent.EventType = EET_MOUSE_INPUT_EVENT; + irrevent.MouseInput.Event = EMIE_MOUSE_MOVED; MouseXRel = static_cast(SDL_event.motion.xrel * ScaleX); MouseYRel = static_cast(SDL_event.motion.yrel * ScaleY); @@ -743,8 +741,8 @@ bool CIrrDeviceSDL::run() case SDL_MOUSEWHEEL: { SDL_Keymod keymod = SDL_GetModState(); - irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT; - irrevent.MouseInput.Event = irr::EMIE_MOUSE_WHEEL; + irrevent.EventType = EET_MOUSE_INPUT_EVENT; + irrevent.MouseInput.Event = EMIE_MOUSE_WHEEL; #if SDL_VERSION_ATLEAST(2, 0, 18) irrevent.MouseInput.Wheel = SDL_event.wheel.preciseY; #else @@ -767,8 +765,8 @@ bool CIrrDeviceSDL::run() case SDL_MOUSEBUTTONUP: { SDL_Keymod keymod = SDL_GetModState(); - irrevent.EventType = irr::EET_MOUSE_INPUT_EVENT; - irrevent.MouseInput.Event = irr::EMIE_MOUSE_MOVED; // value to be ignored + irrevent.EventType = EET_MOUSE_INPUT_EVENT; + irrevent.MouseInput.Event = EMIE_MOUSE_MOVED; // value to be ignored #ifdef _IRR_EMSCRIPTEN_PLATFORM_ // Handle mouselocking in emscripten in Windowed mode. @@ -804,31 +802,31 @@ bool CIrrDeviceSDL::run() switch (button) { case SDL_BUTTON_LEFT: if (SDL_event.type == SDL_MOUSEBUTTONDOWN) { - irrevent.MouseInput.Event = irr::EMIE_LMOUSE_PRESSED_DOWN; - MouseButtonStates |= irr::EMBSM_LEFT; + irrevent.MouseInput.Event = EMIE_LMOUSE_PRESSED_DOWN; + MouseButtonStates |= EMBSM_LEFT; } else { - irrevent.MouseInput.Event = irr::EMIE_LMOUSE_LEFT_UP; - MouseButtonStates &= ~irr::EMBSM_LEFT; + irrevent.MouseInput.Event = EMIE_LMOUSE_LEFT_UP; + MouseButtonStates &= ~EMBSM_LEFT; } break; case SDL_BUTTON_RIGHT: if (SDL_event.type == SDL_MOUSEBUTTONDOWN) { - irrevent.MouseInput.Event = irr::EMIE_RMOUSE_PRESSED_DOWN; - MouseButtonStates |= irr::EMBSM_RIGHT; + irrevent.MouseInput.Event = EMIE_RMOUSE_PRESSED_DOWN; + MouseButtonStates |= EMBSM_RIGHT; } else { - irrevent.MouseInput.Event = irr::EMIE_RMOUSE_LEFT_UP; - MouseButtonStates &= ~irr::EMBSM_RIGHT; + irrevent.MouseInput.Event = EMIE_RMOUSE_LEFT_UP; + MouseButtonStates &= ~EMBSM_RIGHT; } break; case SDL_BUTTON_MIDDLE: if (SDL_event.type == SDL_MOUSEBUTTONDOWN) { - irrevent.MouseInput.Event = irr::EMIE_MMOUSE_PRESSED_DOWN; - MouseButtonStates |= irr::EMBSM_MIDDLE; + irrevent.MouseInput.Event = EMIE_MMOUSE_PRESSED_DOWN; + MouseButtonStates |= EMBSM_MIDDLE; } else { - irrevent.MouseInput.Event = irr::EMIE_MMOUSE_LEFT_UP; - MouseButtonStates &= ~irr::EMBSM_MIDDLE; + irrevent.MouseInput.Event = EMIE_MMOUSE_LEFT_UP; + MouseButtonStates &= ~EMBSM_MIDDLE; } break; @@ -836,19 +834,19 @@ bool CIrrDeviceSDL::run() // those as keycodes instead. This is relatively hacky but avoids the effort of // adding more mouse events that will be discarded anyway once we switch to SDL case SDL_BUTTON_X1: - irrevent.EventType = irr::EET_KEY_INPUT_EVENT; - irrevent.KeyInput.Key = irr::KEY_XBUTTON1; + irrevent.EventType = EET_KEY_INPUT_EVENT; + irrevent.KeyInput.Key = KEY_XBUTTON1; break; case SDL_BUTTON_X2: - irrevent.EventType = irr::EET_KEY_INPUT_EVENT; - irrevent.KeyInput.Key = irr::KEY_XBUTTON2; + irrevent.EventType = EET_KEY_INPUT_EVENT; + irrevent.KeyInput.Key = KEY_XBUTTON2; break; } bool shift = (keymod & KMOD_SHIFT) != 0; bool control = (keymod & KMOD_CTRL) != 0; - if (irrevent.EventType == irr::EET_MOUSE_INPUT_EVENT && irrevent.MouseInput.Event != irr::EMIE_MOUSE_MOVED) { + if (irrevent.EventType == EET_MOUSE_INPUT_EVENT && irrevent.MouseInput.Event != EMIE_MOUSE_MOVED) { irrevent.MouseInput.ButtonStates = MouseButtonStates; irrevent.MouseInput.X = static_cast(SDL_event.button.x * ScaleX); irrevent.MouseInput.Y = static_cast(SDL_event.button.y * ScaleY); @@ -866,7 +864,7 @@ bool CIrrDeviceSDL::run() postEventFromUser(irrevent); } } - } else if (irrevent.EventType == irr::EET_KEY_INPUT_EVENT) { + } else if (irrevent.EventType == EET_KEY_INPUT_EVENT) { irrevent.KeyInput.Char = 0; irrevent.KeyInput.PressedDown = SDL_event.type == SDL_MOUSEBUTTONDOWN; irrevent.KeyInput.Shift = shift; @@ -877,9 +875,9 @@ bool CIrrDeviceSDL::run() } case SDL_TEXTINPUT: { - irrevent.EventType = irr::EET_STRING_INPUT_EVENT; + irrevent.EventType = EET_STRING_INPUT_EVENT; irrevent.StringInput.Str = new core::stringw(); - irr::core::utf8ToWString(*irrevent.StringInput.Str, SDL_event.text.text); + core::utf8ToWString(*irrevent.StringInput.Str, SDL_event.text.text); postEventFromUser(irrevent); delete irrevent.StringInput.Str; irrevent.StringInput.Str = NULL; @@ -906,7 +904,7 @@ bool CIrrDeviceSDL::run() if (SDL_IsTextInputActive() && !keyIsKnownSpecial(key) && (SDL_event.key.keysym.mod & KMOD_CTRL) == 0) break; - irrevent.EventType = irr::EET_KEY_INPUT_EVENT; + irrevent.EventType = EET_KEY_INPUT_EVENT; irrevent.KeyInput.Key = key; irrevent.KeyInput.PressedDown = (SDL_event.type == SDL_KEYDOWN); irrevent.KeyInput.Shift = (SDL_event.key.keysym.mod & KMOD_SHIFT) != 0; @@ -946,7 +944,7 @@ bool CIrrDeviceSDL::run() break; case SDL_USEREVENT: - irrevent.EventType = irr::EET_USER_EVENT; + irrevent.EventType = EET_USER_EVENT; irrevent.UserEvent.UserData1 = reinterpret_cast(SDL_event.user.data1); irrevent.UserEvent.UserData2 = reinterpret_cast(SDL_event.user.data2); @@ -1529,6 +1527,4 @@ void CIrrDeviceSDL::CCursorControl::initCursors() Cursors.emplace_back(nullptr); // ECI_UP } -} // end namespace irr - #endif // _IRR_COMPILE_WITH_SDL_DEVICE_ diff --git a/irr/src/CIrrDeviceSDL.h b/irr/src/CIrrDeviceSDL.h index 1faaad7a7..30c65431b 100644 --- a/irr/src/CIrrDeviceSDL.h +++ b/irr/src/CIrrDeviceSDL.h @@ -26,9 +26,6 @@ #include #include -namespace irr -{ - class CIrrDeviceSDL : public CIrrDeviceStub { public: @@ -339,6 +336,4 @@ private: bool IsInBackground; }; -} // end namespace irr - #endif // _IRR_COMPILE_WITH_SDL_DEVICE_ diff --git a/irr/src/CIrrDeviceStub.cpp b/irr/src/CIrrDeviceStub.cpp index ff1319164..0cd2c30ca 100644 --- a/irr/src/CIrrDeviceStub.cpp +++ b/irr/src/CIrrDeviceStub.cpp @@ -14,8 +14,6 @@ #include "CLogger.h" #include "irrString.h" -namespace irr -{ namespace video { #ifndef _IRR_COMPILE_WITH_OPENGL_ @@ -176,7 +174,7 @@ u32 CIrrDeviceStub::checkSuccessiveClicks(s32 mouseX, s32 mouseY, EMOUSE_INPUT_E { const s32 MAX_MOUSEMOVE = 3; - irr::u32 clickTime = getTimer()->getRealTime(); + u32 clickTime = getTimer()->getRealTime(); if ((clickTime - MouseMultiClicks.LastClickTime) < MouseMultiClicks.DoubleClickTime && core::abs_(MouseMultiClicks.LastClick.X - mouseX) <= MAX_MOUSEMOVE && core::abs_(MouseMultiClicks.LastClick.Y - mouseY) <= MAX_MOUSEMOVE && MouseMultiClicks.CountSuccessiveClicks < 3 && MouseMultiClicks.LastMouseInputEvent == inputEvent) { ++MouseMultiClicks.CountSuccessiveClicks; @@ -378,5 +376,3 @@ bool CIrrDeviceStub::acceptsIME() gui::IGUIElement *elem = GUIEnvironment->getFocus(); return elem && elem->acceptsIME(); } - -} // end namespace irr diff --git a/irr/src/CIrrDeviceStub.h b/irr/src/CIrrDeviceStub.h index c46fd64fc..af0ce19d5 100644 --- a/irr/src/CIrrDeviceStub.h +++ b/irr/src/CIrrDeviceStub.h @@ -8,8 +8,6 @@ #include "SIrrCreationParameters.h" #include "IContextManager.h" -namespace irr -{ // lots of prototypes: class ILogger; class CLogger; @@ -159,7 +157,7 @@ public: float getDisplayDensity() const override; //! Resize the render window. - void setWindowSize(const irr::core::dimension2d &size) override {} + void setWindowSize(const core::dimension2d &size) override {} protected: void createGUIAndScene(); @@ -202,5 +200,3 @@ protected: SIrrlichtCreationParameters CreationParams; bool Close; }; - -} // end namespace irr diff --git a/irr/src/CIrrDeviceWin32.cpp b/irr/src/CIrrDeviceWin32.cpp index f0947163d..63954de8c 100644 --- a/irr/src/CIrrDeviceWin32.cpp +++ b/irr/src/CIrrDeviceWin32.cpp @@ -38,8 +38,6 @@ #include "CWGLManager.h" #endif -namespace irr -{ struct SJoystickWin32Control { CIrrDeviceWin32 *Device; @@ -74,7 +72,7 @@ struct SJoystickWin32Control void pollJoysticks(); bool activateJoysticks(core::array &joystickInfo); - irr::core::stringc findJoystickName(int index, const JOYCAPS &caps) const; + core::stringc findJoystickName(int index, const JOYCAPS &caps) const; }; SJoystickWin32Control::SJoystickWin32Control(CIrrDeviceWin32 *dev) : @@ -196,7 +194,7 @@ void SJoystickWin32Control::pollJoysticks() if (!FAILED(ActiveJoysticks[joystick].lpdijoy->GetDeviceState(sizeof(info), &info))) { SEvent event; - event.EventType = irr::EET_JOYSTICK_INPUT_EVENT; + event.EventType = EET_JOYSTICK_INPUT_EVENT; event.JoystickEvent.Joystick = (u8)joystick; event.JoystickEvent.POV = (u16)info.rgdwPOV[0]; @@ -292,7 +290,7 @@ void SJoystickWin32Control::pollJoysticks() if (JOYERR_NOERROR == joyGetPosEx(ActiveJoysticks[joystick].Index, &info)) { SEvent event; - event.EventType = irr::EET_JOYSTICK_INPUT_EVENT; + event.EventType = EET_JOYSTICK_INPUT_EVENT; event.JoystickEvent.Joystick = (u8)joystick; event.JoystickEvent.POV = (u16)info.dwPOV; @@ -342,13 +340,13 @@ void SJoystickWin32Control::pollJoysticks() /** This function is ported from SDL and released under zlib-license: * Copyright (C) 1997-2014 Sam Lantinga */ -irr::core::stringc SJoystickWin32Control::findJoystickName(int index, const JOYCAPS &caps) const +core::stringc SJoystickWin32Control::findJoystickName(int index, const JOYCAPS &caps) const { #if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ // As a default use the name given in the joystick structure. // It is always the same name, independent of joystick. - irr::core::stringc result(caps.szPname); + core::stringc result(caps.szPname); core::stringc key = core::stringc(REGSTR_PATH_JOYCONFIG) + "\\" + caps.szRegKey + "\\" + REGSTR_KEY_JOYCURR; HKEY hTopKey = HKEY_LOCAL_MACHINE; @@ -469,25 +467,24 @@ bool SJoystickWin32Control::activateJoysticks(core::array &joysti return false; #endif // _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ } -} // end namespace irr namespace { struct SEnvMapper { HWND hWnd; - irr::CIrrDeviceWin32 *irrDev; + CIrrDeviceWin32 *irrDev; }; // NOTE: This is global. We can have more than one Irrlicht Device at same time. -irr::core::array EnvMap; +core::array EnvMap; HKL KEYBOARD_INPUT_HKL = 0; } -irr::CIrrDeviceWin32 *getDeviceFromHWnd(HWND hWnd) +CIrrDeviceWin32 *getDeviceFromHWnd(HWND hWnd) { - const irr::u32 end = EnvMap.size(); - for (irr::u32 i = 0; i < end; ++i) { + const u32 end = EnvMap.size(); + for (u32 i = 0; i < end; ++i) { const SEnvMapper &env = EnvMap[i]; if (env.hWnd == hWnd) return env.irrDev; @@ -502,29 +499,29 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) #define WHEEL_DELTA 120 #endif - irr::CIrrDeviceWin32 *dev = 0; - irr::SEvent event; + CIrrDeviceWin32 *dev = 0; + SEvent event; - static irr::s32 ClickCount = 0; + static s32 ClickCount = 0; if (GetCapture() != hWnd && ClickCount > 0) ClickCount = 0; struct messageMap { - irr::s32 group; + s32 group; UINT winMessage; - irr::s32 irrMessage; + s32 irrMessage; }; static messageMap mouseMap[] = { - {0, WM_LBUTTONDOWN, irr::EMIE_LMOUSE_PRESSED_DOWN}, - {1, WM_LBUTTONUP, irr::EMIE_LMOUSE_LEFT_UP}, - {0, WM_RBUTTONDOWN, irr::EMIE_RMOUSE_PRESSED_DOWN}, - {1, WM_RBUTTONUP, irr::EMIE_RMOUSE_LEFT_UP}, - {0, WM_MBUTTONDOWN, irr::EMIE_MMOUSE_PRESSED_DOWN}, - {1, WM_MBUTTONUP, irr::EMIE_MMOUSE_LEFT_UP}, - {2, WM_MOUSEMOVE, irr::EMIE_MOUSE_MOVED}, - {3, WM_MOUSEWHEEL, irr::EMIE_MOUSE_WHEEL}, + {0, WM_LBUTTONDOWN, EMIE_LMOUSE_PRESSED_DOWN}, + {1, WM_LBUTTONUP, EMIE_LMOUSE_LEFT_UP}, + {0, WM_RBUTTONDOWN, EMIE_RMOUSE_PRESSED_DOWN}, + {1, WM_RBUTTONUP, EMIE_RMOUSE_LEFT_UP}, + {0, WM_MBUTTONDOWN, EMIE_MMOUSE_PRESSED_DOWN}, + {1, WM_MBUTTONUP, EMIE_MMOUSE_LEFT_UP}, + {2, WM_MOUSEMOVE, EMIE_MOUSE_MOVED}, + {3, WM_MOUSEWHEEL, EMIE_MOUSE_WHEEL}, {-1, 0, 0}, }; @@ -545,8 +542,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) } } - event.EventType = irr::EET_MOUSE_INPUT_EVENT; - event.MouseInput.Event = (irr::EMOUSE_INPUT_EVENT)m->irrMessage; + event.EventType = EET_MOUSE_INPUT_EVENT; + event.MouseInput.Event = (EMOUSE_INPUT_EVENT)m->irrMessage; event.MouseInput.X = (short)LOWORD(lParam); event.MouseInput.Y = (short)HIWORD(lParam); event.MouseInput.Shift = ((LOWORD(wParam) & MK_SHIFT) != 0); @@ -555,11 +552,11 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) event.MouseInput.ButtonStates = wParam & (MK_LBUTTON | MK_RBUTTON); // middle and extra buttons if (wParam & MK_MBUTTON) - event.MouseInput.ButtonStates |= irr::EMBSM_MIDDLE; + event.MouseInput.ButtonStates |= EMBSM_MIDDLE; if (wParam & MK_XBUTTON1) - event.MouseInput.ButtonStates |= irr::EMBSM_EXTRA1; + event.MouseInput.ButtonStates |= EMBSM_EXTRA1; if (wParam & MK_XBUTTON2) - event.MouseInput.ButtonStates |= irr::EMBSM_EXTRA2; + event.MouseInput.ButtonStates |= EMBSM_EXTRA2; event.MouseInput.Wheel = 0.f; // wheel @@ -570,20 +567,20 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) ClientToScreen(hWnd, &p); event.MouseInput.X -= p.x; event.MouseInput.Y -= p.y; - event.MouseInput.Wheel = ((irr::f32)((short)HIWORD(wParam))) / (irr::f32)WHEEL_DELTA; + event.MouseInput.Wheel = ((f32)((short)HIWORD(wParam))) / (f32)WHEEL_DELTA; } dev = getDeviceFromHWnd(hWnd); if (dev) { dev->postEventFromUser(event); - if (event.MouseInput.Event >= irr::EMIE_LMOUSE_PRESSED_DOWN && event.MouseInput.Event <= irr::EMIE_MMOUSE_PRESSED_DOWN) { - irr::u32 clicks = dev->checkSuccessiveClicks(event.MouseInput.X, event.MouseInput.Y, event.MouseInput.Event); + if (event.MouseInput.Event >= EMIE_LMOUSE_PRESSED_DOWN && event.MouseInput.Event <= EMIE_MMOUSE_PRESSED_DOWN) { + u32 clicks = dev->checkSuccessiveClicks(event.MouseInput.X, event.MouseInput.Y, event.MouseInput.Event); if (clicks == 2) { - event.MouseInput.Event = (irr::EMOUSE_INPUT_EVENT)(irr::EMIE_LMOUSE_DOUBLE_CLICK + event.MouseInput.Event - irr::EMIE_LMOUSE_PRESSED_DOWN); + event.MouseInput.Event = (EMOUSE_INPUT_EVENT)(EMIE_LMOUSE_DOUBLE_CLICK + event.MouseInput.Event - EMIE_LMOUSE_PRESSED_DOWN); dev->postEventFromUser(event); } else if (clicks == 3) { - event.MouseInput.Event = (irr::EMOUSE_INPUT_EVENT)(irr::EMIE_LMOUSE_TRIPLE_CLICK + event.MouseInput.Event - irr::EMIE_LMOUSE_PRESSED_DOWN); + event.MouseInput.Event = (EMOUSE_INPUT_EVENT)(EMIE_LMOUSE_TRIPLE_CLICK + event.MouseInput.Event - EMIE_LMOUSE_PRESSED_DOWN); dev->postEventFromUser(event); } } @@ -608,23 +605,23 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_KEYUP: { BYTE allKeys[256]; - event.EventType = irr::EET_KEY_INPUT_EVENT; - event.KeyInput.Key = (irr::EKEY_CODE)wParam; + event.EventType = EET_KEY_INPUT_EVENT; + event.KeyInput.Key = (EKEY_CODE)wParam; event.KeyInput.PressedDown = (message == WM_KEYDOWN || message == WM_SYSKEYDOWN); - if (event.KeyInput.Key == irr::KEY_SHIFT) { - event.KeyInput.Key = (irr::EKEY_CODE)MapVirtualKey(((lParam >> 16) & 255), MAPVK_VSC_TO_VK_EX); + if (event.KeyInput.Key == KEY_SHIFT) { + event.KeyInput.Key = (EKEY_CODE)MapVirtualKey(((lParam >> 16) & 255), MAPVK_VSC_TO_VK_EX); } - if (event.KeyInput.Key == irr::KEY_CONTROL) { - event.KeyInput.Key = (irr::EKEY_CODE)MapVirtualKey(((lParam >> 16) & 255), MAPVK_VSC_TO_VK_EX); + if (event.KeyInput.Key == KEY_CONTROL) { + event.KeyInput.Key = (EKEY_CODE)MapVirtualKey(((lParam >> 16) & 255), MAPVK_VSC_TO_VK_EX); // some keyboards will just return LEFT for both - left and right keys. So also check extend bit. if (lParam & 0x1000000) - event.KeyInput.Key = irr::KEY_RCONTROL; + event.KeyInput.Key = KEY_RCONTROL; } - if (event.KeyInput.Key == irr::KEY_MENU) { - event.KeyInput.Key = (irr::EKEY_CODE)MapVirtualKey(((lParam >> 16) & 255), MAPVK_VSC_TO_VK_EX); + if (event.KeyInput.Key == KEY_MENU) { + event.KeyInput.Key = (EKEY_CODE)MapVirtualKey(((lParam >> 16) & 255), MAPVK_VSC_TO_VK_EX); if (lParam & 0x1000000) - event.KeyInput.Key = irr::KEY_RMENU; + event.KeyInput.Key = KEY_RMENU; } GetKeyboardState(allKeys); @@ -677,7 +674,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) break; case WM_USER: - event.EventType = irr::EET_USER_EVENT; + event.EventType = EET_USER_EVENT; event.UserEvent.UserData1 = static_cast(wParam); event.UserEvent.UserData2 = static_cast(lParam); dev = getDeviceFromHWnd(hWnd); @@ -704,9 +701,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) return DefWindowProcW(hWnd, message, wParam, lParam); } -namespace irr -{ - //! constructor CIrrDeviceWin32::CIrrDeviceWin32(const SIrrlichtCreationParameters ¶ms) : CIrrDeviceStub(params), HWnd(0), Resized(false), @@ -958,7 +952,7 @@ void CIrrDeviceWin32::resizeIfNecessary() snprintf_irr(tmp, sizeof(tmp), "Resizing window (%ld %ld)", r.right, r.bottom); os::Printer::log(tmp); - getVideoDriver()->OnResize(irr::core::dimension2du((u32)r.right, (u32)r.bottom)); + getVideoDriver()->OnResize(core::dimension2du((u32)r.right, (u32)r.bottom)); getWin32CursorControl()->OnResize(getVideoDriver()->getScreenSize()); } @@ -1101,7 +1095,7 @@ void CIrrDeviceWin32::OnResized() } //! Resize the render window. -void CIrrDeviceWin32::setWindowSize(const irr::core::dimension2d &size) +void CIrrDeviceWin32::setWindowSize(const core::dimension2d &size) { if (ExternalWindow || !getVideoDriver() || CreationParams.Fullscreen) return; @@ -1253,7 +1247,7 @@ float CIrrDeviceWin32::getDisplayDensity() const // Convert an Irrlicht texture to a Windows cursor // Based on http://www.codeguru.com/cpp/w-p/win32/cursors/article.php/c4529/ -HCURSOR CIrrDeviceWin32::TextureToCursor(HWND hwnd, irr::video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot) +HCURSOR CIrrDeviceWin32::TextureToCursor(HWND hwnd, video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot) { // // create the bitmaps needed for cursors from the texture @@ -1389,9 +1383,9 @@ gui::ECURSOR_ICON CIrrDeviceWin32::CCursorControl::addIcon(const gui::SCursorSpr cW32.FrameTime = icon.SpriteBank->getSprites()[icon.SpriteId].frameTime; for (u32 i = 0; i < icon.SpriteBank->getSprites()[icon.SpriteId].Frames.size(); ++i) { - irr::u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber; - irr::u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber; - irr::core::rect rectIcon = icon.SpriteBank->getPositions()[rectId]; + u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber; + u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber; + core::rect rectIcon = icon.SpriteBank->getPositions()[rectId]; HCURSOR hc = Device->TextureToCursor(HWnd, icon.SpriteBank->getTexture(texId), rectIcon, icon.HotSpot); cW32.Frames.push_back(CursorFrameW32(hc)); @@ -1416,9 +1410,9 @@ void CIrrDeviceWin32::CCursorControl::changeIcon(gui::ECURSOR_ICON iconId, const CursorW32 cW32; cW32.FrameTime = icon.SpriteBank->getSprites()[icon.SpriteId].frameTime; for (u32 i = 0; i < icon.SpriteBank->getSprites()[icon.SpriteId].Frames.size(); ++i) { - irr::u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber; - irr::u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber; - irr::core::rect rectIcon = icon.SpriteBank->getPositions()[rectId]; + u32 texId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].textureNumber; + u32 rectId = icon.SpriteBank->getSprites()[icon.SpriteId].Frames[i].rectNumber; + core::rect rectIcon = icon.SpriteBank->getPositions()[rectId]; HCURSOR hc = Device->TextureToCursor(HWnd, icon.SpriteBank->getTexture(texId), rectIcon, icon.HotSpot); cW32.Frames.push_back(CursorFrameW32(hc)); @@ -1439,6 +1433,4 @@ core::dimension2di CIrrDeviceWin32::CCursorControl::getSupportedIconSize() const return result; } -} // end namespace - #endif // _IRR_COMPILE_WITH_WINDOWS_DEVICE_ diff --git a/irr/src/CIrrDeviceWin32.h b/irr/src/CIrrDeviceWin32.h index 8a4c14276..3e446584d 100644 --- a/irr/src/CIrrDeviceWin32.h +++ b/irr/src/CIrrDeviceWin32.h @@ -18,8 +18,6 @@ #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) #endif -namespace irr -{ struct SJoystickWin32Control; class CIrrDeviceWin32 : public CIrrDeviceStub @@ -72,7 +70,7 @@ public: void setResizable(bool resize = false) override; //! Resize the render window. - void setWindowSize(const irr::core::dimension2d &size) override; + void setWindowSize(const core::dimension2d &size) override; //! Minimizes the window. void minimizeWindow() override; @@ -113,7 +111,7 @@ public: bool switchToFullScreen(); // convert an Irrlicht texture to a windows cursor - HCURSOR TextureToCursor(HWND hwnd, irr::video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot); + HCURSOR TextureToCursor(HWND hwnd, video::ITexture *tex, const core::rect &sourceRect, const core::position2d &hotspot); //! Implementation of the win32 cursor control class CCursorControl : public gui::ICursorControl @@ -400,6 +398,4 @@ private: bool WindowMaximized; }; -} // end namespace irr - #endif // _IRR_COMPILE_WITH_WINDOWS_DEVICE_ diff --git a/irr/src/CLimitReadFile.cpp b/irr/src/CLimitReadFile.cpp index b13120194..b6c4e1599 100644 --- a/irr/src/CLimitReadFile.cpp +++ b/irr/src/CLimitReadFile.cpp @@ -6,8 +6,6 @@ #include "irrMath.h" #include "irrString.h" -namespace irr -{ namespace io { @@ -108,4 +106,3 @@ IReadFile *createLimitReadFile(const io::path &fileName, IReadFile *alreadyOpene } } // end namespace io -} // end namespace irr diff --git a/irr/src/CLimitReadFile.h b/irr/src/CLimitReadFile.h index 6b02cfdc0..f95ca5b2c 100644 --- a/irr/src/CLimitReadFile.h +++ b/irr/src/CLimitReadFile.h @@ -7,8 +7,6 @@ #include "IReadFile.h" #include "irrString.h" -namespace irr -{ class CUnicodeConverter; namespace io @@ -59,4 +57,3 @@ private: }; } // end namespace io -} // end namespace irr diff --git a/irr/src/CLogger.cpp b/irr/src/CLogger.cpp index 2bb589a99..ff0be335a 100644 --- a/irr/src/CLogger.cpp +++ b/irr/src/CLogger.cpp @@ -4,9 +4,6 @@ #include "CLogger.h" -namespace irr -{ - CLogger::CLogger(IEventReceiver *r) : LogLevel(ELL_INFORMATION), Receiver(r) {} @@ -58,5 +55,3 @@ void CLogger::setReceiver(IEventReceiver *r) { Receiver = r; } - -} // end namespace irr diff --git a/irr/src/CLogger.h b/irr/src/CLogger.h index e9cfae8fc..67503420f 100644 --- a/irr/src/CLogger.h +++ b/irr/src/CLogger.h @@ -9,9 +9,6 @@ #include "irrString.h" #include "IEventReceiver.h" -namespace irr -{ - //! Class for logging messages, warnings and errors to stdout class CLogger : public ILogger { @@ -37,5 +34,3 @@ private: ELOG_LEVEL LogLevel; IEventReceiver *Receiver; }; - -} // end namespace diff --git a/irr/src/CMemoryFile.cpp b/irr/src/CMemoryFile.cpp index 4e6baa99c..28e380636 100644 --- a/irr/src/CMemoryFile.cpp +++ b/irr/src/CMemoryFile.cpp @@ -5,8 +5,6 @@ #include "CMemoryFile.h" #include "irrString.h" -namespace irr -{ namespace io { @@ -154,4 +152,3 @@ IWriteFile *createMemoryWriteFile(void *memory, long size, const io::path &fileN } } // end namespace io -} // end namespace irr diff --git a/irr/src/CMemoryFile.h b/irr/src/CMemoryFile.h index 83d77cb77..ac0524cd2 100644 --- a/irr/src/CMemoryFile.h +++ b/irr/src/CMemoryFile.h @@ -8,9 +8,6 @@ #include "IWriteFile.h" #include "irrString.h" -namespace irr -{ - namespace io { @@ -96,4 +93,3 @@ private: }; } // end namespace io -} // end namespace irr diff --git a/irr/src/CMeshCache.cpp b/irr/src/CMeshCache.cpp index 9a41aa582..df555f5aa 100644 --- a/irr/src/CMeshCache.cpp +++ b/irr/src/CMeshCache.cpp @@ -6,8 +6,6 @@ #include "IAnimatedMesh.h" #include "IMesh.h" -namespace irr -{ namespace scene { @@ -153,4 +151,3 @@ void CMeshCache::clearUnusedMeshes() } } // end namespace scene -} // end namespace irr diff --git a/irr/src/CMeshCache.h b/irr/src/CMeshCache.h index 1c2b52686..53680646b 100644 --- a/irr/src/CMeshCache.h +++ b/irr/src/CMeshCache.h @@ -7,9 +7,6 @@ #include "IMeshCache.h" #include "irrArray.h" -namespace irr -{ - namespace scene { class CMeshCache : public IMeshCache @@ -113,4 +110,3 @@ protected: }; } // end namespace scene -} // end namespace irr diff --git a/irr/src/CMeshManipulator.cpp b/irr/src/CMeshManipulator.cpp index 535b74686..edb787f39 100644 --- a/irr/src/CMeshManipulator.cpp +++ b/irr/src/CMeshManipulator.cpp @@ -10,8 +10,6 @@ #include -namespace irr -{ namespace scene { @@ -178,4 +176,3 @@ SMesh *CMeshManipulator::createMeshCopy(scene::IMesh *mesh) const } } // end namespace scene -} // end namespace irr diff --git a/irr/src/CMeshManipulator.h b/irr/src/CMeshManipulator.h index c5632512d..cc93e6565 100644 --- a/irr/src/CMeshManipulator.h +++ b/irr/src/CMeshManipulator.h @@ -6,8 +6,6 @@ #include "IMeshManipulator.h" -namespace irr -{ namespace scene { @@ -34,4 +32,3 @@ public: }; } // end namespace scene -} // end namespace irr diff --git a/irr/src/CMeshSceneNode.cpp b/irr/src/CMeshSceneNode.cpp index 4f0a43212..743e92df5 100644 --- a/irr/src/CMeshSceneNode.cpp +++ b/irr/src/CMeshSceneNode.cpp @@ -10,8 +10,6 @@ #include "IMaterialRenderer.h" #include "IFileSystem.h" -namespace irr -{ namespace scene { @@ -254,4 +252,3 @@ ISceneNode *CMeshSceneNode::clone(ISceneNode *newParent, ISceneManager *newManag } } // end namespace scene -} // end namespace irr diff --git a/irr/src/CMeshSceneNode.h b/irr/src/CMeshSceneNode.h index 20c7146ea..5615263fa 100644 --- a/irr/src/CMeshSceneNode.h +++ b/irr/src/CMeshSceneNode.h @@ -7,8 +7,6 @@ #include "IMeshSceneNode.h" #include "IMesh.h" -namespace irr -{ namespace scene { @@ -84,4 +82,3 @@ protected: }; } // end namespace scene -} // end namespace irr diff --git a/irr/src/CNSOGLManager.h b/irr/src/CNSOGLManager.h index cdbb221b3..d0e848b87 100644 --- a/irr/src/CNSOGLManager.h +++ b/irr/src/CNSOGLManager.h @@ -13,8 +13,6 @@ #import -namespace irr -{ namespace video { // NSOpenGL manager. @@ -65,6 +63,5 @@ private: NSOpenGLPixelFormat *PixelFormat; }; } -} #endif diff --git a/irr/src/CNSOGLManager.mm b/irr/src/CNSOGLManager.mm index b550df20e..5a369d6f9 100644 --- a/irr/src/CNSOGLManager.mm +++ b/irr/src/CNSOGLManager.mm @@ -9,8 +9,6 @@ #include #include "os.h" -namespace irr -{ namespace video { @@ -224,7 +222,6 @@ bool CNSOGLManager::swapBuffers() return true; } -} } #endif diff --git a/irr/src/CNullDriver.cpp b/irr/src/CNullDriver.cpp index f7d012913..2ef371d89 100644 --- a/irr/src/CNullDriver.cpp +++ b/irr/src/CNullDriver.cpp @@ -20,8 +20,6 @@ #include -namespace irr -{ namespace video { @@ -354,7 +352,7 @@ ITexture *CNullDriver::addTextureCubemap(const io::path &name, IImage *imagePosX return t; } -ITexture *CNullDriver::addTextureCubemap(const irr::u32 sideLen, const io::path &name, ECOLOR_FORMAT format) +ITexture *CNullDriver::addTextureCubemap(const u32 sideLen, const io::path &name, ECOLOR_FORMAT format) { if (0 == sideLen) return 0; @@ -628,7 +626,7 @@ void CNullDriver::draw2DImageBatch(const video::ITexture *texture, SColor color, bool useAlphaChannelOfTexture) { - const irr::u32 drawCount = core::min_(positions.size(), sourceRects.size()); + const u32 drawCount = core::min_(positions.size(), sourceRects.size()); for (u32 i = 0; i < drawCount; ++i) { draw2DImage(texture, positions[i], sourceRects[i], @@ -1659,7 +1657,7 @@ ITexture *CNullDriver::addRenderTargetTextureMs(const core::dimension2d &si return 0; } -ITexture *CNullDriver::addRenderTargetTextureCubemap(const irr::u32 sideLen, +ITexture *CNullDriver::addRenderTargetTextureCubemap(const u32 sideLen, const io::path &name, const ECOLOR_FORMAT format) { return 0; @@ -1731,7 +1729,7 @@ core::dimension2du CNullDriver::getMaxTextureSize() const return core::dimension2du(0x10000, 0x10000); // maybe large enough } -bool CNullDriver::needsTransparentRenderPass(const irr::video::SMaterial &material) const +bool CNullDriver::needsTransparentRenderPass(const video::SMaterial &material) const { // TODO: I suspect it would be nice if the material had an enum for further control. // Especially it probably makes sense to allow disabling transparent render pass as soon as material.ZWriteEnable is on. @@ -1750,4 +1748,3 @@ bool CNullDriver::needsTransparentRenderPass(const irr::video::SMaterial &materi } } // end namespace -} // end namespace diff --git a/irr/src/CNullDriver.h b/irr/src/CNullDriver.h index cb6c5fba5..e5f4b5dea 100644 --- a/irr/src/CNullDriver.h +++ b/irr/src/CNullDriver.h @@ -17,8 +17,6 @@ #include "SVertexIndex.h" #include "SExposedVideoData.h" -namespace irr -{ namespace io { class IWriteFile; @@ -85,7 +83,7 @@ public: virtual ITexture *addTextureCubemap(const io::path &name, IImage *imagePosX, IImage *imageNegX, IImage *imagePosY, IImage *imageNegY, IImage *imagePosZ, IImage *imageNegZ) override; - ITexture *addTextureCubemap(const irr::u32 sideLen, const io::path &name, ECOLOR_FORMAT format = ECF_A8R8G8B8) override; + ITexture *addTextureCubemap(const u32 sideLen, const io::path &name, ECOLOR_FORMAT format = ECF_A8R8G8B8) override; virtual bool setRenderTargetEx(IRenderTarget *target, u16 clearFlag, SColor clearColor = SColor(255, 0, 0, 0), f32 clearDepth = 1.f, u8 clearStencil = 0) override; @@ -221,7 +219,7 @@ public: const io::path &name, const ECOLOR_FORMAT format = ECF_UNKNOWN) override; //! Creates a render target texture for a cubemap - ITexture *addRenderTargetTextureCubemap(const irr::u32 sideLen, + ITexture *addRenderTargetTextureCubemap(const u32 sideLen, const io::path &name, const ECOLOR_FORMAT format) override; //! Creates an 1bit alpha channel of the texture based of an color key. @@ -535,7 +533,7 @@ public: core::dimension2du getMaxTextureSize() const override; //! Used by some SceneNodes to check if a material should be rendered in the transparent render pass - bool needsTransparentRenderPass(const irr::video::SMaterial &material) const override; + bool needsTransparentRenderPass(const video::SMaterial &material) const override; protected: //! deletes all textures @@ -727,4 +725,3 @@ protected: }; } // end namespace video -} // end namespace irr diff --git a/irr/src/COBJMeshFileLoader.cpp b/irr/src/COBJMeshFileLoader.cpp index d899f19da..08fa4772f 100644 --- a/irr/src/COBJMeshFileLoader.cpp +++ b/irr/src/COBJMeshFileLoader.cpp @@ -12,8 +12,6 @@ #include "coreutil.h" #include "os.h" -namespace irr -{ namespace scene { @@ -72,11 +70,11 @@ IAnimatedMesh *COBJMeshFileLoader::createMesh(io::IReadFile *file) const c8 *bufPtr = buf; core::stringc grpName, mtlName; bool mtlChanged = false; - [[maybe_unused]] irr::u32 lineNr = 1; // only counts non-empty lines, still useful in debugging to locate errors + [[maybe_unused]] u32 lineNr = 1; // only counts non-empty lines, still useful in debugging to locate errors core::array faceCorners; faceCorners.reallocate(32); // should be large enough const core::stringc TAG_OFF = "off"; - irr::u32 degeneratedFaces = 0; + u32 degeneratedFaces = 0; while (bufPtr != bufEnd) { switch (bufPtr[0]) { @@ -184,7 +182,7 @@ IAnimatedMesh *COBJMeshFileLoader::createMesh(io::IReadFile *file) u32 wlength = copyWord(vertexWord, linePtr, WORD_BUFFER_LENGTH, endPtr); // this function will also convert obj's 1-based index to c++'s 0-based index retrieveVertexIndices(vertexWord, Idx, vertexWord + wlength + 1, vertexBuffer.size(), textureCoordBuffer.size(), normalsBuffer.size()); - if (Idx[0] >= 0 && Idx[0] < (irr::s32)vertexBuffer.size()) + if (Idx[0] >= 0 && Idx[0] < (s32)vertexBuffer.size()) v.Pos = vertexBuffer[Idx[0]]; else { os::Printer::log("Invalid vertex index in this line", wordBuffer.c_str(), ELL_ERROR); @@ -192,11 +190,11 @@ IAnimatedMesh *COBJMeshFileLoader::createMesh(io::IReadFile *file) cleanUp(); return 0; } - if (Idx[1] >= 0 && Idx[1] < (irr::s32)textureCoordBuffer.size()) + if (Idx[1] >= 0 && Idx[1] < (s32)textureCoordBuffer.size()) v.TCoords = textureCoordBuffer[Idx[1]]; else v.TCoords.set(0.0f, 0.0f); - if (Idx[2] >= 0 && Idx[2] < (irr::s32)normalsBuffer.size()) + if (Idx[2] >= 0 && Idx[2] < (s32)normalsBuffer.size()) v.Normal = normalsBuffer[Idx[2]]; else { v.Normal.set(0.0f, 0.0f, 0.0f); @@ -253,9 +251,9 @@ IAnimatedMesh *COBJMeshFileLoader::createMesh(io::IReadFile *file) } // end while(bufPtr && (bufPtr-buf 0) { - irr::core::stringc log(degeneratedFaces); + core::stringc log(degeneratedFaces); log += " degenerated faces removed in "; - log += irr::core::stringc(fullName); + log += core::stringc(fullName); os::Printer::log(log.c_str(), ELL_INFORMATION); } @@ -523,4 +521,3 @@ void COBJMeshFileLoader::cleanUp() } } // end namespace scene -} // end namespace irr diff --git a/irr/src/COBJMeshFileLoader.h b/irr/src/COBJMeshFileLoader.h index 135be296a..00bb91db0 100644 --- a/irr/src/COBJMeshFileLoader.h +++ b/irr/src/COBJMeshFileLoader.h @@ -10,8 +10,6 @@ #include "irrString.h" #include "CMeshBuffer.h" -namespace irr -{ namespace scene { @@ -102,4 +100,3 @@ private: }; } // end namespace scene -} // end namespace irr diff --git a/irr/src/COGLESCoreExtensionHandler.h b/irr/src/COGLESCoreExtensionHandler.h index 5c760e8ca..147512fe6 100644 --- a/irr/src/COGLESCoreExtensionHandler.h +++ b/irr/src/COGLESCoreExtensionHandler.h @@ -10,8 +10,6 @@ #include "irrMath.h" #include "COpenGLCoreFeature.h" -namespace irr -{ namespace video { @@ -98,4 +96,3 @@ protected: bool FeatureAvailable[IRR_OGLES_Feature_Count]; }; } -} diff --git a/irr/src/COSOperator.cpp b/irr/src/COSOperator.cpp index 9abca636c..d2c10b664 100644 --- a/irr/src/COSOperator.cpp +++ b/irr/src/COSOperator.cpp @@ -29,9 +29,6 @@ #include "fast_atof.h" -namespace irr -{ - #if defined(_IRR_COMPILE_WITH_X11_DEVICE_) // constructor linux COSOperator::COSOperator(const core::stringc &osVersion, CIrrDeviceLinux *device) : @@ -245,5 +242,3 @@ bool COSOperator::getSystemMemory(u32 *Total, u32 *Avail) const return false; #endif } - -} // end namespace diff --git a/irr/src/COSOperator.h b/irr/src/COSOperator.h index c1059bffc..bc067bfcf 100644 --- a/irr/src/COSOperator.h +++ b/irr/src/COSOperator.h @@ -6,9 +6,6 @@ #include "IOSOperator.h" -namespace irr -{ - class CIrrDeviceLinux; //! The OSOperator provides OS-specific methods and information. @@ -70,5 +67,3 @@ private: mutable char *PrimarySelectionText = nullptr; #endif }; - -} // end namespace diff --git a/irr/src/COpenGLCacheHandler.cpp b/irr/src/COpenGLCacheHandler.cpp index 577967c56..187ec1431 100644 --- a/irr/src/COpenGLCacheHandler.cpp +++ b/irr/src/COpenGLCacheHandler.cpp @@ -8,8 +8,6 @@ #include "COpenGLDriver.h" -namespace irr -{ namespace video { @@ -117,7 +115,6 @@ void COpenGLCacheHandler::setClientActiveTexture(GLenum texture) } } -} // end namespace } // end namespace #endif // _IRR_COMPILE_WITH_OPENGL_ diff --git a/irr/src/COpenGLCacheHandler.h b/irr/src/COpenGLCacheHandler.h index 968e452d7..be68f1650 100644 --- a/irr/src/COpenGLCacheHandler.h +++ b/irr/src/COpenGLCacheHandler.h @@ -12,8 +12,6 @@ #include "COpenGLCoreTexture.h" #include "COpenGLCoreCacheHandler.h" -namespace irr -{ namespace video { @@ -57,6 +55,5 @@ protected: }; } // end namespace video -} // end namespace irr #endif // _IRR_COMPILE_WITH_OPENGL_ diff --git a/irr/src/COpenGLCommon.h b/irr/src/COpenGLCommon.h index 99bd69e11..6f976b640 100644 --- a/irr/src/COpenGLCommon.h +++ b/irr/src/COpenGLCommon.h @@ -22,8 +22,6 @@ // macro used with COpenGLDriver #define TEST_GL_ERROR(cls) (cls)->testGLError(__LINE__) -namespace irr -{ namespace video { @@ -45,7 +43,6 @@ typedef COpenGLCoreTexture COpenGLTexture; typedef COpenGLCoreRenderTarget COpenGLRenderTarget; class COpenGLCacheHandler; -} } #endif diff --git a/irr/src/COpenGLCoreCacheHandler.h b/irr/src/COpenGLCoreCacheHandler.h index 8302f182a..87e175a54 100644 --- a/irr/src/COpenGLCoreCacheHandler.h +++ b/irr/src/COpenGLCoreCacheHandler.h @@ -11,8 +11,6 @@ #include -namespace irr -{ namespace video { @@ -109,8 +107,8 @@ class COpenGLCoreCacheHandler texture = 0; os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR); - os::Printer::log("Texture type", irr::core::stringc((int)type), ELL_ERROR); - os::Printer::log("Driver (or cache handler) type", irr::core::stringc((int)DriverType), ELL_ERROR); + os::Printer::log("Texture type", core::stringc((int)type), ELL_ERROR); + os::Printer::log("Driver (or cache handler) type", core::stringc((int)DriverType), ELL_ERROR); } } @@ -553,7 +551,7 @@ public: //! Compare material to current cache and update it when there are differences // Some material renderers do change the cache beyond the original material settings // This corrects the material to represent the current cache state again. - void correctCacheMaterial(irr::video::SMaterial &material) + void correctCacheMaterial(video::SMaterial &material) { // Fix textures which got removed for (u32 i = 0; i < MATERIAL_MAX_TEXTURES; ++i) { @@ -603,4 +601,3 @@ protected: }; } -} diff --git a/irr/src/COpenGLCoreFeature.h b/irr/src/COpenGLCoreFeature.h index 629bec2a1..a4e35ecb2 100644 --- a/irr/src/COpenGLCoreFeature.h +++ b/irr/src/COpenGLCoreFeature.h @@ -6,8 +6,6 @@ #include "irrTypes.h" -namespace irr -{ namespace video { @@ -29,4 +27,3 @@ public: }; } -} diff --git a/irr/src/COpenGLCoreRenderTarget.h b/irr/src/COpenGLCoreRenderTarget.h index 96eacc207..b13538017 100644 --- a/irr/src/COpenGLCoreRenderTarget.h +++ b/irr/src/COpenGLCoreRenderTarget.h @@ -15,8 +15,6 @@ #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT #endif -namespace irr -{ namespace video { @@ -374,4 +372,3 @@ protected: }; } -} diff --git a/irr/src/COpenGLCoreTexture.h b/irr/src/COpenGLCoreTexture.h index b2b7403c2..8e2214922 100644 --- a/irr/src/COpenGLCoreTexture.h +++ b/irr/src/COpenGLCoreTexture.h @@ -16,8 +16,6 @@ #include "mt_opengl.h" -namespace irr -{ namespace video { @@ -702,4 +700,3 @@ protected: }; } -} diff --git a/irr/src/COpenGLDriver.cpp b/irr/src/COpenGLDriver.cpp index 7e7454673..4105942d0 100644 --- a/irr/src/COpenGLDriver.cpp +++ b/irr/src/COpenGLDriver.cpp @@ -20,8 +20,6 @@ #include "mt_opengl.h" -namespace irr -{ namespace video { @@ -2490,7 +2488,7 @@ bool COpenGLDriver::queryTextureFormat(ECOLOR_FORMAT format) const return getColorFormatParameters(format, dummyInternalFormat, dummyPixelFormat, dummyPixelType, &dummyConverter); } -bool COpenGLDriver::needsTransparentRenderPass(const irr::video::SMaterial &material) const +bool COpenGLDriver::needsTransparentRenderPass(const video::SMaterial &material) const { return CNullDriver::needsTransparentRenderPass(material) || material.isAlphaBlendOperation(); } @@ -2639,7 +2637,7 @@ ITexture *COpenGLDriver::addRenderTargetTextureMs(const core::dimension2d & } //! Creates a render target texture for a cubemap -ITexture *COpenGLDriver::addRenderTargetTextureCubemap(const irr::u32 sideLen, const io::path &name, const ECOLOR_FORMAT format) +ITexture *COpenGLDriver::addRenderTargetTextureCubemap(const u32 sideLen, const io::path &name, const ECOLOR_FORMAT format) { if (IImage::isCompressedFormat(format)) return 0; @@ -3170,5 +3168,4 @@ IVideoDriver *createOpenGLDriver(const SIrrlichtCreationParameters ¶ms, io:: } } // end namespace video -} // end namespace irr #endif // opengl diff --git a/irr/src/COpenGLDriver.h b/irr/src/COpenGLDriver.h index 67c328f58..d4d603c7b 100644 --- a/irr/src/COpenGLDriver.h +++ b/irr/src/COpenGLDriver.h @@ -6,13 +6,10 @@ #include "SIrrCreationParameters.h" -namespace irr -{ class CIrrDeviceWin32; class CIrrDeviceLinux; class CIrrDeviceSDL; class CIrrDeviceMacOSX; -} #ifdef _IRR_COMPILE_WITH_OPENGL_ @@ -22,9 +19,6 @@ class CIrrDeviceMacOSX; #include "COpenGLExtensionHandler.h" #include "IContextManager.h" -namespace irr -{ - namespace video { class IContextManager; @@ -263,7 +257,7 @@ public: const io::path &name = "rt", const ECOLOR_FORMAT format = ECF_UNKNOWN) override; //! Creates a render target texture for a cubemap - ITexture *addRenderTargetTextureCubemap(const irr::u32 sideLen, + ITexture *addRenderTargetTextureCubemap(const u32 sideLen, const io::path &name, const ECOLOR_FORMAT format) override; virtual bool setRenderTargetEx(IRenderTarget *target, u16 clearFlag, SColor clearColor = SColor(255, 0, 0, 0), @@ -294,7 +288,7 @@ public: bool queryTextureFormat(ECOLOR_FORMAT format) const override; //! Used by some SceneNodes to check if a material should be rendered in the transparent render pass - bool needsTransparentRenderPass(const irr::video::SMaterial &material) const override; + bool needsTransparentRenderPass(const video::SMaterial &material) const override; //! Convert E_PRIMITIVE_TYPE to OpenGL equivalent GLenum primitiveTypeToGL(scene::E_PRIMITIVE_TYPE type) const; @@ -399,6 +393,5 @@ private: }; } // end namespace video -} // end namespace irr #endif // _IRR_COMPILE_WITH_OPENGL_ diff --git a/irr/src/COpenGLExtensionHandler.cpp b/irr/src/COpenGLExtensionHandler.cpp index 7eb4252a6..d2b2221fc 100644 --- a/irr/src/COpenGLExtensionHandler.cpp +++ b/irr/src/COpenGLExtensionHandler.cpp @@ -11,8 +11,6 @@ #include "fast_atof.h" #include "IContextManager.h" -namespace irr -{ namespace video { @@ -618,7 +616,6 @@ bool COpenGLExtensionHandler::queryFeature(E_VIDEO_DRIVER_FEATURE feature) const }; } -} } #endif diff --git a/irr/src/COpenGLExtensionHandler.h b/irr/src/COpenGLExtensionHandler.h index 63c55f26c..1662c78a6 100644 --- a/irr/src/COpenGLExtensionHandler.h +++ b/irr/src/COpenGLExtensionHandler.h @@ -14,8 +14,6 @@ #include "COpenGLCoreFeature.h" -namespace irr -{ namespace video { @@ -2608,8 +2606,6 @@ inline void COpenGLExtensionHandler::extGlSwapInterval(int interval) } #endif #endif -} - } } diff --git a/irr/src/COpenGLMaterialRenderer.h b/irr/src/COpenGLMaterialRenderer.h index b4706f537..8d111dfd5 100644 --- a/irr/src/COpenGLMaterialRenderer.h +++ b/irr/src/COpenGLMaterialRenderer.h @@ -11,8 +11,6 @@ #include "COpenGLDriver.h" #include "COpenGLCacheHandler.h" -namespace irr -{ namespace video { @@ -330,6 +328,5 @@ protected: }; } // end namespace video -} // end namespace irr #endif diff --git a/irr/src/COpenGLSLMaterialRenderer.cpp b/irr/src/COpenGLSLMaterialRenderer.cpp index 60c5f9204..373f79b54 100644 --- a/irr/src/COpenGLSLMaterialRenderer.cpp +++ b/irr/src/COpenGLSLMaterialRenderer.cpp @@ -26,8 +26,6 @@ #include "COpenGLCoreFeature.h" -namespace irr -{ namespace video { @@ -672,6 +670,5 @@ IVideoDriver *COpenGLSLMaterialRenderer::getVideoDriver() } } // end namespace video -} // end namespace irr #endif diff --git a/irr/src/COpenGLSLMaterialRenderer.h b/irr/src/COpenGLSLMaterialRenderer.h index 2914b3956..3b8e83674 100644 --- a/irr/src/COpenGLSLMaterialRenderer.h +++ b/irr/src/COpenGLSLMaterialRenderer.h @@ -15,8 +15,6 @@ #include "COpenGLCommon.h" -namespace irr -{ namespace video { @@ -114,6 +112,5 @@ protected: }; } // end namespace video -} // end namespace irr #endif // compile with OpenGL diff --git a/irr/src/CReadFile.cpp b/irr/src/CReadFile.cpp index 3ef90e715..16bc4398a 100644 --- a/irr/src/CReadFile.cpp +++ b/irr/src/CReadFile.cpp @@ -4,8 +4,6 @@ #include "CReadFile.h" -namespace irr -{ namespace io { @@ -89,4 +87,3 @@ IReadFile *CReadFile::createReadFile(const io::path &fileName) } } // end namespace io -} // end namespace irr diff --git a/irr/src/CReadFile.h b/irr/src/CReadFile.h index c9231be7c..6c1d0d0d9 100644 --- a/irr/src/CReadFile.h +++ b/irr/src/CReadFile.h @@ -8,9 +8,6 @@ #include "IReadFile.h" #include "irrString.h" -namespace irr -{ - namespace io { @@ -64,4 +61,3 @@ private: }; } // end namespace io -} // end namespace irr diff --git a/irr/src/CSDLManager.cpp b/irr/src/CSDLManager.cpp index 56fe9e0d7..96f193c83 100644 --- a/irr/src/CSDLManager.cpp +++ b/irr/src/CSDLManager.cpp @@ -8,8 +8,6 @@ #include "CIrrDeviceSDL.h" -namespace irr -{ namespace video { @@ -44,7 +42,6 @@ bool CSDLManager::swapBuffers() return true; } -} } #endif diff --git a/irr/src/CSDLManager.h b/irr/src/CSDLManager.h index 22efeb1ee..0faf52a35 100644 --- a/irr/src/CSDLManager.h +++ b/irr/src/CSDLManager.h @@ -8,8 +8,6 @@ #include "IContextManager.h" -namespace irr -{ class CIrrDeviceSDL; namespace video @@ -44,6 +42,5 @@ private: CIrrDeviceSDL *SDLDevice; }; } -} #endif diff --git a/irr/src/CSceneCollisionManager.cpp b/irr/src/CSceneCollisionManager.cpp index 3d8f1091f..916ba913f 100644 --- a/irr/src/CSceneCollisionManager.cpp +++ b/irr/src/CSceneCollisionManager.cpp @@ -8,8 +8,6 @@ #include "irrMath.h" -namespace irr -{ namespace scene { @@ -66,4 +64,3 @@ core::line3d CSceneCollisionManager::getRayFromScreenCoordinates( } } // end namespace scene -} // end namespace irr diff --git a/irr/src/CSceneCollisionManager.h b/irr/src/CSceneCollisionManager.h index d3dc2ef70..4a263103c 100644 --- a/irr/src/CSceneCollisionManager.h +++ b/irr/src/CSceneCollisionManager.h @@ -8,8 +8,6 @@ #include "ISceneManager.h" #include "IVideoDriver.h" -namespace irr -{ namespace scene { @@ -32,4 +30,3 @@ private: }; } // end namespace scene -} // end namespace irr diff --git a/irr/src/CSceneManager.cpp b/irr/src/CSceneManager.cpp index b0b82b772..d5b992e62 100644 --- a/irr/src/CSceneManager.cpp +++ b/irr/src/CSceneManager.cpp @@ -30,8 +30,6 @@ #include "CSceneCollisionManager.h" -namespace irr -{ namespace scene { @@ -771,4 +769,3 @@ ISceneManager *createSceneManager(video::IVideoDriver *driver, gui::ICursorContr } } // end namespace scene -} // end namespace irr diff --git a/irr/src/CSceneManager.h b/irr/src/CSceneManager.h index 078044a2e..ea035d237 100644 --- a/irr/src/CSceneManager.h +++ b/irr/src/CSceneManager.h @@ -12,8 +12,6 @@ #include "irrArray.h" #include "IMeshLoader.h" -namespace irr -{ namespace io { class IFileSystem; @@ -272,4 +270,3 @@ private: }; } // end namespace video -} // end namespace scene diff --git a/irr/src/CTimer.h b/irr/src/CTimer.h index 950365cd5..38b6ccf01 100644 --- a/irr/src/CTimer.h +++ b/irr/src/CTimer.h @@ -7,8 +7,6 @@ #include "ITimer.h" #include "os.h" -namespace irr -{ //! Device independent implementation of the timer class CTimer : public ITimer { @@ -92,5 +90,3 @@ public: os::Timer::tick(); } }; - -} // end namespace diff --git a/irr/src/CWGLManager.cpp b/irr/src/CWGLManager.cpp index d0dc9bf6a..b84ae1670 100644 --- a/irr/src/CWGLManager.cpp +++ b/irr/src/CWGLManager.cpp @@ -11,8 +11,6 @@ #include #include -namespace irr -{ namespace video { @@ -433,7 +431,6 @@ bool CWGLManager::swapBuffers() return SwapBuffers((HDC)CurrentContext.OpenGLWin32.HDc) == TRUE; } -} } #endif diff --git a/irr/src/CWGLManager.h b/irr/src/CWGLManager.h index b8276d5f8..390e561a6 100644 --- a/irr/src/CWGLManager.h +++ b/irr/src/CWGLManager.h @@ -15,8 +15,6 @@ #include #include -namespace irr -{ namespace video { // WGL manager. @@ -71,6 +69,5 @@ private: HMODULE libHandle; }; } -} #endif diff --git a/irr/src/CWriteFile.cpp b/irr/src/CWriteFile.cpp index f6a7efd2b..6ee44f476 100644 --- a/irr/src/CWriteFile.cpp +++ b/irr/src/CWriteFile.cpp @@ -5,8 +5,6 @@ #include "CWriteFile.h" #include -namespace irr -{ namespace io { @@ -99,4 +97,3 @@ IWriteFile *CWriteFile::createWriteFile(const io::path &fileName, bool append) } } // end namespace io -} // end namespace irr diff --git a/irr/src/CWriteFile.h b/irr/src/CWriteFile.h index 20bca0894..eea97e889 100644 --- a/irr/src/CWriteFile.h +++ b/irr/src/CWriteFile.h @@ -8,9 +8,6 @@ #include "IWriteFile.h" #include "irrString.h" -namespace irr -{ - namespace io { @@ -55,4 +52,3 @@ private: }; } // end namespace io -} // end namespace irr diff --git a/irr/src/CXMeshFileLoader.cpp b/irr/src/CXMeshFileLoader.cpp index f2c4e94e6..b5dea4c7c 100644 --- a/irr/src/CXMeshFileLoader.cpp +++ b/irr/src/CXMeshFileLoader.cpp @@ -24,8 +24,6 @@ return false; \ } while (0) -namespace irr -{ namespace scene { @@ -1336,7 +1334,7 @@ bool CXMeshFileLoader::parseDataObjectAnimationTicksPerSecond() SET_ERR_AND_RETURN(); } - AnimatedMesh->setAnimationSpeed(static_cast(ticks)); + AnimatedMesh->setAnimationSpeed(static_cast(ticks)); return true; } @@ -2004,4 +2002,3 @@ bool CXMeshFileLoader::readMatrix(core::matrix4 &mat) } } // end namespace scene -} // end namespace irr diff --git a/irr/src/CXMeshFileLoader.h b/irr/src/CXMeshFileLoader.h index 36610d3b3..9bb329673 100644 --- a/irr/src/CXMeshFileLoader.h +++ b/irr/src/CXMeshFileLoader.h @@ -8,8 +8,6 @@ #include "irrString.h" #include "SkinnedMesh.h" -namespace irr -{ namespace io { class IReadFile; @@ -178,4 +176,3 @@ private: }; } // end namespace scene -} // end namespace irr diff --git a/irr/src/CZipReader.cpp b/irr/src/CZipReader.cpp index 7ec6a5ff3..ae89a3bcc 100644 --- a/irr/src/CZipReader.cpp +++ b/irr/src/CZipReader.cpp @@ -12,8 +12,6 @@ #include // use system lib -namespace irr -{ namespace io { @@ -391,4 +389,3 @@ IReadFile *CZipReader::createAndOpenFile(u32 index) } } // end namespace io -} // end namespace irr diff --git a/irr/src/CZipReader.h b/irr/src/CZipReader.h index 654f7a80a..929313ca4 100644 --- a/irr/src/CZipReader.h +++ b/irr/src/CZipReader.h @@ -10,8 +10,6 @@ #include "IFileSystem.h" #include "CFileList.h" -namespace irr -{ namespace io { // the fields crc-32, compressed size and uncompressed size are set to @@ -175,4 +173,3 @@ protected: }; } // end namespace io -} // end namespace irr diff --git a/irr/src/Irrlicht.cpp b/irr/src/Irrlicht.cpp index cfe836754..86206dbd8 100644 --- a/irr/src/Irrlicht.cpp +++ b/irr/src/Irrlicht.cpp @@ -24,8 +24,6 @@ static const char *const copyright = "Irrlicht Engine (c) 2002-2017 Nikolaus Geb #include "CIrrDeviceSDL.h" #endif -namespace irr -{ //! stub for calling createDeviceEx IrrlichtDevice *createDevice(video::E_DRIVER_TYPE driverType, const core::dimension2d &windowSize, @@ -116,5 +114,3 @@ extern "C" bool isDriverSupported(E_DRIVER_TYPE driver) } } } - -} // end namespace irr diff --git a/irr/src/OpenGL/Common.h b/irr/src/OpenGL/Common.h index 7049f6f65..d032a8e73 100644 --- a/irr/src/OpenGL/Common.h +++ b/irr/src/OpenGL/Common.h @@ -17,8 +17,6 @@ // macro used with COpenGL3DriverBase #define TEST_GL_ERROR(cls) (cls)->testGLError(__FILE__, __LINE__) -namespace irr -{ namespace video { @@ -59,4 +57,3 @@ struct OpenGLVersion }; } -} diff --git a/irr/src/OpenGL/Driver.cpp b/irr/src/OpenGL/Driver.cpp index c1cae0294..e114e48ff 100644 --- a/irr/src/OpenGL/Driver.cpp +++ b/irr/src/OpenGL/Driver.cpp @@ -23,8 +23,6 @@ #include "mt_opengl.h" -namespace irr -{ namespace video { @@ -432,7 +430,7 @@ void COpenGL3DriverBase::createMaterialRenderers() delete[] fs2DData; } -bool COpenGL3DriverBase::setMaterialTexture(irr::u32 layerIdx, const irr::video::ITexture *texture) +bool COpenGL3DriverBase::setMaterialTexture(u32 layerIdx, const video::ITexture *texture) { Material.TextureLayers[layerIdx].Texture = const_cast(texture); // function uses const-pointer for texture because all draw functions use const-pointers already return CacheHandler->getTextureCache().set(0, texture); @@ -851,7 +849,7 @@ void COpenGL3DriverBase::draw2DImageBatch(const video::ITexture *texture, clipRect->getWidth(), clipRect->getHeight()); } - const irr::u32 drawCount = core::min_(positions.size(), sourceRects.size()); + const u32 drawCount = core::min_(positions.size(), sourceRects.size()); assert(6 * drawCount * sizeof(u16) <= QuadIndexVBO.getSize()); // FIXME split the batch? or let it crash? std::vector vtx; @@ -1682,7 +1680,7 @@ ITexture *COpenGL3DriverBase::addRenderTargetTextureMs(const core::dimension2dsetViewport`, but also sets `ViewPort` virtual void setViewPortRaw(u32 width, u32 height); @@ -356,7 +354,7 @@ private: E_RENDER_MODE CurrentRenderMode; bool Transformation3DChanged; - irr::io::path OGLES2ShaderPath; + io::path OGLES2ShaderPath; SMaterial Material, LastMaterial; @@ -377,4 +375,3 @@ private: }; } // end namespace video -} // end namespace irr diff --git a/irr/src/OpenGL/ExtensionHandler.cpp b/irr/src/OpenGL/ExtensionHandler.cpp index 3c248ba0a..97c816d38 100644 --- a/irr/src/OpenGL/ExtensionHandler.cpp +++ b/irr/src/OpenGL/ExtensionHandler.cpp @@ -12,8 +12,6 @@ #include "os.h" #include -namespace irr -{ namespace video { @@ -25,4 +23,3 @@ void COpenGL3ExtensionHandler::initExtensions() } } // end namespace video -} // end namespace irr diff --git a/irr/src/OpenGL/ExtensionHandler.h b/irr/src/OpenGL/ExtensionHandler.h index 2ee3543d5..ec75e492a 100644 --- a/irr/src/OpenGL/ExtensionHandler.h +++ b/irr/src/OpenGL/ExtensionHandler.h @@ -17,8 +17,6 @@ #include "COGLESCoreExtensionHandler.h" -namespace irr -{ namespace video { @@ -184,4 +182,3 @@ public: }; } -} diff --git a/irr/src/OpenGL/FixedPipelineRenderer.cpp b/irr/src/OpenGL/FixedPipelineRenderer.cpp index cef446587..3307fd8da 100644 --- a/irr/src/OpenGL/FixedPipelineRenderer.cpp +++ b/irr/src/OpenGL/FixedPipelineRenderer.cpp @@ -8,8 +8,6 @@ #include "IVideoDriver.h" -namespace irr -{ namespace video { @@ -172,4 +170,3 @@ void COpenGL3MaterialOneTextureBlendCB::OnSetConstants(IMaterialRendererServices } } -} diff --git a/irr/src/OpenGL/FixedPipelineRenderer.h b/irr/src/OpenGL/FixedPipelineRenderer.h index 89e251a35..300119a79 100644 --- a/irr/src/OpenGL/FixedPipelineRenderer.h +++ b/irr/src/OpenGL/FixedPipelineRenderer.h @@ -8,8 +8,6 @@ #include "IShaderConstantSetCallBack.h" #include "IMaterialRendererServices.h" -namespace irr -{ namespace video { @@ -83,4 +81,3 @@ protected: }; } -} diff --git a/irr/src/OpenGL/MaterialRenderer.cpp b/irr/src/OpenGL/MaterialRenderer.cpp index 269f28ae9..cef3233c4 100644 --- a/irr/src/OpenGL/MaterialRenderer.cpp +++ b/irr/src/OpenGL/MaterialRenderer.cpp @@ -15,8 +15,6 @@ #include "COpenGLCoreTexture.h" #include "COpenGLCoreCacheHandler.h" -namespace irr -{ namespace video { @@ -422,4 +420,3 @@ IVideoDriver *COpenGL3MaterialRenderer::getVideoDriver() } } -} diff --git a/irr/src/OpenGL/MaterialRenderer.h b/irr/src/OpenGL/MaterialRenderer.h index 0916f1ad5..f533babd1 100644 --- a/irr/src/OpenGL/MaterialRenderer.h +++ b/irr/src/OpenGL/MaterialRenderer.h @@ -13,8 +13,6 @@ #include "Common.h" -namespace irr -{ namespace video { @@ -93,4 +91,3 @@ protected: }; } -} diff --git a/irr/src/OpenGL/Renderer2D.cpp b/irr/src/OpenGL/Renderer2D.cpp index ec53cc9f9..f5c55f06f 100644 --- a/irr/src/OpenGL/Renderer2D.cpp +++ b/irr/src/OpenGL/Renderer2D.cpp @@ -13,8 +13,6 @@ #include "COpenGLCoreTexture.h" #include "COpenGLCoreCacheHandler.h" -namespace irr -{ namespace video { @@ -86,4 +84,3 @@ bool COpenGL3Renderer2D::OnRender(IMaterialRendererServices *service, E_VERTEX_T } } -} diff --git a/irr/src/OpenGL/Renderer2D.h b/irr/src/OpenGL/Renderer2D.h index 8cc8fe6ca..2d04801da 100644 --- a/irr/src/OpenGL/Renderer2D.h +++ b/irr/src/OpenGL/Renderer2D.h @@ -6,8 +6,6 @@ #include "MaterialRenderer.h" -namespace irr -{ namespace video { @@ -30,4 +28,3 @@ protected: }; } -} diff --git a/irr/src/OpenGL/VBO.cpp b/irr/src/OpenGL/VBO.cpp index d374c7b02..8fb7c98f8 100644 --- a/irr/src/OpenGL/VBO.cpp +++ b/irr/src/OpenGL/VBO.cpp @@ -7,8 +7,6 @@ #include #include -namespace irr -{ namespace video { @@ -48,4 +46,3 @@ void OpenGLVBO::destroy() } } -} diff --git a/irr/src/OpenGL/VBO.h b/irr/src/OpenGL/VBO.h index 85c005df2..227cc900b 100644 --- a/irr/src/OpenGL/VBO.h +++ b/irr/src/OpenGL/VBO.h @@ -7,8 +7,6 @@ #include "Common.h" #include -namespace irr -{ namespace video { @@ -54,4 +52,3 @@ private: }; } -} diff --git a/irr/src/OpenGL3/DriverGL3.cpp b/irr/src/OpenGL3/DriverGL3.cpp index 057305869..54bc55c64 100644 --- a/irr/src/OpenGL3/DriverGL3.cpp +++ b/irr/src/OpenGL3/DriverGL3.cpp @@ -7,8 +7,6 @@ #include #include "mt_opengl.h" -namespace irr -{ namespace video { @@ -106,4 +104,3 @@ IVideoDriver *createOpenGL3Driver(const SIrrlichtCreationParameters ¶ms, io: } } -} diff --git a/irr/src/OpenGL3/DriverGL3.h b/irr/src/OpenGL3/DriverGL3.h index e11c11a42..eeec29f39 100644 --- a/irr/src/OpenGL3/DriverGL3.h +++ b/irr/src/OpenGL3/DriverGL3.h @@ -5,8 +5,6 @@ #pragma once #include "OpenGL/Driver.h" -namespace irr -{ namespace video { @@ -27,4 +25,3 @@ protected: }; } -} diff --git a/irr/src/OpenGLES2/DriverGLES2.cpp b/irr/src/OpenGLES2/DriverGLES2.cpp index f806cdd5c..1ef6d091f 100644 --- a/irr/src/OpenGLES2/DriverGLES2.cpp +++ b/irr/src/OpenGLES2/DriverGLES2.cpp @@ -8,8 +8,6 @@ #include "mt_opengl.h" #include "CColorConverter.h" -namespace irr -{ namespace video { @@ -163,4 +161,3 @@ IVideoDriver *createOGLES2Driver(const SIrrlichtCreationParameters ¶ms, io:: } } -} diff --git a/irr/src/OpenGLES2/DriverGLES2.h b/irr/src/OpenGLES2/DriverGLES2.h index 78cad23fc..e46282957 100644 --- a/irr/src/OpenGLES2/DriverGLES2.h +++ b/irr/src/OpenGLES2/DriverGLES2.h @@ -5,8 +5,6 @@ #pragma once #include "OpenGL/Driver.h" -namespace irr -{ namespace video { @@ -27,4 +25,3 @@ protected: }; } -} diff --git a/irr/src/SB3DStructs.h b/irr/src/SB3DStructs.h index b5e61daae..940464e2c 100644 --- a/irr/src/SB3DStructs.h +++ b/irr/src/SB3DStructs.h @@ -11,8 +11,6 @@ #include "SMaterial.h" #include "irrMath.h" -namespace irr -{ namespace scene { @@ -68,4 +66,3 @@ struct SB3dMaterial }; } // end namespace scene -} // end namespace irr diff --git a/irr/src/SkinnedMesh.cpp b/irr/src/SkinnedMesh.cpp index cf58121ba..d37d7a306 100644 --- a/irr/src/SkinnedMesh.cpp +++ b/irr/src/SkinnedMesh.cpp @@ -19,8 +19,6 @@ #include #include -namespace irr -{ namespace scene { @@ -668,4 +666,3 @@ void SkinnedMesh::calculateTangents( } } // end namespace scene -} // end namespace irr diff --git a/irr/src/SoftwareDriver2_helper.h b/irr/src/SoftwareDriver2_helper.h index 76ea249ea..ca3ac7ae9 100644 --- a/irr/src/SoftwareDriver2_helper.h +++ b/irr/src/SoftwareDriver2_helper.h @@ -20,9 +20,6 @@ #endif #endif -namespace irr -{ - // ----------------------- Generic ---------------------------------- //! align_next - align to next upper 2^n #define align_next(num, to) (((num) + (to - 1)) & (~(to - 1))) @@ -275,5 +272,3 @@ inline bool intersect(AbsRectangle &dest, const AbsRectangle &a, const AbsRectan dest.y1 = core::s32_min(a.y1, b.y1); return dest.x0 < dest.x1 && dest.y0 < dest.y1; } - -} // end namespace irr diff --git a/irr/src/mt_opengl_loader.cpp b/irr/src/mt_opengl_loader.cpp index 2b7184036..c8e9dc403 100755 --- a/irr/src/mt_opengl_loader.cpp +++ b/irr/src/mt_opengl_loader.cpp @@ -7,7 +7,7 @@ OpenGLProcedures GL; -void OpenGLProcedures::LoadAllProcedures(irr::video::IContextManager *cmgr) +void OpenGLProcedures::LoadAllProcedures(video::IContextManager *cmgr) { if (!CullFace) CullFace = (PFNGLCULLFACEPROC_MT)cmgr->getProcAddress("glCullFace"); diff --git a/irr/src/os.cpp b/irr/src/os.cpp index 8762c8c54..f8bf3a948 100644 --- a/irr/src/os.cpp +++ b/irr/src/os.cpp @@ -39,8 +39,6 @@ #define bswap_64(X) ((((X) & 0x00000000000000FF) << 56) | (((X) & 0xFF00000000000000) >> 56) | (((X) & 0x000000000000FF00) << 40) | (((X) & 0x00FF000000000000) >> 40) | (((X) & 0x0000000000FF0000) << 24) | (((X) & 0x0000FF0000000000) >> 24) | (((X) & 0x00000000FF000000) << 8) | (((X) & 0x000000FF00000000) >> 8)) #endif -namespace irr -{ namespace os { u16 Byteswap::byteswap(u16 num) @@ -74,7 +72,6 @@ f32 Byteswap::byteswap(f32 num) return (FR(tmp)); } } -} #if defined(_IRR_WINDOWS_API_) // ---------------------------------------------------------------- @@ -85,8 +82,6 @@ f32 Byteswap::byteswap(f32 num) #include #include -namespace irr -{ namespace os { //! prints a debuginfo string @@ -130,8 +125,6 @@ u32 Timer::getRealTime() #include -namespace irr -{ namespace os { @@ -194,8 +187,6 @@ u32 Timer::getRealTime() #include #include -namespace irr -{ namespace os { @@ -245,8 +236,6 @@ u32 Timer::getRealTime() #include #include -namespace irr -{ namespace os { @@ -377,4 +366,3 @@ void Timer::initVirtualTimer() } } // end namespace os -} // end namespace irr diff --git a/irr/src/os.h b/irr/src/os.h index 238b71653..fffaea8a6 100644 --- a/irr/src/os.h +++ b/irr/src/os.h @@ -10,9 +10,6 @@ #include "ILogger.h" #include "ITimer.h" -namespace irr -{ - namespace os { class Byteswap @@ -87,4 +84,3 @@ private: }; } // end namespace os -} // end namespace irr diff --git a/lib/catch2/catch_amalgamated.hpp b/lib/catch2/catch_amalgamated.hpp index 6cc67e76f..041790be0 100644 --- a/lib/catch2/catch_amalgamated.hpp +++ b/lib/catch2/catch_amalgamated.hpp @@ -672,7 +672,6 @@ namespace Catch { #include - #ifndef CATCH_STRINGREF_HPP_INCLUDED #define CATCH_STRINGREF_HPP_INCLUDED @@ -2300,7 +2299,6 @@ namespace Catch { - /** \file * Wrapper for the WCHAR configuration option * diff --git a/lib/lua/src/lapi.c b/lib/lua/src/lapi.c index f83593794..3aa996243 100644 --- a/lib/lua/src/lapi.c +++ b/lib/lua/src/lapi.c @@ -30,7 +30,6 @@ #include "lvm.h" - const char lua_ident[] = "$Lua: " LUA_RELEASE " " LUA_COPYRIGHT " $\n" "$Authors: " LUA_AUTHORS " $\n" diff --git a/lib/lua/src/lbaselib.c b/lib/lua/src/lbaselib.c index ed293ebdc..d238903a8 100644 --- a/lib/lua/src/lbaselib.c +++ b/lib/lua/src/lbaselib.c @@ -21,7 +21,6 @@ - /* ** If your system does not support `stdout', you can just remove this function. ** If you need, you can define your own `print' function, following this diff --git a/lib/lua/src/ldblib.c b/lib/lua/src/ldblib.c index 2c55edcda..4c96b072c 100644 --- a/lib/lua/src/ldblib.c +++ b/lib/lua/src/ldblib.c @@ -18,7 +18,6 @@ #include "lualib.h" - static int db_getregistry (lua_State *L) { lua_pushvalue(L, LUA_REGISTRYINDEX); return 1; diff --git a/lib/lua/src/ldebug.c b/lib/lua/src/ldebug.c index 69456b964..0a6cd13dd 100644 --- a/lib/lua/src/ldebug.c +++ b/lib/lua/src/ldebug.c @@ -29,7 +29,6 @@ #include "lvm.h" - static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name); diff --git a/lib/lua/src/ldo.c b/lib/lua/src/ldo.c index 37a7660fd..92ca60300 100644 --- a/lib/lua/src/ldo.c +++ b/lib/lua/src/ldo.c @@ -32,7 +32,6 @@ - /* ** {====================================================== ** Error-recovery functions diff --git a/lib/lua/src/lfunc.c b/lib/lua/src/lfunc.c index 813e88f58..ce9a3a5a4 100644 --- a/lib/lua/src/lfunc.c +++ b/lib/lua/src/lfunc.c @@ -19,7 +19,6 @@ #include "lstate.h" - Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e) { Closure *c = cast(Closure *, luaM_malloc(L, sizeCclosure(nelems))); luaC_link(L, obj2gco(c), LUA_TFUNCTION); diff --git a/lib/lua/src/liolib.c b/lib/lua/src/liolib.c index 649f9a595..5a664f9f4 100644 --- a/lib/lua/src/liolib.c +++ b/lib/lua/src/liolib.c @@ -19,7 +19,6 @@ #include "lualib.h" - #define IO_INPUT 1 #define IO_OUTPUT 2 diff --git a/lib/lua/src/llex.c b/lib/lua/src/llex.c index 5affe7c16..71ffb6e97 100644 --- a/lib/lua/src/llex.c +++ b/lib/lua/src/llex.c @@ -24,7 +24,6 @@ #include "lzio.h" - #define next(ls) (ls->current = zgetc(ls->z)) diff --git a/lib/lua/src/lmem.c b/lib/lua/src/lmem.c index ae7d8c965..95620c703 100644 --- a/lib/lua/src/lmem.c +++ b/lib/lua/src/lmem.c @@ -19,7 +19,6 @@ #include "lstate.h" - /* ** About the realloc function: ** void * frealloc (void *ud, void *ptr, size_t osize, size_t nsize); diff --git a/lib/lua/src/lobject.c b/lib/lua/src/lobject.c index 4ff50732a..d8f00ae99 100644 --- a/lib/lua/src/lobject.c +++ b/lib/lua/src/lobject.c @@ -23,7 +23,6 @@ #include "lvm.h" - const TValue luaO_nilobject_ = {{NULL}, LUA_TNIL}; diff --git a/lib/lua/src/lparser.c b/lib/lua/src/lparser.c index dda7488dc..6bfb7fb71 100644 --- a/lib/lua/src/lparser.c +++ b/lib/lua/src/lparser.c @@ -26,7 +26,6 @@ #include "ltable.h" - #define hasmultret(k) ((k) == VCALL || (k) == VVARARG) #define getlocvar(fs, i) ((fs)->f->locvars[(fs)->actvar[i]]) diff --git a/lib/lua/src/lstate.h b/lib/lua/src/lstate.h index c4364ea3f..98385eb2a 100644 --- a/lib/lua/src/lstate.h +++ b/lib/lua/src/lstate.h @@ -14,7 +14,6 @@ #include "lzio.h" - struct lua_longjmp; /* defined in ldo.c */ diff --git a/lib/lua/src/lstring.c b/lib/lua/src/lstring.c index 49113151c..4e4c4930c 100644 --- a/lib/lua/src/lstring.c +++ b/lib/lua/src/lstring.c @@ -18,7 +18,6 @@ #include "lstring.h" - void luaS_resize (lua_State *L, int newsize) { GCObject **newhash; stringtable *tb; diff --git a/lib/lua/src/ltm.c b/lib/lua/src/ltm.c index c27f0f6fa..d98876dff 100644 --- a/lib/lua/src/ltm.c +++ b/lib/lua/src/ltm.c @@ -19,7 +19,6 @@ #include "ltm.h" - const char *const luaT_typenames[] = { "nil", "boolean", "userdata", "number", "string", "table", "function", "userdata", "thread", diff --git a/lib/lua/src/lua.c b/lib/lua/src/lua.c index 8ef87873b..ee81e7b22 100644 --- a/lib/lua/src/lua.c +++ b/lib/lua/src/lua.c @@ -18,7 +18,6 @@ #include "lualib.h" - static lua_State *globalL = NULL; static const char *progname = LUA_PROGNAME; diff --git a/lib/lua/src/lvm.c b/lib/lua/src/lvm.c index 60a715a6d..bca3ab64d 100644 --- a/lib/lua/src/lvm.c +++ b/lib/lua/src/lvm.c @@ -27,7 +27,6 @@ #include "lvm.h" - /* limit for table tag-method chains (to avoid loops) */ #define MAXTAGLOOP 100 diff --git a/src/chat.h b/src/chat.h index 97b391ccb..3624995c0 100644 --- a/src/chat.h +++ b/src/chat.h @@ -137,7 +137,7 @@ private: // Enable clickable chat weblinks bool m_cache_clickable_chat_weblinks; // Color of clickable chat weblinks - irr::video::SColor m_cache_chat_weblink_color; + video::SColor m_cache_chat_weblink_color; // Whether the lines were modified since last markLinesUnchanged() // Is always set to true when m_unformatted is modified, because that's what diff --git a/src/client/camera.cpp b/src/client/camera.cpp index 3a69be6ac..c9a343623 100644 --- a/src/client/camera.cpp +++ b/src/client/camera.cpp @@ -599,7 +599,7 @@ void Camera::wield(const ItemStack &item) } } -void Camera::drawWieldedTool(irr::core::matrix4* translation) +void Camera::drawWieldedTool(core::matrix4* translation) { // Clear Z buffer so that the wielded tool stays in front of world geometry m_wieldmgr->getVideoDriver()->clearBuffers(video::ECBF_DEPTH); @@ -612,12 +612,12 @@ void Camera::drawWieldedTool(irr::core::matrix4* translation) cam->setFarValue(1000); if (translation != NULL) { - irr::core::matrix4 startMatrix = cam->getAbsoluteTransformation(); - irr::core::vector3df focusPoint = (cam->getTarget() + core::matrix4 startMatrix = cam->getAbsoluteTransformation(); + core::vector3df focusPoint = (cam->getTarget() - cam->getAbsolutePosition()).setLength(1) + cam->getAbsolutePosition(); - irr::core::vector3df camera_pos = + core::vector3df camera_pos = (startMatrix * *translation).getTranslation(); cam->setPosition(camera_pos); cam->updateAbsolutePosition(); @@ -685,7 +685,7 @@ void Camera::removeNametag(Nametag *nametag) std::array, 4> Camera::getFrustumCullPlanes() const { - using irr::scene::SViewFrustum; + using scene::SViewFrustum; const auto &frustum_planes = m_cameranode->getViewFrustum()->planes; return { frustum_planes[SViewFrustum::VF_LEFT_PLANE], diff --git a/src/client/camera.h b/src/client/camera.h index 49e07d4ee..851cf760d 100644 --- a/src/client/camera.h +++ b/src/client/camera.h @@ -164,7 +164,7 @@ public: // Draw the wielded tool. // This has to happen *after* the main scene is drawn. // Warning: This clears the Z buffer. - void drawWieldedTool(irr::core::matrix4* translation=NULL); + void drawWieldedTool(core::matrix4* translation=NULL); // Toggle the current camera mode void toggleCameraMode() diff --git a/src/client/clientlauncher.cpp b/src/client/clientlauncher.cpp index 4c8eaf060..e8aa46463 100644 --- a/src/client/clientlauncher.cpp +++ b/src/client/clientlauncher.cpp @@ -302,8 +302,8 @@ void ClientLauncher::init_input() void ClientLauncher::init_joysticks() { - irr::core::array infos; - std::vector joystick_infos; + core::array infos; + std::vector joystick_infos; // Make sure this is called maximum once per // irrlicht device, otherwise it will give you diff --git a/src/client/clientmap.h b/src/client/clientmap.h index daa9d80f1..259ae849e 100644 --- a/src/client/clientmap.h +++ b/src/client/clientmap.h @@ -26,12 +26,12 @@ class Client; class ITextureSource; class PartialMeshBuffer; -namespace irr::scene +namespace scene { class IMeshBuffer; } -namespace irr::video +namespace video { class IVideoDriver; } diff --git a/src/client/clientobject.h b/src/client/clientobject.h index 4002a8181..188c76ea0 100644 --- a/src/client/clientobject.h +++ b/src/client/clientobject.h @@ -19,7 +19,7 @@ class LocalPlayer; struct ItemStack; class WieldMeshSceneNode; -namespace irr::scene +namespace scene { class IAnimatedMeshSceneNode; class ISceneNode; diff --git a/src/client/clouds.h b/src/client/clouds.h index 4b39a8315..6326b15a0 100644 --- a/src/client/clouds.h +++ b/src/client/clouds.h @@ -15,7 +15,7 @@ class IShaderSource; -namespace irr::scene +namespace scene { class ISceneManager; } diff --git a/src/client/content_cao.h b/src/client/content_cao.h index 2e765ab6e..798b1674c 100644 --- a/src/client/content_cao.h +++ b/src/client/content_cao.h @@ -17,7 +17,7 @@ #include #include -namespace irr::scene { +namespace scene { class IMeshSceneNode; class IBillboardSceneNode; } diff --git a/src/client/content_cso.h b/src/client/content_cso.h index 4eb3277fb..4085bb58f 100644 --- a/src/client/content_cso.h +++ b/src/client/content_cso.h @@ -7,7 +7,7 @@ #include "irrlichttypes_bloated.h" #include "clientsimpleobject.h" -namespace irr::scene +namespace scene { class ISceneManager; } diff --git a/src/client/fontengine.cpp b/src/client/fontengine.cpp index ad1ae2eb2..582d13148 100644 --- a/src/client/fontengine.cpp +++ b/src/client/fontengine.cpp @@ -72,12 +72,12 @@ void FontEngine::clearCache() } } -irr::gui::IGUIFont *FontEngine::getFont(FontSpec spec) +gui::IGUIFont *FontEngine::getFont(FontSpec spec) { return getFont(spec, false); } -irr::gui::IGUIFont *FontEngine::getFont(FontSpec spec, bool may_fail) +gui::IGUIFont *FontEngine::getFont(FontSpec spec, bool may_fail) { if (spec.mode == FM_Unspecified) { spec.mode = s_default_font_mode; @@ -310,7 +310,7 @@ gui::IGUIFont *FontEngine::initFont(FontSpec spec) << " " << size << "pt" << std::endl; // Grab the face. - if (auto *face = irr::gui::SGUITTFace::loadFace(font_path)) { + if (auto *face = gui::SGUITTFace::loadFace(font_path)) { auto *font = createFont(face); face->drop(); return font; diff --git a/src/client/fontengine.h b/src/client/fontengine.h index 82949b250..b922fefa6 100644 --- a/src/client/fontengine.h +++ b/src/client/fontengine.h @@ -13,11 +13,9 @@ #include "irrString.h" // utf8_to_wide #include "threading/mutex_auto_lock.h" -namespace irr { - namespace gui { - class IGUIEnvironment; - class IGUIFont; - } +namespace gui { + class IGUIEnvironment; + class IGUIFont; } #define FONT_SIZE_UNSPECIFIED 0xFFFFFFFF @@ -76,9 +74,9 @@ public: ~FontEngine(); // Get best possible font specified by FontSpec - irr::gui::IGUIFont *getFont(FontSpec spec); + gui::IGUIFont *getFont(FontSpec spec); - irr::gui::IGUIFont *getFont(unsigned int font_size=FONT_SIZE_UNSPECIFIED, + gui::IGUIFont *getFont(unsigned int font_size=FONT_SIZE_UNSPECIFIED, FontMode mode=FM_Unspecified) { FontSpec spec(font_size, mode, m_default_bold, m_default_italic); @@ -148,7 +146,7 @@ public: void clearMediaFonts(); private: - irr::gui::IGUIFont *getFont(FontSpec spec, bool may_fail); + gui::IGUIFont *getFont(FontSpec spec, bool may_fail); /** update content of font cache in case of a setting change made it invalid */ void updateCache(); @@ -174,7 +172,7 @@ private: std::recursive_mutex m_font_mutex; /** internal storage for caching fonts of different size */ - std::map m_font_cache[FontSpec::MAX_VARIANTS]; + std::map m_font_cache[FontSpec::MAX_VARIANTS]; /** media-provided faces, indexed by filename (without extension) */ std::unordered_map> m_media_faces; diff --git a/src/client/game.cpp b/src/client/game.cpp index ebfc3f1c8..c2a6bd82e 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -1013,7 +1013,7 @@ void Game::run() m_touch_simulate_aux1 = g_settings->getBool("fast_move") && client->checkPrivilege("fast"); - const irr::core::dimension2du initial_screen_size( + const core::dimension2du initial_screen_size( g_settings->getU16("screen_w"), g_settings->getU16("screen_h") ); @@ -3385,10 +3385,10 @@ PointedThing Game::updatePointedThing( // Modify final color a bit with time u32 timer = client->getEnv().getFrameTime() % 5000; - float timerf = (float) (irr::core::PI * ((timer / 2500.0) - 0.5)); + float timerf = (float) (core::PI * ((timer / 2500.0) - 0.5)); float sin_r = 0.08f * std::sin(timerf); - float sin_g = 0.08f * std::sin(timerf + irr::core::PI * 0.5f); - float sin_b = 0.08f * std::sin(timerf + irr::core::PI); + float sin_g = 0.08f * std::sin(timerf + core::PI * 0.5f); + float sin_b = 0.08f * std::sin(timerf + core::PI); c.setRed(core::clamp(core::round32(c.getRed() * (0.8 + sin_r)), 0, 255)); c.setGreen(core::clamp(core::round32(c.getGreen() * (0.8 + sin_g)), 0, 255)); c.setBlue(core::clamp(core::round32(c.getBlue() * (0.8 + sin_b)), 0, 255)); diff --git a/src/client/gameui.h b/src/client/gameui.h index 03cbb3b2c..57ea0861d 100644 --- a/src/client/gameui.h +++ b/src/client/gameui.h @@ -9,7 +9,7 @@ #include #include "game.h" -using namespace irr; + class Client; class EnrichedString; class GUIChatConsole; diff --git a/src/client/guiscalingfilter.h b/src/client/guiscalingfilter.h index 5c8311f3d..d9b658431 100644 --- a/src/client/guiscalingfilter.h +++ b/src/client/guiscalingfilter.h @@ -9,7 +9,7 @@ #include #include -namespace irr::video +namespace video { class IImage; class ITexture; diff --git a/src/client/hud.cpp b/src/client/hud.cpp index 47ef56039..1083d677e 100644 --- a/src/client/hud.cpp +++ b/src/client/hud.cpp @@ -394,9 +394,9 @@ void Hud::drawLuaElements(const v3s16 &camera_offset) (e->style & HUD_STYLE_MONO) ? FM_Mono : FM_Unspecified, e->style & HUD_STYLE_BOLD, e->style & HUD_STYLE_ITALIC)); - irr::gui::CGUITTFont *ttfont = nullptr; - if (textfont->getType() == irr::gui::EGFT_CUSTOM) - ttfont = static_cast(textfont); + gui::CGUITTFont *ttfont = nullptr; + if (textfont->getType() == gui::EGFT_CUSTOM) + ttfont = static_cast(textfont); video::SColor color(255, (e->number >> 16) & 0xFF, (e->number >> 8) & 0xFF, diff --git a/src/client/hud.h b/src/client/hud.h index 313bbabbb..1cf4411de 100644 --- a/src/client/hud.h +++ b/src/client/hud.h @@ -20,12 +20,12 @@ class InventoryList; class LocalPlayer; struct ItemStack; -namespace irr::scene +namespace scene { class IMesh; } -namespace irr::video +namespace video { class ITexture; class IVideoDriver; diff --git a/src/client/imagefilters.h b/src/client/imagefilters.h index ff8905ba0..7b6e8a44b 100644 --- a/src/client/imagefilters.h +++ b/src/client/imagefilters.h @@ -8,7 +8,7 @@ #include #include -namespace irr::video +namespace video { class IVideoDriver; class IImage; diff --git a/src/client/imagesource.h b/src/client/imagesource.h index b5e3d8d3a..7e994659d 100644 --- a/src/client/imagesource.h +++ b/src/client/imagesource.h @@ -9,7 +9,6 @@ #include #include -using namespace irr; // This file is only used for internal generation of images. // Use texturesource.h to handle textures. diff --git a/src/client/inputhandler.cpp b/src/client/inputhandler.cpp index 56bdb184e..52e73356c 100644 --- a/src/client/inputhandler.cpp +++ b/src/client/inputhandler.cpp @@ -111,7 +111,7 @@ void MyEventReceiver::setKeyDown(GameKeyType action, bool is_down) bool MyEventReceiver::OnEvent(const SEvent &event) { - if (event.EventType == irr::EET_LOG_TEXT_EVENT) { + if (event.EventType == EET_LOG_TEXT_EVENT) { static const LogLevel irr_loglev_conv[] = { LL_VERBOSE, // ELL_DEBUG LL_INFO, // ELL_INFORMATION @@ -178,18 +178,18 @@ bool MyEventReceiver::OnEvent(const SEvent &event) } // Remember whether each key is down or up - if (event.EventType == irr::EET_KEY_INPUT_EVENT) { + if (event.EventType == EET_KEY_INPUT_EVENT) { KeyPress keyCode(event.KeyInput); if (setKeyDown(keyCode, event.KeyInput.PressedDown)) return true; - } else if (g_touchcontrols && event.EventType == irr::EET_TOUCH_INPUT_EVENT) { + } else if (g_touchcontrols && event.EventType == EET_TOUCH_INPUT_EVENT) { // In case of touchcontrols, we have to handle different events g_touchcontrols->translateEvent(event); return true; - } else if (event.EventType == irr::EET_JOYSTICK_INPUT_EVENT) { + } else if (event.EventType == EET_JOYSTICK_INPUT_EVENT) { // joystick may be nullptr if game is launched with '--random-input' parameter return joystick && joystick->handleEvent(event.JoystickEvent); - } else if (event.EventType == irr::EET_MOUSE_INPUT_EVENT) { + } else if (event.EventType == EET_MOUSE_INPUT_EVENT) { // Handle mouse events switch (event.MouseInput.Event) { case EMIE_LMOUSE_PRESSED_DOWN: diff --git a/src/client/item_visuals_manager.h b/src/client/item_visuals_manager.h index 36604f0c7..de346b141 100644 --- a/src/client/item_visuals_manager.h +++ b/src/client/item_visuals_manager.h @@ -14,7 +14,7 @@ class Client; struct ItemStack; typedef std::vector Palette; // copied from src/client/texturesource.h -namespace irr::video { class ITexture; } +namespace video { class ITexture; } // Caches data needed to draw an itemstack diff --git a/src/client/joystick_controller.cpp b/src/client/joystick_controller.cpp index 854bed925..3e0122d24 100644 --- a/src/client/joystick_controller.cpp +++ b/src/client/joystick_controller.cpp @@ -10,7 +10,7 @@ #include "util/string.h" #include "util/numeric.h" -bool JoystickButtonCmb::isTriggered(const irr::SEvent::SJoystickEvent &ev) const +bool JoystickButtonCmb::isTriggered(const SEvent::SJoystickEvent &ev) const { u32 buttons = ev.ButtonStates; @@ -18,7 +18,7 @@ bool JoystickButtonCmb::isTriggered(const irr::SEvent::SJoystickEvent &ev) const return buttons == compare_mask; } -bool JoystickAxisCmb::isTriggered(const irr::SEvent::SJoystickEvent &ev) const +bool JoystickAxisCmb::isTriggered(const SEvent::SJoystickEvent &ev) const { s16 ax_val = ev.Axis[axis_to_compare]; @@ -197,7 +197,7 @@ JoystickController::JoystickController() clear(); } -void JoystickController::onJoystickConnect(const std::vector &joystick_infos) +void JoystickController::onJoystickConnect(const std::vector &joystick_infos) { s32 id = g_settings->getS32("joystick_id"); std::string layout = g_settings->get("joystick_type"); @@ -229,7 +229,7 @@ void JoystickController::setLayoutFromControllerName(const std::string &name) } } -bool JoystickController::handleEvent(const irr::SEvent::SJoystickEvent &ev) +bool JoystickController::handleEvent(const SEvent::SJoystickEvent &ev) { if (ev.Joystick != m_joystick_id) return false; diff --git a/src/client/joystick_controller.h b/src/client/joystick_controller.h index d7bf4230e..5c2d9fe92 100644 --- a/src/client/joystick_controller.h +++ b/src/client/joystick_controller.h @@ -31,7 +31,7 @@ struct JoystickAxisLayout { struct JoystickCombination { - virtual bool isTriggered(const irr::SEvent::SJoystickEvent &ev) const=0; + virtual bool isTriggered(const SEvent::SJoystickEvent &ev) const=0; GameKeyType key; }; @@ -49,7 +49,7 @@ struct JoystickButtonCmb : public JoystickCombination { virtual ~JoystickButtonCmb() = default; - virtual bool isTriggered(const irr::SEvent::SJoystickEvent &ev) const; + virtual bool isTriggered(const SEvent::SJoystickEvent &ev) const; u32 filter_mask; u32 compare_mask; @@ -69,7 +69,7 @@ struct JoystickAxisCmb : public JoystickCombination { virtual ~JoystickAxisCmb() = default; - bool isTriggered(const irr::SEvent::SJoystickEvent &ev) const override; + bool isTriggered(const SEvent::SJoystickEvent &ev) const override; u16 axis_to_compare; @@ -91,9 +91,9 @@ class JoystickController { public: JoystickController(); - void onJoystickConnect(const std::vector &joystick_infos); + void onJoystickConnect(const std::vector &joystick_infos); - bool handleEvent(const irr::SEvent::SJoystickEvent &ev); + bool handleEvent(const SEvent::SJoystickEvent &ev); void clear(); void releaseAllKeys() diff --git a/src/client/keycode.cpp b/src/client/keycode.cpp index 71e068e30..e21bc6308 100644 --- a/src/client/keycode.cpp +++ b/src/client/keycode.cpp @@ -15,21 +15,21 @@ struct table_key { std::string Name; // An EKEY_CODE 'symbol' name as a string - irr::EKEY_CODE Key; + EKEY_CODE Key; wchar_t Char; // L'\0' means no character assigned std::string LangName; // empty string means it doesn't have a human description }; #define DEFINEKEY1(x, lang) /* Irrlicht key without character */ \ - { #x, irr::x, L'\0', lang }, + { #x, x, L'\0', lang }, #define DEFINEKEY2(x, ch, lang) /* Irrlicht key with character */ \ - { #x, irr::x, ch, lang }, + { #x, x, ch, lang }, #define DEFINEKEY3(ch) /* single Irrlicht key (e.g. KEY_KEY_X) */ \ - { "KEY_KEY_" TOSTRING(ch), irr::KEY_KEY_ ## ch, (wchar_t) *TOSTRING(ch), TOSTRING(ch) }, + { "KEY_KEY_" TOSTRING(ch), KEY_KEY_ ## ch, (wchar_t) *TOSTRING(ch), TOSTRING(ch) }, #define DEFINEKEY4(ch) /* single Irrlicht function key (e.g. KEY_F3) */ \ - { "KEY_F" TOSTRING(ch), irr::KEY_F ## ch, L'\0', "F" TOSTRING(ch) }, + { "KEY_F" TOSTRING(ch), KEY_F ## ch, L'\0', "F" TOSTRING(ch) }, #define DEFINEKEY5(ch) /* key without Irrlicht keycode */ \ - { ch, irr::KEY_KEY_CODES_COUNT, (wchar_t) *ch, ch }, + { ch, KEY_KEY_CODES_COUNT, (wchar_t) *ch, ch }, #define N_(text) text @@ -224,7 +224,7 @@ static std::vector table = { DEFINEKEY5("_") }; -static const table_key invalid_key = {"", irr::KEY_UNKNOWN, L'\0', ""}; +static const table_key invalid_key = {"", KEY_UNKNOWN, L'\0', ""}; #undef N_ @@ -241,11 +241,11 @@ static const table_key &lookup_keychar(wchar_t Char) // Create a new entry in the lookup table if one is not available. auto newsym = wide_to_utf8(std::wstring_view(&Char, 1)); - table_key new_key {newsym, irr::KEY_KEY_CODES_COUNT, Char, newsym}; + table_key new_key {newsym, KEY_KEY_CODES_COUNT, Char, newsym}; return table.emplace_back(std::move(new_key)); } -static const table_key &lookup_keykey(irr::EKEY_CODE key) +static const table_key &lookup_keykey(EKEY_CODE key) { if (!Keycode::isValid(key)) return invalid_key; @@ -278,18 +278,18 @@ static const table_key &lookup_scancode(const u32 scancode) { auto key = RenderingEngine::get_raw_device()->getKeyFromScancode(scancode); return std::holds_alternative(key) ? - lookup_keykey(std::get(key)) : + lookup_keykey(std::get(key)) : lookup_keychar(std::get(key)); } -static const table_key &lookup_scancode(const std::variant &scancode) +static const table_key &lookup_scancode(const std::variant &scancode) { - return std::holds_alternative(scancode) ? - lookup_keykey(std::get(scancode)) : + return std::holds_alternative(scancode) ? + lookup_keykey(std::get(scancode)) : lookup_scancode(std::get(scancode)); } -void KeyPress::loadFromKey(irr::EKEY_CODE keycode, wchar_t keychar) +void KeyPress::loadFromKey(EKEY_CODE keycode, wchar_t keychar) { scancode = RenderingEngine::get_raw_device()->getScancodeFromKey(Keycode(keycode, keychar)); } @@ -302,13 +302,13 @@ KeyPress::KeyPress(const std::string &name) loadFromKey(key.Key, key.Char); } -KeyPress::KeyPress(const irr::SEvent::SKeyInput &in) +KeyPress::KeyPress(const SEvent::SKeyInput &in) { if (USE_SDL2) { if (in.SystemKeyCode) scancode.emplace(in.SystemKeyCode); else - scancode.emplace(in.Key); + scancode.emplace(in.Key); } else { loadFromKey(in.Key, in.Char); } @@ -340,7 +340,7 @@ std::string KeyPress::name() const return formatScancode(); } -irr::EKEY_CODE KeyPress::getKeycode() const +EKEY_CODE KeyPress::getKeycode() const { return lookup_scancode(scancode).Key; } diff --git a/src/client/keycode.h b/src/client/keycode.h index 503529b52..a62e7822c 100644 --- a/src/client/keycode.h +++ b/src/client/keycode.h @@ -20,7 +20,7 @@ public: KeyPress(const std::string &name); - KeyPress(const irr::SEvent::SKeyInput &in); + KeyPress(const SEvent::SKeyInput &in); // Get a string representation that is suitable for use in minetest.conf std::string sym() const; @@ -29,7 +29,7 @@ public: std::string name() const; // Get the corresponding keycode or KEY_UNKNOWN if one is not available - irr::EKEY_CODE getKeycode() const; + EKEY_CODE getKeycode() const; // Get the corresponding keychar or '\0' if one is not available wchar_t getKeychar() const; @@ -57,20 +57,20 @@ public: // Check whether the keypress is valid operator bool() const { - return std::holds_alternative(scancode) ? - Keycode::isValid(std::get(scancode)) : + return std::holds_alternative(scancode) ? + Keycode::isValid(std::get(scancode)) : std::get(scancode) != 0; } static KeyPress getSpecialKey(const std::string &name); private: - using value_type = std::variant; + using value_type = std::variant; bool loadFromScancode(const std::string &name); - void loadFromKey(irr::EKEY_CODE keycode, wchar_t keychar); + void loadFromKey(EKEY_CODE keycode, wchar_t keychar); std::string formatScancode() const; - value_type scancode = irr::KEY_UNKNOWN; + value_type scancode = KEY_UNKNOWN; friend std::hash; }; diff --git a/src/client/mapblock_mesh.cpp b/src/client/mapblock_mesh.cpp index 5aaa4d98a..8181c2e6d 100644 --- a/src/client/mapblock_mesh.cpp +++ b/src/client/mapblock_mesh.cpp @@ -316,7 +316,7 @@ void final_color_blend(video::SColor *result, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; - b += emphase_blue_when_dark[irr::core::clamp((s32) ((r + g + b) / 3 * 255), + b += emphase_blue_when_dark[core::clamp((s32) ((r + g + b) / 3 * 255), 0, 255) / 8] / 255.0f; result->setRed(core::clamp((s32) (r * 255.0f), 0, 255)); diff --git a/src/client/mapblock_mesh.h b/src/client/mapblock_mesh.h index 698163589..4df70320f 100644 --- a/src/client/mapblock_mesh.h +++ b/src/client/mapblock_mesh.h @@ -16,7 +16,7 @@ #include #include -namespace irr::video { +namespace video { class IVideoDriver; } diff --git a/src/client/mesh.h b/src/client/mesh.h index 53c54fc51..df6376b10 100644 --- a/src/client/mesh.h +++ b/src/client/mesh.h @@ -8,15 +8,12 @@ #include "SMaterialLayer.h" #include "nodedef.h" -namespace irr { - namespace scene { - class IAnimatedMesh; - class IMesh; - class IMeshBuffer; - } +namespace scene { + class IAnimatedMesh; + class IMesh; + class IMeshBuffer; } -using namespace irr; /*! * Applies shading to a color based on the surface's diff --git a/src/client/minimap.cpp b/src/client/minimap.cpp index ae6244b93..fbba80e6c 100644 --- a/src/client/minimap.cpp +++ b/src/client/minimap.cpp @@ -481,7 +481,7 @@ video::ITexture *Minimap::getMinimapTexture() map_image->fill(video::SColor(255, 0, 0, 0)); image->copyTo(map_image, - irr::core::vector2d { + core::vector2d { ((data->mode.map_size - (static_cast(dim.Width))) >> 1) - data->pos.X / data->mode.scale, ((data->mode.map_size - (static_cast(dim.Height))) >> 1) diff --git a/src/client/minimap.h b/src/client/minimap.h index d6c61f4ff..d240f2332 100644 --- a/src/client/minimap.h +++ b/src/client/minimap.h @@ -16,16 +16,14 @@ #include #include -namespace irr { - namespace video { - class IVideoDriver; - class IImage; - class ITexture; - } +namespace video { + class IVideoDriver; + class IImage; + class ITexture; +} - namespace scene { - class ISceneNode; - } +namespace scene { + class ISceneNode; } class Client; diff --git a/src/client/particles.h b/src/client/particles.h index 87a12d4a6..43acac8ee 100644 --- a/src/client/particles.h +++ b/src/client/particles.h @@ -16,7 +16,7 @@ #include #include "../particles.h" -namespace irr::video { +namespace video { class ITexture; } diff --git a/src/client/render/core.h b/src/client/render/core.h index f9d92bee5..e05cfa7f7 100644 --- a/src/client/render/core.h +++ b/src/client/render/core.h @@ -8,10 +8,7 @@ #include "irr_v2d.h" #include -namespace irr -{ - class IrrlichtDevice; -} +class IrrlichtDevice; class ShadowRenderer; class Camera; diff --git a/src/client/render/pipeline.h b/src/client/render/pipeline.h index d91d523b9..3ca67a09c 100644 --- a/src/client/render/pipeline.h +++ b/src/client/render/pipeline.h @@ -18,7 +18,7 @@ class Client; class Hud; class ShadowRenderer; -namespace irr::video +namespace video { class IRenderTarget; } diff --git a/src/client/renderingengine.cpp b/src/client/renderingengine.cpp index 3b3d114ea..766071ee5 100644 --- a/src/client/renderingengine.cpp +++ b/src/client/renderingengine.cpp @@ -130,7 +130,7 @@ static inline auto getVideoDriverName(video::E_DRIVER_TYPE driver) return RenderingEngine::getVideoDriverInfo(driver).friendly_name; } -static irr::IrrlichtDevice *createDevice(SIrrlichtCreationParameters params, std::optional requested_driver) +static IrrlichtDevice *createDevice(SIrrlichtCreationParameters params, std::optional requested_driver) { if (requested_driver) { params.DriverType = *requested_driver; @@ -189,7 +189,7 @@ RenderingEngine::RenderingEngine(MyEventReceiver *receiver) SIrrlichtCreationParameters params = SIrrlichtCreationParameters(); if (tracestream) - params.LoggingLevel = irr::ELL_DEBUG; + params.LoggingLevel = ELL_DEBUG; params.WindowSize = core::dimension2d(screen_w, screen_h); params.AntiAlias = fsaa; params.Fullscreen = fullscreen; @@ -407,7 +407,7 @@ void RenderingEngine::draw_scene(video::SColor skycolor, bool show_hud, core->draw(skycolor, show_hud, draw_wield_tool, draw_crosshair); } -const VideoDriverInfo &RenderingEngine::getVideoDriverInfo(irr::video::E_DRIVER_TYPE type) +const VideoDriverInfo &RenderingEngine::getVideoDriverInfo(video::E_DRIVER_TYPE type) { static const std::unordered_map driver_info_map = { {(int)video::EDT_NULL, {"null", "NULL Driver"}}, @@ -432,7 +432,7 @@ float RenderingEngine::getDisplayDensity() } void RenderingEngine::autosaveScreensizeAndCo( - const irr::core::dimension2d initial_screen_size, + const core::dimension2d initial_screen_size, const bool initial_window_maximized) { if (!g_settings->getBool("autosave_screensize")) @@ -446,11 +446,11 @@ void RenderingEngine::autosaveScreensizeAndCo( // Don't save the fullscreen size, we want the windowed size. bool fullscreen = RenderingEngine::get_raw_device()->isFullscreen(); // Screen size - const irr::core::dimension2d current_screen_size = + const core::dimension2d current_screen_size = RenderingEngine::get_video_driver()->getScreenSize(); // Don't replace good value with (0, 0) if (!fullscreen && - current_screen_size != irr::core::dimension2d(0, 0) && + current_screen_size != core::dimension2d(0, 0) && current_screen_size != initial_screen_size) { g_settings->setU16("screen_w", current_screen_size.Width); g_settings->setU16("screen_h", current_screen_size.Height); diff --git a/src/client/renderingengine.h b/src/client/renderingengine.h index 34918ec7a..24896a485 100644 --- a/src/client/renderingengine.h +++ b/src/client/renderingengine.h @@ -75,7 +75,7 @@ public: video::IVideoDriver *getVideoDriver() { return driver; } - static const VideoDriverInfo &getVideoDriverInfo(irr::video::E_DRIVER_TYPE type); + static const VideoDriverInfo &getVideoDriverInfo(video::E_DRIVER_TYPE type); static float getDisplayDensity(); bool setupTopLevelWindow(); @@ -112,7 +112,7 @@ public: return m_device->getSceneManager(); } - static irr::IrrlichtDevice *get_raw_device() + static IrrlichtDevice *get_raw_device() { sanity_check(s_singleton && s_singleton->m_device); return s_singleton->m_device; @@ -147,10 +147,10 @@ public: return s_singleton->core->get_shadow_renderer(); return nullptr; } - static std::vector getSupportedVideoDrivers(); + static std::vector getSupportedVideoDrivers(); static void autosaveScreensizeAndCo( - const irr::core::dimension2d initial_screen_size, + const core::dimension2d initial_screen_size, const bool initial_window_maximized); static PointerType getLastPointerType() @@ -164,8 +164,8 @@ private: v2u32 _getWindowSize() const; std::unique_ptr core; - irr::IrrlichtDevice *m_device = nullptr; - irr::video::IVideoDriver *driver; + IrrlichtDevice *m_device = nullptr; + video::IVideoDriver *driver; MyEventReceiver *m_receiver = nullptr; static RenderingEngine *s_singleton; }; diff --git a/src/client/shader.h b/src/client/shader.h index c4e37bb2e..910117660 100644 --- a/src/client/shader.h +++ b/src/client/shader.h @@ -51,7 +51,7 @@ public: Abstraction for updating uniforms used by shaders */ -namespace irr::video { +namespace video { class IMaterialRendererServices; } diff --git a/src/client/sky.cpp b/src/client/sky.cpp index 958ffa953..ee3172c10 100644 --- a/src/client/sky.cpp +++ b/src/client/sky.cpp @@ -20,7 +20,7 @@ #include "settings.h" #include "camera.h" // CameraModes -using namespace irr::core; +using namespace core; static video::SMaterial baseMaterial() { @@ -140,7 +140,7 @@ void Sky::render() video::SColor mooncolor2 = mooncolor2_f.toSColor(); // Calculate offset normalized to the X dimension of a 512x1 px tonemap - float offset = (1.0 - fabs(sin((m_time_of_day - 0.5) * irr::core::PI))) * 511; + float offset = (1.0 - fabs(sin((m_time_of_day - 0.5) * core::PI))) * 511; if (m_sun_tonemap) { auto texel_color = m_sun_tonemap->getPixel(offset, 0); diff --git a/src/client/sky.h b/src/client/sky.h index aad855244..e1eb32be3 100644 --- a/src/client/sky.h +++ b/src/client/sky.h @@ -14,7 +14,7 @@ #define SKY_MATERIAL_COUNT 12 -namespace irr::video +namespace video { class IVideoDriver; class IImage; diff --git a/src/client/texturesource.h b/src/client/texturesource.h index bb04325ff..d89fd1689 100644 --- a/src/client/texturesource.h +++ b/src/client/texturesource.h @@ -9,7 +9,7 @@ #include #include -namespace irr::video +namespace video { class IImage; class ITexture; diff --git a/src/client/wieldmesh.h b/src/client/wieldmesh.h index 1dced09e1..ce8e5d151 100644 --- a/src/client/wieldmesh.h +++ b/src/client/wieldmesh.h @@ -14,14 +14,14 @@ #include #include "tile.h" -namespace irr::scene +namespace scene { class ISceneManager; class IMesh; struct SMesh; } -using namespace irr; + struct ItemStack; class Client; diff --git a/src/filesys.h b/src/filesys.h index 3f2b81d54..73c9041a3 100644 --- a/src/filesys.h +++ b/src/filesys.h @@ -23,7 +23,7 @@ #define PATH_DELIM ":" #endif -namespace irr::io { +namespace io { class IFileSystem; } @@ -151,7 +151,7 @@ const char *GetFilenameFromPath(const char *path); bool safeWriteToFile(const std::string &path, std::string_view content); #if IS_CLIENT_BUILD -bool extractZipFile(irr::io::IFileSystem *fs, const char *filename, const std::string &destination); +bool extractZipFile(io::IFileSystem *fs, const char *filename, const std::string &destination); #endif bool ReadFile(const std::string &path, std::string &out, bool log_error = false); diff --git a/src/gamedef.h b/src/gamedef.h index fa38a2bdf..247ec09f6 100644 --- a/src/gamedef.h +++ b/src/gamedef.h @@ -23,7 +23,7 @@ struct SubgameSpec; struct ModSpec; struct ModIPCStore; -namespace irr::scene { +namespace scene { class IAnimatedMesh; class ISceneManager; } diff --git a/src/gui/StyleSpec.h b/src/gui/StyleSpec.h index f78a038c2..64bc837b9 100644 --- a/src/gui/StyleSpec.h +++ b/src/gui/StyleSpec.h @@ -236,25 +236,25 @@ public: return def; } - irr::core::rect getRect(Property prop, irr::core::rect def) const + core::rect getRect(Property prop, core::rect def) const { const auto &val = properties[prop]; if (val.empty()) return def; - irr::core::rect rect; + core::rect rect; if (!parseRect(val, &rect)) return def; return rect; } - irr::core::rect getRect(Property prop) const + core::rect getRect(Property prop) const { const auto &val = properties[prop]; FATAL_ERROR_IF(val.empty(), "Unexpected missing property"); - irr::core::rect rect; + core::rect rect; parseRect(val, &rect); return rect; } @@ -416,25 +416,25 @@ private: return true; } - bool parseRect(const std::string &value, irr::core::rect *parsed_rect) const + bool parseRect(const std::string &value, core::rect *parsed_rect) const { - irr::core::rect rect; + core::rect rect; std::vector v_rect = split(value, ','); if (v_rect.size() == 1) { s32 x = stoi(v_rect[0]); - rect.UpperLeftCorner = irr::core::vector2di(x, x); - rect.LowerRightCorner = irr::core::vector2di(-x, -x); + rect.UpperLeftCorner = core::vector2di(x, x); + rect.LowerRightCorner = core::vector2di(-x, -x); } else if (v_rect.size() == 2) { s32 x = stoi(v_rect[0]); s32 y = stoi(v_rect[1]); - rect.UpperLeftCorner = irr::core::vector2di(x, y); - rect.LowerRightCorner = irr::core::vector2di(-x, -y); + rect.UpperLeftCorner = core::vector2di(x, y); + rect.LowerRightCorner = core::vector2di(-x, -y); // `-x` is interpreted as `w - x` } else if (v_rect.size() == 4) { - rect.UpperLeftCorner = irr::core::vector2di( + rect.UpperLeftCorner = core::vector2di( stoi(v_rect[0]), stoi(v_rect[1])); - rect.LowerRightCorner = irr::core::vector2di( + rect.LowerRightCorner = core::vector2di( stoi(v_rect[2]), stoi(v_rect[3])); } else { warningstream << "Invalid rectangle string format: \"" << value diff --git a/src/gui/guiAnimatedImage.h b/src/gui/guiAnimatedImage.h index 8f42cd9f3..42d2f3451 100644 --- a/src/gui/guiAnimatedImage.h +++ b/src/gui/guiAnimatedImage.h @@ -4,7 +4,6 @@ #include #include -using namespace irr; class ISimpleTextureSource; diff --git a/src/gui/guiBackgroundImage.h b/src/gui/guiBackgroundImage.h index de12c48d7..65c2d6f73 100644 --- a/src/gui/guiBackgroundImage.h +++ b/src/gui/guiBackgroundImage.h @@ -21,7 +21,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include "irr_v2d.h" -using namespace irr; class ISimpleTextureSource; diff --git a/src/gui/guiBox.h b/src/gui/guiBox.h index 49c3b8210..1b3a214a6 100644 --- a/src/gui/guiBox.h +++ b/src/gui/guiBox.h @@ -8,7 +8,6 @@ #include #include -using namespace irr; class GUIBox : public gui::IGUIElement { diff --git a/src/gui/guiButton.cpp b/src/gui/guiButton.cpp index 9975549fe..aec9454c9 100644 --- a/src/gui/guiButton.cpp +++ b/src/gui/guiButton.cpp @@ -15,7 +15,7 @@ #include "StyleSpec.h" #include "util/numeric.h" -using namespace irr; + using namespace gui; // Multiply with a color to get the default corresponding hovered color @@ -744,8 +744,8 @@ void GUIButton::setFromStyle(const StyleSpec& style) IGUISkin *skin = Environment->getSkin(); core::vector2d defaultPressOffset( - skin->getSize(irr::gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X), - skin->getSize(irr::gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y)); + skin->getSize(gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X), + skin->getSize(gui::EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y)); ContentOffset = style.getVector2i(StyleSpec::CONTENT_OFFSET, isPressed() ? defaultPressOffset : core::vector2d(0)); diff --git a/src/gui/guiButton.h b/src/gui/guiButton.h index dd71788ba..dcdff23fe 100644 --- a/src/gui/guiButton.h +++ b/src/gui/guiButton.h @@ -12,7 +12,6 @@ #include "SColor.h" #include "StyleSpec.h" -using namespace irr; class ISimpleTextureSource; diff --git a/src/gui/guiButtonImage.cpp b/src/gui/guiButtonImage.cpp index fd3481d85..eb3ee20fe 100644 --- a/src/gui/guiButtonImage.cpp +++ b/src/gui/guiButtonImage.cpp @@ -11,7 +11,7 @@ #include "IVideoDriver.h" #include "StyleSpec.h" -using namespace irr; + using namespace gui; GUIButtonImage::GUIButtonImage(gui::IGUIEnvironment *environment, diff --git a/src/gui/guiButtonImage.h b/src/gui/guiButtonImage.h index c07be178b..1e8c4a551 100644 --- a/src/gui/guiButtonImage.h +++ b/src/gui/guiButtonImage.h @@ -9,7 +9,6 @@ #include "guiAnimatedImage.h" #include "irr_ptr.h" -using namespace irr; class GUIButtonImage : public GUIButton { diff --git a/src/gui/guiButtonItemImage.cpp b/src/gui/guiButtonItemImage.cpp index bb7f55fff..c93f058fb 100644 --- a/src/gui/guiButtonItemImage.cpp +++ b/src/gui/guiButtonItemImage.cpp @@ -9,7 +9,7 @@ #include "IGUIEnvironment.h" #include "itemdef.h" -using namespace irr; + using namespace gui; GUIButtonItemImage::GUIButtonItemImage(gui::IGUIEnvironment *environment, diff --git a/src/gui/guiButtonItemImage.h b/src/gui/guiButtonItemImage.h index d4d00b82e..872d93a22 100644 --- a/src/gui/guiButtonItemImage.h +++ b/src/gui/guiButtonItemImage.h @@ -7,7 +7,6 @@ #include "guiButton.h" #include "IGUIButton.h" -using namespace irr; class Client; class GUIItemImage; diff --git a/src/gui/guiButtonKey.cpp b/src/gui/guiButtonKey.cpp index 85e3719b1..6a7c0817f 100644 --- a/src/gui/guiButtonKey.cpp +++ b/src/gui/guiButtonKey.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: LGPL-2.1-or-later #include "guiButtonKey.h" -using namespace irr::gui; +using namespace gui; GUIButtonKey *GUIButtonKey::addButton(IGUIEnvironment *environment, const core::rect &rectangle, ISimpleTextureSource *tsrc, diff --git a/src/gui/guiButtonKey.h b/src/gui/guiButtonKey.h index 75d0d56ee..86414c00d 100644 --- a/src/gui/guiButtonKey.h +++ b/src/gui/guiButtonKey.h @@ -8,7 +8,6 @@ #include "util/string.h" #include "gettext.h" -using namespace irr; class GUIButtonKey : public GUIButton { diff --git a/src/gui/guiChatConsole.cpp b/src/gui/guiChatConsole.cpp index 31df2a944..db90368cc 100644 --- a/src/gui/guiChatConsole.cpp +++ b/src/gui/guiChatConsole.cpp @@ -24,7 +24,7 @@ inline u32 clamp_u8(s32 value) return (u32) MYMIN(MYMAX(value, 0), 255); } -inline bool isInCtrlKeys(const irr::EKEY_CODE& kc) +inline bool isInCtrlKeys(const EKEY_CODE& kc) { return kc == KEY_LCONTROL || kc == KEY_RCONTROL || kc == KEY_CONTROL; } @@ -332,7 +332,7 @@ void GUIChatConsole::drawText() core::rect destrect( x, y, x + m_fontsize.X * fragment.text.size(), y + m_fontsize.Y); - if (m_font->getType() == irr::gui::EGFT_CUSTOM) { + if (m_font->getType() == gui::EGFT_CUSTOM) { // Draw colored text if possible auto *tmp = static_cast(m_font.get()); tmp->draw( diff --git a/src/gui/guiEditBox.cpp b/src/gui/guiEditBox.cpp index 9aa12bce4..a5f2581f7 100644 --- a/src/gui/guiEditBox.cpp +++ b/src/gui/guiEditBox.cpp @@ -707,7 +707,7 @@ void GUIEditBox::inputString(const core::stringw &str) bool GUIEditBox::processMouse(const SEvent &event) { switch (event.MouseInput.Event) { - case irr::EMIE_LMOUSE_LEFT_UP: + case EMIE_LMOUSE_LEFT_UP: if (Environment->hasFocus(this)) { m_cursor_pos = getCursorPos( event.MouseInput.X, event.MouseInput.Y); @@ -719,7 +719,7 @@ bool GUIEditBox::processMouse(const SEvent &event) return true; } break; - case irr::EMIE_MOUSE_MOVED: { + case EMIE_MOUSE_MOVED: { if (m_mouse_marking) { m_cursor_pos = getCursorPos( event.MouseInput.X, event.MouseInput.Y); diff --git a/src/gui/guiEditBox.h b/src/gui/guiEditBox.h index be9df89ff..be18e19a6 100644 --- a/src/gui/guiEditBox.h +++ b/src/gui/guiEditBox.h @@ -10,8 +10,8 @@ #include "guiScrollBar.h" #include -using namespace irr; -using namespace irr::gui; + +using namespace gui; class GUIEditBox : public IGUIEditBox { diff --git a/src/gui/guiEditBoxWithScrollbar.cpp b/src/gui/guiEditBoxWithScrollbar.cpp index 7e89a32d3..e6ce9aa76 100644 --- a/src/gui/guiEditBoxWithScrollbar.cpp +++ b/src/gui/guiEditBoxWithScrollbar.cpp @@ -503,7 +503,7 @@ void GUIEditBoxWithScrollBar::calculateScrollPos() return; // get cursor area - irr::u32 cursor_width = font->getDimension(L"_").Width; + u32 cursor_width = font->getDimension(L"_").Width; core::stringw *txt_line = has_broken_text ? &m_broken_text[curs_line] : &Text; s32 cpos = has_broken_text ? m_cursor_pos - m_broken_text_positions[curs_line] : m_cursor_pos; // column s32 cstart = font->getDimension(txt_line->subString(0, cpos).c_str()).Width; // pixels from text-start @@ -534,9 +534,9 @@ void GUIEditBoxWithScrollBar::calculateScrollPos() // calculate vertical scrolling if (has_broken_text) { - irr::u32 line_height = font->getDimension(L"A").Height + font->getKerning(L'A').Y; + u32 line_height = font->getDimension(L"A").Height + font->getKerning(L'A').Y; // only up to 1 line fits? - if (line_height >= (irr::u32)m_frame_rect.getHeight()) { + if (line_height >= (u32)m_frame_rect.getHeight()) { m_vscroll_pos = 0; setTextRect(curs_line); s32 unscrolledPos = m_current_text_rect.UpperLeftCorner.Y; @@ -627,7 +627,7 @@ void GUIEditBoxWithScrollBar::createVScrollBar() m_scrollbar_width = skin ? skin->getSize(gui::EGDS_SCROLLBAR_SIZE) : 16; - irr::core::rect scrollbarrect = m_frame_rect; + core::rect scrollbarrect = m_frame_rect; scrollbarrect.UpperLeftCorner.X += m_frame_rect.getWidth() - m_scrollbar_width; m_vscrollbar = new GUIScrollBar(Environment, getParent(), -1, scrollbarrect, false, true, m_tsrc); @@ -650,5 +650,5 @@ bool GUIEditBoxWithScrollBar::isDrawBackgroundEnabled() const { return false; } bool GUIEditBoxWithScrollBar::isDrawBorderEnabled() const { return false; } void GUIEditBoxWithScrollBar::setCursorChar(const wchar_t cursorChar) { } wchar_t GUIEditBoxWithScrollBar::getCursorChar() const { return '|'; } -void GUIEditBoxWithScrollBar::setCursorBlinkTime(irr::u32 timeMs) { } -irr::u32 GUIEditBoxWithScrollBar::getCursorBlinkTime() const { return 500; } +void GUIEditBoxWithScrollBar::setCursorBlinkTime(u32 timeMs) { } +u32 GUIEditBoxWithScrollBar::getCursorBlinkTime() const { return 500; } diff --git a/src/gui/guiEditBoxWithScrollbar.h b/src/gui/guiEditBoxWithScrollbar.h index 22c9dce6d..7ba742b0d 100644 --- a/src/gui/guiEditBoxWithScrollbar.h +++ b/src/gui/guiEditBoxWithScrollbar.h @@ -37,8 +37,8 @@ public: virtual bool isDrawBorderEnabled() const; virtual void setCursorChar(const wchar_t cursorChar); virtual wchar_t getCursorChar() const; - virtual void setCursorBlinkTime(irr::u32 timeMs); - virtual irr::u32 getCursorBlinkTime() const; + virtual void setCursorBlinkTime(u32 timeMs); + virtual u32 getCursorBlinkTime() const; protected: //! Breaks the single text line. diff --git a/src/gui/guiEngine.cpp b/src/gui/guiEngine.cpp index e843b5b38..99a755d41 100644 --- a/src/gui/guiEngine.cpp +++ b/src/gui/guiEngine.cpp @@ -317,7 +317,7 @@ void GUIEngine::run() fog_end, fog_density, fog_pixelfog, fog_rangefog); } - const irr::core::dimension2d initial_screen_size( + const core::dimension2d initial_screen_size( g_settings->getU16("screen_w"), g_settings->getU16("screen_h") ); diff --git a/src/gui/guiEngine.h b/src/gui/guiEngine.h index 4fde215fb..32dbdce72 100644 --- a/src/gui/guiEngine.h +++ b/src/gui/guiEngine.h @@ -254,7 +254,7 @@ private: void setTopleftText(const std::string &text); /** pointer to gui element shown at topleft corner */ - irr::gui::IGUIStaticText *m_irr_toplefttext = nullptr; + gui::IGUIStaticText *m_irr_toplefttext = nullptr; /** and text that is in it */ EnrichedString m_toplefttext; diff --git a/src/gui/guiFormSpecMenu.cpp b/src/gui/guiFormSpecMenu.cpp index 96ead0a8f..7d3837689 100644 --- a/src/gui/guiFormSpecMenu.cpp +++ b/src/gui/guiFormSpecMenu.cpp @@ -1505,7 +1505,7 @@ void GUIFormSpecMenu::parsePwdField(parserData* data, const std::string &element e->setOverrideColor(style.getColor(StyleSpec::TEXTCOLOR, video::SColor(0xFFFFFFFF))); e->setOverrideFont(style.getFont()); - irr::SEvent evt; + SEvent evt; evt.EventType = EET_KEY_INPUT_EVENT; evt.KeyInput.Key = KEY_END; evt.KeyInput.Char = 0; @@ -1560,7 +1560,7 @@ void GUIFormSpecMenu::createTextField(parserData *data, FieldSpec &spec, e->setWordWrap(true); e->setTextAlignment(gui::EGUIA_UPPERLEFT, gui::EGUIA_UPPERLEFT); } else { - irr::SEvent evt; + SEvent evt; evt.EventType = EET_KEY_INPUT_EVENT; evt.KeyInput.Key = KEY_END; evt.KeyInput.Char = 0; @@ -2137,8 +2137,8 @@ void GUIFormSpecMenu::parseTabHeader(parserData* data, const std::string &elemen gui::IGUITabControl *e = Environment->addTabControl(rect, data->current_parent, show_background, show_border, spec.fid); - e->setAlignment(irr::gui::EGUIA_UPPERLEFT, irr::gui::EGUIA_UPPERLEFT, - irr::gui::EGUIA_UPPERLEFT, irr::gui::EGUIA_LOWERRIGHT); + e->setAlignment(gui::EGUIA_UPPERLEFT, gui::EGUIA_UPPERLEFT, + gui::EGUIA_UPPERLEFT, gui::EGUIA_LOWERRIGHT); e->setTabHeight(geom.Y); auto style = getDefaultStyleForElement("tabheader", name); @@ -3400,7 +3400,7 @@ void GUIFormSpecMenu::getAndroidUIInput() return; auto element_type = element->getType(); - if (dialog_type == porting::TEXT_INPUT && element_type == irr::gui::EGUIET_EDIT_BOX) { + if (dialog_type == porting::TEXT_INPUT && element_type == gui::EGUIET_EDIT_BOX) { gui::IGUIEditBox *editbox = (gui::IGUIEditBox *)element; std::string text = porting::getInputDialogMessage(); editbox->setText(utf8_to_wide(text).c_str()); @@ -3419,7 +3419,7 @@ void GUIFormSpecMenu::getAndroidUIInput() editbox->getParent()->OnEvent(enter); } } else if (dialog_type == porting::SELECTION_INPUT && - element_type == irr::gui::EGUIET_COMBO_BOX) { + element_type == gui::EGUIET_COMBO_BOX) { auto dropdown = (gui::IGUIComboBox *) element; int selected = porting::getInputDialogSelection(); dropdown->setAndSendSelected(selected); @@ -3631,7 +3631,7 @@ void GUIFormSpecMenu::drawMenu() void GUIFormSpecMenu::showTooltip(const std::wstring &text, - const irr::video::SColor &color, const irr::video::SColor &bgcolor) + const video::SColor &color, const video::SColor &bgcolor) { EnrichedString ntext(text); ntext.setDefaultColor(color); @@ -4024,7 +4024,7 @@ bool GUIFormSpecMenu::preprocessEvent(const SEvent& event) } } - if (event.EventType == irr::EET_JOYSTICK_INPUT_EVENT) { + if (event.EventType == EET_JOYSTICK_INPUT_EVENT) { if (event.JoystickEvent.Joystick != m_joystick->getJoystickId()) return false; diff --git a/src/gui/guiFormSpecMenu.h b/src/gui/guiFormSpecMenu.h index 50b9a60b7..cb0126c2a 100644 --- a/src/gui/guiFormSpecMenu.h +++ b/src/gui/guiFormSpecMenu.h @@ -136,8 +136,8 @@ class GUIFormSpecMenu : public GUIModalMenu struct TooltipSpec { TooltipSpec() = default; - TooltipSpec(const std::wstring &a_tooltip, irr::video::SColor a_bgcolor, - irr::video::SColor a_color): + TooltipSpec(const std::wstring &a_tooltip, video::SColor a_bgcolor, + video::SColor a_color): tooltip(translate_string(a_tooltip)), bgcolor(a_bgcolor), color(a_color) @@ -145,8 +145,8 @@ class GUIFormSpecMenu : public GUIModalMenu } std::wstring tooltip; - irr::video::SColor bgcolor; - irr::video::SColor color; + video::SColor bgcolor; + video::SColor color; }; public: @@ -493,8 +493,8 @@ private: void tryClose(); void trySubmitClose(); - void showTooltip(const std::wstring &text, const irr::video::SColor &color, - const irr::video::SColor &bgcolor); + void showTooltip(const std::wstring &text, const video::SColor &color, + const video::SColor &bgcolor); /** * In formspec version < 2 the elements were not ordered properly. Some element diff --git a/src/gui/guiHyperText.cpp b/src/gui/guiHyperText.cpp index f3278a3ab..ef3006658 100644 --- a/src/gui/guiHyperText.cpp +++ b/src/gui/guiHyperText.cpp @@ -17,11 +17,11 @@ #include "mainmenumanager.h" #include "porting.h" -using namespace irr::gui; +using namespace gui; static bool check_color(const std::string &str) { - irr::video::SColor color; + video::SColor color; return parseColorString(str, color, false); } @@ -359,7 +359,7 @@ void ParsedText::globalTag(const AttrsList &attrs) else if (attr.second == "middle") valign = ParsedText::VALIGN_MIDDLE; } else if (attr.first == "background") { - irr::video::SColor color; + video::SColor color; if (attr.second == "none") { background_type = BACKGROUND_NONE; } else if (parseColorString(attr.second, color, false)) { @@ -630,7 +630,7 @@ TextDrawer::TextDrawer(const wchar_t *text, Client *client, if (e.font) { e.dim.Width = e.font->getDimension(e.text.c_str()).Width; e.dim.Height = e.font->getDimension(L"Yy").Height; - if (e.font->getType() == irr::gui::EGFT_CUSTOM) { + if (e.font->getType() == gui::EGFT_CUSTOM) { CGUITTFont *tmp = static_cast(e.font); e.baseline = e.dim.Height - 1 - tmp->getAscender() / 64; } @@ -932,7 +932,7 @@ void TextDrawer::place(const core::rect &dest_rect) void TextDrawer::draw(const core::rect &clip_rect, const core::position2d &dest_offset) { - irr::video::IVideoDriver *driver = m_guienv->getVideoDriver(); + video::IVideoDriver *driver = m_guienv->getVideoDriver(); core::position2d offset = dest_offset; offset.Y += m_voffset; @@ -948,7 +948,7 @@ void TextDrawer::draw(const core::rect &clip_rect, switch (el.type) { case ParsedText::ELEMENT_SEPARATOR: case ParsedText::ELEMENT_TEXT: { - irr::video::SColor color = el.color; + video::SColor color = el.color; for (auto tag : el.tags) if (&(*tag) == m_hovertag) @@ -981,7 +981,7 @@ void TextDrawer::draw(const core::rect &clip_rect, if (texture != 0) m_guienv->getVideoDriver()->draw2DImage( texture, rect, - irr::core::rect( + core::rect( core::position2d(0, 0), texture->getOriginalSize()), &clip_rect, 0, true); @@ -1021,7 +1021,7 @@ GUIHyperText::GUIHyperText(const wchar_t *text, IGUIEnvironment *environment, m_scrollbar_width = skin ? skin->getSize(gui::EGDS_SCROLLBAR_SIZE) : 16; - core::rect rect = irr::core::rect( + core::rect rect = core::rect( RelativeRect.getWidth() - m_scrollbar_width, 0, RelativeRect.getWidth(), RelativeRect.getHeight()); diff --git a/src/gui/guiHyperText.h b/src/gui/guiHyperText.h index abdd5de7b..e8194693c 100644 --- a/src/gui/guiHyperText.h +++ b/src/gui/guiHyperText.h @@ -12,7 +12,6 @@ #include #include "irr_v3d.h" -using namespace irr; class ISimpleTextureSource; class Client; @@ -86,8 +85,8 @@ public: gui::IGUIFont *font; - irr::video::SColor color; - irr::video::SColor hovercolor; + video::SColor color; + video::SColor hovercolor; bool underline; s32 baseline = 0; @@ -117,7 +116,7 @@ public: s32 margin = 3; ValignType valign = VALIGN_TOP; BackgroundType background_type = BACKGROUND_NONE; - irr::video::SColor background_color; + video::SColor background_color; Tag m_root_tag; diff --git a/src/gui/guiInventoryList.h b/src/gui/guiInventoryList.h index 517dfe4c6..1933940a4 100644 --- a/src/gui/guiInventoryList.h +++ b/src/gui/guiInventoryList.h @@ -9,7 +9,6 @@ #include #include "irr_v2d.h" -using namespace irr; class GUIFormSpecMenu; diff --git a/src/gui/guiItemImage.h b/src/gui/guiItemImage.h index 9bf81de9f..5cc069ab6 100644 --- a/src/gui/guiItemImage.h +++ b/src/gui/guiItemImage.h @@ -7,7 +7,6 @@ #include #include -using namespace irr; class Client; diff --git a/src/gui/guiPasswordChange.cpp b/src/gui/guiPasswordChange.cpp index a9b73dfe8..0439d3010 100644 --- a/src/gui/guiPasswordChange.cpp +++ b/src/gui/guiPasswordChange.cpp @@ -274,7 +274,7 @@ void GUIPasswordChange::getAndroidUIInput() e = getElementFromId(ID_newPassword2); m_jni_field_name.clear(); - if (!e || e->getType() != irr::gui::EGUIET_EDIT_BOX) + if (!e || e->getType() != gui::EGUIET_EDIT_BOX) return; std::string text = porting::getInputDialogMessage(); diff --git a/src/gui/guiPathSelectMenu.cpp b/src/gui/guiPathSelectMenu.cpp index 31eb9c740..c382743fc 100644 --- a/src/gui/guiPathSelectMenu.cpp +++ b/src/gui/guiPathSelectMenu.cpp @@ -74,7 +74,7 @@ void GUIFileSelectMenu::acceptInput() bool GUIFileSelectMenu::OnEvent(const SEvent &event) { - if (event.EventType == irr::EET_GUI_EVENT) { + if (event.EventType == EET_GUI_EVENT) { switch (event.GUIEvent.EventType) { case gui::EGET_ELEMENT_CLOSED: case gui::EGET_FILE_CHOOSE_DIALOG_CANCELLED: diff --git a/src/gui/guiScene.h b/src/gui/guiScene.h index 43902dad7..a96fbe36f 100644 --- a/src/gui/guiScene.h +++ b/src/gui/guiScene.h @@ -10,7 +10,6 @@ #include #include -using namespace irr; class GUIScene : public gui::IGUIElement { diff --git a/src/gui/guiScrollBar.h b/src/gui/guiScrollBar.h index 7f6621940..c318bc879 100644 --- a/src/gui/guiScrollBar.h +++ b/src/gui/guiScrollBar.h @@ -18,7 +18,7 @@ the arrow buttons where there is insufficient space. class ISimpleTextureSource; -using namespace irr; + using namespace gui; class GUIScrollBar : public IGUIElement diff --git a/src/gui/mainmenumanager.h b/src/gui/mainmenumanager.h index 553d6ffce..fbec0fc3f 100644 --- a/src/gui/mainmenumanager.h +++ b/src/gui/mainmenumanager.h @@ -13,7 +13,7 @@ #include "IGUIEnvironment.h" -namespace irr::gui { +namespace gui { class IGUIStaticText; } diff --git a/src/gui/modalMenu.cpp b/src/gui/modalMenu.cpp index d5c717d51..5575b4f97 100644 --- a/src/gui/modalMenu.cpp +++ b/src/gui/modalMenu.cpp @@ -251,7 +251,7 @@ bool GUIModalMenu::preprocessEvent(const SEvent &event) gui::IGUIElement *hovered = Environment->getRootGUIElement()->getElementFromPoint( core::position2d(event.MouseInput.X, event.MouseInput.Y)); - if ((hovered) && (hovered->getType() == irr::gui::EGUIET_EDIT_BOX)) { + if ((hovered) && (hovered->getType() == gui::EGUIET_EDIT_BOX)) { bool retval = hovered->OnEvent(event); if (retval) Environment->setFocus(hovered); diff --git a/src/gui/profilergraph.h b/src/gui/profilergraph.h index 04f114961..9ca5b3d86 100644 --- a/src/gui/profilergraph.h +++ b/src/gui/profilergraph.h @@ -10,7 +10,7 @@ #include #include "profiler.h" -namespace irr::video { +namespace video { class IVideoDriver; } diff --git a/src/gui/touchcontrols.h b/src/gui/touchcontrols.h index 52a3bd6b2..1cdfe655c 100644 --- a/src/gui/touchcontrols.h +++ b/src/gui/touchcontrols.h @@ -18,24 +18,22 @@ #include "util/basic_macros.h" #include "client/keycode.h" -namespace irr +class IrrlichtDevice; +namespace gui { - class IrrlichtDevice; - namespace gui - { - class IGUIEnvironment; - class IGUIImage; - class IGUIStaticText; - } - namespace video - { - class IVideoDriver; - } + class IGUIEnvironment; + class IGUIImage; + class IGUIStaticText; } +namespace video +{ + class IVideoDriver; +} + class ISimpleTextureSource; -using namespace irr::core; -using namespace irr::gui; +using namespace core; +using namespace gui; enum class TapState diff --git a/src/gui/touchscreeneditor.h b/src/gui/touchscreeneditor.h index cedc3b42a..6f8b21088 100644 --- a/src/gui/touchscreeneditor.h +++ b/src/gui/touchscreeneditor.h @@ -11,7 +11,7 @@ #include class ISimpleTextureSource; -namespace irr::gui +namespace gui { class IGUIButton; class IGUIImage; diff --git a/src/gui/touchscreenlayout.h b/src/gui/touchscreenlayout.h index 7a181d701..c74137832 100644 --- a/src/gui/touchscreenlayout.h +++ b/src/gui/touchscreenlayout.h @@ -12,11 +12,11 @@ #include class ISimpleTextureSource; -namespace irr::gui +namespace gui { class IGUIStaticText; } -namespace irr::video +namespace video { class ITexture; } diff --git a/src/irr_gui_ptr.h b/src/irr_gui_ptr.h index 8c16a5b1e..284c93220 100644 --- a/src/irr_gui_ptr.h +++ b/src/irr_gui_ptr.h @@ -20,7 +20,7 @@ template std::shared_ptr grab_gui_element(T *element) { - static_assert(std::is_base_of_v, + static_assert(std::is_base_of_v, "grab_gui_element only works for IGUIElement"); return std::shared_ptr(element, [](T *e) { e->remove(); diff --git a/src/irrlicht_changes/CGUITTFont.cpp b/src/irrlicht_changes/CGUITTFont.cpp index ab5aeb091..31d1dd376 100644 --- a/src/irrlicht_changes/CGUITTFont.cpp +++ b/src/irrlicht_changes/CGUITTFont.cpp @@ -43,8 +43,7 @@ #include #include -namespace irr -{ + namespace gui { @@ -955,4 +954,3 @@ std::u32string CGUITTFont::convertWCharToU32String(const wchar_t* const charArra } // end namespace gui -} // end namespace irr diff --git a/src/irrlicht_changes/CGUITTFont.h b/src/irrlicht_changes/CGUITTFont.h index 082942856..1073b9fdc 100644 --- a/src/irrlicht_changes/CGUITTFont.h +++ b/src/irrlicht_changes/CGUITTFont.h @@ -46,12 +46,10 @@ #include #include -namespace irr -{ namespace gui { // Manages the FT_Face cache. - struct SGUITTFace : public irr::IReferenceCounted + struct SGUITTFace : public IReferenceCounted { private: @@ -409,4 +407,3 @@ namespace gui }; } // end namespace gui -} // end namespace irr diff --git a/src/irrlicht_changes/printing.h b/src/irrlicht_changes/printing.h index 089193b57..2d302a56d 100644 --- a/src/irrlicht_changes/printing.h +++ b/src/irrlicht_changes/printing.h @@ -7,7 +7,7 @@ #include #include -namespace irr::core { +namespace core { template std::ostream &operator<< (std::ostream &os, vector2d vec) diff --git a/src/irrlicht_changes/static_text.cpp b/src/irrlicht_changes/static_text.cpp index e9be122b5..f1ee734d0 100644 --- a/src/irrlicht_changes/static_text.cpp +++ b/src/irrlicht_changes/static_text.cpp @@ -14,8 +14,6 @@ #include "CGUITTFont.h" #include "util/string.h" -namespace irr -{ namespace gui { @@ -97,7 +95,7 @@ void StaticText::draw() font->getDimension(str.c_str()).Width; } - if (font->getType() == irr::gui::EGFT_CUSTOM) { + if (font->getType() == gui::EGFT_CUSTOM) { CGUITTFont *tmp = static_cast(font); tmp->draw(str, r, HAlign == EGUIA_CENTER, VAlign == EGUIA_CENTER, @@ -319,7 +317,7 @@ void StaticText::updateText() elWidth -= 2*skin->getSize(EGDS_TEXT_DISTANCE_X); wchar_t c; - //std::vector colors; + //std::vector colors; // We have to deal with right-to-left and left-to-right differently // However, most parts of the following code is the same, it's just @@ -574,5 +572,3 @@ s32 StaticText::getTextWidth() const } // end namespace gui - -} // end namespace irr diff --git a/src/irrlicht_changes/static_text.h b/src/irrlicht_changes/static_text.h index 15a976c74..511356ebf 100644 --- a/src/irrlicht_changes/static_text.h +++ b/src/irrlicht_changes/static_text.h @@ -18,9 +18,6 @@ #include -namespace irr -{ - namespace gui { @@ -39,18 +36,18 @@ namespace gui //! destructor virtual ~StaticText(); - static irr::gui::IGUIStaticText *add( - irr::gui::IGUIEnvironment *guienv, + static gui::IGUIStaticText *add( + gui::IGUIEnvironment *guienv, const EnrichedString &text, const core::rect< s32 > &rectangle, bool border = false, bool wordWrap = true, - irr::gui::IGUIElement *parent = NULL, + gui::IGUIElement *parent = NULL, s32 id = -1, bool fillBackground = false) { parent = parent ? parent : guienv->getRootGUIElement(); - irr::gui::IGUIStaticText *result = new irr::gui::StaticText( + gui::IGUIStaticText *result = new gui::StaticText( text, border, guienv, parent, id, rectangle, fillBackground); @@ -59,13 +56,13 @@ namespace gui return result; } - static irr::gui::IGUIStaticText *add( - irr::gui::IGUIEnvironment *guienv, + static gui::IGUIStaticText *add( + gui::IGUIEnvironment *guienv, std::wstring_view text, const core::rect< s32 > &rectangle, bool border = false, bool wordWrap = true, - irr::gui::IGUIElement *parent = NULL, + gui::IGUIElement *parent = NULL, s32 id = -1, bool fillBackground = false) { @@ -190,21 +187,19 @@ namespace gui } // end namespace gui -} // end namespace irr - -inline void setStaticText(irr::gui::IGUIStaticText *static_text, const EnrichedString &text) +inline void setStaticText(gui::IGUIStaticText *static_text, const EnrichedString &text) { // dynamic_cast not possible due to some distributions shipped // without rtti support in irrlicht - if (static_text->hasType(irr::gui::EGUIET_ENRICHED_STATIC_TEXT)) { - irr::gui::StaticText* stext = static_cast(static_text); + if (static_text->hasType(gui::EGUIET_ENRICHED_STATIC_TEXT)) { + gui::StaticText* stext = static_cast(static_text); stext->setText(text); } else { static_text->setText(text.c_str()); } } -inline void setStaticText(irr::gui::IGUIStaticText *static_text, std::wstring_view text) +inline void setStaticText(gui::IGUIStaticText *static_text, std::wstring_view text) { setStaticText(static_text, EnrichedString(text, static_text->getOverrideColor())); } diff --git a/src/irrlichttypes.h b/src/irrlichttypes.h index 0474786a1..ffda0f5a2 100644 --- a/src/irrlichttypes.h +++ b/src/irrlichttypes.h @@ -7,7 +7,6 @@ #include #include -using namespace irr; #define S8_MIN INT8_MIN #define S16_MIN INT16_MIN diff --git a/src/lighting.h b/src/lighting.h index 4ba1b37ef..4d9cf9f4d 100644 --- a/src/lighting.h +++ b/src/lighting.h @@ -5,7 +5,6 @@ #pragma once #include "SColor.h" -using namespace irr; /** * Parameters for automatic exposure compensation diff --git a/src/skyparams.h b/src/skyparams.h index c5cd574cd..8c74e919c 100644 --- a/src/skyparams.h +++ b/src/skyparams.h @@ -9,7 +9,6 @@ #include "SColor.h" #include "irr_v2d.h" -using namespace irr; struct SkyColor { diff --git a/src/unittest/test_irr_gltf_mesh_loader.cpp b/src/unittest/test_irr_gltf_mesh_loader.cpp index 6cd6f0f1d..8a14dc32a 100644 --- a/src/unittest/test_irr_gltf_mesh_loader.cpp +++ b/src/unittest/test_irr_gltf_mesh_loader.cpp @@ -24,9 +24,9 @@ const auto gamespec = findSubgame("devtest"); if (!gamespec.isValid()) SKIP(); -irr::SIrrlichtCreationParameters p; +SIrrlichtCreationParameters p; p.DriverType = video::EDT_NULL; -auto *driver = irr::createDeviceEx(p); +auto *driver = createDeviceEx(p); REQUIRE(driver); auto *smgr = driver->getSceneManager(); @@ -74,7 +74,7 @@ SECTION("minimal triangle") { SECTION("vertex coordinates are correct") { REQUIRE(mesh->getMeshBuffer(0)->getVertexCount() == 3); - auto vertices = static_cast( + auto vertices = static_cast( mesh->getMeshBuffer(0)->getVertices()); CHECK(vertices[0].Pos == v3f {0.0f, 0.0f, 0.0f}); CHECK(vertices[1].Pos == v3f {1.0f, 0.0f, 0.0f}); @@ -83,7 +83,7 @@ SECTION("minimal triangle") { SECTION("vertex indices are correct") { REQUIRE(mesh->getMeshBuffer(0)->getIndexCount() == 3); - auto indices = static_cast( + auto indices = static_cast( mesh->getMeshBuffer(0)->getIndices()); CHECK(indices[0] == 2); CHECK(indices[1] == 1); @@ -93,7 +93,7 @@ SECTION("minimal triangle") { auto check_cube_vertices = [](auto *meshbuf) { REQUIRE(meshbuf->getVertexCount() == 24); - auto vertices = static_cast( + auto vertices = static_cast( meshbuf->getVertices()); CHECK(vertices[0].Pos == v3f{-1.0f, -1.0f, -1.0f}); CHECK(vertices[3].Pos == v3f{-1.0f, 1.0f, -1.0f}); @@ -112,7 +112,7 @@ SECTION("blender cube") { const auto mesh = loadMesh(path); REQUIRE(mesh); REQUIRE(mesh->getMeshBufferCount() == 1); - auto *meshbuf = dynamic_cast( + auto *meshbuf = dynamic_cast( mesh->getMeshBuffer(0)); REQUIRE(meshbuf); SECTION("vertex coordinates are correct") { @@ -124,7 +124,7 @@ SECTION("blender cube") { SECTION("vertex indices are correct") { REQUIRE(meshbuf->getIndexCount() == 36); - auto indices = static_cast( + auto indices = static_cast( meshbuf->getIndices()); CHECK(indices[0] == 16); CHECK(indices[1] == 5); @@ -134,7 +134,7 @@ SECTION("blender cube") { SECTION("vertex normals are correct") { REQUIRE(meshbuf->getVertexCount() == 24); - auto vertices = static_cast( + auto vertices = static_cast( meshbuf->getVertices()); CHECK(vertices[0].Normal == v3f{-1.0f, 0.0f, 0.0f}); CHECK(vertices[1].Normal == v3f{0.0f, -1.0f, 0.0f}); @@ -147,7 +147,7 @@ SECTION("blender cube") { SECTION("texture coords are correct") { REQUIRE(meshbuf->getVertexCount() == 24); - auto vertices = static_cast( + auto vertices = static_cast( meshbuf->getVertices()); CHECK(vertices[0].TCoords == v2f{0.375f, 1.0f}); CHECK(vertices[1].TCoords == v2f{0.125f, 0.25f}); @@ -161,7 +161,7 @@ SECTION("blender cube scaled") { const auto mesh = loadMesh(model_stem + "blender_cube_scaled.gltf"); REQUIRE(mesh); REQUIRE(mesh->getMeshBufferCount() == 1); - auto *meshbuf = dynamic_cast( + auto *meshbuf = dynamic_cast( mesh->getMeshBuffer(0)); REQUIRE(meshbuf); @@ -179,11 +179,11 @@ SECTION("blender cube matrix transform") { REQUIRE(mesh->getMeshBufferCount() == 1); SECTION("Transformation is correct") { - auto *meshbuf = dynamic_cast( + auto *meshbuf = dynamic_cast( mesh->getMeshBuffer(0)); REQUIRE(meshbuf); REQUIRE(meshbuf->getVertexCount() == 24); - auto vertices = static_cast( + auto vertices = static_cast( meshbuf->getVertices()); const auto checkVertex = [&](const std::size_t i, v3f vec) { // The transform scales by (1, 2, 3) and translates by (4, 5, 6). @@ -210,7 +210,7 @@ SECTION("snow man") { SECTION("vertex coordinates are correct for all buffers") { REQUIRE(mesh->getMeshBuffer(0)->getVertexCount() == 24); { - auto vertices = static_cast( + auto vertices = static_cast( mesh->getMeshBuffer(0)->getVertices()); CHECK(vertices[0].Pos == v3f{3.0f, 24.0f, -3.0f}); CHECK(vertices[3].Pos == v3f{3.0f, 18.0f, 3.0f}); @@ -223,7 +223,7 @@ SECTION("snow man") { } { REQUIRE(mesh->getMeshBuffer(1)->getVertexCount() == 24); - auto vertices = static_cast( + auto vertices = static_cast( mesh->getMeshBuffer(1)->getVertices()); CHECK(vertices[2].Pos == v3f{5.0f, 10.0f, 5.0f}); CHECK(vertices[3].Pos == v3f{5.0f, 0.0f, 5.0f}); @@ -236,7 +236,7 @@ SECTION("snow man") { } { REQUIRE(mesh->getMeshBuffer(2)->getVertexCount() == 24); - auto vertices = static_cast( + auto vertices = static_cast( mesh->getMeshBuffer(2)->getVertices()); CHECK(vertices[1].Pos == v3f{4.0f, 10.0f, -4.0f}); CHECK(vertices[2].Pos == v3f{4.0f, 18.0f, 4.0f}); @@ -252,7 +252,7 @@ SECTION("snow man") { SECTION("vertex indices are correct for all buffers") { { REQUIRE(mesh->getMeshBuffer(0)->getIndexCount() == 36); - auto indices = static_cast( + auto indices = static_cast( mesh->getMeshBuffer(0)->getIndices()); CHECK(indices[0] == 23); CHECK(indices[1] == 21); @@ -261,7 +261,7 @@ SECTION("snow man") { } { REQUIRE(mesh->getMeshBuffer(1)->getIndexCount() == 36); - auto indices = static_cast( + auto indices = static_cast( mesh->getMeshBuffer(1)->getIndices()); CHECK(indices[10] == 16); CHECK(indices[11] == 18); @@ -270,7 +270,7 @@ SECTION("snow man") { } { REQUIRE(mesh->getMeshBuffer(2)->getIndexCount() == 36); - auto indices = static_cast( + auto indices = static_cast( mesh->getMeshBuffer(2)->getIndices()); CHECK(indices[26] == 6); CHECK(indices[27] == 5); @@ -283,7 +283,7 @@ SECTION("snow man") { SECTION("vertex normals are correct for all buffers") { { REQUIRE(mesh->getMeshBuffer(0)->getVertexCount() == 24); - auto vertices = static_cast( + auto vertices = static_cast( mesh->getMeshBuffer(0)->getVertices()); CHECK(vertices[0].Normal == v3f{1.0f, 0.0f, -0.0f}); CHECK(vertices[1].Normal == v3f{1.0f, 0.0f, -0.0f}); @@ -294,7 +294,7 @@ SECTION("snow man") { } { REQUIRE(mesh->getMeshBuffer(1)->getVertexCount() == 24); - auto vertices = static_cast( + auto vertices = static_cast( mesh->getMeshBuffer(1)->getVertices()); CHECK(vertices[0].Normal == v3f{1.0f, 0.0f, -0.0f}); CHECK(vertices[1].Normal == v3f{1.0f, 0.0f, -0.0f}); @@ -305,7 +305,7 @@ SECTION("snow man") { } { REQUIRE(mesh->getMeshBuffer(2)->getVertexCount() == 24); - auto vertices = static_cast( + auto vertices = static_cast( mesh->getMeshBuffer(2)->getVertices()); CHECK(vertices[3].Normal == v3f{1.0f, 0.0f, -0.0f}); CHECK(vertices[4].Normal == v3f{-1.0f, 0.0f, -0.0f}); @@ -320,7 +320,7 @@ SECTION("snow man") { SECTION("texture coords are correct for all buffers") { { REQUIRE(mesh->getMeshBuffer(0)->getVertexCount() == 24); - auto vertices = static_cast( + auto vertices = static_cast( mesh->getMeshBuffer(0)->getVertices()); CHECK(vertices[0].TCoords == v2f{0.583333313f, 0.791666686f}); CHECK(vertices[1].TCoords == v2f{0.583333313f, 0.666666686f}); @@ -331,7 +331,7 @@ SECTION("snow man") { } { REQUIRE(mesh->getMeshBuffer(1)->getVertexCount() == 24); - auto vertices = static_cast( + auto vertices = static_cast( mesh->getMeshBuffer(1)->getVertices()); CHECK(vertices[1].TCoords == v2f{0.0f, 0.791666686f}); @@ -343,7 +343,7 @@ SECTION("snow man") { } { REQUIRE(mesh->getMeshBuffer(2)->getVertexCount() == 24); - auto vertices = static_cast( + auto vertices = static_cast( mesh->getMeshBuffer(2)->getVertices()); CHECK(vertices[10].TCoords == v2f{0.375f, 0.416666657f}); CHECK(vertices[11].TCoords == v2f{0.375f, 0.583333313f}); @@ -360,7 +360,7 @@ SECTION("simple sparse accessor") { const auto mesh = loadMesh(model_stem + "simple_sparse_accessor.gltf"); REQUIRE(mesh); - const auto *vertices = reinterpret_cast( + const auto *vertices = reinterpret_cast( mesh->getMeshBuffer(0)->getVertices()); const std::array expectedPositions = { // Lower @@ -387,7 +387,7 @@ SECTION("simple sparse accessor") // https://github.com/KhronosGroup/glTF-Sample-Models/tree/main/2.0/SimpleSkin SECTION("simple skin") { - using SkinnedMesh = irr::scene::SkinnedMesh; + using SkinnedMesh = scene::SkinnedMesh; const auto mesh = loadMesh(model_stem + "simple_skin.gltf"); REQUIRE(mesh != nullptr); auto csm = dynamic_cast(mesh); @@ -414,17 +414,17 @@ SECTION("simple skin") { const auto &transform = std::get(parent->transform); CHECK(transform.translation == v3f(0, 0, 0)); - CHECK(transform.rotation == irr::core::quaternion()); + CHECK(transform.rotation == core::quaternion()); CHECK(transform.scale == v3f(1, 1, 1)); - CHECK(parent->GlobalInversedMatrix == irr::core::matrix4()); + CHECK(parent->GlobalInversedMatrix == core::matrix4()); } { const auto &transform = std::get(child->transform); const v3f translation(0, 1, 0); CHECK(transform.translation == translation); - CHECK(transform.rotation == irr::core::quaternion()); + CHECK(transform.rotation == core::quaternion()); CHECK(transform.scale == v3f(1, 1, 1)); - irr::core::matrix4 inverseBindMatrix; + core::matrix4 inverseBindMatrix; inverseBindMatrix.setTranslation(-translation); CHECK(child->GlobalInversedMatrix == inverseBindMatrix); } @@ -433,7 +433,7 @@ SECTION("simple skin") SECTION("weights are correct") { const auto weights = [&](const SkinnedMesh::SJoint *joint) { - std::unordered_map weights; + std::unordered_map weights; for (std::size_t i = 0; i < joint->Weights.size(); ++i) { const auto weight = joint->Weights[i]; REQUIRE(weight.buffer_id == 0); @@ -444,7 +444,7 @@ SECTION("simple skin") const auto parentWeights = weights(parent); const auto childWeights = weights(child); - const auto checkWeights = [&](irr::u32 index, irr::f32 parentWeight, irr::f32 childWeight) { + const auto checkWeights = [&](u32 index, f32 parentWeight, f32 childWeight) { const auto getWeight = [](auto weights, auto index) { const auto it = weights.find(index); return it == weights.end() ? 0.0f : it->second; diff --git a/src/unittest/test_irr_x_mesh_loader.cpp b/src/unittest/test_irr_x_mesh_loader.cpp index cb61ce7da..c9aec2d9e 100644 --- a/src/unittest/test_irr_x_mesh_loader.cpp +++ b/src/unittest/test_irr_x_mesh_loader.cpp @@ -25,9 +25,9 @@ const auto gamespec = findSubgame("devtest"); if (!gamespec.isValid()) SKIP(); -irr::SIrrlichtCreationParameters p; +SIrrlichtCreationParameters p; p.DriverType = video::EDT_NULL; -auto *driver = irr::createDeviceEx(p); +auto *driver = createDeviceEx(p); REQUIRE(driver); @@ -42,7 +42,7 @@ const static auto model_stem = gamespec.gamemods_path + DIR_DELIM + "testentities" + DIR_DELIM + "models" + DIR_DELIM + "testentities_"; SECTION("cool guy") { - const auto *mesh = dynamic_cast(loadMesh(model_stem + "cool_guy.x")); + const auto *mesh = dynamic_cast(loadMesh(model_stem + "cool_guy.x")); REQUIRE(mesh); REQUIRE(mesh->getMeshBufferCount() == 1); diff --git a/src/unittest/test_keycode.cpp b/src/unittest/test_keycode.cpp index a805ec044..7cd5c5b96 100644 --- a/src/unittest/test_keycode.cpp +++ b/src/unittest/test_keycode.cpp @@ -71,28 +71,28 @@ void TestKeycode::testCreateFromString() void TestKeycode::testCreateFromSKeyInput() { KeyPress k; - irr::SEvent::SKeyInput in; + SEvent::SKeyInput in; // Character key - in.Key = irr::KEY_KEY_3; + in.Key = KEY_KEY_3; in.Char = L'3'; k = KeyPress(in); UASSERTEQ_STR(k.sym(), "KEY_KEY_3"); // Non-Character key - in.Key = irr::KEY_RSHIFT; + in.Key = KEY_RSHIFT; in.Char = L'\0'; k = KeyPress(in); UASSERTEQ_STR(k.sym(), "KEY_RSHIFT"); // Irrlicht-unknown key - in.Key = irr::KEY_KEY_CODES_COUNT; + in.Key = KEY_KEY_CODES_COUNT; in.Char = L'?'; k = KeyPress(in); UASSERTEQ_STR(k.sym(), "?"); // prefer_character mode - in.Key = irr::KEY_COMMA; + in.Key = KEY_COMMA; in.Char = L'G'; k = KeyPress(in, true); UASSERTEQ_STR(k.sym(), "KEY_KEY_G"); @@ -105,15 +105,15 @@ void TestKeycode::testCompare() UASSERT(!(KeyPress("5") == KeyPress("KEY_NUMPAD5"))); // Matching char suffices - // note: This is a real-world example, Irrlicht maps XK_equal to irr::KEY_PLUS on Linux - irr::SEvent::SKeyInput in; - in.Key = irr::KEY_PLUS; + // note: This is a real-world example, Irrlicht maps XK_equal to KEY_PLUS on Linux + SEvent::SKeyInput in; + in.Key = KEY_PLUS; in.Char = L'='; UASSERT(KeyPress("=") == KeyPress(in)); // Matching keycode suffices - irr::SEvent::SKeyInput in2; - in.Key = in2.Key = irr::KEY_OEM_CLEAR; + SEvent::SKeyInput in2; + in.Key = in2.Key = KEY_OEM_CLEAR; in.Char = L'\0'; in2.Char = L';'; UASSERT(KeyPress(in) == KeyPress(in2)); diff --git a/src/unittest/test_utilities.cpp b/src/unittest/test_utilities.cpp index 093dcf1ef..62ac6110c 100644 --- a/src/unittest/test_utilities.cpp +++ b/src/unittest/test_utilities.cpp @@ -370,7 +370,7 @@ void TestUtilities::testWrapRows() void TestUtilities::testEnrichedString() { EnrichedString str(L"Test bar"); - irr::video::SColor color(0xFF, 0, 0, 0xFF); + video::SColor color(0xFF, 0, 0, 0xFF); UASSERT(str.substr(1, 3).getString() == L"est"); str += L" BUZZ"; diff --git a/src/util/enriched_string.cpp b/src/util/enriched_string.cpp index 09baeac29..0eff3ffea 100644 --- a/src/util/enriched_string.cpp +++ b/src/util/enriched_string.cpp @@ -22,7 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "debug.h" #include "log.h" -using namespace irr::video; +using namespace video; EnrichedString::EnrichedString() { @@ -49,8 +49,8 @@ void EnrichedString::clear() m_colors.clear(); m_has_background = false; m_default_length = 0; - m_default_color = irr::video::SColor(255, 255, 255, 255); - m_background = irr::video::SColor(0, 0, 0, 0); + m_default_color = video::SColor(255, 255, 255, 255); + m_background = video::SColor(0, 0, 0, 0); } EnrichedString &EnrichedString::operator=(std::wstring_view str) diff --git a/src/util/enriched_string.h b/src/util/enriched_string.h index 18fd967bc..692023e83 100644 --- a/src/util/enriched_string.h +++ b/src/util/enriched_string.h @@ -24,7 +24,6 @@ with this program; if not, write to the Free Software Foundation, Inc., #include #include -using namespace irr; class EnrichedString { public: diff --git a/src/util/string.h b/src/util/string.h index de9c318a3..6674aae8a 100644 --- a/src/util/string.h +++ b/src/util/string.h @@ -763,23 +763,23 @@ inline std::string str_join(const std::vector &list, #if IS_CLIENT_BUILD /** - * Create a UTF8 std::string from an irr::core::stringw. + * Create a UTF8 std::string from an core::stringw. */ [[nodiscard]] -inline std::string stringw_to_utf8(const irr::core::stringw &input) +inline std::string stringw_to_utf8(const core::stringw &input) { std::wstring_view sv(input.c_str(), input.size()); return wide_to_utf8(sv); } /** - * Create an irr::core:stringw from a UTF8 std::string. + * Create an core:stringw from a UTF8 std::string. */ [[nodiscard]] -inline irr::core::stringw utf8_to_stringw(std::string_view input) +inline core::stringw utf8_to_stringw(std::string_view input) { std::wstring str = utf8_to_wide(input); - return irr::core::stringw(str.c_str(), str.size()); + return core::stringw(str.c_str(), str.size()); } #endif