Example #1
0
        /// <summary>
        /// Registers a <see cref="Duality.Resources.Sound">Sounds</see> playing instance.
        /// </summary>
        /// <param name="snd">The Sound that is playing.</param>
        /// <param name="is3D">Whether the instance is 3d or not.</param>
        internal void RegisterPlaying(ContentRef <Sound> snd, bool is3D)
        {
            if (is3D)
            {
                this.numPlaying3D++;
            }
            else
            {
                this.numPlaying2D++;
            }

            if (snd.IsAvailable && !snd.IsRuntimeResource)
            {
                if (!this.resPlaying.ContainsKey(snd.Path))
                {
                    this.resPlaying.Add(snd.Path, 1);
                }
                else
                {
                    this.resPlaying[snd.Path]++;
                }
            }
        }
Example #2
0
 public DebuggerTypeProxy(ContentRef <T> cr)
 {
     this.cr = cr;
 }
Example #3
0
 public bool Equals(ContentRef <T> other)
 {
     return(this == other);
 }
Example #4
0
 /// <summary>
 /// Performs a single render cycle.
 /// </summary>
 /// <param name="target">
 /// The <see cref="RenderTarget"/> which will be used for all rendering output.
 /// "null" means rendering directly to the output buffer of the game window / screen.
 /// </param>
 /// <param name="viewportRect">The viewport to render to, in pixel coordinates.</param>
 /// <param name="imageSize">Target size of the rendered image before adjusting it to fit the specified viewport.</param>
 public static void Render(ContentRef <RenderTarget> target, Rect viewportRect, Vector2 imageSize)
 {
     Scene.Current.Render(target, viewportRect, imageSize);
 }
Example #5
0
 public ResourceEventArgs(ContentRef <Resource> resRef, bool isDirectory = false)
 {
     this.content     = resRef;
     this.isResource  = !isDirectory;
     this.isDirectory = isDirectory;
 }
Example #6
0
 public void AddVertices <T>(ContentRef <Material> material, VertexMode vertexMode, T[] vertexBuffer, int vertexCount) where T : struct, IVertexData
 {
     this.AddVertices <T>(material.IsAvailable ? material.Res.InfoDirect : Material.Checkerboard.Res.InfoDirect, vertexMode, vertexBuffer, vertexCount);
 }
Example #7
0
 internal SoundInstance(ContentRef <Sound> sound)
 {
     this.sound     = sound;
     this.is3D      = false;
     this.audioData = this.sound.IsAvailable ? this.sound.Res.FetchData() : null;
 }
Example #8
0
 public void AddVertices <T>(ContentRef <Material> material, VertexMode vertexMode, params T[] vertices) where T : struct, IVertexData
 {
     this.AddVertices <T>(material.IsAvailable ? material.Res.InfoDirect : Material.Checkerboard.Res.InfoDirect, vertexMode, vertices, vertices.Length);
 }
Example #9
0
 internal SoundInstance(ContentRef <Sound> snd)
 {
     this.snd  = snd;
     this.is3D = false;
 }
Example #10
0
 internal SoundInstance(ContentRef <Sound> snd, Vector3 pos)
 {
     this.pos  = pos;
     this.is3D = true;
     this.snd  = snd;
 }
Example #11
0
 internal SoundInstance(ContentRef <Sound> snd, GameObject attachObj)
 {
     this.attachedTo = attachObj;
     this.is3D       = true;
     this.snd        = snd;
 }
Example #12
0
 public ResourceSaveEventArgs(ContentRef <Resource> resRef, string saveAsPath) : base(resRef)
 {
     this.saveAsPath = saveAsPath;
 }