Revision: 2677
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2677&view=rev
Author:   rorthomas
Date:     2012-05-26 02:09:35 +0000 (Sat, 26 May 2012)
Log Message:
-----------
removed terrain code from RoRframelistener

Modified Paths:
--------------
    trunk/source/main/gameplay/RoRFrameListener.cpp

Modified: trunk/source/main/gameplay/RoRFrameListener.cpp
===================================================================
--- trunk/source/main/gameplay/RoRFrameListener.cpp     2012-05-26 02:06:28 UTC 
(rev 2676)
+++ trunk/source/main/gameplay/RoRFrameListener.cpp     2012-05-26 02:09:35 UTC 
(rev 2677)
@@ -2991,23 +2991,6 @@
                }
        }
 
-       // set the terrain hash
-       {
-               Cache_Entry ce = CACHE.getResourceInfo(terrainfile);
-               char hash_result[250];
-               memset(hash_result, 0, 249);
-               RoR::CSHA1 sha1;
-               String fn;
-               if (ce.type == "Zip")
-                       fn = ce.dirname;
-               else if (ce.type == "FileSystem")
-                       fn = ce.dirname + SSETTING("dirsep", "\\") + ce.fname;
-               sha1.HashFile(const_cast<char*>(fn.c_str()));
-               sha1.Final();
-               sha1.ReportHash(hash_result, RoR::CSHA1::REPORT_HEX_SHORT);
-               terrainModHash = String(hash_result);
-       }
-
        loadedTerrain = terrainfile;
 
        initializeCompontents();
@@ -3019,9 +3002,9 @@
 
        } else if (terrainfile.find(".terrn") != String::npos)
        {
-               LOG("Loading classic terrain format: " + terrainfile);
-               loadClassicTerrain(terrainfile);
-
+               LOG("Old Terrain not supported anymore");
+               showError(_L("Terrain loading error"), _L("Old Terrain not 
supported"));
+               exit(1);
        } else
        {
                // exit on unknown terrain handler
@@ -3044,1174 +3027,6 @@
        if (person) person->setVisible(true);
 }
 
-void RoRFrameListener::loadClassicTerrain(String terrainfile)
-{
-       //we load a classic terrain
-       //FILE *fd;
-       char geom[1024];
-       char sandstormcubemap[256]="";
-       char line[1024];
-       float r,g,b;
-       float cx,cy,cz;
-       String group = "";
-       try
-       {
-               group = 
ResourceGroupManager::getSingleton().findGroupContainingResource(terrainfile);
-       } catch(...) {}
-       if (group == "")
-       {
-               // we need to do a bit more here, since this can also happen on 
joining a MP server, in that case the user should get a better error message ...
-               LOG("Terrain not found: " + String(terrainfile));
-               showError(_L("Terrain loading error"), _L("Terrain not found: 
") + terrainfile);
-               exit(125);
-       }
-
-       // set the terrain cache entry
-       //loaded_terrain = CACHE.getResourceInfo(terrainfile);
-
-       terrainFileName = terrainfile;
-
-       DataStreamPtr 
ds=ResourceGroupManager::getSingleton().openResource(terrainfile, group);
-
-       // now generate the hash of it
-       {
-               // copy whole file into a string
-               String code = "";
-               ds->seek(0); // from start
-               code.resize(ds->size());
-               ds->read(&code[0], ds->size());
-
-               // and build the hash over it
-               char hash_result[250];
-               memset(hash_result, 0, 249);
-               RoR::CSHA1 sha1;
-               sha1.UpdateHash((uint8_t *)code.c_str(), (uint32_t)code.size());
-               sha1.Final();
-               sha1.ReportHash(hash_result, RoR::CSHA1::REPORT_HEX_SHORT);
-               terrainFileHash = String(hash_result);
-               ds->seek(0); // to start
-       }
-
-       ds->readLine(line, 1023);
-       terrainName = String(line);
-
-       //geometry
-       ds->readLine(geom, 1023);
-
-       //colour
-       ds->readLine(line, 1023);
-       //water stuff
-       float waterline=-9999;
-       if (line[0]=='w')
-       {
-               sscanf(line+1, "%f", &waterline);
-               //fscanf(fd," %[^\n\r]",line);
-               ds->readLine(line, 1023);
-       };
-       //Caelum maps
-       if (!strncmp(line,"caelum", 6))
-       {
-               // deprecated
-               ds->readLine(line, 1023);
-       };
-
-       sscanf(line,"%f, %f, %f",&r,&g,&b);
-       //coordinates
-       //fscanf(fd," %[^\n\r]",line);
-       ds->readLine(line, 1023);
-       sscanf(line, "%f, %f, %f, %f, %f, %f, %f, %f, 
%f",&truckx,&trucky,&truckz,&cx,&cy,&cz, &persostart.x, &persostart.y, 
&persostart.z);
-       spawn_location_t spl;
-       memset(&spl, 0, sizeof(spl));
-       spl.pos = Vector3(truckx, trucky, truckz);
-       spl.rot = Quaternion::ZERO;
-       netSpawnPos["truck"] = spl;
-       netSpawnPos["airplane"] = spl;
-       netSpawnPos["boat"] = spl;
-       netSpawnPos["car"] = spl;
-
-#if OGRE_VERSION>0x010602
-       Vector4 splitPoints;
-#endif
-
-       //shadows
-       ShadowManager *sh = new ShadowManager(mSceneMgr, mWindow, mCamera);
-       sh->loadConfiguration();
-
-       ColourValue fadeColour(r,g,b);
-
-       terrainxsize=1000;
-       terrainzsize=1000;
-
-       bool disableTetrrain=false;
-
-       {
-           ConfigFile config;
-               ResourceGroupManager& rgm = 
ResourceGroupManager::getSingleton();
-               String group = "";
-               try
-               {
-                       group = 
ResourceGroupManager::getSingleton().findGroupContainingResource(geom);
-               } catch(...) {}
-               if (group == "")
-               {
-                       LOG("Geometry not found: " + String(terrainfile));
-                       showError(_L("Geometry loading error"), _L("Geometry 
not found: ") + String(geom));
-                       exit(125);
-               }
-               DataStreamPtr stream=rgm.openResource(geom, group);
-               config.load( stream );
-           String val;
-               float fval=0.0f;
-               val = config.getSetting("PageWorldX");
-               if ( !val.empty() )
-                       fval = atof( val.c_str() );
-               terrainxsize=fval;
-               val = config.getSetting("PageWorldZ");
-               if ( !val.empty() )
-                       fval = atof( val.c_str() );
-               terrainzsize=fval;
-               disableTetrrain = (config.getSetting("disable") != "");
-       }
-
-       //mCamera->setNearClipDistance (0.01);
-       //mCamera->setFarClipDistance( farclip*1.733 );
-       int farclip = ISETTING("SightRange", 2000);
-       bool inifite_farclip = false;
-       
-       if (farclip == 5000 && 
mRoot->getRenderSystem()->getCapabilities()->hasCapability(Ogre::RSC_INFINITE_FAR_PLANE))
-       {
-               mCamera->setFarClipDistance(0);   // enable infinite far clip 
distance if we can
-               inifite_farclip = true;
-       } else
-       {
-               farclip = std::min((float)farclip, terrainzsize * 1.8f);
-               mCamera->setFarClipDistance(farclip);
-       }
-
-       Light *mainLight = 0;
-       mSceneMgr->setFog(FOG_NONE);
-
-#ifdef USE_CAELUM
-       //Caelum skies
-       bool useCaelum = SSETTING("Sky effects", "Caelum (best looking, 
slower)")=="Caelum (best looking, slower)";
-       if (useCaelum)
-       {
-               new SkyManager();
-
-               SkyManager::getSingleton().init(mSceneMgr, mWindow, mCamera);
-               mainLight = SkyManager::getSingleton().getMainLight();
-       } else
-#endif //CAELUM
-       {
-               // Create a light
-               mainLight = mSceneMgr->createLight("MainLight");
-               //directional light for shadow
-               mainLight->setType(Light::LT_DIRECTIONAL);
-               mainLight->setDirection(0.785, -0.423, 0.453);
-
-               mainLight->setDiffuseColour(fadeColour);
-               mainLight->setSpecularColour(fadeColour);
-
-               //mSceneMgr->setSkyBox(true, sandstormcubemap, farclip);
-               //mSceneMgr->setSkyDome(true, "Examples/CloudySky", 5, 8);
-               
-               if (!inifite_farclip)
-                       mSceneMgr->setFog(FOG_LINEAR, fadeColour,  0, farclip * 
0.7, farclip * 0.9);
-       }
-       mCamera->getViewport()->setBackgroundColour(fadeColour);
-       
-
-#ifdef USE_CAELUM
-       // load caelum config
-       if (SSETTING("Sky effects", "Caelum (best looking, slower)")=="Caelum 
(best looking, slower)")
-       {
-               String cfn = terrainfile + ".os";
-               if 
(ResourceGroupManager::getSingleton().resourceExistsInAnyGroup(cfn))
-                       SkyManager::getSingleton().loadScript(cfn);
-               else
-                       
SkyManager::getSingleton().loadScript("ror_default_sky");
-       }
-#endif //USE_CAELUM
-
-
-       MaterialPtr terMat = 
(MaterialPtr)(MaterialManager::getSingleton().getByName("TerrainSceneManager/Terrain"));
-       {
-               // load configuration from STM (sizes)
-               ConfigFile cfg;
-               String group="";
-               try
-               {
-                       group = 
ResourceGroupManager::getSingleton().findGroupContainingResource(String(geom));
-               }catch(...)
-               {
-               }
-               if (group == "")
-                       return;
-               DataStreamPtr ds_config = 
ResourceGroupManager::getSingleton().openResource(String(geom), group);
-               cfg.load(ds_config, "\t:=", false);
-
-               // X, Y and Z scale
-               mapsizex = 
StringConverter::parseInt(cfg.getSetting("PageWorldX"));
-               mapsizey = 
StringConverter::parseInt(cfg.getSetting("MaxHeight"));
-               mapsizez = 
StringConverter::parseInt(cfg.getSetting("PageWorldZ"));
-
-#ifdef USE_MYGUI
-               if (surveyMap)
-               {
-                       surveyMap->setWorldSize(mapsizex, mapsizey, mapsizez);
-               }
-#endif //MYGUI
-
-               if (!disableTetrrain)
-               {
-                       // classic mode
-                       mSceneMgr->setWorldGeometry(geom);
-               }
-       }
-
-
-       // get vegetation mode
-       int pagedMode = 0; //None
-       float pagedDetailFactor = 0;
-       String vegetationMode = SSETTING("Vegetation", "None (fastest)");
-       if     (vegetationMode == "None (fastest)")
-       {
-               pagedMode = 0;
-               pagedDetailFactor = 0.001;
-       }
-       else if (vegetationMode == "20%")
-       {
-               pagedMode = 1;
-               pagedDetailFactor = 0.2;
-       }
-       else if (vegetationMode == "50%")
-       {
-               pagedMode = 2;
-               pagedDetailFactor = 0.5;
-       }
-       else if (vegetationMode == "Full (best looking, slower)")
-       {
-               pagedMode = 3;
-               pagedDetailFactor = 1;
-       }
-
-       // Define the required skyplane
-       Plane plane;
-       // 1000 world units from the camera
-       plane.d = 200;
-       // Above the camera, facing down
-       plane.normal = -Vector3::UNIT_Y;
-
-
-       if (!terMat.isNull())
-               terrainmaterial = terMat.get();
-       if (terrainmaterial)
-               LOG("using Terrain Material '"+terrainmaterial->getName()+"'");
-
-       //create sky material
-       //                      MaterialPtr 
skmat=(MaterialPtr)(MaterialManager::getSingleton().create("Skycol", 
"Standard"));
-       //                      Technique* sktechnique = skmat->getTechnique(0);
-       //                      Pass* skpass = sktechnique->getPass(0);
-       //                      skpass->setDepthWriteEnabled(false);
-       //                      skpass->setLightingEnabled(false);
-       //                      TextureUnitState* 
sktunit=skpass->createTextureUnitState();
-       //                      sktunit->setColourOperationEx(LBX_MODULATE, 
LBS_MANUAL, LBS_CURRENT, fadeColour);
-
-       //              mSceneMgr->setSkyPlane(true, plane, 
"tracks/skyplanecol", 1000, 1, true, 0.5, 100, 100);
-       //              mSceneMgr->setSkyBox(true, "tracks/skycol", 1000);
-
-       //bloom effect
-       /*
-       // replaced by HDR
-       if (BSETTING("Bloom"))
-       {
-               
CompositorManager::getSingleton().addCompositor(mCamera->getViewport(),"Bloom");
-               
CompositorManager::getSingleton().setCompositorEnabled(mCamera->getViewport(), 
"Bloom", true);
-       }*/
-
-       // first compositor: HDR!
-       // HDR if wished
-       if (BSETTING("HDR", false))
-       {
-               initHDR();
-       }
-
-       if (BSETTING("Glow", false))
-       {
-               
CompositorManager::getSingleton().addCompositor(mCamera->getViewport(), "Glow");
-               
CompositorManager::getSingleton().setCompositorEnabled(mCamera->getViewport(), 
"Glow", true);
-               GlowMaterialListener *gml = new GlowMaterialListener();
-               Ogre::MaterialManager::getSingleton().addListener(gml);
-       }
-
-       // Motion blur stuff :)
-       if (BSETTING("Motion blur", false))
-       {
-               /// Motion blur effect
-               CompositorPtr comp3 = CompositorManager::getSingleton().create(
-                       "MotionBlur", 
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
-                       );
-               {
-                       CompositionTechnique *t = comp3->createTechnique();
-                       {
-                               CompositionTechnique::TextureDefinition *def = 
t->createTextureDefinition("scene");
-                               def->width = 0;
-                               def->height = 0;
-#if OGRE_VERSION>0x010602
-                               def->formatList.push_back(PF_R8G8B8);
-#else
-                               def->format = PF_R8G8B8;
-#endif //OGRE_VERSION
-                       }
-                       {
-                               CompositionTechnique::TextureDefinition *def = 
t->createTextureDefinition("sum");
-                               def->width = 0;
-                               def->height = 0;
-#if OGRE_VERSION>0x010602
-                               def->formatList.push_back(PF_R8G8B8);
-#else
-                               def->format = PF_R8G8B8;
-#endif //OGRE_VERSION
-                       }
-                       {
-                               CompositionTechnique::TextureDefinition *def = 
t->createTextureDefinition("temp");
-                               def->width = 0;
-                               def->height = 0;
-#if OGRE_VERSION>0x010602
-                               def->formatList.push_back(PF_R8G8B8);
-#else
-                               def->format = PF_R8G8B8;
-#endif //OGRE_VERSION
-                       }
-                       /// Render scene
-                       {
-                               CompositionTargetPass *tp = 
t->createTargetPass();
-                               
tp->setInputMode(CompositionTargetPass::IM_PREVIOUS);
-                               tp->setOutputName("scene");
-                       }
-                       /// Initialisation pass for sum texture
-                       {
-                               CompositionTargetPass *tp = 
t->createTargetPass();
-                               
tp->setInputMode(CompositionTargetPass::IM_PREVIOUS);
-                               tp->setOutputName("sum");
-                               tp->setOnlyInitial(true);
-                       }
-                       /// Do the motion blur
-                       {
-                               CompositionTargetPass *tp = 
t->createTargetPass();
-                               
tp->setInputMode(CompositionTargetPass::IM_NONE);
-                               tp->setOutputName("temp");
-                               { CompositionPass *pass = tp->createPass();
-                               pass->setType(CompositionPass::PT_RENDERQUAD);
-                               
pass->setMaterialName("Ogre/Compositor/Combine");
-                               pass->setInput(0, "scene");
-                               pass->setInput(1, "sum");
-                               }
-                       }
-                       /// Copy back sum texture
-                       {
-                               CompositionTargetPass *tp = 
t->createTargetPass();
-                               
tp->setInputMode(CompositionTargetPass::IM_NONE);
-                               tp->setOutputName("sum");
-                               { CompositionPass *pass = tp->createPass();
-                               pass->setType(CompositionPass::PT_RENDERQUAD);
-                               
pass->setMaterialName("Ogre/Compositor/Copyback");
-                               pass->setInput(0, "temp");
-                               }
-                       }
-                       /// Display result
-                       {
-                               CompositionTargetPass *tp = 
t->getOutputTargetPass();
-                               
tp->setInputMode(CompositionTargetPass::IM_NONE);
-                               { CompositionPass *pass = tp->createPass();
-                               pass->setType(CompositionPass::PT_RENDERQUAD);
-                               
pass->setMaterialName("Ogre/Compositor/MotionBlur");
-                               pass->setInput(0, "sum");
-                               }
-                       }
-               }
-               
CompositorManager::getSingleton().addCompositor(mCamera->getViewport(),"MotionBlur");
-               
CompositorManager::getSingleton().setCompositorEnabled(mCamera->getViewport(), 
"MotionBlur", true);
-       }
-       // End of motion blur :(
-
-       //SUNBURN
-       if (BSETTING("Sunburn", false))
-       {
-               
CompositorManager::getSingleton().addCompositor(mCamera->getViewport(),"Sunburn");
-               
CompositorManager::getSingleton().setCompositorEnabled(mCamera->getViewport(), 
"Sunburn", true);
-       }
-
-
-
-       //hack
-       // now with extensive error checking
-       if 
(CompositorManager::getSingleton().hasCompositorChain(mCamera->getViewport()))
-       {
-       //      
//CompositorManager::getSingleton().getCompositorChain(mCamera->getViewport())->getCompositor(0)->getTechnique()->getOutputTargetPass()->getPass(0)->setClearColour(fadeColour);
-               CompositorInstance *co = 
CompositorManager::getSingleton().getCompositorChain(mCamera->getViewport())->_getOriginalSceneCompositor();
-               if (co)
-               {
-                       CompositionTechnique *ct = co->getTechnique();
-                       if (ct)
-                       {
-                               CompositionTargetPass *ctp = 
ct->getOutputTargetPass();
-                               if (ctp)
-                               {
-                                       CompositionPass *p = ctp->getPass(0);
-                                       if (p)
-                                               p->setClearColour(fadeColour);
-                               }
-                       }
-               }
-       }
-
-
-       // not such ugly anymore: read .raw heightmap filename out of the 
terrain .cfg file
-       {
-               ConfigFile config;
-               ResourceGroupManager& rgm = 
ResourceGroupManager::getSingleton();
-               String group="";
-               try
-               {
-                       group = 
ResourceGroupManager::getSingleton().findGroupContainingResource(String(geom));
-               }catch(...)
-               {
-               }
-               if (group == "")
-                       return;
-               DataStreamPtr stream=rgm.openResource(geom, group);
-               config.load(stream);
-               String val = config.getSetting("Heightmap.image");
-               if (!val.empty())
-               {
-                       strcpy(terrainmap, val.c_str());
-               } else
-               {
-                       // bad ugly hack
-                       strcpy(terrainmap, geom);
-                       terrainmap[strlen(terrainmap)-3]='r';
-                       terrainmap[strlen(terrainmap)-2]='a';
-                       terrainmap[strlen(terrainmap)-1]='w';
-               }
-               //ensure file gets closed again using this braces
-       }
-
-       //set terrain map
-       //MaterialPtr 
mat=(MaterialPtr)(MaterialManager::getSingleton().getByName("tracks/BigMap"));
-       //if (terrainmaterial && bigMap)
-       
//mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(terrainmaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->getTextureName());
-       //      
bigMap->setBackground(terrainmaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->getTextureName());
-
-       mCamera->setPosition(Vector3(cx,cy,cz));
-
-       //water!
-       if (waterline != -9999)
-       {
-               bool usewaves=(BSETTING("Waves", false));
-
-               // disable waves in multiplayer
-               if (net)
-                       usewaves=false;
-
-               String waterSettingsString = SSETTING("Water effects", 
"Reflection + refraction (speed optimized)");
-
-               if      (waterSettingsString == "None")
-                       w = 0;
-               else if (waterSettingsString == "Basic (fastest)")
-                       w = new WaterOld(WaterOld::WATER_BASIC, mCamera, 
mSceneMgr, mWindow, waterline, &mapsizex, &mapsizez, usewaves);
-               else if (waterSettingsString == "Reflection")
-                       w = new WaterOld(WaterOld::WATER_REFLECT, mCamera, 
mSceneMgr, mWindow, waterline, &mapsizex, &mapsizez, usewaves);
-               else if (waterSettingsString == "Reflection + refraction (speed 
optimized)")
-                       w = new WaterOld(WaterOld::WATER_FULL_SPEED, mCamera, 
mSceneMgr, mWindow, waterline, &mapsizex, &mapsizez, usewaves);
-               else if (waterSettingsString == "Reflection + refraction 
(quality optimized)")
-                       w = new WaterOld(WaterOld::WATER_FULL_QUALITY, mCamera, 
mSceneMgr, mWindow, waterline, &mapsizex, &mapsizez, usewaves);
-       }
-       if (w) w->setFadeColour(fadeColour);
-       if (person) person->setWater(w);
-       BeamFactory::getSingleton().w = w;
-       DustManager::getSingleton().setWater(w);
-
-       //environment map
-       if (!BSETTING("Envmapdisable", false))
-       {
-               envmap = new Envmap(mSceneMgr, mWindow, mCamera, 
BSETTING("Envmap", false), ISETTING("EnvmapUpdateRate", 1));
-       }
-
-       //dashboard
-       dashboard = new Dashboard(mSceneMgr);
-
-       //setup heightfinder
-       float wheight = 0.0f;
-       if (w)
-       {
-               wheight = w->getHeight() - 30.0f;
-       }
-
-       // we choose the heightfinder depending on whether we use the classical
-       // terrain or the new one
-       if (newTerrainMode)
-               hfinder = new NTHeightFinder(terrainManager, Vector3::ZERO);
-       else
-               hfinder = new TSMHeightFinder(geom, terrainmap, wheight);
-
-       collisions->setHfinder(hfinder);
-       if (person)
-       {
-               person->setHFinder(hfinder);
-       }
-
-       // update hfinder instance in factory
-       BeamFactory::getSingleton().mfinder = hfinder;
-
-       // set camera to some nice spot, overviewing the terrain, showing the 
loading progress
-       if (spl.pos != Vector3::ZERO)    mCamera->setPosition(spl.pos);
-       if (spl.rot != Quaternion::ZERO) mCamera->setOrientation(spl.rot);
-
-#ifdef USE_MYGUI
-       if (surveyMap)
-       {
-               mtc = new MapTextureCreator(mSceneMgr, mCamera, surveyMap);
-               surveyMap->setMapTexture(mtc->getRTName());
-       }
-#endif //USE_MYGUI
-
-       // fix the person starting position
-       if (persostart.isZeroLength() && !spl.pos.isZeroLength())
-       {
-               if (hfinder)
-                       persostart = Vector3(spl.pos.x, 
hfinder->getHeightAt(spl.pos.x, spl.pos.z), spl.pos.z);
-               else
-                       persostart = spl.pos;
-       }
-
-       //prepare road2
-       proceduralManager = new ProceduralManager(mSceneMgr, hfinder, 
collisions);
-
-       Vector3 r2lastpos=Vector3::ZERO;
-       Quaternion r2lastrot=Quaternion::IDENTITY;
-
-       //prepare for baking
-       SceneNode 
*bakeNode=mSceneMgr->getRootSceneNode()->createChildSceneNode();
-
-#ifdef USE_PAGED
-       treeLoader = 0;
-       Entity *curTree = 0;
-       String treename = "";
-#endif
-
-       ProceduralObject po;
-       po.loadingState = -1;
-       int r2oldmode = 0;
-       int lastprogress = -1;
-       bool proroad = false;
-
-       while (!ds->eof())
-       {
-               int progress = ((float)(ds->tell()) / (float)(ds->size())) * 
100.0f;
-               if (progress-lastprogress > 20)
-               {
-#ifdef USE_MYGUI
-                       LoadingWindow::getSingleton().setProgress(progress, 
_L("Loading Terrain"));
-#endif //MYGUI
-                       lastprogress = progress;
-               }
-
-               char oname[1024];
-               char type[256];
-               char name[256];
-               int r;
-               float ox, oy, oz;
-               float rx, ry, rz;
-               //fscanf(fd," %[^\n\r]",line);
-               size_t ll=ds->readLine(line, 1023);
-               if (line[0]=='/' || line[0]==';' || ll==0) continue; //comments
-               if (!strcmp("end",line)) break;
-               
-               if (!strncmp(line,"collision-tris", 14))
-               {
-                       long amount = Collisions::MAX_COLLISION_TRIS;
-                       sscanf(line, "collision-tris %ld", &amount);
-                       collisions->resizeMemory(amount);
-               }
-
-               if (!strncmp(line,"grid", 4))
-               {
-                       float px=0,py=0,pz=0;
-                       sscanf(line, "grid %f, %f, %f", &px, &py, &pz);
-                       Vector3 pos = Vector3(px,py,pz);
-
-                       Ogre::ColourValue BackgroundColour = 
Ogre::ColourValue::White;//Ogre::ColourValue(0.1337f, 0.1337f, 0.1337f, 1.0f);
-                       Ogre::ColourValue GridColour = Ogre::ColourValue(0.2f, 
0.2f, 0.2f, 1.0f);
-               
-                       Ogre::ManualObject *mReferenceObject = new 
Ogre::ManualObject("ReferenceGrid");
-
-                       mReferenceObject->begin("BaseWhiteNoLighting", 
Ogre::RenderOperation::OT_LINE_LIST);
-
-                       Ogre::Real step = 1.0f;
-                       unsigned int count = 50;
-                       unsigned int halfCount = count / 2;
-                       Ogre::Real full = (step * count);
-                       Ogre::Real half = full / 2;
-                       Ogre::Real y = 0;
-                       Ogre::ColourValue c;
-                       for (unsigned i=0;i < count+1;i++)
-                       {
-                               if (i == halfCount)
-                                       c = Ogre::ColourValue(1,0,0,1.0f);
-                               else
-                                       c = GridColour;
-
-                               
mReferenceObject->position(-half,y,-half+(step*i));
-                               mReferenceObject->colour(BackgroundColour);
-                               mReferenceObject->position(0,y,-half+(step*i));
-                               mReferenceObject->colour(c);
-                               mReferenceObject->position(0,y,-half+(step*i));
-                               mReferenceObject->colour(c);
-                               
mReferenceObject->position(half,y,-half+(step*i));
-                               mReferenceObject->colour(BackgroundColour);
-
-                               if (i == halfCount)
-                                       c = Ogre::ColourValue(0,0,1,1.0f);
-                               else
-                                       c = GridColour;
-
-                               
mReferenceObject->position(-half+(step*i),y,-half);
-                               mReferenceObject->colour(BackgroundColour);
-                               mReferenceObject->position(-half+(step*i),y,0);
-                               mReferenceObject->colour(c);
-                               mReferenceObject->position(-half+(step*i),y,0);
-                               mReferenceObject->colour(c);
-                               mReferenceObject->position(-half+(step*i),y, 
half);
-                               mReferenceObject->colour(BackgroundColour);
-                       }
-
-                       mReferenceObject->end();
-                       mReferenceObject->setCastShadows(false);
-                       SceneNode *n = 
mSceneMgr->getRootSceneNode()->createChildSceneNode();
-                       n->setPosition(pos);
-                       n->attachObject(mReferenceObject);
-                       n->setVisible(true);
-               }
-
-               if (!strncmp("mpspawn", line, 7))
-               {
-                       spawn_location_t spl;
-                       memset(&spl, 0, sizeof(spawn_location_t));
-
-                       char tmp[256]="";
-                       float x=0,y=0,z=0, rx=0, ry=0, rz=0;
-                       int res = sscanf(line, "mpspawn %s %f %f %f %f %f %f", 
tmp, &x, &y, &z, &rx, &ry, &rz);
-                       if (res < 7)
-                       {
-                               LOG("error reading mpspawn command!");
-                               continue;
-                       }
-                       spl.pos = Vector3(x, y, z);
-                       spl.rot = Quaternion(Degree(rx), 
Vector3::UNIT_X)*Quaternion(Degree(ry), Vector3::UNIT_Y)*Quaternion(Degree(rz), 
Vector3::UNIT_Z);
-                       netSpawnPos[String(tmp)] = spl;
-                       continue;
-               }
-
-               //sandstorm cube texture
-               if (!strncmp(line,"sandstormcubemap", 16))
-               {
-                       sscanf(line, "sandstormcubemap %s", sandstormcubemap);
-               }
-               if (!strncmp("landuse-config", line, 14))
-               {
-                       collisions->setupLandUse(line+15);
-                       continue;
-               }
-               if (!strncmp("gravity", line, 7))
-               {
-                       int res = sscanf(line, "gravity %f", &gravity);
-                       if (res < 1)
-                       {
-                               LOG("error reading gravity command!");
-                       }
-                       continue;
-               }
-               //ugly stuff to parse map size
-               if (!strncmp("mapsize", line, 7))
-               {
-                       // this is deprecated!!! (replaced by direct .cfg reads)
-                       //sscanf(line, "mapsize %f, %f", &mapsizex, &mapsizez);
-                       continue;
-               }
-#ifdef USE_PAGED
-               //ugly stuff to parse trees :)
-               if (!strncmp("trees", line, 5))
-               {
-                       if (pagedMode == 0) continue;
-                       char ColorMap[256] = {};
-                       char DensityMap[256] = {};
-                       char treemesh[256] = {};
-                       char treeCollmesh[256] = {};
-                       float gridspacing = 0.0f;
-                       float yawfrom = 0.0f, yawto = 0.0f;
-                       float scalefrom = 0.0f, scaleto = 0.0f;
-                       float highdens = 1.0f;
-                       int minDist = 90, maxDist = 700;
-                       sscanf(line, "trees %f, %f, %f, %f, %f, %d, %d, %s %s 
%s %f %s", &yawfrom, &yawto, &scalefrom, &scaleto, &highdens, &minDist, 
&maxDist, treemesh, ColorMap, DensityMap, &gridspacing, treeCollmesh);
-                       if (strnlen(ColorMap, 3) == 0)
-                       {
-                               LOG("tree ColorMap map zero!");
-                               continue;
-                       }
-                       if (strnlen(DensityMap, 3) == 0)
-                       {
-                               LOG("tree DensityMap zero!");
-                               continue;
-                       }
-                       Forests::DensityMap *densityMap = 
Forests::DensityMap::load(DensityMap, CHANNEL_COLOR);
-                       if (!densityMap)
-                       {
-                               LOG("could not load densityMap: 
"+String(DensityMap));
-                               continue;
-                       }
-                       densityMap->setFilter(Forests::MAPFILTER_BILINEAR);
-                       //densityMap->setMapBounds(TRect(0, 0, mapsizex, 
mapsizez));
-
-                       paged_geometry_t paged;
-                       paged.geom = new PagedGeometry();
-                       paged.geom->setTempDir(SSETTING("User Path", "") + 
"cache" + SSETTING("dirsep", "\\"));
-                       paged.geom->setCamera(mCamera);
-                       paged.geom->setPageSize(50);
-                       paged.geom->setInfinite();
-                       Ogre::TRect<Ogre::Real> bounds = TBounds(0, 0, 
mapsizex, mapsizez);
-                       //trees->setBounds(bounds);
-
-                       //Set up LODs
-                       //trees->addDetailLevel<EntityPage>(50);
-                       float min = minDist * pagedDetailFactor;
-                       if (min<10) min = 10;
-                       paged.geom->addDetailLevel<BatchPage>(min, min/2);
-                       float max = maxDist * pagedDetailFactor;
-                       if (max<10) max = 10;
-                       paged.geom->addDetailLevel<ImpostorPage>(max, max/10);
-                       TreeLoader2D *treeLoader = new TreeLoader2D(paged.geom, 
TBounds(0, 0, mapsizex, mapsizez));
-                       paged.geom->setPageLoader(treeLoader);
-                       treeLoader->setHeightFunction(&getTerrainHeight);
-                       if (String(ColorMap) != "none")
-                       {
-                               treeLoader->setColorMap(ColorMap);
-                       }
-
-                       curTree = 
mSceneMgr->createEntity(String("paged_")+treemesh+TOSTRING(pagedGeometry.size()),
 treemesh);
-
-                       if (gridspacing > 0)
-                       {
-                               // grid style
-                               for(float x=0; x < mapsizex; x += gridspacing)
-                               {
-                                       for(float z=0; z < mapsizez; z += 
gridspacing)
-                                       {
-                                               float density = 
densityMap->_getDensityAt_Unfiltered(x, z, bounds);
-                                               if (density < 0.8f) continue;
-                                               float nx = x + gridspacing * 
0.5f;
-                                               float nz = z + gridspacing * 
0.5f;
-                                               float yaw = 
Math::RangeRandom(yawfrom, yawto);
-                                               float scale = 
Math::RangeRandom(scalefrom, scaleto);
-                                               Vector3 pos = Vector3(nx, 0, 
nz);
-                                               treeLoader->addTree(curTree, 
pos, Degree(yaw), (Ogre::Real)scale);
-                                               if (strlen(treeCollmesh))
-                                               {
-                                                       pos.y = 
hfinder->getHeightAt(pos.x, pos.z);
-                                                       scale *= 0.1f;
-                                                       
collisions->addCollisionMesh(String(treeCollmesh), pos, Quaternion(Degree(yaw), 
Vector3::UNIT_Y), Vector3(scale, scale, scale));
-                                               }
-                                       }
-                               }
-
-                       } else
-                       {
-                               float gridsize = 10;
-                               if (gridspacing < 0 && gridspacing != 0)
-                               {
-                                       gridsize = -gridspacing;
-                               }
-                               float hd = highdens;
-                               // normal style, random
-                               for(float x=0; x < mapsizex; x += gridsize)
-                               {
-                                       for(float z=0; z < mapsizez; z += 
gridsize)
-                                       {
-                                               if (highdens < 0) hd = 
Math::RangeRandom(0, -highdens);
-                                               float density = 
densityMap->_getDensityAt_Unfiltered(x, z, bounds);
-                                               int numTreesToPlace = 
(int)((float)(hd) * density * pagedDetailFactor);
-                                               float nx=0, nz=0;
-                                               while(numTreesToPlace-->0)
-                                               {
-                                                       nx = 
Math::RangeRandom(x, x + gridsize);
-                                                       nz = 
Math::RangeRandom(z, z + gridsize);
-                                                       float yaw = 
Math::RangeRandom(yawfrom, yawto);
-                                                       float scale = 
Math::RangeRandom(scalefrom, scaleto);
-                                                       Vector3 pos = 
Vector3(nx, 0, nz);
-                                                       
treeLoader->addTree(curTree, pos, Degree(yaw), (Ogre::Real)scale);
-                                                       if 
(strlen(treeCollmesh))
-                                                       {
-                                                               pos.y = 
hfinder->getHeightAt(pos.x, pos.z);
-                                                               
collisions->addCollisionMesh(String(treeCollmesh),pos, Quaternion(Degree(yaw), 
Vector3::UNIT_Y), Vector3(scale, scale, scale));
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-                       paged.loader = (void*)treeLoader;
-                       pagedGeometry.push_back(paged);
-               }
-
-               //ugly stuff to parse grass :)
-               if (!strncmp("grass", line, 5) || !strncmp("grass2", line, 6))
-               {
-                       // is paged geometry disabled by configuration?
-                       if (pagedMode == 0) continue;
-                       int range = 80;
-                       float SwaySpeed=0.5, SwayLength=0.05, 
SwayDistribution=10.0, minx=0.2, miny=0.2, maxx=1, maxy=0.6, Density=0.6, 
minH=-9999, maxH=9999;
-                       char grassmat[256]="";
-                       char ColorMap[256]="";
-                       char DensityMap[256]="";
-                       int growtechnique = 0;
-                       int techn = GRASSTECH_CROSSQUADS;
-                       if (!strncmp("grass2", line, 6))
-                               sscanf(line, "grass2 %d, %f, %f, %f, %f, %f, 
%f, %f, %f, %d, %f, %f, %d, %s %s %s", &range, &SwaySpeed, &SwayLength, 
&SwayDistribution, &Density, &minx, &miny, &maxx, &maxy, &growtechnique, &minH, 
&maxH, &techn, grassmat, ColorMap, DensityMap);
-                       else if (!strncmp("grass", line, 5))
-                               sscanf(line, "grass %d, %f, %f, %f, %f, %f, %f, 
%f, %f, %d, %f, %f, %s %s %s", &range, &SwaySpeed, &SwayLength, 
&SwayDistribution, &Density, &minx, &miny, &maxx, &maxy, &growtechnique, &minH, 
&maxH, grassmat, ColorMap, DensityMap);
-
-                       //Initialize the PagedGeometry engine
-                       try
-                       {
-                               paged_geometry_t paged;
-                               PagedGeometry *grass = new 
PagedGeometry(mCamera, 30);
-                               //Set up LODs
-
-                               grass->addDetailLevel<GrassPage>(range * 
pagedDetailFactor); // original value: 80
-
-                               //Set up a GrassLoader for easy use
-                               GrassLoader *grassLoader = new 
GrassLoader(grass);
-                               grass->setPageLoader(grassLoader);
-                               
grassLoader->setHeightFunction(&getTerrainHeight);
-
-                               // render grass at first
-                               
grassLoader->setRenderQueueGroup(RENDER_QUEUE_MAIN-1);
-
-                               GrassLayer* grassLayer = 
grassLoader->addLayer(grassmat);
-                               grassLayer->setHeightRange(minH, maxH);
-                               //grassLayer->setLightingEnabled(true);
-
-                               grassLayer->setAnimationEnabled((SwaySpeed>0));
-                               grassLayer->setSwaySpeed(SwaySpeed);
-                               grassLayer->setSwayLength(SwayLength);
-                               
grassLayer->setSwayDistribution(SwayDistribution);
-
-                               grassdensityTextureFilename = 
String(DensityMap);
-
-                               grassLayer->setDensity(Density * 
pagedDetailFactor);
-                               if (techn>10)
-                                       
grassLayer->setRenderTechnique(static_cast<GrassTechnique>(techn-10), true);
-                               else
-                                       
grassLayer->setRenderTechnique(static_cast<GrassTechnique>(techn), false);
-
-                               grassLayer->setMapBounds(TBounds(0, 0, 
mapsizex, mapsizez));
-
-                               if (strcmp(ColorMap,"none") != 0)
-                               {
-                                       grassLayer->setColorMap(ColorMap);
-                                       
grassLayer->setColorMapFilter(MAPFILTER_BILINEAR);
-                               }
-
-                               if (strcmp(DensityMap,"none") != 0)
-                               {
-                                       grassLayer->setDensityMap(DensityMap);
-                                       
grassLayer->setDensityMapFilter(MAPFILTER_BILINEAR);
-                               }
-
-                               //grassLayer->setMinimumSize(0.5,0.5);
-                               //grassLayer->setMaximumSize(1.0, 1.0);
-
-                               grassLayer->setMinimumSize(minx, miny);
-                               grassLayer->setMaximumSize(maxx, maxy);
-
-                               // growtechnique
-                               if (growtechnique == 0)
-                                       
grassLayer->setFadeTechnique(FADETECH_GROW);
-                               else if (growtechnique == 1)
-                                       
grassLayer->setFadeTechnique(FADETECH_ALPHAGROW);
-                               else if (growtechnique == 2)
-                                       
grassLayer->setFadeTechnique(FADETECH_ALPHA);
-                               paged.geom = grass;
-                               paged.loader = (void*)grassLoader;
-                               pagedGeometry.push_back(paged);
-                       } catch(...)
-                       {
-                               LOG("error loading grass!");
-                       }
-
-                       continue;
-               }
-#endif //USE_PAGED
-
-               { // ugly stuff to parse procedural roads
-                       if (!strncmp("begin_procedural_roads", line, 22))
-                       {
-                               po = ProceduralObject();
-                               po.loadingState = 1;
-                               r2oldmode = 1;
-                               proroad = true;
-                               continue;
-                       }
-                       if (!strncmp("end_procedural_roads", line, 20))
-                       {
-                               if (r2oldmode)
-                               {
-                                       if (proceduralManager)
-                                               
proceduralManager->addObject(po);
-                                       po = ProceduralObject();
-                               }
-                               proroad = false;
-                               continue;
-                       }
-                       if (proroad)
-                       {
-                               float rwidth, bwidth, bheight;
-                               //position x,y,z rotation rx,ry,rz, width, 
border width, border height, type
-                               r=sscanf(line, "%f, %f, %f, %f, %f, %f, %f, %f, 
%f, %s",&ox,&oy,&oz, &rx, &ry, &rz, &rwidth, &bwidth, &bheight, oname);
-                               Vector3 pos=Vector3(ox, oy, oz);
-                               Quaternion rotation = Quaternion(Degree(rx), 
Vector3::UNIT_X)*Quaternion(Degree(ry), Vector3::UNIT_Y)*Quaternion(Degree(rz), 
Vector3::UNIT_Z);
-                               int roadtype=Road2::ROAD_AUTOMATIC;
-                               int pillartype = 0;
-                               if (!strcmp(oname, "flat")) 
roadtype=Road2::ROAD_FLAT;
-                               if (!strcmp(oname, "left")) 
roadtype=Road2::ROAD_LEFT;
-                               if (!strcmp(oname, "right")) 
roadtype=Road2::ROAD_RIGHT;
-                               if (!strcmp(oname, "both")) 
roadtype=Road2::ROAD_BOTH;
-                               if (!strcmp(oname, "bridge")) 
{roadtype=Road2::ROAD_BRIDGE;pillartype=1;}
-                               if (!strcmp(oname, "monorail")) 
{roadtype=Road2::ROAD_MONORAIL;pillartype=2;}
-                               if (!strcmp(oname, "monorail2")) 
{roadtype=Road2::ROAD_MONORAIL;pillartype=0;}
-                               if (!strcmp(oname, "bridge_no_pillars")) 
{roadtype=Road2::ROAD_BRIDGE;pillartype=0;}
-
-                               if (r2oldmode)
-                               {
-                                       //fill object
-                                       ProceduralPoint pp;
-                                       pp.bheight = bheight;
-                                       pp.bwidth = bwidth;
-                                       pp.pillartype = pillartype;
-                                       pp.position = pos;
-                                       pp.rotation = rotation;
-                                       pp.type = roadtype;
-                                       pp.width = rwidth;
-
-                                       po.points.push_back(pp);
-                               }
-                               continue;
-                       }
-               } //end of the ugly (somewhat)
-
-               strcpy(name, "generic");
-               memset(oname, 0, 255);
-               memset(type, 0, 255);
-               memset(name, 0, 255);
-               r=sscanf(line, "%f, %f, %f, %f, %f, %f, %s %s %s",&ox,&oy,&oz, 
&rx, &ry, &rz, oname, type, name);
-               if (r<6)
-                       continue;
-               if ((!strcmp(oname, "truck")) || (!strcmp(oname, "load") || 
(!strcmp(oname, "machine")) || (!strcmp(oname, "boat")) || (!strcmp(oname, 
"truck2")) ))
-               {
-                       bool newFormat = (!strcmp(oname, "truck2"));
-
-                       if (!strcmp(oname, "boat") && !w)
-                               // no water so do not load boats!
-                               continue;
-                       String group="";
-                       String truckname=String(type);
-                       if (!CACHE.checkResourceLoaded(truckname, group))
-                       {
-                               LOG("Error while loading Terrain: truck " + 
String(type) + " not found. ignoring.");
-                               continue;
-                       }
-                       //this is a truck or load declaration
-                       truck_preload[truck_preload_num].px=ox;
-                       truck_preload[truck_preload_num].py=oy;
-                       truck_preload[truck_preload_num].pz=oz;
-                       truck_preload[truck_preload_num].freePosition = 
newFormat;
-                       
truck_preload[truck_preload_num].ismachine=(!strcmp(oname, "machine"));
-                       
truck_preload[truck_preload_num].rotation=Quaternion(Degree(rx), 
Vector3::UNIT_X)*Quaternion(Degree(ry), Vector3::UNIT_Y)*Quaternion(Degree(rz), 
Vector3::UNIT_Z);
-                       //truck_preload[truck_preload_num].ry=ry;
-                       strcpy(truck_preload[truck_preload_num].name, 
truckname.c_str());
-                       truck_preload_num++;
-                       continue;
-               }
-               if (   !strcmp(oname, "road")
-                       || !strcmp(oname, "roadborderleft")
-                       || !strcmp(oname, "roadborderright")
-                       || !strcmp(oname, "roadborderboth")
-                       || !strcmp(oname, "roadbridgenopillar")
-                       || !strcmp(oname, "roadbridge"))
-               {
-                       int pillartype = !(strcmp(oname, "roadbridgenopillar") 
== 0);
-                       //okay, this is a job for roads2
-                       int roadtype=Road2::ROAD_AUTOMATIC;
-                       if (!strcmp(oname, "road")) roadtype=Road2::ROAD_FLAT;
-                       Vector3 pos=Vector3(ox, oy, oz);
-                       Quaternion rotation;
-                       rotation=Quaternion(Degree(rx), 
Vector3::UNIT_X)*Quaternion(Degree(ry), Vector3::UNIT_Y)*Quaternion(Degree(rz), 
Vector3::UNIT_Z);
-                       if ((pos-r2lastpos).length()>20.0)
-                       {
-                               //break the road
-                               if (r2oldmode!=0)
-                               {
-                                       //fill object
-                                       ProceduralPoint pp;
-                                       pp.bheight = 0.2;
-                                       pp.bwidth = 1.4;
-                                       pp.pillartype = pillartype;
-                                       pp.position = 
r2lastpos+r2lastrot*Vector3(10.0,0,0);
-                                       pp.rotation = r2lastrot;
-                                       pp.type = roadtype;
-                                       pp.width = 8;
-                                       po.points.push_back(pp);
-
-                                       // finish it and start new object
-                                       if (proceduralManager)
-                                               
proceduralManager->addObject(po);
-                                       po = ProceduralObject();
-                                       r2oldmode=1;
-                               }
-                               r2oldmode=1;
-                               // beginning of new
-                               ProceduralPoint pp;
-                               pp.bheight = 0.2;
-                               pp.bwidth = 1.4;
-                               pp.pillartype = pillartype;
-                               pp.position = pos;
-                               pp.rotation = rotation;
-                               pp.type = roadtype;
-                               pp.width = 8;
-                               po.points.push_back(pp);
-                       }
-                       else
-                       {
-                               //fill object
-                               ProceduralPoint pp;
-                               pp.bheight = 0.2;
-                               pp.bwidth = 1.4;
-                               pp.pillartype = pillartype;
-                               pp.position = pos;
-                               pp.rotation = rotation;
-                               pp.type = roadtype;
-                               pp.width = 8;
-                               po.points.push_back(pp);
-                       }
-                       r2lastpos=pos;
-                       r2lastrot=rotation;
-
-
-                       continue;
-               }
-               loadObject(oname, ox, oy, oz, rx, ry, rz, bakeNode, name, true, 
-1, type);
-       }
-       //fclose(fd);
-
-       // ds closes automatically, so do not close it explicitly here:
-       //ds->close();
-
-       // finish the last road
-       if (r2oldmode != 0)
-       {
-               //fill object
-               ProceduralPoint pp;
-               pp.bheight = 0.2;
-               pp.bwidth = 1.4;
-               pp.pillartype = 1;
-               pp.position = r2lastpos+r2lastrot*Vector3(10.0,0,0);
-               pp.rotation = r2lastrot;
-               pp.type = Road2::ROAD_AUTOMATIC;
-               pp.width = 8;
-               po.points.push_back(pp);
-
-               // finish it and start new object
-               if (proceduralManager)
-                       proceduralManager->addObject(po);
-       }
-
-
-       // okay, now bake everything
-       bakesg = mSceneMgr->createStaticGeometry("bakeSG");
-       bakesg->setCastShadows(true);
-       bakesg->addSceneNode(bakeNode);
-       bakesg->setRegionDimensions(Vector3(farclip/2.0, 10000.0, farclip/2.0));
-       bakesg->setRenderingDistance(farclip);
-       try
-       {
-               bakesg->build();
-               bakeNode->detachAllObjects();
-               // crash under linux:
-               //bakeNode->removeAndDestroyAllChildren();
-       }catch(...)
-       {
-               LOG("error while baking roads. ignoring.");
-
-       }
-
-#ifdef USE_MYGUI
-       // tell this the map, so it can change the drawing distance !
-       if (mtc)
-       {
-               mtc->setStaticGeometry(bakesg);
-       }
-#endif //USE_MYGUI
-
-       collisions->printStats();
-       loading_state=TERRAIN_LOADED;
-
-       // we set the sky this late, so the user can configure it ...
-       if (SSETTING("Sky effects", "Caelum (best looking, slower)")!="Caelum 
(best looking, slower)")
-       {
-               if (strlen(sandstormcubemap)>0)
-               {
-                       // use custom
-                       mSceneMgr->setSkyBox(true, sandstormcubemap, 100, true);
-               } else
-               {
-                       // use default
-                       mSceneMgr->setSkyBox(true, "tracks/skyboxcol", 100, 
true);
-               }
-       }
-
-       if (debugCollisions)
-               collisions->createCollisionDebugVisualization();
-
-       // bake the decals
-       //finishTerrainDecal();
-
-#ifdef USE_MYGUI
-       LoadingWindow::getSingleton().hide();
-#endif //MYGUI
-
-#if 0
-       // put some trucks in a fancy circle
-       // not functional purpose, just for screenshots
-       {
-               float dg = 0, rad = 10;
-               for(int i=0;i < 200; i++)
-               {
-                       dg += (Ogre::Math::PI * 2) / (10+rad);
-                       rad += 0.4f;
-                       if (dg > 2 * Ogre::Math::PI)
-                       {
-                               //rad += 10;
-                               dg -= 2 * Ogre::Math::PI;
-                       }
-                       Vector3 pos(cx + cos(dg) * rad, cy, cz + sin(dg) * rad);
-                       BeamFactory::getSingleton().createLocal(pos, 
Quaternion(Radian(-dg), Vector3::UNIT_Y), "semi.truck");
-               }
-               BeamFactory::getSingleton().sendAllTrucksSleeping();
-       }
-#endif // 0
-
-       collisions->finishLoadingTerrain();
-}
-
 void RoRFrameListener::initTrucks(bool loadmanual, Ogre::String selected, 
Ogre::String selectedExtension, std::vector<Ogre::String> *truckconfig, bool 
enterTruck, Skin *skin)
 {
        //we load truck

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rigsofrods-devel mailing list
Rigsofrods-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to