Commit cbfd931f authored by Thom Cherryhomes's avatar Thom Cherryhomes
Browse files

Last bits of configuration table import for now. Shelving temporarily to smash other bugs.

parent e111f8df
......@@ -1359,15 +1359,15 @@ bool Database::ProcessMachine(MAMEMachine* m)
// Add Configuration entry if needed, otherwise query, come out with a PK_Configuration
long int liPK_Configuration;
if (!ConfigurationExists(m))
{
// if (!ConfigurationExists(m))
// {
// Add Configuration Entry
liPK_Configuration=AddConfiguration(m);
}
else
{
liPK_Configuration=GetPKConfiguration(m);
}
// }
// else
// {
// liPK_Configuration=GetPKConfiguration(m);
// }
m->liPK_Configuration_set(liPK_Configuration);
......
......@@ -167,10 +167,10 @@ class MAMEControl
sRet+="\"maximum\":\""+m_sMaximum+"\", ";
sRet+="\"sensitivity\":\""+m_sSensitivity+"\", ";
sRet+="\"keydelta\":\""+m_sKeyDelta+"\", ";
sRet+="\"reverse\":\""+m_sReverse+"\"";
sRet+="\"reverse\":\""+m_sReverse+"\",";
sRet+="\"ways\":\""+m_sWays+"\", ";
sRet+="\"ways2\":\""+m_sWays2+"\", ";
sRet+="\"ways3\";\""+m_sWays3+"\"";
sRet+="\"ways3\":\""+m_sWays3+"\"";
sRet+="}";
return sRet;
}
......@@ -223,15 +223,20 @@ class MAMEInput
return sRet;
}
void MachineInputControls_add(MAMEControl* control)
{
m_vectMAMEControls.push_back(control);
}
string to_json()
{
string sRet="";
sRet+="{";
sRet+="\"service\":\""+m_sService+"\"";
sRet+="\"tilt\":\""+m_sTilt+"\"";
sRet+="\"players\":\""+m_sPlayers+"\"";
sRet+="\"buttons\":\""+m_sButtons+"\"";
sRet+="\"coins\":\""+m_sCoins+"\"";
sRet+="\"service\":\""+m_sService+"\", ";
sRet+="\"tilt\":\""+m_sTilt+"\", ";
sRet+="\"players\":\""+m_sPlayers+"\", ";
sRet+="\"buttons\":\""+m_sButtons+"\", ";
sRet+="\"coins\":\""+m_sCoins+"\", ";
sRet+="\"controls\":["+MachineInputControls_get()+"]";
sRet+="}";
return sRet;
......
......@@ -132,6 +132,22 @@ bool MAMEXMLParser::parseMAMEOutput()
xnINPUT.child("input").attribute("players").value(),
xnINPUT.child("input").attribute("buttons").value(),
xnINPUT.child("input").attribute("coins").value()));
xnINPUT=xnMACHINE;
for (pugi::xml_node xnCONTROL: xnINPUT.child("input").children("control"))
{
m->MachineInput_get()->MachineInputControls_add(new MAMEControl(
xnCONTROL.attribute("type").value(),
xnCONTROL.attribute("minimum").value(),
xnCONTROL.attribute("maximum").value(),
xnCONTROL.attribute("sensitivity").value(),
xnCONTROL.attribute("keydelta").value(),
xnCONTROL.attribute("reverse").value(),
xnCONTROL.attribute("ways").value(),
xnCONTROL.attribute("ways2").value(),
xnCONTROL.attribute("ways3").value()));
}
for (pugi::xml_node xnDISPLAY: xnDISPLAYS.children("display"))
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment