Minor missile starfield fix.

This commit is contained in:
Christian Speckner 2018-02-09 00:59:17 +01:00
parent b8af22cd67
commit d65ac4875f
2 changed files with 20 additions and 17 deletions

View File

@ -168,17 +168,17 @@ bool Missile::movementTick(uInt8 clock, uInt8 hclock, bool apply)
if (clock == myHmmClocks) myIsMoving = false;
if (myIsMoving && apply) tick(hclock);
if (myIsMoving && apply) tick(hclock, false);
return myIsMoving;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Missile::tick(uInt8 hclock)
void Missile::tick(uInt8 hclock, bool isReceivingMclock)
{
myIsVisible =
myIsRendering &&
(myRenderCounter >= 0 || (myIsMoving && myRenderCounter == -1 && myWidth < 4 && ((hclock + 1) % 4 == 3)));
(myRenderCounter >= 0 || (myIsMoving && isReceivingMclock && myRenderCounter == -1 && myWidth < 4 && ((hclock + 1) % 4 == 3)));
collision = (myIsVisible && myIsEnabled) ? myCollisionMaskEnabled : myCollisionMaskDisabled;
@ -187,21 +187,24 @@ void Missile::tick(uInt8 hclock)
myRenderCounter = Count::renderCounterOffset;
} else if (myIsRendering) {
if (myIsMoving && myRenderCounter == -1) {
if (myRenderCounter == -1) {
if (myIsMoving && isReceivingMclock) {
switch ((hclock + 1) % 4) {
case 3:
myEffectiveWidth = myWidth == 1 ? 2 : myWidth;
if (myWidth < 4) myRenderCounter++;
break;
switch ((hclock + 1) % 4) {
case 3:
myEffectiveWidth = myWidth == 1 ? 2 : myWidth;
if (myWidth < 4) myRenderCounter++;
break;
case 2:
myEffectiveWidth = 0;
break;
case 2:
myEffectiveWidth = 0;
break;
default:
myEffectiveWidth = myWidth;
break;
default:
myEffectiveWidth = myWidth;
break;
}
} else {
myEffectiveWidth = myWidth;
}
}

View File

@ -50,7 +50,7 @@ class Missile : public Serializable
bool movementTick(uInt8 clock, uInt8 hclock, bool apply);
void tick(uInt8 hclock);
void tick(uInt8 hclock, bool isReceivingMclock = true);
void nextLine();