particles test

This commit is contained in:
Henrique Santiago
2011-12-18 21:44:49 -02:00
parent e3e6770957
commit ab9efe5a95
7 changed files with 87 additions and 27 deletions

View File

@@ -111,11 +111,8 @@ void Application::init(const std::vector<std::string>& args, int appFlags)
if(m_appFlags & Fw::AppEnableModules)
g_modules.discoverModulesPath();
g_particleManager.load("particle.otpa");
}
void Application::terminate()
{
// hide the window because there is no render anymore

View File

@@ -49,9 +49,9 @@ void Particle::render()
if(!m_texture)
g_painter.drawFilledRect(m_rect);
else {
//g_painter.setCompositionMode(Painter::CompositionMode_AdditiveSource);
g_painter.setCompositionMode(Painter::CompositionMode_AdditiveSource);
g_painter.drawTexturedRect(m_rect, m_texture);
//g_painter.setCompositionMode(Painter::CompositionMode_SourceOver);
g_painter.setCompositionMode(Painter::CompositionMode_SourceOver);
}
}

View File

@@ -163,7 +163,8 @@ bool ParticleEmitter::load(const OTMLNodePtr& node)
if(m_pColors.empty())
m_pColors.push_back(Color(255, 255, 255, 128));
m_pColorsStops.insert(m_pColorsStops.begin(), 0);
if(m_pColorsStops.empty())
m_pColorsStops.push_back(0);
if(m_pColors.size() != m_pColorsStops.size()) {
logError("particle colors must be equal to colorstops-1");