Пример #1
0
 private static void AddNonRenderableRotations()
 {
     // These two frame names should never have any rendering done with
     // them. NULLA is from ZDoom (I believe), and TNT1A I think is...
     // from TNT? Either way, they are meant to be a "do not draw".
     foreach (string name in new[] { "NULLA", "TNT1A" })
     {
         spriteRotations[name] = new SpriteRotations(name);
     }
 }
Пример #2
0
        /// <summary>
        /// Gets the sprite for the provided sprite/frame, or creates one if it
        /// does not exist.
        /// </summary>
        /// <param name="spriteAndFrame">The name of the sprite to look up (ex:
        /// "PLAYD"). This must contain the frame (or 5th letter).</param>
        /// <returns>The sprite rotations, or a default value of missing images
        /// if the sprite/frame is an empty string.</returns>
        public static SpriteRotations Rotations(UpperString spriteAndFrame)
        {
            if (spriteAndFrame.Empty())
            {
                return(NullRotations);
            }

            if (spriteRotations.TryGetValue(spriteAndFrame, out SpriteRotations rotations))
            {
                return(rotations);
            }

            SpriteRotations newRotations = CreateSpriteFrom(spriteAndFrame);

            spriteRotations[spriteAndFrame] = newRotations;
            return(newRotations);
        }