Skip to content

Commit

Permalink
some fallbacks for older maps, disclaimer in readme for older maps
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWillard committed Nov 21, 2021
1 parent 23d059b commit 3601cc4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Although we would say that using `grad_meh` is intuitive and mostly self-explana
- To reduce complexity we only allow one export process at a time.
- To reduce complexity it is not possible to stop a running export reliably, except by killing the game.
- MEH cannot export maps included in `.ebo` files, because those are encrypted and therefore we cannot get to the map files.
- MEH will have some difficulties with older maps (e.g. Fallujah, Clafghan), where it fails to export roads and tile the sat image correctly.

## Output
We export the following from Arma 3 maps:
Expand Down
11 changes: 11 additions & 0 deletions src/geojsons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,13 @@ void writeGeojsons(grad_aff::Wrp& wrp, std::filesystem::path& basePathGeojson, c
}

auto pboPath = findPboPath(modelPath);

if (pboPath.empty()) {
modelMapTypes[i] = {};
modelInfos[i] = {};
break;
}

std::shared_ptr<grad_aff::Pbo> pbo = {};
auto res = pboMap.find(pboPath);
if (res == pboMap.end()) {
Expand Down Expand Up @@ -843,6 +850,10 @@ void writeGeojsons(grad_aff::Wrp& wrp, std::filesystem::path& basePathGeojson, c
for (int j = 0; j < odol.lods.size(); j++) {
if (odol.lods[j].lodType == LodType::SPECIAL_LOD) {
geoIndex = j;
break;
}
if (geoIndex == -1 && odol.lods[j].lodType == LodType::GEOMETRY) { // Fallback
geoIndex = j;
}
}
auto memLod = odol.readLod(geoIndex);
Expand Down
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ void writePreviewImage(const std::string& worldName, std::filesystem::path& base
}

auto pboPath = findPboPath(picturePath);

if (pboPath.empty()) {
return;
}

grad_aff::Pbo prewviewPbo(pboPath.string());

auto paa = grad_aff::Paa();
Expand Down

0 comments on commit 3601cc4

Please sign in to comment.