Convert spaces to tabs

Former-commit-id: b459cfe0c83f651cc660d42f7d3014c3b146f345
This commit is contained in:
Lynix 2015-09-24 00:55:57 +02:00
parent ce3bbf6c78
commit dea3fb4e39
87 changed files with 1206 additions and 1205 deletions

View File

@ -260,9 +260,9 @@ namespace Ndk
namespace std
{
template<>
struct hash<Ndk::EntityHandle>
{
template<>
struct hash<Ndk::EntityHandle>
{
size_t operator()(const Ndk::EntityHandle& handle) const
{
// Hasher le pointeur fonctionnerait jusqu'à ce que l'entité soit mise à jour et déplacée
@ -271,9 +271,9 @@ namespace std
return hash<Ndk::EntityId>()(id);
}
};
};
inline void swap(Ndk::EntityHandle& lhs, Ndk::EntityHandle& rhs)
inline void swap(Ndk::EntityHandle& lhs, Ndk::EntityHandle& rhs)
{
lhs.Swap(rhs);
}

View File

@ -26,8 +26,8 @@ namespace Ndk
using EntityList = std::vector<EntityHandle>;
inline World(bool addDefaultSystems = true);
World(const World&) = delete;
World(World&&) = delete; ///TODO
World(const World&) = delete;
World(World&&) = delete; ///TODO
~World();
void AddDefaultSystems();
@ -61,8 +61,8 @@ namespace Ndk
void Update();
inline void Update(float elapsedTime);
World& operator=(const World&) = delete;
World& operator=(World&&) = delete; ///TODO
World& operator=(const World&) = delete;
World& operator=(World&&) = delete; ///TODO
private:
inline void Invalidate();

View File

@ -17,15 +17,15 @@ namespace Ndk
if (!entity)
return false;
const NzBitset<>& components = entity->GetComponentBits();
const NzBitset<>& components = entity->GetComponentBits();
m_filterResult.PerformsAND(m_requiredComponents, components);
if (m_filterResult != m_requiredComponents)
return false; // Au moins un component requis n'est pas présent
m_filterResult.PerformsAND(m_requiredComponents, components);
if (m_filterResult != m_requiredComponents)
return false; // Au moins un component requis n'est pas présent
m_filterResult.PerformsAND(m_excludedComponents, components);
if (m_filterResult.TestAny())
return false; // Au moins un component exclu est présent
m_filterResult.PerformsAND(m_excludedComponents, components);
if (m_filterResult.TestAny())
return false; // Au moins un component exclu est présent
// Si nous avons une liste de composants nécessaires
if (m_requiredAnyComponents.TestAny())
@ -34,7 +34,7 @@ namespace Ndk
return false;
}
return true;
return true;
}
void BaseSystem::OnEntityAdded(Entity* entity)

View File

@ -11,7 +11,7 @@ void NzMixToMono(T* input, T* output, unsigned int channelCount, unsigned int fr
///DOC: Le buffer d'entrée peut être le même que le buffer de sortie
// Pour éviter l'overflow, on utilise comme accumulateur un type assez grand, (u)int 64 bits pour les entiers, double pour les flottants
typedef typename std::conditional<std::is_unsigned<T>::value, nzUInt64, nzInt64>::type BiggestInt;
typedef typename std::conditional<std::is_integral<T>::value, BiggestInt, double>::type Biggest;
typedef typename std::conditional<std::is_integral<T>::value, BiggestInt, double>::type Biggest;
for (unsigned int i = 0; i < frameCount; ++i)
{

View File

@ -33,8 +33,8 @@ class NAZARA_AUDIO_API NzMusic : public NzResource, public NzSoundEmitter
public:
NzMusic() = default;
NzMusic(const NzMusic&) = delete;
NzMusic(NzMusic&&) = delete; ///TODO
NzMusic(const NzMusic&) = delete;
NzMusic(NzMusic&&) = delete; ///TODO
~NzMusic();
bool Create(NzSoundStream* soundStream);
@ -62,8 +62,8 @@ class NAZARA_AUDIO_API NzMusic : public NzResource, public NzSoundEmitter
void Stop();
NzMusic& operator=(const NzMusic&) = delete;
NzMusic& operator=(NzMusic&&) = delete; ///TODO
NzMusic& operator=(const NzMusic&) = delete;
NzMusic& operator=(NzMusic&&) = delete; ///TODO
private:
NzMusicImpl* m_impl = nullptr;

View File

@ -48,8 +48,8 @@ class NAZARA_AUDIO_API NzSoundBuffer : public NzRefCounted, public NzResource
public:
NzSoundBuffer() = default;
NzSoundBuffer(nzAudioFormat format, unsigned int sampleCount, unsigned int sampleRate, const nzInt16* samples);
NzSoundBuffer(const NzSoundBuffer&) = delete;
NzSoundBuffer(NzSoundBuffer&&) = delete;
NzSoundBuffer(const NzSoundBuffer&) = delete;
NzSoundBuffer(NzSoundBuffer&&) = delete;
~NzSoundBuffer();
bool Create(nzAudioFormat format, unsigned int sampleCount, unsigned int sampleRate, const nzInt16* samples);
@ -70,8 +70,8 @@ class NAZARA_AUDIO_API NzSoundBuffer : public NzRefCounted, public NzResource
static bool IsFormatSupported(nzAudioFormat format);
template<typename... Args> static NzSoundBufferRef New(Args&&... args);
NzSoundBuffer& operator=(const NzSoundBuffer&) = delete;
NzSoundBuffer& operator=(NzSoundBuffer&&) = delete; ///TODO
NzSoundBuffer& operator=(const NzSoundBuffer&) = delete;
NzSoundBuffer& operator=(NzSoundBuffer&&) = delete; ///TODO
// Signals:
NazaraSignal(OnSoundBufferDestroy, const NzSoundBuffer* /*soundBuffer*/);

View File

@ -50,13 +50,13 @@ class NAZARA_AUDIO_API NzSoundEmitter
virtual void Stop() = 0;
NzSoundEmitter& operator=(const NzSoundEmitter&) = delete; ///TODO
NzSoundEmitter& operator=(NzSoundEmitter&&) = delete; ///TODO
NzSoundEmitter& operator=(const NzSoundEmitter&) = delete; ///TODO
NzSoundEmitter& operator=(NzSoundEmitter&&) = delete; ///TODO
protected:
NzSoundEmitter();
NzSoundEmitter(const NzSoundEmitter& emitter);
NzSoundEmitter(NzSoundEmitter&&) = delete; ///TODO
NzSoundEmitter(const NzSoundEmitter& emitter);
NzSoundEmitter(NzSoundEmitter&&) = delete; ///TODO
nzSoundStatus GetInternalStatus() const;

View File

@ -15,16 +15,16 @@ class NAZARA_CORE_API NzAbstractHash
{
public:
NzAbstractHash() = default;
NzAbstractHash(const NzAbstractHash&) = delete;
NzAbstractHash(NzAbstractHash&&) = default;
NzAbstractHash(const NzAbstractHash&) = delete;
NzAbstractHash(NzAbstractHash&&) = default;
virtual ~NzAbstractHash();
virtual void Append(const nzUInt8* data, unsigned int len) = 0;
virtual void Begin() = 0;
virtual NzHashDigest End() = 0;
NzAbstractHash& operator=(const NzAbstractHash&) = delete;
NzAbstractHash& operator=(NzAbstractHash&&) = default;
NzAbstractHash& operator=(const NzAbstractHash&) = delete;
NzAbstractHash& operator=(NzAbstractHash&&) = default;
};
#endif // NAZARA_ABSTRACTHASH_HPP

View File

@ -12,7 +12,7 @@
template<typename F, typename Tuple, size_t... S>
auto NzApplyImplFunc(F&& fn, Tuple&& t, std::index_sequence<S...>)
{
return std::forward<F>(fn)(std::get<S>(std::forward<Tuple>(t))...);
return std::forward<F>(fn)(std::get<S>(std::forward<Tuple>(t))...);
}
template<typename F, typename Tuple>
@ -26,7 +26,7 @@ auto NzApply(F&& fn, Tuple&& t)
template<typename O, typename F, typename Tuple, size_t... S>
auto NzApplyImplMethod(O& object, F&& fn, Tuple&& t, std::index_sequence<S...>)
{
return (object .* std::forward<F>(fn))(std::get<S>(std::forward<Tuple>(t))...);
return (object .* std::forward<F>(fn))(std::get<S>(std::forward<Tuple>(t))...);
}
template<typename O, typename F, typename Tuple>
@ -41,16 +41,16 @@ auto NzApply(O& object, F&& fn, Tuple&& t)
template<typename T>
void NzHashCombine(std::size_t& seed, const T& v)
{
const nzUInt64 kMul = 0x9ddfea08eb382d69ULL;
const nzUInt64 kMul = 0x9ddfea08eb382d69ULL;
std::hash<T> hasher;
nzUInt64 a = (hasher(v) ^ seed) * kMul;
a ^= (a >> 47);
std::hash<T> hasher;
nzUInt64 a = (hasher(v) ^ seed) * kMul;
a ^= (a >> 47);
nzUInt64 b = (seed ^ a) * kMul;
b ^= (b >> 47);
nzUInt64 b = (seed ^ a) * kMul;
b ^= (b >> 47);
seed = static_cast<std::size_t>(b * kMul);
seed = static_cast<std::size_t>(b * kMul);
}
#include <Nazara/Core/DebugOff.hpp>

View File

@ -16,15 +16,15 @@ class NzCallOnExit
public:
NzCallOnExit(Func func = nullptr);
NzCallOnExit(const NzCallOnExit&) = delete;
NzCallOnExit(NzCallOnExit&&) = delete;
NzCallOnExit(const NzCallOnExit&) = delete;
NzCallOnExit(NzCallOnExit&&) = delete;
~NzCallOnExit();
void CallAndReset(Func func = nullptr);
void Reset(Func func = nullptr);
NzCallOnExit& operator=(const NzCallOnExit&) = delete;
NzCallOnExit& operator=(NzCallOnExit&&) = default;
NzCallOnExit& operator=(const NzCallOnExit&) = delete;
NzCallOnExit& operator=(NzCallOnExit&&) = default;
private:
Func m_func;

View File

@ -16,8 +16,8 @@ class NAZARA_CORE_API NzConditionVariable
{
public:
NzConditionVariable();
NzConditionVariable(const NzConditionVariable&) = delete;
NzConditionVariable(NzConditionVariable&&) = delete; ///TODO
NzConditionVariable(const NzConditionVariable&) = delete;
NzConditionVariable(NzConditionVariable&&) = delete; ///TODO
~NzConditionVariable();
void Signal();
@ -26,8 +26,8 @@ class NAZARA_CORE_API NzConditionVariable
void Wait(NzMutex* mutex);
bool Wait(NzMutex* mutex, nzUInt32 timeout);
NzConditionVariable& operator=(const NzConditionVariable&) = delete;
NzConditionVariable& operator=(NzConditionVariable&&) = delete; ///TODO
NzConditionVariable& operator=(const NzConditionVariable&) = delete;
NzConditionVariable& operator=(NzConditionVariable&&) = delete; ///TODO
private:
NzConditionVariableImpl* m_impl;

View File

@ -31,9 +31,9 @@ class NAZARA_CORE_API NzDirectory
{
public:
NzDirectory();
NzDirectory(const NzString& dirPath);
NzDirectory(const NzDirectory&) = delete;
NzDirectory(NzDirectory&&) = delete; ///TODO
NzDirectory(const NzString& dirPath);
NzDirectory(const NzDirectory&) = delete;
NzDirectory(NzDirectory&&) = delete; ///TODO
~NzDirectory();
void Close();
@ -64,8 +64,8 @@ class NAZARA_CORE_API NzDirectory
static bool Remove(const NzString& dirPath, bool emptyDirectory = false);
static bool SetCurrent(const NzString& dirPath);
NzDirectory& operator=(const NzDirectory&) = delete;
NzDirectory& operator=(NzDirectory&&) = delete; ///TODO
NzDirectory& operator=(const NzDirectory&) = delete;
NzDirectory& operator=(NzDirectory&&) = delete; ///TODO
private:
NazaraMutexAttrib(m_mutex, mutable)

View File

@ -34,8 +34,8 @@ class NAZARA_CORE_API NzDynLib
{
public:
NzDynLib();
NzDynLib(const NzDynLib&) = delete;
NzDynLib(NzDynLib&& lib);
NzDynLib(const NzDynLib&) = delete;
NzDynLib(NzDynLib&& lib);
~NzDynLib();
NzString GetLastError() const;
@ -46,8 +46,8 @@ class NAZARA_CORE_API NzDynLib
bool Load(const NzString& libraryPath);
void Unload();
NzDynLib& operator=(const NzDynLib&) = delete;
NzDynLib& operator=(NzDynLib&& lib);
NzDynLib& operator=(const NzDynLib&) = delete;
NzDynLib& operator=(NzDynLib&& lib);
private:
NazaraMutexAttrib(m_mutex, mutable)

View File

@ -14,16 +14,16 @@ class NAZARA_CORE_API NzErrorFlags
{
public:
NzErrorFlags(nzUInt32 flags, bool replace = false);
NzErrorFlags(const NzErrorFlags&) = delete;
NzErrorFlags(NzErrorFlags&&) = delete;
NzErrorFlags(const NzErrorFlags&) = delete;
NzErrorFlags(NzErrorFlags&&) = delete;
~NzErrorFlags();
nzUInt32 GetPreviousFlags() const;
void SetFlags(nzUInt32 flags, bool replace = false);
NzErrorFlags& operator=(const NzErrorFlags&) = delete;
NzErrorFlags& operator=(NzErrorFlags&&) = delete;
NzErrorFlags& operator=(const NzErrorFlags&) = delete;
NzErrorFlags& operator=(NzErrorFlags&&) = delete;
private:
nzUInt32 m_previousFlags;

View File

@ -32,8 +32,8 @@ class NAZARA_CORE_API NzFile : public NzHashable, public NzInputStream
NzFile();
NzFile(const NzString& filePath);
NzFile(const NzString& filePath, unsigned int openMode);
NzFile(const NzFile&) = delete;
NzFile(NzFile&& file) noexcept;
NzFile(const NzFile&) = delete;
NzFile(NzFile&& file) noexcept;
~NzFile();
bool Copy(const NzString& newFilePath);
@ -76,8 +76,8 @@ class NAZARA_CORE_API NzFile : public NzHashable, public NzInputStream
bool Write(const NzString& string);
std::size_t Write(const void* buffer, std::size_t typeSize, unsigned int count);
NzFile& operator=(const NzString& filePath);
NzFile& operator=(const NzFile&) = delete;
NzFile& operator=(const NzString& filePath);
NzFile& operator=(const NzFile&) = delete;
NzFile& operator=(NzFile&& file) noexcept;
static NzString AbsolutePath(const NzString& filePath);

View File

@ -17,14 +17,14 @@ class NAZARA_CORE_API NzHash
public:
NzHash(nzHash hash);
NzHash(NzAbstractHash* hashImpl);
NzHash(const NzHash&) = delete;
NzHash(NzHash&&) = delete; ///TODO
NzHash(const NzHash&) = delete;
NzHash(NzHash&&) = delete; ///TODO
~NzHash();
NzHashDigest Hash(const NzHashable& hashable);
NzHash& operator=(const NzHash&) = delete;
NzHash& operator=(NzHash&&) = delete; ///TODO
NzHash& operator=(const NzHash&) = delete;
NzHash& operator=(NzHash&&) = delete; ///TODO
private:
NzAbstractHash* m_impl;

View File

@ -49,12 +49,12 @@ class NAZARA_CORE_API NzLog
private:
NzLog();
NzLog(const NzLog&) = delete;
NzLog(NzLog&&) = delete;
NzLog(const NzLog&) = delete;
NzLog(NzLog&&) = delete;
~NzLog();
NzLog& operator=(const NzLog&) = delete;
NzLog& operator=(NzLog&&) = delete;
NzLog& operator=(const NzLog&) = delete;
NzLog& operator=(NzLog&&) = delete;
NazaraMutexAttrib(m_mutex, mutable)

View File

@ -17,16 +17,16 @@ class NAZARA_CORE_API NzMutex
public:
NzMutex();
NzMutex(const NzMutex&) = delete;
NzMutex(NzMutex&&) = delete; ///TODO
NzMutex(const NzMutex&) = delete;
NzMutex(NzMutex&&) = delete; ///TODO
~NzMutex();
void Lock();
bool TryLock();
void Unlock();
NzMutex& operator=(const NzMutex&) = delete;
NzMutex& operator=(NzMutex&&) = delete; ///TODO
NzMutex& operator=(const NzMutex&) = delete;
NzMutex& operator=(NzMutex&&) = delete; ///TODO
private:
NzMutexImpl* m_impl;

View File

@ -15,8 +15,8 @@ class NAZARA_CORE_API NzSemaphore
{
public:
NzSemaphore(unsigned int count);
NzSemaphore(const NzSemaphore&) = delete;
NzSemaphore(NzSemaphore&&) = delete; ///TODO
NzSemaphore(const NzSemaphore&) = delete;
NzSemaphore(NzSemaphore&&) = delete; ///TODO
~NzSemaphore();
unsigned int GetCount() const;
@ -26,8 +26,8 @@ class NAZARA_CORE_API NzSemaphore
void Wait();
bool Wait(nzUInt32 timeout);
NzSemaphore& operator=(const NzSemaphore&) = delete;
NzSemaphore& operator=(NzSemaphore&&) = delete; ///TODO
NzSemaphore& operator=(const NzSemaphore&) = delete;
NzSemaphore& operator=(NzSemaphore&&) = delete; ///TODO
private:
NzSemaphoreImpl* m_impl;

View File

@ -56,40 +56,40 @@ template<typename... Args>
template<typename O>
typename NzSignal<Args...>::Connection NzSignal<Args...>::Connect(O& object, void (O::*method) (Args...))
{
return Connect([&object, method] (Args&&... args)
{
return (object .* method) (std::forward<Args>(args)...);
});
return Connect([&object, method] (Args&&... args)
{
return (object .* method) (std::forward<Args>(args)...);
});
}
template<typename... Args>
template<typename O>
typename NzSignal<Args...>::Connection NzSignal<Args...>::Connect(O* object, void (O::*method)(Args...))
{
return Connect([object, method] (Args&&... args)
{
return (object ->* method) (std::forward<Args>(args)...);
});
return Connect([object, method] (Args&&... args)
{
return (object ->* method) (std::forward<Args>(args)...);
});
}
template<typename... Args>
template<typename O>
typename NzSignal<Args...>::Connection NzSignal<Args...>::Connect(const O& object, void (O::*method) (Args...) const)
{
return Connect([&object, method] (Args&&... args)
{
return (object .* method) (std::forward<Args>(args)...);
});
return Connect([&object, method] (Args&&... args)
{
return (object .* method) (std::forward<Args>(args)...);
});
}
template<typename... Args>
template<typename O>
typename NzSignal<Args...>::Connection NzSignal<Args...>::Connect(const O* object, void (O::*method)(Args...) const)
{
return Connect([object, method] (Args&&... args)
{
return (object ->* method) (std::forward<Args>(args)...);
});
return Connect([object, method] (Args&&... args)
{
return (object ->* method) (std::forward<Args>(args)...);
});
}
template<typename... Args>

View File

@ -22,8 +22,8 @@ class NAZARA_CORE_API NzThread
template<typename F> NzThread(F function);
template<typename F, typename... Args> NzThread(F function, Args&&... args);
template<typename C> NzThread(void (C::*function)(), C* object);
NzThread(const NzThread&) = delete;
NzThread(NzThread&& other);
NzThread(const NzThread&) = delete;
NzThread(NzThread&& other);
~NzThread();
void Detach();
@ -31,8 +31,8 @@ class NAZARA_CORE_API NzThread
bool IsJoinable() const;
void Join();
NzThread& operator=(const NzThread&) = delete;
NzThread& operator=(NzThread&& thread);
NzThread& operator=(const NzThread&) = delete;
NzThread& operator=(NzThread&& thread);
static unsigned int HardwareConcurrency();
static void Sleep(nzUInt32 milliseconds);

View File

@ -30,8 +30,8 @@ class NAZARA_GRAPHICS_API NzAbstractRenderQueue
struct SpotLight;
NzAbstractRenderQueue() = default;
NzAbstractRenderQueue(const NzAbstractRenderQueue&) = delete;
NzAbstractRenderQueue(NzAbstractRenderQueue&&) = default;
NzAbstractRenderQueue(const NzAbstractRenderQueue&) = delete;
NzAbstractRenderQueue(NzAbstractRenderQueue&&) = default;
virtual ~NzAbstractRenderQueue();
// Je ne suis vraiment pas fan du nombre de surcharges pour AddBillboards,
@ -54,8 +54,8 @@ class NAZARA_GRAPHICS_API NzAbstractRenderQueue
virtual void Clear(bool fully = false);
NzAbstractRenderQueue& operator=(const NzAbstractRenderQueue&) = delete;
NzAbstractRenderQueue& operator=(NzAbstractRenderQueue&&) = default;
NzAbstractRenderQueue& operator=(const NzAbstractRenderQueue&) = delete;
NzAbstractRenderQueue& operator=(NzAbstractRenderQueue&&) = default;
struct DirectionalLight
{

View File

@ -22,8 +22,8 @@ class NAZARA_GRAPHICS_API NzAbstractRenderTechnique
{
public:
NzAbstractRenderTechnique();
NzAbstractRenderTechnique(const NzAbstractRenderTechnique&) = delete;
NzAbstractRenderTechnique(NzAbstractRenderTechnique&&) = default;
NzAbstractRenderTechnique(const NzAbstractRenderTechnique&) = delete;
NzAbstractRenderTechnique(NzAbstractRenderTechnique&&) = default;
virtual ~NzAbstractRenderTechnique();
virtual bool Draw(const NzSceneData& sceneData) const = 0;
@ -36,8 +36,8 @@ class NAZARA_GRAPHICS_API NzAbstractRenderTechnique
virtual bool IsInstancingEnabled() const;
NzAbstractRenderTechnique& operator=(const NzAbstractRenderTechnique&) = delete;
NzAbstractRenderTechnique& operator=(NzAbstractRenderTechnique&&) = default;
NzAbstractRenderTechnique& operator=(const NzAbstractRenderTechnique&) = delete;
NzAbstractRenderTechnique& operator=(NzAbstractRenderTechnique&&) = default;
protected:
bool m_instancingEnabled;

View File

@ -30,8 +30,8 @@ class NAZARA_GRAPHICS_API NzInstancedRenderable : public NzRefCounted
struct InstanceData;
NzInstancedRenderable() = default;
inline NzInstancedRenderable(const NzInstancedRenderable& renderable);
NzInstancedRenderable(NzInstancedRenderable&& renderable) = delete;
inline NzInstancedRenderable(const NzInstancedRenderable& renderable);
NzInstancedRenderable(NzInstancedRenderable&& renderable) = delete;
virtual ~NzInstancedRenderable();
inline void EnsureBoundingVolumeUpdated() const;
@ -44,7 +44,7 @@ class NAZARA_GRAPHICS_API NzInstancedRenderable : public NzRefCounted
virtual void UpdateData(InstanceData* instanceData) const;
inline NzInstancedRenderable& operator=(const NzInstancedRenderable& renderable);
NzInstancedRenderable& operator=(NzInstancedRenderable&& renderable) = delete;
NzInstancedRenderable& operator=(NzInstancedRenderable&& renderable) = delete;
// Signals:
NazaraSignal(OnInstancedRenderableInvalidateData, const NzInstancedRenderable* /*instancedRenderable*/, nzUInt32 /*flags*/);

View File

@ -19,17 +19,17 @@ class NAZARA_GRAPHICS_API NzRenderable
public:
NzRenderable() = default;
NzRenderable(const NzRenderable& renderable) = default;
NzRenderable(NzRenderable&&) = default;
NzRenderable(NzRenderable&&) = default;
virtual ~NzRenderable();
virtual void AddToRenderQueue(NzAbstractRenderQueue* renderQueue, const NzMatrix4f& transformMatrix) const = 0;
virtual bool Cull(const NzFrustumf& frustum, const NzMatrix4f& transformMatrix) const;
inline void EnsureBoundingVolumeUpdated() const;
inline void EnsureBoundingVolumeUpdated() const;
virtual const NzBoundingVolumef& GetBoundingVolume() const;
virtual void UpdateBoundingVolume(const NzMatrix4f& transformMatrix);
NzRenderable& operator=(const NzRenderable& renderable) = default;
NzRenderable& operator=(NzRenderable&& renderable) = default;
NzRenderable& operator=(const NzRenderable& renderable) = default;
NzRenderable& operator=(NzRenderable&& renderable) = default;
protected:
virtual void MakeBoundingVolume() const = 0;

View File

@ -28,8 +28,8 @@ class NAZARA_LUA_API NzLuaInstance
{
public:
NzLuaInstance();
NzLuaInstance(const NzLuaInstance&) = delete;
NzLuaInstance(NzLuaInstance&&) = delete; ///TODO
NzLuaInstance(const NzLuaInstance&) = delete;
NzLuaInstance(NzLuaInstance&&) = delete; ///TODO
~NzLuaInstance();
void ArgCheck(bool condition, unsigned int argNum, const char* error);
@ -149,8 +149,8 @@ class NAZARA_LUA_API NzLuaInstance
void* ToUserdata(int index, const char* tname) const;
void* ToUserdata(int index, const NzString& tname) const;
NzLuaInstance& operator=(const NzLuaInstance&) = delete;
NzLuaInstance& operator=(NzLuaInstance&&) = delete; ///TODO
NzLuaInstance& operator=(const NzLuaInstance&) = delete;
NzLuaInstance& operator=(NzLuaInstance&&) = delete; ///TODO
static int GetIndexOfUpValue(int upValue);
static NzLuaInstance* GetInstance(lua_State* state);

View File

@ -160,7 +160,7 @@ void NzLuaInstance::PushFunction(R(*func)(Args...))
PushFunction([func](NzLuaInstance& instance) -> int
{
NzLuaImplFunctionProxy<Args...> handler(instance);
handler.ProcessArgs();
handler.ProcessArgs();
return handler.Invoke(func);
});

View File

@ -12,12 +12,12 @@
class NAZARA_NOISE_API NzAbstract2DNoise : public NzMappedNoiseBase
{
public:
virtual ~NzAbstract2DNoise();
public:
virtual ~NzAbstract2DNoise();
float GetBasicValue(float x, float y);
float GetMappedValue(float x, float y);
virtual float GetValue(float x, float y, float resolution) = 0;
float GetBasicValue(float x, float y);
float GetMappedValue(float x, float y);
virtual float GetValue(float x, float y, float resolution) = 0;
};
#endif // NAZARA_ABSTRACT2DNOISE_HPP

View File

@ -12,12 +12,12 @@
class NAZARA_NOISE_API NzAbstract3DNoise : public NzMappedNoiseBase
{
public:
virtual ~NzAbstract3DNoise();
public:
virtual ~NzAbstract3DNoise();
float GetBasicValue(float x, float y, float z);
float GetMappedValue(float x, float y, float z);
virtual float GetValue(float x, float y, float z, float resolution) = 0;
float GetBasicValue(float x, float y, float z);
float GetMappedValue(float x, float y, float z);
virtual float GetValue(float x, float y, float z, float resolution) = 0;
};
#endif // NAZARA_ABSTRACT3DNOISE_HPP

View File

@ -12,12 +12,12 @@
class NAZARA_NOISE_API NzAbstract4DNoise : public NzMappedNoiseBase
{
public:
virtual ~NzAbstract4DNoise();
public:
virtual ~NzAbstract4DNoise();
float GetBasicValue(float x, float y, float z, float w);
float GetMappedValue(float x, float y, float z, float w);
virtual float GetValue(float x, float y, float z, float w, float resolution) = 0;
float GetBasicValue(float x, float y, float z, float w);
float GetMappedValue(float x, float y, float z, float w);
virtual float GetValue(float x, float y, float z, float w, float resolution) = 0;
};
#endif // NAZARA_ABSTRACT4DNOISE_HPP

View File

@ -12,26 +12,27 @@
class NAZARA_NOISE_API NzComplexNoiseBase
{
public:
NzComplexNoiseBase();
~NzComplexNoiseBase() = default;
public:
NzComplexNoiseBase();
~NzComplexNoiseBase() = default;
float GetHurstParameter() const;
float GetLacunarity() const;
float GetOctaveNumber() const;
void SetHurstParameter(float h);
void SetLacunarity(float lacunarity);
void SetOctavesNumber(float octaves);
void RecomputeExponentArray();
float GetHurstParameter() const;
float GetLacunarity() const;
float GetOctaveNumber() const;
void SetHurstParameter(float h);
void SetLacunarity(float lacunarity);
void SetOctavesNumber(float octaves);
void RecomputeExponentArray();
protected:
float m_lacunarity;
float m_hurst;
float m_octaves;
std::array<float, 30> m_exponent_array;
float m_sum;
private:
bool m_parametersModified;
protected:
float m_lacunarity;
float m_hurst;
float m_octaves;
std::array<float, 30> m_exponent_array;
float m_sum;
private:
bool m_parametersModified;
};
#endif // COMPLEXNOISEBASE_HPP

View File

@ -13,16 +13,16 @@
class NAZARA_NOISE_API NzFBM2D : public NzAbstract2DNoise, public NzComplexNoiseBase
{
public:
NzFBM2D(nzNoises source, unsigned int seed);
float GetValue(float x, float y, float resolution);
~NzFBM2D();
protected:
private:
NzAbstract2DNoise* m_source;
float m_value;
float m_remainder;
nzNoises m_noiseType;
public:
NzFBM2D(nzNoises source, unsigned int seed);
float GetValue(float x, float y, float resolution);
~NzFBM2D();
private:
NzAbstract2DNoise* m_source;
float m_value;
float m_remainder;
nzNoises m_noiseType;
};
#endif // FBM2D_HPP

View File

@ -13,16 +13,16 @@
class NAZARA_NOISE_API NzFBM3D : public NzAbstract3DNoise, public NzComplexNoiseBase
{
public:
NzFBM3D(nzNoises source, unsigned int seed);
float GetValue(float x, float y, float z, float resolution);
~NzFBM3D();
protected:
private:
NzAbstract3DNoise* m_source;
float m_value;
float m_remainder;
nzNoises m_noiseType;
public:
NzFBM3D(nzNoises source, unsigned int seed);
float GetValue(float x, float y, float z, float resolution);
~NzFBM3D();
private:
NzAbstract3DNoise* m_source;
float m_value;
float m_remainder;
nzNoises m_noiseType;
};
#endif // FBM3D_HPP

View File

@ -13,16 +13,16 @@
class NAZARA_NOISE_API NzFBM4D : public NzAbstract4DNoise, public NzComplexNoiseBase
{
public:
NzFBM4D(nzNoises source, unsigned int seed);
float GetValue(float x, float y, float z, float w, float resolution);
~NzFBM4D();
protected:
private:
NzAbstract4DNoise* m_source;
float m_value;
float m_remainder;
nzNoises m_noiseType;
public:
NzFBM4D(nzNoises source, unsigned int seed);
float GetValue(float x, float y, float z, float w, float resolution);
~NzFBM4D();
private:
NzAbstract4DNoise* m_source;
float m_value;
float m_remainder;
nzNoises m_noiseType;
};
#endif // FBM4D_HPP

View File

@ -13,19 +13,19 @@
class NAZARA_NOISE_API NzHybridMultiFractal3D : public NzAbstract3DNoise, public NzComplexNoiseBase
{
public:
NzHybridMultiFractal3D(nzNoises source, unsigned int seed);
float GetValue(float x, float y, float z, float resolution);
~NzHybridMultiFractal3D();
protected:
private:
NzAbstract3DNoise* m_source;
float m_value;
float m_remainder;
float m_offset;
float m_weight;
float m_signal;
nzNoises m_noiseType;
public:
NzHybridMultiFractal3D(nzNoises source, unsigned int seed);
float GetValue(float x, float y, float z, float resolution);
~NzHybridMultiFractal3D();
protected:
private:
NzAbstract3DNoise* m_source;
float m_value;
float m_remainder;
float m_offset;
float m_weight;
float m_signal;
nzNoises m_noiseType;
};
#endif // HYBRIDMULTIFRACTAL3D_HPP

View File

@ -13,19 +13,19 @@
class NAZARA_NOISE_API NzHybridMultiFractal4D : public NzAbstract4DNoise, public NzComplexNoiseBase
{
public:
NzHybridMultiFractal4D(nzNoises source, unsigned int seed);
float GetValue(float x, float y, float z, float w, float resolution);
~NzHybridMultiFractal4D();
protected:
private:
NzAbstract4DNoise* m_source;
float m_value;
float m_remainder;
float m_offset;
float m_weight;
float m_signal;
nzNoises m_noiseType;
public:
NzHybridMultiFractal4D(nzNoises source, unsigned int seed);
float GetValue(float x, float y, float z, float w, float resolution);
~NzHybridMultiFractal4D();
protected:
private:
NzAbstract4DNoise* m_source;
float m_value;
float m_remainder;
float m_offset;
float m_weight;
float m_signal;
nzNoises m_noiseType;
};
#endif // HYBRIDMULTIFRACTAL4D_HPP

View File

@ -13,19 +13,19 @@
class NAZARA_NOISE_API NzHybridMultiFractal2D : public NzAbstract2DNoise, public NzComplexNoiseBase
{
public:
NzHybridMultiFractal2D(nzNoises source, unsigned int seed);
float GetValue(float x, float y, float resolution);
~NzHybridMultiFractal2D();
protected:
private:
NzAbstract2DNoise* m_source;
float m_value;
float m_remainder;
float m_offset;
float m_weight;
float m_signal;
nzNoises m_noiseType;
public:
NzHybridMultiFractal2D(nzNoises source, unsigned int seed);
float GetValue(float x, float y, float resolution);
~NzHybridMultiFractal2D();
private:
NzAbstract2DNoise* m_source;
float m_value;
float m_remainder;
float m_offset;
float m_weight;
float m_signal;
nzNoises m_noiseType;
};
#endif // HYBRIDMULTIFRACTAL2D_HPP

View File

@ -12,20 +12,20 @@
class NAZARA_NOISE_API NzMappedNoiseBase : public NzNoiseBase
{
public:
NzMappedNoiseBase();
~NzMappedNoiseBase() = default;
public:
NzMappedNoiseBase();
~NzMappedNoiseBase() = default;
float GetGain() const;
float GetOffset() const;
float GetResolution() const;
void SetGain(float gain);
void SetOffset(float offset);
void SetResolution(float resolution);
protected:
float m_gain;
float m_offset;
float m_resolution;
float GetGain() const;
float GetOffset() const;
float GetResolution() const;
void SetGain(float gain);
void SetOffset(float offset);
void SetResolution(float resolution);
protected:
float m_gain;
float m_offset;
float m_resolution;
};
#endif // NAZARA_MAPPEDNOISEBASE_HPP

View File

@ -12,31 +12,31 @@
enum nzNoises
{
PERLIN,
SIMPLEX,
CELL
PERLIN,
SIMPLEX,
CELL
};
class NAZARA_NOISE_API NzNoiseBase
{
public:
NzNoiseBase(unsigned int seed = 0);
~NzNoiseBase() = default;
public:
NzNoiseBase(unsigned int seed = 0);
~NzNoiseBase() = default;
void SetNewSeed(unsigned int seed);
void SetNewSeed(unsigned int seed);
void ShufflePermutationTable();
void ShufflePermutationTable();
unsigned int GetUniformRandomValue();
unsigned int GetUniformRandomValue();
int fastfloor(float n);
int JenkinsHash(int a, int b, int c);
protected:
unsigned int perm[512];
private:
unsigned int Ua, Uc, Um;
unsigned int UcurrentSeed;
unsigned int Uprevious, Ulast;
int fastfloor(float n);
int JenkinsHash(int a, int b, int c);
protected:
unsigned int perm[512];
private:
unsigned int Ua, Uc, Um;
unsigned int UcurrentSeed;
unsigned int Uprevious, Ulast;
};

View File

@ -14,21 +14,21 @@
class NAZARA_NOISE_API NzPerlin2D : public NzAbstract2DNoise
{
public:
NzPerlin2D();
NzPerlin2D(unsigned int seed);
float GetValue(float x, float y, float resolution);
~NzPerlin2D() = default;
protected:
private:
int x0, y0;
int gi0,gi1,gi2,gi3;
int ii, jj;
float gradient2[8][2];
float s,t,u,v;
float Cx,Cy;
float Li1, Li2;
NzVector2<float> temp;
public:
NzPerlin2D();
NzPerlin2D(unsigned int seed);
float GetValue(float x, float y, float resolution);
~NzPerlin2D() = default;
protected:
private:
int x0, y0;
int gi0,gi1,gi2,gi3;
int ii, jj;
float gradient2[8][2];
float s,t,u,v;
float Cx,Cy;
float Li1, Li2;
NzVector2<float> temp;
};
#endif // PERLIN2D_HPP

View File

@ -14,23 +14,23 @@
class NAZARA_NOISE_API NzPerlin3D : public NzAbstract3DNoise
{
public:
NzPerlin3D();
NzPerlin3D(unsigned int seed);
float GetValue(float x, float y, float z, float resolution);
~NzPerlin3D() = default;
protected:
private:
int x0,y0,z0;
int gi0,gi1,gi2,gi3,gi4,gi5,gi6,gi7;
int ii,jj,kk;
float gradient3[16][3];
float Li1,Li2,Li3,Li4,Li5,Li6;
float s[2],t[2],u[2],v[2];
float Cx,Cy,Cz;
float nx,ny,nz;
float tmp;
NzVector3<float> temp;
public:
NzPerlin3D();
NzPerlin3D(unsigned int seed);
float GetValue(float x, float y, float z, float resolution);
~NzPerlin3D() = default;
protected:
private:
int x0,y0,z0;
int gi0,gi1,gi2,gi3,gi4,gi5,gi6,gi7;
int ii,jj,kk;
float gradient3[16][3];
float Li1,Li2,Li3,Li4,Li5,Li6;
float s[2],t[2],u[2],v[2];
float Cx,Cy,Cz;
float nx,ny,nz;
float tmp;
NzVector3<float> temp;
};
#endif // PERLIN3D_HPP

View File

@ -14,22 +14,22 @@
class NAZARA_NOISE_API NzPerlin4D : public NzAbstract4DNoise
{
public:
NzPerlin4D();
NzPerlin4D(unsigned int seed);
float GetValue(float x, float y, float z, float w, float resolution);
~NzPerlin4D() = default;
protected:
private:
int x0,y0,z0,w0;
int gi0,gi1,gi2,gi3,gi4,gi5,gi6,gi7,gi8,gi9,gi10,gi11,gi12,gi13,gi14,gi15;
int ii,jj,kk,ll;
float gradient4[32][4];
float Li1,Li2,Li3,Li4,Li5,Li6,Li7,Li8,Li9,Li10,Li11,Li12,Li13,Li14;
float s[4],t[4],u[4],v[4];
float Cx,Cy,Cz,Cw;
float tmp;
NzVector4<float> temp;
public:
NzPerlin4D();
NzPerlin4D(unsigned int seed);
float GetValue(float x, float y, float z, float w, float resolution);
~NzPerlin4D() = default;
protected:
private:
int x0,y0,z0,w0;
int gi0,gi1,gi2,gi3,gi4,gi5,gi6,gi7,gi8,gi9,gi10,gi11,gi12,gi13,gi14,gi15;
int ii,jj,kk,ll;
float gradient4[32][4];
float Li1,Li2,Li3,Li4,Li5,Li6,Li7,Li8,Li9,Li10,Li11,Li12,Li13,Li14;
float s[4],t[4],u[4],v[4];
float Cx,Cy,Cz,Cw;
float tmp;
NzVector4<float> temp;
};
#endif // PERLIN4D_HPP

View File

@ -14,24 +14,24 @@
class NAZARA_NOISE_API NzSimplex2D : public NzAbstract2DNoise
{
public:
NzSimplex2D();
NzSimplex2D(unsigned int seed);
float GetValue(float x, float y, float resolution);
virtual ~NzSimplex2D() = default;
protected:
private:
int ii,jj;
int gi0,gi1,gi2;
NzVector2i skewedCubeOrigin,off1;
float n1,n2,n3;
float c1,c2,c3;
float gradient2[8][2];
float UnskewCoeff2D;
float SkewCoeff2D;
float sum;
NzVector2<float> unskewedCubeOrigin, unskewedDistToOrigin;
NzVector2<float> d1,d2,d3;
public:
NzSimplex2D();
NzSimplex2D(unsigned int seed);
float GetValue(float x, float y, float resolution);
virtual ~NzSimplex2D() = default;
protected:
private:
int ii,jj;
int gi0,gi1,gi2;
NzVector2i skewedCubeOrigin,off1;
float n1,n2,n3;
float c1,c2,c3;
float gradient2[8][2];
float UnskewCoeff2D;
float SkewCoeff2D;
float sum;
NzVector2<float> unskewedCubeOrigin, unskewedDistToOrigin;
NzVector2<float> d1,d2,d3;
};
#endif // SIMPLEX2D_HPP

View File

@ -14,24 +14,24 @@
class NAZARA_NOISE_API NzSimplex3D : public NzAbstract3DNoise
{
public:
NzSimplex3D();
NzSimplex3D(unsigned int seed);
float GetValue(float x, float y, float z, float resolution);
~NzSimplex3D() = default;
protected:
private:
int ii,jj,kk;
int gi0,gi1,gi2,gi3;
NzVector3i skewedCubeOrigin,off1,off2;
float n1,n2,n3,n4;
float c1,c2,c3,c4;
float gradient3[12][3];
float UnskewCoeff3D;
float SkewCoeff3D;
float sum;
NzVector3<float> unskewedCubeOrigin, unskewedDistToOrigin;
NzVector3<float> d1,d2,d3,d4;
public:
NzSimplex3D();
NzSimplex3D(unsigned int seed);
float GetValue(float x, float y, float z, float resolution);
~NzSimplex3D() = default;
protected:
private:
int ii,jj,kk;
int gi0,gi1,gi2,gi3;
NzVector3i skewedCubeOrigin,off1,off2;
float n1,n2,n3,n4;
float c1,c2,c3,c4;
float gradient3[12][3];
float UnskewCoeff3D;
float SkewCoeff3D;
float sum;
NzVector3<float> unskewedCubeOrigin, unskewedDistToOrigin;
NzVector3<float> d1,d2,d3,d4;
};
#endif // SIMPLEX3D_HPP

View File

@ -14,26 +14,26 @@
class NAZARA_NOISE_API NzSimplex4D : public NzAbstract4DNoise
{
public:
NzSimplex4D();
NzSimplex4D(unsigned int seed);
float GetValue(float x, float y, float z, float w, float resolution);
~NzSimplex4D() = default;
protected:
private:
int ii,jj,kk,ll;
int gi0,gi1,gi2,gi3,gi4;
NzVector4i skewedCubeOrigin,off1,off2,off3;
int lookupTable4D[64][4];
int c;
float n1,n2,n3,n4,n5;
float c1,c2,c3,c4,c5,c6;
float gradient4[32][4];
float UnskewCoeff4D;
float SkewCoeff4D;
float sum;
NzVector4<float> unskewedCubeOrigin, unskewedDistToOrigin;
NzVector4<float> d1,d2,d3,d4,d5;
public:
NzSimplex4D();
NzSimplex4D(unsigned int seed);
float GetValue(float x, float y, float z, float w, float resolution);
~NzSimplex4D() = default;
protected:
private:
int ii,jj,kk,ll;
int gi0,gi1,gi2,gi3,gi4;
NzVector4i skewedCubeOrigin,off1,off2,off3;
int lookupTable4D[64][4];
int c;
float n1,n2,n3,n4,n5;
float c1,c2,c3,c4,c5,c6;
float gradient4[32][4];
float UnskewCoeff4D;
float SkewCoeff4D;
float sum;
NzVector4<float> unskewedCubeOrigin, unskewedDistToOrigin;
NzVector4<float> d1,d2,d3,d4,d5;
};
#endif // SIMPLEX4D_H

View File

@ -38,8 +38,8 @@ class NAZARA_PHYSICS_API NzPhysGeom : public NzRefCounted
{
public:
NzPhysGeom() = default;
NzPhysGeom(const NzPhysGeom&) = delete;
NzPhysGeom(NzPhysGeom&&) = delete;
NzPhysGeom(const NzPhysGeom&) = delete;
NzPhysGeom(NzPhysGeom&&) = delete;
virtual ~NzPhysGeom();
NzBoxf ComputeAABB(const NzVector3f& translation, const NzQuaternionf& rotation, const NzVector3f& scale) const;
@ -50,8 +50,8 @@ class NAZARA_PHYSICS_API NzPhysGeom : public NzRefCounted
NewtonCollision* GetHandle(NzPhysWorld* world) const;
virtual nzGeomType GetType() const = 0;
NzPhysGeom& operator=(const NzPhysGeom&) = delete;
NzPhysGeom& operator=(NzPhysGeom&&) = delete;
NzPhysGeom& operator=(const NzPhysGeom&) = delete;
NzPhysGeom& operator=(NzPhysGeom&&) = delete;
static NzPhysGeomRef Build(const NzPrimitiveList& list);

View File

@ -18,8 +18,8 @@ class NAZARA_PHYSICS_API NzPhysWorld
{
public:
NzPhysWorld();
NzPhysWorld(const NzPhysWorld&) = delete;
NzPhysWorld(NzPhysWorld&&) = delete; ///TODO
NzPhysWorld(const NzPhysWorld&) = delete;
NzPhysWorld(NzPhysWorld&&) = delete; ///TODO
~NzPhysWorld();
NzVector3f GetGravity() const;
@ -32,8 +32,8 @@ class NAZARA_PHYSICS_API NzPhysWorld
void Step(float timestep);
NzPhysWorld& operator=(const NzPhysWorld&) = delete;
NzPhysWorld& operator=(NzPhysWorld&&) = delete; ///TODO
NzPhysWorld& operator=(const NzPhysWorld&) = delete;
NzPhysWorld& operator=(NzPhysWorld&&) = delete; ///TODO
private:
NzVector3f m_gravity;

View File

@ -15,8 +15,8 @@ class NAZARA_RENDERER_API NzGpuQuery
{
public:
NzGpuQuery();
NzGpuQuery(const NzGpuQuery&) = delete;
NzGpuQuery(NzGpuQuery&&) = delete; ///TODO
NzGpuQuery(const NzGpuQuery&) = delete;
NzGpuQuery(NzGpuQuery&&) = delete; ///TODO
~NzGpuQuery();
void Begin(nzGpuQueryMode mode);
@ -29,8 +29,8 @@ class NAZARA_RENDERER_API NzGpuQuery
// Fonctions OpenGL
unsigned int GetOpenGLID() const;
NzGpuQuery& operator=(const NzGpuQuery&) = delete;
NzGpuQuery& operator=(NzGpuQuery&&) = delete; ///TODO
NzGpuQuery& operator=(const NzGpuQuery&) = delete;
NzGpuQuery& operator=(NzGpuQuery&&) = delete; ///TODO
static bool IsModeSupported(nzGpuQueryMode mode);
static bool IsSupported();

View File

@ -28,8 +28,8 @@ class NAZARA_RENDERER_API NzRenderBuffer : public NzRefCounted
public:
NzRenderBuffer();
NzRenderBuffer(const NzRenderBuffer&) = delete;
NzRenderBuffer(NzRenderBuffer&&) = delete;
NzRenderBuffer(const NzRenderBuffer&) = delete;
NzRenderBuffer(NzRenderBuffer&&) = delete;
~NzRenderBuffer();
bool Create(nzPixelFormat format, unsigned int width, unsigned int height);
@ -44,8 +44,8 @@ class NAZARA_RENDERER_API NzRenderBuffer : public NzRefCounted
bool IsValid() const;
NzRenderBuffer& operator=(const NzRenderBuffer&) = delete;
NzRenderBuffer& operator=(NzRenderBuffer&&) = delete;
NzRenderBuffer& operator=(const NzRenderBuffer&) = delete;
NzRenderBuffer& operator=(NzRenderBuffer&&) = delete;
static bool IsSupported();
template<typename... Args> static NzRenderBufferRef New(Args&&... args);

View File

@ -26,8 +26,8 @@ class NAZARA_RENDERER_API NzRenderTexture : public NzRenderTarget
{
public:
inline NzRenderTexture();
NzRenderTexture(const NzRenderTexture&) = delete;
NzRenderTexture(NzRenderTexture&&) = delete; ///TODO
NzRenderTexture(const NzRenderTexture&) = delete;
NzRenderTexture(NzRenderTexture&&) = delete; ///TODO
inline ~NzRenderTexture();
bool AttachBuffer(nzAttachmentPoint attachmentPoint, nzUInt8 index, NzRenderBuffer* buffer);
@ -60,8 +60,8 @@ class NAZARA_RENDERER_API NzRenderTexture : public NzRenderTarget
unsigned int GetOpenGLID() const;
bool HasContext() const override;
NzRenderTexture& operator=(const NzRenderTexture&) = delete;
NzRenderTexture& operator=(NzRenderTexture&&) = delete; ///TODO
NzRenderTexture& operator=(const NzRenderTexture&) = delete;
NzRenderTexture& operator=(NzRenderTexture&&) = delete; ///TODO
static inline void Blit(NzRenderTexture* src, NzRenderTexture* dst, nzUInt32 buffers = nzRendererBuffer_Color | nzRendererBuffer_Depth | nzRendererBuffer_Stencil, bool bilinearFilter = false);
static void Blit(NzRenderTexture* src, NzRectui srcRect, NzRenderTexture* dst, NzRectui dstRect, nzUInt32 buffers = nzRendererBuffer_Color | nzRendererBuffer_Depth | nzRendererBuffer_Stencil, bool bilinearFilter = false);

View File

@ -36,8 +36,8 @@ class NAZARA_RENDERER_API NzShader : public NzRefCounted
public:
NzShader();
NzShader(const NzShader&) = delete;
NzShader(NzShader&&) = delete;
NzShader(const NzShader&) = delete;
NzShader(NzShader&&) = delete;
~NzShader();
void AttachStage(nzShaderStage stage, const NzShaderStage& shaderStage);
@ -99,8 +99,8 @@ class NAZARA_RENDERER_API NzShader : public NzRefCounted
// Fonctions OpenGL
unsigned int GetOpenGLID() const;
NzShader& operator=(const NzShader&) = delete;
NzShader& operator=(NzShader&&) = delete;
NzShader& operator=(const NzShader&) = delete;
NzShader& operator=(NzShader&&) = delete;
static bool IsStageSupported(nzShaderStage stage);
template<typename... Args> static NzShaderRef New(Args&&... args);

View File

@ -17,8 +17,8 @@ class NAZARA_RENDERER_API NzShaderStage
public:
NzShaderStage();
NzShaderStage(nzShaderStage stage);
NzShaderStage(const NzShaderStage&) = delete;
NzShaderStage(NzShaderStage&& stage);
NzShaderStage(const NzShaderStage&) = delete;
NzShaderStage(NzShaderStage&& stage);
~NzShaderStage();
bool Compile();
@ -36,8 +36,8 @@ class NAZARA_RENDERER_API NzShaderStage
void SetSource(const NzString& source);
bool SetSourceFromFile(const NzString& filePath);
NzShaderStage& operator=(const NzShaderStage&) = delete;
NzShaderStage& operator=(NzShaderStage&& shader);
NzShaderStage& operator=(const NzShaderStage&) = delete;
NzShaderStage& operator=(NzShaderStage&& shader);
// Fonctions OpenGL
unsigned int GetOpenGLID() const;

View File

@ -39,8 +39,8 @@ class NAZARA_RENDERER_API NzTexture : public NzAbstractImage, public NzRefCounte
NzTexture() = default;
NzTexture(nzImageType type, nzPixelFormat format, unsigned int width, unsigned int height, unsigned int depth = 1, nzUInt8 levelCount = 1);
explicit NzTexture(const NzImage& image);
NzTexture(const NzTexture&) = delete;
NzTexture(NzTexture&&) = delete;
NzTexture(const NzTexture&) = delete;
NzTexture(NzTexture&&) = delete;
~NzTexture();
bool Create(nzImageType type, nzPixelFormat format, unsigned int width, unsigned int height, unsigned int depth = 1, nzUInt8 levelCount = 1);
@ -103,8 +103,8 @@ class NAZARA_RENDERER_API NzTexture : public NzAbstractImage, public NzRefCounte
// Fonctions OpenGL
unsigned int GetOpenGLID() const;
NzTexture& operator=(const NzTexture&) = delete;
NzTexture& operator=(NzTexture&&) = delete;
NzTexture& operator=(const NzTexture&) = delete;
NzTexture& operator=(NzTexture&&) = delete;
static unsigned int GetValidSize(unsigned int size);
static bool IsFormatSupported(nzPixelFormat format);

View File

@ -30,8 +30,8 @@ class NAZARA_UTILITY_API NzBuffer : public NzRefCounted
NzBuffer(nzBufferType type);
NzBuffer(nzBufferType type, unsigned int size, nzUInt32 storage = nzDataStorage_Software, nzBufferUsage usage = nzBufferUsage_Static);
NzBuffer(const NzBuffer&) = delete;
NzBuffer(NzBuffer&&) = delete;
NzBuffer(const NzBuffer&) = delete;
NzBuffer(NzBuffer&&) = delete;
~NzBuffer();
bool CopyContent(const NzBuffer& buffer);
@ -57,8 +57,8 @@ class NAZARA_UTILITY_API NzBuffer : public NzRefCounted
void Unmap() const;
NzBuffer& operator=(const NzBuffer&) = delete;
NzBuffer& operator=(NzBuffer&&) = delete;
NzBuffer& operator=(const NzBuffer&) = delete;
NzBuffer& operator=(NzBuffer&&) = delete;
static bool IsStorageSupported(nzUInt32 storage);
template<typename... Args> static NzBufferRef New(Args&&... args);

View File

@ -44,8 +44,8 @@ class NAZARA_UTILITY_API NzFont : public NzRefCounted, public NzResource
struct SizeInfo;
NzFont();
NzFont(const NzFont&) = delete;
NzFont(NzFont&&) = delete;
NzFont(const NzFont&) = delete;
NzFont(NzFont&&) = delete;
~NzFont();
void ClearGlyphCache();
@ -82,8 +82,8 @@ class NAZARA_UTILITY_API NzFont : public NzRefCounted, public NzResource
void SetGlyphBorder(unsigned int borderSize);
void SetMinimumStepSize(unsigned int minimumStepSize);
NzFont& operator=(const NzFont&) = delete;
NzFont& operator=(NzFont&&) = delete;
NzFont& operator=(const NzFont&) = delete;
NzFont& operator=(NzFont&&) = delete;
static std::shared_ptr<NzAbstractAtlas> GetDefaultAtlas();
static NzFont* GetDefault();

View File

@ -43,7 +43,7 @@ class NAZARA_UTILITY_API NzGuillotineImageAtlas : public NzAbstractAtlas
struct QueuedGlyph
{
NzImage image;
NzImage image;
NzRectui rect;
bool flipped;
};

View File

@ -39,8 +39,8 @@ class NAZARA_UTILITY_API NzWindow
NzWindow();
NzWindow(NzVideoMode mode, const NzString& title, nzUInt32 style = nzWindowStyle_Default);
NzWindow(NzWindowHandle handle);
NzWindow(const NzWindow&) = delete;
NzWindow(NzWindow&&) = delete; ///TODO
NzWindow(const NzWindow&) = delete;
NzWindow(NzWindow&&) = delete; ///TODO
virtual ~NzWindow();
void Close();
@ -90,8 +90,8 @@ class NAZARA_UTILITY_API NzWindow
bool WaitEvent(NzEvent* event);
NzWindow& operator=(const NzWindow&) = delete;
NzWindow& operator=(NzWindow&&) = delete; ///TODO
NzWindow& operator=(const NzWindow&) = delete;
NzWindow& operator=(NzWindow&&) = delete; ///TODO
protected:
virtual bool OnWindowCreated();

View File

@ -25,21 +25,21 @@ namespace
{
sf_count_t GetSize(void* user_data)
{
NzInputStream* stream = static_cast<NzInputStream*>(user_data);
NzInputStream* stream = static_cast<NzInputStream*>(user_data);
return stream->GetSize();
}
sf_count_t Read(void* ptr, sf_count_t count, void* user_data)
{
NzInputStream* stream = static_cast<NzInputStream*>(user_data);
return static_cast<sf_count_t>(stream->Read(ptr, static_cast<std::size_t>(count)));
}
sf_count_t Read(void* ptr, sf_count_t count, void* user_data)
{
NzInputStream* stream = static_cast<NzInputStream*>(user_data);
return static_cast<sf_count_t>(stream->Read(ptr, static_cast<std::size_t>(count)));
}
sf_count_t Seek(sf_count_t offset, int whence, void* user_data)
{
NzInputStream* stream = static_cast<NzInputStream*>(user_data);
switch (whence)
{
sf_count_t Seek(sf_count_t offset, int whence, void* user_data)
{
NzInputStream* stream = static_cast<NzInputStream*>(user_data);
switch (whence)
{
case SEEK_CUR:
stream->Read(nullptr, static_cast<std::size_t>(offset));
break;
@ -54,16 +54,16 @@ namespace
default:
NazaraInternalError("Seek mode not handled");
}
}
return stream->GetCursorPos();
}
return stream->GetCursorPos();
}
sf_count_t Tell(void* user_data)
{
NzInputStream* stream = static_cast<NzInputStream*>(user_data);
return stream->GetCursorPos();
}
sf_count_t Tell(void* user_data)
{
NzInputStream* stream = static_cast<NzInputStream*>(user_data);
return stream->GetCursorPos();
}
static SF_VIRTUAL_IO callbacks = {GetSize, Seek, Read, nullptr, Tell};

View File

@ -121,28 +121,28 @@ nzUInt32 NzMusic::GetPlayingOffset() const
nzUInt32 NzMusic::GetSampleCount() const
{
#if NAZARA_AUDIO_SAFE
if (!m_impl)
{
NazaraError("Music not created");
return 0;
}
#endif
#if NAZARA_AUDIO_SAFE
if (!m_impl)
{
NazaraError("Music not created");
return 0;
}
#endif
return m_impl->stream->GetSampleCount();
return m_impl->stream->GetSampleCount();
}
nzUInt32 NzMusic::GetSampleRate() const
{
#if NAZARA_AUDIO_SAFE
if (!m_impl)
{
NazaraError("Music not created");
return 0;
}
#endif
#if NAZARA_AUDIO_SAFE
if (!m_impl)
{
NazaraError("Music not created");
return 0;
}
#endif
return m_impl->stream->GetSampleRate();
return m_impl->stream->GetSampleRate();
}
nzSoundStatus NzMusic::GetStatus() const

View File

@ -104,7 +104,7 @@ bool NzDeferredPhongLightingPass::Process(const NzSceneData& sceneData, unsigned
{
m_directionalLightShader->SendColor(m_directionalLightUniforms.locations.color, light.color);
m_directionalLightShader->SendVector(m_directionalLightUniforms.locations.factors, NzVector2f(light.ambientFactor, light.diffuseFactor));
m_directionalLightShader->SendVector(m_directionalLightUniforms.locations.parameters1, NzVector4f(light.direction));
m_directionalLightShader->SendVector(m_directionalLightUniforms.locations.parameters1, NzVector4f(light.direction));
NzRenderer::DrawFullscreenQuad();
}

View File

@ -375,8 +375,8 @@ NzDeferredRenderPass* NzDeferredRenderTechnique::ResetPass(nzRenderPassType rend
if (oldPass && !oldPass->IsEnabled())
smartPtr->Enable(false);
SetPass(renderPass, position, smartPtr.get());
return smartPtr.release();
SetPass(renderPass, position, smartPtr.get());
return smartPtr.release();
}
void NzDeferredRenderTechnique::SetPass(nzRenderPassType relativeTo, int position, NzDeferredRenderPass* pass)

View File

@ -15,13 +15,13 @@
namespace
{
struct BufferData
{
NazaraSlot(NzSkeletalMesh, OnSkeletalMeshDestroy, skeletalMeshDestroySlot);
struct BufferData
{
NazaraSlot(NzSkeletalMesh, OnSkeletalMeshDestroy, skeletalMeshDestroySlot);
NzVertexBufferRef buffer;
bool updated;
};
};
using MeshMap = std::unordered_map<const NzSkeletalMesh*, BufferData>;
@ -115,9 +115,9 @@ NzVertexBuffer* NzSkinningManager::GetBuffer(const NzSkeletalMesh* mesh, const N
NzVertexBuffer* buffer;
MeshMap& meshMap = it->second.meshMap;
MeshMap::iterator it2 = meshMap.find(mesh);
if (it2 == meshMap.end())
MeshMap& meshMap = it->second.meshMap;
MeshMap::iterator it2 = meshMap.find(mesh);
if (it2 == meshMap.end())
{
NzVertexBufferRef vertexBuffer = NzVertexBuffer::New(NzVertexDeclaration::Get(nzVertexLayout_XYZ_Normal_UV_Tangent), mesh->GetVertexCount(), nzDataStorage_Hardware, nzBufferUsage_Dynamic);

View File

@ -12,10 +12,10 @@ NzAbstract2DNoise::~NzAbstract2DNoise() = default;
float NzAbstract2DNoise::GetBasicValue(float x, float y)
{
return this->GetValue(x,y,m_resolution);
return this->GetValue(x,y,m_resolution);
}
float NzAbstract2DNoise::GetMappedValue(float x, float y)
{
return (this->GetValue(x,y,m_resolution) + m_offset) * m_gain;
return (this->GetValue(x,y,m_resolution) + m_offset) * m_gain;
}

View File

@ -12,10 +12,10 @@ NzAbstract3DNoise::~NzAbstract3DNoise() = default;
float NzAbstract3DNoise::GetBasicValue(float x, float y, float z)
{
return this->GetValue(x,y,z,m_resolution);
return this->GetValue(x,y,z,m_resolution);
}
float NzAbstract3DNoise::GetMappedValue(float x, float y, float z)
{
return (this->GetValue(x,y,z,m_resolution) + m_offset) * m_gain ;
return (this->GetValue(x,y,z,m_resolution) + m_offset) * m_gain ;
}

View File

@ -12,10 +12,10 @@ NzAbstract4DNoise::~NzAbstract4DNoise() = default;
float NzAbstract4DNoise::GetBasicValue(float x, float y, float z, float w)
{
return this->GetValue(x,y,z,w,m_resolution);
return this->GetValue(x,y,z,w,m_resolution);
}
float NzAbstract4DNoise::GetMappedValue(float x, float y, float z, float w)
{
return (this->GetValue(x,y,z,w,m_resolution) + m_offset) * m_gain ;
return (this->GetValue(x,y,z,w,m_resolution) + m_offset) * m_gain ;
}

View File

@ -10,71 +10,71 @@
NzComplexNoiseBase::NzComplexNoiseBase()
{
m_parametersModified = true;
m_lacunarity = 5.0f;
m_hurst = 1.2f;
m_octaves = 3.0f;
m_parametersModified = true;
m_lacunarity = 5.0f;
m_hurst = 1.2f;
m_octaves = 3.0f;
for (int i(0) ; i < m_octaves; ++i)
{
m_exponent_array[i] = 0;
}
for (int i(0) ; i < m_octaves; ++i)
{
m_exponent_array[i] = 0;
}
}
float NzComplexNoiseBase::GetLacunarity() const
{
return m_lacunarity;
return m_lacunarity;
}
float NzComplexNoiseBase::GetHurstParameter() const
{
return m_hurst;
return m_hurst;
}
float NzComplexNoiseBase::GetOctaveNumber() const
{
return m_octaves;
return m_octaves;
}
void NzComplexNoiseBase::SetLacunarity(float lacunarity)
{
m_lacunarity = lacunarity;
m_parametersModified = true;
m_lacunarity = lacunarity;
m_parametersModified = true;
}
void NzComplexNoiseBase::SetHurstParameter(float h)
{
m_hurst = h;
m_parametersModified = true;
m_hurst = h;
m_parametersModified = true;
}
void NzComplexNoiseBase::SetOctavesNumber(float octaves)
{
if(octaves <= 30.0f)
m_octaves = octaves;
else
m_octaves = 30.0f;
if(octaves <= 30.0f)
m_octaves = octaves;
else
m_octaves = 30.0f;
m_parametersModified = true;
m_parametersModified = true;
}
void NzComplexNoiseBase::RecomputeExponentArray()
{
if(m_parametersModified)
{
float frequency = 1.0;
m_sum = 0.f;
for (int i(0) ; i < static_cast<int>(m_octaves) ; ++i)
{
if(m_parametersModified)
{
float frequency = 1.0;
m_sum = 0.f;
for (int i(0) ; i < static_cast<int>(m_octaves) ; ++i)
{
m_exponent_array[i] = std::pow( frequency, -m_hurst );
frequency *= m_lacunarity;
m_exponent_array[i] = std::pow( frequency, -m_hurst );
frequency *= m_lacunarity;
m_sum += m_exponent_array[i];
m_sum += m_exponent_array[i];
}
m_parametersModified = false;
}
}
m_parametersModified = false;
}
}

View File

@ -11,41 +11,41 @@
NzFBM2D::NzFBM2D(nzNoises source, unsigned int seed)
{
switch(source)
{
case PERLIN:
m_source = new NzPerlin2D();
break;
switch(source)
{
case PERLIN:
m_source = new NzPerlin2D();
break;
default:
m_source = new NzSimplex2D();
break;
}
m_source->SetNewSeed(seed);
m_source->ShufflePermutationTable();
m_noiseType = source;
default:
m_source = new NzSimplex2D();
break;
}
m_source->SetNewSeed(seed);
m_source->ShufflePermutationTable();
m_noiseType = source;
}
float NzFBM2D::GetValue(float x, float y, float resolution)
{
this->RecomputeExponentArray();
this->RecomputeExponentArray();
m_value = 0.0;
m_value = 0.0;
for (int i(0); i < m_octaves; ++i)
{
m_value += m_source->GetValue(x,y,resolution) * m_exponent_array[i];
resolution *= m_lacunarity;
}
m_remainder = m_octaves - static_cast<int>(m_octaves);
for (int i(0); i < m_octaves; ++i)
{
m_value += m_source->GetValue(x,y,resolution) * m_exponent_array[i];
resolution *= m_lacunarity;
}
m_remainder = m_octaves - static_cast<int>(m_octaves);
if(!NzNumberEquals(m_remainder, static_cast<float>(0.0)))
m_value += m_remainder * m_source->GetValue(x,y,resolution) * m_exponent_array[static_cast<int>(m_octaves-1)];
if(!NzNumberEquals(m_remainder, static_cast<float>(0.0)))
m_value += m_remainder * m_source->GetValue(x,y,resolution) * m_exponent_array[static_cast<int>(m_octaves-1)];
return m_value/this->m_sum;
return m_value/this->m_sum;
}
NzFBM2D::~NzFBM2D()
{
delete m_source;
delete m_source;
}

View File

@ -11,41 +11,41 @@
NzFBM3D::NzFBM3D(nzNoises source, unsigned int seed)
{
switch(source)
{
case PERLIN:
m_source = new NzPerlin3D();
break;
switch(source)
{
case PERLIN:
m_source = new NzPerlin3D();
break;
default:
m_source = new NzSimplex3D();
break;
}
m_source->SetNewSeed(seed);
m_source->ShufflePermutationTable();
m_noiseType = source;
default:
m_source = new NzSimplex3D();
break;
}
m_source->SetNewSeed(seed);
m_source->ShufflePermutationTable();
m_noiseType = source;
}
float NzFBM3D::GetValue(float x, float y, float z, float resolution)
{
this->RecomputeExponentArray();
this->RecomputeExponentArray();
m_value = 0.0;
m_value = 0.0;
for (int i(0); i < m_octaves; ++i)
{
m_value += m_source->GetValue(x,y,z,resolution) * m_exponent_array[i];
resolution *= m_lacunarity;
}
m_remainder = m_octaves - static_cast<int>(m_octaves);
for (int i(0); i < m_octaves; ++i)
{
m_value += m_source->GetValue(x,y,z,resolution) * m_exponent_array[i];
resolution *= m_lacunarity;
}
m_remainder = m_octaves - static_cast<int>(m_octaves);
if(!NzNumberEquals(m_remainder, static_cast<float>(0.0)))
m_value += m_remainder * m_source->GetValue(x,y,z,resolution) * m_exponent_array[static_cast<int>(m_octaves-1)];
if(!NzNumberEquals(m_remainder, static_cast<float>(0.0)))
m_value += m_remainder * m_source->GetValue(x,y,z,resolution) * m_exponent_array[static_cast<int>(m_octaves-1)];
return m_value/this->m_sum;
return m_value/this->m_sum;
}
NzFBM3D::~NzFBM3D()
{
delete m_source;
delete m_source;
}

View File

@ -11,41 +11,41 @@
NzFBM4D::NzFBM4D(nzNoises source, unsigned int seed)
{
switch(source)
{
case PERLIN:
m_source = new NzPerlin4D();
break;
switch(source)
{
case PERLIN:
m_source = new NzPerlin4D();
break;
default:
m_source = new NzSimplex4D();
break;
}
m_source->SetNewSeed(seed);
m_source->ShufflePermutationTable();
m_noiseType = source;
default:
m_source = new NzSimplex4D();
break;
}
m_source->SetNewSeed(seed);
m_source->ShufflePermutationTable();
m_noiseType = source;
}
float NzFBM4D::GetValue(float x, float y, float z, float w, float resolution)
{
this->RecomputeExponentArray();
this->RecomputeExponentArray();
m_value = 0.0;
m_value = 0.0;
for (int i(0); i < m_octaves; ++i)
{
m_value += m_source->GetValue(x,y,z,w,resolution) * m_exponent_array[i];
resolution *= m_lacunarity;
}
m_remainder = m_octaves - static_cast<int>(m_octaves);
for (int i(0); i < m_octaves; ++i)
{
m_value += m_source->GetValue(x,y,z,w,resolution) * m_exponent_array[i];
resolution *= m_lacunarity;
}
m_remainder = m_octaves - static_cast<int>(m_octaves);
if(!NzNumberEquals(m_remainder, static_cast<float>(0.0)))
m_value += m_remainder * m_source->GetValue(x,y,z,w,resolution) * m_exponent_array[static_cast<int>(m_octaves-1)];
if(!NzNumberEquals(m_remainder, static_cast<float>(0.0)))
m_value += m_remainder * m_source->GetValue(x,y,z,w,resolution) * m_exponent_array[static_cast<int>(m_octaves-1)];
return m_value/this->m_sum;
return m_value/this->m_sum;
}
NzFBM4D::~NzFBM4D()
{
delete m_source;
delete m_source;
}

View File

@ -11,54 +11,54 @@
NzHybridMultiFractal3D::NzHybridMultiFractal3D(nzNoises source, unsigned int seed)
{
switch(source)
{
case PERLIN:
m_source = new NzPerlin3D();
break;
switch(source)
{
case PERLIN:
m_source = new NzPerlin3D();
break;
default:
m_source = new NzSimplex3D();
break;
}
m_source->SetNewSeed(seed);
m_source->ShufflePermutationTable();
m_noiseType = source;
default:
m_source = new NzSimplex3D();
break;
}
m_source->SetNewSeed(seed);
m_source->ShufflePermutationTable();
m_noiseType = source;
}
float NzHybridMultiFractal3D::GetValue(float x, float y, float z, float resolution)
{
this->RecomputeExponentArray();
this->RecomputeExponentArray();
m_offset = 1.0f;
m_offset = 1.0f;
m_value = (m_source->GetValue(x,y,z,resolution) + m_offset) * m_exponent_array[0];
m_weight = m_value;
m_signal = 0.f;
m_value = (m_source->GetValue(x,y,z,resolution) + m_offset) * m_exponent_array[0];
m_weight = m_value;
m_signal = 0.f;
resolution *= m_lacunarity;
resolution *= m_lacunarity;
for(int i(1) ; i < m_octaves; ++i)
{
if (m_weight > 1.f)
m_weight = 1.f;
for(int i(1) ; i < m_octaves; ++i)
{
if (m_weight > 1.f)
m_weight = 1.f;
m_signal = (m_source->GetValue(x,y,z,resolution) + m_offset) * m_exponent_array[i];
m_value += m_weight * m_signal;
m_signal = (m_source->GetValue(x,y,z,resolution) + m_offset) * m_exponent_array[i];
m_value += m_weight * m_signal;
m_weight *= m_signal;
m_weight *= m_signal;
resolution *= m_lacunarity;
}
resolution *= m_lacunarity;
}
m_remainder = m_octaves - static_cast<int>(m_octaves);
if (m_remainder > 0.f)
m_value += m_remainder * m_source->GetValue(x,y,z,resolution) * m_exponent_array[static_cast<int>(m_octaves-1)];
m_remainder = m_octaves - static_cast<int>(m_octaves);
if (m_remainder > 0.f)
m_value += m_remainder * m_source->GetValue(x,y,z,resolution) * m_exponent_array[static_cast<int>(m_octaves-1)];
return m_value/this->m_sum - m_offset;
return m_value/this->m_sum - m_offset;
}
NzHybridMultiFractal3D::~NzHybridMultiFractal3D()
{
delete m_source;
delete m_source;
}

View File

@ -11,54 +11,54 @@
NzHybridMultiFractal4D::NzHybridMultiFractal4D(nzNoises source, unsigned int seed)
{
switch(source)
{
case PERLIN:
m_source = new NzPerlin4D();
break;
switch(source)
{
case PERLIN:
m_source = new NzPerlin4D();
break;
default:
m_source = new NzSimplex4D();
break;
}
m_source->SetNewSeed(seed);
m_source->ShufflePermutationTable();
m_noiseType = source;
default:
m_source = new NzSimplex4D();
break;
}
m_source->SetNewSeed(seed);
m_source->ShufflePermutationTable();
m_noiseType = source;
}
float NzHybridMultiFractal4D::GetValue(float x, float y, float z, float w, float resolution)
{
this->RecomputeExponentArray();
this->RecomputeExponentArray();
m_offset = 1.0f;
m_offset = 1.0f;
m_value = (m_source->GetValue(x,y,z,w,resolution) + m_offset) * m_exponent_array[0];
m_weight = m_value;
m_signal = 0.f;
m_value = (m_source->GetValue(x,y,z,w,resolution) + m_offset) * m_exponent_array[0];
m_weight = m_value;
m_signal = 0.f;
resolution *= m_lacunarity;
resolution *= m_lacunarity;
for(int i(1) ; i < m_octaves; ++i)
{
if (m_weight > 1.f)
m_weight = 1.f;
for(int i(1) ; i < m_octaves; ++i)
{
if (m_weight > 1.f)
m_weight = 1.f;
m_signal = (m_source->GetValue(x,y,z,w,resolution) + m_offset) * m_exponent_array[i];
m_value += m_weight * m_signal;
m_signal = (m_source->GetValue(x,y,z,w,resolution) + m_offset) * m_exponent_array[i];
m_value += m_weight * m_signal;
m_weight *= m_signal;
m_weight *= m_signal;
resolution *= m_lacunarity;
}
resolution *= m_lacunarity;
}
m_remainder = m_octaves - static_cast<int>(m_octaves);
if (m_remainder > 0.f)
m_value += m_remainder * m_source->GetValue(x,y,z,w,resolution) * m_exponent_array[static_cast<int>(m_octaves-1)];
m_remainder = m_octaves - static_cast<int>(m_octaves);
if (m_remainder > 0.f)
m_value += m_remainder * m_source->GetValue(x,y,z,w,resolution) * m_exponent_array[static_cast<int>(m_octaves-1)];
return m_value/this->m_sum - m_offset;
return m_value/this->m_sum - m_offset;
}
NzHybridMultiFractal4D::~NzHybridMultiFractal4D()
{
delete m_source;
delete m_source;
}

View File

@ -11,54 +11,54 @@
NzHybridMultiFractal2D::NzHybridMultiFractal2D(nzNoises source, unsigned int seed)
{
switch(source)
{
case PERLIN:
m_source = new NzPerlin2D();
break;
switch(source)
{
case PERLIN:
m_source = new NzPerlin2D();
break;
default:
m_source = new NzSimplex2D();
break;
}
m_source->SetNewSeed(seed);
m_source->ShufflePermutationTable();
m_noiseType = source;
default:
m_source = new NzSimplex2D();
break;
}
m_source->SetNewSeed(seed);
m_source->ShufflePermutationTable();
m_noiseType = source;
}
float NzHybridMultiFractal2D::GetValue(float x, float y, float resolution)
{
this->RecomputeExponentArray();
this->RecomputeExponentArray();
m_offset = 1.0f;
m_offset = 1.0f;
m_value = (m_source->GetValue(x,y,resolution) + m_offset) * m_exponent_array[0];
m_weight = m_value;
m_signal = 0.f;
m_value = (m_source->GetValue(x,y,resolution) + m_offset) * m_exponent_array[0];
m_weight = m_value;
m_signal = 0.f;
resolution *= m_lacunarity;
resolution *= m_lacunarity;
for(int i(1) ; i < m_octaves; ++i)
{
if (m_weight > 1.f)
m_weight = 1.f;
for(int i(1) ; i < m_octaves; ++i)
{
if (m_weight > 1.f)
m_weight = 1.f;
m_signal = (m_source->GetValue(x,y,resolution) + m_offset) * m_exponent_array[i];
m_value += m_weight * m_signal;
m_signal = (m_source->GetValue(x,y,resolution) + m_offset) * m_exponent_array[i];
m_value += m_weight * m_signal;
m_weight *= m_signal;
m_weight *= m_signal;
resolution *= m_lacunarity;
}
resolution *= m_lacunarity;
}
m_remainder = m_octaves - static_cast<int>(m_octaves);
if (m_remainder > 0.f)
m_value += m_remainder * m_source->GetValue(x,y,resolution) * m_exponent_array[static_cast<int>(m_octaves-1)];
m_remainder = m_octaves - static_cast<int>(m_octaves);
if (m_remainder > 0.f)
m_value += m_remainder * m_source->GetValue(x,y,resolution) * m_exponent_array[static_cast<int>(m_octaves-1)];
return m_value/this->m_sum - m_offset;
return m_value/this->m_sum - m_offset;
}
NzHybridMultiFractal2D::~NzHybridMultiFractal2D()
{
delete m_source;
delete m_source;
}

View File

@ -17,37 +17,37 @@ NzMappedNoiseBase::NzMappedNoiseBase() : m_gain(1.f), m_offset(0.f), m_resolutio
float NzMappedNoiseBase::GetGain() const
{
return m_gain;
return m_gain;
}
float NzMappedNoiseBase::GetOffset() const
{
return m_offset;
return m_offset;
}
float NzMappedNoiseBase::GetResolution() const
{
return m_resolution;
return m_resolution;
}
void NzMappedNoiseBase::SetGain(float gain)
{
m_gain = gain;
m_gain = gain;
}
void NzMappedNoiseBase::SetOffset(float offset)
{
m_offset = offset;
m_offset = offset;
}
void NzMappedNoiseBase::SetResolution(float resolution)
{
if (NzNumberEquals(resolution, 0.f))
if (NzNumberEquals(resolution, 0.f))
{
NzStringStream ss;
ss << __FILE__ << ':' << __LINE__ << " : resolution cannot be 0.0f";
throw std::domain_error(ss.ToString());
}
m_resolution = resolution;
m_resolution = resolution;
}

View File

@ -9,68 +9,68 @@
NzNoiseBase::NzNoiseBase(unsigned int seed)
{
Ua = 16807;
Uc = 0;
Um = 2147483647;
UcurrentSeed = 0;
Uprevious = 0;
Ua = 16807;
Uc = 0;
Um = 2147483647;
UcurrentSeed = 0;
Uprevious = 0;
SetNewSeed(seed);
SetNewSeed(seed);
for(int i(0) ; i < 512 ; i++)
perm[i] = i & 255;
for(int i(0) ; i < 512 ; i++)
perm[i] = i & 255;
}
void NzNoiseBase::SetNewSeed(unsigned int seed)
{
Uprevious = seed;
UcurrentSeed = seed;
Uprevious = seed;
UcurrentSeed = seed;
}
unsigned int NzNoiseBase::GetUniformRandomValue()
{
Ulast = Ua*Uprevious + Uc%Um;
Uprevious = Ulast;
return Ulast;
Ulast = Ua*Uprevious + Uc%Um;
Uprevious = Ulast;
return Ulast;
}
void NzNoiseBase::ShufflePermutationTable()
{
int xchanger;
unsigned int ncase;
int xchanger;
unsigned int ncase;
for(unsigned int i(0) ; i < 256 ; i++)
perm[i] = i;
for(unsigned int i(0) ; i < 256 ; i++)
perm[i] = i;
for(unsigned int j(0) ; j < 20 ; ++j)
for (unsigned int i(0); i < 256 ; ++i)
{
ncase = this->GetUniformRandomValue() & 255;
xchanger = perm[i];
perm[i] = perm[ncase];
perm[ncase] = xchanger;
}
for(unsigned int j(0) ; j < 20 ; ++j)
for (unsigned int i(0); i < 256 ; ++i)
{
ncase = this->GetUniformRandomValue() & 255;
xchanger = perm[i];
perm[i] = perm[ncase];
perm[ncase] = xchanger;
}
for(unsigned int i(256) ; i < 512; ++i)
perm[i] = perm[i & 255];
for(unsigned int i(256) ; i < 512; ++i)
perm[i] = perm[i & 255];
}
int NzNoiseBase::fastfloor(float n)
{
return (n >= 0) ? static_cast<int>(n) : static_cast<int>(n-1);
return (n >= 0) ? static_cast<int>(n) : static_cast<int>(n-1);
}
int NzNoiseBase::JenkinsHash(int a, int b, int c)
{
a = a-b; a = a - c; a = a^(static_cast<unsigned int>(c) >> 13);
b = b-c; b = b - a; b = b^(a << 8);
c = c-a; c = c - b; c = c^(static_cast<unsigned int>(b) >> 13);
a = a-b; a = a - c; a = a^(static_cast<unsigned int>(c) >> 12);
b = b-c; b = b - a; b = b^(a << 16);
c = c-a; c = c - b; c = c^(static_cast<unsigned int>(b) >> 5);
a = a-b; a = a - c; a = a^(static_cast<unsigned int>(c) >> 3);
b = b-c; b = b - a; b = b^(a << 10);
c = c-a; c = c - b; c = c^(static_cast<unsigned int>(b) >> 15);
return c;
a = a-b; a = a - c; a = a^(static_cast<unsigned int>(c) >> 13);
b = b-c; b = b - a; b = b^(a << 8);
c = c-a; c = c - b; c = c^(static_cast<unsigned int>(b) >> 13);
a = a-b; a = a - c; a = a^(static_cast<unsigned int>(c) >> 12);
b = b-c; b = b - a; b = b^(a << 16);
c = c-a; c = c - b; c = c^(static_cast<unsigned int>(b) >> 5);
a = a-b; a = a - c; a = a^(static_cast<unsigned int>(c) >> 3);
b = b-c; b = b - a; b = b^(a << 10);
c = c-a; c = c - b; c = c^(static_cast<unsigned int>(b) >> 15);
return c;
}

View File

@ -9,7 +9,7 @@
NzPerlin2D::NzPerlin2D()
{
float grad2Temp[][2] = {
float grad2Temp[][2] = {
{1.f,1.f},
{-1.f,1.f},
{1.f,-1.f},
@ -21,52 +21,52 @@ NzPerlin2D::NzPerlin2D()
{0.f,-1.f}
};
for(int i(0) ; i < 8 ; ++i)
for(int j(0) ; j < 2 ; ++j)
gradient2[i][j] = grad2Temp[i][j];
for(int i(0) ; i < 8 ; ++i)
for(int j(0) ; j < 2 ; ++j)
gradient2[i][j] = grad2Temp[i][j];
}
NzPerlin2D::NzPerlin2D(unsigned int seed) : NzPerlin2D()
{
this->SetNewSeed(seed);
this->ShufflePermutationTable();
this->SetNewSeed(seed);
this->ShufflePermutationTable();
}
float NzPerlin2D::GetValue(float x, float y, float resolution)
{
x *= resolution;
y *= resolution;
x *= resolution;
y *= resolution;
x0 = fastfloor(x);
y0 = fastfloor(y);
x0 = fastfloor(x);
y0 = fastfloor(y);
ii = x0 & 255;
jj = y0 & 255;
ii = x0 & 255;
jj = y0 & 255;
gi0 = perm[ii + perm[jj]] & 7;
gi1 = perm[ii + 1 + perm[jj]] & 7;
gi2 = perm[ii + perm[jj + 1]] & 7;
gi3 = perm[ii + 1 + perm[jj + 1]] & 7;
gi0 = perm[ii + perm[jj]] & 7;
gi1 = perm[ii + 1 + perm[jj]] & 7;
gi2 = perm[ii + perm[jj + 1]] & 7;
gi3 = perm[ii + 1 + perm[jj + 1]] & 7;
temp.x = x-x0;
temp.y = y-y0;
temp.x = x-x0;
temp.y = y-y0;
Cx = temp.x * temp.x * temp.x * (temp.x * (temp.x * 6 - 15) + 10);
Cy = temp.y * temp.y * temp.y * (temp.y * (temp.y * 6 - 15) + 10);
Cx = temp.x * temp.x * temp.x * (temp.x * (temp.x * 6 - 15) + 10);
Cy = temp.y * temp.y * temp.y * (temp.y * (temp.y * 6 - 15) + 10);
s = gradient2[gi0][0]*temp.x + gradient2[gi0][1]*temp.y;
s = gradient2[gi0][0]*temp.x + gradient2[gi0][1]*temp.y;
temp.x = x-(x0+1);
t = gradient2[gi1][0]*temp.x + gradient2[gi1][1]*temp.y;
temp.x = x-(x0+1);
t = gradient2[gi1][0]*temp.x + gradient2[gi1][1]*temp.y;
temp.y = y-(y0+1);
v = gradient2[gi3][0]*temp.x + gradient2[gi3][1]*temp.y;
temp.y = y-(y0+1);
v = gradient2[gi3][0]*temp.x + gradient2[gi3][1]*temp.y;
temp.x = x-x0;
u = gradient2[gi2][0]*temp.x + gradient2[gi2][1]*temp.y;
temp.x = x-x0;
u = gradient2[gi2][0]*temp.x + gradient2[gi2][1]*temp.y;
Li1 = s + Cx*(t-s);
Li2 = u + Cx*(v-u);
Li1 = s + Cx*(t-s);
Li2 = u + Cx*(v-u);
return Li1 + Cy*(Li2-Li1);
return Li1 + Cy*(Li2-Li1);
}

View File

@ -9,87 +9,87 @@
NzPerlin3D::NzPerlin3D()
{
float grad3Temp[][3] = {
{1,1,0},{-1,1,0},{1,-1,0},{-1,-1,0},
{1,0,1},{-1,0,1},{1,0,-1},{-1,0,-1},
{0,1,1},{0,-1,1},{0,1,-1},{0,-1,-1},
{1,1,0},{-1,1,0},{0,-1,1},{0,-1,-1}
};
float grad3Temp[][3] = {
{1,1,0},{-1,1,0},{1,-1,0},{-1,-1,0},
{1,0,1},{-1,0,1},{1,0,-1},{-1,0,-1},
{0,1,1},{0,-1,1},{0,1,-1},{0,-1,-1},
{1,1,0},{-1,1,0},{0,-1,1},{0,-1,-1}
};
for(int i(0) ; i < 16 ; ++i)
for(int j(0) ; j < 3 ; ++j)
gradient3[i][j] = grad3Temp[i][j];
for(int i(0) ; i < 16 ; ++i)
for(int j(0) ; j < 3 ; ++j)
gradient3[i][j] = grad3Temp[i][j];
}
NzPerlin3D::NzPerlin3D(unsigned int seed) : NzPerlin3D()
{
this->SetNewSeed(seed);
this->ShufflePermutationTable();
this->SetNewSeed(seed);
this->ShufflePermutationTable();
}
float NzPerlin3D::GetValue(float x, float y, float z, float resolution)
{
x /= resolution;
y /= resolution;
z /= resolution;
x /= resolution;
y /= resolution;
z /= resolution;
x0 = fastfloor(x);
y0 = fastfloor(y);
z0 = fastfloor(z);
x0 = fastfloor(x);
y0 = fastfloor(y);
z0 = fastfloor(z);
ii = x0 & 255;
jj = y0 & 255;
kk = z0 & 255;
ii = x0 & 255;
jj = y0 & 255;
kk = z0 & 255;
gi0 = perm[ii + perm[jj + perm[kk]]] & 15;
gi1 = perm[ii + 1 + perm[jj + perm[kk]]] & 15;
gi2 = perm[ii + perm[jj + 1 + perm[kk]]] & 15;
gi3 = perm[ii + 1 + perm[jj + 1 + perm[kk]]] & 15;
gi0 = perm[ii + perm[jj + perm[kk]]] & 15;
gi1 = perm[ii + 1 + perm[jj + perm[kk]]] & 15;
gi2 = perm[ii + perm[jj + 1 + perm[kk]]] & 15;
gi3 = perm[ii + 1 + perm[jj + 1 + perm[kk]]] & 15;
gi4 = perm[ii + perm[jj + perm[kk + 1]]] & 15;
gi5 = perm[ii + 1 + perm[jj + perm[kk + 1]]] & 15;
gi6 = perm[ii + perm[jj + 1 + perm[kk + 1]]] & 15;
gi7 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1]]] & 15;
gi4 = perm[ii + perm[jj + perm[kk + 1]]] & 15;
gi5 = perm[ii + 1 + perm[jj + perm[kk + 1]]] & 15;
gi6 = perm[ii + perm[jj + 1 + perm[kk + 1]]] & 15;
gi7 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1]]] & 15;
temp.x = x-x0;
temp.y = y-y0;
temp.z = z-z0;
temp.x = x-x0;
temp.y = y-y0;
temp.z = z-z0;
Cx = temp.x * temp.x * temp.x * (temp.x * (temp.x * 6 - 15) + 10);
Cy = temp.y * temp.y * temp.y * (temp.y * (temp.y * 6 - 15) + 10);
Cz = temp.z * temp.z * temp.z * (temp.z * (temp.z * 6 - 15) + 10);
Cx = temp.x * temp.x * temp.x * (temp.x * (temp.x * 6 - 15) + 10);
Cy = temp.y * temp.y * temp.y * (temp.y * (temp.y * 6 - 15) + 10);
Cz = temp.z * temp.z * temp.z * (temp.z * (temp.z * 6 - 15) + 10);
s[0] = gradient3[gi0][0]*temp.x + gradient3[gi0][1]*temp.y + gradient3[gi0][2]*temp.z;
s[0] = gradient3[gi0][0]*temp.x + gradient3[gi0][1]*temp.y + gradient3[gi0][2]*temp.z;
temp.x = x-(x0+1);
t[0] = gradient3[gi1][0]*temp.x + gradient3[gi1][1]*temp.y + gradient3[gi1][2]*temp.z;
temp.x = x-(x0+1);
t[0] = gradient3[gi1][0]*temp.x + gradient3[gi1][1]*temp.y + gradient3[gi1][2]*temp.z;
temp.y = y-(y0+1);
v[0] = gradient3[gi3][0]*temp.x + gradient3[gi3][1]*temp.y + gradient3[gi3][2]*temp.z;
temp.y = y-(y0+1);
v[0] = gradient3[gi3][0]*temp.x + gradient3[gi3][1]*temp.y + gradient3[gi3][2]*temp.z;
temp.x = x-x0;
u[0] = gradient3[gi2][0]*temp.x + gradient3[gi2][1]*temp.y + gradient3[gi2][2]*temp.z;
temp.x = x-x0;
u[0] = gradient3[gi2][0]*temp.x + gradient3[gi2][1]*temp.y + gradient3[gi2][2]*temp.z;
temp.y = y-y0;
temp.z = z-(z0+1);
s[1] = gradient3[gi4][0]*temp.x + gradient3[gi4][1]*temp.y + gradient3[gi4][2]*temp.z;
temp.y = y-y0;
temp.z = z-(z0+1);
s[1] = gradient3[gi4][0]*temp.x + gradient3[gi4][1]*temp.y + gradient3[gi4][2]*temp.z;
temp.x = x-(x0+1);
t[1] = gradient3[gi5][0]*temp.x + gradient3[gi5][1]*temp.y + gradient3[gi5][2]*temp.z;
temp.x = x-(x0+1);
t[1] = gradient3[gi5][0]*temp.x + gradient3[gi5][1]*temp.y + gradient3[gi5][2]*temp.z;
temp.y = y-(y0+1);
v[1] = gradient3[gi7][0]*temp.x + gradient3[gi7][1]*temp.y + gradient3[gi7][2]*temp.z;
temp.y = y-(y0+1);
v[1] = gradient3[gi7][0]*temp.x + gradient3[gi7][1]*temp.y + gradient3[gi7][2]*temp.z;
temp.x = x-x0;
u[1] = gradient3[gi6][0]*temp.x + gradient3[gi6][1]*temp.y + gradient3[gi6][2]*temp.z;
temp.x = x-x0;
u[1] = gradient3[gi6][0]*temp.x + gradient3[gi6][1]*temp.y + gradient3[gi6][2]*temp.z;
Li1 = s[0] + Cx*(t[0]-s[0]);
Li2 = u[0] + Cx*(v[0]-u[0]);
Li3 = s[1] + Cx*(t[1]-s[1]);
Li4 = u[1] + Cx*(v[1]-u[1]);
Li1 = s[0] + Cx*(t[0]-s[0]);
Li2 = u[0] + Cx*(v[0]-u[0]);
Li3 = s[1] + Cx*(t[1]-s[1]);
Li4 = u[1] + Cx*(v[1]-u[1]);
Li5 = Li1 + Cy*(Li2-Li1);
Li6 = Li3 + Cy*(Li4-Li3);
Li5 = Li1 + Cy*(Li2-Li1);
Li6 = Li3 + Cy*(Li4-Li3);
return Li5 + Cz*(Li6-Li5);
return Li5 + Cz*(Li6-Li5);
}

View File

@ -9,145 +9,145 @@
NzPerlin4D::NzPerlin4D()
{
float grad4Temp[][4] =
{
{0,1,1,1}, {0,1,1,-1}, {0,1,-1,1}, {0,1,-1,-1},
{0,-1,1,1},{0,-1,1,-1},{0,-1,-1,1},{0,-1,-1,-1},
{1,0,1,1}, {1,0,1,-1}, {1,0,-1,1}, {1,0,-1,-1},
{-1,0,1,1},{-1,0,1,-1},{-1,0,-1,1},{-1,0,-1,-1},
{1,1,0,1}, {1,1,0,-1}, {1,-1,0,1}, {1,-1,0,-1},
{-1,1,0,1},{-1,1,0,-1},{-1,-1,0,1},{-1,-1,0,-1},
{1,1,1,0}, {1,1,-1,0}, {1,-1,1,0}, {1,-1,-1,0},
{-1,1,1,0},{-1,1,-1,0},{-1,-1,1,0},{-1,-1,-1,0}
};
float grad4Temp[][4] =
{
{0,1,1,1}, {0,1,1,-1}, {0,1,-1,1}, {0,1,-1,-1},
{0,-1,1,1},{0,-1,1,-1},{0,-1,-1,1},{0,-1,-1,-1},
{1,0,1,1}, {1,0,1,-1}, {1,0,-1,1}, {1,0,-1,-1},
{-1,0,1,1},{-1,0,1,-1},{-1,0,-1,1},{-1,0,-1,-1},
{1,1,0,1}, {1,1,0,-1}, {1,-1,0,1}, {1,-1,0,-1},
{-1,1,0,1},{-1,1,0,-1},{-1,-1,0,1},{-1,-1,0,-1},
{1,1,1,0}, {1,1,-1,0}, {1,-1,1,0}, {1,-1,-1,0},
{-1,1,1,0},{-1,1,-1,0},{-1,-1,1,0},{-1,-1,-1,0}
};
for(int i(0) ; i < 32 ; ++i)
for(int j(0) ; j < 4 ; ++j)
gradient4[i][j] = grad4Temp[i][j];
for(int i(0) ; i < 32 ; ++i)
for(int j(0) ; j < 4 ; ++j)
gradient4[i][j] = grad4Temp[i][j];
}
NzPerlin4D::NzPerlin4D(unsigned int seed) : NzPerlin4D()
{
this->SetNewSeed(seed);
this->ShufflePermutationTable();
this->SetNewSeed(seed);
this->ShufflePermutationTable();
}
float NzPerlin4D::GetValue(float x, float y, float z, float w, float resolution)
{
x *= resolution;
y *= resolution;
z *= resolution;
w *= resolution;
x *= resolution;
y *= resolution;
z *= resolution;
w *= resolution;
x0 = fastfloor(x);
y0 = fastfloor(y);
z0 = fastfloor(z);
w0 = fastfloor(w);
x0 = fastfloor(x);
y0 = fastfloor(y);
z0 = fastfloor(z);
w0 = fastfloor(w);
ii = x0 & 255;
jj = y0 & 255;
kk = z0 & 255;
ll = w0 & 255;
ii = x0 & 255;
jj = y0 & 255;
kk = z0 & 255;
ll = w0 & 255;
gi0 = perm[ii + perm[jj + perm[kk + perm[ll]]]] & 31;
gi1 = perm[ii + 1 + perm[jj + perm[kk + perm[ll]]]] & 31;
gi2 = perm[ii + perm[jj + 1 + perm[kk + perm[ll]]]] & 31;
gi3 = perm[ii + 1 + perm[jj + 1 + perm[kk + perm[ll]]]] & 31;
gi0 = perm[ii + perm[jj + perm[kk + perm[ll]]]] & 31;
gi1 = perm[ii + 1 + perm[jj + perm[kk + perm[ll]]]] & 31;
gi2 = perm[ii + perm[jj + 1 + perm[kk + perm[ll]]]] & 31;
gi3 = perm[ii + 1 + perm[jj + 1 + perm[kk + perm[ll]]]] & 31;
gi4 = perm[ii + perm[jj + + perm[kk + 1 + perm[ll]]]] & 31;
gi5 = perm[ii + 1 + perm[jj + + perm[kk + 1 + perm[ll]]]] & 31;
gi6 = perm[ii + perm[jj + 1 + perm[kk + 1 + perm[ll]]]] & 31;
gi7 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll]]]] & 31;
gi4 = perm[ii + perm[jj + + perm[kk + 1 + perm[ll]]]] & 31;
gi5 = perm[ii + 1 + perm[jj + + perm[kk + 1 + perm[ll]]]] & 31;
gi6 = perm[ii + perm[jj + 1 + perm[kk + 1 + perm[ll]]]] & 31;
gi7 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll]]]] & 31;
gi8 = perm[ii + perm[jj + perm[kk + perm[ll + 1]]]] & 31;
gi9 = perm[ii + 1 + perm[jj + perm[kk + perm[ll + 1]]]] & 31;
gi10 = perm[ii + perm[jj + 1 + perm[kk + perm[ll + 1]]]] & 31;
gi11 = perm[ii + 1 + perm[jj + 1 + perm[kk + perm[ll + 1]]]] & 31;
gi8 = perm[ii + perm[jj + perm[kk + perm[ll + 1]]]] & 31;
gi9 = perm[ii + 1 + perm[jj + perm[kk + perm[ll + 1]]]] & 31;
gi10 = perm[ii + perm[jj + 1 + perm[kk + perm[ll + 1]]]] & 31;
gi11 = perm[ii + 1 + perm[jj + 1 + perm[kk + perm[ll + 1]]]] & 31;
gi12 = perm[ii + perm[jj + perm[kk + 1 + perm[ll + 1]]]] & 31;
gi13 = perm[ii + 1 + perm[jj + perm[kk + 1 + perm[ll + 1]]]] & 31;
gi14 = perm[ii + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] & 31;
gi15 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] & 31;
gi12 = perm[ii + perm[jj + perm[kk + 1 + perm[ll + 1]]]] & 31;
gi13 = perm[ii + 1 + perm[jj + perm[kk + 1 + perm[ll + 1]]]] & 31;
gi14 = perm[ii + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] & 31;
gi15 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] & 31;
temp.x = x-x0;
temp.y = y-y0;
temp.z = z-z0;
temp.w = w-w0;
temp.x = x-x0;
temp.y = y-y0;
temp.z = z-z0;
temp.w = w-w0;
Cx = temp.x * temp.x * temp.x * (temp.x * (temp.x * 6 - 15) + 10);
Cy = temp.y * temp.y * temp.y * (temp.y * (temp.y * 6 - 15) + 10);
Cz = temp.z * temp.z * temp.z * (temp.z * (temp.z * 6 - 15) + 10);
Cw = temp.w * temp.w * temp.w * (temp.w * (temp.w * 6 - 15) + 10);
Cx = temp.x * temp.x * temp.x * (temp.x * (temp.x * 6 - 15) + 10);
Cy = temp.y * temp.y * temp.y * (temp.y * (temp.y * 6 - 15) + 10);
Cz = temp.z * temp.z * temp.z * (temp.z * (temp.z * 6 - 15) + 10);
Cw = temp.w * temp.w * temp.w * (temp.w * (temp.w * 6 - 15) + 10);
s[0] = gradient4[gi0][0]*temp.x + gradient4[gi0][1]*temp.y + gradient4[gi0][2]*temp.z + gradient4[gi0][3]*temp.w;
s[0] = gradient4[gi0][0]*temp.x + gradient4[gi0][1]*temp.y + gradient4[gi0][2]*temp.z + gradient4[gi0][3]*temp.w;
temp.x = x-(x0+1);
t[0] = gradient4[gi1][0]*temp.x + gradient4[gi1][1]*temp.y + gradient4[gi1][2]*temp.z + gradient4[gi1][3]*temp.w;
temp.x = x-(x0+1);
t[0] = gradient4[gi1][0]*temp.x + gradient4[gi1][1]*temp.y + gradient4[gi1][2]*temp.z + gradient4[gi1][3]*temp.w;
temp.y = y-(y0+1);
v[0] = gradient4[gi3][0]*temp.x + gradient4[gi3][1]*temp.y + gradient4[gi3][2]*temp.z + gradient4[gi3][3]*temp.w;
temp.y = y-(y0+1);
v[0] = gradient4[gi3][0]*temp.x + gradient4[gi3][1]*temp.y + gradient4[gi3][2]*temp.z + gradient4[gi3][3]*temp.w;
temp.x = x-x0;
u[0] = gradient4[gi2][0]*temp.x + gradient4[gi2][1]*temp.y + gradient4[gi2][2]*temp.z + gradient4[gi2][3]*temp.w;
temp.x = x-x0;
u[0] = gradient4[gi2][0]*temp.x + gradient4[gi2][1]*temp.y + gradient4[gi2][2]*temp.z + gradient4[gi2][3]*temp.w;
temp.y = y-y0;
temp.z = z-(z0+1);
s[1] = gradient4[gi4][0]*temp.x + gradient4[gi4][1]*temp.y + gradient4[gi4][2]*temp.z + gradient4[gi4][3]*temp.w;
temp.y = y-y0;
temp.z = z-(z0+1);
s[1] = gradient4[gi4][0]*temp.x + gradient4[gi4][1]*temp.y + gradient4[gi4][2]*temp.z + gradient4[gi4][3]*temp.w;
temp.x = x-(x0+1);
t[1] = gradient4[gi5][0]*temp.x + gradient4[gi5][1]*temp.y + gradient4[gi5][2]*temp.z + gradient4[gi5][3]*temp.w;
temp.x = x-(x0+1);
t[1] = gradient4[gi5][0]*temp.x + gradient4[gi5][1]*temp.y + gradient4[gi5][2]*temp.z + gradient4[gi5][3]*temp.w;
temp.y = y-(y0+1);
v[1] = gradient4[gi7][0]*temp.x + gradient4[gi7][1]*temp.y + gradient4[gi7][2]*temp.z + gradient4[gi7][3]*temp.w;
temp.y = y-(y0+1);
v[1] = gradient4[gi7][0]*temp.x + gradient4[gi7][1]*temp.y + gradient4[gi7][2]*temp.z + gradient4[gi7][3]*temp.w;
temp.x = x-x0;
u[1] = gradient4[gi6][0]*temp.x + gradient4[gi6][1]*temp.y + gradient4[gi6][2]*temp.z + gradient4[gi6][3]*temp.w;
temp.x = x-x0;
u[1] = gradient4[gi6][0]*temp.x + gradient4[gi6][1]*temp.y + gradient4[gi6][2]*temp.z + gradient4[gi6][3]*temp.w;
temp.y = y-y0;
temp.z = z-z0;
temp.w = w-(w0+1);
s[2] = gradient4[gi8][0]*temp.x + gradient4[gi8][1]*temp.y + gradient4[gi8][2]*temp.z + gradient4[gi8][3]*temp.w;
temp.y = y-y0;
temp.z = z-z0;
temp.w = w-(w0+1);
s[2] = gradient4[gi8][0]*temp.x + gradient4[gi8][1]*temp.y + gradient4[gi8][2]*temp.z + gradient4[gi8][3]*temp.w;
temp.x = x-(x0+1);
t[2] = gradient4[gi9][0]*temp.x + gradient4[gi9][1]*temp.y + gradient4[gi9][2]*temp.z + gradient4[gi9][3]*temp.w;
temp.x = x-(x0+1);
t[2] = gradient4[gi9][0]*temp.x + gradient4[gi9][1]*temp.y + gradient4[gi9][2]*temp.z + gradient4[gi9][3]*temp.w;
temp.y = y-(y0+1);
v[2] = gradient4[gi11][0]*temp.x + gradient4[gi11][1]*temp.y + gradient4[gi11][2]*temp.z + gradient4[gi11][3]*temp.w;
temp.y = y-(y0+1);
v[2] = gradient4[gi11][0]*temp.x + gradient4[gi11][1]*temp.y + gradient4[gi11][2]*temp.z + gradient4[gi11][3]*temp.w;
temp.x = x-x0;
u[2] = gradient4[gi10][0]*temp.x + gradient4[gi10][1]*temp.y + gradient4[gi10][2]*temp.z + gradient4[gi10][3]*temp.w;
temp.x = x-x0;
u[2] = gradient4[gi10][0]*temp.x + gradient4[gi10][1]*temp.y + gradient4[gi10][2]*temp.z + gradient4[gi10][3]*temp.w;
temp.y = y-y0;
temp.z = z-(z0+1);
s[3] = gradient4[gi12][0]*temp.x + gradient4[gi12][1]*temp.y + gradient4[gi12][2]*temp.z + gradient4[gi12][3]*temp.w;
temp.y = y-y0;
temp.z = z-(z0+1);
s[3] = gradient4[gi12][0]*temp.x + gradient4[gi12][1]*temp.y + gradient4[gi12][2]*temp.z + gradient4[gi12][3]*temp.w;
temp.x = x-(x0+1);
t[3] = gradient4[gi13][0]*temp.x + gradient4[gi13][1]*temp.y + gradient4[gi13][2]*temp.z + gradient4[gi13][3]*temp.w;
temp.x = x-(x0+1);
t[3] = gradient4[gi13][0]*temp.x + gradient4[gi13][1]*temp.y + gradient4[gi13][2]*temp.z + gradient4[gi13][3]*temp.w;
temp.y = y-(y0+1);
v[3] = gradient4[gi15][0]*temp.x + gradient4[gi15][1]*temp.y + gradient4[gi15][2]*temp.z + gradient4[gi15][3]*temp.w;
temp.y = y-(y0+1);
v[3] = gradient4[gi15][0]*temp.x + gradient4[gi15][1]*temp.y + gradient4[gi15][2]*temp.z + gradient4[gi15][3]*temp.w;
temp.x = x-x0;
u[3] = gradient4[gi14][0]*temp.x + gradient4[gi14][1]*temp.y + gradient4[gi14][2]*temp.z + gradient4[gi14][3]*temp.w;
temp.x = x-x0;
u[3] = gradient4[gi14][0]*temp.x + gradient4[gi14][1]*temp.y + gradient4[gi14][2]*temp.z + gradient4[gi14][3]*temp.w;
Li1 = s[0] + Cx*(t[0]-s[0]);
Li2 = u[0] + Cx*(v[0]-u[0]);
Li3 = s[1] + Cx*(t[1]-s[1]);
Li4 = u[1] + Cx*(v[1]-u[1]);
Li5 = s[2] + Cx*(t[2]-s[2]);
Li6 = u[2] + Cx*(v[2]-u[2]);
Li7 = s[3] + Cx*(t[3]-s[3]);
Li8 = u[3] + Cx*(v[3]-u[3]);
Li1 = s[0] + Cx*(t[0]-s[0]);
Li2 = u[0] + Cx*(v[0]-u[0]);
Li3 = s[1] + Cx*(t[1]-s[1]);
Li4 = u[1] + Cx*(v[1]-u[1]);
Li5 = s[2] + Cx*(t[2]-s[2]);
Li6 = u[2] + Cx*(v[2]-u[2]);
Li7 = s[3] + Cx*(t[3]-s[3]);
Li8 = u[3] + Cx*(v[3]-u[3]);
Li9 = Li1 + Cy*(Li2-Li1);
Li10 = Li3 + Cy*(Li4-Li3);
Li11 = Li5 + Cy*(Li6-Li5);
Li12 = Li7 + Cy*(Li8-Li7);
Li9 = Li1 + Cy*(Li2-Li1);
Li10 = Li3 + Cy*(Li4-Li3);
Li11 = Li5 + Cy*(Li6-Li5);
Li12 = Li7 + Cy*(Li8-Li7);
Li13 = Li9 + Cz*(Li10-Li9);
Li14 = Li11 + Cz*(Li12-Li11);
Li13 = Li9 + Cz*(Li10-Li9);
Li14 = Li11 + Cz*(Li12-Li11);
return Li13 + Cw*(Li14-Li13);
return Li13 + Cw*(Li14-Li13);
}

View File

@ -9,83 +9,83 @@
NzSimplex2D::NzSimplex2D()
{
float grad2Temp[][2] = {{1,1},{-1,1},{1,-1},{-1,-1},
{1,0},{-1,0},{0,1},{0,-1}};
float grad2Temp[][2] = {{1,1},{-1,1},{1,-1},{-1,-1},
{1,0},{-1,0},{0,1},{0,-1}};
for(int i(0) ; i < 8 ; ++i)
for(int j(0) ; j < 2 ; ++j)
gradient2[i][j] = grad2Temp[i][j];
for(int i(0) ; i < 8 ; ++i)
for(int j(0) ; j < 2 ; ++j)
gradient2[i][j] = grad2Temp[i][j];
SkewCoeff2D = 0.5f*(std::sqrt(3.f) - 1.f);
UnskewCoeff2D = (3.f-std::sqrt(3.f))/6.f;
SkewCoeff2D = 0.5f*(std::sqrt(3.f) - 1.f);
UnskewCoeff2D = (3.f-std::sqrt(3.f))/6.f;
}
NzSimplex2D::NzSimplex2D(unsigned int seed) : NzSimplex2D()
{
this->SetNewSeed(seed);
this->ShufflePermutationTable();
this->SetNewSeed(seed);
this->ShufflePermutationTable();
}
float NzSimplex2D::GetValue(float x, float y, float resolution)
{
x *= resolution;
y *= resolution;
x *= resolution;
y *= resolution;
sum = (x + y) * SkewCoeff2D;
skewedCubeOrigin.x = fastfloor(x + sum);
skewedCubeOrigin.y = fastfloor(y + sum);
sum = (x + y) * SkewCoeff2D;
skewedCubeOrigin.x = fastfloor(x + sum);
skewedCubeOrigin.y = fastfloor(y + sum);
sum = (skewedCubeOrigin.x + skewedCubeOrigin.y) * UnskewCoeff2D;
unskewedCubeOrigin.x = skewedCubeOrigin.x - sum;
unskewedCubeOrigin.y = skewedCubeOrigin.y - sum;
sum = (skewedCubeOrigin.x + skewedCubeOrigin.y) * UnskewCoeff2D;
unskewedCubeOrigin.x = skewedCubeOrigin.x - sum;
unskewedCubeOrigin.y = skewedCubeOrigin.y - sum;
unskewedDistToOrigin.x = x - unskewedCubeOrigin.x;
unskewedDistToOrigin.y = y - unskewedCubeOrigin.y;
unskewedDistToOrigin.x = x - unskewedCubeOrigin.x;
unskewedDistToOrigin.y = y - unskewedCubeOrigin.y;
if(unskewedDistToOrigin.x > unskewedDistToOrigin.y)
{
off1.x = 1;
off1.y = 0;
}
else
{
off1.x = 0;
off1.y = 1;
}
if(unskewedDistToOrigin.x > unskewedDistToOrigin.y)
{
off1.x = 1;
off1.y = 0;
}
else
{
off1.x = 0;
off1.y = 1;
}
d1 = - unskewedDistToOrigin;
d1 = - unskewedDistToOrigin;
d2.x = d1.x + off1.x - UnskewCoeff2D;
d2.y = d1.y + off1.y - UnskewCoeff2D;
d2.x = d1.x + off1.x - UnskewCoeff2D;
d2.y = d1.y + off1.y - UnskewCoeff2D;
d3.x = d1.x + 1.f - 2.f * UnskewCoeff2D;
d3.y = d1.y + 1.f - 2.f * UnskewCoeff2D;
d3.x = d1.x + 1.f - 2.f * UnskewCoeff2D;
d3.y = d1.y + 1.f - 2.f * UnskewCoeff2D;
ii = skewedCubeOrigin.x & 255;
jj = skewedCubeOrigin.y & 255;
ii = skewedCubeOrigin.x & 255;
jj = skewedCubeOrigin.y & 255;
gi0 = perm[ii + perm[jj ]] & 7;
gi1 = perm[ii + off1.x + perm[jj + off1.y]] & 7;
gi2 = perm[ii + 1 + perm[jj + 1 ]] & 7;
gi0 = perm[ii + perm[jj ]] & 7;
gi1 = perm[ii + off1.x + perm[jj + off1.y]] & 7;
gi2 = perm[ii + 1 + perm[jj + 1 ]] & 7;
c1 = 0.5f - d1.x * d1.x - d1.y * d1.y;
c2 = 0.5f - d2.x * d2.x - d2.y * d2.y;
c3 = 0.5f - d3.x * d3.x - d3.y * d3.y;
c1 = 0.5f - d1.x * d1.x - d1.y * d1.y;
c2 = 0.5f - d2.x * d2.x - d2.y * d2.y;
c3 = 0.5f - d3.x * d3.x - d3.y * d3.y;
if(c1 < 0)
n1 = 0;
else
n1 = c1*c1*c1*c1*(gradient2[gi0][0] * d1.x + gradient2[gi0][1] * d1.y);
if(c1 < 0)
n1 = 0;
else
n1 = c1*c1*c1*c1*(gradient2[gi0][0] * d1.x + gradient2[gi0][1] * d1.y);
if(c2 < 0)
n2 = 0;
else
n2 = c2*c2*c2*c2*(gradient2[gi1][0] * d2.x + gradient2[gi1][1] * d2.y);
if(c2 < 0)
n2 = 0;
else
n2 = c2*c2*c2*c2*(gradient2[gi1][0] * d2.x + gradient2[gi1][1] * d2.y);
if(c3 < 0)
n3 = 0;
else
n3 = c3*c3*c3*c3*(gradient2[gi2][0] * d3.x + gradient2[gi2][1] * d3.y);
if(c3 < 0)
n3 = 0;
else
n3 = c3*c3*c3*c3*(gradient2[gi2][0] * d3.x + gradient2[gi2][1] * d3.y);
return (n1+n2+n3)*70.f;
return (n1+n2+n3)*70.f;
}

View File

@ -9,10 +9,10 @@
NzSimplex3D::NzSimplex3D()
{
SkewCoeff3D = 1/3.f;
UnskewCoeff3D = 1/6.f;
SkewCoeff3D = 1/3.f;
UnskewCoeff3D = 1/6.f;
float grad3Temp[][3] = {
float grad3Temp[][3] = {
{1.f,1.f,0.f},
{-1.f,1.f,0.f},
{1.f,-1.f,0.f},
@ -29,145 +29,145 @@ NzSimplex3D::NzSimplex3D()
{0.f,-1.f,-1.f}
};
for(int i(0) ; i < 12 ; ++i)
for(int j(0) ; j < 3 ; ++j)
gradient3[i][j] = grad3Temp[i][j];
for(int i(0) ; i < 12 ; ++i)
for(int j(0) ; j < 3 ; ++j)
gradient3[i][j] = grad3Temp[i][j];
}
NzSimplex3D::NzSimplex3D(unsigned int seed) : NzSimplex3D()
{
this->SetNewSeed(seed);
this->ShufflePermutationTable();
this->SetNewSeed(seed);
this->ShufflePermutationTable();
}
float NzSimplex3D::GetValue(float x, float y, float z, float resolution)
{
x *= resolution;
y *= resolution;
z *= resolution;
x *= resolution;
y *= resolution;
z *= resolution;
sum = (x + y + z) * SkewCoeff3D;
skewedCubeOrigin.x = fastfloor(x + sum);
skewedCubeOrigin.y = fastfloor(y + sum);
skewedCubeOrigin.z = fastfloor(z + sum);
sum = (x + y + z) * SkewCoeff3D;
skewedCubeOrigin.x = fastfloor(x + sum);
skewedCubeOrigin.y = fastfloor(y + sum);
skewedCubeOrigin.z = fastfloor(z + sum);
sum = (skewedCubeOrigin.x + skewedCubeOrigin.y + skewedCubeOrigin.z) * UnskewCoeff3D;
unskewedCubeOrigin.x = skewedCubeOrigin.x - sum;
unskewedCubeOrigin.y = skewedCubeOrigin.y - sum;
unskewedCubeOrigin.z = skewedCubeOrigin.z - sum;
sum = (skewedCubeOrigin.x + skewedCubeOrigin.y + skewedCubeOrigin.z) * UnskewCoeff3D;
unskewedCubeOrigin.x = skewedCubeOrigin.x - sum;
unskewedCubeOrigin.y = skewedCubeOrigin.y - sum;
unskewedCubeOrigin.z = skewedCubeOrigin.z - sum;
unskewedDistToOrigin.x = x - unskewedCubeOrigin.x;
unskewedDistToOrigin.y = y - unskewedCubeOrigin.y;
unskewedDistToOrigin.z = z - unskewedCubeOrigin.z;
unskewedDistToOrigin.x = x - unskewedCubeOrigin.x;
unskewedDistToOrigin.y = y - unskewedCubeOrigin.y;
unskewedDistToOrigin.z = z - unskewedCubeOrigin.z;
if(unskewedDistToOrigin.x >= unskewedDistToOrigin.y)
{
if(unskewedDistToOrigin.y >= unskewedDistToOrigin.z)
{
off1.x = 1;
off1.y = 0;
off1.z = 0;
off2.x = 1;
off2.y = 1;
off2.z = 0;
}
else if(unskewedDistToOrigin.x >= unskewedDistToOrigin.z)
{
off1.x = 1;
off1.y = 0;
off1.z = 0;
off2.x = 1;
off2.y = 0;
off2.z = 1;
}
else
{
off1.x = 0;
off1.y = 0;
off1.z = 1;
off2.x = 1;
off2.y = 0;
off2.z = 1;
}
}
else
{
if(unskewedDistToOrigin.y < unskewedDistToOrigin.z)
{
off1.x = 0;
off1.y = 0;
off1.z = 1;
off2.x = 0;
off2.y = 1;
off2.z = 1;
}
else if(unskewedDistToOrigin.x < unskewedDistToOrigin.z)
{
off1.x = 0;
off1.y = 1;
off1.z = 0;
off2.x = 0;
off2.y = 1;
off2.z = 1;
}
else
{
off1.x = 0;
off1.y = 1;
off1.z = 0;
off2.x = 1;
off2.y = 1;
off2.z = 0;
}
}
if(unskewedDistToOrigin.x >= unskewedDistToOrigin.y)
{
if(unskewedDistToOrigin.y >= unskewedDistToOrigin.z)
{
off1.x = 1;
off1.y = 0;
off1.z = 0;
off2.x = 1;
off2.y = 1;
off2.z = 0;
}
else if(unskewedDistToOrigin.x >= unskewedDistToOrigin.z)
{
off1.x = 1;
off1.y = 0;
off1.z = 0;
off2.x = 1;
off2.y = 0;
off2.z = 1;
}
else
{
off1.x = 0;
off1.y = 0;
off1.z = 1;
off2.x = 1;
off2.y = 0;
off2.z = 1;
}
}
else
{
if(unskewedDistToOrigin.y < unskewedDistToOrigin.z)
{
off1.x = 0;
off1.y = 0;
off1.z = 1;
off2.x = 0;
off2.y = 1;
off2.z = 1;
}
else if(unskewedDistToOrigin.x < unskewedDistToOrigin.z)
{
off1.x = 0;
off1.y = 1;
off1.z = 0;
off2.x = 0;
off2.y = 1;
off2.z = 1;
}
else
{
off1.x = 0;
off1.y = 1;
off1.z = 0;
off2.x = 1;
off2.y = 1;
off2.z = 0;
}
}
d1 = unskewedDistToOrigin;
d1 = unskewedDistToOrigin;
d2.x = d1.x - off1.x + UnskewCoeff3D;
d2.y = d1.y - off1.y + UnskewCoeff3D;
d2.z = d1.z - off1.z + UnskewCoeff3D;
d2.x = d1.x - off1.x + UnskewCoeff3D;
d2.y = d1.y - off1.y + UnskewCoeff3D;
d2.z = d1.z - off1.z + UnskewCoeff3D;
d3.x = d1.x - off2.x + 2.f*UnskewCoeff3D;
d3.y = d1.y - off2.y + 2.f*UnskewCoeff3D;
d3.z = d1.z - off2.z + 2.f*UnskewCoeff3D;
d3.x = d1.x - off2.x + 2.f*UnskewCoeff3D;
d3.y = d1.y - off2.y + 2.f*UnskewCoeff3D;
d3.z = d1.z - off2.z + 2.f*UnskewCoeff3D;
d4.x = d1.x - 1.f + 3.f*UnskewCoeff3D;
d4.y = d1.y - 1.f + 3.f*UnskewCoeff3D;
d4.z = d1.z - 1.f + 3.f*UnskewCoeff3D;
d4.x = d1.x - 1.f + 3.f*UnskewCoeff3D;
d4.y = d1.y - 1.f + 3.f*UnskewCoeff3D;
d4.z = d1.z - 1.f + 3.f*UnskewCoeff3D;
ii = skewedCubeOrigin.x & 255;
jj = skewedCubeOrigin.y & 255;
kk = skewedCubeOrigin.z & 255;
ii = skewedCubeOrigin.x & 255;
jj = skewedCubeOrigin.y & 255;
kk = skewedCubeOrigin.z & 255;
gi0 = perm[ii + perm[jj + perm[kk ]]] % 12;
gi1 = perm[ii + off1.x + perm[jj + off1.y + perm[kk + off1.z]]] % 12;
gi2 = perm[ii + off2.x + perm[jj + off2.y + perm[kk + off2.z]]] % 12;
gi3 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1 ]]] % 12;
gi0 = perm[ii + perm[jj + perm[kk ]]] % 12;
gi1 = perm[ii + off1.x + perm[jj + off1.y + perm[kk + off1.z]]] % 12;
gi2 = perm[ii + off2.x + perm[jj + off2.y + perm[kk + off2.z]]] % 12;
gi3 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1 ]]] % 12;
c1 = 0.6f - d1.x * d1.x - d1.y * d1.y - d1.z * d1.z;
c2 = 0.6f - d2.x * d2.x - d2.y * d2.y - d2.z * d2.z;
c3 = 0.6f - d3.x * d3.x - d3.y * d3.y - d3.z * d3.z;
c4 = 0.6f - d4.x * d4.x - d4.y * d4.y - d4.z * d4.z;
c1 = 0.6f - d1.x * d1.x - d1.y * d1.y - d1.z * d1.z;
c2 = 0.6f - d2.x * d2.x - d2.y * d2.y - d2.z * d2.z;
c3 = 0.6f - d3.x * d3.x - d3.y * d3.y - d3.z * d3.z;
c4 = 0.6f - d4.x * d4.x - d4.y * d4.y - d4.z * d4.z;
if(c1 < 0)
n1 = 0;
else
n1 = c1*c1*c1*c1*(gradient3[gi0][0] * d1.x + gradient3[gi0][1] * d1.y + gradient3[gi0][2] * d1.z);
if(c1 < 0)
n1 = 0;
else
n1 = c1*c1*c1*c1*(gradient3[gi0][0] * d1.x + gradient3[gi0][1] * d1.y + gradient3[gi0][2] * d1.z);
if(c2 < 0)
n2 = 0;
else
n2 = c2*c2*c2*c2*(gradient3[gi1][0] * d2.x + gradient3[gi1][1] * d2.y + gradient3[gi1][2] * d2.z);
if(c2 < 0)
n2 = 0;
else
n2 = c2*c2*c2*c2*(gradient3[gi1][0] * d2.x + gradient3[gi1][1] * d2.y + gradient3[gi1][2] * d2.z);
if(c3 < 0)
n3 = 0;
else
n3 = c3*c3*c3*c3*(gradient3[gi2][0] * d3.x + gradient3[gi2][1] * d3.y + gradient3[gi2][2] * d3.z);
if(c3 < 0)
n3 = 0;
else
n3 = c3*c3*c3*c3*(gradient3[gi2][0] * d3.x + gradient3[gi2][1] * d3.y + gradient3[gi2][2] * d3.z);
if(c4 < 0)
n4 = 0;
else
n4 = c4*c4*c4*c4*(gradient3[gi3][0] * d4.x + gradient3[gi3][1] * d4.y + gradient3[gi3][2] * d4.z);
if(c4 < 0)
n4 = 0;
else
n4 = c4*c4*c4*c4*(gradient3[gi3][0] * d4.x + gradient3[gi3][1] * d4.y + gradient3[gi3][2] * d4.z);
return (n1+n2+n3+n4)*32;
return (n1+n2+n3+n4)*32;
}

View File

@ -9,158 +9,158 @@
NzSimplex4D::NzSimplex4D()
{
SkewCoeff4D = (std::sqrt(5.f) - 1.f)/4.f;
UnskewCoeff4D = (5.f - std::sqrt(5.f))/20.f;
SkewCoeff4D = (std::sqrt(5.f) - 1.f)/4.f;
UnskewCoeff4D = (5.f - std::sqrt(5.f))/20.f;
int lookupTemp4D[][4] =
{
{0,1,2,3},{0,1,3,2},{0,0,0,0},{0,2,3,1},{0,0,0,0},{0,0,0,0},{0,0,0,0},{1,2,3,0},
{0,2,1,3},{0,0,0,0},{0,3,1,2},{0,3,2,1},{0,0,0,0},{0,0,0,0},{0,0,0,0},{1,3,2,0},
{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},
{1,2,0,3},{0,0,0,0},{1,3,0,2},{0,0,0,0},{0,0,0,0},{0,0,0,0},{2,3,0,1},{2,3,1,0},
{1,0,2,3},{1,0,3,2},{0,0,0,0},{0,0,0,0},{0,0,0,0},{2,0,3,1},{0,0,0,0},{2,1,3,0},
{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},
{2,0,1,3},{0,0,0,0},{0,0,0,0},{0,0,0,0},{3,0,1,2},{3,0,2,1},{0,0,0,0},{3,1,2,0},
{2,1,0,3},{0,0,0,0},{0,0,0,0},{0,0,0,0},{3,1,0,2},{0,0,0,0},{3,2,0,1},{3,2,1,0}
};
int lookupTemp4D[][4] =
{
{0,1,2,3},{0,1,3,2},{0,0,0,0},{0,2,3,1},{0,0,0,0},{0,0,0,0},{0,0,0,0},{1,2,3,0},
{0,2,1,3},{0,0,0,0},{0,3,1,2},{0,3,2,1},{0,0,0,0},{0,0,0,0},{0,0,0,0},{1,3,2,0},
{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},
{1,2,0,3},{0,0,0,0},{1,3,0,2},{0,0,0,0},{0,0,0,0},{0,0,0,0},{2,3,0,1},{2,3,1,0},
{1,0,2,3},{1,0,3,2},{0,0,0,0},{0,0,0,0},{0,0,0,0},{2,0,3,1},{0,0,0,0},{2,1,3,0},
{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},
{2,0,1,3},{0,0,0,0},{0,0,0,0},{0,0,0,0},{3,0,1,2},{3,0,2,1},{0,0,0,0},{3,1,2,0},
{2,1,0,3},{0,0,0,0},{0,0,0,0},{0,0,0,0},{3,1,0,2},{0,0,0,0},{3,2,0,1},{3,2,1,0}
};
for(int i(0) ; i < 64 ; ++i)
for(int j(0) ; j < 4 ; ++j)
lookupTable4D[i][j] = lookupTemp4D[i][j];
for(int i(0) ; i < 64 ; ++i)
for(int j(0) ; j < 4 ; ++j)
lookupTable4D[i][j] = lookupTemp4D[i][j];
float grad4Temp[][4] =
{
{0.f,1.f,1.f,1.f}, {0.f,1.f,1.f,-1.f}, {0.f,1.f,-1.f,1.f}, {0.f,1.f,-1.f,-1.f},
{0.f,-1.f,1.f,1.f},{0.f,-1.f,1.f,-1.f},{0.f,-1.f,-1.f,1.f},{0.f,-1.f,-1.f,-1.f},
{1.f,0.f,1.f,1.f}, {1.f,0.f,1.f,-1.f}, {1.f,0.f,-1.f,1.f}, {1.f,0.f,-1.f,-1.f},
{-1.f,0.f,1.f,1.f},{-1.f,0.f,1.f,-1.f},{-1.f,0.f,-1.f,1.f},{-1.f,0.f,-1.f,-1.f},
{1.f,1.f,0.f,1.f}, {1.f,1.f,0.f,-1.f}, {1.f,-1.f,0.f,1.f}, {1.f,-1.f,0.f,-1.f},
{-1.f,1.f,0.f,1.f},{-1.f,1.f,0.f,-1.f},{-1.f,-1.f,0.f,1.f},{-1.f,-1.f,0.f,-1.f},
{1.f,1.f,1.f,0.f}, {1.f,1.f,-1.f,0.f}, {1.f,-1.f,1.f,0.f}, {1.f,-1.f,-1.f,0.f},
{-1.f,1.f,1.f,0.f},{-1.f,1.f,-1.f,0.f},{-1.f,-1.f,1.f,0.f},{-1.f,-1.f,-1.f,0.f}
};
float grad4Temp[][4] =
{
{0.f,1.f,1.f,1.f}, {0.f,1.f,1.f,-1.f}, {0.f,1.f,-1.f,1.f}, {0.f,1.f,-1.f,-1.f},
{0.f,-1.f,1.f,1.f},{0.f,-1.f,1.f,-1.f},{0.f,-1.f,-1.f,1.f},{0.f,-1.f,-1.f,-1.f},
{1.f,0.f,1.f,1.f}, {1.f,0.f,1.f,-1.f}, {1.f,0.f,-1.f,1.f}, {1.f,0.f,-1.f,-1.f},
{-1.f,0.f,1.f,1.f},{-1.f,0.f,1.f,-1.f},{-1.f,0.f,-1.f,1.f},{-1.f,0.f,-1.f,-1.f},
{1.f,1.f,0.f,1.f}, {1.f,1.f,0.f,-1.f}, {1.f,-1.f,0.f,1.f}, {1.f,-1.f,0.f,-1.f},
{-1.f,1.f,0.f,1.f},{-1.f,1.f,0.f,-1.f},{-1.f,-1.f,0.f,1.f},{-1.f,-1.f,0.f,-1.f},
{1.f,1.f,1.f,0.f}, {1.f,1.f,-1.f,0.f}, {1.f,-1.f,1.f,0.f}, {1.f,-1.f,-1.f,0.f},
{-1.f,1.f,1.f,0.f},{-1.f,1.f,-1.f,0.f},{-1.f,-1.f,1.f,0.f},{-1.f,-1.f,-1.f,0.f}
};
for(int i(0) ; i < 32 ; ++i)
for(int j(0) ; j < 4 ; ++j)
gradient4[i][j] = grad4Temp[i][j];
for(int i(0) ; i < 32 ; ++i)
for(int j(0) ; j < 4 ; ++j)
gradient4[i][j] = grad4Temp[i][j];
}
NzSimplex4D::NzSimplex4D(unsigned int seed) : NzSimplex4D()
{
this->SetNewSeed(seed);
this->ShufflePermutationTable();
this->SetNewSeed(seed);
this->ShufflePermutationTable();
}
float NzSimplex4D::GetValue(float x, float y, float z, float w, float resolution)
{
x *= resolution;
y *= resolution;
z *= resolution;
w *= resolution;
x *= resolution;
y *= resolution;
z *= resolution;
w *= resolution;
sum = (x + y + z + w) * SkewCoeff4D;
skewedCubeOrigin.x = fastfloor(x + sum);
skewedCubeOrigin.y = fastfloor(y + sum);
skewedCubeOrigin.z = fastfloor(z + sum);
skewedCubeOrigin.w = fastfloor(w + sum);
sum = (x + y + z + w) * SkewCoeff4D;
skewedCubeOrigin.x = fastfloor(x + sum);
skewedCubeOrigin.y = fastfloor(y + sum);
skewedCubeOrigin.z = fastfloor(z + sum);
skewedCubeOrigin.w = fastfloor(w + sum);
sum = (skewedCubeOrigin.x + skewedCubeOrigin.y + skewedCubeOrigin.z + skewedCubeOrigin.w) * UnskewCoeff4D;
unskewedCubeOrigin.x = skewedCubeOrigin.x - sum;
unskewedCubeOrigin.y = skewedCubeOrigin.y - sum;
unskewedCubeOrigin.z = skewedCubeOrigin.z - sum;
unskewedCubeOrigin.w = skewedCubeOrigin.w - sum;
sum = (skewedCubeOrigin.x + skewedCubeOrigin.y + skewedCubeOrigin.z + skewedCubeOrigin.w) * UnskewCoeff4D;
unskewedCubeOrigin.x = skewedCubeOrigin.x - sum;
unskewedCubeOrigin.y = skewedCubeOrigin.y - sum;
unskewedCubeOrigin.z = skewedCubeOrigin.z - sum;
unskewedCubeOrigin.w = skewedCubeOrigin.w - sum;
unskewedDistToOrigin.x = x - unskewedCubeOrigin.x;
unskewedDistToOrigin.y = y - unskewedCubeOrigin.y;
unskewedDistToOrigin.z = z - unskewedCubeOrigin.z;
unskewedDistToOrigin.w = w - unskewedCubeOrigin.w;
unskewedDistToOrigin.x = x - unskewedCubeOrigin.x;
unskewedDistToOrigin.y = y - unskewedCubeOrigin.y;
unskewedDistToOrigin.z = z - unskewedCubeOrigin.z;
unskewedDistToOrigin.w = w - unskewedCubeOrigin.w;
c1 = (unskewedDistToOrigin.x > unskewedDistToOrigin.y) ? 32 : 0;
c2 = (unskewedDistToOrigin.x > unskewedDistToOrigin.z) ? 16 : 0;
c3 = (unskewedDistToOrigin.y > unskewedDistToOrigin.z) ? 8 : 0;
c4 = (unskewedDistToOrigin.x > unskewedDistToOrigin.w) ? 4 : 0;
c5 = (unskewedDistToOrigin.y > unskewedDistToOrigin.w) ? 2 : 0;
c6 = (unskewedDistToOrigin.z > unskewedDistToOrigin.w) ? 1 : 0;
c = c1 + c2 + c3 + c4 + c5 + c6;
c1 = (unskewedDistToOrigin.x > unskewedDistToOrigin.y) ? 32 : 0;
c2 = (unskewedDistToOrigin.x > unskewedDistToOrigin.z) ? 16 : 0;
c3 = (unskewedDistToOrigin.y > unskewedDistToOrigin.z) ? 8 : 0;
c4 = (unskewedDistToOrigin.x > unskewedDistToOrigin.w) ? 4 : 0;
c5 = (unskewedDistToOrigin.y > unskewedDistToOrigin.w) ? 2 : 0;
c6 = (unskewedDistToOrigin.z > unskewedDistToOrigin.w) ? 1 : 0;
c = c1 + c2 + c3 + c4 + c5 + c6;
off1.x = lookupTable4D[c][0] >= 3 ? 1 : 0;
off1.y = lookupTable4D[c][1] >= 3 ? 1 : 0;
off1.z = lookupTable4D[c][2] >= 3 ? 1 : 0;
off1.w = lookupTable4D[c][3] >= 3 ? 1 : 0;
off1.x = lookupTable4D[c][0] >= 3 ? 1 : 0;
off1.y = lookupTable4D[c][1] >= 3 ? 1 : 0;
off1.z = lookupTable4D[c][2] >= 3 ? 1 : 0;
off1.w = lookupTable4D[c][3] >= 3 ? 1 : 0;
off2.x = lookupTable4D[c][0] >= 2 ? 1 : 0;
off2.y = lookupTable4D[c][1] >= 2 ? 1 : 0;
off2.z = lookupTable4D[c][2] >= 2 ? 1 : 0;
off2.w = lookupTable4D[c][3] >= 2 ? 1 : 0;
off2.x = lookupTable4D[c][0] >= 2 ? 1 : 0;
off2.y = lookupTable4D[c][1] >= 2 ? 1 : 0;
off2.z = lookupTable4D[c][2] >= 2 ? 1 : 0;
off2.w = lookupTable4D[c][3] >= 2 ? 1 : 0;
off3.x = lookupTable4D[c][0] >= 1 ? 1 : 0;
off3.y = lookupTable4D[c][1] >= 1 ? 1 : 0;
off3.z = lookupTable4D[c][2] >= 1 ? 1 : 0;
off3.w = lookupTable4D[c][3] >= 1 ? 1 : 0;
off3.x = lookupTable4D[c][0] >= 1 ? 1 : 0;
off3.y = lookupTable4D[c][1] >= 1 ? 1 : 0;
off3.z = lookupTable4D[c][2] >= 1 ? 1 : 0;
off3.w = lookupTable4D[c][3] >= 1 ? 1 : 0;
d1 = unskewedDistToOrigin;
d1 = unskewedDistToOrigin;
d2.x = d1.x - off1.x + UnskewCoeff4D;
d2.y = d1.y - off1.y + UnskewCoeff4D;
d2.z = d1.z - off1.z + UnskewCoeff4D;
d2.w = d1.w - off1.w + UnskewCoeff4D;
d2.x = d1.x - off1.x + UnskewCoeff4D;
d2.y = d1.y - off1.y + UnskewCoeff4D;
d2.z = d1.z - off1.z + UnskewCoeff4D;
d2.w = d1.w - off1.w + UnskewCoeff4D;
d3.x = d1.x - off2.x + 2.f*UnskewCoeff4D;
d3.y = d1.y - off2.y + 2.f*UnskewCoeff4D;
d3.z = d1.z - off2.z + 2.f*UnskewCoeff4D;
d3.w = d1.w - off2.w + 2.f*UnskewCoeff4D;
d3.x = d1.x - off2.x + 2.f*UnskewCoeff4D;
d3.y = d1.y - off2.y + 2.f*UnskewCoeff4D;
d3.z = d1.z - off2.z + 2.f*UnskewCoeff4D;
d3.w = d1.w - off2.w + 2.f*UnskewCoeff4D;
d4.x = d1.x - off3.x + 3.f*UnskewCoeff4D;
d4.y = d1.y - off3.y + 3.f*UnskewCoeff4D;
d4.z = d1.z - off3.z + 3.f*UnskewCoeff4D;
d4.w = d1.w - off3.w + 3.f*UnskewCoeff4D;
d4.x = d1.x - off3.x + 3.f*UnskewCoeff4D;
d4.y = d1.y - off3.y + 3.f*UnskewCoeff4D;
d4.z = d1.z - off3.z + 3.f*UnskewCoeff4D;
d4.w = d1.w - off3.w + 3.f*UnskewCoeff4D;
d5.x = d1.x - 1.f + 4*UnskewCoeff4D;
d5.y = d1.y - 1.f + 4*UnskewCoeff4D;
d5.z = d1.z - 1.f + 4*UnskewCoeff4D;
d5.w = d1.w - 1.f + 4*UnskewCoeff4D;
d5.x = d1.x - 1.f + 4*UnskewCoeff4D;
d5.y = d1.y - 1.f + 4*UnskewCoeff4D;
d5.z = d1.z - 1.f + 4*UnskewCoeff4D;
d5.w = d1.w - 1.f + 4*UnskewCoeff4D;
ii = skewedCubeOrigin.x & 255;
jj = skewedCubeOrigin.y & 255;
kk = skewedCubeOrigin.z & 255;
ll = skewedCubeOrigin.w & 255;
ii = skewedCubeOrigin.x & 255;
jj = skewedCubeOrigin.y & 255;
kk = skewedCubeOrigin.z & 255;
ll = skewedCubeOrigin.w & 255;
gi0 = perm[ii + perm[jj + perm[kk + perm[ll]]]] & 31;
gi1 = perm[ii + off1.x + perm[jj + off1.y + perm[kk + off1.z + perm[ll + off1.w]]]] & 31;
gi2 = perm[ii + off2.x + perm[jj + off2.y + perm[kk + off2.z + perm[ll + off2.w]]]] & 31;
gi3 = perm[ii + off3.x + perm[jj + off3.y + perm[kk + off3.z + perm[ll + off3.w]]]] & 31;
gi4 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32;
gi0 = perm[ii + perm[jj + perm[kk + perm[ll]]]] & 31;
gi1 = perm[ii + off1.x + perm[jj + off1.y + perm[kk + off1.z + perm[ll + off1.w]]]] & 31;
gi2 = perm[ii + off2.x + perm[jj + off2.y + perm[kk + off2.z + perm[ll + off2.w]]]] & 31;
gi3 = perm[ii + off3.x + perm[jj + off3.y + perm[kk + off3.z + perm[ll + off3.w]]]] & 31;
gi4 = perm[ii + 1 + perm[jj + 1 + perm[kk + 1 + perm[ll + 1]]]] % 32;
c1 = 0.6f - d1.x*d1.x - d1.y*d1.y - d1.z*d1.z - d1.w*d1.w;
c2 = 0.6f - d2.x*d2.x - d2.y*d2.y - d2.z*d2.z - d2.w*d2.w;
c3 = 0.6f - d3.x*d3.x - d3.y*d3.y - d3.z*d3.z - d3.w*d3.w;
c4 = 0.6f - d4.x*d4.x - d4.y*d4.y - d4.z*d4.z - d4.w*d4.w;
c5 = 0.6f - d5.x*d5.x - d5.y*d5.y - d5.z*d5.z - d5.w*d5.w;
c1 = 0.6f - d1.x*d1.x - d1.y*d1.y - d1.z*d1.z - d1.w*d1.w;
c2 = 0.6f - d2.x*d2.x - d2.y*d2.y - d2.z*d2.z - d2.w*d2.w;
c3 = 0.6f - d3.x*d3.x - d3.y*d3.y - d3.z*d3.z - d3.w*d3.w;
c4 = 0.6f - d4.x*d4.x - d4.y*d4.y - d4.z*d4.z - d4.w*d4.w;
c5 = 0.6f - d5.x*d5.x - d5.y*d5.y - d5.z*d5.z - d5.w*d5.w;
if(c1 < 0)
n1 = 0;
else
n1 = c1*c1*c1*c1*(gradient4[gi0][0]*d1.x + gradient4[gi0][1]*d1.y + gradient4[gi0][2]*d1.z + gradient4[gi0][3]*d1.w);
if(c1 < 0)
n1 = 0;
else
n1 = c1*c1*c1*c1*(gradient4[gi0][0]*d1.x + gradient4[gi0][1]*d1.y + gradient4[gi0][2]*d1.z + gradient4[gi0][3]*d1.w);
if(c2 < 0)
n2 = 0;
else
n2 = c2*c2*c2*c2*(gradient4[gi1][0]*d2.x + gradient4[gi1][1]*d2.y + gradient4[gi1][2]*d2.z + gradient4[gi1][3]*d2.w);
if(c2 < 0)
n2 = 0;
else
n2 = c2*c2*c2*c2*(gradient4[gi1][0]*d2.x + gradient4[gi1][1]*d2.y + gradient4[gi1][2]*d2.z + gradient4[gi1][3]*d2.w);
if(c3 < 0)
n3 = 0;
else
n3 = c3*c3*c3*c3*(gradient4[gi2][0]*d3.x + gradient4[gi2][1]*d3.y + gradient4[gi2][2]*d3.z + gradient4[gi2][3]*d3.w);
if(c3 < 0)
n3 = 0;
else
n3 = c3*c3*c3*c3*(gradient4[gi2][0]*d3.x + gradient4[gi2][1]*d3.y + gradient4[gi2][2]*d3.z + gradient4[gi2][3]*d3.w);
if(c4 < 0)
n4 = 0;
else
n4 = c4*c4*c4*c4*(gradient4[gi3][0]*d4.x + gradient4[gi3][1]*d4.y + gradient4[gi3][2]*d4.z + gradient4[gi3][3]*d4.w);
if(c4 < 0)
n4 = 0;
else
n4 = c4*c4*c4*c4*(gradient4[gi3][0]*d4.x + gradient4[gi3][1]*d4.y + gradient4[gi3][2]*d4.z + gradient4[gi3][3]*d4.w);
if(c5 < 0)
n5 = 0;
else
n5 = c5*c5*c5*c5*(gradient4[gi4][0]*d5.x + gradient4[gi4][1]*d5.y + gradient4[gi4][2]*d5.z + gradient4[gi4][3]*d5.w);
if(c5 < 0)
n5 = 0;
else
n5 = c5*c5*c5*c5*(gradient4[gi4][0]*d5.x + gradient4[gi4][1]*d5.y + gradient4[gi4][2]*d5.z + gradient4[gi4][3]*d5.w);
return (n1+n2+n3+n4+n5)*27.f;
return (n1+n2+n3+n4+n5)*27.f;
}

View File

@ -647,7 +647,7 @@ unsigned int NzRenderTexture::GetOpenGLID() const
}
#endif
return m_impl->fbo;
return m_impl->fbo;
}
bool NzRenderTexture::HasContext() const

View File

@ -351,7 +351,7 @@ bool NzShader::LoadFromBinary(const void* buffer, unsigned int size)
bool NzShader::LoadFromBinary(const NzByteArray& byteArray)
{
return LoadFromBinary(byteArray.GetConstBuffer(), byteArray.GetSize());
return LoadFromBinary(byteArray.GetConstBuffer(), byteArray.GetSize());
}
void NzShader::SendBoolean(int location, bool value) const

View File

@ -1041,11 +1041,11 @@ unsigned int NzTexture::GetValidSize(unsigned int size)
return size;
else
{
unsigned int pot = 1;
while (pot < size)
pot <<= 1;
unsigned int pot = 1;
while (pot < size)
pot <<= 1;
return pot;
return pot;
}
}

View File

@ -111,15 +111,15 @@ NzUberShaderInstance* NzUberShaderPreprocessor::Get(const NzParameterList& param
void NzUberShaderPreprocessor::SetShader(nzShaderStage stage, const NzString& source, const NzString& shaderFlags, const NzString& requiredFlags)
{
Shader& shader = m_shaders[stage];
shader.present = true;
shader.source = source;
Shader& shader = m_shaders[stage];
shader.present = true;
shader.source = source;
// On extrait les flags de la chaîne
std::vector<NzString> flags;
shaderFlags.Split(flags, ' ');
// On extrait les flags de la chaîne
std::vector<NzString> flags;
shaderFlags.Split(flags, ' ');
for (NzString& flag : flags)
for (NzString& flag : flags)
{
auto it = m_flags.find(flag);
if (it == m_flags.end())
@ -136,7 +136,7 @@ void NzUberShaderPreprocessor::SetShader(nzShaderStage stage, const NzString& so
flags.clear();
requiredFlags.Split(flags, ' ');
for (NzString& flag : flags)
for (NzString& flag : flags)
{
nzUInt32 flagVal;

View File

@ -106,7 +106,7 @@ namespace
SetCharacterSize(characterSize);
if (FT_Load_Char(m_face, character, FT_LOAD_FORCE_AUTOHINT | FT_LOAD_TARGET_NORMAL) != 0)
if (FT_Load_Char(m_face, character, FT_LOAD_FORCE_AUTOHINT | FT_LOAD_TARGET_NORMAL) != 0)
{
NazaraError("Failed to load character");
return false;

View File

@ -21,11 +21,11 @@ namespace
return static_cast<int>(stream->Read(data, size));
}
void Skip(void* userdata, int size)
{
void Skip(void* userdata, int size)
{
NzInputStream* stream = static_cast<NzInputStream*>(userdata);
stream->SetCursorPos(static_cast<nzInt64>(stream->GetCursorPos()) + static_cast<nzInt64>(size));
}
}
int Eof(void* userdata)
{

View File

@ -29,7 +29,7 @@
// N'est pas défini avec MinGW
#ifndef MAPVK_VK_TO_VSC
#define MAPVK_VK_TO_VSC 0
#define MAPVK_VK_TO_VSC 0
#endif
#undef IsMinimized // Conflit avec la méthode du même nom