byte *TerminalState;
int TerminalMaxCycles;
+
+#if 0
#define aniTerminal (0x80)
+#endif
// ==========================================================================
// SUBROUTINE
// int bl, ax, al, X, Y;
#if 1
- short bl, al, X, Y;
+ short bl;
#else
int bl, al, X, Y;
#endif
+#if 1
+ int lx = GetX(si);
+ int ly = GetY(si);
+ int graphic;
+#endif
+
if (LowByte(PlayField16[si]) != fiTerminal)
return subAnimateTerminals;
+ /* use native frame handling (undo frame incrementation in main loop) */
+ if (game.use_native_sp_graphics_engine)
+ GfxFrame[lx][ly]--;
+
+ /* get last random animation delay */
bl = HighByte(PlayField16[si]);
if ((bl & 0x80) == 0x80)
bl = (bl | 0xFF00);
bl = bl + 1;
- if (bl <= 0)
+ if (bl <= 0) /* return if random animation delay not yet reached */
{
MovHighByte(&PlayField16[si], bl);
+
+#if 1
+ if (game.use_native_sp_graphics_engine)
+ return subAnimateTerminals;
+#else
return subAnimateTerminals;
+#endif
}
+ /* calculate new random animation delay */
bl = -(subGetRandomNumber() & TerminalMaxCycles); // generate new random number
MovHighByte(&PlayField16[si], bl); // save new sequence#
+
+ /* check terminal state (active or inactive) */
bl = TerminalState[si] + 1;
if (bl == 8)
{
}
TerminalState[si] = bl;
+
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- al = aniTerminal + bl;
+#if 1
+
+ graphic = (bl < 8 ? aniTerminal : aniTerminalActive);
+
+ if (game.use_native_sp_graphics_engine)
+ GfxFrame[lx][ly] += getGraphicInfo_Delay(graphic);
+
+#if 1
+ subCopyAnimToScreen(si, graphic, GfxFrame[lx][ly]);
+#else
X = GetStretchX(si);
Y = GetStretchY(si);
+ StretchedSprites.BltImg(X, Y, graphic, GfxFrame[lx][ly]);
+#endif
+
+#else
+
+ al = aniTerminal + bl;
+
#if 1
- StretchedSprites.BltImg(X, Y,
- bl < 8 ? IMG_SP_TERMINAL : IMG_SP_TERMINAL_ACTIVE,
- FrameCounter);
+ subCopyFieldToScreen(si, al);
#else
+ X = GetStretchX(si);
+ Y = GetStretchY(si);
StretchedSprites.BltEx(X, Y, al);
+#endif
+
#endif
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++