Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/graphics/ParticleEmitterType.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 All 15 Lines | |||||
#include "graphics/TextureManager.h" | #include "graphics/TextureManager.h" | ||||
#include "lib/rand.h" | #include "lib/rand.h" | ||||
#include "maths/MathUtil.h" | #include "maths/MathUtil.h" | ||||
#include "ps/CLogger.h" | #include "ps/CLogger.h" | ||||
#include "ps/Filesystem.h" | #include "ps/Filesystem.h" | ||||
#include "ps/XML/Xeromyces.h" | #include "ps/XML/Xeromyces.h" | ||||
#include "renderer/Renderer.h" | #include "renderer/Renderer.h" | ||||
#include <boost/random/uniform_real.hpp> | #include <boost/random/uniform_real_distribution.hpp> | ||||
/** | /** | ||||
* Interface for particle state variables, which get evaluated for each newly | * Interface for particle state variables, which get evaluated for each newly | ||||
* constructed particle. | * constructed particle. | ||||
*/ | */ | ||||
class IParticleVar | class IParticleVar | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Lines | |||||
public: | public: | ||||
CParticleVarUniform(float min, float max) : | CParticleVarUniform(float min, float max) : | ||||
m_Min(min), m_Max(max) | m_Min(min), m_Max(max) | ||||
{ | { | ||||
} | } | ||||
virtual float Compute(CParticleEmitterType& type, CParticleEmitter& UNUSED(emitter)) | virtual float Compute(CParticleEmitterType& type, CParticleEmitter& UNUSED(emitter)) | ||||
{ | { | ||||
return boost::uniform_real<>(m_Min, m_Max)(type.m_Manager.m_RNG); | return boost::random::uniform_real_distribution<float>(m_Min, m_Max)(type.m_Manager.m_RNG); | ||||
} | } | ||||
virtual float Min(CParticleEmitterType& UNUSED(type)) | virtual float Min(CParticleEmitterType& UNUSED(type)) | ||||
{ | { | ||||
return m_Min; | return m_Min; | ||||
} | } | ||||
virtual float Max(CParticleEmitterType& UNUSED(type)) | virtual float Max(CParticleEmitterType& UNUSED(type)) | ||||
▲ Show 20 Lines • Show All 482 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator