Prefer DDS over PNG for orthophoto
This commit is contained in:
@@ -224,7 +224,19 @@ namespace simgear {
|
||||
|
||||
for (const auto& scenery_path : scenery_paths) {
|
||||
SGPath path = scenery_path / "Orthophotos" / bucket_path / std::to_string(bucket.gen_index());
|
||||
|
||||
|
||||
SGPath dds_path = path;
|
||||
dds_path.concat(".dds");
|
||||
if (dds_path.exists()) {
|
||||
ImageRef image = osgDB::readRefImageFile(dds_path.str());
|
||||
if (!image) {
|
||||
return nullptr;
|
||||
}
|
||||
const Texture2DRef texture = textureFromImage(image);
|
||||
const OrthophotoBounds bbox = OrthophotoBounds::fromBucket(bucket);
|
||||
return new Orthophoto(texture, bbox);
|
||||
}
|
||||
|
||||
SGPath png_path = path;
|
||||
png_path.concat(".png");
|
||||
if (png_path.exists()) {
|
||||
@@ -237,18 +249,6 @@ namespace simgear {
|
||||
const OrthophotoBounds bbox = OrthophotoBounds::fromBucket(bucket);
|
||||
return new Orthophoto(texture, bbox);
|
||||
}
|
||||
|
||||
SGPath dds_path = path;
|
||||
dds_path.concat(".dds");
|
||||
if (dds_path.exists()) {
|
||||
ImageRef image = osgDB::readRefImageFile(dds_path.str());
|
||||
if (!image) {
|
||||
return nullptr;
|
||||
}
|
||||
const Texture2DRef texture = textureFromImage(image);
|
||||
const OrthophotoBounds bbox = OrthophotoBounds::fromBucket(bucket);
|
||||
return new Orthophoto(texture, bbox);
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user