Merge branch 'master' into NDK
Conflicts: src/Nazara/Physics/Geom.cpp Former-commit-id: 8fd71e34dbe105890042acc55e30b64e7c457ed4
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
#elif defined(NAZARA_PLATFORM_POSIX)
|
||||
#include <Nazara/Core/Posix/ConditionVariableImpl.hpp>
|
||||
#else
|
||||
#error Thread condition has no implementation
|
||||
#error Condition variable has no implementation
|
||||
#endif
|
||||
|
||||
#include <Nazara/Core/Debug.hpp>
|
||||
|
||||
@@ -33,8 +33,8 @@ namespace
|
||||
bool s_initialized = false;
|
||||
const unsigned int s_magic = 0xDEADB33FUL;
|
||||
const char* s_logFileName = "NazaraMemory.log";
|
||||
const char* s_nextFreeFile = "(Internal error)";
|
||||
unsigned int s_nextFreeLine = 0;
|
||||
thread_local const char* s_nextFreeFile = "(Internal error)";
|
||||
thread_local unsigned int s_nextFreeLine = 0;
|
||||
|
||||
Block s_list =
|
||||
{
|
||||
@@ -235,6 +235,7 @@ void NzMemoryManager::Initialize()
|
||||
|
||||
#ifdef NAZARA_PLATFORM_WINDOWS
|
||||
InitializeCriticalSection(&s_mutex);
|
||||
//#elif defined(NAZARA_PLATFORM_POSIX) is already done in the namespace
|
||||
#endif
|
||||
|
||||
s_initialized = true;
|
||||
@@ -250,6 +251,8 @@ void NzMemoryManager::Uninitialize()
|
||||
{
|
||||
#ifdef NAZARA_PLATFORM_WINDOWS
|
||||
DeleteCriticalSection(&s_mutex);
|
||||
#elif defined(NAZARA_PLATFORM_POSIX)
|
||||
pthread_mutex_destroy(&s_mutex);
|
||||
#endif
|
||||
|
||||
FILE* log = std::fopen(s_logFileName, "a");
|
||||
|
||||
@@ -266,8 +266,8 @@ bool NzParameterList::GetUserdataParameter(const NzString& name, void** value) c
|
||||
}
|
||||
else
|
||||
{
|
||||
NazaraError("Parameter value is not an userdata");
|
||||
return nullptr;
|
||||
NazaraError("Parameter value is not a userdata");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ bool NzConditionVariableImpl::Wait(NzMutexImpl* mutex, nzUInt32 timeout)
|
||||
{
|
||||
// get the current time
|
||||
timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
gettimeofday(&tv, nullptr);
|
||||
|
||||
// construct the time limit (current time + time to wait)
|
||||
timespec ti;
|
||||
|
||||
@@ -82,14 +82,15 @@ bool NzDirectoryImpl::Exists(const NzString& dirPath)
|
||||
NzString NzDirectoryImpl::GetCurrent()
|
||||
{
|
||||
NzString currentPath;
|
||||
char* path = new char[_PC_PATH_MAX];
|
||||
char* path = getcwd(nullptr, 0);
|
||||
|
||||
if (getcwd(path, _PC_PATH_MAX))
|
||||
if (path)
|
||||
{
|
||||
currentPath = path;
|
||||
free(path);
|
||||
}
|
||||
else
|
||||
NazaraError("Unable to get current directory: " + NzError::GetLastSystemError());
|
||||
|
||||
delete[] path;
|
||||
NazaraError("Unable to get current directory: " + NzError::GetLastSystemError()); // Bug: initialisation -> if no path for log !
|
||||
|
||||
return currentPath;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,11 @@
|
||||
|
||||
NzMutexImpl::NzMutexImpl()
|
||||
{
|
||||
pthread_mutex_init(&m_handle, NULL);
|
||||
pthread_mutexattr_t attr;
|
||||
pthread_mutexattr_init(&attr);
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
|
||||
|
||||
pthread_mutex_init(&m_handle, &attr);
|
||||
}
|
||||
|
||||
NzMutexImpl::~NzMutexImpl()
|
||||
|
||||
@@ -57,9 +57,9 @@ void NzThreadImpl::Sleep(nzUInt32 time)
|
||||
|
||||
// create a mutex and thread condition
|
||||
pthread_mutex_t mutex;
|
||||
pthread_mutex_init(&mutex, 0);
|
||||
pthread_mutex_init(&mutex, nullptr);
|
||||
pthread_cond_t condition;
|
||||
pthread_cond_init(&condition, 0);
|
||||
pthread_cond_init(&condition, nullptr);
|
||||
|
||||
// wait...
|
||||
pthread_mutex_lock(&mutex);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
bool NzTaskSchedulerImpl::Initialize(unsigned int workerCount)
|
||||
{
|
||||
if (s_workerCount > 0)
|
||||
if (IsInitialized())
|
||||
return true; // Déjà initialisé
|
||||
|
||||
#if NAZARA_CORE_SAFE
|
||||
|
||||
@@ -171,6 +171,10 @@ void NzCamera::SetTarget(const NzRenderTarget* renderTarget)
|
||||
m_target = renderTarget;
|
||||
if (m_target)
|
||||
m_target->AddListener(this);
|
||||
|
||||
m_frustumUpdated = false;
|
||||
m_projectionMatrixUpdated = false;
|
||||
m_viewportUpdated = false;
|
||||
}
|
||||
|
||||
void NzCamera::SetTarget(const NzRenderTarget& renderTarget)
|
||||
|
||||
@@ -127,8 +127,8 @@ bool NzDeferredPhongLightingPass::Process(const NzScene* scene, unsigned int fir
|
||||
NzRenderer::SetRenderStates(lightStates);
|
||||
|
||||
NzRenderer::SetShader(m_pointSpotLightShader);
|
||||
m_pointSpotLightShader->SendColor(m_pointSpotLightShaderEyePositionLocation, scene->GetAmbientColor());
|
||||
m_pointSpotLightShader->SendVector(m_pointSpotLightShaderSceneAmbientLocation, scene->GetViewer()->GetEyePosition());
|
||||
m_pointSpotLightShader->SendColor(m_pointSpotLightShaderSceneAmbientLocation, scene->GetAmbientColor());
|
||||
m_pointSpotLightShader->SendVector(m_pointSpotLightShaderEyePositionLocation, scene->GetViewer()->GetEyePosition());
|
||||
|
||||
NzMatrix4f lightMatrix;
|
||||
lightMatrix.MakeIdentity();
|
||||
|
||||
@@ -658,9 +658,12 @@ void NzForwardRenderTechnique::DrawTransparentModels(const NzScene* scene) const
|
||||
shader->SendVector(shaderUniforms->eyePosition, viewer->GetEyePosition());
|
||||
|
||||
// On envoie les lumières directionnelles s'il y a (Les mêmes pour tous)
|
||||
lightCount = std::min(m_directionalLights.GetLightCount(), NazaraSuffixMacro(NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS, U));
|
||||
for (unsigned int i = 0; i < lightCount; ++i)
|
||||
m_directionalLights.GetLight(i)->Enable(shader, shaderUniforms->lightUniforms, shaderUniforms->lightOffset*i);
|
||||
if (shaderUniforms->hasLightUniforms)
|
||||
{
|
||||
lightCount = std::min(m_directionalLights.GetLightCount(), NazaraSuffixMacro(NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS, U));
|
||||
for (unsigned int i = 0; i < lightCount; ++i)
|
||||
m_directionalLights.GetLight(i)->Enable(shader, shaderUniforms->lightUniforms, shaderUniforms->lightOffset*i);
|
||||
}
|
||||
|
||||
lastShader = shader;
|
||||
}
|
||||
@@ -690,21 +693,24 @@ void NzForwardRenderTechnique::DrawTransparentModels(const NzScene* scene) const
|
||||
NzRenderer::SetIndexBuffer(indexBuffer);
|
||||
NzRenderer::SetVertexBuffer(vertexBuffer);
|
||||
|
||||
// Calcul des lumières les plus proches
|
||||
if (lightCount < NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS && !m_lights.IsEmpty())
|
||||
if (shaderUniforms->hasLightUniforms)
|
||||
{
|
||||
NzVector3f position = matrix.GetTranslation() + modelData.squaredBoundingSphere.GetPosition();
|
||||
float radius = modelData.squaredBoundingSphere.radius;
|
||||
unsigned int closestLightCount = m_lights.ComputeClosestLights(position, radius, NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS);
|
||||
// Calcul des lumières les plus proches
|
||||
if (lightCount < NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS && !m_lights.IsEmpty())
|
||||
{
|
||||
NzVector3f position = matrix.GetTranslation() + modelData.squaredBoundingSphere.GetPosition();
|
||||
float radius = modelData.squaredBoundingSphere.radius;
|
||||
unsigned int closestLightCount = m_lights.ComputeClosestLights(position, radius, NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS);
|
||||
|
||||
unsigned int count = std::min(NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS - lightCount, closestLightCount);
|
||||
for (unsigned int i = 0; i < count; ++i)
|
||||
m_lights.GetResult(i)->Enable(shader, shaderUniforms->lightUniforms, shaderUniforms->lightOffset*(lightCount++));
|
||||
unsigned int count = std::min(NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS - lightCount, closestLightCount);
|
||||
for (unsigned int i = 0; i < count; ++i)
|
||||
m_lights.GetResult(i)->Enable(shader, shaderUniforms->lightUniforms, shaderUniforms->lightOffset*(lightCount++));
|
||||
}
|
||||
|
||||
for (unsigned int i = lightCount; i < NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS; ++i)
|
||||
NzLight::Disable(shader, shaderUniforms->lightUniforms, shaderUniforms->lightOffset*i);
|
||||
}
|
||||
|
||||
for (unsigned int i = lightCount; i < NAZARA_GRAPHICS_MAX_LIGHT_PER_PASS; ++i)
|
||||
NzLight::Disable(shader, shaderUniforms->lightUniforms, shaderUniforms->lightOffset*i);
|
||||
|
||||
NzRenderer::SetMatrix(nzMatrixType_World, matrix);
|
||||
drawFunc(meshData.primitiveMode, 0, indexCount);
|
||||
}
|
||||
|
||||
@@ -170,6 +170,24 @@ float NzView::GetZNear() const
|
||||
return m_zNear;
|
||||
}
|
||||
|
||||
NzVector2f NzView::MapPixelToWorld(const NzVector2i& pixel)
|
||||
{
|
||||
if (!m_invViewProjMatrixUpdated)
|
||||
UpdateInvViewProjMatrix();
|
||||
|
||||
if (!m_viewportUpdated)
|
||||
UpdateViewport();
|
||||
|
||||
// Conversion du viewport en flottant
|
||||
NzRectf viewport(m_viewport);
|
||||
|
||||
NzVector2f normalized;
|
||||
normalized.x = -1.f + 2.f * (pixel.x - viewport.x) / viewport.width;
|
||||
normalized.y = 1.f - 2.f * (pixel.y - viewport.y) / viewport.height;
|
||||
|
||||
return m_invViewProjMatrix.Transform(normalized);
|
||||
}
|
||||
|
||||
NzVector2i NzView::MapWorldToPixel(const NzVector2f& coords)
|
||||
{
|
||||
if (!m_viewProjMatrixUpdated)
|
||||
@@ -190,24 +208,6 @@ NzVector2i NzView::MapWorldToPixel(const NzVector2f& coords)
|
||||
return pixel;
|
||||
}
|
||||
|
||||
NzVector2f NzView::MapPixelToWorld(const NzVector2i& pixel)
|
||||
{
|
||||
if (!m_invViewProjMatrixUpdated)
|
||||
UpdateInvViewProjMatrix();
|
||||
|
||||
if (!m_viewportUpdated)
|
||||
UpdateViewport();
|
||||
|
||||
// Conversion du viewport en flottant
|
||||
NzRectf viewport(m_viewport);
|
||||
|
||||
NzVector2f normalized;
|
||||
normalized.x = -1.f + 2.f * (pixel.x - viewport.x) / viewport.width;
|
||||
normalized.y = 1.f - 2.f * (pixel.y - viewport.y) / viewport.height;
|
||||
|
||||
return m_invViewProjMatrix.Transform(normalized);
|
||||
}
|
||||
|
||||
void NzView::SetSize(const NzVector2f& size)
|
||||
{
|
||||
SetSize(size.x, size.y);
|
||||
|
||||
@@ -95,13 +95,20 @@ namespace
|
||||
static_assert(sizeof(s_comparisons)/sizeof(int) == nzLuaComparison_Max+1, "Lua comparison array is incomplete");
|
||||
|
||||
int s_operations[] = {
|
||||
LUA_OPADD, // nzLuaOperation_Addition
|
||||
LUA_OPDIV, // nzLuaOperation_Division
|
||||
LUA_OPPOW, // nzLuaOperation_Exponentiation
|
||||
LUA_OPMOD, // nzLuaOperation_Modulo
|
||||
LUA_OPMUL, // nzLuaOperation_Multiplication
|
||||
LUA_OPUNM, // nzLuaOperation_Negation
|
||||
LUA_OPSUB // nzLuaOperation_Substraction
|
||||
LUA_OPADD, // nzLuaOperation_Addition
|
||||
LUA_OPBAND, // nzLuaOperation_BitwiseAnd
|
||||
LUA_OPSHL, // nzLuaOperation_BitwiseLeftShift
|
||||
LUA_OPBNOT, // nzLuaOperation_BitwiseNot
|
||||
LUA_OPBOR, // nzLuaOperation_BitwiseOr
|
||||
LUA_OPSHR, // nzLuaOperation_BitwiseRightShift
|
||||
LUA_OPBXOR, // nzLuaOperation_BitwiseXOr
|
||||
LUA_OPDIV, // nzLuaOperation_Division
|
||||
LUA_OPPOW, // nzLuaOperation_Exponentiation
|
||||
LUA_OPIDIV, // nzLuaOperation_FloorDivision
|
||||
LUA_OPMUL, // nzLuaOperation_Multiplication
|
||||
LUA_OPMOD, // nzLuaOperation_Modulo
|
||||
LUA_OPUNM, // nzLuaOperation_Negation
|
||||
LUA_OPSUB // nzLuaOperation_Substraction
|
||||
};
|
||||
|
||||
static_assert(sizeof(s_operations)/sizeof(int) == nzLuaOperation_Max+1, "Lua operation array is incomplete");
|
||||
@@ -159,6 +166,16 @@ int NzLuaInstance::ArgError(unsigned int argNum, const NzString& error)
|
||||
return luaL_argerror(m_state, argNum, error.GetConstBuffer());
|
||||
}
|
||||
|
||||
bool NzLuaInstance::Call(unsigned int argCount)
|
||||
{
|
||||
return Run(argCount, LUA_MULTRET);
|
||||
}
|
||||
|
||||
bool NzLuaInstance::Call(unsigned int argCount, unsigned int resultCount)
|
||||
{
|
||||
return Run(argCount, resultCount);
|
||||
}
|
||||
|
||||
void NzLuaInstance::CheckAny(int index) const
|
||||
{
|
||||
luaL_checkany(m_state, index);
|
||||
@@ -370,7 +387,7 @@ bool NzLuaInstance::Execute(const NzString& code)
|
||||
return false;
|
||||
}
|
||||
|
||||
return Run();
|
||||
return Run(0, 0);
|
||||
}
|
||||
|
||||
bool NzLuaInstance::ExecuteFromFile(const NzString& filePath)
|
||||
@@ -416,7 +433,7 @@ bool NzLuaInstance::ExecuteFromStream(NzInputStream& stream)
|
||||
return false;
|
||||
}
|
||||
|
||||
return Run();
|
||||
return Run(0, 0);
|
||||
}
|
||||
|
||||
int NzLuaInstance::GetAbsIndex(int index) const
|
||||
@@ -813,12 +830,12 @@ NzLuaInstance* NzLuaInstance::GetInstance(lua_State* state)
|
||||
return instance;
|
||||
}
|
||||
|
||||
bool NzLuaInstance::Run()
|
||||
bool NzLuaInstance::Run(int argCount, int resultCount)
|
||||
{
|
||||
if (m_level++ == 0)
|
||||
m_clock.Restart();
|
||||
|
||||
int status = lua_pcall(m_state, 0, 0, 0);
|
||||
int status = lua_pcall(m_state, argCount, resultCount, 0);
|
||||
|
||||
m_level--;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Physics module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#if NAZARA_PHYSICS_MANAGE_MEMORY
|
||||
|
||||
#include <Nazara/Core/MemoryManager.hpp>
|
||||
#include <new> // Nécessaire ?
|
||||
#include <new> // Nécessaire ?
|
||||
|
||||
void* operator new(std::size_t size)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// Copyright (C) 2015 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Physics module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ struct NzRenderTextureImpl
|
||||
bool complete = false;
|
||||
bool userDefinedTargets = false;
|
||||
mutable bool drawBuffersUpdated = true;
|
||||
mutable bool sizeUpdated = false;
|
||||
mutable bool targetsUpdated = true;
|
||||
unsigned int height;
|
||||
unsigned int width;
|
||||
@@ -171,6 +172,7 @@ bool NzRenderTexture::AttachBuffer(nzAttachmentPoint attachmentPoint, nzUInt8 in
|
||||
attachment.width = buffer->GetWidth();
|
||||
|
||||
m_impl->checked = false;
|
||||
m_impl->sizeUpdated = false;
|
||||
|
||||
if (attachmentPoint == nzAttachmentPoint_Color && !m_impl->userDefinedTargets)
|
||||
{
|
||||
@@ -316,6 +318,7 @@ bool NzRenderTexture::AttachTexture(nzAttachmentPoint attachmentPoint, nzUInt8 i
|
||||
attachment.width = texture->GetWidth();
|
||||
|
||||
m_impl->checked = false;
|
||||
m_impl->sizeUpdated = false;
|
||||
|
||||
if (attachmentPoint == nzAttachmentPoint_Color && !m_impl->userDefinedTargets)
|
||||
{
|
||||
@@ -469,8 +472,8 @@ unsigned int NzRenderTexture::GetHeight() const
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!m_impl->targetsUpdated)
|
||||
UpdateTargets();
|
||||
if (!m_impl->sizeUpdated)
|
||||
UpdateSize();
|
||||
|
||||
return m_impl->height;
|
||||
}
|
||||
@@ -499,8 +502,8 @@ NzVector2ui NzRenderTexture::GetSize() const
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!m_impl->targetsUpdated)
|
||||
UpdateTargets();
|
||||
if (!m_impl->sizeUpdated)
|
||||
UpdateSize();
|
||||
|
||||
return NzVector2ui(m_impl->width, m_impl->height);
|
||||
}
|
||||
@@ -515,8 +518,8 @@ unsigned int NzRenderTexture::GetWidth() const
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!m_impl->targetsUpdated)
|
||||
UpdateTargets();
|
||||
if (!m_impl->sizeUpdated)
|
||||
UpdateSize();
|
||||
|
||||
return m_impl->width;
|
||||
}
|
||||
@@ -915,11 +918,21 @@ void NzRenderTexture::UpdateDrawBuffers() const
|
||||
m_impl->drawBuffersUpdated = true;
|
||||
}
|
||||
|
||||
void NzRenderTexture::UpdateSize() const
|
||||
{
|
||||
m_impl->width = 0;
|
||||
m_impl->height = 0;
|
||||
for (Attachment& attachment : m_impl->attachments)
|
||||
{
|
||||
m_impl->height = std::max(m_impl->height, attachment.height);
|
||||
m_impl->width = std::max(m_impl->width, attachment.width);
|
||||
}
|
||||
|
||||
m_impl->sizeUpdated = true;
|
||||
}
|
||||
|
||||
void NzRenderTexture::UpdateTargets() const
|
||||
{
|
||||
m_impl->width = std::numeric_limits<unsigned int>::max();
|
||||
m_impl->height = std::numeric_limits<unsigned int>::max();
|
||||
|
||||
if (m_impl->colorTargets.empty())
|
||||
{
|
||||
m_impl->drawBuffers.resize(1);
|
||||
@@ -930,13 +943,7 @@ void NzRenderTexture::UpdateTargets() const
|
||||
m_impl->drawBuffers.resize(m_impl->colorTargets.size());
|
||||
GLenum* ptr = &m_impl->drawBuffers[0];
|
||||
for (nzUInt8 index : m_impl->colorTargets)
|
||||
{
|
||||
*ptr++ = GL_COLOR_ATTACHMENT0 + index;
|
||||
|
||||
Attachment& attachment = m_impl->attachments[attachmentIndex[nzAttachmentPoint_Color] + index];
|
||||
m_impl->height = std::min(m_impl->height, attachment.height);
|
||||
m_impl->width = std::min(m_impl->width, attachment.width);
|
||||
}
|
||||
}
|
||||
|
||||
m_impl->targetsUpdated = true;
|
||||
|
||||
@@ -37,11 +37,50 @@ NzFont* NzSimpleTextDrawer::GetFont() const
|
||||
return m_font;
|
||||
}
|
||||
|
||||
NzFont* NzSimpleTextDrawer::GetFont(unsigned int index) const
|
||||
{
|
||||
#if NAZARA_UTILITY_SAFE
|
||||
if (index > 0)
|
||||
{
|
||||
NazaraError("Font index out of range (" + NzString::Number(index) + " >= 1)");
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
return m_font;
|
||||
}
|
||||
|
||||
unsigned int NzSimpleTextDrawer::GetFontCount() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
const NzAbstractTextDrawer::Glyph& NzSimpleTextDrawer::GetGlyph(unsigned int index) const
|
||||
{
|
||||
if (!m_glyphUpdated)
|
||||
UpdateGlyphs();
|
||||
|
||||
return m_glyphs[index];
|
||||
}
|
||||
|
||||
unsigned int NzSimpleTextDrawer::GetGlyphCount() const
|
||||
{
|
||||
if (!m_glyphUpdated)
|
||||
UpdateGlyphs();
|
||||
|
||||
return m_glyphs.size();
|
||||
}
|
||||
|
||||
nzUInt32 NzSimpleTextDrawer::GetStyle() const
|
||||
{
|
||||
return m_style;
|
||||
}
|
||||
|
||||
const NzString& NzSimpleTextDrawer::GetText() const
|
||||
{
|
||||
return m_text;
|
||||
}
|
||||
|
||||
void NzSimpleTextDrawer::SetCharacterSize(unsigned int characterSize)
|
||||
{
|
||||
m_characterSize = characterSize;
|
||||
@@ -101,40 +140,6 @@ NzSimpleTextDrawer NzSimpleTextDrawer::Draw(NzFont* font, const NzString& str, u
|
||||
return drawer;
|
||||
}
|
||||
|
||||
NzFont* NzSimpleTextDrawer::GetFont(unsigned int index) const
|
||||
{
|
||||
#if NAZARA_UTILITY_SAFE
|
||||
if (index > 0)
|
||||
{
|
||||
NazaraError("Font index out of range (" + NzString::Number(index) + " >= 1)");
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
return m_font;
|
||||
}
|
||||
|
||||
unsigned int NzSimpleTextDrawer::GetFontCount() const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
const NzAbstractTextDrawer::Glyph& NzSimpleTextDrawer::GetGlyph(unsigned int index) const
|
||||
{
|
||||
if (!m_glyphUpdated)
|
||||
UpdateGlyphs();
|
||||
|
||||
return m_glyphs[index];
|
||||
}
|
||||
|
||||
unsigned int NzSimpleTextDrawer::GetGlyphCount() const
|
||||
{
|
||||
if (!m_glyphUpdated)
|
||||
UpdateGlyphs();
|
||||
|
||||
return m_glyphs.size();
|
||||
}
|
||||
|
||||
bool NzSimpleTextDrawer::OnObjectModified(const NzRefCounted* object, int index, unsigned int code)
|
||||
{
|
||||
NazaraUnused(object);
|
||||
|
||||
Reference in New Issue
Block a user