Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/gui/MiniMap.cpp
Show All 37 Lines | |||||
#include "ps/ConfigDB.h" | #include "ps/ConfigDB.h" | ||||
#include "ps/Filesystem.h" | #include "ps/Filesystem.h" | ||||
#include "ps/Game.h" | #include "ps/Game.h" | ||||
#include "ps/GameSetup/Config.h" | #include "ps/GameSetup/Config.h" | ||||
#include "ps/Profile.h" | #include "ps/Profile.h" | ||||
#include "ps/World.h" | #include "ps/World.h" | ||||
#include "ps/XML/Xeromyces.h" | #include "ps/XML/Xeromyces.h" | ||||
#include "renderer/Renderer.h" | #include "renderer/Renderer.h" | ||||
#include "renderer/RenderingOptions.h" | |||||
#include "renderer/WaterManager.h" | #include "renderer/WaterManager.h" | ||||
#include "scriptinterface/ScriptInterface.h" | #include "scriptinterface/ScriptInterface.h" | ||||
#include "simulation2/Simulation2.h" | #include "simulation2/Simulation2.h" | ||||
#include "simulation2/components/ICmpMinimap.h" | #include "simulation2/components/ICmpMinimap.h" | ||||
#include "simulation2/system/ParamNode.h" | #include "simulation2/system/ParamNode.h" | ||||
extern bool g_GameRestarted; | extern bool g_GameRestarted; | ||||
▲ Show 20 Lines • Show All 515 Lines • ▼ Show 20 Lines | if (doUpdate) | ||||
m_VertexArray.Upload(); | m_VertexArray.Upload(); | ||||
} | } | ||||
m_VertexArray.PrepareForRendering(); | m_VertexArray.PrepareForRendering(); | ||||
if (m_EntitiesDrawn > 0) | if (m_EntitiesDrawn > 0) | ||||
{ | { | ||||
#if !CONFIG2_GLES | #if !CONFIG2_GLES | ||||
if (g_Renderer.GetRenderPath() == CRenderer::RP_SHADER) | if (g_RenderingOptions.GetRenderPath() == RenderPath::SHADER) | ||||
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); | glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); | ||||
#endif | #endif | ||||
u8* indexBase = m_IndexArray.Bind(); | u8* indexBase = m_IndexArray.Bind(); | ||||
u8* base = m_VertexArray.Bind(); | u8* base = m_VertexArray.Bind(); | ||||
const GLsizei stride = (GLsizei)m_VertexArray.GetStride(); | const GLsizei stride = (GLsizei)m_VertexArray.GetStride(); | ||||
shader->VertexPointer(2, GL_FLOAT, stride, base + m_AttributePos.offset); | shader->VertexPointer(2, GL_FLOAT, stride, base + m_AttributePos.offset); | ||||
shader->ColorPointer(4, GL_UNSIGNED_BYTE, stride, base + m_AttributeColor.offset); | shader->ColorPointer(4, GL_UNSIGNED_BYTE, stride, base + m_AttributeColor.offset); | ||||
shader->AssertPointersBound(); | shader->AssertPointersBound(); | ||||
if (!g_Renderer.m_SkipSubmit) | if (!g_Renderer.m_SkipSubmit) | ||||
glDrawElements(GL_POINTS, (GLsizei)(m_EntitiesDrawn), GL_UNSIGNED_SHORT, indexBase); | glDrawElements(GL_POINTS, (GLsizei)(m_EntitiesDrawn), GL_UNSIGNED_SHORT, indexBase); | ||||
g_Renderer.GetStats().m_DrawCalls++; | g_Renderer.GetStats().m_DrawCalls++; | ||||
CVertexBuffer::Unbind(); | CVertexBuffer::Unbind(); | ||||
#if !CONFIG2_GLES | #if !CONFIG2_GLES | ||||
if (g_Renderer.GetRenderPath() == CRenderer::RP_SHADER) | if (g_RenderingOptions.GetRenderPath() == RenderPath::SHADER) | ||||
glDisable(GL_VERTEX_PROGRAM_POINT_SIZE); | glDisable(GL_VERTEX_PROGRAM_POINT_SIZE); | ||||
#endif | #endif | ||||
} | } | ||||
tech->EndPass(); | tech->EndPass(); | ||||
DrawViewRect(unitMatrix); | DrawViewRect(unitMatrix); | ||||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator