Adjust includes

This commit is contained in:
Wojtek Figat
2021-06-17 14:15:19 +02:00
parent aa83af477a
commit 99012725dc
21 changed files with 57 additions and 55 deletions

View File

@@ -304,7 +304,7 @@ MClass* ScriptsBuilder::FindScript(const StringView& scriptName)
GetClassName(mclass->GetFullName(), mclassName); GetClassName(mclass->GetFullName(), mclassName);
if (className == mclassName) if (className == mclassName)
{ {
LOG(Info, "Found {0} type for type {1} (assembly {2})", mclass->ToString(), String(scriptName.Get(), scriptName.Length()), assembly->ToString()); LOG(Info, "Found {0} type for type {1} (assembly {2})", String(mclass->GetFullName()), String(scriptName.Get(), scriptName.Length()), assembly->ToString());
return mclass; return mclass;
} }
} }

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "TerrainTools.h" #include "TerrainTools.h"
#include "Engine/Core/Log.h"
#include "Engine/Core/Cache.h" #include "Engine/Core/Cache.h"
#include "Engine/Core/Math/Int2.h" #include "Engine/Core/Math/Int2.h"
#include "Engine/Core/Math/Color32.h" #include "Engine/Core/Math/Color32.h"

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "AudioSource.h" #include "AudioSource.h"
#include "Engine/Core/Log.h"
#include "Engine/Level/SceneObjectsFactory.h" #include "Engine/Level/SceneObjectsFactory.h"
#include "Engine/Serialization/Serialization.h" #include "Engine/Serialization/Serialization.h"
#include "Engine/Graphics/RenderTask.h" #include "Engine/Graphics/RenderTask.h"

View File

@@ -5,7 +5,6 @@
#include "Engine/Platform/Platform.h" #include "Engine/Platform/Platform.h"
#include "Engine/Platform/StringUtils.h" #include "Engine/Platform/StringUtils.h"
#include "Engine/Core/Formatting.h" #include "Engine/Core/Formatting.h"
#include "Engine/Core/Templates.h"
/// <summary> /// <summary>
/// Represents text as a sequence of characters. Container uses a single dynamic memory allocation to store the characters data. Characters sequence is always null-terminated. /// Represents text as a sequence of characters. Container uses a single dynamic memory allocation to store the characters data. Characters sequence is always null-terminated.

View File

@@ -19,21 +19,6 @@ protected:
public: public:
/// <summary>
/// Copies the data.
/// </summary>
/// <param name="other">The other object.</param>
/// <returns>The reference to this object.</returns>
FORCE_INLINE StringViewBase& operator=(const StringViewBase& other)
{
if (this != &other)
{
_data = other._data;
_length = other._length;
}
return *this;
}
/// <summary> /// <summary>
/// Gets the specific const character from this string. /// Gets the specific const character from this string.
/// </summary> /// </summary>
@@ -82,7 +67,7 @@ public:
/// <summary> /// <summary>
/// Gets the length of the string. /// Gets the length of the string.
/// </summary> /// </summary>
FORCE_INLINE int32 Length() const FORCE_INLINE constexpr int32 Length() const
{ {
return _length; return _length;
} }
@@ -90,7 +75,7 @@ public:
/// <summary> /// <summary>
/// Gets the pointer to the string. /// Gets the pointer to the string.
/// </summary> /// </summary>
FORCE_INLINE const T* operator*() const FORCE_INLINE constexpr const T* operator*() const
{ {
return _data; return _data;
} }
@@ -98,7 +83,7 @@ public:
/// <summary> /// <summary>
/// Gets the pointer to the string. /// Gets the pointer to the string.
/// </summary> /// </summary>
FORCE_INLINE const T* Get() const FORCE_INLINE constexpr const T* Get() const
{ {
return _data; return _data;
} }
@@ -202,7 +187,7 @@ public:
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="StringView"/> class. /// Initializes a new instance of the <see cref="StringView"/> class.
/// </summary> /// </summary>
StringView() constexpr StringView()
{ {
_data = nullptr; _data = nullptr;
_length = 0; _length = 0;
@@ -218,7 +203,7 @@ public:
/// Initializes a new instance of the <see cref="StringView"/> class. /// Initializes a new instance of the <see cref="StringView"/> class.
/// </summary> /// </summary>
/// <param name="str">The reference to the static string.</param> /// <param name="str">The reference to the static string.</param>
StringView(const StringView& str) constexpr StringView(const StringView& str)
{ {
_data = str._data; _data = str._data;
_length = str._length; _length = str._length;
@@ -239,7 +224,7 @@ public:
/// </summary> /// </summary>
/// <param name="str">The characters sequence.</param> /// <param name="str">The characters sequence.</param>
/// <param name="length">The characters sequence length (excluding null-terminator character).</param> /// <param name="length">The characters sequence length (excluding null-terminator character).</param>
StringView(const Char* str, int32 length) constexpr StringView(const Char* str, int32 length)
{ {
_data = str; _data = str;
_length = length; _length = length;
@@ -259,6 +244,21 @@ public:
return *this; return *this;
} }
/// <summary>
/// Assigns the static string.
/// </summary>
/// <param name="other">The other object.</param>
/// <returns>The reference to this object.</returns>
FORCE_INLINE constexpr StringView& operator=(const StringView& other)
{
if (this != &other)
{
_data = other._data;
_length = other._length;
}
return *this;
}
/// <summary> /// <summary>
/// Lexicographically test whether this string is equivalent to the other given string (case sensitive). /// Lexicographically test whether this string is equivalent to the other given string (case sensitive).
/// </summary> /// </summary>
@@ -394,7 +394,7 @@ public:
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="StringView"/> class. /// Initializes a new instance of the <see cref="StringView"/> class.
/// </summary> /// </summary>
StringAnsiView() constexpr StringAnsiView()
{ {
_data = nullptr; _data = nullptr;
_length = 0; _length = 0;
@@ -410,7 +410,7 @@ public:
/// Initializes a new instance of the <see cref="StringAnsiView"/> class. /// Initializes a new instance of the <see cref="StringAnsiView"/> class.
/// </summary> /// </summary>
/// <param name="str">The reference to the static string.</param> /// <param name="str">The reference to the static string.</param>
StringAnsiView(const StringAnsiView& str) constexpr StringAnsiView(const StringAnsiView& str)
{ {
_data = str._data; _data = str._data;
_length = str._length; _length = str._length;
@@ -431,7 +431,7 @@ public:
/// </summary> /// </summary>
/// <param name="str">The characters sequence.</param> /// <param name="str">The characters sequence.</param>
/// <param name="length">The characters sequence length (excluding null-terminator character).</param> /// <param name="length">The characters sequence length (excluding null-terminator character).</param>
StringAnsiView(const char* str, int32 length) constexpr StringAnsiView(const char* str, int32 length)
{ {
_data = str; _data = str;
_length = length; _length = length;
@@ -451,6 +451,21 @@ public:
return *this; return *this;
} }
/// <summary>
/// Assigns the static string.
/// </summary>
/// <param name="other">The other object.</param>
/// <returns>The reference to this object.</returns>
FORCE_INLINE constexpr StringAnsiView& operator=(const StringAnsiView& other)
{
if (this != &other)
{
_data = other._data;
_length = other._length;
}
return *this;
}
/// <summary> /// <summary>
/// Lexicographically test whether this string is equivalent to the other given string (case sensitive). /// Lexicographically test whether this string is equivalent to the other given string (case sensitive).
/// </summary> /// </summary>

View File

@@ -3,6 +3,7 @@
#include "Foliage.h" #include "Foliage.h"
#include "FoliageType.h" #include "FoliageType.h"
#include "FoliageCluster.h" #include "FoliageCluster.h"
#include "Engine/Core/Log.h"
#include "Engine/Core/Random.h" #include "Engine/Core/Random.h"
#include "Engine/Engine/Engine.h" #include "Engine/Engine/Engine.h"
#include "Engine/Graphics/RenderTask.h" #include "Engine/Graphics/RenderTask.h"

View File

@@ -2,16 +2,15 @@
#include "TextureBase.h" #include "TextureBase.h"
#include "TextureData.h" #include "TextureData.h"
#include "Engine/Core/Math/Color32.h"
#include "Engine/Graphics/GPUDevice.h" #include "Engine/Graphics/GPUDevice.h"
#include "Engine/Graphics/Textures/GPUTexture.h" #include "Engine/Graphics/Textures/GPUTexture.h"
#include "Engine/Graphics/RenderTools.h" #include "Engine/Graphics/RenderTools.h"
#include "Engine/Graphics/PixelFormatExtensions.h" #include "Engine/Graphics/PixelFormatExtensions.h"
#include "Engine/Debug/Exceptions/ArgumentOutOfRangeException.h" #include "Engine/Debug/Exceptions/ArgumentOutOfRangeException.h"
#include "Engine/Debug/Exceptions/InvalidOperationException.h" #include "Engine/Debug/Exceptions/InvalidOperationException.h"
#include "Engine/Core/Math/Color32.h"
#include "Engine/Profiler/ProfilerCPU.h" #include "Engine/Profiler/ProfilerCPU.h"
#include "Engine/Content/Factories/BinaryAssetFactory.h" #include "Engine/Content/Factories/BinaryAssetFactory.h"
#include <ThirdParty/mono-2.0/mono/metadata/appdomain.h>
REGISTER_BINARY_ASSET_ABSTRACT(TextureBase, "FlaxEngine.TextureBase"); REGISTER_BINARY_ASSET_ABSTRACT(TextureBase, "FlaxEngine.TextureBase");

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "SkyLight.h" #include "SkyLight.h"
#include "Engine/Core/Log.h"
#include "Engine/Platform/FileSystem.h" #include "Engine/Platform/FileSystem.h"
#include "Engine/Graphics/RenderView.h" #include "Engine/Graphics/RenderView.h"
#include "Engine/Graphics/RenderTask.h" #include "Engine/Graphics/RenderTask.h"

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "SceneCSGData.h" #include "SceneCSGData.h"
#include "Engine/Core/Log.h"
#include "Engine/CSG/CSGBuilder.h" #include "Engine/CSG/CSGBuilder.h"
#include "Engine/Serialization/Serialization.h" #include "Engine/Serialization/Serialization.h"
#include "Engine/Level/Scene/Scene.h" #include "Engine/Level/Scene/Scene.h"

View File

@@ -5,6 +5,7 @@
#include "Engine/Level/Scene/Scene.h" #include "Engine/Level/Scene/Scene.h"
#include "Engine/Serialization/Serialization.h" #include "Engine/Serialization/Serialization.h"
#if COMPILE_WITH_ASSETS_IMPORTER #if COMPILE_WITH_ASSETS_IMPORTER
#include "Engine/Core/Log.h"
#include "Engine/ContentImporters/AssetsImportingManager.h" #include "Engine/ContentImporters/AssetsImportingManager.h"
#include "Engine/Serialization/MemoryWriteStream.h" #include "Engine/Serialization/MemoryWriteStream.h"
#if USE_EDITOR #if USE_EDITOR

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "WheeledVehicle.h" #include "WheeledVehicle.h"
#include "Engine/Core/Log.h"
#include "Engine/Physics/Physics.h" #include "Engine/Physics/Physics.h"
#include "Engine/Physics/Utilities.h" #include "Engine/Physics/Utilities.h"
#include "Engine/Level/Scene/Scene.h" #include "Engine/Level/Scene/Scene.h"

View File

@@ -80,11 +80,6 @@ MClass::~MClass()
_events.ClearDelete(); _events.ClearDelete();
} }
String MClass::ToString() const
{
return String(_fullname);
}
MonoClass* MClass::GetNative() const MonoClass* MClass::GetNative() const
{ {
return _monoClass; return _monoClass;

View File

@@ -73,12 +73,6 @@ public:
return _fullname; return _fullname;
} }
/// <summary>
/// Gets the class full name as string.
/// </summary>
/// <returns>The class full name.</returns>
String ToString() const;
#if USE_MONO #if USE_MONO
/// <summary> /// <summary>

View File

@@ -639,9 +639,7 @@ MClass* Scripting::FindClass(MonoClass* monoClass)
{ {
if (monoClass == nullptr) if (monoClass == nullptr)
return nullptr; return nullptr;
PROFILE_CPU(); PROFILE_CPU();
auto& modules = BinaryModule::GetModules(); auto& modules = BinaryModule::GetModules();
for (auto module : modules) for (auto module : modules)
{ {
@@ -653,7 +651,6 @@ MClass* Scripting::FindClass(MonoClass* monoClass)
return result; return result;
} }
} }
return nullptr; return nullptr;
} }
@@ -661,9 +658,7 @@ MClass* Scripting::FindClass(const StringAnsiView& fullname)
{ {
if (fullname.IsEmpty()) if (fullname.IsEmpty())
return nullptr; return nullptr;
PROFILE_CPU(); PROFILE_CPU();
auto& modules = BinaryModule::GetModules(); auto& modules = BinaryModule::GetModules();
for (auto module : modules) for (auto module : modules)
{ {
@@ -675,7 +670,6 @@ MClass* Scripting::FindClass(const StringAnsiView& fullname)
return result; return result;
} }
} }
return nullptr; return nullptr;
} }
@@ -683,9 +677,7 @@ MonoClass* Scripting::FindClassNative(const StringAnsiView& fullname)
{ {
if (fullname.IsEmpty()) if (fullname.IsEmpty())
return nullptr; return nullptr;
PROFILE_CPU(); PROFILE_CPU();
auto& modules = BinaryModule::GetModules(); auto& modules = BinaryModule::GetModules();
for (auto module : modules) for (auto module : modules)
{ {
@@ -697,7 +689,6 @@ MonoClass* Scripting::FindClassNative(const StringAnsiView& fullname)
return result->GetNative(); return result->GetNative();
} }
} }
return nullptr; return nullptr;
} }
@@ -705,9 +696,7 @@ ScriptingTypeHandle Scripting::FindScriptingType(const StringAnsiView& fullname)
{ {
if (fullname.IsEmpty()) if (fullname.IsEmpty())
return ScriptingTypeHandle(); return ScriptingTypeHandle();
PROFILE_CPU(); PROFILE_CPU();
auto& modules = BinaryModule::GetModules(); auto& modules = BinaryModule::GetModules();
for (auto module : modules) for (auto module : modules)
{ {
@@ -717,7 +706,6 @@ ScriptingTypeHandle Scripting::FindScriptingType(const StringAnsiView& fullname)
return ScriptingTypeHandle(module, typeIndex); return ScriptingTypeHandle(module, typeIndex);
} }
} }
return ScriptingTypeHandle(); return ScriptingTypeHandle();
} }

View File

@@ -91,21 +91,21 @@ public:
/// <summary> /// <summary>
/// Finds the class with given fully qualified name within whole assembly. /// Finds the class with given fully qualified name within whole assembly.
/// </summary> /// </summary>
/// <param name="fullname">The full name of the type eg: System.Int64.MaxInt.</param> /// <param name="fullname">The full name of the type eg: System.Int64.</param>
/// <returns>The MClass object or null if missing.</returns> /// <returns>The MClass object or null if missing.</returns>
static MClass* FindClass(const StringAnsiView& fullname); static MClass* FindClass(const StringAnsiView& fullname);
/// <summary> /// <summary>
/// Finds the native class with given fully qualified name within whole assembly. /// Finds the native class with given fully qualified name within whole assembly.
/// </summary> /// </summary>
/// <param name="fullname">The full name of the type eg: System.Int64.MaxInt.</param> /// <param name="fullname">The full name of the type eg: System.Int64.</param>
/// <returns>The MClass object or null if missing.</returns> /// <returns>The MClass object or null if missing.</returns>
static MonoClass* FindClassNative(const StringAnsiView& fullname); static MonoClass* FindClassNative(const StringAnsiView& fullname);
/// <summary> /// <summary>
/// Finds the scripting type of the given fullname by searching loaded scripting assemblies. /// Finds the scripting type of the given fullname by searching loaded scripting assemblies.
/// </summary> /// </summary>
/// <param name="fullname">The full name of the type eg: System.Int64.MaxInt.</param> /// <param name="fullname">The full name of the type eg: System.Int64.</param>
/// <returns>The scripting type or invalid type if missing.</returns> /// <returns>The scripting type or invalid type if missing.</returns>
static ScriptingTypeHandle FindScriptingType(const StringAnsiView& fullname); static ScriptingTypeHandle FindScriptingType(const StringAnsiView& fullname);

View File

@@ -259,7 +259,7 @@ void ScriptingObject::OnDeleteObject()
String ScriptingObject::ToString() const String ScriptingObject::ToString() const
{ {
return _type ? _type.GetType().ManagedClass->ToString() : String::Empty; return _type ? String(_type.GetType().ManagedClass->GetFullName()) : String::Empty;
} }
ManagedScriptingObject::ManagedScriptingObject(const SpawnParams& params) ManagedScriptingObject::ManagedScriptingObject(const SpawnParams& params)

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Builder.h" #include "Builder.h"
#include "Engine/Core/Log.h"
#include "Engine/Core/Types/TimeSpan.h" #include "Engine/Core/Types/TimeSpan.h"
#include "Engine/Core/Math/Math.h" #include "Engine/Core/Math/Math.h"
#include "Engine/Level/Actors/BoxBrush.h" #include "Engine/Level/Actors/BoxBrush.h"

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Builder.h" #include "Builder.h"
#include "Engine/Core/Log.h"
#include "Engine/Core/Math/Math.h" #include "Engine/Core/Math/Math.h"
#include "Engine/Level/Actors/BoxBrush.h" #include "Engine/Level/Actors/BoxBrush.h"
#include "Engine/Level/Actors/StaticModel.h" #include "Engine/Level/Actors/StaticModel.h"

View File

@@ -1,6 +1,7 @@
// Copyright (c) 2012-2021 Wojciech Figat. All rights reserved. // Copyright (c) 2012-2021 Wojciech Figat. All rights reserved.
#include "Builder.h" #include "Builder.h"
#include "Engine/Core/Log.h"
#include "Engine/Core/Math/Math.h" #include "Engine/Core/Math/Math.h"
#include "Engine/Level/SceneQuery.h" #include "Engine/Level/SceneQuery.h"
#include "Engine/Level/Actors/BoxBrush.h" #include "Engine/Level/Actors/BoxBrush.h"

View File

@@ -10,6 +10,7 @@
#if COMPILE_WITH_GI_BAKING #if COMPILE_WITH_GI_BAKING
#include "Engine/Graphics/RenderTask.h" #include "Engine/Graphics/RenderTask.h"
#include "Engine/Core/Singleton.h"
// Forward declarations // Forward declarations
#if COMPILE_WITH_ASSETS_IMPORTER #if COMPILE_WITH_ASSETS_IMPORTER

View File

@@ -2,6 +2,7 @@
#include "Terrain.h" #include "Terrain.h"
#include "TerrainPatch.h" #include "TerrainPatch.h"
#include "Engine/Core/Log.h"
#include "Engine/Core/Math/Ray.h" #include "Engine/Core/Math/Ray.h"
#include "Engine/Level/Scene/SceneRendering.h" #include "Engine/Level/Scene/SceneRendering.h"
#include "Engine/Serialization/Serialization.h" #include "Engine/Serialization/Serialization.h"