trackgen: add use object materials xml attribute

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8929 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 34d8d71680836dabd8821ee730fea330df231aa4
Former-commit-id: 9982d547af9e626a8c9650be4f5273b84d94ef94
This commit is contained in:
iobyte 2023-05-05 00:44:52 +00:00
parent e35a69a0c2
commit 8a1aa92a35
2 changed files with 8 additions and 1 deletions

View file

@ -134,6 +134,7 @@
#define TRK_ATT_COLOR "color"
#define TRK_ATT_OBJECT "object"
#define TRK_ATT_SEED "random seed"
#define TRK_ATT_USE_OBJ_MATERIALS "use object materials"
#define TRK_ATT_ORIENTATION_TYPE "orientation type"
#define TRK_ATT_ORIENTATION "orientation"
#define TRK_ATT_SCALE_TYPE "scale type"

View file

@ -98,7 +98,7 @@ public:
//! Constructor.
Application::Application()
: GfApplication("TrackGen", "1.6.0.7", "Terrain generator for tracks")
: GfApplication("TrackGen", "1.6.0.8", "Terrain generator for tracks")
, HeightSteps(30)
, Bump(false)
, Raceline(false)
@ -405,6 +405,12 @@ int Application::generate()
return EXIT_SUCCESS;
}
// check if we should use the object's materials
const std::string useObjectMaterials = GfParmGetStr(TrackHandle, TRK_SECT_TERRAIN, TRK_ATT_USE_OBJ_MATERIALS, "no");
if (useObjectMaterials == "yes")
MultipleMaterials = true;
GenerateObjects(Track, TrackHandle, CfgHandle, allAc3d, all, OutMeshName, OutputFileName, MultipleMaterials);
allAc3d.writeFile(OutputFileName + ".ac", false);