From 6340a2f608bcf6e5a1a034a5709c3931323537d5 Mon Sep 17 00:00:00 2001 From: iobyte Date: Mon, 12 Sep 2022 15:07:18 +0000 Subject: [PATCH] trackgen: make global variable TrackRoot local git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8492 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: f644368b6b03fc7f40fd3e4309bd327546ea20bb Former-commit-id: dd4277417276626651889c308a7a5c99c9a4bb2a --- src/tools/trackgen/objects.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/tools/trackgen/objects.cpp b/src/tools/trackgen/objects.cpp index c5fcc0a04..1443f3fd4 100644 --- a/src/tools/trackgen/objects.cpp +++ b/src/tools/trackgen/objects.cpp @@ -50,7 +50,6 @@ static char buf[1024]; static ssgRoot *Root = nullptr; static ssgRoot *GroupRoot = nullptr; -static ssgRoot *TrackRoot = nullptr; struct group { @@ -261,7 +260,7 @@ AddToRoot(ssgEntity *node) } static void -AddObject(tTrack *track, void *TrackHandle, unsigned int clr, tdble x, tdble y) +AddObject(tTrack *track, void *TrackHandle, ssgRoot *TrackRoot, unsigned int clr, tdble x, tdble y) { for (struct objdef *curObj = GF_TAILQ_FIRST(&objhead); curObj; curObj = GF_TAILQ_NEXT(curObj, link)) { @@ -577,7 +576,7 @@ GenerateObjects(tTrack *track, void *TrackHandle, void *CfgHandle, FILE *save_fd ssgTexturePath(buf); snprintf(buf, sizeof(buf), ".;%s;%sdata/objects", inputPath.c_str(), GfDataDir()); ssgModelPath(""); // don't need a search path because meshFile has a full path - TrackRoot = (ssgRoot*)ssgLoadAC(meshFile.c_str()); + ssgRoot *TrackRoot = (ssgRoot*)ssgLoadAC(meshFile.c_str()); InitObjects(track, TrackHandle); @@ -628,7 +627,7 @@ GenerateObjects(tTrack *track, void *TrackHandle, void *CfgHandle, FILE *save_fd if (clr) { printf("found color: 0x%X x: %d y: %d\n", clr, i, j); - AddObject(track, TrackHandle, clr, i * kX + dX, j * kY + dY); + AddObject(track, TrackHandle, TrackRoot, clr, i * kX + dX, j * kY + dY); } } }