Revision: 2518
          http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2518&view=rev
Author:   ulteq
Date:     2012-05-06 07:12:57 +0000 (Sun, 06 May 2012)
Log Message:
-----------
removed unreachable code, fixed typos, style++

Modified Paths:
--------------
    trunk/source/main/audio/SoundScriptManager.h
    trunk/source/main/framework/AdvancedOgreFramework.cpp
    trunk/source/main/framework/ContentManager.cpp
    trunk/source/main/gameplay/BeamEngine.h
    trunk/source/main/gameplay/RoRFrameListener.cpp
    trunk/source/main/gameplay/Savegame.cpp
    trunk/source/main/gameplay/TorqueCurve.cpp
    trunk/source/main/gameplay/TorqueCurve.h
    trunk/source/main/gameplay/autopilot.cpp
    trunk/source/main/gui/MapControl.cpp
    trunk/source/main/physics/Beam.cpp
    trunk/source/main/physics/BeamFactory.cpp
    trunk/source/main/physics/air/airbrake.cpp
    trunk/source/main/physics/air/turboprop.cpp
    trunk/source/main/physics/flex/FlexBody.cpp
    trunk/source/main/physics/input_output/SerializedRig.cpp
    trunk/source/main/scripting/ScriptEngine.cpp
    trunk/source/main/scripting/ScriptEngine.h
    trunk/source/main/scripting/as_ogre.cpp
    trunk/source/main/utils/CollisionTools.cpp
    trunk/source/main/utils/InputEngine.cpp
    trunk/source/main/utils/Settings.cpp
    trunk/source/main/utils/utils.cpp

Modified: trunk/source/main/audio/SoundScriptManager.h
===================================================================
--- trunk/source/main/audio/SoundScriptManager.h        2012-05-06 07:10:44 UTC 
(rev 2517)
+++ trunk/source/main/audio/SoundScriptManager.h        2012-05-06 07:12:57 UTC 
(rev 2518)
@@ -23,12 +23,10 @@
 
 #include "RoRPrerequisites.h"
 
-#include <OgreScriptLoader.h>
-
-// deprecated
-#include "BeamData.h" // for MAX_TRUCKS
 #include "Singleton.h"
 
+#include <OgreScriptLoader.h>
+
 enum {
        MAX_SOUNDS_PER_SCRIPT = 16,
        MAX_INSTANCES_PER_GROUP = 256
@@ -232,9 +230,9 @@
        float sounds_pitchgain[MAX_SOUNDS_PER_SCRIPT];
        float lastgain;
 
-       int truck;                              // holds the number of the 
truck this is for. important
-       int sound_link_type;            // holds the SL_ type this is bound to
-       int sound_link_item_id; // holds the item number this is for
+       int truck;              // holds the number of the truck this is for. 
important
+       int sound_link_type;    // holds the SL_ type this is bound to
+       int sound_link_item_id; // holds the item number this is for
 };
 
 class SoundScriptManager : public Ogre::ScriptLoader, public 
RoRSingleton<SoundScriptManager>
@@ -267,19 +265,12 @@
        void modulate    (Beam *b,   int mod, float value, int linkType = 
SL_DEFAULT, int linkItemID=-1);
 
        void setEnabled(bool state);
-       // deprecated
-       void soundEnable(bool state) { setEnabled(state); };
 
        void setCamera(Ogre::Vector3 position, Ogre::Vector3 direction, 
Ogre::Vector3 up, Ogre::Vector3 velocity);
        void setLoadingBaseSounds(bool value) { loading_base = value; };
 
        bool isDisabled() { return disabled; }
-       // deprecated
-       inline bool working() { return !disabled; }
 
-       // deprecated
-       static const unsigned int TERRAINSOUND = MAX_TRUCKS+1;
-
 private:
 
        SoundScriptTemplate* createTemplate(Ogre::String name, Ogre::String 
groupname, Ogre::String filename);

Modified: trunk/source/main/framework/AdvancedOgreFramework.cpp
===================================================================
--- trunk/source/main/framework/AdvancedOgreFramework.cpp       2012-05-06 
07:10:44 UTC (rev 2517)
+++ trunk/source/main/framework/AdvancedOgreFramework.cpp       2012-05-06 
07:12:57 UTC (rev 2518)
@@ -62,7 +62,6 @@
                {
                        showError(_L("Configuration error"), _L("Run the 
RoRconfig program first."));
                        exit(1);
-                       return false;
                }
        } else
        {
@@ -71,7 +70,6 @@
                {
                        showError(_L("Configuration error"), _L("Run the 
RoRconfig program first."));
                        exit(1);
-                       return false;
                }
 
                m_pRoot->initialise(false);
@@ -87,7 +85,6 @@
                m_pRenderWnd = m_pRoot->createRenderWindow(name, 320, 240, 
false, &param);
                return true;
        }
-       return false;
 }
 
 

Modified: trunk/source/main/framework/ContentManager.cpp
===================================================================
--- trunk/source/main/framework/ContentManager.cpp      2012-05-06 07:10:44 UTC 
(rev 2517)
+++ trunk/source/main/framework/ContentManager.cpp      2012-05-06 07:12:57 UTC 
(rev 2518)
@@ -80,16 +80,16 @@
 
 bool ContentManager::init(void)
 {
-    //Set listener if none has already been set
+    // set listener if none has already been set
     if (!Ogre::ResourceGroupManager::getSingleton().getLoadingListener())
         Ogre::ResourceGroupManager::getSingleton().setLoadingListener(this);
 
-       //try to get correct paths
-       //note: we don't have LogManager available yet!
-       //FIRST: Get the "program path" and the user space path
+       // try to get correct paths
+       // note: we don't have LogManager available yet!
+       // FIRST: Get the "program path" and the user space path
 
        // note: this is now done in the settings class, so set it up
-       // note: you need to set the buildmode correcty before you build the 
paths!
+       // note: you need to set the build mode correctly before you build the 
paths!
 
        // by default, display everything in the depth map
        Ogre::MovableObject::setDefaultVisibilityFlags(DEPTHMAP_ENABLED);
@@ -101,15 +101,15 @@
 
 
 
-       //load bootstrap and main resources
+       // load bootstrap and main resources
        String dirsep="/";
 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
        dirsep="\\";
 #endif
-       //bootstrap
+       // bootstrap
        // we load the bootstrap before already
 
-       //main game resources
+       // main game resources
        LOG("Loading main resources");
        loadMainResource("airfoils");
        loadMainResource("materials");
@@ -149,20 +149,20 @@
 
        // optional ones
 
-       // sound iss a bit special as we mark the base sounds so we dont clear 
them accidentially later on
+       // sound is a bit special as we mark the base sounds so we don't clear 
them accidentally later on
 #ifdef USE_OPENAL
        LOG("Creating Sound Manager");
        SoundScriptManager::getSingleton().setLoadingBaseSounds(true);
 #endif // USE_OPENAL
 
-       if (SSETTING("AudioDevice", "Default") != "No Output")
+       if (SSETTING("AudioDevice", "") != "No Output")
                loadMainResource("sounds");
 
        if (SSETTING("Sky effects", "Caelum (best looking, slower)") == "Caelum 
(best looking, slower)")
                loadMainResource("caelum");
 
        //if(BSETTING("Hydrax", false))
-       //      loadMainResource("hydrax", "Hydrax"); // special resourcegroup 
required!
+       //      loadMainResource("hydrax", "Hydrax"); // special resource group 
required!
 
        if(SSETTING("Vegetation", "None (fastest)") != "None (fastest)")
                loadMainResource("paged");
@@ -188,14 +188,14 @@
        if (SSETTING("Shadow technique", "") == "Parallel-split Shadow Maps")
                loadMainResource("pssm");
 
-       //streams path, to be processed later by the cache system
+       // streams path, to be processed later by the cache system
        LOG("Loading filesystems");
 
        ResourceGroupManager::getSingleton().addResourceLocation(SSETTING("User 
Path", "")+"cache", "FileSystem", "cache");
-       //config, flat
+       // config, flat
        ResourceGroupManager::getSingleton().addResourceLocation(SSETTING("User 
Path", "")+"config", "FileSystem", 
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
        ResourceGroupManager::getSingleton().addResourceLocation(SSETTING("User 
Path", "")+"alwaysload", "FileSystem", 
ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
-       //packs, to be processed later by the cache system
+       // packs, to be processed later by the cache system
 
        // add scripts folder
        ResourceGroupManager::getSingleton().addResourceLocation(SSETTING("User 
Path", "")+"scripts", "FileSystem", "Scripts");
@@ -208,7 +208,7 @@
        ColoredTextAreaOverlayElementFactory *pCT = new 
ColoredTextAreaOverlayElementFactory();
        OverlayManager::getSingleton().addOverlayElementFactory(pCT);
 
-       // Set default mipmap level (NB some APIs ignore this)
+       // set default mipmap level (NB some APIs ignore this)
        if(TextureManager::getSingletonPtr())
                TextureManager::getSingleton().setDefaultNumMipmaps(5);
        String tft=SSETTING("Texture Filtering", "Trilinear");
@@ -321,13 +321,13 @@
 #endif
        ResourceGroupManager& rgm = ResourceGroupManager::getSingleton();
 
-       FileInfoListPtr files= rgm.findResourceFileInfo(rg, "*", true); 
//searching for dirs
+       FileInfoListPtr files= rgm.findResourceFileInfo(rg, "*", true); // 
searching for dirs
        FileInfoList::iterator iterFiles = files->begin();
        for (; iterFiles!= files->end(); ++iterFiles)
        {
                if(!iterFiles->archive) continue;
                if (iterFiles->filename==String(".svn")) continue;
-               //trying to get the full path
+               // trying to get the full path
                String fullpath = iterFiles->archive->getName() + dirsep;
                rgm.addResourceLocation(fullpath+iterFiles->filename, 
"FileSystem", rg);
        }

Modified: trunk/source/main/gameplay/BeamEngine.h
===================================================================
--- trunk/source/main/gameplay/BeamEngine.h     2012-05-06 07:10:44 UTC (rev 
2517)
+++ trunk/source/main/gameplay/BeamEngine.h     2012-05-06 07:12:57 UTC (rev 
2518)
@@ -40,7 +40,7 @@
        char type;
        int running;
        int contact;
-       char status[256];
+       //char status[256];
        float hydropump;
        int prime;
 

Modified: trunk/source/main/gameplay/RoRFrameListener.cpp
===================================================================
--- trunk/source/main/gameplay/RoRFrameListener.cpp     2012-05-06 07:10:44 UTC 
(rev 2517)
+++ trunk/source/main/gameplay/RoRFrameListener.cpp     2012-05-06 07:12:57 UTC 
(rev 2518)
@@ -1219,7 +1219,7 @@
                                        hideMap();
                                        
SelectorWindow::getSingleton().show(SelectorWindow::LT_Network);
                                }
-#endif // MYGUI
+#endif //USE_MYGUI
                        } else {
                                // init no trucks, as there were found some
                                initTrucks(false, preselected_map);
@@ -1233,7 +1233,7 @@
                //LOG("huette debug 3");
                SelectorWindow::getSingleton().show(SelectorWindow::LT_Terrain);
                SelectorWindow::getSingleton().setEnableCancel(false);
-#endif // MYGUI
+#endif //USE_MYGUI
        }
 
        initialized=true;
@@ -1486,10 +1486,8 @@
        bool classic_ref=true;
        // everything is of concrete by default
        ground_model_t *gm = collisions->getGroundModelByString("concrete");
-       bool generateLod=false;
        char eventname[256];
        eventname[0]=0;
-       bool lodmode=false;
        while (!ds->eof())
        {
                size_t ll=ds->readLine(line, 1023);
@@ -1539,11 +1537,11 @@
                if (!strncmp("sound", ptline, 5))
                {
 #ifdef USE_OPENAL
-                       if(SoundScriptManager::getSingleton().working())
+                       if (!SoundScriptManager::getSingleton().isDisabled())
                        {
                                char tmp[255]="";
                                sscanf(ptline, "sound %s", tmp);
-                               SoundScriptInstance *sound = 
SoundScriptManager::getSingleton().createInstance(tmp, 
SoundScriptManager::TERRAINSOUND, tenode);
+                               SoundScriptInstance *sound = 
SoundScriptManager::getSingleton().createInstance(tmp, MAX_TRUCKS+1, tenode);
                                sound->setPosition(tenode->getPosition(), 
Vector3::ZERO);
                                sound->start();
                        }
@@ -1957,7 +1955,7 @@
                if(gm)
                        GUI_Friction::getSingleton().setActiveCol(gm);
        }
-#endif // MYGUI
+#endif //USE_MYGUI
 
 #ifdef USE_MYGUI
        if (INPUTENGINE.getEventBoolValueBounce(EV_COMMON_ENTER_CHATMODE, 0.5f) 
&& !hidegui)
@@ -2142,8 +2140,6 @@
 
        if (loading_state==ALL_LOADED)
        {
-
-               bool enablegrab = true;
                if (CAMERA_MODE != CameraManager::CAMERA_FREE)
                {
                        if (!curr_truck)
@@ -3090,7 +3086,7 @@
                                }
                        }
                }
-#endif // MYGUI
+#endif //USE_MYGUI
                if (INPUTENGINE.getEventBoolValueBounce(EV_COMMON_RESCUE_TRUCK, 
0.5f) && curr_truck && !netmode && curr_truck->driveable != AIRPLANE)
                {
                        if(!BeamFactory::getSingleton().enterRescueTruck())
@@ -3370,7 +3366,7 @@
 #endif //SOCKETW
        loading_state=EXITING;
 #ifdef USE_OPENAL
-       SoundScriptManager::getSingleton().soundEnable(false);
+       SoundScriptManager::getSingleton().setEnabled(false);
 #endif // OPENAL
 #ifdef USE_OIS_G27
        //logitech G27 LEDs tachometer
@@ -3403,7 +3399,7 @@
 #ifdef USE_MYGUI
        if(bigMap)
                bigMap->setVisibility(false);
-#endif // MYGUI
+#endif //USE_MYGUI
 }
 
 
@@ -3428,7 +3424,7 @@
                //bigMap->setPosition(0, 0, 1, 1);
                //bigMap->resizeToScreenRatio(win);
        }
-#endif // MYGUI
+#endif //USE_MYGUI
 
        collisions=new Collisions(this, mSceneMgr, debugCollisions);
 
@@ -3973,7 +3969,6 @@
                                                for(int 
b=1;b<terrain->getLayerCount();b++)
                                                {
                                                        Ogre::Image img;
-                                                       ResourceGroupManager& 
rgm = ResourceGroupManager::getSingleton();
                                                        String group="";
                                                        try
                                                        {
@@ -4343,7 +4338,7 @@
                bigMap->setVisibility(false);
                bigMap->setMapTexture(mtc->getRTName());
        }
-#endif // MYGUI
+#endif //USE_MYGUI
 
        // fix the person starting position
        if(persostart.isZeroLength() && !spl.pos.isZeroLength())
@@ -4357,7 +4352,6 @@
 
        Vector3 r2lastpos=Vector3::ZERO;
        Quaternion r2lastrot=Quaternion::IDENTITY;
-       int r2counter=0;
 
        //prepare for baking
        SceneNode 
*bakeNode=mSceneMgr->getRootSceneNode()->createChildSceneNode();
@@ -4365,11 +4359,8 @@
        //while (!feof(fd))
        bool proroad=false;
 #ifdef USE_PAGED
-       int treemode=0;
        treeLoader = 0;
        Entity *curTree = 0;
-       int treecounter=0;
-       float treescale_min=1,treescale_max=1;
        String treename="";
 #endif
 
@@ -4404,14 +4395,14 @@
                if (!strncmp(line,"collision-tris", 14))
                {
                        long amount = Collisions::MAX_COLLISION_TRIS;
-                       int res = sscanf(line, "collision-tris %ld", &amount);
+                       sscanf(line, "collision-tris %ld", &amount);
                        collisions->resizeMemory(amount);
                }
 
                if (!strncmp(line,"grid", 4))
                {
                        float px=0,py=0,pz=0;
-                       int res = sscanf(line, "grid %f, %f, %f", &px, &py, 
&pz);
+                       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);
@@ -4928,7 +4919,7 @@
        // tell this the map, so it can change the drawing distance !
        if(mtc)
                mtc->setStaticGeometry(bakesg);
-#endif // MYGUI
+#endif //USE_MYGUI
 
        collisions->printStats();
        loading_state=TERRAIN_LOADED;
@@ -5083,7 +5074,7 @@
                                        
e->setRotation(-Radian(b->getHeadingDirectionAngle()));
                                }
                        }
-#endif // MYGUI
+#endif //USE_MYGUI
                }
 
        }
@@ -5239,7 +5230,7 @@
                        //bigMap->setVisibility(true);
                        bigMap->setPosition(0, 0.81, 0.14, 0.19, mWindow);
                }
-#endif // MYGUI
+#endif //USE_MYGUI
 
                currentTruck->activate();
                //if (trucks[current_truck]->engine->running) 
trucks[current_truck]->audio->playStart();
@@ -5534,7 +5525,7 @@
        hideMap();
 #ifdef USE_MYGUI
        SelectorWindow::getSingleton().show(SelectorWindow::LoaderType(type));
-#endif // MYGUI
+#endif //USE_MYGUI
 }
 
 void RoRFrameListener::setDirectionArrow(char *text, Vector3 position)
@@ -5551,7 +5542,6 @@
        {
                ow->directionOverlay->show();
                ow->directionArrowText->setCaption(String(text));
-               float w = ow->directionArrowText->getWidth();
                //LOG("*** new pointed position: " + TOSTRING(position));
                ow->directionArrowDistance->setCaption("");
                dirvisible = true;
@@ -5573,7 +5563,7 @@
                if(e)
                        e->setVisibility(false);
        }
-#endif // MYGUI
+#endif //USE_MYGUI
 }
 
 
@@ -5752,7 +5742,6 @@
 
        // 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.
@@ -5846,13 +5835,6 @@
                return;
        }
 
-       // store camera settings
-       //Radian camRotX_saved = camRotX;
-       //Radian camRotY_saved = camRotY;
-
-       // store current trucks node positions
-       Vector3 *nodeStorage = (Vector3 *)malloc(sizeof(Vector3) * 
curr_truck->free_node + 10);
-
        // remove the old truck
        curr_truck->state=RECYCLE;
 

Modified: trunk/source/main/gameplay/Savegame.cpp
===================================================================
--- trunk/source/main/gameplay/Savegame.cpp     2012-05-06 07:10:44 UTC (rev 
2517)
+++ trunk/source/main/gameplay/Savegame.cpp     2012-05-06 07:12:57 UTC (rev 
2518)
@@ -226,7 +226,7 @@
                return 1;
        }
 
-       int current_truck = BeamFactory::getSingleton().getCurrentTruckNumber();
+       //int current_truck = 
BeamFactory::getSingleton().getCurrentTruckNumber();
        int free_truck    = BeamFactory::getSingleton().getTruckCount();
        Beam **trucks     = BeamFactory::getSingleton().getTrucks();
 

Modified: trunk/source/main/gameplay/TorqueCurve.cpp
===================================================================
--- trunk/source/main/gameplay/TorqueCurve.cpp  2012-05-06 07:10:44 UTC (rev 
2517)
+++ trunk/source/main/gameplay/TorqueCurve.cpp  2012-05-06 07:12:57 UTC (rev 
2518)
@@ -140,41 +140,48 @@
 
 int TorqueCurve::spaceCurveEvenly(Ogre::SimpleSpline *spline)
 {
-       if(!spline) return 0;
-       SimpleSpline tmpSpline=*spline;
-       Real points=tmpSpline.getNumPoints();
-       if (points>1)
+       if (!spline) return 2;
+
+       SimpleSpline tmpSpline = *spline;
+       Real points = tmpSpline.getNumPoints();
+
+       if (points > 1)
        {
-               //clear the original spline, so it's prepared for the new 
corrected numbers
+               // clear the original spline, so it's prepared for the new 
corrected numbers
                spline->clear();
-               Real minDistance=10000000.0f;
-               //looking for the mininimum distance (spacing) in the current 
spline
-               for(int i=0;i<points-1;i++)
+               Real minDistance = tmpSpline.getPoint(1).x - 
tmpSpline.getPoint(0).x;
+               // looking for the minimum distance (spacing) in the current 
spline
+               for (int i=2; i < points; i++)
                {
-                       // the rpms must be in an ascending order, as the 
points should be added at the end of the spline
-                       if (tmpSpline.getPoint(i+1).x<tmpSpline.getPoint(i).x) 
return 1;
-                       Real 
distance=tmpSpline.getPoint(i+1).x-tmpSpline.getPoint(i).x;
-                       if (distance<minDistance) minDistance=distance;
+                       Real distance = tmpSpline.getPoint(i).x - 
tmpSpline.getPoint(i - 1).x;
+                       minDistance = std::min(distance, minDistance);
                }
-               //first(smallest), and last rpm
-               Vector3 minPoint=tmpSpline.getPoint(0);
-               Vector3 maxPoint=tmpSpline.getPoint(points-1);
+               // the rpm points must be in an ascending order, as the points 
should be added at the end of the spline
+               if (minDistance < 0) return 1;
+               // first(smallest)- and last(greatest) rpm
+               Vector3 minPoint = tmpSpline.getPoint(0);
+               Vector3 maxPoint = tmpSpline.getPoint(points - 1);
 
-               Real rpmPoint=minPoint.x;
-               int PointNum=1; //this is the index used to interpolate between 
the rpm points
-               while (rpmPoint<=maxPoint.x && PointNum<points)
+               Real rpmPoint = minPoint.x;
+               int pointIndex = 1; // this is the index used to interpolate 
between the rpm points
+               while (rpmPoint <= maxPoint.x && pointIndex < points)
                {
-                       //if actual rpm is higher than point of the spline, 
proceed to the next point
-                       if(rpmPoint>tmpSpline.getPoint(PointNum).x) PointNum++;
-                       //interpolate(linear)
-                       Real 
newPoint=tmpSpline.getPoint(PointNum-1).y+(tmpSpline.getPoint(PointNum).y-tmpSpline.getPoint(PointNum-1).y)/
-                               
(tmpSpline.getPoint(PointNum).x-tmpSpline.getPoint(PointNum-1).x)*(rpmPoint-tmpSpline.getPoint(PointNum-1).x);
-                       spline->addPoint(Vector3(rpmPoint,newPoint,0));
-                       rpmPoint+=minDistance;
+                       // if actual rpm is higher than point of the spline, 
proceed to the next point
+                       if (rpmPoint > tmpSpline.getPoint(pointIndex).x)
+                               pointIndex++;
+                       // interpolate(linear)
+                       Real newPoint = tmpSpline.getPoint(pointIndex - 1).y + 
(tmpSpline.getPoint(pointIndex).y - tmpSpline.getPoint(pointIndex - 1).y) /
+                               (tmpSpline.getPoint(pointIndex).x - 
tmpSpline.getPoint(pointIndex - 1).x) * (rpmPoint-tmpSpline.getPoint(pointIndex 
- 1).x);
+                       spline->addPoint(Vector3(rpmPoint, newPoint, 0));
+                       rpmPoint += minDistance;
                }
-               //if the last point is missing due the even spacing, we add the 
last point manually
-               //criterium is that it must be smaller than 1% of the maximum 
rpm.
-               if(spline->getPoint(spline->getNumPoints()-1).x<maxPoint.x && 
(rpmPoint-maxPoint.x)<0.01*maxPoint.x) 
spline->addPoint(Vector3(rpmPoint,maxPoint.y,0));
+               // if the last point is missing due the even spacing, we add 
the last point manually
+               // criterion is that it must be smaller than 1% of the maximum 
rpm.
+               if (spline->getPoint(spline->getNumPoints() - 1).x < maxPoint.x 
&& (rpmPoint - maxPoint.x) < 0.01 * maxPoint.x)
+               {
+                       spline->addPoint(Vector3(rpmPoint, maxPoint.y, 0));
+               }
        }
+
        return 0;
 }

Modified: trunk/source/main/gameplay/TorqueCurve.h
===================================================================
--- trunk/source/main/gameplay/TorqueCurve.h    2012-05-06 07:10:44 UTC (rev 
2517)
+++ trunk/source/main/gameplay/TorqueCurve.h    2012-05-06 07:12:57 UTC (rev 
2518)
@@ -17,8 +17,8 @@
 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/>.
 */
-#ifndef __TorqueCurve_H__
-#define __TorqueCurve_H__
+#ifndef __TorqueCurve_H_
+#define __TorqueCurve_H_
 
 #include "RoRPrerequisites.h"
 #include "OgrePrerequisites.h"
@@ -106,5 +106,4 @@
        int processLine(Ogre::StringVector args, Ogre::String model);
 };
 
-
-#endif
+#endif // __TorqueCurve_H_

Modified: trunk/source/main/gameplay/autopilot.cpp
===================================================================
--- trunk/source/main/gameplay/autopilot.cpp    2012-05-06 07:10:44 UTC (rev 
2517)
+++ trunk/source/main/gameplay/autopilot.cpp    2012-05-06 07:12:57 UTC (rev 
2518)
@@ -271,7 +271,7 @@
 void Autopilot::gpws_update(float spawnheight)
 {
 #ifdef USE_OPENAL
-       if(!SoundScriptManager::getSingleton().working()) return;
+       if (SoundScriptManager::getSingleton().isDisabled()) return;
        if (mode_gpws && hf && ref_b)
        {
                float groundalt=hf->getHeightAt(ref_c->AbsPosition.x, 
ref_c->AbsPosition.z);

Modified: trunk/source/main/gui/MapControl.cpp
===================================================================
--- trunk/source/main/gui/MapControl.cpp        2012-05-06 07:10:44 UTC (rev 
2517)
+++ trunk/source/main/gui/MapControl.cpp        2012-05-06 07:12:57 UTC (rev 
2518)
@@ -101,7 +101,7 @@
                {
                        // found it, erase!
                        delete *it;
-                       it = mMapEntities.erase(it);
+                       mMapEntities.erase(it);
                        return;
                }
        }

Modified: trunk/source/main/physics/Beam.cpp
===================================================================
--- trunk/source/main/physics/Beam.cpp  2012-05-06 07:10:44 UTC (rev 2517)
+++ trunk/source/main/physics/Beam.cpp  2012-05-06 07:12:57 UTC (rev 2518)
@@ -1337,7 +1337,7 @@
 void Beam::setupDefaultSoundSources()
 {
 #ifdef USE_OPENAL
-       if(!SoundScriptManager::getSingleton().working()) return;
+       if (SoundScriptManager::getSingleton().isDisabled()) return;
        //engine
        if (engine)
        {
@@ -3888,7 +3888,7 @@
 {
        BES_GFX_START(BES_GFX_updateSoundSources);
 #ifdef USE_OPENAL
-       if(!SoundScriptManager::getSingleton().working()) return;
+       if (SoundScriptManager::getSingleton().isDisabled()) return;
        for (int i=0; i<free_soundsource; i++)
        {
                
soundsources[i].ssi->setPosition(nodes[soundsources[i].nodenum].AbsPosition, 
nodes[soundsources[i].nodenum].Velocity);
@@ -4742,7 +4742,7 @@
                                bool found = false;
                                if(it->lockNodes)
                                {
-                                       int last_node; // nodenumber storage
+                                       int last_node=0; // nodenumber storage
                                        // all nodes, so walk them
                                        for (int i=0; i<trucks[t]->free_node; 
i++)
                                        {
@@ -5514,8 +5514,8 @@
        mSteeringForce.normalise();
 
        float mYaw    = mSteeringForce.x;
-       float mPitch  = mSteeringForce.y;
-       float mRoll   = mTargetVO.getRotationTo( mAgentVO 
).getRoll().valueRadians();
+       //float mPitch  = mSteeringForce.y;
+       //float mRoll   = mTargetVO.getRotationTo( mAgentVO 
).getRoll().valueRadians();
 
        /*
        String txt = "AI:"+TOSTRING(mSteeringForce);
@@ -5604,7 +5604,7 @@
 
                // accelerator
                float acc = engine->getAcc();
-               dash->setFloat(DD_ACCELERATOR, brake);
+               dash->setFloat(DD_ACCELERATOR, acc);
 
                // RPM
                float rpm = engine->getRPM();
@@ -5683,7 +5683,7 @@
 
        // low pressure lamp
        bool low_pres = (canwork == 0);
-       dash->setBool(DD_LOW_PRESSURE, locked);
+       dash->setBool(DD_LOW_PRESSURE, low_pres);
 
        // lights
        bool lightsOn = (lights > 0);
@@ -5747,7 +5747,6 @@
                        Vector3 dir = nodes[cameranodepos[0]].RelPosition - 
nodes[cameranodedir[0]].RelPosition;
                        dir.normalise();
 
-                       char tmp[50]="";
                        int low_node = getLowestNode();
                        if(low_node != -1)
                        {
@@ -5804,7 +5803,7 @@
                        float altitude              = nodes[0].AbsPosition.y;
                        float sea_level_temperature = 273.15 + 15.0; //in 
Kelvin // MAGICs D:
                        float sea_level_pressure    = 101325; //in Pa
-                       float airtemperature        = sea_level_temperature - 
altitude * 0.0065f; //in Kelvin
+                       //float airtemperature        = sea_level_temperature - 
altitude * 0.0065f; //in Kelvin
                        float airpressure           = sea_level_pressure * 
pow(1.0f - 0.0065f * altitude / 288.15f, 5.24947f); //in Pa
                        float airdensity            = airpressure * 
0.0000120896f; //1.225 at sea level
 

Modified: trunk/source/main/physics/BeamFactory.cpp
===================================================================
--- trunk/source/main/physics/BeamFactory.cpp   2012-05-06 07:10:44 UTC (rev 
2517)
+++ trunk/source/main/physics/BeamFactory.cpp   2012-05-06 07:12:57 UTC (rev 
2518)
@@ -95,9 +95,9 @@
        std::map < int, std::map < unsigned int, Beam *> >::iterator it1;
        std::map < unsigned int, Beam *>::iterator it2;
 
-       for(it1=streamables.begin(); it1!=streamables.end();it1++)
+       for(it1=streamables.begin(); it1!=streamables.end(); it1++)
        {
-               for(it2=it1->second.begin(); it2!=it1->second.end();it2++)
+               for(it2=it1->second.begin(); it2!=it1->second.end(); it2++)
                {
                        if (it2->second == b)
                        {
@@ -296,7 +296,7 @@
 
        if (streamables.find(-1) != streamables.end())
        {
-               Beam *b = streamables[-1][0];
+               //Beam *b = streamables[-1][0];
                streamables[new_id][0] = streamables[-1][0]; // add alias :)
                //b->setUID(newid);
                //b->updateNetLabel();

Modified: trunk/source/main/physics/air/airbrake.cpp
===================================================================
--- trunk/source/main/physics/air/airbrake.cpp  2012-05-06 07:10:44 UTC (rev 
2517)
+++ trunk/source/main/physics/air/airbrake.cpp  2012-05-06 07:12:57 UTC (rev 
2518)
@@ -170,7 +170,7 @@
        float altitude=noderef->AbsPosition.y;
        float sea_level_temperature=273.15+15.0; //in Kelvin
        float sea_level_pressure=101325; //in Pa
-       float airtemperature=sea_level_temperature-altitude*0.0065; //in Kelvin
+       //float airtemperature=sea_level_temperature-altitude*0.0065; //in 
Kelvin
        float airpressure=sea_level_pressure*pow(1.0-0.0065*altitude/288.15, 
5.24947); //in Pa
        float airdensity=airpressure*0.0000120896;//1.225 at sea level
 

Modified: trunk/source/main/physics/air/turboprop.cpp
===================================================================
--- trunk/source/main/physics/air/turboprop.cpp 2012-05-06 07:10:44 UTC (rev 
2517)
+++ trunk/source/main/physics/air/turboprop.cpp 2012-05-06 07:12:57 UTC (rev 
2518)
@@ -211,7 +211,7 @@
                float altitude=nodes[noderef].AbsPosition.y;
                float sea_level_temperature=273.15+15.0; //in Kelvin
                float sea_level_pressure=101325; //in Pa
-               float airtemperature=sea_level_temperature-altitude*0.0065; 
//in Kelvin
+               //float airtemperature=sea_level_temperature-altitude*0.0065; 
//in Kelvin
                float 
airpressure=sea_level_pressure*pow(1.0-0.0065*altitude/288.15, 5.24947); //in Pa
                airdensity=airpressure*0.0000120896;//1.225 at sea level
 #ifdef USE_OPENAL
@@ -306,7 +306,6 @@
        float tottorque=0;
        for (int i=0; i<numblades; i++)
        {
-               float dragfactor=0.01;
                if (!failed && ignition)
                {
                        Vector3 totaltipforce=Vector3::ZERO;

Modified: trunk/source/main/physics/flex/FlexBody.cpp
===================================================================
--- trunk/source/main/physics/flex/FlexBody.cpp 2012-05-06 07:10:44 UTC (rev 
2517)
+++ trunk/source/main/physics/flex/FlexBody.cpp 2012-05-06 07:12:57 UTC (rev 
2518)
@@ -223,7 +223,6 @@
                msh->sharedVertexData->closeGapsInBindings();
        }
     Mesh::SubMeshIterator smIt = msh->getSubMeshIterator();
-       unsigned short idx = 0;
        while (smIt.hasMoreElements())
        {
                SubMesh* sm = smIt.getNext();
@@ -636,12 +635,6 @@
                npt+=subnodecounts[i];
        }
 
-       if (haveshadows)
-       {
-               EdgeData *      ed=msh->getEdgeList();
-               //ed->updateFaceNormals(0, pbuf); //wtf?
-       }
-
        snode->setPosition(center);
        return center;
 }

Modified: trunk/source/main/physics/input_output/SerializedRig.cpp
===================================================================
--- trunk/source/main/physics/input_output/SerializedRig.cpp    2012-05-06 
07:10:44 UTC (rev 2517)
+++ trunk/source/main/physics/input_output/SerializedRig.cpp    2012-05-06 
07:12:57 UTC (rev 2518)
@@ -4060,14 +4060,14 @@
                                int axis1, axis2,keys,keyl;
                                int p1[4], p2[4];
                                float rate;
-                               hascommands=1;
+                               hascommands = 1;
                                Real startDelay  = 0.0f;
                                Real stopDelay   = 0.0f;
                                Real force       = ROTATOR_FORCE_DEFAULT;
                                Real tolerance   = ROTATOR_TOLERANCE_DEFAULT;
-                               char startFunction[50]="";
-                               char stopFunction[50]="";
-                               char description[50]="";
+                               char startFunction[50] = {};
+                               char stopFunction[50]  = {};
+                               char description[50]   = {};
                                int n = parse_args(c, args, 13);
                                axis1 = parse_node_number(c, args[0]);
                                axis2 = parse_node_number(c, args[1]);
@@ -4120,7 +4120,7 @@
                                }
                                //add short key
                                
commandkey[keys].rotators.push_back(-(free_rotator+1));
-                               if (description  == "")
+                               if (String(description)  == "")
                                        commandkey[keys].description = 
"Rotate_Left/Right";
                                else
                                        commandkey[keys].description = 
description;
@@ -5133,13 +5133,16 @@
        };
        
        // we should post-process the torque curve if existing
-       if(engine)
+       if (engine)
        {
-               int 
result=engine->getTorqueCurve()->spaceCurveEvenly(engine->getTorqueCurve()->getUsedSpline());
-               if (result==1)
+               int result = 
engine->getTorqueCurve()->spaceCurveEvenly(engine->getTorqueCurve()->getUsedSpline());
+               if (result)
                {
-                       parser_warning(c, "TorqueCurve: Points (rpm) must be in 
an ascending order. Using default curve", PARSER_ERROR);
                        engine->getTorqueCurve()->setTorqueModel("default");
+                       if (result == 1)
+                       {
+                               parser_warning(c, "TorqueCurve: Points (rpm) 
must be in an ascending order. Using default curve", PARSER_ERROR);
+                       }
                }
        }
        

Modified: trunk/source/main/scripting/ScriptEngine.cpp
===================================================================
--- trunk/source/main/scripting/ScriptEngine.cpp        2012-05-06 07:10:44 UTC 
(rev 2517)
+++ trunk/source/main/scripting/ScriptEngine.cpp        2012-05-06 07:12:57 UTC 
(rev 2518)
@@ -143,8 +143,8 @@
 
 void ScriptEngine::exploreScripts()
 {
-       // this shouldnt be used atm
-       return;
+       // this shouldn't be used at the moment
+#if 0
 #if USE_ANGELSCRIPT
        FileInfoListPtr files= 
ResourceGroupManager::getSingleton().findResourceFileInfo("Scripts", "*.rs", 
false);
        for (FileInfoList::iterator iterFiles = files->begin(); iterFiles!= 
files->end(); ++iterFiles)
@@ -152,6 +152,7 @@
                loadScript(iterFiles->filename);
        }
 #endif //USE_ANGELSCRIPT
+#endif
 }
 
 void ScriptEngine::LineCallback(AngelScript::asIScriptContext *ctx, unsigned 
long *timeOut)

Modified: trunk/source/main/scripting/ScriptEngine.h
===================================================================
--- trunk/source/main/scripting/ScriptEngine.h  2012-05-06 07:10:44 UTC (rev 
2517)
+++ trunk/source/main/scripting/ScriptEngine.h  2012-05-06 07:12:57 UTC (rev 
2518)
@@ -144,6 +144,7 @@
                void messageLogged( const Ogre::String& message, 
Ogre::LogMessageLevel lml, bool maskDebug, const Ogre::String &logName, bool& 
skipThisMessage);
 #endif // OGRE_VERSION
 
+       // deprecated
        void exploreScripts();
 
 

Modified: trunk/source/main/scripting/as_ogre.cpp
===================================================================
--- trunk/source/main/scripting/as_ogre.cpp     2012-05-06 07:10:44 UTC (rev 
2517)
+++ trunk/source/main/scripting/as_ogre.cpp     2012-05-06 07:12:57 UTC (rev 
2518)
@@ -46,6 +46,7 @@
        new(self) Vector3(s,s,s);
 }
 
+// not used
 static int Vector3Cmp(const Vector3 &a, const Vector3 &b)
 {
        // If a is greater than b, then we return a positive number

Modified: trunk/source/main/utils/CollisionTools.cpp
===================================================================
--- trunk/source/main/utils/CollisionTools.cpp  2012-05-06 07:10:44 UTC (rev 
2517)
+++ trunk/source/main/utils/CollisionTools.cpp  2012-05-06 07:12:57 UTC (rev 
2518)
@@ -550,23 +550,22 @@
        Ogre::Vector3 center = rg->getCentre();
        Ogre::StaticGeometry::Region::LODIterator lit(rg->getLODIterator());
 
+#if 0
        // use the closest LOD of each block
+       Ogre::StaticGeometry::LODBucket *theBucket = 0;
        float sqdist = 1e24;
-       Ogre::StaticGeometry::LODBucket *theBucket = 0;
 
-#if 0
        // XXX: TODO: FIX LODS in ogre 1.7
        while (lit.hasMoreElements()) {
 
                Ogre::StaticGeometry::LODBucket *b = lit.getNext();
-               if (!theBucket || b->getSquaredDistance() < sqdist) {
+               if (!theBucket || b->getSquaredDistance() < sqdist)
+               {
                        sqdist = b->getSquaredDistance();
                        theBucket = b;
                }
        }
-#endif //0
 
-       // TODO: What if theBucket == 0?
        Ogre::StaticGeometry::LODBucket::MaterialIterator 
mit(theBucket->getMaterialIterator());
 
        while (mit.hasMoreElements())
@@ -612,6 +611,7 @@
                        next_offset += vertex_data->vertexCount;
                }
        }
+#endif //0
 
        overtex_count = vertices.size();
        overtices = 0;

Modified: trunk/source/main/utils/InputEngine.cpp
===================================================================
--- trunk/source/main/utils/InputEngine.cpp     2012-05-06 07:10:44 UTC (rev 
2517)
+++ trunk/source/main/utils/InputEngine.cpp     2012-05-06 07:12:57 UTC (rev 
2518)
@@ -2043,7 +2043,6 @@
        else
                // non-deadzone, remap the remaining part
                return (axisValue - dz) * (1.0f / (1.0f-dz));
-       return axisValue;
 }
 
 float InputEngine::axisLinearity(float axisValue, float linearity)
@@ -2106,7 +2105,7 @@
                {
                        if(b->suid == suid)
                        {
-                               b = a->second.erase(b);
+                               a->second.erase(b);
                                return true;
                        }
                }
@@ -2127,15 +2126,12 @@
 
 int InputEngine::getKeboardKeyForCommand(int eventID)
 {
-       float returnValue = 0;
        std::vector<event_trigger_t> t_vec = events[eventID];
        for(std::vector<event_trigger_t>::iterator i = t_vec.begin(); i != 
t_vec.end(); i++)
        {
                event_trigger_t t = *i;
-               float value = 0;
                if(t.eventtype == ET_Keyboard)
                        return t.keyCode;
-               return -1;
        }
        return -1;
 }
@@ -2765,7 +2761,6 @@
        default:
                return false;
        }
-       return false;
 }
 
 int InputEngine::getCurrentJoyButton(int &joystickNumber, int &button)

Modified: trunk/source/main/utils/Settings.cpp
===================================================================
--- trunk/source/main/utils/Settings.cpp        2012-05-06 07:10:44 UTC (rev 
2517)
+++ trunk/source/main/utils/Settings.cpp        2012-05-06 07:12:57 UTC (rev 
2518)
@@ -352,7 +352,7 @@
 {
        char program_path[1024] = {};
        char resources_path[1024] = {};
-       char streams_path[1024] = {};
+       //char streams_path[1024] = {};
        char user_path[1024] = {};
        char config_root[1024] = {};
 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32

Modified: trunk/source/main/utils/utils.cpp
===================================================================
--- trunk/source/main/utils/utils.cpp   2012-05-06 07:10:44 UTC (rev 2517)
+++ trunk/source/main/utils/utils.cpp   2012-05-06 07:12:57 UTC (rev 2518)
@@ -102,7 +102,7 @@
        {
                return UTFString("(UTF conversion error 2)");
        }
-       return UTFString("(UTF conversion error 3)");
+       //return UTFString("(UTF conversion error 3)");
 }
 
 Ogre::UTFString formatBytes(double bytes)

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