Removed debug error when copying a matrix

Former-commit-id: 60c57643b5a520abe96fdca83f2d0c28f3bc1f11
This commit is contained in:
Lynix 2012-11-27 20:25:14 +01:00
parent 38c1cf2ad0
commit 4fbe508960
5 changed files with 13 additions and 10 deletions

View File

@ -16,21 +16,25 @@ if (_OPTIONS["united"]) then
links "NazaraEngine" links "NazaraEngine"
else else
configuration "DebugStatic" configuration "DebugStatic"
links "Nazara3D-s-d"
links "NazaraRenderer-s-d" links "NazaraRenderer-s-d"
links "NazaraUtility-s-d" links "NazaraUtility-s-d"
links "NazaraCore-s-d" links "NazaraCore-s-d"
configuration "ReleaseStatic" configuration "ReleaseStatic"
links "Nazara3D-s"
links "NazaraRenderer-s" links "NazaraRenderer-s"
links "NazaraUtility-s" links "NazaraUtility-s"
links "NazaraCore-s" links "NazaraCore-s"
configuration "DebugDLL" configuration "DebugDLL"
links "Nazara3D-d"
links "NazaraRenderer-d" links "NazaraRenderer-d"
links "NazaraUtility-d" links "NazaraUtility-d"
links "NazaraCore-d" links "NazaraCore-d"
configuration "ReleaseDLL" configuration "ReleaseDLL"
links "Nazara3D"
links "NazaraRenderer" links "NazaraRenderer"
links "NazaraUtility" links "NazaraUtility"
links "NazaraCore" links "NazaraCore"

View File

@ -50,7 +50,7 @@ class NAZARA_API NzResource
void RemoveResourceListener(NzResourceListener* listener) const; void RemoveResourceListener(NzResourceListener* listener) const;
void RemoveResourceReference() const; void RemoveResourceReference() const;
void SetPersistent(bool persistent = true); void SetPersistent(bool persistent = true, bool checkReferenceCount = true);
protected: protected:
void NotifyCreated(); void NotifyCreated();

View File

@ -590,9 +590,9 @@ NzMatrix4<T>& NzMatrix4<T>::MakeZero()
template<typename T> template<typename T>
NzMatrix4<T>& NzMatrix4<T>::Set(T r11, T r12, T r13, T r14, NzMatrix4<T>& NzMatrix4<T>::Set(T r11, T r12, T r13, T r14,
T r21, T r22, T r23, T r24, T r21, T r22, T r23, T r24,
T r31, T r32, T r33, T r34, T r31, T r32, T r33, T r34,
T r41, T r42, T r43, T r44) T r41, T r42, T r43, T r44)
{ {
m11 = r11; m11 = r11;
m12 = r12; m12 = r12;
@ -626,9 +626,7 @@ NzMatrix4<T>& NzMatrix4<T>::Set(const T matrix[16])
template<typename T> template<typename T>
NzMatrix4<T>& NzMatrix4<T>::Set(const NzMatrix4& matrix) NzMatrix4<T>& NzMatrix4<T>::Set(const NzMatrix4& matrix)
{ {
NazaraError("Check 1");
std::memcpy(&m11, &matrix.m11, 16*sizeof(T)); std::memcpy(&m11, &matrix.m11, 16*sizeof(T));
NazaraError("Check 2");
return *this; return *this;
} }

View File

@ -20,7 +20,7 @@ void NzError(nzErrorType type, const NzString& error, unsigned int line, const c
#if NAZARA_CORE_EXIT_ON_ASSERT_FAILURE #if NAZARA_CORE_EXIT_ON_ASSERT_FAILURE
if (type == nzErrorType_AssertFailed) if (type == nzErrorType_AssertFailed)
exit(EXIT_FAILURE); std::exit(EXIT_FAILURE);
#endif #endif
} }
@ -56,7 +56,7 @@ NzString NzGetLastSystemError(unsigned int code)
return error; return error;
#elif defined(NAZARA_PLATFORM_POSIX) #elif defined(NAZARA_PLATFORM_POSIX)
return strerror(code); return std::strerror(code);
#else #else
#error GetLastSystemError is not implemented on this platform #error GetLastSystemError is not implemented on this platform

View File

@ -6,6 +6,7 @@
#include <Nazara/Core/Config.hpp> #include <Nazara/Core/Config.hpp>
#include <Nazara/Core/Error.hpp> #include <Nazara/Core/Error.hpp>
#include <Nazara/Core/ResourceListener.hpp> #include <Nazara/Core/ResourceListener.hpp>
#include <typeinfo>
#include <Nazara/Core/Debug.hpp> #include <Nazara/Core/Debug.hpp>
NzResource::NzResource(bool persistent) : NzResource::NzResource(bool persistent) :
@ -111,13 +112,13 @@ void NzResource::RemoveResourceReference() const
} }
} }
void NzResource::SetPersistent(bool persistent) void NzResource::SetPersistent(bool persistent, bool checkReferenceCount)
{ {
NazaraMutexLock(m_mutex); NazaraMutexLock(m_mutex);
m_resourcePersistent = persistent; m_resourcePersistent = persistent;
if (!persistent && m_resourceReferenceCount == 0) if (checkReferenceCount && !persistent && m_resourceReferenceCount == 0)
{ {
NazaraMutexUnlock(m_mutex); NazaraMutexUnlock(m_mutex);
delete this; delete this;