[Fix] Mount y position is now properly in pixels.

This commit is contained in:
Allanis 2014-05-20 23:50:18 +01:00
parent e52456d312
commit 8445d5a1ca
2 changed files with 7 additions and 4 deletions

View File

@ -516,8 +516,8 @@
<mount x="35" y="0" h="-2">0</mount>
<mount x="5" y="12" h="3" >1</mount>
<mount x="5" y="-12" h="3" >2</mount>
<mount x="-3" y="30" h="3" >3</mount>
<mount x="-3" y="-30" h="3" >4</mount>
<mount x="-3" y="22" h="3" >3</mount>
<mount x="-3" y="-22" h="3" >4</mount>
<mount x="25" y="0" h="3" >5</mount>
</mounts>
</ship>
@ -560,8 +560,8 @@
<mount x="35" y="0" h="-2">0</mount>
<mount x="5" y="12" h="3" >1</mount>
<mount x="5" y="-12" h="3" >2</mount>
<mount x="-3" y="30" h="3" >3</mount>
<mount x="-3" y="-30" h="3" >4</mount>
<mount x="-3" y="22" h="3" >3</mount>
<mount x="-3" y="-22" h="3" >4</mount>
<mount x="25" y="0" h="3" >5</mount>
</mounts>
</ship>

View File

@ -413,6 +413,9 @@ static int ship_parse(Ship* tmp, xmlNodePtr parent) {
free(stmp);
xmlr_attr(cur, "y", stmp);
tmp->mounts[id].y = atof(stmp);
/* Since we measure in pixels, we have to modify it so it
* doesn't get corrected by the ortho correction. */
tmp->mounts[id].y *= M_SQRT2;
free(stmp);
xmlr_attr(cur, "h", stmp);
tmp->mounts[id].h = atof(stmp);