コード例 #1
0
ファイル: ev_static.cpp プロジェクト: Blastfrog/eternity
//
// EV_HereticSpecialForStaticInit
//
// Always looks up a special in the Heretic gamemode's static init list, 
// regardless of the map format or gamemode in use. Returns 0 if no such 
// special exists.
//
int EV_HereticSpecialForStaticInit(int staticFn)
{
   // There is only one difference between Heretic and DOOM regarding static
   // init specials; line type 99 is equivalent to BOOM extended type 85, 
   // scroll line right.

   if(staticFn == EV_STATIC_SCROLL_LINE_RIGHT)
      return 99;

   return EV_DOOMSpecialForStaticInit(staticFn);
}
コード例 #2
0
ファイル: ev_static.cpp プロジェクト: Blastfrog/eternity
//
// EV_PSXSpecialForStaticInit
//
// Always looks up a special in the PSX mission's static init list, regardless
// of the map format or gamemode in use. Returns 0 if no such special exists.
//
int EV_PSXSpecialForStaticInit(int staticFn)
{
   // small set, so, linear search
   for(size_t i = 0; i < earrlen(PSXStaticBindings); i++)
   {
      if(PSXStaticBindings[i].staticFn == staticFn)
         return PSXStaticBindings[i].actionNumber;
   }

   // otherwise, check the DOOM lookup
   return EV_DOOMSpecialForStaticInit(staticFn);
}
コード例 #3
0
ファイル: ev_static.cpp プロジェクト: chungy/eternity
//
// EV_SpecialForStaticInit
//
// Pass in the symbolic static function name you want the line special for; it
// will return the line special number currently bound to that function for the
// currently active map type. If zero is returned, that static function has no
// binding for the current map.
//
int EV_SpecialForStaticInit(int staticFn)
{
   switch(LevelInfo.mapFormat)
   {
   case LEVEL_FORMAT_HEXEN:
      return EV_HexenSpecialForStaticInit(staticFn);
   case LEVEL_FORMAT_PSX:
      return EV_PSXSpecialForStaticInit(staticFn);
   default:
      switch(LevelInfo.levelType)
      {
      case LI_TYPE_DOOM: 
      default:
         return EV_DOOMSpecialForStaticInit(staticFn);
      case LI_TYPE_HERETIC:
      case LI_TYPE_HEXEN:   // matches ZDoom's default behavior
         return EV_HereticSpecialForStaticInit(staticFn);
      case LI_TYPE_STRIFE:
         return EV_StrifeSpecialForStaticInit(staticFn);
      }
   }      
}