From 8445d5a1ca0e1e8381936745cd0483741b48e3b7 Mon Sep 17 00:00:00 2001 From: Allanis <allanis@saracraft.net> Date: Tue, 20 May 2014 23:50:18 +0100 Subject: [PATCH] [Fix] Mount y position is now properly in pixels. --- dat/ship.xml | 8 ++++---- src/ship.c | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dat/ship.xml b/dat/ship.xml index 82b1c2d..07a546d 100644 --- a/dat/ship.xml +++ b/dat/ship.xml @@ -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> diff --git a/src/ship.c b/src/ship.c index 2013dfd..04812e7 100644 --- a/src/ship.c +++ b/src/ship.c @@ -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);