Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/Overlay.cpp
Show All 16 Lines | |||||
#include "precompiled.h" | #include "precompiled.h" | ||||
#include "Overlay.h" | #include "Overlay.h" | ||||
#include "graphics/TextureManager.h" | #include "graphics/TextureManager.h" | ||||
#include "ps/CStr.h" | #include "ps/CStr.h" | ||||
#include "renderer/Renderer.h" | #include "renderer/Renderer.h" | ||||
#include "renderer/TexturedLineRData.h" | |||||
SOverlayTexturedLine::LineCapType SOverlayTexturedLine::StrToLineCapType(const std::wstring& str) | SOverlayTexturedLine::LineCapType SOverlayTexturedLine::StrToLineCapType(const std::wstring& str) | ||||
{ | { | ||||
if (str == L"round") | if (str == L"round") | ||||
return LINECAP_ROUND; | return LINECAP_ROUND; | ||||
else if (str == L"sharp") | else if (str == L"sharp") | ||||
return LINECAP_SHARP; | return LINECAP_SHARP; | ||||
else if (str == L"square") | else if (str == L"square") | ||||
Show All 19 Lines | void SOverlayTexturedLine::CreateOverlayTexture(const SOverlayDescriptor* overlayDescriptor) | ||||
m_AlwaysVisible = false; | m_AlwaysVisible = false; | ||||
m_Closed = true; | m_Closed = true; | ||||
m_Thickness = overlayDescriptor->m_LineThickness; | m_Thickness = overlayDescriptor->m_LineThickness; | ||||
m_TextureBase = g_Renderer.GetTextureManager().CreateTexture(texturePropsBase); | m_TextureBase = g_Renderer.GetTextureManager().CreateTexture(texturePropsBase); | ||||
m_TextureMask = g_Renderer.GetTextureManager().CreateTexture(texturePropsMask); | m_TextureMask = g_Renderer.GetTextureManager().CreateTexture(texturePropsMask); | ||||
ENSURE(m_TextureBase); | ENSURE(m_TextureBase); | ||||
} | } | ||||
bool SOverlayTexturedLine::IsVisibleInFrustum(const CFrustum& frustum) const | |||||
{ | |||||
// If we don't have render data, we don't have actual bounds and we need | |||||
// to calculate them on a prerendering stage. | |||||
if (!m_RenderData) | |||||
return true; | |||||
return m_RenderData->IsVisibleInFrustum(frustum); | |||||
Stan: return !m_RenderData || m_RenderData->IsVisibleInFrustum(frustum) ? | |||||
Not Done Inline ActionsNot done. Stan: Not done. | |||||
Not Done Inline ActionsI think it's worth keeping on two lines because the comment only refers to the first line, but your mileage might vary. wraitii: I think it's worth keeping on two lines because the comment only refers to the first line, but… | |||||
} |
Wildfire Games · Phabricator
return !m_RenderData || m_RenderData->IsVisibleInFrustum(frustum) ?