Fixing logger and windows version - remove terminal

This commit is contained in:
Vladislav Khorev committed 2026-07-14 20:39:41 +03:00
1 parent 76287dda46
commit a7d17d9afd
27 files changed
+349 -243

No files matched your search

+18 -18
View File
@@ -91,15 +91,15 @@ namespace ZL
if (dx * dx + dz * dz <= removeRadius * removeRadius) {
navigationEditorPoints.erase(it);
rebuildPointsMesh();
std::cout << "[NAV_EDITOR] Removed point, " << navigationEditorPoints.size() << " remaining\n";
logger() << "[NAV_EDITOR] Removed point, " << navigationEditorPoints.size() << " remaining\n";
return;
}
}
std::cout << "[NAV_EDITOR] No point found within " << removeRadius << " units of click\n";
logger() << "[NAV_EDITOR] No point found within " << removeRadius << " units of click\n";
} else {
navigationEditorPoints.push_back(hit);
rebuildPointsMesh();
std::cout << "[NAV_EDITOR] Added point (" << hit.x() << ", " << hit.z()
logger() << "[NAV_EDITOR] Added point (" << hit.x() << ", " << hit.z()
<< "), total: " << navigationEditorPoints.size() << "\n";
}
}
@@ -107,7 +107,7 @@ namespace ZL
void LocationEditor::handleRightClick()
{
if (navigationEditorPoints.size() < 3) {
std::cout << "[NAV_EDITOR] Need at least 3 points to form a polygon (have "
logger() << "[NAV_EDITOR] Need at least 3 points to form a polygon (have "
<< navigationEditorPoints.size() << "); clearing\n";
navigationEditorPoints.clear();
rebuildPointsMesh();
@@ -121,7 +121,7 @@ namespace ZL
}
if (loc.navigation) loc.navigation->addObstaclePolygon(poly);
std::cout << "[NAV_EDITOR] Added obstacle '" << poly.name << "' with "
logger() << "[NAV_EDITOR] Added obstacle '" << poly.name << "' with "
<< poly.polygon.size() << " vertices\n";
{
@@ -150,12 +150,12 @@ namespace ZL
if (!loc.navigation) return;
if (loc.navigation->saveConfig(baseName + ".json"))
std::cout << "[NAV_EDITOR] Saved config to: " << baseName << ".json\n";
logger() << "[NAV_EDITOR] Saved config to: " << baseName << ".json\n";
else
std::cerr << "[NAV_EDITOR] Failed to save config to: " << baseName << ".json\n";
if (loc.navigation->saveGrid(baseName + ".txt"))
std::cout << "[NAV_EDITOR] Saved grid to: " << baseName << ".txt\n";
logger() << "[NAV_EDITOR] Saved grid to: " << baseName << ".txt\n";
else
std::cerr << "[NAV_EDITOR] Failed to save grid to: " << baseName << ".txt\n";
}
@@ -163,7 +163,7 @@ namespace ZL
void LocationEditor::reload()
{
loc.setupNavigation(loc.navigationMapPaths);
std::cout << "[NAV_EDITOR] Reloaded navigation maps (" << loc.navigationMapPaths.size() << " maps)\n";
logger() << "[NAV_EDITOR] Reloaded navigation maps (" << loc.navigationMapPaths.size() << " maps)\n";
}
static VertexDataStruct CreateBoundsBoxMesh(const Eigen::Vector3f corners[8], const Eigen::Vector3f& color)
@@ -290,14 +290,14 @@ namespace ZL
void LocationEditor::selectInteractiveObject(int index)
{
if (index < 0 || index >= static_cast<int>(loc.interactiveObjects.size())) {
std::cout << "[IO_EDITOR] Index " << index << " out of range ("
logger() << "[IO_EDITOR] Index " << index << " out of range ("
<< loc.interactiveObjects.size() << " objects)\n";
return;
}
selectedInteractiveObjectIndex = index;
boundsClickCount = 0;
buildInteractiveObjectBoundsMeshes();
std::cout << "[IO_EDITOR] Selected object " << index
logger() << "[IO_EDITOR] Selected object " << index
<< " (" << loc.interactiveObjects[index].loadedObject.name << ")\n";
}
@@ -305,7 +305,7 @@ namespace ZL
{
if (selectedInteractiveObjectIndex < 0 ||
selectedInteractiveObjectIndex >= static_cast<int>(loc.interactiveObjects.size())) {
std::cout << "[IO_EDITOR] No valid object selected\n";
logger() << "[IO_EDITOR] No valid object selected\n";
return;
}
@@ -316,7 +316,7 @@ namespace ZL
target.state.hasInteractionPosition = true;
boundsClickCount = 0; // cancel any in-progress bounds placement
buildInteractiveObjectBoundsMeshes();
std::cout << "[IO_EDITOR] Interaction position set on object " << selectedInteractiveObjectIndex
logger() << "[IO_EDITOR] Interaction position set on object " << selectedInteractiveObjectIndex
<< " (" << target.loadedObject.name << ")"
<< " at (" << worldHit.x() << ", " << worldHit.z() << ")\n";
return;
@@ -343,7 +343,7 @@ namespace ZL
if (boundsClickCount == 0) {
boundsClickA = worldHit;
boundsClickCount = 1;
std::cout << "[IO_EDITOR] First corner placed at world ("
logger() << "[IO_EDITOR] First corner placed at world ("
<< worldHit.x() << ", " << worldHit.z() << ") — click again for second corner\n";
} else {
const Eigen::Vector3f localA = worldToLocal(boundsClickA);
@@ -358,7 +358,7 @@ namespace ZL
boundsClickCount = 0;
buildInteractiveObjectBoundsMeshes();
std::cout << "[IO_EDITOR] Bounds set on object " << selectedInteractiveObjectIndex
logger() << "[IO_EDITOR] Bounds set on object " << selectedInteractiveObjectIndex
<< " (" << target.loadedObject.name << ")"
<< " min=(" << target.state.boundsMin.x() << ", " << target.state.boundsMin.z() << ")"
<< " max=(" << target.state.boundsMax.x() << ", " << target.state.boundsMax.z() << ")\n";
@@ -419,7 +419,7 @@ namespace ZL
std::ofstream out(filename);
if (out.is_open()) {
out << j.dump(4);
std::cout << "[IO_EDITOR] Saved " << loc.interactiveObjects.size()
logger() << "[IO_EDITOR] Saved " << loc.interactiveObjects.size()
<< " interactive object(s) to " << filename << "\n";
} else {
std::cerr << "[IO_EDITOR] Failed to open " << filename << " for writing\n";
@@ -485,7 +485,7 @@ namespace ZL
loc.gameObjects[data2.name] = std::move(obj2);
editorPlacedObjects.push_back(data2);
std::cout << "[GAME_EDITOR] Placed '" << data.name << "' at ("
logger() << "[GAME_EDITOR] Placed '" << data.name << "' at ("
<< data.positionX << ", " << data.positionZ
<< ") scale=" << data.scale << " rotY=" << data.rotationY << "\n";
}
@@ -493,7 +493,7 @@ namespace ZL
void LocationEditor::saveObjects()
{
if (editorPlacedObjects.empty()) {
std::cout << "[GAME_EDITOR] No editor-placed objects to save\n";
logger() << "[GAME_EDITOR] No editor-placed objects to save\n";
return;
}
@@ -527,7 +527,7 @@ namespace ZL
/*std::ofstream out(filename);
if (out.is_open()) {
out << j.dump(4);
std::cout << "[GAME_EDITOR] Saved " << editorPlacedObjects.size()
logger() << "[GAME_EDITOR] Saved " << editorPlacedObjects.size()
<< " object(s) to " << filename << "\n";
} else {
std::cerr << "[GAME_EDITOR] Failed to open " << filename << " for writing\n";