Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4873 in orxonox.OLD for orxonox/trunk/src/lib


Ignore:
Timestamp:
Jul 15, 2005, 12:37:31 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: temporary fix in the EvenetHandler
EVENT_NUMBER is not a maximum value of events, but merely a count of how many differnent kinds of events there are
FIXME

Location:
orxonox/trunk/src/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/event/event_def.h

    r4836 r4873  
    11/*!
    2     \file event_def.h
    3   * some central definitions
     2 * @file event_def.h
     3 * some central definitions
    44
    55*/
     
    3434  EV_UNKNOWN,
    3535
    36   EV_NUMBER,
     36  EV_NUMBER = 500,  //!< FIXME MSUT Resolve this EV_NUMBER should hold all the Events, also the count of other events
    3737};
    3838
  • orxonox/trunk/src/lib/event/event_handler.cc

    r4872 r4873  
    2424#include "compiler.h"
    2525#include "debug.h"
     26#include "class_list.h"
    2627
    2728using namespace std;
     
    4243  for(int i = 0; i < ES_NUMBER; ++i)
    4344    {
    44       for(int j = 0; j < SDLK_LAST; ++j)
     45      for(int j = 0; j < EV_NUMBER; ++j)
    4546        {
    4647          this->listeners[i][j] = NULL;
     
    277278      PRINT(4)("=  Got Event nr %i, for state %i", ev.type, this->state);
    278279
     280      //! @todo fix this debug code away */
     281      ////////////////////////////////////////////////////////////////
    279282      listener = this->listeners[this->state][ev.type];
     283      if (!ClassList::exists(listener, CL_EVENT_LISTENER) && listener != NULL)
     284      {
     285        ClassList::debug(3, CL_EVENT_LISTENER);
     286        this->debug();
     287        printf("ERROR THIS EVENT DOES NOT EXIST\n");
     288        return;
     289      }
     290      ////////////////////////////////////////////////////////////////
    280291      if( listener != NULL)
    281292        {
     
    304315      if( this->listeners[i][j] != NULL)
    305316      {
    306         PRINT(0)("Event %d of State %d subscribed to %s\n", j, i, this->listeners[i][j]->getName());
     317        PRINT(0)("Event %d of State %d subscribed to %s (%p)\n", j, i, this->listeners[i][j]->getName(), this->listeners[i][j]);
    307318      }
    308319    }
  • orxonox/trunk/src/lib/lang/class_list.cc

    r4872 r4873  
    211211 * @param classID the class that should be displayed (if CL_NULL (default) all classes will be displayed)
    212212 */
    213     void ClassList::debug(unsigned int debugLevel, long classID)
     213void ClassList::debug(unsigned int debugLevel, long classID)
    214214{
    215215  if (debugLevel > 3)
     
    244244        while (enumBO)
    245245        {
    246           PRINT(0)("|   (class %s): NAME(%s)->%p\n", enumBO->getClassName(), enumBO->getName(), enumBO);
     246          PRINT(0)("|   (class %s): NAME(%s)->%p ", enumBO->getClassName(), enumBO->getName(), enumBO);
    247247          if (debugLevel == 3)
    248248            enumBO->whatIs();
     249          else
     250          {
     251            PRINT(0)("\n");
     252          }
    249253          enumBO = iterator->nextElement();
    250254        }
Note: See TracChangeset for help on using the changeset viewer.