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");

View File

@@ -530,7 +530,7 @@ void ProtocolGame::parseMagicEffect(InputMessage& msg)
tile->addEffect(effect);
// TODO: check if particles effect exists, if not, play standard sprite effect.
g_particleManager.load("particle.otpa");
//g_particleManager.load("particle.otpa");
}
void ProtocolGame::parseAnimatedText(InputMessage& msg)

View File

@@ -23,6 +23,7 @@
#include "uigame.h"
#include <otclient/core/game.h>
#include <framework/ui/uilineedit.h>
#include <framework/graphics/particlemanager.h>
bool UIGame::onKeyPress(uchar keyCode, std::string keyText, int keyboardModifiers)
{
@@ -82,6 +83,7 @@ bool UIGame::onKeyPress(uchar keyCode, std::string keyText, int keyboardModifier
return true;
} else if(keyCode == Fw::KeyRight || keyCode == Fw::KeyNumpad6) {
g_game.turn(Otc::East);
g_particleManager.load("particle.otpa");
return true;
} else if(keyCode == Fw::KeyDown || keyCode == Fw::KeyNumpad2) {
g_game.turn(Otc::South);