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

View File

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