Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gavin Pryke
linuxmce
Commits
cbfd931f
Commit
cbfd931f
authored
Mar 05, 2016
by
Thom Cherryhomes
Browse files
Last bits of configuration table import for now. Shelving temporarily to smash other bugs.
parent
e111f8df
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/lmce_game_tools/import-mame/Database.cpp
View file @
cbfd931f
...
...
@@ -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
);
...
...
src/lmce_game_tools/import-mame/MAMEMachine.h
View file @
cbfd931f
...
...
@@ -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
;
...
...
src/lmce_game_tools/import-mame/MAMEXMLParser.cpp
View file @
cbfd931f
...
...
@@ -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"
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment