[Add] You can now specify target graphic different from normal gfx.

This commit is contained in:
Allanis 2013-08-03 13:25:43 +01:00
parent 61291921fe
commit 6bc5e6d5af

View File

@ -126,16 +126,26 @@ static Ship* ship_parse(xmlNodePtr parent) {
do {
/* Load all the data. */
if(xml_isNode(node,"GFX")) {
/* Load the base graphic. */
snprintf(str, strlen(xml_get(node)) +
sizeof(SHIP_GFX) + sizeof(SHIP_EXT),
SHIP_GFX"%s"SHIP_EXT, xml_get(node));
tmp->gfx_space = gl_newSprite(str, 6, 6);
/* Target. */
snprintf(str, strlen(xml_get(node)) +
sizeof(SHIP_GFX)+sizeof(SHIP_TARGET)+sizeof(SHIP_EXT),
SHIP_GFX"%s"SHIP_TARGET SHIP_EXT, xml_get(node));
tmp->gfx_target = gl_newImage(str);
xmlr_attr(node, "target", stmp);
if(stmp != NULL) {
snprintf(str, strlen(stmp) +
sizeof(SHIP_GFX)+sizeof(SHIP_TARGET)+sizeof(SHIP_EXT),
SHIP_GFX"%s"SHIP_TARGET SHIP_EXT, stmp);
tmp->gfx_target = gl_newImage(str);
free(stmp);
} else { /* Load standard target graphic. */
snprintf(str, strlen(xml_get(node)) +
sizeof(SHIP_GFX)+sizeof(SHIP_TARGET)+sizeof(SHIP_EXT),
SHIP_GFX"%s"SHIP_TARGET SHIP_EXT, xml_get(node));
tmp->gfx_target = gl_newImage(str);
}
}
xmlr_strd(node, "GUI", tmp->gui);
if(xml_isNode(node, "sound"))