/// <summary>Registers a texture and returns a handle to the texture.</summary> /// <param name="texture">The texture data.</param> /// <param name="parameters">The parameters that specify how to process the texture.</param> /// <param name="handle">Receives the handle to the texture.</param> /// <returns>Whether loading the texture was successful.</returns> public override bool RegisterTexture(OpenBveApi.Textures.Texture texture, OpenBveApi.Textures.TextureParameters parameters, out OpenBveApi.Textures.TextureHandle handle) { texture = texture.ApplyParameters(parameters); handle = Textures.RegisterTexture(texture); return(true); }
/// <summary>Registers a texture and returns a handle to the texture.</summary> /// <param name="path">The path to the file or folder that contains the texture.</param> /// <param name="parameters">The parameters that specify how to process the texture.</param> /// <param name="handle">Receives the handle to the texture.</param> /// <returns>Whether loading the texture was successful.</returns> public override bool RegisterTexture(string path, OpenBveApi.Textures.TextureParameters parameters, out OpenBveApi.Textures.TextureHandle handle) { if (System.IO.File.Exists(path) || System.IO.Directory.Exists(path)) { Textures.Texture data; if (Textures.RegisterTexture(path, parameters, out data)) { handle = data; return(true); } } else { ReportProblem(OpenBveApi.Hosts.ProblemType.PathNotFound, path); } handle = null; return(false); }