Changeset View
Changeset View
Standalone View
Standalone View
source/gui/MiniMap.cpp
/* Copyright (C) 2017 Wildfire Games. | /* Copyright (C) 2019Config.cpp Wildfire Games. | ||||
historic_bruno: 2019 | |||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 0 A.D. is free software: you can redistribute it and/or modify | ||||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 27 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 517 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
2019