@@ -529,20 +529,21 @@ void UnitSprite::drawRoutine0()
529529 itemB->setY (itemB->getY () + (22 - _unit->getStandHeight ()));
530530 }
531531
532- if (_unit->getStatus () == STATUS_AIMING )
533- {
534- torso->setX (offXAiming);
535- legs->setX (offXAiming);
536- leftArm->setX (offXAiming);
537- rightArm->setX (offXAiming);
538- if (itemA)
539- itemA->setX (itemA->getX () + offXAiming);
540- if (itemB)
541- itemB->setX (itemB->getX () + offXAiming);
542- }
543- else if (!itemA && _drawingRoutine == 10 && _unit->getStatus () == STATUS_WALKING && unitDir == 2 )
532+ // offset everything to the left by 16 pixels.
533+ // this is because we draw the sprites double wide, to accomodate weapons in-hand
534+ torso->setX (16 );
535+ legs->setX (16 );
536+ leftArm->setX (16 );
537+ rightArm->setX (16 );
538+ if (itemA)
539+ itemA->setX (itemA->getX () + 16 );
540+ if (itemB)
541+ itemB->setX (itemB->getX () + 16 );
542+
543+ // fix the errant muton arm.
544+ if (!itemA && _drawingRoutine == 10 && _unit->getStatus () == STATUS_WALKING && unitDir == 2 )
544545 {
545- rightArm->setX (- 6 );
546+ rightArm->setX (10 );
546547 }
547548
548549 // blit order depends on unit direction, and whether we are holding a 2 handed weapon.
@@ -722,16 +723,17 @@ void UnitSprite::drawRoutine1()
722723 rightArm->setY (0 );
723724 torso->setY (0 );
724725 }
725- if (_unit->getStatus () == STATUS_AIMING )
726- {
727- torso->setX (offXAiming);
728- leftArm->setX (offXAiming);
729- rightArm->setX (offXAiming);
730- if (itemA)
731- itemA->setX (itemA->getX () + offXAiming);
732- if (itemB)
733- itemB->setX (itemB->getX () + offXAiming);
734- }
726+
727+ // offset everything to the left by 16 pixels.
728+ // this is because we draw the sprites double wide, to accomodate weapons in-hand
729+ torso->setX (16 );
730+ leftArm->setX (16 );
731+ rightArm->setX (16 );
732+ if (itemA)
733+ itemA->setX (itemA->getX () + 16 );
734+ if (itemB)
735+ itemB->setX (itemB->getX () + 16 );
736+
735737 // blit order depends on unit direction.
736738 switch (unitDir)
737739 {
@@ -781,6 +783,7 @@ void UnitSprite::drawRoutine2()
781783
782784 // draw the tank itself
783785 s = _unitSurface->getFrame (hoverTank + (_part * 8 ) + _unit->getDirection ());
786+ s->setX (16 );
784787 drawRecolored (s);
785788
786789 // draw the turret, together with the last part
@@ -791,7 +794,7 @@ void UnitSprite::drawRoutine2()
791794 int turretOffsetY = -4 ;
792795 if (hoverTank)
793796 {
794- turretOffsetX += offX[_unit->getDirection ()];
797+ turretOffsetX += offX[_unit->getDirection ()] + 16 ;
795798 turretOffsetY += offy[_unit->getDirection ()];
796799 }
797800 s->setX (turretOffsetX);
@@ -822,6 +825,10 @@ void UnitSprite::drawRoutine3()
822825 }
823826
824827 s = _unitSurface->getFrame ((_part * 8 ) + _unit->getDirection ());
828+
829+ // offset everything to the left by 16 pixels.
830+ // this is because we draw the sprites double wide, to accomodate weapons in-hand
831+ s->setX (16 );
825832
826833 drawRecolored (s);
827834}
@@ -941,15 +948,15 @@ void UnitSprite::drawRoutine4()
941948 itemB->setY (offY3[unitDir]);
942949 }
943950 }
951+
952+ // offset everything to the right by 16 pixels.
953+ // this is because we draw the sprites double wide, to accomodate weapons in-hand
954+ s->setX (16 );
955+ if (itemA)
956+ itemA->setX (itemA->getX () + 16 );
957+ if (itemB)
958+ itemB->setX (itemB->getX () + 16 );
944959
945- if (_unit->getStatus () == STATUS_AIMING )
946- {
947- s->setX (offXAiming);
948- if (itemA)
949- itemA->setX (itemA->getX () + offXAiming);
950- if (itemB)
951- itemB->setX (itemB->getX () + offXAiming);
952- }
953960 switch (unitDir)
954961 {
955962 case 0 : itemB?itemB->blit (this ):void (); itemA?itemA->blit (this ):void (); drawRecolored (s); break ;
@@ -989,7 +996,10 @@ void UnitSprite::drawRoutine5()
989996 {
990997 s = _unitSurface->getFrame ((_part * 8 ) + _unit->getDirection ());
991998 }
992-
999+
1000+ // offset everything to the right by 16 pixels.
1001+ // this is because we draw the sprites double wide, to accomodate weapons in-hand
1002+ s->setX (16 );
9931003 drawRecolored (s);
9941004}
9951005
@@ -1155,17 +1165,16 @@ void UnitSprite::drawRoutine6()
11551165 rightArm->setY (0 );
11561166 torso->setY (0 );
11571167 }
1158- if (_unit->getStatus () == STATUS_AIMING )
1159- {
1160- torso->setX (offXAiming);
1161- legs->setX (offXAiming);
1162- leftArm->setX (offXAiming);
1163- rightArm->setX (offXAiming);
1164- if (itemA)
1165- itemA->setX (itemA->getX () + offXAiming);
1166- if (itemB)
1167- itemB->setX (itemB->getX () + offXAiming);
1168- }
1168+ // offset everything to the right by 16 pixels.
1169+ // this is because we draw the sprites double wide, to accomodate weapons in-hand
1170+ torso->setX (16 );
1171+ legs->setX (16 );
1172+ leftArm->setX (16 );
1173+ rightArm->setX (16 );
1174+ if (itemA)
1175+ itemA->setX (itemA->getX () + 16 );
1176+ if (itemB)
1177+ itemB->setX (itemB->getX () + 16 );
11691178
11701179 // blit order depends on unit direction.
11711180 switch (unitDir)
@@ -1241,6 +1250,12 @@ void UnitSprite::drawRoutine7()
12411250 rightArm->setY (0 );
12421251 torso->setY (0 );
12431252 }
1253+ // offset everything to the right by 16 pixels.
1254+ // this is because we draw the sprites double wide, to accomodate weapons in-hand
1255+ torso->setX (16 );
1256+ legs->setX (16 );
1257+ leftArm->setX (16 );
1258+ rightArm->setX (16 );
12441259
12451260 // blit order depends on unit direction
12461261 switch (unitDir)
@@ -1280,6 +1295,10 @@ void UnitSprite::drawRoutine8()
12801295
12811296 if (_unit->getStatus () == STATUS_AIMING )
12821297 legs = _unitSurface->getFrame (aim);
1298+
1299+ // offset everything to the right by 16 pixels.
1300+ // this is because we draw the sprites double wide, to accomodate weapons in-hand
1301+ legs->setX (16 );
12831302
12841303 drawRecolored (legs);
12851304}
@@ -1304,6 +1323,10 @@ void UnitSprite::drawRoutine9()
13041323
13051324 if (_unit->getStatus () == STATUS_COLLAPSING )
13061325 torso = _unitSurface->getFrame (die + _unit->getFallingPhase ());
1326+
1327+ // offset everything to the right by 16 pixels.
1328+ // this is because we draw the sprites double wide, to accomodate weapons in-hand
1329+ torso->setX (16 );
13071330
13081331 drawRecolored (torso);
13091332}
@@ -1333,14 +1356,15 @@ void UnitSprite::drawRoutine11()
13331356
13341357 Surface *s = _unitSurface->getFrame (body + (_part * 4 ) + 16 * _unit->getDirection () + animFrame);
13351358 s->setY (4 );
1359+ s->setX (16 );
13361360 drawRecolored (s);
13371361
13381362 int turret = _unit->getTurretType ();
13391363 // draw the turret, overlapping all 4 parts
13401364 if ((_part == 3 || _part == 0 ) && turret != -1 && !_unit->getFloorAbove ())
13411365 {
13421366 s = _unitSurface->getFrame (256 + (turret * 8 ) + _unit->getTurretDirection ());
1343- s->setX (offTurretX[_unit->getDirection ()]);
1367+ s->setX (offTurretX[_unit->getDirection ()] + 16 );
13441368 if (_part == 3 )
13451369 s->setY (offTurretYBelow[_unit->getDirection ()]);
13461370 else
@@ -1374,7 +1398,7 @@ void UnitSprite::drawRoutine12()
13741398 drawRecolored (s);
13751399 return ;
13761400 }
1377-
1401+ s-> setX ( 16 );
13781402 drawRecolored (s);
13791403}
13801404
@@ -1408,7 +1432,7 @@ void UnitSprite::drawRoutine19()
14081432 {
14091433 s = _unitSurface->getFrame (stand + _unit->getDirection ());
14101434 }
1411-
1435+ s-> setX ( 16 );
14121436 drawRecolored (s);
14131437}
14141438
@@ -1433,7 +1457,7 @@ void UnitSprite::drawRoutine20()
14331457 {
14341458 s = _unitSurface->getFrame (5 * (_part + 4 * _unit->getDirection ()));
14351459 }
1436-
1460+ s-> setX ( 16 );
14371461 drawRecolored (s);
14381462}
14391463
@@ -1452,7 +1476,7 @@ void UnitSprite::drawRoutine21()
14521476
14531477 s = _unitSurface->getFrame ((_part * 4 ) + (_unit->getDirection () * 16 ) + (_animationFrame % 4 ));
14541478 _redraw = true ;
1455-
1479+ s-> setX ( 16 );
14561480 drawRecolored (s);
14571481}
14581482
0 commit comments