Add end-of-line spaces checker
This commit is contained in:
parent
63c61c0827
commit
6757de1be8
|
|
@ -125,7 +125,7 @@ namespace Nz
|
||||||
class ChipmunkMotorConstraint2D;
|
class ChipmunkMotorConstraint2D;
|
||||||
|
|
||||||
using ChipmunkMotorConstraint2DHandle = ObjectHandle<ChipmunkMotorConstraint2D>;
|
using ChipmunkMotorConstraint2DHandle = ObjectHandle<ChipmunkMotorConstraint2D>;
|
||||||
|
|
||||||
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkMotorConstraint2D : public ChipmunkConstraint2D
|
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkMotorConstraint2D : public ChipmunkConstraint2D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -159,7 +159,7 @@ namespace Nz
|
||||||
class ChipmunkPivotConstraint2D;
|
class ChipmunkPivotConstraint2D;
|
||||||
|
|
||||||
using ChipmunkPivotConstraint2DHandle = ObjectHandle<ChipmunkPivotConstraint2D>;
|
using ChipmunkPivotConstraint2DHandle = ObjectHandle<ChipmunkPivotConstraint2D>;
|
||||||
|
|
||||||
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkPivotConstraint2D : public ChipmunkConstraint2D
|
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkPivotConstraint2D : public ChipmunkConstraint2D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -178,7 +178,7 @@ namespace Nz
|
||||||
class ChipmunkRatchetConstraint2D;
|
class ChipmunkRatchetConstraint2D;
|
||||||
|
|
||||||
using ChipmunkRatchetConstraint2DHandle = ObjectHandle<ChipmunkRatchetConstraint2D>;
|
using ChipmunkRatchetConstraint2DHandle = ObjectHandle<ChipmunkRatchetConstraint2D>;
|
||||||
|
|
||||||
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkRatchetConstraint2D : public ChipmunkConstraint2D
|
class NAZARA_CHIPMUNKPHYSICS2D_API ChipmunkRatchetConstraint2D : public ChipmunkConstraint2D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ namespace Nz
|
||||||
|
|
||||||
return static_cast<T&>(*m_components[componentIndex]);
|
return static_cast<T&>(*m_components[componentIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
const T& ApplicationBase::GetComponent() const
|
const T& ApplicationBase::GetComponent() const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace Nz
|
||||||
ApplicationUpdater& operator=(const ApplicationUpdater&) = delete;
|
ApplicationUpdater& operator=(const ApplicationUpdater&) = delete;
|
||||||
ApplicationUpdater& operator=(ApplicationUpdater&&) = delete;
|
ApplicationUpdater& operator=(ApplicationUpdater&&) = delete;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename F>
|
template<typename F>
|
||||||
class ApplicationUpdaterFunctor : public ApplicationUpdater
|
class ApplicationUpdaterFunctor : public ApplicationUpdater
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -312,7 +312,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
return Color(r / 255.f, g / 255.f, b / 255.f);
|
return Color(r / 255.f, g / 255.f, b / 255.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Converts RGBA8 representation to Color (RGBA32F)
|
* \brief Converts RGBA8 representation to Color (RGBA32F)
|
||||||
* \return Color resulting
|
* \return Color resulting
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ namespace Nz
|
||||||
inline /*constexpr*/ Result<OpenModeFlags, std::string> File::DecodeOpenMode(std::string_view openModeStr)
|
inline /*constexpr*/ Result<OpenModeFlags, std::string> File::DecodeOpenMode(std::string_view openModeStr)
|
||||||
{
|
{
|
||||||
OpenModeFlags openModes = 0;
|
OpenModeFlags openModes = 0;
|
||||||
|
|
||||||
if (openModeStr.find('r') != std::string_view::npos)
|
if (openModeStr.find('r') != std::string_view::npos)
|
||||||
{
|
{
|
||||||
openModes |= OpenMode::Read;
|
openModes |= OpenMode::Read;
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ namespace Nz
|
||||||
return OverrideModuleConfig(T{}, parameters);
|
return OverrideModuleConfig(T{}, parameters);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Module, typename... Modules>
|
template<typename Module, typename... Modules>
|
||||||
template<typename... ModuleConfig>
|
template<typename... ModuleConfig>
|
||||||
ModuleTuple<Module, Modules...>::ModuleTuple(const CommandLineParameters& parameters, ModuleConfig&&... configs) :
|
ModuleTuple<Module, Modules...>::ModuleTuple(const CommandLineParameters& parameters, ModuleConfig&&... configs) :
|
||||||
|
|
@ -97,7 +97,7 @@ namespace Nz
|
||||||
m_modules(CommandLineParameters{}, std::forward<ModuleConfig>(configs)...)
|
m_modules(CommandLineParameters{}, std::forward<ModuleConfig>(configs)...)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename... ModuleList>
|
template<typename... ModuleList>
|
||||||
template<typename... ModuleConfig>
|
template<typename... ModuleConfig>
|
||||||
Modules<ModuleList...>::Modules(const CommandLineParameters& parameters, ModuleConfig&&... configs) :
|
Modules<ModuleList...>::Modules(const CommandLineParameters& parameters, ModuleConfig&&... configs) :
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
HandleInner<EndOfStream>(std::forward<Args>(args)...);
|
HandleInner<EndOfStream>(std::forward<Args>(args)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename EndToken, typename... Args>
|
template<typename EndToken, typename... Args>
|
||||||
void ParameterFile::HandleInner(Args&&... args)
|
void ParameterFile::HandleInner(Args&&... args)
|
||||||
{
|
{
|
||||||
|
|
@ -113,7 +113,7 @@ namespace Nz
|
||||||
keyValue.handler = BuildBlockHandler(keyValues, std::forward<Rest>(rest)...);
|
keyValue.handler = BuildBlockHandler(keyValues, std::forward<Rest>(rest)...);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename V, typename... Rest>
|
template<typename V, typename... Rest>
|
||||||
auto ParameterFile::GetSingleHandler(V&& value, Rest&&... rest) -> ValueHandler
|
auto ParameterFile::GetSingleHandler(V&& value, Rest&&... rest) -> ValueHandler
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ namespace Nz
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \ingroup math
|
* \ingroup math
|
||||||
* \brief Converts the string to number
|
* \brief Converts the string to number
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ namespace Nz
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename F>
|
template<typename F>
|
||||||
bool VirtualDirectory::GetDirectoryEntry(std::string_view path, F&& callback)
|
bool VirtualDirectory::GetDirectoryEntry(std::string_view path, F&& callback)
|
||||||
{
|
{
|
||||||
|
|
@ -260,7 +260,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
return m_isUprootAllowed;
|
return m_isUprootAllowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline auto VirtualDirectory::StoreDirectory(std::string_view path, std::shared_ptr<VirtualDirectoryResolver> resolver) -> DirectoryEntry&
|
inline auto VirtualDirectory::StoreDirectory(std::string_view path, std::shared_ptr<VirtualDirectoryResolver> resolver) -> DirectoryEntry&
|
||||||
{
|
{
|
||||||
assert(!path.empty());
|
assert(!path.empty());
|
||||||
|
|
@ -318,7 +318,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
return StoreFile(path, std::make_shared<MemoryView>(data, size));
|
return StoreFile(path, std::make_shared<MemoryView>(data, size));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename F> bool VirtualDirectory::GetEntryInternal(std::string_view name, bool allowResolve, F&& callback)
|
template<typename F> bool VirtualDirectory::GetEntryInternal(std::string_view name, bool allowResolve, F&& callback)
|
||||||
{
|
{
|
||||||
if (name == ".")
|
if (name == ".")
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
m_worldInstance = std::make_shared<WorldInstance>(); //< FIXME: Use pools
|
m_worldInstance = std::make_shared<WorldInstance>(); //< FIXME: Use pools
|
||||||
}
|
}
|
||||||
|
|
||||||
inline GraphicsComponent::GraphicsComponent(std::shared_ptr<InstancedRenderable> renderable, UInt32 renderMask, bool initiallyVisible) :
|
inline GraphicsComponent::GraphicsComponent(std::shared_ptr<InstancedRenderable> renderable, UInt32 renderMask, bool initiallyVisible) :
|
||||||
GraphicsComponent(initiallyVisible)
|
GraphicsComponent(initiallyVisible)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ namespace Nz
|
||||||
class Light;
|
class Light;
|
||||||
class PointLight;
|
class PointLight;
|
||||||
class SpotLight;
|
class SpotLight;
|
||||||
|
|
||||||
class NAZARA_GRAPHICS_API ForwardPipelinePass : public FramePipelinePass, TransferInterface
|
class NAZARA_GRAPHICS_API ForwardPipelinePass : public FramePipelinePass, TransferInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace Nz
|
||||||
|
|
||||||
return inputIndex;
|
return inputIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::size_t FramePass::AddOutput(std::size_t attachmentId)
|
inline std::size_t FramePass::AddOutput(std::size_t attachmentId)
|
||||||
{
|
{
|
||||||
assert(attachmentId != InvalidAttachmentId);
|
assert(attachmentId != InvalidAttachmentId);
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ namespace Nz
|
||||||
template<> struct TypeToMaterialPropertyType<Vector2<Int32>> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::Int2; };
|
template<> struct TypeToMaterialPropertyType<Vector2<Int32>> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::Int2; };
|
||||||
template<> struct TypeToMaterialPropertyType<Vector3<Int32>> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::Int3; };
|
template<> struct TypeToMaterialPropertyType<Vector3<Int32>> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::Int3; };
|
||||||
template<> struct TypeToMaterialPropertyType<Vector4<Int32>> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::Int4; };
|
template<> struct TypeToMaterialPropertyType<Vector4<Int32>> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::Int4; };
|
||||||
|
|
||||||
template<> struct TypeToMaterialPropertyType<UInt32> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::UInt; };
|
template<> struct TypeToMaterialPropertyType<UInt32> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::UInt; };
|
||||||
template<> struct TypeToMaterialPropertyType<Vector2<UInt32>> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::UInt2; };
|
template<> struct TypeToMaterialPropertyType<Vector2<UInt32>> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::UInt2; };
|
||||||
template<> struct TypeToMaterialPropertyType<Vector3<UInt32>> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::UInt3; };
|
template<> struct TypeToMaterialPropertyType<Vector3<UInt32>> { static constexpr MaterialPropertyType PropertyType = MaterialPropertyType::UInt3; };
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
return m_submeshes.size();
|
return m_submeshes.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Model::SetMaterial(std::size_t subMeshIndex, std::shared_ptr<MaterialInstance> material)
|
inline void Model::SetMaterial(std::size_t subMeshIndex, std::shared_ptr<MaterialInstance> material)
|
||||||
{
|
{
|
||||||
assert(subMeshIndex < m_submeshes.size());
|
assert(subMeshIndex < m_submeshes.size());
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace Nz
|
||||||
|
|
||||||
return lightData;
|
return lightData;
|
||||||
}
|
}
|
||||||
|
|
||||||
// PredefinedPointLightData
|
// PredefinedPointLightData
|
||||||
constexpr PredefinedPointLightData PredefinedPointLightData::Build()
|
constexpr PredefinedPointLightData PredefinedPointLightData::Build()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ namespace Nz
|
||||||
|
|
||||||
OptionValuePropertyHandler& operator=(const OptionValuePropertyHandler&) = delete;
|
OptionValuePropertyHandler& operator=(const OptionValuePropertyHandler&) = delete;
|
||||||
OptionValuePropertyHandler& operator=(OptionValuePropertyHandler&&) = delete;
|
OptionValuePropertyHandler& operator=(OptionValuePropertyHandler&&) = delete;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::size_t m_propertyIndex;
|
std::size_t m_propertyIndex;
|
||||||
std::string m_propertyName;
|
std::string m_propertyName;
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace Nz
|
||||||
|
|
||||||
UniformValuePropertyHandler& operator=(const UniformValuePropertyHandler&) = delete;
|
UniformValuePropertyHandler& operator=(const UniformValuePropertyHandler&) = delete;
|
||||||
UniformValuePropertyHandler& operator=(UniformValuePropertyHandler&&) = delete;
|
UniformValuePropertyHandler& operator=(UniformValuePropertyHandler&&) = delete;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::size_t m_propertyIndex;
|
std::size_t m_propertyIndex;
|
||||||
std::size_t m_offset;
|
std::size_t m_offset;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ namespace Nz
|
||||||
RenderTextureBlit(textureSize, std::move(targetTexture), filter, PipelineStage::FragmentShader, MemoryAccess::ShaderRead, TextureLayout::ColorInput)
|
RenderTextureBlit(textureSize, std::move(targetTexture), filter, PipelineStage::FragmentShader, MemoryAccess::ShaderRead, TextureLayout::ColorInput)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderTextureBlit::RenderTextureBlit(const Vector2ui& textureSize, std::shared_ptr<Texture> texture, SamplerFilter filter, PipelineStage targetPipelineStage, MemoryAccessFlags targetMemoryFlags, TextureLayout targetLayout) :
|
RenderTextureBlit::RenderTextureBlit(const Vector2ui& textureSize, std::shared_ptr<Texture> texture, SamplerFilter filter, PipelineStage targetPipelineStage, MemoryAccessFlags targetMemoryFlags, TextureLayout targetLayout) :
|
||||||
m_targetTexture(std::move(texture)),
|
m_targetTexture(std::move(texture)),
|
||||||
m_targetMemoryFlags(targetMemoryFlags),
|
m_targetMemoryFlags(targetMemoryFlags),
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace Nz
|
||||||
class Texture;
|
class Texture;
|
||||||
class VertexDeclaration;
|
class VertexDeclaration;
|
||||||
class WorldInstance;
|
class WorldInstance;
|
||||||
|
|
||||||
struct SpriteChainRendererData : public ElementRendererData
|
struct SpriteChainRendererData : public ElementRendererData
|
||||||
{
|
{
|
||||||
struct DrawCall
|
struct DrawCall
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ namespace Nz
|
||||||
private:
|
private:
|
||||||
std::vector<ChildCollider> m_childs;
|
std::vector<ChildCollider> m_childs;
|
||||||
};
|
};
|
||||||
|
|
||||||
class NAZARA_JOLTPHYSICS3D_API JoltConvexHullCollider3D final : public JoltCollider3D
|
class NAZARA_JOLTPHYSICS3D_API JoltConvexHullCollider3D final : public JoltCollider3D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -122,7 +122,7 @@ namespace Nz
|
||||||
|
|
||||||
JoltColliderType3D GetType() const override;
|
JoltColliderType3D GetType() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
class NAZARA_JOLTPHYSICS3D_API JoltMeshCollider3D final : public JoltCollider3D
|
class NAZARA_JOLTPHYSICS3D_API JoltMeshCollider3D final : public JoltCollider3D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -148,7 +148,7 @@ namespace Nz
|
||||||
};
|
};
|
||||||
|
|
||||||
/*********************************** Decorated ******************************************/
|
/*********************************** Decorated ******************************************/
|
||||||
|
|
||||||
class NAZARA_JOLTPHYSICS3D_API JoltTranslatedRotatedCollider3D final : public JoltCollider3D
|
class NAZARA_JOLTPHYSICS3D_API JoltTranslatedRotatedCollider3D final : public JoltCollider3D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -164,7 +164,7 @@ namespace Nz
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<JoltCollider3D> m_collider;
|
std::shared_ptr<JoltCollider3D> m_collider;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <Nazara/JoltPhysics3D/JoltCollider3D.inl>
|
#include <Nazara/JoltPhysics3D/JoltCollider3D.inl>
|
||||||
|
|
|
||||||
|
|
@ -612,7 +612,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
return value <= other.value;
|
return value <= other.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<AngleUnit Unit, typename T>
|
template<AngleUnit Unit, typename T>
|
||||||
constexpr bool Angle<Unit, T>::operator>(Angle other) const
|
constexpr bool Angle<Unit, T>::operator>(Angle other) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -539,7 +539,7 @@ namespace Nz
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Multiplies the lengths of this box with the scalar (the box center doesn't move)
|
* \brief Multiplies the lengths of this box with the scalar (the box center doesn't move)
|
||||||
* \return A reference to this box where lengths are the product of these lengths and the scalar
|
* \return A reference to this box where lengths are the product of these lengths and the scalar
|
||||||
|
|
|
||||||
|
|
@ -237,17 +237,17 @@ namespace Nz
|
||||||
m11*matrix.m12 + m12*matrix.m22 + m13*matrix.m32,
|
m11*matrix.m12 + m12*matrix.m22 + m13*matrix.m32,
|
||||||
m11*matrix.m13 + m12*matrix.m23 + m13*matrix.m33,
|
m11*matrix.m13 + m12*matrix.m23 + m13*matrix.m33,
|
||||||
T(0.0),
|
T(0.0),
|
||||||
|
|
||||||
m21*matrix.m11 + m22*matrix.m21 + m23*matrix.m31,
|
m21*matrix.m11 + m22*matrix.m21 + m23*matrix.m31,
|
||||||
m21*matrix.m12 + m22*matrix.m22 + m23*matrix.m32,
|
m21*matrix.m12 + m22*matrix.m22 + m23*matrix.m32,
|
||||||
m21*matrix.m13 + m22*matrix.m23 + m23*matrix.m33,
|
m21*matrix.m13 + m22*matrix.m23 + m23*matrix.m33,
|
||||||
T(0.0),
|
T(0.0),
|
||||||
|
|
||||||
m31*matrix.m11 + m32*matrix.m21 + m33*matrix.m31,
|
m31*matrix.m11 + m32*matrix.m21 + m33*matrix.m31,
|
||||||
m31*matrix.m12 + m32*matrix.m22 + m33*matrix.m32,
|
m31*matrix.m12 + m32*matrix.m22 + m33*matrix.m32,
|
||||||
m31*matrix.m13 + m32*matrix.m23 + m33*matrix.m33,
|
m31*matrix.m13 + m32*matrix.m23 + m33*matrix.m33,
|
||||||
T(0.0),
|
T(0.0),
|
||||||
|
|
||||||
m41*matrix.m11 + m42*matrix.m21 + m43*matrix.m31 + matrix.m41,
|
m41*matrix.m11 + m42*matrix.m21 + m43*matrix.m31 + matrix.m41,
|
||||||
m41*matrix.m12 + m42*matrix.m22 + m43*matrix.m32 + matrix.m42,
|
m41*matrix.m12 + m42*matrix.m22 + m43*matrix.m32 + matrix.m42,
|
||||||
m41*matrix.m13 + m42*matrix.m23 + m43*matrix.m33 + matrix.m43,
|
m41*matrix.m13 + m42*matrix.m23 + m43*matrix.m33 + matrix.m43,
|
||||||
|
|
@ -502,7 +502,7 @@ namespace Nz
|
||||||
if (det == T(0.0))
|
if (det == T(0.0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
// http://stackoverflow.com/questions/1148309/inverting-a-4x4-matrix
|
// http://stackoverflow.com/questions/1148309/inverting-a-4x4-matrix
|
||||||
T inv[16];
|
T inv[16];
|
||||||
inv[0] = m22 * m33 -
|
inv[0] = m22 * m33 -
|
||||||
|
|
|
||||||
|
|
@ -527,7 +527,7 @@ namespace Nz
|
||||||
if (z != quat.z)
|
if (z != quat.z)
|
||||||
return z < quat.z;
|
return z < quat.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr bool Quaternion<T>::operator<=(const Quaternion& quat) const
|
constexpr bool Quaternion<T>::operator<=(const Quaternion& quat) const
|
||||||
{
|
{
|
||||||
|
|
@ -543,7 +543,7 @@ namespace Nz
|
||||||
if (z != quat.z)
|
if (z != quat.z)
|
||||||
return z <= quat.z;
|
return z <= quat.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr bool Quaternion<T>::operator>(const Quaternion& quat) const
|
constexpr bool Quaternion<T>::operator>(const Quaternion& quat) const
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -513,7 +513,7 @@ namespace Nz
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
constexpr Vector4<T>& Vector4<T>::operator%=(const Vector4& vec)
|
constexpr Vector4<T>& Vector4<T>::operator%=(const Vector4& vec)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,7 @@ namespace Nz
|
||||||
m_buffer = std::move(packet.m_buffer);
|
m_buffer = std::move(packet.m_buffer);
|
||||||
m_memoryStream = std::move(packet.m_memoryStream);
|
m_memoryStream = std::move(packet.m_memoryStream);
|
||||||
m_netCode = packet.m_netCode;
|
m_netCode = packet.m_netCode;
|
||||||
|
|
||||||
///< Redirect memory stream to the moved buffer
|
///< Redirect memory stream to the moved buffer
|
||||||
if (m_buffer)
|
if (m_buffer)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
m_headers.insert_or_assign(std::move(header), std::move(value));
|
m_headers.insert_or_assign(std::move(header), std::move(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool WebRequest::OnBodyResponse(const char* data, std::size_t length)
|
inline bool WebRequest::OnBodyResponse(const char* data, std::size_t length)
|
||||||
{
|
{
|
||||||
if (!m_dataCallback)
|
if (!m_dataCallback)
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ namespace Nz
|
||||||
NazaraErrorFmt("unhandled BlendFunc {0:#x})", UnderlyingCast(blendFunc));
|
NazaraErrorFmt("unhandled BlendFunc {0:#x})", UnderlyingCast(blendFunc));
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
inline GLenum ToOpenGL(FaceFilling side)
|
inline GLenum ToOpenGL(FaceFilling side)
|
||||||
{
|
{
|
||||||
switch (side)
|
switch (side)
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace Nz
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void Image::ArrayToRegion(ImageType type, unsigned int baseLayer, unsigned int layerCount, Boxui& region)
|
inline void Image::ArrayToRegion(ImageType type, unsigned int baseLayer, unsigned int layerCount, Boxui& region)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ namespace Nz
|
||||||
m_skinningMatrixUpdated(false)
|
m_skinningMatrixUpdated(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Joint::Joint(Joint&& joint) noexcept :
|
inline Joint::Joint(Joint&& joint) noexcept :
|
||||||
Node(std::move(joint)),
|
Node(std::move(joint)),
|
||||||
m_inverseBindMatrix(joint.m_inverseBindMatrix),
|
m_inverseBindMatrix(joint.m_inverseBindMatrix),
|
||||||
|
|
|
||||||
|
|
@ -406,7 +406,7 @@ namespace Nz
|
||||||
EnsureDerivedUpdate();
|
EnsureDerivedUpdate();
|
||||||
return globalScale / m_derivedScale;
|
return globalScale / m_derivedScale;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Node& Node::operator=(const Node& node)
|
inline Node& Node::operator=(const Node& node)
|
||||||
{
|
{
|
||||||
SetParent(node.m_parent, false, Invalidation::DontInvalidate);
|
SetParent(node.m_parent, false, Invalidation::DontInvalidate);
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ namespace Nz
|
||||||
RichTextDrawer& operator=(RichTextDrawer&& drawer) noexcept;
|
RichTextDrawer& operator=(RichTextDrawer&& drawer) noexcept;
|
||||||
|
|
||||||
static constexpr std::size_t InvalidBlockIndex = std::numeric_limits<std::size_t>::max();
|
static constexpr std::size_t InvalidBlockIndex = std::numeric_limits<std::size_t>::max();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct Block;
|
struct Block;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace Nz
|
||||||
template<typename T> SparsePtr<T> GetComponentPtr(VertexComponent component, std::size_t componentIndex = 0);
|
template<typename T> SparsePtr<T> GetComponentPtr(VertexComponent component, std::size_t componentIndex = 0);
|
||||||
inline const VertexBuffer* GetVertexBuffer() const;
|
inline const VertexBuffer* GetVertexBuffer() const;
|
||||||
inline UInt32 GetVertexCount() const;
|
inline UInt32 GetVertexCount() const;
|
||||||
|
|
||||||
template<typename T> bool HasComponentOfType(VertexComponent component) const;
|
template<typename T> bool HasComponentOfType(VertexComponent component) const;
|
||||||
|
|
||||||
void Unmap();
|
void Unmap();
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ namespace Nz
|
||||||
static std::vector<Vk::PhysicalDevice> s_physDevices;
|
static std::vector<Vk::PhysicalDevice> s_physDevices;
|
||||||
static Vk::Instance s_instance;
|
static Vk::Instance s_instance;
|
||||||
static ParameterList s_initializationParameters;
|
static ParameterList s_initializationParameters;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // NAZARA_VULKANRENDERER_VULKAN_HPP
|
#endif // NAZARA_VULKANRENDERER_VULKAN_HPP
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ namespace Nz
|
||||||
void InsertDebugLabel(std::string_view label, const Color& color) override;
|
void InsertDebugLabel(std::string_view label, const Color& color) override;
|
||||||
|
|
||||||
inline Vk::CommandBuffer& GetCommandBuffer();
|
inline Vk::CommandBuffer& GetCommandBuffer();
|
||||||
|
|
||||||
void NextSubpass() override;
|
void NextSubpass() override;
|
||||||
|
|
||||||
void PreTransferBarrier() override;
|
void PreTransferBarrier() override;
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ namespace Nz
|
||||||
public:
|
public:
|
||||||
Loader() = delete;
|
Loader() = delete;
|
||||||
~Loader() = delete;
|
~Loader() = delete;
|
||||||
|
|
||||||
static bool EnumerateInstanceExtensionProperties(std::vector<VkExtensionProperties>* properties, const char* layerName = nullptr);
|
static bool EnumerateInstanceExtensionProperties(std::vector<VkExtensionProperties>* properties, const char* layerName = nullptr);
|
||||||
static bool EnumerateInstanceLayerProperties(std::vector<VkLayerProperties>* properties);
|
static bool EnumerateInstanceLayerProperties(std::vector<VkLayerProperties>* properties);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ namespace Nz::Vk
|
||||||
m_surface = VK_NULL_HANDLE;
|
m_surface = VK_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline VkResult Surface::GetLastErrorCode() const
|
inline VkResult Surface::GetLastErrorCode() const
|
||||||
{
|
{
|
||||||
return m_lastErrorCode;
|
return m_lastErrorCode;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ namespace Nz::Vk
|
||||||
|
|
||||||
public:
|
public:
|
||||||
struct Image;
|
struct Image;
|
||||||
|
|
||||||
Swapchain() = default;
|
Swapchain() = default;
|
||||||
Swapchain(const Swapchain&) = delete;
|
Swapchain(const Swapchain&) = delete;
|
||||||
Swapchain(Swapchain&&) = default;
|
Swapchain(Swapchain&&) = default;
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ namespace Nz
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<typename F> bool DispatchEvent(std::size_t widgetIndex, F&& functor);
|
template<typename F> bool DispatchEvent(std::size_t widgetIndex, F&& functor);
|
||||||
|
|
||||||
void OnEventMouseButtonPressed(const WindowEventHandler* eventHandler, const WindowEvent::MouseButtonEvent& event);
|
void OnEventMouseButtonPressed(const WindowEventHandler* eventHandler, const WindowEvent::MouseButtonEvent& event);
|
||||||
void OnEventMouseButtonRelease(const WindowEventHandler* eventHandler, const WindowEvent::MouseButtonEvent& event);
|
void OnEventMouseButtonRelease(const WindowEventHandler* eventHandler, const WindowEvent::MouseButtonEvent& event);
|
||||||
void OnEventMouseEntered(const WindowEventHandler* eventHandler);
|
void OnEventMouseEntered(const WindowEventHandler* eventHandler);
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ namespace Nz
|
||||||
bool m_isHovered;
|
bool m_isHovered;
|
||||||
bool m_isPressed;
|
bool m_isPressed;
|
||||||
};
|
};
|
||||||
|
|
||||||
class NAZARA_WIDGETS_API SimpleCheckboxWidgetStyle : public CheckboxWidgetStyle
|
class NAZARA_WIDGETS_API SimpleCheckboxWidgetStyle : public CheckboxWidgetStyle
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -109,7 +109,7 @@ namespace Nz
|
||||||
entt::entity m_checkEntity;
|
entt::entity m_checkEntity;
|
||||||
bool m_isHovered;
|
bool m_isHovered;
|
||||||
};
|
};
|
||||||
|
|
||||||
class NAZARA_WIDGETS_API SimpleImageButtonWidgetStyle : public ImageButtonWidgetStyle
|
class NAZARA_WIDGETS_API SimpleImageButtonWidgetStyle : public ImageButtonWidgetStyle
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -150,7 +150,7 @@ namespace Nz
|
||||||
bool m_isHovered;
|
bool m_isHovered;
|
||||||
bool m_isPressed;
|
bool m_isPressed;
|
||||||
};
|
};
|
||||||
|
|
||||||
class NAZARA_WIDGETS_API SimpleLabelWidgetStyle : public LabelWidgetStyle
|
class NAZARA_WIDGETS_API SimpleLabelWidgetStyle : public LabelWidgetStyle
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -179,7 +179,7 @@ namespace Nz
|
||||||
std::shared_ptr<TextSprite> m_textSprite;
|
std::shared_ptr<TextSprite> m_textSprite;
|
||||||
entt::entity m_entity;
|
entt::entity m_entity;
|
||||||
};
|
};
|
||||||
|
|
||||||
class NAZARA_WIDGETS_API SimpleProgressBarWidgetStyle : public ProgressBarWidgetStyle
|
class NAZARA_WIDGETS_API SimpleProgressBarWidgetStyle : public ProgressBarWidgetStyle
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ namespace Nz
|
||||||
ButtonWidgetStyle& operator=(const ButtonWidgetStyle&) = delete;
|
ButtonWidgetStyle& operator=(const ButtonWidgetStyle&) = delete;
|
||||||
ButtonWidgetStyle& operator=(ButtonWidgetStyle&&) = default;
|
ButtonWidgetStyle& operator=(ButtonWidgetStyle&&) = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
class NAZARA_WIDGETS_API CheckboxWidgetStyle : public BaseWidgetStyle
|
class NAZARA_WIDGETS_API CheckboxWidgetStyle : public BaseWidgetStyle
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -147,7 +147,7 @@ namespace Nz
|
||||||
CheckboxWidgetStyle& operator=(const CheckboxWidgetStyle&) = delete;
|
CheckboxWidgetStyle& operator=(const CheckboxWidgetStyle&) = delete;
|
||||||
CheckboxWidgetStyle& operator=(CheckboxWidgetStyle&&) = default;
|
CheckboxWidgetStyle& operator=(CheckboxWidgetStyle&&) = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
class NAZARA_WIDGETS_API ImageButtonWidgetStyle : public BaseWidgetStyle
|
class NAZARA_WIDGETS_API ImageButtonWidgetStyle : public BaseWidgetStyle
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -186,7 +186,7 @@ namespace Nz
|
||||||
LabelWidgetStyle& operator=(const LabelWidgetStyle&) = delete;
|
LabelWidgetStyle& operator=(const LabelWidgetStyle&) = delete;
|
||||||
LabelWidgetStyle& operator=(LabelWidgetStyle&&) = default;
|
LabelWidgetStyle& operator=(LabelWidgetStyle&&) = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
class NAZARA_WIDGETS_API ProgressBarWidgetStyle : public BaseWidgetStyle
|
class NAZARA_WIDGETS_API ProgressBarWidgetStyle : public BaseWidgetStyle
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -233,7 +233,7 @@ namespace Nz
|
||||||
ScrollbarWidgetStyle& operator=(const ScrollbarWidgetStyle&) = delete;
|
ScrollbarWidgetStyle& operator=(const ScrollbarWidgetStyle&) = delete;
|
||||||
ScrollbarWidgetStyle& operator=(ScrollbarWidgetStyle&&) = default;
|
ScrollbarWidgetStyle& operator=(ScrollbarWidgetStyle&&) = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
class NAZARA_WIDGETS_API ScrollbarButtonWidgetStyle : public BaseWidgetStyle
|
class NAZARA_WIDGETS_API ScrollbarButtonWidgetStyle : public BaseWidgetStyle
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ namespace Nz
|
||||||
format = AudioFormat::I16_Mono;
|
format = AudioFormat::I16_Mono;
|
||||||
sampleCount = wav.totalPCMFrameCount;
|
sampleCount = wav.totalPCMFrameCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::make_shared<SoundBuffer>(format, sampleCount, wav.sampleRate, samples.get());
|
return std::make_shared<SoundBuffer>(format, sampleCount, wav.sampleRate, samples.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,7 @@ namespace Nz
|
||||||
format = AudioFormat::I16_Mono;
|
format = AudioFormat::I16_Mono;
|
||||||
sampleCount = frameCount;
|
sampleCount = frameCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::make_shared<SoundBuffer>(format, sampleCount, sampleRate, samples.get());
|
return std::make_shared<SoundBuffer>(format, sampleCount, sampleRate, samples.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ namespace Nz
|
||||||
format = AudioFormat::I16_Mono;
|
format = AudioFormat::I16_Mono;
|
||||||
sampleCount = frameCount;
|
sampleCount = frameCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::make_shared<SoundBuffer>(format, sampleCount, info->rate, samples.get());
|
return std::make_shared<SoundBuffer>(format, sampleCount, info->rate, samples.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ namespace Nz
|
||||||
format = AudioFormat::I16_Mono;
|
format = AudioFormat::I16_Mono;
|
||||||
sampleCount = frameCount;
|
sampleCount = frameCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::make_shared<SoundBuffer>(format, sampleCount, info.hz, info.buffer);
|
return std::make_shared<SoundBuffer>(format, sampleCount, info.hz, info.buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace Nz
|
||||||
Music(*Audio::Instance()->GetDefaultDevice())
|
Music(*Audio::Instance()->GetDefaultDevice())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
Music::Music(AudioDevice& device) :
|
Music::Music(AudioDevice& device) :
|
||||||
SoundEmitter(device),
|
SoundEmitter(device),
|
||||||
m_streaming(false),
|
m_streaming(false),
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ namespace Nz
|
||||||
else
|
else
|
||||||
return std::make_shared<BulletNullCollider3D>();
|
return std::make_shared<BulletNullCollider3D>();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<BulletCollider3D> BulletCollider3D::CreateGeomFromPrimitive(const Primitive& primitive)
|
std::shared_ptr<BulletCollider3D> BulletCollider3D::CreateGeomFromPrimitive(const Primitive& primitive)
|
||||||
{
|
{
|
||||||
switch (primitive.type)
|
switch (primitive.type)
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@ namespace Nz
|
||||||
cpDampedSpringSetStiffness(m_constraint, newStiffness);
|
cpDampedSpringSetStiffness(m_constraint, newStiffness);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ChipmunkDampedRotarySpringConstraint2D::ChipmunkDampedRotarySpringConstraint2D(ChipmunkRigidBody2D& first, ChipmunkRigidBody2D& second, const RadianAnglef& restAngle, float stiffness, float damping) :
|
ChipmunkDampedRotarySpringConstraint2D::ChipmunkDampedRotarySpringConstraint2D(ChipmunkRigidBody2D& first, ChipmunkRigidBody2D& second, const RadianAnglef& restAngle, float stiffness, float damping) :
|
||||||
ChipmunkConstraint2D(first.GetWorld(), cpDampedRotarySpringNew(first.GetHandle(), second.GetHandle(), restAngle.value, stiffness, damping))
|
ChipmunkConstraint2D(first.GetWorld(), cpDampedRotarySpringNew(first.GetHandle(), second.GetHandle(), restAngle.value, stiffness, damping))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -621,7 +621,7 @@ namespace Nz
|
||||||
|
|
||||||
DestroyBody();
|
DestroyBody();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChipmunkRigidBody2D::DestroyBody()
|
void ChipmunkRigidBody2D::DestroyBody()
|
||||||
{
|
{
|
||||||
UnregisterFromSpace();
|
UnregisterFromSpace();
|
||||||
|
|
|
||||||
|
|
@ -785,7 +785,7 @@ namespace Nz
|
||||||
return "Whirlpool";
|
return "Whirlpool";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WhirlpoolHasher::ProcessBuffer()
|
void WhirlpoolHasher::ProcessBuffer()
|
||||||
{
|
{
|
||||||
NAZARA_USE_ANONYMOUS_NAMESPACE
|
NAZARA_USE_ANONYMOUS_NAMESPACE
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,7 @@ namespace Nz
|
||||||
pthread_cond_t TaskSchedulerImpl::s_cvEmpty;
|
pthread_cond_t TaskSchedulerImpl::s_cvEmpty;
|
||||||
pthread_cond_t TaskSchedulerImpl::s_cvNotEmpty;
|
pthread_cond_t TaskSchedulerImpl::s_cvNotEmpty;
|
||||||
pthread_barrier_t TaskSchedulerImpl::s_barrier;
|
pthread_barrier_t TaskSchedulerImpl::s_barrier;
|
||||||
|
|
||||||
#if defined(NAZARA_PLATFORM_MACOS)
|
#if defined(NAZARA_PLATFORM_MACOS)
|
||||||
//Code from https://blog.albertarmea.com/post/47089939939/using-pthreadbarrier-on-mac-os-x
|
//Code from https://blog.albertarmea.com/post/47089939939/using-pthreadbarrier-on-mac-os-x
|
||||||
int TaskSchedulerImpl::pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count)
|
int TaskSchedulerImpl::pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count)
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ namespace Nz
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Write bits to the stream (if any) and reset the current bit cursor
|
* Write bits to the stream (if any) and reset the current bit cursor
|
||||||
|
|
||||||
* \see ResetWriteBitPosition
|
* \see ResetWriteBitPosition
|
||||||
*/
|
*/
|
||||||
void SerializationContext::FlushBits()
|
void SerializationContext::FlushBits()
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
return utf8::distance(str.data(), str.data() + str.size());
|
return utf8::distance(str.data(), str.data() + str.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EndsWith(std::string_view lhs, std::string_view rhs, CaseIndependent)
|
bool EndsWith(std::string_view lhs, std::string_view rhs, CaseIndependent)
|
||||||
{
|
{
|
||||||
NAZARA_USE_ANONYMOUS_NAMESPACE
|
NAZARA_USE_ANONYMOUS_NAMESPACE
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace Nz::PlatformImpl
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
commandLine += program;
|
commandLine += program;
|
||||||
|
|
||||||
ReplaceStr(commandLine, L'/', L'\\');
|
ReplaceStr(commandLine, L'/', L'\\');
|
||||||
commandLine += L' ';
|
commandLine += L' ';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace Nz
|
||||||
FramePass& debugDrawPass = frameGraph.AddPass("Debug draw pass");
|
FramePass& debugDrawPass = frameGraph.AddPass("Debug draw pass");
|
||||||
debugDrawPass.AddInput(inputOuputs.inputAttachments[0]);
|
debugDrawPass.AddInput(inputOuputs.inputAttachments[0]);
|
||||||
debugDrawPass.AddOutput(inputOuputs.outputAttachments[0]);
|
debugDrawPass.AddOutput(inputOuputs.outputAttachments[0]);
|
||||||
|
|
||||||
if (inputOuputs.depthStencilInput != InvalidAttachmentIndex)
|
if (inputOuputs.depthStencilInput != InvalidAttachmentIndex)
|
||||||
debugDrawPass.SetDepthStencilInput(inputOuputs.depthStencilInput);
|
debugDrawPass.SetDepthStencilInput(inputOuputs.depthStencilInput);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ namespace Nz::Loaders
|
||||||
std::size_t proxyId = m_current->passList->AddAttachmentProxy(proxyName, it->second);
|
std::size_t proxyId = m_current->passList->AddAttachmentProxy(proxyName, it->second);
|
||||||
m_current->attachmentsByName.emplace(std::move(proxyName), proxyId);
|
m_current->attachmentsByName.emplace(std::move(proxyName), proxyId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandlePass(ParameterFileSection section, std::string passName)
|
void HandlePass(ParameterFileSection section, std::string passName)
|
||||||
{
|
{
|
||||||
struct InputOutput
|
struct InputOutput
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ namespace Nz
|
||||||
|
|
||||||
return lightIndex;
|
return lightIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t ForwardFramePipeline::RegisterRenderable(std::size_t worldInstanceIndex, std::size_t skeletonInstanceIndex, const InstancedRenderable* instancedRenderable, UInt32 renderMask, const Recti& scissorBox)
|
std::size_t ForwardFramePipeline::RegisterRenderable(std::size_t worldInstanceIndex, std::size_t skeletonInstanceIndex, const InstancedRenderable* instancedRenderable, UInt32 renderMask, const Recti& scissorBox)
|
||||||
{
|
{
|
||||||
std::size_t renderableIndex;
|
std::size_t renderableIndex;
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ namespace Nz
|
||||||
textureInfo.type = ImageType::E2D;
|
textureInfo.type = ImageType::E2D;
|
||||||
textureInfo.usageFlags = TextureUsage::ShaderSampling | TextureUsage::TransferSource | TextureUsage::TransferDestination;
|
textureInfo.usageFlags = TextureUsage::ShaderSampling | TextureUsage::TransferSource | TextureUsage::TransferDestination;
|
||||||
textureInfo.levelCount = 1; //< FIXME: Disable mipmaps for now
|
textureInfo.levelCount = 1; //< FIXME: Disable mipmaps for now
|
||||||
|
|
||||||
std::shared_ptr<Texture> newTexture;
|
std::shared_ptr<Texture> newTexture;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ namespace Nz
|
||||||
size = Vector2f(m_size, section.size);
|
size = Vector2f(m_size, section.size);
|
||||||
texCoords = Vector2f(m_textureCoords.width, section.textureCoord);
|
texCoords = Vector2f(m_textureCoords.width, section.textureCoord);
|
||||||
}
|
}
|
||||||
|
|
||||||
vertices->color = m_color;
|
vertices->color = m_color;
|
||||||
vertices->position = topLeftCorner;
|
vertices->position = topLeftCorner;
|
||||||
vertices->uv = topLeftUV;
|
vertices->uv = topLeftUV;
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ namespace Nz
|
||||||
for (std::size_t i = 0; i < m_directions.size(); ++i)
|
for (std::size_t i = 0; i < m_directions.size(); ++i)
|
||||||
{
|
{
|
||||||
DirectionData& direction = m_directions[i];
|
DirectionData& direction = m_directions[i];
|
||||||
|
|
||||||
ViewerInstance& viewerInstance = direction.viewer.GetViewerInstance();
|
ViewerInstance& viewerInstance = direction.viewer.GetViewerInstance();
|
||||||
viewerInstance.UpdateEyePosition(m_light.GetPosition());
|
viewerInstance.UpdateEyePosition(m_light.GetPosition());
|
||||||
viewerInstance.UpdateViewMatrix(Matrix4f::TransformInverse(m_light.GetPosition(), s_dirRotations[i]));
|
viewerInstance.UpdateViewMatrix(Matrix4f::TransformInverse(m_light.GetPosition(), s_dirRotations[i]));
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
// TODO: Replace the blit to swapchain by a graph.BindExternalSwapchain?
|
// TODO: Replace the blit to swapchain by a graph.BindExternalSwapchain?
|
||||||
std::size_t linkAttachment = graph.AddDummyAttachment();
|
std::size_t linkAttachment = graph.AddDummyAttachment();
|
||||||
|
|
||||||
FramePass& blitPass = graph.AddPass("Blit to swapchain");
|
FramePass& blitPass = graph.AddPass("Blit to swapchain");
|
||||||
blitPass.AddInput(attachmentIndex);
|
blitPass.AddInput(attachmentIndex);
|
||||||
blitPass.SetInputAccess(0, TextureLayout::TransferSource, PipelineStage::Transfer, MemoryAccess::MemoryRead);
|
blitPass.SetInputAccess(0, TextureLayout::TransferSource, PipelineStage::Transfer, MemoryAccess::MemoryRead);
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ namespace Nz
|
||||||
});
|
});
|
||||||
|
|
||||||
std::size_t size = structData.fieldOffsets.GetSize() - offset;
|
std::size_t size = structData.fieldOffsets.GetSize() - offset;
|
||||||
|
|
||||||
if (member.tag.empty())
|
if (member.tag.empty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -184,7 +184,7 @@ namespace Nz
|
||||||
if (UInt32 bindingIndex = material.GetEngineBindingIndex(EngineShaderBinding::ShadowmapPoint); bindingIndex != Material::InvalidBindingIndex)
|
if (UInt32 bindingIndex = material.GetEngineBindingIndex(EngineShaderBinding::ShadowmapPoint); bindingIndex != Material::InvalidBindingIndex)
|
||||||
{
|
{
|
||||||
std::size_t textureBindingBaseIndex = m_textureBindingCache.size();
|
std::size_t textureBindingBaseIndex = m_textureBindingCache.size();
|
||||||
|
|
||||||
for (std::size_t j = 0; j < renderState.shadowMapsPoint.size(); ++j)
|
for (std::size_t j = 0; j < renderState.shadowMapsPoint.size(); ++j)
|
||||||
{
|
{
|
||||||
const Texture* texture = renderState.shadowMapsPoint[j];
|
const Texture* texture = renderState.shadowMapsPoint[j];
|
||||||
|
|
@ -202,7 +202,7 @@ namespace Nz
|
||||||
SafeCast<UInt32>(renderState.shadowMapsPoint.size()), &m_textureBindingCache[textureBindingBaseIndex]
|
SafeCast<UInt32>(renderState.shadowMapsPoint.size()), &m_textureBindingCache[textureBindingBaseIndex]
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (UInt32 bindingIndex = material.GetEngineBindingIndex(EngineShaderBinding::ShadowmapSpot); bindingIndex != Material::InvalidBindingIndex)
|
if (UInt32 bindingIndex = material.GetEngineBindingIndex(EngineShaderBinding::ShadowmapSpot); bindingIndex != Material::InvalidBindingIndex)
|
||||||
{
|
{
|
||||||
std::size_t textureBindingBaseIndex = m_textureBindingCache.size();
|
std::size_t textureBindingBaseIndex = m_textureBindingCache.size();
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,7 @@ namespace Nz
|
||||||
CameraComponent& entityCamera = m_registry.get<CameraComponent>(entity);
|
CameraComponent& entityCamera = m_registry.get<CameraComponent>(entity);
|
||||||
|
|
||||||
Vector3f cameraPosition = entityNode.GetPosition(CoordSys::Global);
|
Vector3f cameraPosition = entityNode.GetPosition(CoordSys::Global);
|
||||||
|
|
||||||
ViewerInstance& viewerInstance = entityCamera.GetViewerInstance();
|
ViewerInstance& viewerInstance = entityCamera.GetViewerInstance();
|
||||||
viewerInstance.UpdateEyePosition(cameraPosition);
|
viewerInstance.UpdateEyePosition(cameraPosition);
|
||||||
viewerInstance.UpdateViewMatrix(Nz::Matrix4f::TransformInverse(cameraPosition, entityNode.GetRotation(CoordSys::Global)));
|
viewerInstance.UpdateViewMatrix(Nz::Matrix4f::TransformInverse(cameraPosition, entityNode.GetRotation(CoordSys::Global)));
|
||||||
|
|
@ -355,7 +355,7 @@ namespace Nz
|
||||||
assert(m_cameraEntities.find(entity) == m_cameraEntities.end());
|
assert(m_cameraEntities.find(entity) == m_cameraEntities.end());
|
||||||
m_cameraEntities.emplace(entity, cameraEntity);
|
m_cameraEntities.emplace(entity, cameraEntity);
|
||||||
});
|
});
|
||||||
|
|
||||||
m_graphicsConstructObserver.each([&](entt::entity entity)
|
m_graphicsConstructObserver.each([&](entt::entity entity)
|
||||||
{
|
{
|
||||||
GraphicsComponent& entityGfx = m_registry.get<GraphicsComponent>(entity);
|
GraphicsComponent& entityGfx = m_registry.get<GraphicsComponent>(entity);
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ namespace Nz
|
||||||
vertices += 4 * spriteCount;
|
vertices += 4 * spriteCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::shared_ptr<MaterialInstance>& Tilemap::GetMaterial(std::size_t i) const
|
const std::shared_ptr<MaterialInstance>& Tilemap::GetMaterial(std::size_t i) const
|
||||||
{
|
{
|
||||||
assert(i < m_layers.size());
|
assert(i < m_layers.size());
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ namespace Nz
|
||||||
for (const auto& [optionHash, optionValue] : config.optionValues)
|
for (const auto& [optionHash, optionValue] : config.optionValues)
|
||||||
{
|
{
|
||||||
std::uint32_t hash = optionHash;
|
std::uint32_t hash = optionHash;
|
||||||
|
|
||||||
std::visit([&](auto&& arg)
|
std::visit([&](auto&& arg)
|
||||||
{
|
{
|
||||||
states.optionValues[hash] = arg;
|
states.optionValues[hash] = arg;
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
m_character->Activate(false);
|
m_character->Activate(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
JoltCharacter& JoltCharacter::operator=(JoltCharacter&& character) noexcept
|
JoltCharacter& JoltCharacter::operator=(JoltCharacter&& character) noexcept
|
||||||
{
|
{
|
||||||
Destroy();
|
Destroy();
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ namespace Nz
|
||||||
for (unsigned int slice = 0; slice < sliceCount; ++slice)
|
for (unsigned int slice = 0; slice < sliceCount; ++slice)
|
||||||
{
|
{
|
||||||
Quaternionf rot(RadianAnglef(2.f * Pi<float> * slice / sliceCount), Nz::Vector3f::Down());
|
Quaternionf rot(RadianAnglef(2.f * Pi<float> * slice / sliceCount), Nz::Vector3f::Down());
|
||||||
|
|
||||||
Vector3f top(0.f, halfHeight, 0.f);
|
Vector3f top(0.f, halfHeight, 0.f);
|
||||||
for (unsigned int i = 0; i < cornerStepCount; ++i)
|
for (unsigned int i = 0; i < cornerStepCount; ++i)
|
||||||
{
|
{
|
||||||
|
|
@ -354,7 +354,7 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************** JoltMeshCollider3D *********************************/
|
/******************************** JoltMeshCollider3D *********************************/
|
||||||
|
|
||||||
JoltMeshCollider3D::JoltMeshCollider3D(SparsePtr<const Vector3f> vertices, std::size_t vertexCount, SparsePtr<const UInt16> indices, std::size_t indexCount)
|
JoltMeshCollider3D::JoltMeshCollider3D(SparsePtr<const Vector3f> vertices, std::size_t vertexCount, SparsePtr<const UInt16> indices, std::size_t indexCount)
|
||||||
{
|
{
|
||||||
std::unique_ptr<JPH::MeshShapeSettings> settings = std::make_unique<JPH::MeshShapeSettings>();
|
std::unique_ptr<JPH::MeshShapeSettings> settings = std::make_unique<JPH::MeshShapeSettings>();
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,7 @@ namespace Nz
|
||||||
const FunctionRef<std::optional<float>(const JoltPhysWorld3D::PointCollisionInfo& hitInfo)>& m_callback;
|
const FunctionRef<std::optional<float>(const JoltPhysWorld3D::PointCollisionInfo& hitInfo)>& m_callback;
|
||||||
bool m_didHit;
|
bool m_didHit;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ShapeCallbackHitResult : public JPH::CollideShapeCollector
|
class ShapeCallbackHitResult : public JPH::CollideShapeCollector
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ namespace Nz
|
||||||
void AbstractSocket::SetReceiveBufferSize(std::size_t size)
|
void AbstractSocket::SetReceiveBufferSize(std::size_t size)
|
||||||
{
|
{
|
||||||
NazaraAssert(m_handle != SocketImpl::InvalidHandle, "Socket must be created first");
|
NazaraAssert(m_handle != SocketImpl::InvalidHandle, "Socket must be created first");
|
||||||
|
|
||||||
SocketImpl::SetReceiveBufferSize(m_handle, size);
|
SocketImpl::SetReceiveBufferSize(m_handle, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -156,7 +156,7 @@ namespace Nz
|
||||||
void AbstractSocket::SetSendBufferSize(std::size_t size)
|
void AbstractSocket::SetSendBufferSize(std::size_t size)
|
||||||
{
|
{
|
||||||
NazaraAssert(m_handle != SocketImpl::InvalidHandle, "Socket must be created first");
|
NazaraAssert(m_handle != SocketImpl::InvalidHandle, "Socket must be created first");
|
||||||
|
|
||||||
SocketImpl::SetSendBufferSize(m_handle, size);
|
SocketImpl::SetSendBufferSize(m_handle, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -249,7 +249,7 @@ namespace Nz
|
||||||
m_lastError = abstractSocket.m_lastError;
|
m_lastError = abstractSocket.m_lastError;
|
||||||
m_state = abstractSocket.m_state;
|
m_state = abstractSocket.m_state;
|
||||||
m_type = abstractSocket.m_type;
|
m_type = abstractSocket.m_type;
|
||||||
|
|
||||||
abstractSocket.m_handle = SocketImpl::InvalidHandle;
|
abstractSocket.m_handle = SocketImpl::InvalidHandle;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
|
|
|
||||||
|
|
@ -710,7 +710,7 @@ namespace Nz
|
||||||
#else
|
#else
|
||||||
int byteSent = sendmsg(handle, &msgHdr, 0);
|
int byteSent = sendmsg(handle, &msgHdr, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (byteSent == -1)
|
if (byteSent == -1)
|
||||||
{
|
{
|
||||||
int errorCode = errno;
|
int errorCode = errno;
|
||||||
|
|
@ -892,7 +892,7 @@ namespace Nz
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
*error = SocketError::NoError;
|
*error = SocketError::NoError;
|
||||||
|
|
||||||
#if not defined(MSG_NOSIGNAL) // -> https://github.com/intel/parameter-framework/pull/133/files
|
#if not defined(MSG_NOSIGNAL) // -> https://github.com/intel/parameter-framework/pull/133/files
|
||||||
//There is no MSG_NOSIGNAL on macos
|
//There is no MSG_NOSIGNAL on macos
|
||||||
const int set = 1;
|
const int set = 1;
|
||||||
|
|
@ -1017,7 +1017,7 @@ namespace Nz
|
||||||
int SocketImpl::TranslateNetProtocolToAF(NetProtocol protocol)
|
int SocketImpl::TranslateNetProtocolToAF(NetProtocol protocol)
|
||||||
{
|
{
|
||||||
NazaraAssert(protocol <= NetProtocol::Max, "Protocol has value out of enum");
|
NazaraAssert(protocol <= NetProtocol::Max, "Protocol has value out of enum");
|
||||||
|
|
||||||
constexpr EnumArray<NetProtocol, int> addressFamily {
|
constexpr EnumArray<NetProtocol, int> addressFamily {
|
||||||
AF_UNSPEC, //< NetProtocol::Any
|
AF_UNSPEC, //< NetProtocol::Any
|
||||||
AF_INET, //< NetProtocol::IPv4
|
AF_INET, //< NetProtocol::IPv4
|
||||||
|
|
@ -1031,7 +1031,7 @@ namespace Nz
|
||||||
int SocketImpl::TranslateSocketTypeToSock(SocketType type)
|
int SocketImpl::TranslateSocketTypeToSock(SocketType type)
|
||||||
{
|
{
|
||||||
NazaraAssert(type <= SocketType::Max, "Socket type has value out of enum");
|
NazaraAssert(type <= SocketType::Max, "Socket type has value out of enum");
|
||||||
|
|
||||||
constexpr EnumArray<SocketType, int> socketType {
|
constexpr EnumArray<SocketType, int> socketType {
|
||||||
SOCK_RAW, //< SocketType::Raw
|
SOCK_RAW, //< SocketType::Raw
|
||||||
SOCK_STREAM, //< SocketType::TCP
|
SOCK_STREAM, //< SocketType::TCP
|
||||||
|
|
|
||||||
|
|
@ -445,7 +445,7 @@ namespace Nz
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
SocketState SocketImpl::PollConnection(SocketHandle handle, const IpAddress& /*address*/, UInt64 msTimeout, SocketError* error)
|
SocketState SocketImpl::PollConnection(SocketHandle handle, const IpAddress& /*address*/, UInt64 msTimeout, SocketError* error)
|
||||||
{
|
{
|
||||||
// Wait until socket is available for writing or an error occurs (ie when connection succeeds or fails)
|
// Wait until socket is available for writing or an error occurs (ie when connection succeeds or fails)
|
||||||
|
|
@ -1041,7 +1041,7 @@ namespace Nz
|
||||||
int SocketImpl::TranslateSocketTypeToSock(SocketType type)
|
int SocketImpl::TranslateSocketTypeToSock(SocketType type)
|
||||||
{
|
{
|
||||||
NazaraAssert(type <= SocketType::Max, "Socket type has value out of enum");
|
NazaraAssert(type <= SocketType::Max, "Socket type has value out of enum");
|
||||||
|
|
||||||
constexpr EnumArray<SocketType, int> socketType {
|
constexpr EnumArray<SocketType, int> socketType {
|
||||||
SOCK_RAW, //< SocketType::Raw
|
SOCK_RAW, //< SocketType::Raw
|
||||||
SOCK_STREAM, //< SocketType::TCP
|
SOCK_STREAM, //< SocketType::TCP
|
||||||
|
|
|
||||||
|
|
@ -84,11 +84,11 @@ namespace Nz
|
||||||
for (std::size_t i = 0; i < bindingCount; ++i)
|
for (std::size_t i = 0; i < bindingCount; ++i)
|
||||||
{
|
{
|
||||||
const Binding& binding = bindings[i];
|
const Binding& binding = bindings[i];
|
||||||
|
|
||||||
std::visit([&](auto&& arg)
|
std::visit([&](auto&& arg)
|
||||||
{
|
{
|
||||||
using T = std::decay_t<decltype(arg)>;
|
using T = std::decay_t<decltype(arg)>;
|
||||||
|
|
||||||
if constexpr (std::is_same_v<T, SampledTextureBinding>)
|
if constexpr (std::is_same_v<T, SampledTextureBinding>)
|
||||||
HandleTextureBinding(binding.bindingIndex, arg);
|
HandleTextureBinding(binding.bindingIndex, arg);
|
||||||
else if constexpr (std::is_same_v<T, SampledTextureBindings>)
|
else if constexpr (std::is_same_v<T, SampledTextureBindings>)
|
||||||
|
|
|
||||||
|
|
@ -333,7 +333,7 @@ namespace Nz::GL
|
||||||
{
|
{
|
||||||
// WGL_ARB_pixel_format and WGL_EXT_pixel_format are the same, except for the symbol
|
// WGL_ARB_pixel_format and WGL_EXT_pixel_format are the same, except for the symbol
|
||||||
auto wglChoosePixelFormat = (currentContext->wglChoosePixelFormatARB) ? currentContext->wglChoosePixelFormatARB : currentContext->wglChoosePixelFormatEXT;
|
auto wglChoosePixelFormat = (currentContext->wglChoosePixelFormatARB) ? currentContext->wglChoosePixelFormatARB : currentContext->wglChoosePixelFormatEXT;
|
||||||
|
|
||||||
if (wglChoosePixelFormat)
|
if (wglChoosePixelFormat)
|
||||||
{
|
{
|
||||||
std::array<int, 10 * 2 + 1> attributes = {
|
std::array<int, 10 * 2 + 1> attributes = {
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ namespace Nz
|
||||||
width(0)
|
width(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoMode::VideoMode(unsigned int w, unsigned int h) :
|
VideoMode::VideoMode(unsigned int w, unsigned int h) :
|
||||||
VideoMode(w, h, GetDesktopMode().bitsPerPixel)
|
VideoMode(w, h, GetDesktopMode().bitsPerPixel)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ namespace Nz
|
||||||
auto debugDrawShader = m_renderDevice.InstantiateShaderModule(nzsl::ShaderStageType::Fragment | nzsl::ShaderStageType::Vertex, *shaderModule, {});
|
auto debugDrawShader = m_renderDevice.InstantiateShaderModule(nzsl::ShaderStageType::Fragment | nzsl::ShaderStageType::Vertex, *shaderModule, {});
|
||||||
if (!debugDrawShader)
|
if (!debugDrawShader)
|
||||||
throw std::runtime_error("failed to instantiate debug draw shader");
|
throw std::runtime_error("failed to instantiate debug draw shader");
|
||||||
|
|
||||||
RenderPipelineLayoutInfo layoutInfo;
|
RenderPipelineLayoutInfo layoutInfo;
|
||||||
layoutInfo.bindings.assign({
|
layoutInfo.bindings.assign({
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ namespace Nz
|
||||||
NazaraUnused(parameters);
|
NazaraUnused(parameters);
|
||||||
|
|
||||||
Image tempImage(image); //< We're using COW here to prevent Image copy unless required
|
Image tempImage(image); //< We're using COW here to prevent Image copy unless required
|
||||||
|
|
||||||
int componentCount = ConvertToIntegerFormat(tempImage);
|
int componentCount = ConvertToIntegerFormat(tempImage);
|
||||||
if (componentCount == 0)
|
if (componentCount == 0)
|
||||||
{
|
{
|
||||||
|
|
@ -229,7 +229,7 @@ namespace Nz
|
||||||
{ ".png", &SavePNG },
|
{ ".png", &SavePNG },
|
||||||
{ ".tga", &SaveTGA }
|
{ ".tga", &SaveTGA }
|
||||||
});
|
});
|
||||||
|
|
||||||
bool FormatQuerier(std::string_view extension)
|
bool FormatQuerier(std::string_view extension)
|
||||||
{
|
{
|
||||||
return s_formatHandlers.find(extension) != s_formatHandlers.end();
|
return s_formatHandlers.find(extension) != s_formatHandlers.end();
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ namespace Nz
|
||||||
|
|
||||||
entitySkeleton.SetSkeletonParent(&entityNode);
|
entitySkeleton.SetSkeletonParent(&entityNode);
|
||||||
});
|
});
|
||||||
|
|
||||||
m_skeletonConstructObserver.each([&](entt::entity entity)
|
m_skeletonConstructObserver.each([&](entt::entity entity)
|
||||||
{
|
{
|
||||||
NodeComponent& entityNode = m_registry.get<NodeComponent>(entity);
|
NodeComponent& entityNode = m_registry.get<NodeComponent>(entity);
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ namespace Nz
|
||||||
});
|
});
|
||||||
|
|
||||||
NazaraAssert(s_declarations[VertexLayout::XY_Color]->GetStride() == sizeof(VertexStruct_XY_Color), "Invalid stride for declaration VertexLayout::XY_Color");
|
NazaraAssert(s_declarations[VertexLayout::XY_Color]->GetStride() == sizeof(VertexStruct_XY_Color), "Invalid stride for declaration VertexLayout::XY_Color");
|
||||||
|
|
||||||
// VertexLayout::XY_UV : VertexStruct_XY_UV
|
// VertexLayout::XY_UV : VertexStruct_XY_UV
|
||||||
s_declarations[VertexLayout::XY_UV] = NewDeclaration(VertexInputRate::Vertex, {
|
s_declarations[VertexLayout::XY_UV] = NewDeclaration(VertexInputRate::Vertex, {
|
||||||
{
|
{
|
||||||
|
|
@ -292,7 +292,7 @@ namespace Nz
|
||||||
});
|
});
|
||||||
|
|
||||||
NazaraAssert(s_declarations[VertexLayout::XYZ_Normal_UV_Tangent_Skinning]->GetStride() == sizeof(VertexStruct_XYZ_Normal_UV_Tangent_Skinning), "Invalid stride for declaration VertexLayout::XYZ_Normal_UV_Tangent_Skinning");
|
NazaraAssert(s_declarations[VertexLayout::XYZ_Normal_UV_Tangent_Skinning]->GetStride() == sizeof(VertexStruct_XYZ_Normal_UV_Tangent_Skinning), "Invalid stride for declaration VertexLayout::XYZ_Normal_UV_Tangent_Skinning");
|
||||||
|
|
||||||
// VertexLayout::XYZ_SizeRot : VertexStruct_XYZ_SizeRot
|
// VertexLayout::XYZ_SizeRot : VertexStruct_XYZ_SizeRot
|
||||||
s_declarations[VertexLayout::UV_SizeSinCos] = NewDeclaration(VertexInputRate::Vertex, {
|
s_declarations[VertexLayout::UV_SizeSinCos] = NewDeclaration(VertexInputRate::Vertex, {
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ namespace Nz
|
||||||
ErrorFlags flags(ErrorMode::ThrowException);
|
ErrorFlags flags(ErrorMode::ThrowException);
|
||||||
m_mapper.Map(vertexBuffer, 0, vertexBuffer.GetVertexCount());
|
m_mapper.Map(vertexBuffer, 0, vertexBuffer.GetVertexCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
VertexMapper::~VertexMapper() = default;
|
VertexMapper::~VertexMapper() = default;
|
||||||
|
|
||||||
void VertexMapper::Unmap()
|
void VertexMapper::Unmap()
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ namespace Nz
|
||||||
ToVulkan(attachmentRef.attachmentLayout)
|
ToVulkan(attachmentRef.attachmentLayout)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t inputAttachmentIndex = vkAttachmentReferences.size();
|
std::size_t inputAttachmentIndex = vkAttachmentReferences.size();
|
||||||
for (const AttachmentReference& attachmentRef : subpassInfo.inputAttachments)
|
for (const AttachmentReference& attachmentRef : subpassInfo.inputAttachments)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ namespace Nz
|
||||||
for (std::size_t i = 0; i < bindingCount; ++i)
|
for (std::size_t i = 0; i < bindingCount; ++i)
|
||||||
{
|
{
|
||||||
const Binding& binding = bindings[i];
|
const Binding& binding = bindings[i];
|
||||||
|
|
||||||
VkWriteDescriptorSet& writeOp = writeOps.emplace_back();
|
VkWriteDescriptorSet& writeOp = writeOps.emplace_back();
|
||||||
writeOp.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
|
writeOp.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET;
|
||||||
writeOp.dstSet = m_descriptorSet;
|
writeOp.dstSet = m_descriptorSet;
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ namespace Nz
|
||||||
VkImageViewCreateInfo createInfoView = {};
|
VkImageViewCreateInfo createInfoView = {};
|
||||||
createInfoView.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
|
createInfoView.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
|
||||||
InitViewForFormat(m_textureInfo.pixelFormat, createInfoView);
|
InitViewForFormat(m_textureInfo.pixelFormat, createInfoView);
|
||||||
|
|
||||||
VkImageCreateInfo createInfo = {};
|
VkImageCreateInfo createInfo = {};
|
||||||
createInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
|
createInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
|
||||||
createInfo.format = createInfoView.format;
|
createInfo.format = createInfoView.format;
|
||||||
|
|
@ -229,7 +229,7 @@ namespace Nz
|
||||||
createInfoView.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
|
createInfoView.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
|
||||||
createInfoView.image = m_image;
|
createInfoView.image = m_image;
|
||||||
createInfoView.subresourceRange = m_subresourceRange;
|
createInfoView.subresourceRange = m_subresourceRange;
|
||||||
|
|
||||||
switch (m_textureViewInfo.type)
|
switch (m_textureViewInfo.type)
|
||||||
{
|
{
|
||||||
case ImageType::E1D:
|
case ImageType::E1D:
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ namespace Nz
|
||||||
|
|
||||||
EnableBackground(true);
|
EnableBackground(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AbstractTextAreaWidget::Clear()
|
void AbstractTextAreaWidget::Clear()
|
||||||
{
|
{
|
||||||
AbstractTextDrawer& textDrawer = GetTextDrawer();
|
AbstractTextDrawer& textDrawer = GetTextDrawer();
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ namespace Nz
|
||||||
const UInt8 s_defaultThemeScrollbarCenterImage[] = {
|
const UInt8 s_defaultThemeScrollbarCenterImage[] = {
|
||||||
#include <Nazara/Widgets/Resources/DefaultTheme/ScrollbarCenter.png.h>
|
#include <Nazara/Widgets/Resources/DefaultTheme/ScrollbarCenter.png.h>
|
||||||
};
|
};
|
||||||
|
|
||||||
const UInt8 s_defaultThemeScrollbarGrabbedImage[] = {
|
const UInt8 s_defaultThemeScrollbarGrabbedImage[] = {
|
||||||
#include <Nazara/Widgets/Resources/DefaultTheme/ScrollbarCenterGrabbed.png.h>
|
#include <Nazara/Widgets/Resources/DefaultTheme/ScrollbarCenterGrabbed.png.h>
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
Layout();
|
Layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RichTextAreaWidget::AppendText(std::string_view text)
|
void RichTextAreaWidget::AppendText(std::string_view text)
|
||||||
{
|
{
|
||||||
//m_text += text;
|
//m_text += text;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ namespace Nz
|
||||||
const WidgetTheme::Config& themeConfig = GetTheme()->GetConfig();
|
const WidgetTheme::Config& themeConfig = GetTheme()->GetConfig();
|
||||||
|
|
||||||
m_scrollCenterButton = Add<ScrollbarButtonWidget>();
|
m_scrollCenterButton = Add<ScrollbarButtonWidget>();
|
||||||
|
|
||||||
m_scrollCenterButton->OnButtonReleased.Connect([this](const ScrollbarButtonWidget*)
|
m_scrollCenterButton->OnButtonReleased.Connect([this](const ScrollbarButtonWidget*)
|
||||||
{
|
{
|
||||||
m_style->OnButtonRelease();
|
m_style->OnButtonRelease();
|
||||||
|
|
@ -40,7 +40,7 @@ namespace Nz
|
||||||
m_grabbedValue = GetValue();
|
m_grabbedValue = GetValue();
|
||||||
m_style->OnButtonGrab();
|
m_style->OnButtonGrab();
|
||||||
});
|
});
|
||||||
|
|
||||||
m_scrollCenterButton->OnButtonMoved.Connect([this](const ScrollbarButtonWidget*, int x, int /*y*/)
|
m_scrollCenterButton->OnButtonMoved.Connect([this](const ScrollbarButtonWidget*, int x, int /*y*/)
|
||||||
{
|
{
|
||||||
int deltaX = x - m_grabbedPosition;
|
int deltaX = x - m_grabbedPosition;
|
||||||
|
|
@ -65,7 +65,7 @@ namespace Nz
|
||||||
m_grabbedValue = GetValue();
|
m_grabbedValue = GetValue();
|
||||||
m_style->OnButtonGrab();
|
m_style->OnButtonGrab();
|
||||||
});
|
});
|
||||||
|
|
||||||
m_scrollCenterButton->OnButtonMoved.Connect([this](const ScrollbarButtonWidget* button, int /*x*/, int y)
|
m_scrollCenterButton->OnButtonMoved.Connect([this](const ScrollbarButtonWidget* button, int /*x*/, int y)
|
||||||
{
|
{
|
||||||
int deltaY = SafeCast<int>(m_grabbedPosition - (button->GetPosition().y + y));
|
int deltaY = SafeCast<int>(m_grabbedPosition - (button->GetPosition().y + y));
|
||||||
|
|
@ -87,7 +87,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
SetValue(GetValue() - 0.1f * (GetMaximumValue() - GetMinimumValue()));
|
SetValue(GetValue() - 0.1f * (GetMaximumValue() - GetMinimumValue()));
|
||||||
});
|
});
|
||||||
|
|
||||||
m_scrollNextButton->OnButtonTrigger.Connect([this](const ImageButtonWidget*)
|
m_scrollNextButton->OnButtonTrigger.Connect([this](const ImageButtonWidget*)
|
||||||
{
|
{
|
||||||
SetValue(GetValue() + 0.1f * (GetMaximumValue() - GetMinimumValue()));
|
SetValue(GetValue() + 0.1f * (GetMaximumValue() - GetMinimumValue()));
|
||||||
|
|
@ -139,7 +139,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
m_style->OnHoverBegin();
|
m_style->OnHoverBegin();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScrollbarWidget::OnMouseExit()
|
void ScrollbarWidget::OnMouseExit()
|
||||||
{
|
{
|
||||||
m_style->OnHoverEnd();
|
m_style->OnHoverEnd();
|
||||||
|
|
|
||||||
|
|
@ -393,7 +393,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
m_textSprite->Update(drawer);
|
m_textSprite->Update(drawer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
SimpleProgressBarWidgetStyle::SimpleProgressBarWidgetStyle(ProgressBarWidget* progressBarWidget, StyleConfig config) :
|
SimpleProgressBarWidgetStyle::SimpleProgressBarWidgetStyle(ProgressBarWidget* progressBarWidget, StyleConfig config) :
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ namespace Nz
|
||||||
|
|
||||||
Layout();
|
Layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextAreaWidget::AppendText(std::string_view text)
|
void TextAreaWidget::AppendText(std::string_view text)
|
||||||
{
|
{
|
||||||
m_text += text;
|
m_text += text;
|
||||||
|
|
@ -83,7 +83,7 @@ namespace Nz
|
||||||
m_text.clear();
|
m_text.clear();
|
||||||
OnTextChanged(this, m_text);
|
OnTextChanged(this, m_text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextAreaWidget::Erase(std::size_t firstGlyph, std::size_t lastGlyph)
|
void TextAreaWidget::Erase(std::size_t firstGlyph, std::size_t lastGlyph)
|
||||||
{
|
{
|
||||||
if (firstGlyph > lastGlyph)
|
if (firstGlyph > lastGlyph)
|
||||||
|
|
|
||||||
|
|
@ -845,6 +845,50 @@ on_run(function ()
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- No space should lies before a linefeed
|
||||||
|
table.insert(checks, {
|
||||||
|
Name = "end of line spaces",
|
||||||
|
Check = function (moduleName)
|
||||||
|
local files = table.join(
|
||||||
|
os.files("include/Nazara/" .. moduleName .. "/**.hpp"),
|
||||||
|
os.files("include/Nazara/" .. moduleName .. "/**.inl"),
|
||||||
|
os.files("src/Nazara/" .. moduleName .. "/**.hpp"),
|
||||||
|
os.files("src/Nazara/" .. moduleName .. "/**.inl"),
|
||||||
|
os.files("src/Nazara/" .. moduleName .. "/**.cpp")
|
||||||
|
)
|
||||||
|
|
||||||
|
local fixes = {}
|
||||||
|
|
||||||
|
for _, filePath in pairs(files) do
|
||||||
|
local lines = GetFile(filePath)
|
||||||
|
|
||||||
|
local fileFixes = {}
|
||||||
|
for i = 1, #lines do
|
||||||
|
local content = lines[i]:match("^(%s*[^%s]*)%s+$")
|
||||||
|
if content then
|
||||||
|
table.insert(fileFixes, { line = i, newContent = content })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if #fileFixes > 0 then
|
||||||
|
print(filePath .. " has line ending with spaces")
|
||||||
|
table.insert(fixes, {
|
||||||
|
File = filePath,
|
||||||
|
Func = function (lines)
|
||||||
|
for _, fix in ipairs(fileFixes) do
|
||||||
|
lines[fix.line] = fix.newContent
|
||||||
|
end
|
||||||
|
|
||||||
|
UpdateFile(filePath, lines)
|
||||||
|
end
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return fixes
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
local shouldFix = option.get("fix") or false
|
local shouldFix = option.get("fix") or false
|
||||||
|
|
||||||
for _, check in pairs(checks) do
|
for _, check in pairs(checks) do
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue