Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4597 in orxonox.OLD for orxonox/trunk/src/util/resource_manager.cc


Ignore:
Timestamp:
Jun 11, 2005, 12:55:48 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: setClassID implemented in all files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/resource_manager.cc

    r4534 r4597  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    4747   \brief standard constructor
    4848*/
    49 ResourceManager::ResourceManager ()
    50 {
    51    this->setClassID(CL_RESOURCE_MANAGER, "ResourceManager");
    52    this->dataDir = NULL;
    53    this->setDataDir("./");
    54    this->imageDirs = new tList<char>();
    55    this->resourceList = new tList<Resource>();
     49ResourceManager::ResourceManager ()
     50{
     51  this->setClassID(CL_RESOURCE_MANAGER, "ResourceManager");
     52  this->setName("ResourceManager");
     53
     54  this->dataDir = NULL;
     55  this->setDataDir("./");
     56  this->imageDirs = new tList<char>();
     57  this->resourceList = new tList<Resource>();
    5658}
    5759
     
    6264   \brief standard destructor
    6365*/
    64 ResourceManager::~ResourceManager (void) 
     66ResourceManager::~ResourceManager (void)
    6567{
    6668  // deleting the Resources-List
     
    106108
    107109/**
    108    \brief checks for the DataDirectory, by looking if 
     110   \brief checks for the DataDirectory, by looking if
    109111   \param fileInside is inisde??
    110112*/
     
    117119      return false;
    118120    }
    119  
     121
    120122  char* testFile = new char[strlen(this->dataDir)+strlen(fileInside)+1];
    121123  sprintf(testFile, "%s%s", this->dataDir, fileInside);
     
    141143      char* tmpDir = tmpImageDirs->nextElement();
    142144      while(tmpDir)
    143         {
    144           if (!strcmp(tmpDir, imageDir))
    145             {
    146               PRINTF(4)("Path %s already loaded\n", imageDir);
    147               delete tmpImageDirs;
    148               return true;
    149             }
    150           tmpDir = tmpImageDirs->nextElement();
    151         }
     145        {
     146          if (!strcmp(tmpDir, imageDir))
     147            {
     148              PRINTF(4)("Path %s already loaded\n", imageDir);
     149              delete tmpImageDirs;
     150              return true;
     151            }
     152          tmpDir = tmpImageDirs->nextElement();
     153        }
    152154      delete tmpImageDirs;
    153155
     
    185187  else if (!strcmp(fileName, "cube") ||
    186188           !strcmp(fileName, "sphere") ||
    187            !strcmp(fileName, "plane") ||
     189           !strcmp(fileName, "plane") ||
    188190           !strcmp(fileName, "cylinder") ||
    189191           !strcmp(fileName, "cone"))
     
    203205#endif /* NO_TEXT */
    204206#ifndef NO_TEXTURES
    205   else 
     207  else
    206208    tmpType = IMAGE;
    207209#endif /* NO_TEXTURES */
     
    221223*/
    222224void* ResourceManager::load(const char* fileName, ResourceType type, ResourcePriority prio,
    223                             void* param1, void* param2, void* param3)
     225                            void* param1, void* param2, void* param3)
    224226{
    225227  // searching if the resource was loaded before.
     
    230232      tmpResource->count++;
    231233      if(tmpResource->prio < prio)
    232         tmpResource->prio = prio;
     234        tmpResource->prio = prio;
    233235    }
    234236  else
     
    248250      // Checking for the type of resource \see ResourceType
    249251      switch(type)
    250         {
     252        {
    251253#ifndef NO_MODEL
    252         case OBJ:
    253           if (param1)
    254             tmpResource->modelSize = *(float*)param1;
    255           else
    256             tmpResource->modelSize = 1.0;
    257 
    258           if(ResourceManager::isFile(fullName))
    259             tmpResource->pointer = new OBJModel(fullName, tmpResource->modelSize);
    260           else
    261             {
    262               PRINTF(2)("Sorry, %s does not exist. Loading a cube-Model instead\n", fullName);
    263               tmpResource->pointer = ResourceManager::load("cube", PRIM, prio, &tmpResource->modelSize);
    264             }
    265           break;
    266         case PRIM:
    267           if (param1)
    268             tmpResource->modelSize = *(float*)param1;
    269           else
    270             tmpResource->modelSize = 1.0;
    271 
    272           if (!strcmp(tmpResource->name, "cube"))
    273             tmpResource->pointer = new PrimitiveModel(PRIM_CUBE, tmpResource->modelSize);
    274           else if (!strcmp(tmpResource->name, "sphere"))
    275             tmpResource->pointer = new PrimitiveModel(PRIM_SPHERE, tmpResource->modelSize);
    276           else if (!strcmp(tmpResource->name, "plane"))
    277             tmpResource->pointer = new PrimitiveModel(PRIM_PLANE, tmpResource->modelSize);
    278           else if (!strcmp(tmpResource->name, "cylinder"))
    279             tmpResource->pointer = new PrimitiveModel(PRIM_CYLINDER, tmpResource->modelSize);
    280           else if (!strcmp(tmpResource->name, "cone"))
    281             tmpResource->pointer = new PrimitiveModel(PRIM_CONE, tmpResource->modelSize);
    282           break;
    283         case MD2:
    284           if(ResourceManager::isFile(fullName))
    285             {
    286               if (param1)
    287                 {
    288                   tmpResource->skinFileName = new char[strlen((const char*)param1)+1];
    289                   strcpy(tmpResource->skinFileName, (const char*) param1);
    290                 }
    291               else
    292                 tmpResource->skinFileName = NULL;
    293               tmpResource->pointer = new MD2Data(fullName, tmpResource->skinFileName);
    294             }
    295               break;
     254        case OBJ:
     255          if (param1)
     256            tmpResource->modelSize = *(float*)param1;
     257          else
     258            tmpResource->modelSize = 1.0;
     259
     260          if(ResourceManager::isFile(fullName))
     261            tmpResource->pointer = new OBJModel(fullName, tmpResource->modelSize);
     262          else
     263            {
     264              PRINTF(2)("Sorry, %s does not exist. Loading a cube-Model instead\n", fullName);
     265              tmpResource->pointer = ResourceManager::load("cube", PRIM, prio, &tmpResource->modelSize);
     266            }
     267          break;
     268        case PRIM:
     269          if (param1)
     270            tmpResource->modelSize = *(float*)param1;
     271          else
     272            tmpResource->modelSize = 1.0;
     273
     274          if (!strcmp(tmpResource->name, "cube"))
     275            tmpResource->pointer = new PrimitiveModel(PRIM_CUBE, tmpResource->modelSize);
     276          else if (!strcmp(tmpResource->name, "sphere"))
     277            tmpResource->pointer = new PrimitiveModel(PRIM_SPHERE, tmpResource->modelSize);
     278          else if (!strcmp(tmpResource->name, "plane"))
     279            tmpResource->pointer = new PrimitiveModel(PRIM_PLANE, tmpResource->modelSize);
     280          else if (!strcmp(tmpResource->name, "cylinder"))
     281            tmpResource->pointer = new PrimitiveModel(PRIM_CYLINDER, tmpResource->modelSize);
     282          else if (!strcmp(tmpResource->name, "cone"))
     283            tmpResource->pointer = new PrimitiveModel(PRIM_CONE, tmpResource->modelSize);
     284          break;
     285        case MD2:
     286          if(ResourceManager::isFile(fullName))
     287            {
     288              if (param1)
     289                {
     290                  tmpResource->skinFileName = new char[strlen((const char*)param1)+1];
     291                  strcpy(tmpResource->skinFileName, (const char*) param1);
     292                }
     293              else
     294                tmpResource->skinFileName = NULL;
     295              tmpResource->pointer = new MD2Data(fullName, tmpResource->skinFileName);
     296            }
     297              break;
    296298#endif /* NO_MODEL */
    297299#ifndef NO_TEXT
    298         case TTF:
    299             if (param1)
    300               tmpResource->ttfSize = *(int*)param1;
    301             else
    302               tmpResource->ttfSize = FONT_DEFAULT_SIZE;
    303             if (param2)
    304               {
    305                 Vector* tmpVec = (Vector*)param2;
    306                 tmpResource->ttfColorR = (int)tmpVec->x;
    307                 tmpResource->ttfColorG = (int)tmpVec->y;
    308                 tmpResource->ttfColorB = (int)tmpVec->z;
    309               }
    310             else
    311               {
    312                 tmpResource->ttfColorR = FONT_DEFAULT_COLOR_R;
    313                 tmpResource->ttfColorG = FONT_DEFAULT_COLOR_G;
    314                 tmpResource->ttfColorB = FONT_DEFAULT_COLOR_B;
    315               }
    316            
    317           if(isFile(fullName))
    318             tmpResource->pointer = new Font(fullName,
    319                                             tmpResource->ttfSize,
    320                                             tmpResource->ttfColorR,
    321                                             tmpResource->ttfColorG,
    322                                             tmpResource->ttfColorB);
    323           else
    324             PRINTF(2)("Sorry, %s does not exist. Not loading Font\n", fullName);
    325           break;
     300        case TTF:
     301            if (param1)
     302              tmpResource->ttfSize = *(int*)param1;
     303            else
     304              tmpResource->ttfSize = FONT_DEFAULT_SIZE;
     305            if (param2)
     306              {
     307                Vector* tmpVec = (Vector*)param2;
     308                tmpResource->ttfColorR = (int)tmpVec->x;
     309                tmpResource->ttfColorG = (int)tmpVec->y;
     310                tmpResource->ttfColorB = (int)tmpVec->z;
     311              }
     312            else
     313              {
     314                tmpResource->ttfColorR = FONT_DEFAULT_COLOR_R;
     315                tmpResource->ttfColorG = FONT_DEFAULT_COLOR_G;
     316                tmpResource->ttfColorB = FONT_DEFAULT_COLOR_B;
     317              }
     318
     319          if(isFile(fullName))
     320            tmpResource->pointer = new Font(fullName,
     321                                            tmpResource->ttfSize,
     322                                            tmpResource->ttfColorR,
     323                                            tmpResource->ttfColorG,
     324                                            tmpResource->ttfColorB);
     325          else
     326            PRINTF(2)("Sorry, %s does not exist. Not loading Font\n", fullName);
     327          break;
    326328#endif /* NO_TEXT */
    327329#ifndef NO_AUDIO
    328         case WAV:
    329           if(isFile(fullName))
    330             tmpResource->pointer = new SoundBuffer(fullName);
    331           break;
     330        case WAV:
     331          if(isFile(fullName))
     332            tmpResource->pointer = new SoundBuffer(fullName);
     333          break;
    332334#endif /* NO_AUDIO */
    333335#ifndef NO_TEXTURES
    334         case IMAGE:
    335           if(isFile(fullName))
    336             {
    337               PRINTF(4)("Image %s resides to %s\n", fileName, fullName);
    338               tmpResource->pointer = new Texture(fullName);
    339             }
    340           else
    341             {
    342               tIterator<char>* iterator = imageDirs->getIterator();
    343               tmpDir = iterator->nextElement();
    344               //tmpDir = imageDirs->enumerate();
    345               while(tmpDir)
    346                 {
    347                   char* imgName = new char[strlen(tmpDir)+strlen(fileName)+1];
    348                   sprintf(imgName, "%s%s", tmpDir, fileName);
    349                   if(isFile(imgName))
    350                     {
    351                       PRINTF(4)("Image %s resides to %s\n", fileName, imgName);
    352                       tmpResource->pointer = new Texture(imgName);
    353                       delete []imgName;
    354                       break;
    355                     }
    356                   delete []imgName;
    357                   tmpDir = iterator->nextElement();
    358                 }
    359               delete iterator;
    360             }
    361           if(!tmpResource)
    362              PRINTF(2)("!!Image %s not Found!!\n", fileName);
    363           break;
     336        case IMAGE:
     337          if(isFile(fullName))
     338            {
     339              PRINTF(4)("Image %s resides to %s\n", fileName, fullName);
     340              tmpResource->pointer = new Texture(fullName);
     341            }
     342          else
     343            {
     344              tIterator<char>* iterator = imageDirs->getIterator();
     345              tmpDir = iterator->nextElement();
     346              //tmpDir = imageDirs->enumerate();
     347              while(tmpDir)
     348                {
     349                  char* imgName = new char[strlen(tmpDir)+strlen(fileName)+1];
     350                  sprintf(imgName, "%s%s", tmpDir, fileName);
     351                  if(isFile(imgName))
     352                    {
     353                      PRINTF(4)("Image %s resides to %s\n", fileName, imgName);
     354                      tmpResource->pointer = new Texture(imgName);
     355                      delete []imgName;
     356                      break;
     357                    }
     358                  delete []imgName;
     359                  tmpDir = iterator->nextElement();
     360                }
     361              delete iterator;
     362            }
     363          if(!tmpResource)
     364             PRINTF(2)("!!Image %s not Found!!\n", fileName);
     365          break;
    364366#endif /* NO_TEXTURES */
    365         default:
    366           tmpResource->pointer = NULL;
    367           PRINTF(1)("No type found for %s.\n   !!This should not happen unless the Type is not supported yet.!!\n", tmpResource->name);
    368           break;
    369         }
     367        default:
     368          tmpResource->pointer = NULL;
     369          PRINTF(1)("No type found for %s.\n   !!This should not happen unless the Type is not supported yet.!!\n", tmpResource->name);
     370          break;
     371        }
    370372      if (tmpResource->pointer)
    371         this->resourceList->add(tmpResource);
     373        this->resourceList->add(tmpResource);
    372374      delete []fullName;
    373375    }
    374376  if (tmpResource->pointer)
    375377    return tmpResource->pointer;
    376   else 
     378  else
    377379    {
    378380      PRINTF(2)("Resource %s could not be loaded\n", fileName);
     
    413415    {
    414416      if (resource->count <= 0)
    415         {
    416           // deleting the Resource
    417           switch(resource->type)
    418             {
     417        {
     418          // deleting the Resource
     419          switch(resource->type)
     420            {
    419421#ifndef NO_MODEL
    420             case OBJ:
    421             case PRIM:
    422               delete (Model*)resource->pointer;
    423               break;
    424             case MD2:
    425               delete (MD2Data*)resource->pointer;
    426               break;
     422            case OBJ:
     423            case PRIM:
     424              delete (Model*)resource->pointer;
     425              break;
     426            case MD2:
     427              delete (MD2Data*)resource->pointer;
     428              break;
    427429#endif /* NO_MODEL */
    428430#ifndef NO_AUDIO
    429             case WAV:
    430               delete (SoundBuffer*)resource->pointer;
    431               break;
     431            case WAV:
     432              delete (SoundBuffer*)resource->pointer;
     433              break;
    432434#endif /* NO_AUDIO */
    433435#ifndef NO_TEXT
    434             case TTF:
    435               delete (Font*)resource->pointer;
    436               break;
     436            case TTF:
     437              delete (Font*)resource->pointer;
     438              break;
    437439#endif /* NO_TEXT */
    438440#ifndef NO_TEXTURES
    439             case IMAGE:
    440               delete (Texture*)resource->pointer;
    441               break;
     441            case IMAGE:
     442              delete (Texture*)resource->pointer;
     443              break;
    442444#endif /* NO_TEXTURES */
    443             default:
    444               PRINTF(1)("NOT YET IMPLEMENTED !!FIX FIX!!\n");
    445               return false;
    446               break;
    447             }
    448           // deleting the List Entry:
    449           PRINTF(4)("Resource %s safely removed.\n", resource->name);
    450           delete []resource->name;
    451           this->resourceList->remove(resource);
    452         }
     445            default:
     446              PRINTF(1)("NOT YET IMPLEMENTED !!FIX FIX!!\n");
     447              return false;
     448              break;
     449            }
     450          // deleting the List Entry:
     451          PRINTF(4)("Resource %s safely removed.\n", resource->name);
     452          delete []resource->name;
     453          this->resourceList->remove(resource);
     454        }
    453455      else
    454         PRINTF(4)("Resource %s not removed, because there are still %d References to it.\n", resource->name, resource->count);
     456        PRINTF(4)("Resource %s not removed, because there are still %d References to it.\n", resource->name, resource->count);
    455457    }
    456458  else
     
    471473    {
    472474      if (enumRes->prio <= prio)
    473         if (enumRes->count == 0)
    474           unload(enumRes, prio);
    475         else
    476           PRINTF(2)("unable to unload %s because there are still %d references to it\n",
    477                    enumRes->name, enumRes->count);
     475        if (enumRes->count == 0)
     476          unload(enumRes, prio);
     477        else
     478          PRINTF(2)("unable to unload %s because there are still %d references to it\n",
     479                   enumRes->name, enumRes->count);
    478480      //enumRes = resourceList->nextElement();
    479481      enumRes = iterator->nextElement();
     
    492494*/
    493495Resource* ResourceManager::locateResourceByInfo(const char* fileName, ResourceType type,
    494                                                 void* param1, void* param2, void* param3)
     496                                                void* param1, void* param2, void* param3)
    495497{
    496498  //  Resource* enumRes = resourceList->enumerate();
     
    500502    {
    501503      if (enumRes->type == type && !strcmp(fileName, enumRes->name))
    502         {
    503           bool match = false;
    504           bool subMatch = false;
    505 
    506           switch (type)
    507             {
     504        {
     505          bool match = false;
     506          bool subMatch = false;
     507
     508          switch (type)
     509            {
    508510#ifndef NO_MODEL
    509             case PRIM:
    510             case OBJ:
    511               if (!param1)
    512                 {
    513                   if (enumRes->modelSize == 1.0)
    514                     match = true;
    515                 }
    516               else if (enumRes->modelSize == *(float*)param1)
    517                 match = true;
    518               break;
    519             case MD2:
    520               if (!param1)
    521                 {
    522                   if (enumRes->skinFileName == NULL)
    523                     match = true;
    524                 }
    525               else if (!strcmp(enumRes->skinFileName, (const char*) param1))
    526                 match = true;
    527               break;
     511            case PRIM:
     512            case OBJ:
     513              if (!param1)
     514                {
     515                  if (enumRes->modelSize == 1.0)
     516                    match = true;
     517                }
     518              else if (enumRes->modelSize == *(float*)param1)
     519                match = true;
     520              break;
     521            case MD2:
     522              if (!param1)
     523                {
     524                  if (enumRes->skinFileName == NULL)
     525                    match = true;
     526                }
     527              else if (!strcmp(enumRes->skinFileName, (const char*) param1))
     528                match = true;
     529              break;
    528530#endif /* NO_MODEL */
    529531#ifndef NO_TEXT
    530             case TTF:
    531               if (!param1)
    532                 {
    533                   if (enumRes->ttfSize == FONT_DEFAULT_SIZE)
    534                     subMatch = true;
    535                 }
    536               else if (enumRes->modelSize =- *(int*)param1)
    537                 subMatch = true;
    538               if(subMatch)
    539                 {
    540                   Vector* tmpVec = (Vector*)param2;
    541                   if (!param2)
    542                     {
    543                       if(enumRes->ttfColorR == FONT_DEFAULT_COLOR_R &&
    544                         enumRes->ttfColorG == FONT_DEFAULT_COLOR_G &&
    545                         enumRes->ttfColorB == FONT_DEFAULT_COLOR_B )
    546                         match = true;
    547                     }
    548                   else if (enumRes->ttfColorR == (int)tmpVec->x &&
    549                            enumRes->ttfColorG == (int)tmpVec->y &&
    550                            enumRes->ttfColorB == (int)tmpVec->z )
    551                     match = true;
    552                 }
    553               break;
     532            case TTF:
     533              if (!param1)
     534                {
     535                  if (enumRes->ttfSize == FONT_DEFAULT_SIZE)
     536                    subMatch = true;
     537                }
     538              else if (enumRes->modelSize =- *(int*)param1)
     539                subMatch = true;
     540              if(subMatch)
     541                {
     542                  Vector* tmpVec = (Vector*)param2;
     543                  if (!param2)
     544                    {
     545                      if(enumRes->ttfColorR == FONT_DEFAULT_COLOR_R &&
     546                        enumRes->ttfColorG == FONT_DEFAULT_COLOR_G &&
     547                        enumRes->ttfColorB == FONT_DEFAULT_COLOR_B )
     548                        match = true;
     549                    }
     550                  else if (enumRes->ttfColorR == (int)tmpVec->x &&
     551                           enumRes->ttfColorG == (int)tmpVec->y &&
     552                           enumRes->ttfColorB == (int)tmpVec->z )
     553                    match = true;
     554                }
     555              break;
    554556#endif /* NO_TEXT */
    555             default:
    556               match = true;
    557               break;
    558             }
    559           if (match)
    560             {
    561               delete iterator;
    562               return enumRes;
    563             }
    564         }
     557            default:
     558              match = true;
     559              break;
     560            }
     561          if (match)
     562            {
     563              delete iterator;
     564              return enumRes;
     565            }
     566        }
    565567      enumRes = iterator->nextElement();
    566568    }
     
    582584    {
    583585      if (pointer == enumRes->pointer)
    584         {
    585           delete iterator;
    586           return enumRes;
    587         }
     586        {
     587          delete iterator;
     588          return enumRes;
     589        }
    588590      enumRes = iterator->nextElement();
    589591    }
     
    622624      if (status.st_mode & (S_IFDIR
    623625#ifndef __WIN32__
    624                             | S_IFLNK
     626                            | S_IFLNK
    625627#endif
    626                             ))
    627         {
    628           delete tmpDirName;
    629           return true;
    630         }
     628                            ))
     629        {
     630          delete tmpDirName;
     631          return true;
     632        }
    631633      else
    632         {
    633           delete tmpDirName;
    634           return false;
    635         }
     634        {
     635          delete tmpDirName;
     636          return false;
     637        }
    636638    }
    637639  else
     
    653655  if (!stat(tmpFileName, &status))
    654656    {
    655       if (status.st_mode & (S_IFREG 
     657      if (status.st_mode & (S_IFREG
    656658#ifndef __WIN32__
    657                             | S_IFLNK
     659                            | S_IFLNK
    658660#endif
    659                             ))
    660         {
    661           delete tmpFileName;
    662           return true;
    663         }
     661                            ))
     662        {
     663          delete tmpFileName;
     664          return true;
     665        }
    664666      else
    665         {
    666           delete tmpFileName;
    667           return false;
    668         }
    669     }
    670   else 
     667        {
     668          delete tmpFileName;
     669          return false;
     670        }
     671    }
     672  else
    671673    {
    672674      delete tmpFileName;
     
    691693    }
    692694  fclose(stream);
    693    
    694   delete tmpName; 
     695
     696  delete tmpName;
    695697}
    696698
     
    708710}
    709711
    710 /** 
     712/**
    711713    \param name the Name of the file to check
    712714    \returns The name of the file, including the HomeDir
     
    737739}
    738740
    739 /** 
     741/**
    740742    \param fileName the Name of the File to check
    741743    \returns The full name of the file, including the DataDir, and NULL if the file does not exist
     
    748750
    749751  char* retName = new char[strlen(ResourceManager::getInstance()->getDataDir())
    750                            + strlen(fileName) + 1];
     752                           + strlen(fileName) + 1];
    751753  sprintf(retName, "%s%s", ResourceManager::getInstance()->getDataDir(), fileName);
    752754  if (ResourceManager::isFile(retName) || ResourceManager::isDir(retName))
     
    790792      PRINT(0)("Name: %s; References: %d; Type:", enumRes->name, enumRes->count);
    791793      switch (enumRes->type)
    792         {
    793         case OBJ:
    794           PRINT(0)("ObjectModel\n");
    795           break;
    796         case PRIM:
    797           PRINT(0)("PrimitiveModel\n");
    798           break;
    799         case IMAGE:
    800           PRINT(0)("ImageFile (Texture)\n");
    801           break;
    802         default:
    803           PRINT(0)("SoundFile\n");
    804           break;
    805         }
     794        {
     795        case OBJ:
     796          PRINT(0)("ObjectModel\n");
     797          break;
     798        case PRIM:
     799          PRINT(0)("PrimitiveModel\n");
     800          break;
     801        case IMAGE:
     802          PRINT(0)("ImageFile (Texture)\n");
     803          break;
     804        default:
     805          PRINT(0)("SoundFile\n");
     806          break;
     807        }
    806808      PRINT(0)("gets deleted at ");
    807809      switch(enumRes->prio)
    808         {
    809         default:
    810         case RP_NO:
    811           PRINT(0)("first posibility (0)\n");
    812           break;
    813         case RP_LEVEL:
    814           PRINT(0)("the end of the Level (1)\n");
    815           break;
    816         case RP_CAMPAIGN:
    817           PRINT(0)("the end of the campaign (2)\n");
    818           break;
    819         case RP_GAME:
    820           PRINT(0)("when leaving the game (3)\n");
    821           break;
    822         }
     810        {
     811        default:
     812        case RP_NO:
     813          PRINT(0)("first posibility (0)\n");
     814          break;
     815        case RP_LEVEL:
     816          PRINT(0)("the end of the Level (1)\n");
     817          break;
     818        case RP_CAMPAIGN:
     819          PRINT(0)("the end of the campaign (2)\n");
     820          break;
     821        case RP_GAME:
     822          PRINT(0)("when leaving the game (3)\n");
     823          break;
     824        }
    823825      enumRes = iterator->nextElement();
    824826    }
Note: See TracChangeset for help on using the changeset viewer.