Changeset View
Changeset View
Standalone View
Standalone View
source/renderer/ParticleRenderer.cpp
/* Copyright (C) 2011 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 73 Lines • ▼ Show 20 Lines | void ParticleRenderer::PrepareForRendering(const CShaderDefines& context) | ||||
PROFILE3("prepare particles"); | PROFILE3("prepare particles"); | ||||
// Can't load the shader in the constructor because it's called before the | // Can't load the shader in the constructor because it's called before the | ||||
// renderer initialisation is complete, so load it the first time through here | // renderer initialisation is complete, so load it the first time through here | ||||
if (!m->shader) | if (!m->shader) | ||||
{ | { | ||||
// Only construct the shaders when shaders are supported and enabled; otherwise | // Only construct the shaders when shaders are supported and enabled; otherwise | ||||
// RenderParticles will never be called so it's safe to leave the shaders as null | // RenderParticles will never be called so it's safe to leave the shaders as null | ||||
if (g_Renderer.GetRenderPath() == CRenderer::RP_SHADER) | if (g_RenderingOptions.GetRenderPath() == RenderPath::SHADER) | ||||
{ | { | ||||
m->shader = g_Renderer.GetShaderManager().LoadEffect(str_particle, context, CShaderDefines()); | m->shader = g_Renderer.GetShaderManager().LoadEffect(str_particle, context, CShaderDefines()); | ||||
m->shaderSolid = g_Renderer.GetShaderManager().LoadEffect(str_particle_solid, context, CShaderDefines()); | m->shaderSolid = g_Renderer.GetShaderManager().LoadEffect(str_particle_solid, context, CShaderDefines()); | ||||
} | } | ||||
} | } | ||||
++m->frameNumber; | ++m->frameNumber; | ||||
▲ Show 20 Lines • Show All 69 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator