Revision: 2640 http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2640&view=rev Author: ulteq Date: 2012-05-23 23:02:31 +0000 (Wed, 23 May 2012) Log Message: ----------- fixes 2622 cleanup++
Modified Paths: -------------- trunk/source/main/gameplay/RoRFrameListener.cpp trunk/source/main/gui/TruckHUD.cpp Modified: trunk/source/main/gameplay/RoRFrameListener.cpp =================================================================== --- trunk/source/main/gameplay/RoRFrameListener.cpp 2012-05-23 21:11:47 UTC (rev 2639) +++ trunk/source/main/gameplay/RoRFrameListener.cpp 2012-05-23 23:02:31 UTC (rev 2640) @@ -1149,7 +1149,7 @@ // now continue to load everything... - if (preselected_map != "") + if (!preselected_map.empty()) { if (!CACHE.checkResourceLoaded(preselected_map)) { @@ -1168,41 +1168,9 @@ terrainUID = ce.uniqueid; loadTerrain(preselected_map); - //miniature map stuff - //char ppname[1024]; - //sprintf(ppname, "%s-mini.png", preselected_map); - //MaterialPtr tmat=(MaterialPtr)(MaterialManager::getSingleton().getByName("tracks/Map")); - //search if mini picture exists - //FileInfoListPtr files= ResourceGroupManager::getSingleton().findResourceFileInfo(ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME`, ppname); - //if ( && !files->empty()) - //{ - // tmat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(ppname); - //} - //else - //{ - // tmat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName("unknown.png"); - //} - - //load preselected truck - if (preselected_truck == "none") + if (preselected_truck.empty()) { - // do not load truck - } else if (preselected_truck != "") - { - loading_state=TERRAIN_LOADED; - std::vector<String> *tconfig = 0; - if (!preselected_truckConfig.empty()) - { - std::vector<String> tconfig2; - if (!preselected_truckConfig.empty()) - tconfig2.push_back(preselected_truckConfig); - tconfig = &tconfig2; - } - initTrucks(true, preselected_truck.c_str(), "", tconfig, enterTruck); - - } else { - // no trucks loaded? if (truck_preload_num == 0 && (!netmode || !terrainHasTruckShop)) { #ifdef USE_MYGUI @@ -1212,27 +1180,30 @@ { hideMap(); SelectorWindow::getSingleton().show(SelectorWindow::LT_NetworkWithBoat); - } - else + } else { hideMap(); SelectorWindow::getSingleton().show(SelectorWindow::LT_Network); } -#endif //USE_MYGUI - } else { - // init no trucks, as there were found some +#endif // USE_MYGUI + } else + { initTrucks(false, preselected_map); } + } else if (!preselected_truck.empty() && preselected_truck != "none") + { + // load preselected truck + loading_state = TERRAIN_LOADED; + initTrucks(true, preselected_truck, "", &std::vector<String>(1, preselected_truckConfig), enterTruck); } } else { #ifdef USE_MYGUI // show terrain selector hideMap(); - //LOG("huette debug 3"); SelectorWindow::getSingleton().show(SelectorWindow::LT_Terrain); SelectorWindow::getSingleton().setEnableCancel(false); -#endif //USE_MYGUI +#endif // USE_MYGUI } initialized=true; @@ -1274,8 +1245,6 @@ #endif } - - void RoRFrameListener::loadNetTerrain(char *preselected_map) { // load preselected map Modified: trunk/source/main/gui/TruckHUD.cpp =================================================================== --- trunk/source/main/gui/TruckHUD.cpp 2012-05-23 21:11:47 UTC (rev 2639) +++ trunk/source/main/gui/TruckHUD.cpp 2012-05-23 23:02:31 UTC (rev 2640) @@ -289,7 +289,7 @@ { velocityKMH = velocityMPH = 0.0f; } - overlayElement->setCaption(cspeedstr + TOUTFSTRING(Round(velocityKMH)) + U(" km/h (") + TOUTFSTRING(Round(velocityKMH)) + U(" mph)")); + overlayElement->setCaption(cspeedstr + TOUTFSTRING(Round(velocityKMH)) + U(" km/h (") + TOUTFSTRING(Round(velocityMPH)) + U(" mph)")); checkOverflow(overlayElement); overlayElement = OverlayManager::getSingleton().getOverlayElement("tracks/TruckInfoBox/MaxVelocity"); 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