From: <mk...@us...> - 2003-10-11 17:46:37
|
Update of /cvsroot/csp/APPLICATIONS/CSPSim/Source In directory sc8-pr-cvs1:/tmp/cvs-serv10333/Source Modified Files: Tag: systems EventMapIndex.cpp EventMapping.cpp HID.cpp Log Message: Index: EventMapIndex.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/EventMapIndex.cpp,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** EventMapIndex.cpp 23 Jul 2003 01:28:58 -0000 1.7 --- EventMapIndex.cpp 11 Oct 2003 17:46:34 -0000 1.7.2.1 *************** *** 39,50 **** - EventMapIndex::~EventMapIndex() { - MapVector::iterator i; - for (i = m_Maps.begin(); i != m_Maps.end(); i++) { - delete *i; - } - } ! EventMapping *EventMapIndex::getMap(const simdata::hasht &key) { MapHash::iterator i = m_Index.find(key); if (i == m_Index.end()) return NULL; --- 39,44 ---- ! EventMapping::Ref EventMapIndex::getMap(const simdata::hasht &key) { MapHash::iterator i = m_Index.find(key); if (i == m_Index.end()) return NULL; *************** *** 52,62 **** } ! EventMapping *EventMapIndex::getMap(const std::string &id) { return getMap(simdata::hasht(id)); } void EventMapIndex::load(std::string const &path) { ! EventMapping *m = new EventMapping; ! assert(m); CSP_LOG(APP, INFO, "Loading human interface device mapping '" << path << "'"); if (m->load(path)) { --- 46,56 ---- } ! EventMapping::Ref EventMapIndex::getMap(const std::string &id) { return getMap(simdata::hasht(id)); } void EventMapIndex::load(std::string const &path) { ! EventMapping::Ref m = new EventMapping; ! assert(m.valid()); CSP_LOG(APP, INFO, "Loading human interface device mapping '" << path << "'"); if (m->load(path)) { *************** *** 67,72 **** m_Index[*idx] = m; } - } else { - delete m; } } --- 61,64 ---- Index: EventMapping.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/EventMapping.cpp,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** EventMapping.cpp 19 Feb 2003 11:41:58 -0000 1.4 --- EventMapping.cpp 11 Oct 2003 17:46:34 -0000 1.4.2.1 *************** *** 28,32 **** # endif ! #include "EventMapping.h" #include <SDL/SDL_events.h> --- 28,32 ---- # endif ! #include <EventMapping.h> #include <SDL/SDL_events.h> Index: HID.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/CSPSim/Source/HID.cpp,v retrieving revision 1.10.2.1 retrieving revision 1.10.2.2 diff -C2 -d -r1.10.2.1 -r1.10.2.2 *** HID.cpp 16 Sep 2003 06:57:30 -0000 1.10.2.1 --- HID.cpp 11 Oct 2003 17:46:34 -0000 1.10.2.2 *************** *** 30,33 **** --- 30,34 ---- #include "InputInterface.h" #include <SDL/SDL_events.h> + //#include "Event.h" #include <cassert> *************** *** 117,121 **** VirtualHID::~VirtualHID() {} ! void VirtualHID::setMapping(EventMapping const *map) { m_Map = map; } --- 118,122 ---- VirtualHID::~VirtualHID() {} ! void VirtualHID::setMapping(simdata::Ref<EventMapping const> map) { m_Map = map; } |