Revision: 1669
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1669&view=rev
Author:   rorthomas
Date:     2011-02-13 12:29:26 +0000 (Sun, 13 Feb 2011)

Log Message:
-----------
linux compilation and warning fixes

Modified Paths:
--------------
    trunk/source/main/CMakeLists.txt
    trunk/source/main/audio/SoundScriptManager.cpp
    trunk/source/main/gameplay/CacheSystem.cpp
    trunk/source/main/gameplay/RoRFrameListener.cpp
    trunk/source/main/gui/SelectorWindow.cpp
    trunk/source/main/gui/SelectorWindow.h
    trunk/source/main/physics/input_output/BeamLoadTruck.cpp
    trunk/source/main/physics/input_output/ForceFeedback.h
    trunk/source/main/scripting/ScriptEngine.cpp

Modified: trunk/source/main/CMakeLists.txt
===================================================================
--- trunk/source/main/CMakeLists.txt    2011-02-13 12:26:04 UTC (rev 1668)
+++ trunk/source/main/CMakeLists.txt    2011-02-13 12:29:26 UTC (rev 1669)
@@ -99,7 +99,7 @@
 add_sub_dir(physics/air)
 add_sub_dir(physics/collision)
 add_sub_dir(physics/flex)
-add_sub_dir(physics/io)
+add_sub_dir(physics/input_output)
 add_sub_dir(physics/mplatform)
 add_sub_dir(physics/utils)
 add_sub_dir(physics/water)

Modified: trunk/source/main/audio/SoundScriptManager.cpp
===================================================================
--- trunk/source/main/audio/SoundScriptManager.cpp      2011-02-13 12:26:04 UTC 
(rev 1668)
+++ trunk/source/main/audio/SoundScriptManager.cpp      2011-02-13 12:29:26 UTC 
(rev 1669)
@@ -165,22 +165,32 @@
 void SoundScriptManager::unloadResourceGroup(String groupname)
 {
        //first, search if there is a template name collision
-       for(std::map<Ogre::String, SoundScriptTemplate*>::iterator it = 
templates.begin(); it!=templates.end();it++)
+       for(std::map<Ogre::String, SoundScriptTemplate*>::iterator it = 
templates.begin(); it!=templates.end();)
+       {
                if (it->second->groupname == groupname)
-                       it = templates.erase(it);
+               {
+                       templates.erase(it++);
+               } else
+               {
+                       ++it;
+               }
+       }
 }
 
 void SoundScriptManager::clearNonBaseTemplates()
 {
        int counter = 0;
-       for(std::map<Ogre::String, SoundScriptTemplate*>::iterator it = 
templates.begin(); it!=templates.end();it++)
+       for(std::map<Ogre::String, SoundScriptTemplate*>::iterator it = 
templates.begin(); it!=templates.end();)
        {
                if (it->second && !it->second->baseTemplate)
                {
                        delete(it->second);
                        it->second=0;
-                       it = templates.erase(it);
+                       templates.erase(it++);
                        counter++;
+               } else
+               {
+                       ++it;
                }
        }
        if(counter>0)

Modified: trunk/source/main/gameplay/CacheSystem.cpp
===================================================================
--- trunk/source/main/gameplay/CacheSystem.cpp  2011-02-13 12:26:04 UTC (rev 
1668)
+++ trunk/source/main/gameplay/CacheSystem.cpp  2011-02-13 12:29:26 UTC (rev 
1669)
@@ -6,7 +6,7 @@
 For more information, see http://www.rigsofrods.com/
 
 Rigs of Rods is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License version 3, as 
+it under the terms of the GNU General Public License version 3, as
 published by the Free Software Foundation.
 
 Rigs of Rods is distributed in the hope that it will be useful,
@@ -30,7 +30,7 @@
 #include "BeamData.h" // for authorinfo_t
 #include "ScopeLog.h"
 
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
 #include "LoadingWindow.h"
 #endif //MYGUI
 
@@ -705,7 +705,7 @@
 
        LogManager::getSingleton().logMessage("* incremental check starting 
...");
        LogManager::getSingleton().logMessage("* incremental check (1/5): 
deleted and changed files ...");
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
        LoadingWindow::get()->setProgress(20, _L("incremental check: deleted 
and changed files"));
 #endif //MYGUI
        std::vector<Cache_Entry>::iterator it;
@@ -714,7 +714,7 @@
        for(it = entries.begin(); it != entries.end(); it++, counter++)
        {
                int progress = ((float)counter/(float)(entries.size()))*100;
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
                LoadingWindow::get()->setProgress(progress, _L("incremental 
check: deleted and changed files\n" + it->type + ": " + it->fname));
 #endif //MYGUI
                if(it->type == "FileSystem")
@@ -723,7 +723,7 @@
                        if(!fileExists(fn))
                        {
                                LogManager::getSingleton().logMessage("- "+fn+" 
is not existing");
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
                                LoadingWindow::get()->setProgress(20, 
_L("incremental check: deleted and changed files\n")+it->fname+_L(" not 
existing"));
 #endif // MYGUI
                                removeFileFromFileCache(it);
@@ -741,7 +741,7 @@
                        if(!fileExists(fn))
                        {
                                LogManager::getSingleton().logMessage("- 
"+fn+_L(" not existing"));
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
                                LoadingWindow::get()->setProgress(20, 
_L("incremental check: deleted and changed files\n")+it->fname+_L(" not 
existing"));
 #endif //MYGUI
                                removeFileFromFileCache(it);
@@ -789,7 +789,7 @@
        std::vector<Ogre::String> reloaded_zips;
        std::vector<Ogre::String>::iterator sit;
        LogManager::getSingleton().logMessage("* incremental check (2/5): 
processing changed zips ...");
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
        LoadingWindow::get()->setProgress(40, _L("incremental check: processing 
changed zips\n"));
 #endif //MYGUI
        for(it = changed_entries.begin(); it != changed_entries.end(); it++)
@@ -805,7 +805,7 @@
                }
                if (!found)
                {
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
                        LoadingWindow::get()->setProgress(40, _L("incremental 
check: processing changed zips\n")+it->fname);
 #endif //MYGUI
                        loadSingleZip(*it);
@@ -813,19 +813,19 @@
                }
        }
        LogManager::getSingleton().logMessage("* incremental check (3/5): new 
content ...");
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
        LoadingWindow::get()->setProgress(60, _L("incremental check: new 
content\n"));
 #endif //MYGUI
        checkForNewContent();
 
        LogManager::getSingleton().logMessage("* incremental check (4/5): new 
files ...");
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
        LoadingWindow::get()->setProgress(80, _L("incremental check: new 
files\n"));
 #endif //MYGUI
        checkForNewKnownFiles();
 
        LogManager::getSingleton().logMessage("* incremental check (5/5): 
duplicates ...");
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
        LoadingWindow::get()->setProgress(90, _L("incremental check: 
duplicates\n"));
 #endif //MYGUI
        std::vector<Cache_Entry>::iterator it2;
@@ -905,7 +905,7 @@
                        }
                }
        }
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
        LoadingWindow::get()->setAutotrack(_L("loading...\n"));
 #endif //MYGUI
 
@@ -914,7 +914,7 @@
 
        writeGeneratedCache();
 
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
        LoadingWindow::get()->hide();
 #endif // MYGUI
        LogManager::getSingleton().logMessage("* incremental check done.");
@@ -1126,7 +1126,7 @@
        if(!f)
                return;
        fprintf(f, "shaone=%s\n", const_cast<char*>(currentSHA1.c_str()));
-       fprintf(f, "modcount=%d\n", entries.size());
+       fprintf(f, "modcount=%d\n", (int)entries.size());
        fprintf(f, "skincount=%d\n", 
SkinManager::getSingleton().getSkinCount());
        fprintf(f, "cacheformat=%s\n", CACHE_FILE_FORMAT);
 
@@ -2854,7 +2854,7 @@
                }
                // update loader
                int progress = ((float)i/(float)filecount)*100;
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
                LoadingWindow::get()->setProgress(progress, _L("Loading zips in 
group ") + group + "\n" + iterFiles->filename + "\n" + 
StringConverter::toString(i) + "/" + StringConverter::toString(filecount));
 #endif //MYGUI
 
@@ -2862,7 +2862,7 @@
                loadedZips[iterFiles->filename] = true;
        }
        // hide loader again
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
        LoadingWindow::get()->hide();
 #endif //MYGUI
 }
@@ -2877,13 +2877,13 @@
                String dirname = listitem->archive->getName() + 
SETTINGS.getSetting("dirsep") + listitem->filename;
                // update loader
                int progress = ((float)i/(float)filecount)*100;
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
                LoadingWindow::get()->setProgress(progress, _L("Loading 
directory\n") + listitem->filename);
 #endif //MYGUI
                loadSingleDirectory(dirname, group, true);
        }
        // hide loader again
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
        LoadingWindow::get()->hide();
 #endif //MYGUI
 }
@@ -2926,12 +2926,12 @@
                zippath=zippath2;
                #endif
                int progress = ((float)i/(float)filecount)*100;
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
                LoadingWindow::get()->setProgress(progress, _L("checking for 
new zips in ") + group + "\n" + iterFiles->filename + "\n" + 
StringConverter::toString(i) + "/" + StringConverter::toString(filecount));
 #endif //MYGUI
                if(!isZipUsedInEntries(zippath2))
                {
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
                        LoadingWindow::get()->setProgress(progress, 
_L("checking for new zips in ") + group + "\n" + _L("loading new zip: ") + 
iterFiles->filename + "\n" + StringConverter::toString(i) + "/" + 
StringConverter::toString(filecount));
 #endif //MYGUI
                        LogManager::getSingleton().logMessage("- "+zippath+" is 
new");
@@ -2939,7 +2939,7 @@
                        loadSingleZip((Ogre::FileInfo)*iterFiles);
                }
        }
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
        LoadingWindow::get()->hide();
 #endif //MYGUI
 }
@@ -2953,19 +2953,19 @@
                if(!listitem->archive) continue;
                String dirname = listitem->archive->getName() + 
SETTINGS.getSetting("dirsep") + listitem->filename;
                int progress = ((float)i/(float)filecount)*100;
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
                LoadingWindow::get()->setProgress(progress, _L("checking for 
new directories in ") + group + "\n" + listitem->filename + "\n" + 
StringConverter::toString(i) + "/" + StringConverter::toString(filecount));
 #endif // MYGUI
                if(!isDirectoryUsedInEntries(dirname))
                {
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
                        LoadingWindow::get()->setProgress(progress, 
_L("checking for new directories in ") + group + "\n" + _L("loading new 
directory: ") + listitem->filename + "\n" + StringConverter::toString(i) + "/" 
+ StringConverter::toString(filecount));
 #endif //MYGUI
                        LogManager::getSingleton().logMessage("- "+dirname+" is 
new");
                        loadSingleDirectory(dirname, group, true);
                }
        }
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
        LoadingWindow::get()->hide();
 #endif //MYGUI
 }

Modified: trunk/source/main/gameplay/RoRFrameListener.cpp
===================================================================
--- trunk/source/main/gameplay/RoRFrameListener.cpp     2011-02-13 12:26:04 UTC 
(rev 1668)
+++ trunk/source/main/gameplay/RoRFrameListener.cpp     2011-02-13 12:29:26 UTC 
(rev 1669)
@@ -6,7 +6,7 @@
 For more information, see http://www.rigsofrods.com/
 
 Rigs of Rods is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License version 3, as 
+it under the terms of the GNU General Public License version 3, as
 published by the Free Software Foundation.
 
 Rigs of Rods is distributed in the hope that it will be useful,
@@ -926,7 +926,7 @@
        new GUI_MainMenu(this);
        new GUI_Friction();
 
-       MyGUI::LayoutManager::getInstance().load("wallpaper.layout");
+       MyGUI::VectorWidgetPtr v = 
MyGUI::LayoutManager::getInstance().loadLayout("wallpaper.layout");
 
 #endif //MYGUI
 
@@ -1656,8 +1656,8 @@
        sscanf(line, "%f, %f, %f",&scx,&scy,&scz);
        sprintf(oname,"object%i(%s)", objcounter,name);
        objcounter++;
-       
 
+
        SceneNode *tenode = 
mSceneMgr->getRootSceneNode()->createChildSceneNode();
        MeshObject *mo = new MeshObject(mScene, mesh, oname, tenode);
        //mo->setQueryFlags(OBJECTS_MASK);
@@ -2178,9 +2178,9 @@
        }
 
        // update characters
-       if(loading_state==ALL_LOADED && net) 
+       if(loading_state==ALL_LOADED && net)
                CharacterFactory::getSingleton().updateCharacters(dt);
-       else if(loading_state==ALL_LOADED && !net && cameramode != CAMERA_FREE) 
+       else if(loading_state==ALL_LOADED && !net && cameramode != CAMERA_FREE)
                person->update(dt);
 
        // no event handling during chatting!
@@ -2285,7 +2285,7 @@
 
                        const RenderTarget::FrameStats& stats = 
mWindow->getStatistics();
                        as->addData("AVGFPS", 
StringConverter::toString(stats.avgFPS));
-                       
+
                        as->write();
                        delete(as);
                } else
@@ -2294,7 +2294,7 @@
                        mWindow->writeContentsToFile(tmpfn);
                }
                LogManager::getSingleton().logMessage("Wrote screenshot : " + 
tmpfn);
-               
+
                // hide any old flash message
                if(ow) ow->hideFlashMessage();
 
@@ -2808,9 +2808,9 @@
                                                if(sum > 1) sum = 1;
 
                                                
trucks[current_truck]->hydrodircommand = sum;
-                                               
+
                                                if 
((tmp_left_digital<tmp_left_analog) || (tmp_right_digital<tmp_right_analog))
-                                                       
trucks[current_truck]->hydroSpeedCoupling=false; 
+                                                       
trucks[current_truck]->hydroSpeedCoupling=false;
                                                else
                                                        
trucks[current_truck]->hydroSpeedCoupling=true;
 
@@ -3548,7 +3548,7 @@
                                                        
trucks[current_truck]->currentcamera=0;
                                                        
trucks[current_truck]->changedCamera();
                                                }
-                                               
+
                                                if (cameramode==CAMERA_END) 
cameramode = CAMERA_EXT;
                                        }
                                }
@@ -4606,7 +4606,7 @@
 }
 
 void RoRFrameListener::loadClassicTerrain(String terrainfile)
-{      
+{
        //we load a classic terrain
        //FILE *fd;
        char geom[1024];
@@ -4645,7 +4645,7 @@
                SETTINGS.setSetting("new Terrain Mode", "Yes");
        }
 
-       
+
        //colour
        ds->readLine(line, 1023);
        //water stuff
@@ -4885,7 +4885,7 @@
                        // testing composite map
                        
TerrainGlobalOptions::getSingleton().setCompositeMapDistance(mCamera->getFarClipDistance());//300);
                        
//mTerrainGlobals->setUseRayBoxDistanceCalculation(true);
-                       
+
                        // adds strange colours for debug purposes
                        
//TerrainGlobalOptions::getSingleton().getDefaultMaterialGenerator()->setDebugLevel(1);
 
@@ -4902,7 +4902,7 @@
 
                        
TerrainGlobalOptions::getSingleton().setLightMapSize(256);
                        
TerrainGlobalOptions::getSingleton().setCastsDynamicShadows(false);
-                       
+
                        // Important to set these so that the terrain knows 
what to use for derived (non-realtime) data
                        if(mainLight) 
TerrainGlobalOptions::getSingleton().setLightMapDirection(mainLight->getDerivedDirection());
                        
TerrainGlobalOptions::getSingleton().setCompositeMapAmbient(mSceneMgr->getAmbientLight());
@@ -5080,7 +5080,7 @@
                                                }
                                        }
                                }
-                               
+
                                if(disableCaching)
                                        mTerrainGroup->saveAllTerrains(false);
                        } else
@@ -5101,7 +5101,7 @@
 
                        mTerrainGroup->freeTemporaryResources();
 
-                       
+
                }
        }
 
@@ -6703,7 +6703,7 @@
                        float real_camDist = 
(mCamera->getPosition()-person->getPosition()).length();
                        Radian fov = Radian(atan2(20.0f,real_camDist));
                        mCamera->setFOVy(fov);
-               
+
                        if(mDOF)
                        {
                                mDOF->setFocusMode(DOFManager::Manual);
@@ -8038,18 +8038,18 @@
        bool success;
 
        // Create the shader based technique of this material.
-       success = 
Ogre::RTShader::ShaderGenerator::getSingleton().createShaderBasedTechnique(curMaterialName,
 
+       success = 
Ogre::RTShader::ShaderGenerator::getSingleton().createShaderBasedTechnique(curMaterialName,
                                                
MaterialManager::DEFAULT_SCHEME_NAME,
                                                
RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME);
        if(!success)
                return false;
-               
+
        // Setup custom shader sub render states according to current setup.
        MaterialPtr curMaterial = 
MaterialManager::getSingleton().getByName(curMaterialName);
        Pass* curPass = curMaterial->getTechnique(0)->getPass(0);
 
 
-       // Grab the first pass render state. 
+       // Grab the first pass render state.
        // NOTE: For more complicated samples iterate over the passes and build 
each one of them as desired.
        RTShader::RenderState* renderState = 
Ogre::RTShader::ShaderGenerator::getSingleton().getRenderState(RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME,
 curMaterialName, 0);
 
@@ -8062,7 +8062,7 @@
        /*
        {
                RTShader::SubRenderState* perPerVertexLightModel = 
Ogre::RTShader::ShaderGenerator::getSingleton().createSubRenderState(RTShader::FFPLighting::Type);
-               renderState->addTemplateSubRenderState(perPerVertexLightModel); 
+               renderState->addTemplateSubRenderState(perPerVertexLightModel);
        }
        */
 #endif
@@ -8071,16 +8071,16 @@
        {
                // SSLM_PerPixelLighting
                RTShader::SubRenderState* perPixelLightModel = 
Ogre::RTShader::ShaderGenerator::getSingleton().createSubRenderState(RTShader::PerPixelLighting::Type);
-                               
-               renderState->addTemplateSubRenderState(perPixelLightModel);     
                        
+
+               renderState->addTemplateSubRenderState(perPixelLightModel);
        } else
        {
                // SSLM_NormalMapLightingTangentSpace
                RTShader::SubRenderState* subRenderState = 
Ogre::RTShader::ShaderGenerator::getSingleton().createSubRenderState(RTShader::NormalMapLighting::Type);
                RTShader::NormalMapLighting* normalMapSubRS = 
static_cast<RTShader::NormalMapLighting*>(subRenderState);
-                                       
+
                
normalMapSubRS->setNormalMapSpace(RTShader::NormalMapLighting::NMS_TANGENT);
-               normalMapSubRS->setNormalMapTextureName(normalTextureName);     
+               normalMapSubRS->setNormalMapTextureName(normalTextureName);
 
                renderState->addTemplateSubRenderState(normalMapSubRS);
        }
@@ -8092,26 +8092,26 @@
                {
                        RTShader::SubRenderState* subRenderState = 
mShaderGenerator->createSubRenderState(RTShader::NormalMapLighting::Type);
                        RTShader::NormalMapLighting* normalMapSubRS = 
static_cast<RTShader::NormalMapLighting*>(subRenderState);
-                               
+
                        
normalMapSubRS->setNormalMapSpace(RTShader::NormalMapLighting::NMS_OBJECT);
-                       
normalMapSubRS->setNormalMapTextureName("Panels_Normal_Obj.png");       
+                       
normalMapSubRS->setNormalMapTextureName("Panels_Normal_Obj.png");
 
                        renderState->addTemplateSubRenderState(normalMapSubRS);
                }
-                               
+
                // It is secondary entity -> use simple per pixel lighting.
                else
                {
                        RTShader::SubRenderState* perPixelLightModel = 
mShaderGenerator->createSubRenderState(RTShader::PerPixelLighting::Type);
                        
renderState->addTemplateSubRenderState(perPixelLightModel);
-               }                               
+               }
        } */
 
 #endif
 
        // Invalidate this material in order to re-generate its shaders.
        
Ogre::RTShader::ShaderGenerator::getSingleton().invalidateMaterial(RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME,
 curMaterialName);
-       return true;                                            
+       return true;
 }
 
 void RoRFrameListener::RTSSgenerateShaders(Entity* entity, Ogre::String 
normalTextureName)
@@ -8121,7 +8121,7 @@
        {
                SubEntity* curSubEntity = entity->getSubEntity(i);
                const String& curMaterialName = curSubEntity->getMaterialName();
-       
+
                RTSSgenerateShadersForMaterial(curMaterialName, 
normalTextureName);
        }
 }

Modified: trunk/source/main/gui/SelectorWindow.cpp
===================================================================
--- trunk/source/main/gui/SelectorWindow.cpp    2011-02-13 12:26:04 UTC (rev 
1668)
+++ trunk/source/main/gui/SelectorWindow.cpp    2011-02-13 12:29:26 UTC (rev 
1669)
@@ -6,7 +6,7 @@
 For more information, see http://www.rigsofrods.com/
 
 Rigs of Rods is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License version 3, as 
+it under the terms of the GNU General Public License version 3, as
 published by the Free Software Foundation.
 
 Rigs of Rods is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
 You should have received a copy of the GNU General Public License
 along with Rigs of Rods.  If not, see <http://www.gnu.org/licenses/>.
 */
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
 
 #include "SelectorWindow.h"
 #include "LoadingWindow.h"
@@ -43,22 +43,22 @@
        mMainWidget->setRealPosition(0.1, 0.1);
        mMainWidget->setRealSize(0.8, 0.8);
 
-       mMainWidget->eventKeyButtonPressed      += MyGUI::newDelegate(this, 
&SelectorWindow::eventKeyButtonPressed_Main); 
+       mMainWidget->eventKeyButtonPressed      += MyGUI::newDelegate(this, 
&SelectorWindow::eventKeyButtonPressed_Main);
        mTypeComboBox->eventComboChangePosition += MyGUI::newDelegate(this, 
&SelectorWindow::eventComboChangePositionTypeComboBox);
-       mTypeComboBox->eventKeyButtonPressed    += MyGUI::newDelegate(this, 
&SelectorWindow::eventKeyButtonPressed_Main); 
+       mTypeComboBox->eventKeyButtonPressed    += MyGUI::newDelegate(this, 
&SelectorWindow::eventKeyButtonPressed_Main);
        mModelList->eventListChangePosition     += MyGUI::newDelegate(this, 
&SelectorWindow::eventListChangePositionModelList);
-       //mModelList->eventKeyButtonPressed       += MyGUI::newDelegate(this, 
&SelectorWindow::eventKeyButtonPressed_Main); 
+       //mModelList->eventKeyButtonPressed       += MyGUI::newDelegate(this, 
&SelectorWindow::eventKeyButtonPressed_Main);
        mConfigComboBox->eventComboAccept       += MyGUI::newDelegate(this, 
&SelectorWindow::eventComboAcceptConfigComboBox);
-       //mConfigComboBox->eventKeyButtonPressed  += MyGUI::newDelegate(this, 
&SelectorWindow::eventKeyButtonPressed_Main); 
+       //mConfigComboBox->eventKeyButtonPressed  += MyGUI::newDelegate(this, 
&SelectorWindow::eventKeyButtonPressed_Main);
        mOkButton->eventMouseButtonClick        += MyGUI::newDelegate(this, 
&SelectorWindow::eventMouseButtonClickOkButton);
        mCancelButton->eventMouseButtonClick    += MyGUI::newDelegate(this, 
&SelectorWindow::eventMouseButtonClickCancelButton);
-       
+
        // search stuff
        mSearchLineEdit->eventEditTextChange    += MyGUI::newDelegate(this, 
&SelectorWindow::eventSearchTextChange);
        mSearchLineEdit->eventMouseSetFocus     += MyGUI::newDelegate(this, 
&SelectorWindow::eventSearchTextGotFocus);
        mSearchLineEdit->eventKeySetFocus       += MyGUI::newDelegate(this, 
&SelectorWindow::eventSearchTextGotFocus);
-       mSearchLineEdit->eventKeyButtonPressed  += MyGUI::newDelegate(this, 
&SelectorWindow::eventKeyButtonPressed_Main); 
-       
+       mSearchLineEdit->eventKeyButtonPressed  += MyGUI::newDelegate(this, 
&SelectorWindow::eventKeyButtonPressed_Main);
+
        mSelectedSkin=0;
 }
 
@@ -73,7 +73,7 @@
        int iid = mModelList->getIndexSelected();
 
        bool searching = (mTypeComboBox->getCaption() == _L("Search Results"));
-       
+
        // search
        if(_key == MyGUI::KeyCode::Slash)
        {
@@ -235,7 +235,7 @@
                mTypeComboBox->setEnabled(true);
                mCancelButton->setEnabled(true);
        }
-       
+
        int ts = CACHE.getTimeStamp();
 
        std::vector<Cache_Entry> *entries = CACHE.getEntries();
@@ -261,13 +261,13 @@
                        add = (mLoaderType == LT_Trailer || mLoaderType == 
LT_Extension);
                else if(it->fext=="load")
                        add = (mLoaderType == LT_Load || mLoaderType == 
LT_Extension);
-               
+
                if(mLoaderType == LT_AllBeam && (it->fext == "truck" || 
it->fext == "car" ||  it->fext == "airplane" ||  it->fext == "trailer" ||  
it->fext == "boat" || it->fext == "load"))
                        add = true;
 
                if(!add)
                        continue;
-               
+
                // remove invalid ID's
                if(it->categoryid >= 9000)
                        it->categoryid = -1;
@@ -275,12 +275,12 @@
                // unsorted
                if(it->categoryid == -1)
                        it->categoryid = 9990;
-               
+
                mCategoryUsage[it->categoryid] = mCategoryUsage[it->categoryid] 
+ 1;
-               
+
                // all
                mCategoryUsage[9991] = mCategoryUsage[9991] + 1;
-               
+
                // fresh, 24 hours = 86400
                if(ts - it->addtimestamp < 86400)
                        mCategoryUsage[9992] = mCategoryUsage[9992] + 1;
@@ -290,7 +290,7 @@
                // search results
                mCategoryUsage[9994] = 0;
 
-               
+
                mEntries.push_back(*it);
        }
        int counter=0, counter2=0;
@@ -307,7 +307,7 @@
                if(usage == 0)
                        continue;
                counter2++;
-               
+
                String title = itc->second.title;
                if(title.empty())
                        title = _L("unkown");
@@ -342,7 +342,7 @@
        {
                if(it->categoryid == categoryID || (categoryID == 9991) || 
(categoryID == 9992 && (ts - it->addtimestamp < 86400)))
                        counter++;
-               
+
                // search results
                if(categoryID == 9994)
                {
@@ -421,7 +421,7 @@
                }
                entryID -= 1; // remove default skin :)
                Skin *skin = mCurrentSkins[entryID];
-               
+
                // check if loaded
                if(!skin->loaded && skin->sourcetype == "FileSystem")
                {
@@ -507,7 +507,7 @@
        String outBasename = "";
        String outPath = "";
        StringUtil::splitFilename(entry->filecachename, outBasename, outPath);
-       
+
        setPreviewImage(outBasename);
 
        if(entry->sectionconfigs.size())
@@ -525,7 +525,7 @@
                        }
                }
                mConfigComboBox->setIndexSelected(0);
-               
+
                mTruckConfigs.clear();
                String configstr = *mConfigComboBox->getItemDataAt<String>(0);
                mTruckConfigs.push_back(configstr);
@@ -654,11 +654,11 @@
        mCancelButton->setEnabled(enabled);
 }
 
-void SelectorWindow::eventSearchTextChange(MyGUI::WidgetPtr _sender)
+void SelectorWindow::eventSearchTextChange(MyGUI::EditBox *_sender)
 {
        if(!mMainWidget->getVisible()) return;
        onCategorySelected(9994);
-       mTypeComboBox->setCaption(_L("Search Results"));        
+       mTypeComboBox->setCaption(_L("Search Results"));
 }
 
 void SelectorWindow::eventSearchTextGotFocus(MyGUI::WidgetPtr _sender, 
MyGUI::WidgetPtr oldWidget)

Modified: trunk/source/main/gui/SelectorWindow.h
===================================================================
--- trunk/source/main/gui/SelectorWindow.h      2011-02-13 12:26:04 UTC (rev 
1668)
+++ trunk/source/main/gui/SelectorWindow.h      2011-02-13 12:29:26 UTC (rev 
1669)
@@ -6,7 +6,7 @@
 For more information, see http://www.rigsofrods.com/
 
 Rigs of Rods is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License version 3, as 
+it under the terms of the GNU General Public License version 3, as
 published by the Free Software Foundation.
 
 Rigs of Rods is distributed in the hope that it will be useful,
@@ -17,7 +17,7 @@
 You should have received a copy of the GNU General Public License
 along with Rigs of Rods.  If not, see <http://www.gnu.org/licenses/>.
 */
-#ifdef USE_MYGUI 
+#ifdef USE_MYGUI
 
 #ifndef __SELECTOR_WINDOW_H__
 #define __SELECTOR_WINDOW_H__
@@ -59,16 +59,16 @@
        void eventComboAcceptConfigComboBox(MyGUI::ComboBoxPtr _sender, size_t 
_index);
        void eventMouseButtonClickOkButton(MyGUI::WidgetPtr _sender);
        void eventMouseButtonClickCancelButton(MyGUI::WidgetPtr _sender);
-       void eventSearchTextChange(MyGUI::WidgetPtr _sender);
+       void eventSearchTextChange(MyGUI::EditBox *_sender);
        void eventSearchTextGotFocus(MyGUI::WidgetPtr _sender, MyGUI::WidgetPtr 
oldWidget);
-       
 
+
        // other functions
        void getData();
        void onCategorySelected(int categoryID);
        void onEntrySelected(int entryID);
        void selectionDone();
-       
+
        void updateControls(Cache_Entry *entry);
        void setPreviewImage(Ogre::String texture);
 

Modified: trunk/source/main/physics/input_output/BeamLoadTruck.cpp
===================================================================
--- trunk/source/main/physics/input_output/BeamLoadTruck.cpp    2011-02-13 
12:26:04 UTC (rev 1668)
+++ trunk/source/main/physics/input_output/BeamLoadTruck.cpp    2011-02-13 
12:29:26 UTC (rev 1669)
@@ -210,6 +210,7 @@
                if (!strcmp("slidenodes",line)) {mode=64;continue;}
                if (!strcmp("flares2",line)) {mode=65;continue;};
                if (!strcmp("animators",line)) {mode=66;continue;};
+               if (!strcmp("nodecollision",line)) {mode=68;continue;};
                if (!strncmp("enable_advanced_deformation", line, 27))
                {
                        // parse the optional threshold value
@@ -1714,6 +1715,13 @@
                                
//LogManager::getSingleton().logMessage(String(line));
                        }
 
+                       //verify array limits so we dont overflow
+                       if(keys >= MAX_COMMANDS || keyl >= MAX_COMMANDS)
+                       {
+                                       
LogManager::getSingleton().logMessage("Error parsing File (Command) " + 
String(fname) +" line " + StringConverter::toString(linecounter) + ". Command 
key invalid. trying to continue ...");
+                                       continue;
+                       }
+
                        int htype=BEAM_HYDRO;
 
                        char *options_pointer = options;
@@ -1783,7 +1791,6 @@
                        }
 
                        beams[pos].Lhydro=beams[pos].L;
-
                        //add short key
                        commandkey[keys].beams.push_back(-pos);
                        char *descr_pointer = descr;
@@ -3773,6 +3780,22 @@
 
                else if (mode==63) parseRailGroupLine(line);
                else if (mode==64) parseSlideNodeLine(line);
+               else if (mode==68)
+               {
+                       // parse nodecollision
+                       int nodenum  = -1;
+                       float radius =  0;
+                       int result = sscanf(line,"%d, %f", &nodenum, &radius);
+                       if (result < 2 || result == EOF)
+                       {
+                               LogManager::getSingleton().logMessage("Error 
parsing File (nodecollision) " + String(fname) +" line " + 
StringConverter::toString(linecounter) + ". trying to continue ...");
+                               continue;
+                       }
+                       if(nodenum >= free_node || nodenum < 0)
+                               continue;
+                       
+                       nodes[nodenum].collRadius = radius;
+               }
 
        };
        if(!loading_finished) {

Modified: trunk/source/main/physics/input_output/ForceFeedback.h
===================================================================
--- trunk/source/main/physics/input_output/ForceFeedback.h      2011-02-13 
12:26:04 UTC (rev 1668)
+++ trunk/source/main/physics/input_output/ForceFeedback.h      2011-02-13 
12:29:26 UTC (rev 1669)
@@ -20,6 +20,7 @@
 #ifndef __ForceFeedback_H__
 #define __ForceFeedback_H__
 
+#include "RoRPrerequisites.h"
 #include "Ogre.h"
 #include <math.h>
 #include "OISForceFeedback.h"

Modified: trunk/source/main/scripting/ScriptEngine.cpp
===================================================================
--- trunk/source/main/scripting/ScriptEngine.cpp        2011-02-13 12:26:04 UTC 
(rev 1668)
+++ trunk/source/main/scripting/ScriptEngine.cpp        2011-02-13 12:29:26 UTC 
(rev 1669)
@@ -6,7 +6,7 @@
 For more information, see http://www.rigsofrods.com/
 
 Rigs of Rods is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License version 3, as 
+it under the terms of the GNU General Public License version 3, as
 published by the Free Software Foundation.
 
 Rigs of Rods is distributed in the hope that it will be useful,
@@ -135,7 +135,7 @@
        // get some other optional functions
        frameStepFunctionPtr = mod->GetFunctionIdByDecl("void 
frameStep(float)");
        wheelEventFunctionPtr = mod->GetFunctionIdByDecl("void wheelEvents(int, 
string, string, string)");
-       
+
        eventCallbackFunctionPtr = mod->GetFunctionIdByDecl("void 
eventCallback(int, int)");
 
        // Create our context, prepare it, and then execute
@@ -515,9 +515,9 @@
        result = engine->RegisterObjectMethod("GameScriptClass", "float 
rangeRandom(float, float)", AngelScript::asMETHOD(GameScript,rangeRandom), 
AngelScript::asCALL_THISCALL); assert(result>=0);
        result = engine->RegisterObjectMethod("GameScriptClass", "int 
useOnlineAPI(const string &in, const dictionary &in, string &out)", 
AngelScript::asMETHOD(GameScript,useOnlineAPI), AngelScript::asCALL_THISCALL); 
assert(result>=0);
        result = engine->RegisterObjectMethod("GameScriptClass", "int 
getLoadedTerrain(string &out)", 
AngelScript::asMETHOD(GameScript,getLoadedTerrain), 
AngelScript::asCALL_THISCALL); assert(result>=0);
-       
-       
 
+
+
        // class CacheSystem
        result = engine->RegisterObjectType("CacheSystemClass", 
sizeof(CacheSystem), AngelScript::asOBJ_REF | AngelScript::asOBJ_NOHANDLE);
        result = engine->RegisterObjectMethod("CacheSystemClass", "bool 
checkResourceLoaded(string &in)", AngelScript::asMETHODPR(CacheSystem, 
checkResourceLoaded, (Ogre::String &), bool), AngelScript::asCALL_THISCALL); 
assert(result>=0);
@@ -661,7 +661,7 @@
                                {
                                  // The return value is only valid if the 
execution finished successfully
                                        AngelScript::asDWORD ret = 
context->GetReturnDWord();
-                               }                               
+                               }
                        }
                }
        }
@@ -1162,18 +1162,18 @@
 {
   size_t realsize = size * nmemb;
   struct curlMemoryStruct *mem = (struct curlMemoryStruct *)data;
- 
+
   mem->memory = (char *)realloc(mem->memory, mem->size + realsize + 1);
   if (mem->memory == NULL) {
-    /* out of memory! */ 
+    /* out of memory! */
     printf("not enough memory (realloc returned NULL)\n");
     exit(EXIT_FAILURE);
   }
- 
+
   memcpy(&(mem->memory[mem->size]), ptr, realsize);
   mem->size += realsize;
   mem->memory[mem->size] = 0;
- 
+
   return realsize;
 }
 #endif //USE_CURL
@@ -1182,10 +1182,10 @@
 {
 #ifdef USE_CURL
        struct curlMemoryStruct chunk;
- 
-       chunk.memory = (char *)malloc(1);  /* will be grown as needed by the 
realloc above */ 
-       chunk.size = 0;    /* no data at this point */ 
 
+       chunk.memory = (char *)malloc(1);  /* will be grown as needed by the 
realloc above */
+       chunk.size = 0;    /* no data at this point */
+
        // construct post fields
        struct curl_httppost *formpost=NULL;
        struct curl_httppost *lastptr=NULL;
@@ -1239,7 +1239,7 @@
        curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "MP_ServerName", 
CURLFORM_COPYCONTENTS, SETTINGS.getSetting("Server name").c_str(), 
CURLFORM_END);
        curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "MP_ServerPort", 
CURLFORM_COPYCONTENTS, SETTINGS.getSetting("Server port").c_str(), 
CURLFORM_END);
        curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, 
"MP_NetworkEnabled", CURLFORM_COPYCONTENTS, SETTINGS.getSetting("Network 
enable").c_str(), CURLFORM_END);
-       
+
        if(mefl->getCurrentTruckNumber() >= 0 && mefl->getCurrentTruck())
        {
                Beam *truck = mefl->getCurrentTruck();
@@ -1252,8 +1252,8 @@
        const RenderTarget::FrameStats& stats = 
mefl->getRenderWindow()->getStatistics();
        curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "AVG_FPS", 
CURLFORM_COPYCONTENTS, StringConverter::toString(stats.avgFPS).c_str(), 
CURLFORM_END);
 
- 
-       
+
+
        CURLcode res;
        CURL *curl = curl_easy_init();
        if(!curl)
@@ -1268,12 +1268,12 @@
        string url = "http://"; + string(REPO_SERVER) + apiquery;
        curl_easy_setopt(curl, CURLOPT_URL,              url.c_str());
 
-       /* send all data to this function  */ 
+       /* send all data to this function  */
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curlWriteMemoryCallback);
- 
-       /* we pass our 'chunk' struct to the callback function */ 
+
+       /* we pass our 'chunk' struct to the callback function */
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void *)&chunk);
- 
+
        // set post options
        curl_easy_setopt(curl, CURLOPT_HTTPPOST, formpost);
 
@@ -1283,14 +1283,14 @@
 
        // http related settings
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION,   1); // follow redirects
-       curl_easy_setopt(curl, CURLOPT_AUTOREFERER,      1); // set the 
Referer: field in requests where it follows a Location: redirect. 
+       curl_easy_setopt(curl, CURLOPT_AUTOREFERER,      1); // set the 
Referer: field in requests where it follows a Location: redirect.
        curl_easy_setopt(curl, CURLOPT_MAXREDIRS,        20);
        curl_easy_setopt(curl, CURLOPT_USERAGENT,        "RoR");
        curl_easy_setopt(curl, CURLOPT_FILETIME,         1);
-       
+
        // TO BE DONE: ADD SSL
        // see: http://curl.haxx.se/libcurl/c/simplessl.html
-       // curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,1L); 
+       // curl_easy_setopt(curl,CURLOPT_SSL_VERIFYPEER,1L);
 
        res = curl_easy_perform(curl);
        curl_easy_cleanup(curl);
@@ -1307,8 +1307,8 @@
                // then free
                free(chunk.memory);
        }
- 
-       /* we're done with libcurl, so clean it up */ 
+
+       /* we're done with libcurl, so clean it up */
        curl_global_cleanup();
 
        if(res != CURLE_OK)


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

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel

Reply via email to