Example #1
0
 void Data::PostLoad(KeyList<ScaleKey> &keys)
 {
   // keys lists must have at least 2 entries
   //
   if (keys.GetCount() == 0)
   {
     keys.Append( new ScaleKey( 0.0f, scale) );
   }
   if (keys.GetCount() == 1)
   {
     keys.Append( new ScaleKey( 1.0f, keys.GetHead()->scale) );
   }
   keys.KeyList<ScaleKey>::PostLoad();
 }
Example #2
0
  void Data::PostLoad( KeyList<ColorKey> &keys)
  {
    // keys lists must have at least 2 entries
    //
    if (keys.GetCount() == 0)
    {
      keys.Append( new ColorKey( 0.0f, color.r, color.g, color.b, color.a) );
    }
    if (keys.GetCount() == 1)
    {
      ColorKey *key = keys.GetHead();
      Color c = key->color;

      keys.Append( new ColorKey( 1.0f, c.r, c.g, c.b, c.a) );
    }
    keys.KeyList<ColorKey>::PostLoad();
  }
Example #3
0
      ///////////////////////////////////////////////////////////////////////////////
      //
      // Quake::Type  constructor
      //
      Type( FScope * fScope)
      {
        name = StdLoad::TypeString( fScope);

        Effects::Data data;
        FScope * sScope;
        while ((sScope = fScope->NextFunction()) != NULL)
        {
          switch (sScope->NameCrc())
          {
          default:
          {
            // effects helper structure
            //
            if (data.Configure( sScope))
            {
              lifeTime = data.lifeTime;
              sound    = data.objectId;
            }
            break;
          }

          case 0x9FECAD2F: // "QuakeKey"
          {
            F32 f, i, s;

            f = StdLoad::TypeF32( sScope);    // frame
            i = StdLoad::TypeF32( sScope);    // intensity
            s = StdLoad::TypeF32( sScope);    // speed

            keys.Append( new QuakeKey( f, i, s));
            break;
          }
            //
          } // switch
        }

        ASSERT( keys.GetCount() >= 2);

        keys.PostLoad();      // initialize

        typeList.Add( name.crc, this);
      }
Example #4
0
  Bool Data::Configure(FScope *fScope, KeyList<ScaleKey> &keys, U32 counter) // = 1)
  {
    switch (fScope->NameCrc())
    {
    default:
      return FALSE;

    case 0xD7A2677F: // "RadiusKey2"
    case 0x4C7DA445: // "ScaleKey2"
      if (counter != 2)
      {
        return FALSE;
      }
      counter = 1;

    case 0x4FB72CBC: // "RadiusKey"
    case 0x920CA5B2: // "ScaleKey"
    case 0x44FC1D1A: // "TimeKey"
    case 0x5E205EB4: // "StateKey"
      if (counter == 1)
      {
        F32 f = StdLoad::TypeF32( fScope);
        F32 s = StdLoad::TypeF32( fScope);

        keys.Append( new ScaleKey( f, s));
      }
      break;

    case 0xD445F92F: // "StartRadius2"
    case 0x315642BA: // "StartScale2"
      if (counter != 2)
      {
        return FALSE;
      }
      counter = 1;

    case 0x3E50BE22: // "StartRadius"
    case 0x097FD8A4: // "StartScale"
      if (counter == 1)
      {
        ASSERT( keys.GetCount() == 0);

        F32 s = StdLoad::TypeF32( fScope);

        keys.Append( new ScaleKey( 0.0f, s));
      }
      break;

    case 0x9D7F8F83: // "FinishRadius2"
    case 0x25406D61: // "FinishScale2"
      if (counter != 2)
      {
        return FALSE;
      }
      counter = 1;

    case 0x2A4691F9: // "FinishRadius"
    case 0x5D005D56: // "FinishScale"
      if (counter == 1)
      {
        ASSERT( keys.GetCount() == 1);

        F32 s = StdLoad::TypeF32( fScope);

        keys.Append( new ScaleKey( 1.0f, s));
      }
      break;
    }
    return TRUE;
  }
Example #5
0
  Bool Data::Configure(FScope *fScope, KeyList<ColorKey> &keys, U32 counter) // = 1)
  {
    switch (fScope->NameCrc())
    {
    default:
      return FALSE;

    case 0xBA4990AD: // "ColorKey2"
      if (counter != 2)
      {
        return FALSE;
      }
      counter = 1;
      // fall through

    case 0xEB38EC6B: // "ColorKey"
      if (counter == 1)
      {
        F32 f = StdLoad::TypeF32( fScope);
        U32 r = StdLoad::TypeU32( fScope);
        U32 g = StdLoad::TypeU32( fScope);
        U32 b = StdLoad::TypeU32( fScope);
        U32 a = StdLoad::TypeU32( fScope, 255);

        keys.Append( new ColorKey( f, r, g, b, a));
      }
      break;

    case 0x9A8F5250: // "StartColor2"
      if (counter != 2)
      {
        return FALSE;
      }
      counter = 1;

    case 0x2770ACA2: // "StartColor"
      if (counter == 1)
      {
        ASSERT( keys.GetCount() == 0);

        U32 r = StdLoad::TypeU32( fScope);
        U32 g = StdLoad::TypeU32( fScope);
        U32 b = StdLoad::TypeU32( fScope);
        U32 a = StdLoad::TypeU32( fScope, 255);

        keys.Append( new ColorKey( 0.0f, r, g, b, a));
      }
      break;

    case 0x8E997D8B: // "FinishColor2"
      if (counter != 2)
      {
        return FALSE;
      }
      counter = 1;

    case 0x730F2950: // "FinishColor"
      if (counter == 1)
      {
        ASSERT( keys.GetCount() == 1);

        U32 r = StdLoad::TypeU32( fScope);
        U32 g = StdLoad::TypeU32( fScope);
        U32 b = StdLoad::TypeU32( fScope);
        U32 a = StdLoad::TypeU32( fScope, 255);

        keys.Append( new ColorKey( 1.0f, r, g, b, a));
      }
      break;
    }
    return TRUE;
  }