draw yells outside screen range

This commit is contained in:
Eduardo Bart 2012-02-02 19:28:53 -02:00
parent 82dc42dc26
commit a4546942d2
5 changed files with 3 additions and 6 deletions

View File

@ -210,7 +210,6 @@ void Game::processCreatureTeleport(const CreaturePtr& creature)
{
// stop walking on creature teleports
creature->stopWalk();
dump << "stop walk" << creature->getName();
if(creature == m_localPlayer)
m_localPlayer->lockWalk();

View File

@ -128,9 +128,6 @@ void Map::addThing(const ThingPtr& thing, const Position& pos, int stackPos)
Position oldPos = thing->getPosition();
tile->addThing(thing, stackPos);
// creature teleported
if(creature == g_game.getLocalPlayer())
dump << "creature move from" << oldPos << "to" << pos;
if(oldPos.isValid() && !oldPos.isInRange(pos,1,1))
g_game.processCreatureTeleport(creature);
} else if(MissilePtr missile = thing->asMissile()) {

View File

@ -39,7 +39,6 @@ bool SpriteManager::load(const std::string& file)
g_resources.loadFile(file, m_fin);
m_signature = Fw::getU32(m_fin);
m_spritesCount = Fw::getU16(m_fin);
dump << m_spritesCount;
m_sprites.resize(m_spritesCount);
m_loaded = true;
return true;

View File

@ -37,7 +37,8 @@ void StaticText::draw(const Point& dest, const Rect& parentRect)
Rect boundRect = rect;
boundRect.bind(parentRect);
if((boundRect.center() - rect.center()).length() < parentRect.width() / 15) {
// draw only if the real center is not too far from the parent center, or its a yell
if((boundRect.center() - rect.center()).length() < parentRect.width() / 15 || m_yell) {
//TODO: cache into a framebuffer
m_font->renderText(m_text, boundRect, Fw::AlignCenter, m_color);
}

View File

@ -32,6 +32,7 @@ bool UIGame::onKeyPress(uchar keyCode, int keyboardModifiers, bool wouldFilter)
UILineEditPtr chatLineEdit = std::dynamic_pointer_cast<UILineEdit>(getParent()->recursiveGetChildById("consoleLineEdit"));
//TODO: move this whole shit to lua
if(keyboardModifiers == Fw::KeyboardNoModifier) {
if(keyCode == Fw::KeyUp || keyCode == Fw::KeyNumpad8) {
g_game.walk(Otc::North);