Revision: 2408 http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=2408&view=rev Author: ulteq Date: 2012-01-31 08:17:37 +0000 (Tue, 31 Jan 2012) Log Message: ----------- -Cleanup: Major code cleanup.
Modified Paths: -------------- trunk/source/main/framework/ContentManager.cpp trunk/source/main/framework/ContentManager.h trunk/source/main/gameplay/CacheSystem.cpp trunk/source/main/gameplay/CacheSystem.h trunk/source/main/gameplay/RoRFrameListener.cpp trunk/source/main/gameplay/autopilot.cpp trunk/source/main/gameplay/autopilot.h trunk/source/main/gfx/vidcam.cpp trunk/source/main/gfx/vidcam.h trunk/source/main/gui/Console.cpp trunk/source/main/gui/OverlayWrapper.cpp trunk/source/main/gui/gui_mp.cpp trunk/source/main/physics/Beam.cpp trunk/source/main/physics/Beam.h trunk/source/main/physics/BeamFactory.h trunk/source/main/physics/BeamForcesEuler.cpp trunk/source/main/physics/BeamSlideNode.cpp trunk/source/main/physics/CmdKeyInertia.h trunk/source/main/physics/Differentials.h trunk/source/main/physics/SlideNode.h trunk/source/main/physics/air/Airfoil.h trunk/source/main/physics/air/aeroengine.h trunk/source/main/physics/air/airbrake.cpp trunk/source/main/physics/air/airbrake.h trunk/source/main/physics/air/turbojet.cpp trunk/source/main/physics/air/turbojet.h trunk/source/main/physics/air/turboprop.cpp trunk/source/main/physics/air/turboprop.h trunk/source/main/physics/approxmath.h trunk/source/main/physics/collision/PointColDetector.h trunk/source/main/physics/collision/collisions.cpp trunk/source/main/physics/input_output/ForceFeedback.cpp trunk/source/main/physics/input_output/ForceFeedback.h trunk/source/main/physics/input_output/SerializedRig.cpp trunk/source/main/physics/mplatform/mplatform_base.cpp trunk/source/main/physics/mplatform/mplatform_base.h trunk/source/main/physics/mplatform/mplatform_fd.cpp trunk/source/main/physics/mplatform/mplatform_fd.h trunk/source/main/physics/utils/BeamStats.h trunk/source/main/physics/water/buoyance.cpp trunk/source/main/physics/water/buoyance.h trunk/source/main/physics/water/screwprop.cpp trunk/source/main/physics/water/screwprop.h trunk/source/main/scripting/GameScript.cpp Modified: trunk/source/main/framework/ContentManager.cpp =================================================================== --- trunk/source/main/framework/ContentManager.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/framework/ContentManager.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -20,9 +20,6 @@ #include "ContentManager.h" -#include <Ogre.h> -#include <OgreResourceBackgroundQueue.h> - #include "Settings.h" #include "ColoredTextAreaOverlayElementFactory.h" #include "SoundScriptManager.h" Modified: trunk/source/main/framework/ContentManager.h =================================================================== --- trunk/source/main/framework/ContentManager.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/framework/ContentManager.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -18,14 +18,13 @@ along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef CONTENTMANAGER_H__ -#define CONTENTMANAGER_H__ +#ifndef __CONTENTMANAGER_H_ +#define __CONTENTMANAGER_H_ #include "RoRPrerequisites.h" #include <OgreSingleton.h> #include <OgreResourceGroupManager.h> -//#include "RoR class ContentManager : public Ogre::Singleton<ContentManager>, public Ogre::ResourceLoadingListener { @@ -55,4 +54,4 @@ //std::map<Ogre::String,int> instanceCountMap; }; -#endif // CONTENTMANAGER_H__ +#endif // __CONTENTMANAGER_H_ Modified: trunk/source/main/gameplay/CacheSystem.cpp =================================================================== --- trunk/source/main/gameplay/CacheSystem.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/gameplay/CacheSystem.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -20,24 +20,24 @@ // created on 21th of May 2008 by Thomas #include "CacheSystem.h" -#include "sha1.h" + +#include "BeamData.h" // for authorinfo_t +#include "BeamEngine.h" +#include "errorutils.h" #include "ImprovedConfigFile.h" -#include "Settings.h" #include "language.h" -#include "errorutils.h" -#include "BeamEngine.h" +#include "ScopeLog.h" #include "SerializedRig.h" +#include "Settings.h" +#include "sha1.h" +#include "SoundScriptManager.h" #include "utils.h" -#include "SoundScriptManager.h" -#include "BeamData.h" // for authorinfo_t -#include "ScopeLog.h" - #ifdef USE_MYGUI #include "LoadingWindow.h" -#endif //MYGUI +#endif // USE_MYGUI -using namespace RoR; //CSHA1 +using namespace RoR; // CSHA1 // singleton pattern CacheSystem* CacheSystem::myInstance = 0; Modified: trunk/source/main/gameplay/CacheSystem.h =================================================================== --- trunk/source/main/gameplay/CacheSystem.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/gameplay/CacheSystem.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -19,19 +19,16 @@ */ // created on 21th of May 2008 by Thomas -#ifndef __CacheSystem_H__ -#define __CacheSystem_H__ +#ifndef __CacheSystem_H_ +#define __CacheSystem_H_ #include "RoRPrerequisites.h" -#include <Ogre.h> -#include <vector> -#include <map> +#include "BeamData.h" #include "sha1.h" -#include "BeamData.h" +#include <Ogre.h> - #define CACHE_FILE "mods.cache" #define CACHE_FILE_FORMAT "6" @@ -331,5 +328,4 @@ }; - -#endif +#endif // __CacheSystem_H_ Modified: trunk/source/main/gameplay/RoRFrameListener.cpp =================================================================== --- trunk/source/main/gameplay/RoRFrameListener.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/gameplay/RoRFrameListener.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -530,10 +530,10 @@ int ftp = curr_truck->free_aeroengine; //throttles - ow->thro1->setTop(ow->thrtop+ow->thrheight*(1.0-curr_truck->aeroengines[0]->getThrotle())-1.0); - if (ftp>1) ow->thro2->setTop(ow->thrtop+ow->thrheight*(1.0-curr_truck->aeroengines[1]->getThrotle())-1.0); - if (ftp>2) ow->thro3->setTop(ow->thrtop+ow->thrheight*(1.0-curr_truck->aeroengines[2]->getThrotle())-1.0); - if (ftp>3) ow->thro4->setTop(ow->thrtop+ow->thrheight*(1.0-curr_truck->aeroengines[3]->getThrotle())-1.0); + ow->thro1->setTop(ow->thrtop+ow->thrheight*(1.0-curr_truck->aeroengines[0]->getThrottle())-1.0); + if (ftp>1) ow->thro2->setTop(ow->thrtop+ow->thrheight*(1.0-curr_truck->aeroengines[1]->getThrottle())-1.0); + if (ftp>2) ow->thro3->setTop(ow->thrtop+ow->thrheight*(1.0-curr_truck->aeroengines[2]->getThrottle())-1.0); + if (ftp>3) ow->thro4->setTop(ow->thrtop+ow->thrheight*(1.0-curr_truck->aeroengines[3]->getThrottle())-1.0); //fire if (curr_truck->aeroengines[0]->isFailed()) ow->engfireo1->setMaterialName("tracks/engfire-on"); else ow->engfireo1->setMaterialName("tracks/engfire-off"); @@ -723,9 +723,9 @@ //BOAT GUI int fsp = curr_truck->free_screwprop; //throtles - ow->bthro1->setTop(ow->thrtop+ow->thrheight*(0.5-curr_truck->screwprops[0]->getThrotle()/2.0)-1.0); + ow->bthro1->setTop(ow->thrtop+ow->thrheight*(0.5-curr_truck->screwprops[0]->getThrottle()/2.0)-1.0); if (fsp>1) - ow->bthro2->setTop(ow->thrtop+ow->thrheight*(0.5-curr_truck->screwprops[1]->getThrotle()/2.0)-1.0); + ow->bthro2->setTop(ow->thrtop+ow->thrheight*(0.5-curr_truck->screwprops[1]->getThrottle()/2.0)-1.0); //position Vector3 dir=curr_truck->nodes[curr_truck->cameranodepos[0]].RelPosition-curr_truck->nodes[curr_truck->cameranodedir[0]].RelPosition; @@ -2872,27 +2872,27 @@ float tmp_throttle = INPUTENGINE.getEventBoolValue(EV_AIRPLANE_THROTTLE); if(tmp_throttle > 0) for (int i=0; i<curr_truck->free_aeroengine; i++) - curr_truck->aeroengines[i]->setThrotle(tmp_throttle); + curr_truck->aeroengines[i]->setThrottle(tmp_throttle); if(INPUTENGINE.isEventDefined(EV_AIRPLANE_THROTTLE_AXIS)) { float f = INPUTENGINE.getEventValue(EV_AIRPLANE_THROTTLE_AXIS); for (int i=0; i<curr_truck->free_aeroengine; i++) - curr_truck->aeroengines[i]->setThrotle(f); + curr_truck->aeroengines[i]->setThrottle(f); } if (INPUTENGINE.getEventBoolValueBounce(EV_AIRPLANE_THROTTLE_DOWN, 0.1f)) { //throtle down int i; for (i=0; i<curr_truck->free_aeroengine; i++) - curr_truck->aeroengines[i]->setThrotle(curr_truck->aeroengines[i]->getThrotle()-0.05); + curr_truck->aeroengines[i]->setThrottle(curr_truck->aeroengines[i]->getThrottle()-0.05); } if (INPUTENGINE.getEventBoolValueBounce(EV_AIRPLANE_THROTTLE_UP, 0.1f)) { //throtle up int i; for (i=0; i<curr_truck->free_aeroengine; i++) - curr_truck->aeroengines[i]->setThrotle(curr_truck->aeroengines[i]->getThrotle()+0.05); + curr_truck->aeroengines[i]->setThrottle(curr_truck->aeroengines[i]->getThrottle()+0.05); } if (INPUTENGINE.getEventBoolValueBounce(EV_AIRPLANE_THROTTLE_NO, 0.1f)) @@ -2900,19 +2900,19 @@ // no throtle int i; for (i=0; i<curr_truck->free_aeroengine; i++) - curr_truck->aeroengines[i]->setThrotle(0); + curr_truck->aeroengines[i]->setThrottle(0); } if (INPUTENGINE.getEventBoolValueBounce(EV_AIRPLANE_THROTTLE_FULL, 0.1f)) { // full throtle int i; for (i=0; i<curr_truck->free_aeroengine; i++) - curr_truck->aeroengines[i]->setThrotle(1); + curr_truck->aeroengines[i]->setThrottle(1); } if (curr_truck->autopilot) { for (i=0; i<curr_truck->free_aeroengine; i++) - curr_truck->aeroengines[i]->setThrotle(curr_truck->autopilot->getThrotle(curr_truck->aeroengines[i]->getThrotle(), dt)); + curr_truck->aeroengines[i]->setThrottle(curr_truck->autopilot->getThrottle(curr_truck->aeroengines[i]->getThrottle(), dt)); } @@ -2929,21 +2929,21 @@ // use negative values also! f = f * 2 - 1; for (int i=0; i<curr_truck->free_screwprop; i++) - curr_truck->screwprops[i]->setThrotle(-f); + curr_truck->screwprops[i]->setThrottle(-f); } if (INPUTENGINE.getEventBoolValueBounce(EV_BOAT_THROTTLE_DOWN, 0.1f)) { //throtle down int i; for (i=0; i<curr_truck->free_screwprop; i++) - curr_truck->screwprops[i]->setThrotle(curr_truck->screwprops[i]->getThrotle()-0.05); + curr_truck->screwprops[i]->setThrottle(curr_truck->screwprops[i]->getThrottle()-0.05); } if (INPUTENGINE.getEventBoolValueBounce(EV_BOAT_THROTTLE_UP, 0.1f)) { //throtle up int i; for (i=0; i<curr_truck->free_screwprop; i++) - curr_truck->screwprops[i]->setThrotle(curr_truck->screwprops[i]->getThrotle()+0.05); + curr_truck->screwprops[i]->setThrottle(curr_truck->screwprops[i]->getThrottle()+0.05); } Modified: trunk/source/main/gameplay/autopilot.cpp =================================================================== --- trunk/source/main/gameplay/autopilot.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/gameplay/autopilot.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -187,7 +187,7 @@ return 0; } -float Autopilot::getThrotle(float thrtl, float dt) +float Autopilot::getThrottle(float thrtl, float dt) { if(!mode_ias) {return thrtl;}; Modified: trunk/source/main/gameplay/autopilot.h =================================================================== --- trunk/source/main/gameplay/autopilot.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/gameplay/autopilot.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -76,7 +76,7 @@ float getAilerons(); float getElevator(); float getRudder(); - float getThrotle(float thrtl, float dt); + float getThrottle(float thrtl, float dt); void gpws_update(float spawnheight); Modified: trunk/source/main/gfx/vidcam.cpp =================================================================== --- trunk/source/main/gfx/vidcam.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/gfx/vidcam.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -18,13 +18,13 @@ along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>. */ #include "vidcam.h" + +#include "MaterialReplacer.h" #include "ResourceBuffer.h" -#include <Ogre.h> - -#include "utils.h" #include "Settings.h" #include "SkyManager.h" -#include "MaterialReplacer.h" +#include "utils.h" +#include <Ogre.h> using namespace Ogre; Modified: trunk/source/main/gfx/vidcam.h =================================================================== --- trunk/source/main/gfx/vidcam.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/gfx/vidcam.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -17,16 +17,14 @@ 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 VIDCAM_H__ -#define VIDCAM_H__ +#ifndef __VIDCAM_H_ +#define __VIDCAM_H_ #include "RoRPrerequisites.h" +#include "SerializedRig.h" #include <OgreMaterial.h> -#include "Beam.h" -#include "SerializedRig.h" - class VideoCamera { public: @@ -64,6 +62,4 @@ Ogre::RenderWindow *rwMirror; }; - - -#endif // VIDCAM_H__ +#endif // __VIDCAM_H_ Modified: trunk/source/main/gui/Console.cpp =================================================================== --- trunk/source/main/gui/Console.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/gui/Console.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -46,6 +46,8 @@ #include <iconv.h> #endif // LINUX +using namespace std; + // the delimiters that decide where a word is finished const Ogre::UTFString Console::wordDelimiters = " \\\"\'|.,`!;<>~{}()+&%$@"; const char *builtInCommands[] = {"/help", "/log", "/pos", "/goto", "/terrainheight", "/ver", "/save", "/whisper", "/as", NULL}; Modified: trunk/source/main/gui/OverlayWrapper.cpp =================================================================== --- trunk/source/main/gui/OverlayWrapper.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/gui/OverlayWrapper.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -668,10 +668,10 @@ res = true; char name[256]; strcpy(name,element->getName().c_str()); - if (!strncmp(name, "tracks/thrust1", 14)) curr_truck->aeroengines[0]->setThrotle(1.0f-((mouseY-thrtop-throffset)/thrheight)); - if (!strncmp(name, "tracks/thrust2", 14) && curr_truck->free_aeroengine>1) curr_truck->aeroengines[1]->setThrotle(1.0f-((mouseY-thrtop-throffset)/thrheight)); - if (!strncmp(name, "tracks/thrust3", 14) && curr_truck->free_aeroengine>2) curr_truck->aeroengines[2]->setThrotle(1.0f-((mouseY-thrtop-throffset)/thrheight)); - if (!strncmp(name, "tracks/thrust4", 14) && curr_truck->free_aeroengine>3) curr_truck->aeroengines[3]->setThrotle(1.0f-((mouseY-thrtop-throffset)/thrheight)); + if (!strncmp(name, "tracks/thrust1", 14)) curr_truck->aeroengines[0]->setThrottle(1.0f-((mouseY-thrtop-throffset)/thrheight)); + if (!strncmp(name, "tracks/thrust2", 14) && curr_truck->free_aeroengine>1) curr_truck->aeroengines[1]->setThrottle(1.0f-((mouseY-thrtop-throffset)/thrheight)); + if (!strncmp(name, "tracks/thrust3", 14) && curr_truck->free_aeroengine>2) curr_truck->aeroengines[2]->setThrottle(1.0f-((mouseY-thrtop-throffset)/thrheight)); + if (!strncmp(name, "tracks/thrust4", 14) && curr_truck->free_aeroengine>3) curr_truck->aeroengines[3]->setThrottle(1.0f-((mouseY-thrtop-throffset)/thrheight)); } //also for main dashboard OverlayElement *element2=airdashboardOverlay->findElementAt(mouseX,mouseY); Modified: trunk/source/main/gui/gui_mp.cpp =================================================================== --- trunk/source/main/gui/gui_mp.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/gui/gui_mp.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -192,7 +192,7 @@ x -= 18; // flag - Ogre::StringVector parts = StringUtil::split(string(c->language), "_"); + Ogre::StringVector parts = StringUtil::split(Ogre::String(c->language), "_"); if(parts.size() == 2) { String lang = parts[1]; @@ -395,7 +395,7 @@ { if(t.type == MyGUI::ToolTipInfo::Show) { - string txt = sender->getUserString("tooltip"); + Ogre::String txt = sender->getUserString("tooltip"); if(!txt.empty()) { tooltipText->setCaption(txt); Modified: trunk/source/main/physics/Beam.cpp =================================================================== --- trunk/source/main/physics/Beam.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/Beam.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -18,55 +18,39 @@ along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>. */ - -#include <float.h> +#include "airbrake.h" +#include "approxmath.h" +#include "autopilot.h" #include "Beam.h" #include "BeamData.h" #include "BeamEngine.h" -#include "SoundScriptManager.h" -#include "heightfinder.h" +#include "BeamFactory.h" +#include "BeamStats.h" +#include "BeamWaitAndLock.h" +#include "buoyance.h" +#include "CmdKeyInertia.h" +#include "DashBoardManager.h" +#include "Differentials.h" #include "DustManager.h" -#include "water.h" -#include "DustPool.h" #include "errorutils.h" -#include "Replay.h" -#include "vidcam.h" -#include "autopilot.h" -#include "ScopeLog.h" -#include "network.h" -#include "NetworkStreamManager.h" -#include "skinmanager.h" +#include "FlexAirfoil.h" +#include "FlexBody.h" #include "FlexMesh.h" #include "FlexMeshWheel.h" #include "FlexObj.h" -#include "FlexAirfoil.h" +#include "heightfinder.h" #include "language.h" -#include "MovableText.h" -#include "turboprop.h" -#include "turbojet.h" -#include "screwprop.h" -#include "buoyance.h" -#include "collisions.h" -#include "airbrake.h" -#include "FlexBody.h" -#include "materialFunctionMapper.h" -#include "TorqueCurve.h" -#include "Settings.h" -#include "PositionStorage.h" +#include "MeshObject.h" #include "network.h" -#include "OverlayWrapper.h" #include "PointColDetector.h" -#include "BeamStats.h" -#include "Skidmark.h" -#include "CmdKeyInertia.h" -#include "BeamFactory.h" -#include "ColoredTextAreaOverlayElement.h" +#include "PositionStorage.h" +#include "Replay.h" +#include "screwprop.h" #include "Scripting.h" -#include "PreviewRenderer.h" -#include "DashBoardManager.h" -#include "rornet.h" -#include "MeshObject.h" -#include "BeamWaitAndLock.h" +#include "Skidmark.h" +#include "SlideNode.h" +#include "turboprop.h" +#include "water.h" // some gcc fixes #if OGRE_PLATFORM == OGRE_PLATFORM_LINUX @@ -2369,7 +2353,7 @@ int spi; float ctmp = 0.0f; for (spi=0; spi<free_screwprop; spi++) - if(screwprops[spi]) ctmp += screwprops[spi]->getThrotle(); + if(screwprops[spi]) ctmp += screwprops[spi]->getThrottle(); if (spi > 0) ctmp = ctmp / spi; cstate = ctmp; @@ -2578,7 +2562,7 @@ } if (flag_state & ANIM_FLAG_THROTTLE) { - float throttle=aeroengines[aenum]->getThrotle(); + float throttle=aeroengines[aenum]->getThrottle(); cstate -= throttle; div++; } @@ -5699,7 +5683,7 @@ // the throttle and rudder for(int i = 0; i < free_screwprop && i < DD_MAX_SCREWPROP; i++) { - float throttle = screwprops[i]->getThrotle(); + float throttle = screwprops[i]->getThrottle(); dash->setFloat(DD_SCREW_THROTTLE_0 + i, throttle); float steering = screwprops[i]->getRudder(); @@ -5736,7 +5720,7 @@ { for(int i = 0; i < free_aeroengine && i < DD_MAX_AEROENGINE; i++) { - float throttle = aeroengines[i]->getThrotle(); + float throttle = aeroengines[i]->getThrottle(); dash->setFloat(DD_AEROENGINE_THROTTLE_0 + i, throttle); bool failed = aeroengines[i]->isFailed(); Modified: trunk/source/main/physics/Beam.h =================================================================== --- trunk/source/main/physics/Beam.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/Beam.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -17,28 +17,17 @@ 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 BEAM_H__ -#define BEAM_H__ +#ifndef __BEAM_H_ +#define __BEAM_H_ #include "RoRPrerequisites.h" #include "OgrePrerequisites.h" -// includes to be removed or cleaned up -#include "rornet.h" -#include "Differentials.h" -#include "SlideNode.h" -#include "PointColDetector.h" - -// ror includes -#include "Streamable.h" -#include "SerializedRig.h" #include "BeamData.h" - -#include "approxmath.h" #include "CacheSystem.h" +#include "SerializedRig.h" +#include "Streamable.h" -// system includes -#include <vector> #include <pthread.h> class Beam : @@ -48,8 +37,6 @@ friend class PreviewRenderer; public: Beam() {}; // for wrapper, DO NOT USE! - - // destructor ~Beam(); #ifdef USE_ANGELSCRIPT @@ -637,4 +624,5 @@ { return (num <= max && num >= min); } -#endif //BEAM_H__ + +#endif // __BEAM_H_ Modified: trunk/source/main/physics/BeamFactory.h =================================================================== --- trunk/source/main/physics/BeamFactory.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/BeamFactory.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -20,15 +20,13 @@ // created by Thomas Fischer thomas{AT}thomasfischer{DOT}biz, 24th of August 2009 -#ifndef BEAMFACTORY_H__ -#define BEAMFACTORY_H__ +#ifndef __BEAMFACTORY_H_ +#define __BEAMFACTORY_H_ #include "RoRPrerequisites.h" -#include "StreamableFactory.h" -#include <map> - #include "Beam.h" #include "TwoDReplay.h" +#include "StreamableFactory.h" class BeamFactory : public StreamableFactory < BeamFactory, Beam > { @@ -126,5 +124,4 @@ }; - -#endif // BEAMFACTORY_H__ \ No newline at end of file +#endif // __BEAMFACTORY_H_ Modified: trunk/source/main/physics/BeamForcesEuler.cpp =================================================================== --- trunk/source/main/physics/BeamForcesEuler.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/BeamForcesEuler.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -17,18 +17,22 @@ 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/>. */ + +#include "airbrake.h" +#include "approxmath.h" #include "Beam.h" - #include "BeamEngine.h" +#include "BeamFactory.h" +#include "BeamStats.h" +#include "buoyance.h" +#include "CmdKeyInertia.h" +#include "collisions.h" +#include "Differentials.h" +#include "FlexAirfoil.h" #include "Replay.h" -#include "FlexAirfoil.h" #include "screwprop.h" -#include "buoyance.h" -#include "collisions.h" -#include "airbrake.h" -#include "BeamStats.h" -#include "CmdKeyInertia.h" -#include "BeamFactory.h" +#include "SoundScriptManager.h" +#include "water.h" extern float mrtime; @@ -318,7 +322,7 @@ for (mk=0; mk<free_buoycab; mk++) { int tmpv=buoycabs[mk]*3; - if (buoycabtypes[mk]==BUOY_DRAGONLY) continue; + if (buoycabtypes[mk]==Buoyance::BUOY_DRAGONLY) continue; if ((beams[i].p1==&nodes[cabs[tmpv]] || beams[i].p1==&nodes[cabs[tmpv+1]] || beams[i].p1==&nodes[cabs[tmpv+2]]) &&(beams[i].p2==&nodes[cabs[tmpv]] || beams[i].p2==&nodes[cabs[tmpv+1]] || beams[i].p2==&nodes[cabs[tmpv+2]])) buoyance->setsink(1); Modified: trunk/source/main/physics/BeamSlideNode.cpp =================================================================== --- trunk/source/main/physics/BeamSlideNode.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/BeamSlideNode.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -40,9 +40,11 @@ along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>. */ +#include "RoRPrerequisites.h" +#include "Ogre.h" #include "Beam.h" -#include "Ogre.h" #include "BeamFactory.h" +#include "SlideNode.h" #include <vector> // ug... BAD PERFORMNCE, BAD!! Modified: trunk/source/main/physics/CmdKeyInertia.h =================================================================== --- trunk/source/main/physics/CmdKeyInertia.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/CmdKeyInertia.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -17,18 +17,14 @@ 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 __CmdKeyInertia_H_ +#define __CmdKeyInertia_H_ -#ifndef __CmdKeyInertia_H__ -#define __CmdKeyInertia_H__ - #include "RoRPrerequisites.h" #include "OgrePrerequisites.h" -#include <OgreStringVector.h> - class CmdKeyInertia { - public: CmdKeyInertia(int maxCmdKeys); ~CmdKeyInertia(); @@ -57,4 +53,5 @@ int loadDefaultInertiaModels(); }; -#endif + +#endif __CmdKeyInertia_H_ Modified: trunk/source/main/physics/Differentials.h =================================================================== --- trunk/source/main/physics/Differentials.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/Differentials.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -17,12 +17,11 @@ 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 __DIFFERENTIALS_H__ -#define __DIFFERENTIALS_H__ +#ifndef __DIFFERENTIALS_H_ +#define __DIFFERENTIALS_H_ #include "RoRPrerequisites.h" #include "OgrePrerequisites.h" -#include <vector> #define MAX_DIFFS 3 struct differential_data_t @@ -96,5 +95,4 @@ static diff_callback getDiffEquation(DiffType type); }; - -#endif // __DIFFERENTIALS_H__ +#endif // __DIFFERENTIALS_H_ Modified: trunk/source/main/physics/SlideNode.h =================================================================== --- trunk/source/main/physics/SlideNode.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/SlideNode.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -40,15 +40,11 @@ along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef SLIDENODE_H_ -#define SLIDENODE_H_ +#ifndef __SLIDENODE_H_ +#define __SLIDENODE_H_ #include "RoRPrerequisites.h" - -#include <limits> - #include "BeamData.h" -#include "OgreVector3.h" /** * Find the point on a line defined by pt1 and pt2 that @@ -551,5 +547,4 @@ }; - -#endif +#endif // __SLIDENODE_H_ Modified: trunk/source/main/physics/air/Airfoil.h =================================================================== --- trunk/source/main/physics/air/Airfoil.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/air/Airfoil.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -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 AIRFOIL_H__ -#define AIRFOIL_H__ +#ifndef __AIRFOIL_H_ +#define __AIRFOIL_H_ #include "RoRPrerequisites.h" @@ -36,4 +36,4 @@ }; -#endif // endif AIRFOIL_H__ +#endif // __AIRFOIL_H_ Modified: trunk/source/main/physics/air/aeroengine.h =================================================================== --- trunk/source/main/physics/air/aeroengine.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/air/aeroengine.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -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 AEROENGINE_H__ -#define AEROENGINE_H__ +#ifndef __AEROENGINE_H_ +#define __AEROENGINE_H_ #include "RoRPrerequisites.h" @@ -32,9 +32,9 @@ virtual void updateVisuals()=0; virtual void updateForces(float dt, int doUpdate)=0; - virtual void setThrotle(float val)=0; + virtual void setThrottle(float val)=0; - virtual float getThrotle()=0; + virtual float getThrottle()=0; virtual void reset()=0; @@ -55,4 +55,4 @@ virtual float getRadius()=0; }; -#endif //AEROENGINE_H__ +#endif // __AEROENGINE_H_ Modified: trunk/source/main/physics/air/airbrake.cpp =================================================================== --- trunk/source/main/physics/air/airbrake.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/air/airbrake.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -19,10 +19,11 @@ */ #include "airbrake.h" +#include "BeamData.h" #include "ResourceBuffer.h" -#include "BeamData.h" #include <Ogre.h> + using namespace Ogre; Airbrake::Airbrake(SceneManager *manager, char* basename, int num, node_t *ndref, node_t *ndx, node_t *ndy, node_t *nda, Vector3 pos, float width, float length, float maxang, char* texname, float tx1, float ty1, float tx2, float ty2, float lift_coef) Modified: trunk/source/main/physics/air/airbrake.h =================================================================== --- trunk/source/main/physics/air/airbrake.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/air/airbrake.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -17,10 +17,11 @@ 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 AIRBRAKE_H__ -#define AIRBRAKE_H__ +#ifndef __AIRBRAKE_H_ +#define __AIRBRAKE_H_ #include "RoRPrerequisites.h" + #include <OgreMesh.h> class Airbrake @@ -31,7 +32,6 @@ { Ogre::Vector3 vertex; Ogre::Vector3 normal; - // Vector3 color; Ogre::Vector2 texcoord; } CoVertice_t; @@ -53,4 +53,4 @@ void applyForce(); }; -#endif //AIRBRAKE_H__ +#endif // __AIRBRAKE_H_ Modified: trunk/source/main/physics/air/turbojet.cpp =================================================================== --- trunk/source/main/physics/air/turbojet.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/air/turbojet.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -17,8 +17,10 @@ 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/>. */ +#include "skin.h" +#include "SoundScriptManager.h" #include "turbojet.h" -#include "skin.h" +#include "materialFunctionMapper.h" #include "MaterialReplacer.h" Turbojet::Turbojet(SceneManager *manager, char* propname, int tnumber, int trucknum, node_t *nd, int tnodefront, int tnodeback, int tnoderef, float tmaxdrythrust, bool treversable, bool tafterburnable, float tafterburnthrust, float diskdiam, float nozdiam, float nozlength, bool disable_smoke, bool _heathaze, MaterialFunctionMapper *mfm, Skin *usedSkin, MaterialReplacer *mr) : mr(mr) @@ -239,7 +241,7 @@ exhaust_velocity=enginethrust*5.6/area; } -void Turbojet::setThrotle(float val) +void Turbojet::setThrottle(float val) { if (val>1.0) val=1.0; if (val<0.0) val=0.0; @@ -250,7 +252,7 @@ #endif //OPENAL } -float Turbojet::getThrotle() +float Turbojet::getThrottle() { return throtle; } Modified: trunk/source/main/physics/air/turbojet.h =================================================================== --- trunk/source/main/physics/air/turbojet.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/air/turbojet.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -17,20 +17,13 @@ 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 __Turbojet_H__ -#define __Turbojet_H__ +#ifndef __Turbojet_H_ +#define __Turbojet_H_ #include "RoRPrerequisites.h" -#include "Ogre.h" -#include "SoundScriptManager.h" -#include "materialFunctionMapper.h" -using namespace Ogre; -#include "Beam.h" -#include "Airfoil.h" #include "aeroengine.h" - class Turbojet: public AeroEngine { private: @@ -81,9 +74,9 @@ void updateVisuals(); void updateForces(float dt, int doUpdate); - void setThrotle(float val); + void setThrottle(float val); - float getThrotle(); + float getThrottle(); void reset(); @@ -105,4 +98,4 @@ float getAfterburner() {return (float)afterburner;}; }; -#endif +#endif __Turbojet_H_ Modified: trunk/source/main/physics/air/turboprop.cpp =================================================================== --- trunk/source/main/physics/air/turboprop.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/air/turboprop.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -17,10 +17,11 @@ 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/>. */ +#include "Airfoil.h" +#include "Scripting.h" +#include "SoundScriptManager.h" #include "turboprop.h" -#include "Scripting.h" - Turboprop::Turboprop(SceneManager *manager, char* propname, node_t *nd, int nr, int nb, int np1, int np2, int np3, int np4, int tqn, float power, char* propfoilname, int mnumber, int trucknum, bool disable_smoke, bool ispiston, float fpitch, bool _heathaze) { failed=false; @@ -387,7 +388,7 @@ if (propwash<0) propwash=0; } -void Turboprop::setThrotle(float val) +void Turboprop::setThrottle(float val) { if (val>1.0) val=1.0; if (val<0.0) val=0.0; @@ -398,7 +399,7 @@ #endif //OPENAL } -float Turboprop::getThrotle() +float Turboprop::getThrottle() { return throtle; } Modified: trunk/source/main/physics/air/turboprop.h =================================================================== --- trunk/source/main/physics/air/turboprop.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/air/turboprop.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -17,16 +17,11 @@ 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 __Turboprop_H__ -#define __Turboprop_H__ +#ifndef __Turboprop_H_ +#define __Turboprop_H_ #include "RoRPrerequisites.h" -#include "Ogre.h" -#include "SoundScriptManager.h" -using namespace Ogre; -#include "Beam.h" -#include "Airfoil.h" #include "aeroengine.h" class Turboprop: public AeroEngine @@ -89,9 +84,9 @@ void updateVisuals(); void updateForces(float dt, int doUpdate); - void setThrotle(float val); + void setThrottle(float val); - float getThrotle(); + float getThrottle(); void reset(); @@ -116,4 +111,4 @@ float getRadius() {return radius;}; }; -#endif +#endif // __Turboprop_H_ Modified: trunk/source/main/physics/approxmath.h =================================================================== --- trunk/source/main/physics/approxmath.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/approxmath.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -24,8 +24,8 @@ * Created on April 6, 2009, 2:57 AM */ -#ifndef __APPROXMATH_H__ -#define __APPROXMATH_H__ +#ifndef __APPROXMATH_H_ +#define __APPROXMATH_H_ #include "RoRPrerequisites.h" @@ -158,6 +158,4 @@ return fast_sqrt(v.squaredLength()); } - - -#endif /* _APPROXMATH_H */ +#endif // __APPROXMATH_H_ Modified: trunk/source/main/physics/collision/PointColDetector.h =================================================================== --- trunk/source/main/physics/collision/PointColDetector.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/collision/PointColDetector.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -18,18 +18,13 @@ along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef __PointColDetector_H__ -#define __PointColDetector_H__ +#ifndef __PointColDetector_H_ +#define __PointColDetector_H_ #include "RoRPrerequisites.h" - #include "Ogre.h" -#include <vector> -using namespace Ogre; -using namespace std; #include "Beam.h" - typedef struct _pointid { int nodeid; int truckid; @@ -83,4 +78,4 @@ void partintwo(const int start, const int median, const int end, const int axis, float &minex, float &maxex); }; -#endif +#endif __PointColDetector_H_ Modified: trunk/source/main/physics/collision/collisions.cpp =================================================================== --- trunk/source/main/physics/collision/collisions.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/collision/collisions.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -1438,7 +1438,7 @@ else { //Stribek model. It also comes directly from textbooks. - float g = gm->mc + (gm->ms - gm->mc) * min(1.0f, approx_exp(-approx_pow(slipv / gm->vs, gm->alpha))); + float g = gm->mc + (gm->ms - gm->mc) * std::min(1.0f, approx_exp(-approx_pow(slipv / gm->vs, gm->alpha))); ff = -(g + gm->t2 * slipv) * Greaction; force += Freaction * normal + ff*slip; } Modified: trunk/source/main/physics/input_output/ForceFeedback.cpp =================================================================== --- trunk/source/main/physics/input_output/ForceFeedback.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/input_output/ForceFeedback.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -19,6 +19,8 @@ */ #include "ForceFeedback.h" +using namespace Ogre; + ForceFeedback::ForceFeedback(OIS::ForceFeedback* ffdevice, Real overall_gain, Real stress_gain, Real centering_gain, Real camera_gain) { this->ffdevice=ffdevice; @@ -47,7 +49,6 @@ } - void ForceFeedback::setForces(Real roll, Real pitch, Real wspeed, Real dircommand, Real stress) { //LOG(String("ForceFeedback: R=")+TOSTRING(roll)+" D="+TOSTRING(dir)+" S="+TOSTRING(wspeed)+" H="+TOSTRING(stress)); @@ -94,4 +95,3 @@ { setEnabled(false); } - Modified: trunk/source/main/physics/input_output/ForceFeedback.h =================================================================== --- trunk/source/main/physics/input_output/ForceFeedback.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/input_output/ForceFeedback.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -17,28 +17,25 @@ 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 __ForceFeedback_H__ -#define __ForceFeedback_H__ +#ifndef __ForceFeedback_H_ +#define __ForceFeedback_H_ #include "RoRPrerequisites.h" -#include "Ogre.h" -#include <math.h> #include "OISForceFeedback.h" -using namespace Ogre; class ForceFeedback { private: OIS::ForceFeedback* ffdevice; OIS::Effect* hydroEffect; - Real overall_gain; - Real stress_gain; - Real centering_gain; - Real camera_gain; + Ogre::Real overall_gain; + Ogre::Real stress_gain; + Ogre::Real centering_gain; + Ogre::Real camera_gain; bool enabled_state; public: - ForceFeedback(OIS::ForceFeedback* ffdevice, Real overall_gain, Real stress_gain, Real centering_gain, Real camera_gain); + ForceFeedback(OIS::ForceFeedback* ffdevice, Ogre::Real overall_gain, Ogre::Real stress_gain, Ogre::Real centering_gain, Ogre::Real camera_gain); ~ForceFeedback(); /*we take here : @@ -46,10 +43,9 @@ -wheel speed and direction command, for the artificial auto-centering (which is wheel speed dependant) -hydro beam stress, the ideal data source for FF wheels */ - void setForces(Real roll, Real pitch, Real wspeed, Real dircommand, Real stress); + void setForces(Ogre::Real roll, Ogre::Real pitch, Ogre::Real wspeed, Ogre::Real dircommand, Ogre::Real stress); void setEnabled(bool b); }; - -#endif +#endif // __ForceFeedback_H_ Modified: trunk/source/main/physics/input_output/SerializedRig.cpp =================================================================== --- trunk/source/main/physics/input_output/SerializedRig.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/input_output/SerializedRig.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -20,31 +20,29 @@ #include "SerializedRig.h" -#include "BeamEngine.h" +#include "airbrake.h" #include "autopilot.h" -#include "ScopeLog.h" -#include "skinmanager.h" -#include "FlexObj.h" -#include "FlexAirfoil.h" -#include "turboprop.h" -#include "screwprop.h" +#include "BeamEngine.h" #include "buoyance.h" -#include "airbrake.h" -#include "TorqueCurve.h" -#include "Settings.h" #include "CmdKeyInertia.h" -#include "MeshObject.h" -#include "vidcam.h" -#include "utils.h" -#include "Settings.h" +#include "Differentials.h" +#include "FlexAirfoil.h" #include "FlexMesh.h" #include "FlexMeshWheel.h" -#include "MaterialReplacer.h" +#include "FlexObj.h" #include "JSON.h" +#include "MeshObject.h" #include "RoRVersion.h" +#include "ScopeLog.h" +#include "screwprop.h" +#include "SlideNode.h" +#include "SoundScriptManager.h" +#include "TorqueCurve.h" +#include "turboprop.h" +#include "utils.h" +#include "vidcam.h" - -// TODO not really needed for truck loading, or used very rarely +// TODO: Not really needed for truck loading, or used very rarely #include "collisions.h" #include "FlexBody.h" @@ -2764,9 +2762,9 @@ if (type=='c') {collcabs[free_collcab]=free_cab; collcabstype[free_collcab]=0; free_collcab++;}; if (type=='p') {collcabs[free_collcab]=free_cab; collcabstype[free_collcab]=1; free_collcab++;}; if (type=='u') {collcabs[free_collcab]=free_cab; collcabstype[free_collcab]=2; free_collcab++;}; - if (type=='b') {buoycabs[free_buoycab]=free_cab; collcabstype[free_collcab]=0; buoycabtypes[free_buoycab]=BUOY_NORMAL; free_buoycab++; if (!buoyance && !virtuallyLoaded) buoyance=new Buoyance(water);}; - if (type=='r') {buoycabs[free_buoycab]=free_cab; collcabstype[free_collcab]=0; buoycabtypes[free_buoycab]=BUOY_DRAGONLY; free_buoycab++; if (!buoyance && !virtuallyLoaded) buoyance=new Buoyance(water);}; - if (type=='s') {buoycabs[free_buoycab]=free_cab; collcabstype[free_collcab]=0; buoycabtypes[free_buoycab]=BUOY_DRAGLESS; free_buoycab++; if (!buoyance && !virtuallyLoaded) buoyance=new Buoyance(water);}; + if (type=='b') {buoycabs[free_buoycab]=free_cab; collcabstype[free_collcab]=0; buoycabtypes[free_buoycab]=Buoyance::BUOY_NORMAL; free_buoycab++; if (!buoyance && !virtuallyLoaded) buoyance=new Buoyance(water);}; + if (type=='r') {buoycabs[free_buoycab]=free_cab; collcabstype[free_collcab]=0; buoycabtypes[free_buoycab]=Buoyance::BUOY_DRAGONLY; free_buoycab++; if (!buoyance && !virtuallyLoaded) buoyance=new Buoyance(water);}; + if (type=='s') {buoycabs[free_buoycab]=free_cab; collcabstype[free_collcab]=0; buoycabtypes[free_buoycab]=Buoyance::BUOY_DRAGLESS; free_buoycab++; if (!buoyance && !virtuallyLoaded) buoyance=new Buoyance(water);}; if (type=='D' || type == 'F' || type == 'S') { @@ -2780,7 +2778,7 @@ if(type == 'F') collcabstype[free_collcab]=1; if(type == 'S') collcabstype[free_collcab]=2; free_collcab++; - buoycabs[free_buoycab]=free_cab; buoycabtypes[free_buoycab]=BUOY_NORMAL; free_buoycab++; if (!buoyance && !virtuallyLoaded) buoyance=new Buoyance(water); + buoycabs[free_buoycab]=free_cab; buoycabtypes[free_buoycab]=Buoyance::BUOY_NORMAL; free_buoycab++; if (!buoyance && !virtuallyLoaded) buoyance=new Buoyance(water); } free_cab++; } @@ -5279,7 +5277,7 @@ // now generate the hash of it { // copy whole truck into a string - string code; + String code; ds->seek(0); // from start code.resize(ds->size()); ds->read(&code[0], ds->size()); Modified: trunk/source/main/physics/mplatform/mplatform_base.cpp =================================================================== --- trunk/source/main/physics/mplatform/mplatform_base.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/mplatform/mplatform_base.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -45,4 +45,5 @@ { return false; } -#endif + +#endif // USE_MPLATFORM Modified: trunk/source/main/physics/mplatform/mplatform_base.h =================================================================== --- trunk/source/main/physics/mplatform/mplatform_base.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/mplatform/mplatform_base.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -29,10 +29,9 @@ #include "RoRPrerequisites.h" -#include "Ogre.h" -#include "rornet.h" +//#include "Ogre.h" +//#include "rornet.h" - typedef struct // struct is used for motion platforms { int time; Modified: trunk/source/main/physics/mplatform/mplatform_fd.cpp =================================================================== --- trunk/source/main/physics/mplatform/mplatform_fd.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/mplatform/mplatform_fd.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -79,4 +79,5 @@ // if (error) {return false;} return true; } -#endif + +#endif // USE_MPLATFORM Modified: trunk/source/main/physics/mplatform/mplatform_fd.h =================================================================== --- trunk/source/main/physics/mplatform/mplatform_fd.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/mplatform/mplatform_fd.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -18,13 +18,11 @@ along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>. */ #ifdef USE_MPLATFORM -#ifndef MPLATFORM_FD_H -#define MPLATFORM_FD_H +#ifndef __MPLATFORM_FD_H_ +#define __MPLATFORM_FD_H_ #include "RoRPrerequisites.h" -#include "Ogre.h" #include "mplatform_base.h" -#include "rornet.h" #include "SocketW.h" class MPlatform_FD : public MPlatform_Base @@ -44,5 +42,5 @@ }; -#endif -#endif +#endif // __MPLATFORM_FD_H_ +#endif // USE_MPLATFORM Modified: trunk/source/main/physics/utils/BeamStats.h =================================================================== --- trunk/source/main/physics/utils/BeamStats.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/utils/BeamStats.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -19,12 +19,11 @@ */ // thomas, 11th of March 2008 -#ifndef __BeamStats_H__ -#define __BeamStats_H__ +#ifndef __BeamStats_H_ +#define __BeamStats_H_ #include "RoRPrerequisites.h" #include <Ogre.h> -#include <map> // BES = Beam Engine Statistics @@ -164,6 +163,4 @@ #endif // FEAT_TIMING -#endif //__BeamStats_H__ - - +#endif //__BeamStats_H_ Modified: trunk/source/main/physics/water/buoyance.cpp =================================================================== --- trunk/source/main/physics/water/buoyance.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/water/buoyance.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -19,6 +19,10 @@ */ #include "buoyance.h" +#include "BeamData.h" +#include "DustManager.h" +#include "water.h" + Buoyance::Buoyance(Water *water) { w=water; Modified: trunk/source/main/physics/water/buoyance.h =================================================================== --- trunk/source/main/physics/water/buoyance.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/water/buoyance.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -17,30 +17,13 @@ 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 __Buoyance_H__ -#define __Buoyance_H__ +#ifndef __Buoyance_H_ +#define __Buoyance_H_ #include "RoRPrerequisites.h" -#include "Ogre.h" -#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 -#include <windows.h> -#endif -#include <math.h> -#include <stdio.h> -#include "water.h" -//#include "DustPool.h" -#include "Beam.h" - #include "DustPool.h" -#include "DustManager.h" -using namespace Ogre; - -#define BUOY_NORMAL 0 -#define BUOY_DRAGONLY 1 -#define BUOY_DRAGLESS 2 - class Buoyance { private: @@ -55,18 +38,19 @@ ~Buoyance(); //compute tetrahedron volume - inline float computeVolume(Vector3 o, Vector3 a, Vector3 b, Vector3 c); + inline float computeVolume(Ogre::Vector3 o, Ogre::Vector3 a, Ogre::Vector3 b, Ogre::Vector3 c); //compute pressure and drag force on a submerged triangle - Vector3 computePressureForceSub(Vector3 a, Vector3 b, Vector3 c, Vector3 vel, int type); + Vector3 computePressureForceSub(Ogre::Vector3 a, Ogre::Vector3 b, Ogre::Vector3 c, Ogre::Vector3 vel, int type); //compute pressure and drag forces on a random triangle - Vector3 computePressureForce(Vector3 a, Vector3 b, Vector3 c, Vector3 vel, int type); + Vector3 computePressureForce(Ogre::Vector3 a, Ogre::Vector3 b, Ogre::Vector3 c, Ogre::Vector3 vel, int type); void computeNodeForce(node_t *a, node_t *b, node_t *c, int doupdate, int type); void setsink(int v); + + enum { BUOY_NORMAL, BUOY_DRAGONLY, BUOY_DRAGLESS }; }; - -#endif +#endif // __Buoyance_H_ Modified: trunk/source/main/physics/water/screwprop.cpp =================================================================== --- trunk/source/main/physics/water/screwprop.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/water/screwprop.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -18,6 +18,9 @@ along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>. */ #include "screwprop.h" +#include "DustManager.h" +#include "SoundScriptManager.h" +#include "water.h" Screwprop::Screwprop(node_t *nd, int nr, int nb, int nu, float power, Water* w, int trucknum) { @@ -33,7 +36,6 @@ reset(); } - void Screwprop::updateForces(int update) { if (!water) return; @@ -53,7 +55,7 @@ } } -void Screwprop::setThrotle(float val) +void Screwprop::setThrottle(float val) { if (val>1.0) val=1.0; if (val<-1.0) val=-1.0; @@ -63,7 +65,7 @@ float prpm=(0.5+fabs(val)/2.0)*100.0; #ifdef USE_OPENAL SoundScriptManager::getSingleton().modulate(trucknum, SS_MOD_ENGINE, prpm); -#endif //OPENAL +#endif // USE_OPENAL } void Screwprop::setRudder(float val) @@ -73,7 +75,7 @@ rudder=val*45.0; } -float Screwprop::getThrotle() +float Screwprop::getThrottle() { if (reverse) return -throtle; else return throtle; } @@ -85,8 +87,7 @@ void Screwprop::reset() { - setThrotle(0); - //throtle=0; + setThrottle(0); rudder=0; reverse=false; } @@ -96,4 +97,3 @@ throtle=0; reverse=!reverse; } - Modified: trunk/source/main/physics/water/screwprop.h =================================================================== --- trunk/source/main/physics/water/screwprop.h 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/physics/water/screwprop.h 2012-01-31 08:17:37 UTC (rev 2408) @@ -17,19 +17,12 @@ 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 __Screwprop_H__ -#define __Screwprop_H__ +#ifndef __Screwprop_H_ +#define __Screwprop_H_ #include "RoRPrerequisites.h" -#include "Ogre.h" -#include "water.h" - -using namespace Ogre; -#include "Beam.h" -#include "SoundScriptManager.h" #include "DustPool.h" -#include "DustManager.h" class Screwprop { @@ -51,12 +44,12 @@ Screwprop(node_t *nd, int nr, int nb, int nu, float power, Water* w, int trucknum); void updateForces(int update); - void setThrotle(float val); + void setThrottle(float val); void setRudder(float val); - float getThrotle(); + float getThrottle(); float getRudder(); void reset(); void toggleReverse(); }; -#endif +#endif // __Screwprop_H_ Modified: trunk/source/main/scripting/GameScript.cpp =================================================================== --- trunk/source/main/scripting/GameScript.cpp 2012-01-31 04:35:47 UTC (rev 2407) +++ trunk/source/main/scripting/GameScript.cpp 2012-01-31 08:17:37 UTC (rev 2408) @@ -220,7 +220,7 @@ //NETCHAT.setFontSize(size); } -void GameScript::showChooser(string &type, string &instance, string &box) +void GameScript::showChooser(std::string &type, std::string &instance, std::string &box) { #ifdef USE_MYGUI SelectorWindow::LoaderType ntype = SelectorWindow::LT_None; @@ -238,12 +238,12 @@ #endif //USE_MYGUI } -void GameScript::repairVehicle(string &instance, string &box, bool keepPosition) +void GameScript::repairVehicle(std::string &instance, std::string &box, bool keepPosition) { BeamFactory::getSingleton().repairTruck(mefl->getCollisions(), const_cast<char*>(instance.c_str()), const_cast<char*>(box.c_str()), keepPosition); } -void GameScript::removeVehicle(string &instance, string &box) +void GameScript::removeVehicle(std::string &instance, std::string &box) { BeamFactory::getSingleton().removeTruck(mefl->getCollisions(), const_cast<char*>(instance.c_str()), const_cast<char*>(box.c_str())); } @@ -530,9 +530,9 @@ for(it = params.dict->dict.begin(); it != params.dict->dict.end(); it++) { int typeId = it->second.typeId; - if(typeId == mse->getEngine()->GetTypeIdByDecl("string")) + if(typeId == mse->getEngine()->GetTypeIdByDecl("std::string")) { - // its a string + // its a std::string std::string *str = (std::string *)it->second.valueObj; curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, it->first.c_str(), CURLFORM_COPYCONTENTS, str->c_str(), CURLFORM_END); } @@ -621,7 +621,7 @@ char *curl_err_str[CURL_ERROR_SIZE]; memset(curl_err_str, 0, CURL_ERROR_SIZE); - string url = "http://" + string(REPO_SERVER) + params.apiquery; + std::string url = "http://" + std::string(REPO_SERVER) + params.apiquery; curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); /* send all data to this function */ @@ -660,7 +660,7 @@ if(chunk.memory) { // convert memory into std::string now - result = string(chunk.memory); + result = std::string(chunk.memory); // then free free(chunk.memory); @@ -672,7 +672,7 @@ if(res != CURLE_OK) { const char *errstr = curl_easy_strerror(res); - result = "ERROR: " + string(errstr); + result = "ERROR: " + std::string(errstr); } LOG("online API result: " + result); @@ -707,19 +707,19 @@ if(con) con->putMessage(Console::CONSOLE_MSGTYPE_INFO, Console::CONSOLE_SYSTEM_NOTICE, _L("using Online API..."), "information.png", 2000); #endif // USE_MYGUI - // fix the string objects in the dict - // why we need to do this: when we copy the std::map (dict) over, we calso jsut copy the pointers to string in it. + // fix the std::string objects in the dict + // why we need to do this: when we copy the std::map (dict) over, we calso jsut copy the pointers to std::string in it. // when this continues and forks, AS releases the strings. // so we will allocate new strings that are persistent. std::map<std::string, AngelScript::CScriptDictionary::valueStruct>::iterator it; for(it = params->dict->dict.begin(); it != params->dict->dict.end(); it++) { int typeId = it->second.typeId; - if(typeId == mse->getEngine()->GetTypeIdByDecl("string")) + if(typeId == mse->getEngine()->GetTypeIdByDecl("std::string")) { - // its a string, copy it over + // its a std::string, copy it over std::string *str = (std::string *)it->second.valueObj; - it->second.valueObj = (void *)new string(*str); + it->second.valueObj = (void *)new std::string(*str); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Rigsofrods-devel mailing list Rigsofrods-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel