Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 30, 2008, 3:02:03 PM (16 years ago)
Author:
rgrieder
Message:
  • fixed the InputBufferListener bug in a proper way It looks a little bit ugly, but at least it's got a new feature: You don't need to derive from InputBufferListener (removed it)
  • commented the shader hack in Model.cc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/core/InputBuffer.cc

    r1446 r1486  
    8888    }
    8989
    90     void InputBuffer::unregisterListener(InputBufferListener* listener)
    91     {
    92         for (std::list<InputBufferListenerTuple>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); )
    93         {
    94             if ((*it).listener_ == listener)
    95                 this->listeners_.erase(it++);
    96             else
    97                 ++it;
    98         }
    99     }
    100 
    10190    void InputBuffer::set(const std::string& input, bool update)
    10291    {
     
    165154    void InputBuffer::updated()
    166155    {
    167         for (std::list<InputBufferListenerTuple>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
    168         {
    169             if ((*it).bListenToAllChanges_)
    170                 (*(*it).listener_.*(*it).function_)();
     156        for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
     157        {
     158            if ((*it)->bListenToAllChanges_)
     159                (*it)->callFunction();
    171160        }
    172161    }
     
    174163    void InputBuffer::updated(const char& update, bool bSingleInput)
    175164    {
    176         for (std::list<InputBufferListenerTuple>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
    177         {
    178             if ((!(*it).trueKeyFalseChar_) && ((*it).bListenToAllChanges_ || ((*it).char_ == update)) && (!(*it).bOnlySingleInput_ || bSingleInput))
    179                 (*(*it).listener_.*(*it).function_)();
     165        for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
     166        {
     167            if ((!(*it)->trueKeyFalseChar_) && ((*it)->bListenToAllChanges_ || ((*it)->char_ == update)) && (!(*it)->bOnlySingleInput_ || bSingleInput))
     168                (*it)->callFunction();
    180169        }
    181170    }
     
    195184            return;
    196185
    197         for (std::list<InputBufferListenerTuple>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
    198         {
    199             if ((*it).trueKeyFalseChar_ && ((*it).key_ == evt.key))
    200                 (*(*it).listener_.*(*it).function_)();
     186        for (std::list<BaseInputBufferListenerTuple*>::iterator it = this->listeners_.begin(); it != this->listeners_.end(); ++it)
     187        {
     188            if ((*it)->trueKeyFalseChar_ && ((*it)->key_ == evt.key))
     189                (*it)->callFunction();
    201190        }
    202191
Note: See TracChangeset for help on using the changeset viewer.