public override bool QueryTextureDimensions(string path, out int width, out int height) {
if (System.IO.File.Exists(path) || System.IO.Directory.Exists(path)) {
for (int i = 0; i < Plugins.LoadedPlugins.Length; i++) {
if (Plugins.LoadedPlugins[i].Texture != null) {
try {
if (Plugins.LoadedPlugins[i].Texture.CanLoadTexture(path)) {
try {
if (Plugins.LoadedPlugins[i].Texture.QueryTextureDimensions(path, out width, out height)) {
return true;
}
Interface.AddMessage(Interface.MessageType.Error, false,
"Plugin " + Plugins.LoadedPlugins[i].Title + " returned unsuccessfully at QueryTextureDimensions"
);
} catch (Exception ex) {
Interface.AddMessage(Interface.MessageType.Error, false,
"Plugin " + Plugins.LoadedPlugins[i].Title + " raised the following exception at QueryTextureDimensions:" + ex.Message
);
}
}
} catch (Exception ex) {
Interface.AddMessage(Interface.MessageType.Error, false,
"Plugin " + Plugins.LoadedPlugins[i].Title + " raised the following exception at CanLoadTexture:" + ex.Message
);
}
}
}
Interface.AddMessage(Interface.MessageType.Error, false,
"No plugin found that is capable of loading texture " + path
);
} else {
ReportProblem(OpenBveApi.Hosts.ProblemType.PathNotFound, path.ToString());
}
width = 0;
height = 0;
return false;
}