Skip to content

Commit

Permalink
ed tools fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cryham committed Sep 16, 2024
1 parent 47864f7 commit 1c90ce2
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion data/gui/Editor_Options.layout
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@
</Widget>

<Widget type="TextBox" skin="TextBox" position="32 320 172 24">
<Property key="Caption" value="#{Horizon} #{Horizon} #{max} ##"/>
<Property key="Caption" value="#{Horizon} #{max} ##"/>
<Property key="TextColour" value="0.4 1 1"/>
</Widget>
<Widget type="Slider" skin="Slider" position="280 320 320 18" name="Horizons"/>
Expand Down
6 changes: 3 additions & 3 deletions src/common/GuiCom_Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ void CGuiCom::GuiInitGraphics() // ? not yet: called on preset change with bGI

sv= &svHorTrees; sv->Init("HorTrees", &pSet->veg.hor_trees, 0.0f,1.f); sv->DefaultF(0.5f);
sv= &svHorTreesDist;sv->Init("HorTreesDist",&pSet->veg.hor_trees_dist, 0.0f,1.f); sv->DefaultF(0.5f);
sv= &svHorBush; sv->Init("HorBush", &pSet->veg.hor_bushes, 0.0f,1.f); sv->DefaultF(0.3f);
sv= &svHorBushDist; sv->Init("HorBushDist", &pSet->veg.hor_bushes_dist,0.0f,1.f); sv->DefaultF(0.3f);
sv= &svVegetLimit; sv->Init("VegetLimit", &pSet->veg.limit, 0, 100000); sv->DefaultI(10000);
sv= &svHorBush; sv->Init("HorBush", &pSet->veg.hor_bushes, 0.0f,1.f); sv->DefaultF(0.f);
sv= &svHorBushDist; sv->Init("HorBushDist", &pSet->veg.hor_bushes_dist,0.0f,1.f); sv->DefaultF(0.f);
sv= &svVegetLimit; sv->Init("VegetLimit", &pSet->veg.limit, 0, 100000); sv->DefaultI(20000);
BtnC("ApplyVeget", btnVegetApply); BtnC("VegetReset", btnVegetReset);
BtnC("HorApplyVeget", btnVegetApply);

Expand Down
6 changes: 4 additions & 2 deletions src/common/SceneVeget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ void CScene::CreateVegets()
continue;
bool horiz = td.iHorizon == 1;
if (horiz) // less dist
tws *= pSet->veg.hor_trees_dist;
{ tws *= pSet->veg.hor_trees_dist;
LogO("C--V Create Veget on Horizon");
}

// density
// Real horizMul = 1.f; // /*1.f / */ (1.f + td.iHorizon * 23);
Expand Down Expand Up @@ -153,7 +155,7 @@ void CScene::CreateVegets()
//----------------------------------------------------------------
int cnt = 6000 * vg.dens * (veg->bush ? fBushes : fTrees); // old
int all = 0; // stat
LogO("tws: "+fToStr(tws)+" tr cnt: "+toStr(cnt)+" c/t2: "+fToStr(cnt/tws/tws,8,10)); //-
// LogO("tws: "+fToStr(tws)+" tr cnt: "+toStr(cnt)+" c/t2: "+fToStr(cnt/tws/tws,8,10)); //-
// LogO(String("col? ")+(col?"y":"n")+ " ofs x "+fToStr(ofs.x,2)+ " z "+fToStr(ofs.y,2));

for (int i = 0; i < cnt; ++i)
Expand Down
11 changes: 6 additions & 5 deletions src/common/Tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void CGui::ToolTracksWarnings()
} }

LogO("Track: "+trk);
LogO("ters: "+toStr(sc.tds.size()));
LogO("terrains: "+toStr(sc.tds.size()));
TrackWarn tw = WarningsCheck(&sc, vRoads);

if (tw.hq < min_hq) min_hq = tw.hq; if (tw.hq > max_hq) max_hq = tw.hq;
Expand Down Expand Up @@ -185,9 +185,10 @@ void CGui::ToolSceneXml()
if (td.iHorizon >= 2)
{ td.fVeget = 0.f; modif = 1; }
if (td.iHorizon == 1)
{ td.fVeget = 0.2f; modif = 1; }
{ td.fVeget = 0.3f; modif = 1; }
}
LogO(trk + " ^^ ter: "+toStr(t) + " veget " + fToStr(td.fVeget));
if (td.fVeget != 1.f)
LogO(trk + " ^^ ter: "+toStr(t) + " veget " + fToStr(td.fVeget));
#endif
}

Expand Down Expand Up @@ -219,10 +220,10 @@ void CGui::ToolSceneXml()
if (!data->pre->GetRoad(s))
LogO(trk +" "+ fname + r +" Not Found in presets !!! " + s);

if (rd.IsRoad() &&
/*if (rd.IsRoad() &&
StringUtil::startsWith(s, "River") &&
!StringUtil::endsWith(s, "_lq")) // todo?-
LogO(trk +" "+ fname + r +" river mtr must end with _lq !! " + s);
LogO(trk +" "+ fname + r +" river mtr must end with _lq !! " + s);*/
}
//sMtrWall,sMtrWallPipe, sMtrCol
//sc.td.layerRoad
Expand Down
6 changes: 3 additions & 3 deletions src/editor/Warnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ CGui::TrackWarn CGui::WarningsCheck(const Scene* sc, const std::vector<SplineRoa
if (lay <= 2) Warn(INFO, "Too few terrain layers used");
++i;
}
if (!hqHoriz && ters == 1){ Warn(WARN, "No Horizon terrain"); tw.horiz++; }
if (!hqHoriz && ters > 1){ Warn(WARN, "No Horizon terrain or no terrain marked as Horizon > 0"); tw.horiz++; }
if (hqHoriz) Warn(INFO, "HQ Horizon");
if (!hqHoriz && ters == 1) Warn(WARN, "No Horizon terrain");
if (!hqHoriz && ters > 1) Warn(WARN, "No Horizon terrain or no terrain marked as Horizon > 0");
if (hqHoriz) { Warn(INFO, "HQ Horizon"); tw.horiz++; }


/// 🌳🪨 Vegetation
Expand Down

0 comments on commit 1c90ce2

Please sign in to comment.