CVS: source/src/Input FGCommonInput.cxx, 1.3, 1.4 FGDeviceConfigurationMap.cxx, 1.4, 1.5 FGEventInput.cxx, 1.7, 1.8 FGJoystickInput.cxx, 1.2, 1.3 fgjs.cxx, 1.20, 1.21 FGKeyboardInput.cxx, 1.1, 1.2
Torsten Dreyer <[email protected]> Thu, 15 Apr 2010 07:31:41 -0500
| Newsgroups | gmane.games.flightgear.cvc |
|---|---|
| Message-ID | <[email protected]> |
Update of /var/cvs/FlightGear-0.9/source/src/Input
In directory baron.flightgear.org:/tmp/cvs-serv23629/Input
Modified Files:
FGCommonInput.cxx FGDeviceConfigurationMap.cxx
FGEventInput.cxx FGJoystickInput.cxx fgjs.cxx
FGKeyboardInput.cxx
Log Message:
use simgear::PropertyList instead of std::vector<SGPropertyNode_ptr>
Index: FGCommonInput.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Input/FGCommonInput.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- FGCommonInput.cxx 28 Aug 2009 15:05:21 -0000 1.3
+++ FGCommonInput.cxx 15 Apr 2010 12:31:20 -0000 1.4
@@ -32,10 +32,12 @@
#include <simgear/math/SGMath.hxx>
+using simgear::PropertyList;
+
void FGCommonInput::read_bindings (const SGPropertyNode * node, binding_list_t * binding_list, int modifiers, const string & module )
{
SG_LOG(SG_INPUT, SG_DEBUG, "Reading all bindings");
- vector<SGPropertyNode_ptr> bindings = node->getChildren("binding");
+ PropertyList bindings = node->getChildren("binding");
static string nasal = "nasal";
for (unsigned int i = 0; i < bindings.size(); i++) {
const char *cmd = bindings[i]->getStringValue("command");
Index: FGDeviceConfigurationMap.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Input/FGDeviceConfigurationMap.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- FGDeviceConfigurationMap.cxx 26 Oct 2009 21:53:12 -0000 1.4
+++ FGDeviceConfigurationMap.cxx 15 Apr 2010 12:31:23 -0000 1.5
@@ -35,6 +35,8 @@
#include <simgear/props/props_io.hxx>
#include <Main/globals.hxx>
+using simgear::PropertyList;
+
FGDeviceConfigurationMap::FGDeviceConfigurationMap( const char * relative_path, SGPropertyNode_ptr aBase, const char * aChildname ) :
base(aBase),
childname(aChildname)
@@ -45,10 +47,10 @@
int index = 1000;
scan_dir( path, &index);
- vector<SGPropertyNode_ptr> childNodes = base->getChildren(childname);
+ PropertyList childNodes = base->getChildren(childname);
for (int k = (int)childNodes.size() - 1; k >= 0; k--) {
SGPropertyNode *n = childNodes[k];
- vector<SGPropertyNode_ptr> names = n->getChildren("name");
+ PropertyList names = n->getChildren("name");
if (names.size() ) // && (n->getChildren("axis").size() || n->getChildren("button").size()))
for (unsigned int j = 0; j < names.size(); j++)
(*this)[names[j]->getStringValue()] = n;
Index: FGEventInput.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Input/FGEventInput.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FGEventInput.cxx 1 Oct 2009 11:49:10 -0000 1.7
+++ FGEventInput.cxx 15 Apr 2010 12:31:24 -0000 1.8
@@ -29,6 +29,8 @@
#include <simgear/io/sg_file.hxx>
#include <Scripting/NasalSys.hxx>
+using simgear::PropertyList;
+
FGEventSetting::FGEventSetting( SGPropertyNode_ptr base ) :
value(0.0)
{
@@ -93,8 +95,8 @@
read_bindings( node, bindings, KEYMOD_NONE, device->GetNasalModule() );
- vector<SGPropertyNode_ptr> settingNodes = node->getChildren("setting");
- for( vector<SGPropertyNode_ptr>::iterator it = settingNodes.begin(); it != settingNodes.end(); it++ )
+ PropertyList settingNodes = node->getChildren("setting");
+ for( PropertyList::iterator it = settingNodes.begin(); it != settingNodes.end(); it++ )
settings.push_back( new FGEventSetting( *it ) );
}
@@ -235,8 +237,8 @@
nasalModule = string("__event:") + GetName();
- vector<SGPropertyNode_ptr> eventNodes = deviceNode->getChildren( "event" );
- for( vector<SGPropertyNode_ptr>::iterator it = eventNodes.begin(); it != eventNodes.end(); it++ )
+ PropertyList eventNodes = deviceNode->getChildren( "event" );
+ for( PropertyList::iterator it = eventNodes.begin(); it != eventNodes.end(); it++ )
AddHandledEvent( FGInputEvent::NewObject( this, *it ) );
debugEvents = deviceNode->getBoolValue("debug-events", debugEvents );
Index: FGJoystickInput.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Input/FGJoystickInput.cxx,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- FGJoystickInput.cxx 20 Aug 2009 22:09:11 -0000 1.2
+++ FGJoystickInput.cxx 15 Apr 2010 12:31:25 -0000 1.3
@@ -27,6 +27,8 @@
#include <Main/fg_props.hxx>
#include <Scripting/NasalSys.hxx>
+using simgear::PropertyList;
+
FGJoystickInput::axis::axis ()
: last_value(9999999),
tolerance(0.002),
@@ -166,7 +168,7 @@
string module = str.str();
nasalsys->createModule(module.c_str(), module.c_str(), "", 0);
- vector<SGPropertyNode_ptr> nasal = js_node->getChildren("nasal");
+ PropertyList nasal = js_node->getChildren("nasal");
unsigned int j;
for (j = 0; j < nasal.size(); j++) {
nasal[j]->setStringValue("module", module.c_str());
@@ -176,7 +178,7 @@
//
// Initialize the axes.
//
- vector<SGPropertyNode_ptr> axes = js_node->getChildren("axis");
+ PropertyList axes = js_node->getChildren("axis");
size_t nb_axes = axes.size();
for (j = 0; j < nb_axes; j++ ) {
const SGPropertyNode * axis_node = axes[j];
@@ -219,7 +221,7 @@
//
// Initialize the buttons.
//
- vector<SGPropertyNode_ptr> buttons = js_node->getChildren("button");
+ PropertyList buttons = js_node->getChildren("button");
char buf[32];
for (j = 0; j < buttons.size() && j < nbuttons; j++) {
const SGPropertyNode * button_node = buttons[j];
Index: fgjs.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Input/fgjs.cxx,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- fgjs.cxx 23 Jan 2010 22:26:55 -0000 1.20
+++ fgjs.cxx 15 Apr 2010 12:31:27 -0000 1.21
@@ -58,6 +58,7 @@
#include "jsinput.h"
+using simgear::PropertyList;
bool confirmAnswer() {
char answer;
@@ -136,8 +137,8 @@
cout << e.getFormattedMessage ();
}
- vector<SGPropertyNode_ptr> axes = templatetree->getChildren("axis");
- for(vector<SGPropertyNode_ptr>::iterator iter = axes.begin(); iter != axes.end(); iter++) {
+ PropertyList axes = templatetree->getChildren("axis");
+ for(PropertyList::iterator iter = axes.begin(); iter != axes.end(); iter++) {
cout << "Move the control you wish to use for " << (*iter)->getStringValue("desc")
<< " " << (*iter)->getStringValue("direction") << endl;
cout << "Pressing a button skips this axis" << endl;
@@ -164,8 +165,8 @@
cout << endl;
}
- vector<SGPropertyNode_ptr> buttons = templatetree->getChildren("button");
- for(vector<SGPropertyNode_ptr>::iterator iter = buttons.begin(); iter != buttons.end(); iter++) {
+ PropertyList buttons = templatetree->getChildren("button");
+ for(PropertyList::iterator iter = buttons.begin(); iter != buttons.end(); iter++) {
cout << "Press the button you wish to use for " << (*iter)->getStringValue("desc") << endl;
cout << "Moving a joystick axis skips this button" << endl;
fflush( stdout );
Index: FGKeyboardInput.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Input/FGKeyboardInput.cxx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FGKeyboardInput.cxx 7 Aug 2009 19:00:15 -0000 1.1
+++ FGKeyboardInput.cxx 15 Apr 2010 12:31:29 -0000 1.2
@@ -27,6 +27,8 @@
#include <Scripting/NasalSys.hxx>
#include <plib/pu.h>
+using simgear::PropertyList;
+
static int getModifiers ()
{
return fgGetKeyModifiers() >> 1;
@@ -94,13 +96,13 @@
}
FGNasalSys *nasalsys = (FGNasalSys *)globals->get_subsystem("nasal");
- vector<SGPropertyNode_ptr> nasal = key_nodes->getChildren("nasal");
+ PropertyList nasal = key_nodes->getChildren("nasal");
for (unsigned int j = 0; j < nasal.size(); j++) {
nasal[j]->setStringValue("module", module.c_str());
nasalsys->handleCommand(nasal[j]);
}
- vector<SGPropertyNode_ptr> keys = key_nodes->getChildren("key");
+ PropertyList keys = key_nodes->getChildren("key");
for (unsigned int i = 0; i < keys.size(); i++) {
int index = keys[i]->getIndex();
SG_LOG(SG_INPUT, SG_DEBUG, "Binding key " << index);
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev