Changeset View
Changeset View
Standalone View
Standalone View
source/renderer/DecalRData.cpp
/* Copyright (C) 2015 Wildfire Games. | /* Copyright (C) 2019 Wildfire Games. | ||||
* 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 20 Lines • Show All 202 Lines • ▼ Show 20 Lines | void CDecalRData::BuildArrays() | ||||
m_Array.SetNumVertices((i1-i0+1)*(j1-j0+1)); | m_Array.SetNumVertices((i1-i0+1)*(j1-j0+1)); | ||||
m_Array.Layout(); | m_Array.Layout(); | ||||
VertexArrayIterator<CVector3D> Position = m_Position.GetIterator<CVector3D>(); | VertexArrayIterator<CVector3D> Position = m_Position.GetIterator<CVector3D>(); | ||||
VertexArrayIterator<CVector3D> Normal = m_Normal.GetIterator<CVector3D>(); | VertexArrayIterator<CVector3D> Normal = m_Normal.GetIterator<CVector3D>(); | ||||
VertexArrayIterator<SColor4ub> DiffuseColor = m_DiffuseColor.GetIterator<SColor4ub>(); | VertexArrayIterator<SColor4ub> DiffuseColor = m_DiffuseColor.GetIterator<SColor4ub>(); | ||||
VertexArrayIterator<float[2]> UV = m_UV.GetIterator<float[2]>(); | VertexArrayIterator<float[2]> UV = m_UV.GetIterator<float[2]>(); | ||||
const CLightEnv& lightEnv = g_Renderer.GetLightEnv(); | const CLightEnv& lightEnv = g_Renderer.GetLightEnv(); | ||||
bool cpuLighting = (g_Renderer.GetRenderPath() == CRenderer::RP_FIXED); | bool cpuLighting = (g_RenderingOptions.GetRenderPath() == RenderPath::FIXED); | ||||
for (ssize_t j = j0; j <= j1; ++j) | for (ssize_t j = j0; j <= j1; ++j) | ||||
{ | { | ||||
for (ssize_t i = i0; i <= i1; ++i) | for (ssize_t i = i0; i <= i1; ++i) | ||||
{ | { | ||||
CVector3D pos; | CVector3D pos; | ||||
m_Decal->m_Terrain->CalcPosition(i, j, pos); | m_Decal->m_Terrain->CalcPosition(i, j, pos); | ||||
▲ Show 20 Lines • Show All 64 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator