From: <sv...@ww...> - 2005-04-07 20:02:50
|
Author: delta Date: 2005-04-07 13:02:41 -0700 (Thu, 07 Apr 2005) New Revision: 1514 Modified: trunk/CSP/CSPSim/CHANGES.current trunk/CSP/CSPSim/Include/Animation.h trunk/CSP/CSPSim/Source/HUD/Text.cpp trunk/CSP/CSPSim/Source/LandingGear.cpp Log: * Minor fix to the vc build (snprintf isn't supported). * Minor initialization fix to ser the gear being extended. At some point, initialization values should be set in xml. * Added a bool isDisabled() method in TimedSequece. Browse at: https://www.zerobar.net/viewcvs/viewcvs.cgi?view=rev&rev=1514 Modified: trunk/CSP/CSPSim/CHANGES.current =================================================================== --- trunk/CSP/CSPSim/CHANGES.current 2005-04-04 04:03:31 UTC (rev 1513) +++ trunk/CSP/CSPSim/CHANGES.current 2005-04-07 20:02:41 UTC (rev 1514) @@ -1,5 +1,14 @@ Version 0.4.0 (in progress) =========================== + +2005-04-06: delta + * Minor fix to the vc build (snprintf isn't supported). + + * Minor initialization fix to set the gear being extended. At + some point, initialization values should be set in xml. + + * Added a bool isDisabled() method in TimedSequece. + 2005-04-03: onsight * Increase the left/right panning limits for the in-cockpit view. Modified: trunk/CSP/CSPSim/Include/Animation.h =================================================================== --- trunk/CSP/CSPSim/Include/Animation.h 2005-04-04 04:03:31 UTC (rev 1513) +++ trunk/CSP/CSPSim/Include/Animation.h 2005-04-07 20:02:41 UTC (rev 1514) @@ -553,7 +553,10 @@ b_ReferenceTime->value() = m_TimeAnimationProxy->clamp(m_TimeAnimationProxy->gett_0()+b_NormalizedTime->value()*m_TimeAnimationProxy->getTimeLength()); } - + + bool isDisabled() const { + return std::abs(m_Direction) > 0.0001f; + } protected: bool isEnd() const { return 1.0 - b_NormalizedTime->value() < 0.0001; @@ -607,10 +610,12 @@ } double onUpdate(double dt) { - double t = b_ReferenceTime->value(); - t += m_Direction*dt; - t = m_TimeAnimationProxy->clamp(t); - setTimeValues(t); + if (isDisabled()) { + double t = b_ReferenceTime->value(); + t += m_Direction*dt; + t = m_TimeAnimationProxy->clamp(t); + setTimeValues(t); + } return 0.016; } Modified: trunk/CSP/CSPSim/Source/HUD/Text.cpp =================================================================== --- trunk/CSP/CSPSim/Source/HUD/Text.cpp 2005-04-04 04:03:31 UTC (rev 1513) +++ trunk/CSP/CSPSim/Source/HUD/Text.cpp 2005-04-07 20:02:41 UTC (rev 1514) @@ -22,13 +22,27 @@ * **/ +#ifndef __GNUC__ +#define snprintf _snprintf +#endif #include <HUD/Text.h> #include <osgText/Text> #include <cstdio> +//#include <iomanip> +//#include <sstream> +using namespace std; void StandardFormatter::format(char *buffer, int len, float value) { + + // make buffer a std::string& + //stringstream line(buffer); + //line.precision(0); + //line.setf(ios::fixed); + //line << setw(len) << value; + //buffer = line.str(); + snprintf(buffer, len, m_Format.c_str(), value); } Modified: trunk/CSP/CSPSim/Source/LandingGear.cpp =================================================================== --- trunk/CSP/CSPSim/Source/LandingGear.cpp 2005-04-04 04:03:31 UTC (rev 1513) +++ trunk/CSP/CSPSim/Source/LandingGear.cpp 2005-04-07 20:02:41 UTC (rev 1514) @@ -634,8 +634,8 @@ assert(bus!=0); b_WOW = bus->registerLocalDataChannel<bool>(bus::LandingGear::WOW, false); b_FullyRetracted = bus->registerLocalDataChannel<bool>(bus::LandingGear::FullyRetracted, false); - b_FullyExtended = bus->registerLocalDataChannel<bool>(bus::LandingGear::FullyExtended, false); - b_GearExtendSelected = bus->registerLocalDataChannel<bool>(bus::LandingGear::GearExtendSelected, false); + b_FullyExtended = bus->registerLocalDataChannel<bool>(bus::LandingGear::FullyExtended, true); + b_GearExtendSelected = bus->registerLocalDataChannel<bool>(bus::LandingGear::GearExtendSelected, true); for (unsigned i = 0; i < m_Gear.size(); ++i) { m_Gear[i]->registerChannels(bus); } |