projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added description for BD style explosion
[rocksndiamonds.git]
/
src
/
game_sp
/
BugsTerminals.c
diff --git
a/src/game_sp/BugsTerminals.c
b/src/game_sp/BugsTerminals.c
index ec4be1ea66feebb06629dd91ae7d23c4b8f881c2..c6f03e2e6bcd13cd652da4bfd304c99255999ef9 100644
(file)
--- a/
src/game_sp/BugsTerminals.c
+++ b/
src/game_sp/BugsTerminals.c
@@
-5,7
+5,8
@@
#include "BugsTerminals.h"
#include "BugsTerminals.h"
-byte *TerminalState;
+byte TerminalState[SP_MAX_PLAYFIELD_SIZE + SP_HEADER_SIZE];
+
int TerminalMaxCycles;
int TerminalMaxCycles;
@@
-26,7
+27,7
@@
void subAnimateBugs(int si)
if ((TimerVar & 3) == 0)
{
bl = bl + 1;
if ((TimerVar & 3) == 0)
{
bl = bl + 1;
- if (bl >=
0xE)
+ if (bl >=
14) // bugs animation has 14 frames
{
bl = subGetRandomNumber(); // generate new random number
bl = -((bl & 0x3F) + 0x20);
{
bl = subGetRandomNumber(); // generate new random number
bl = -((bl & 0x3F) + 0x20);
@@
-65,7
+66,7
@@
void subAnimateBugs(int si)
void subAnimateTerminals(int si)
{
void subAnimateTerminals(int si)
{
-
shor
t bl;
+
in
t bl;
int lx = GetX(si);
int ly = GetY(si);
int lx = GetX(si);
int ly = GetY(si);
@@
-74,28
+75,26
@@
void subAnimateTerminals(int si)
if (LowByte(PlayField16[si]) != fiTerminal)
return;
if (LowByte(PlayField16[si]) != fiTerminal)
return;
- /
* use native frame handling (undo frame incrementation in main loop) */
+ /
/ use native frame handling (undo frame incrementation in main loop)
if (game.use_native_sp_graphics_engine)
if (game.use_native_sp_graphics_engine)
- GfxFrame[lx][ly]--;
+ GfxFrame
SP
[lx][ly]--;
- /* get last random animation delay */
- bl = HighByte(PlayField16[si]);
- if ((bl & 0x80) == 0x80)
- bl = (bl | 0xFF00);
+ // get last random animation delay
+ bl = SgnHighByte(PlayField16[si]);
bl = bl + 1;
bl = bl + 1;
- if (bl <= 0) /
* return if random animation delay not yet reached */
+ if (bl <= 0) /
/ return if random animation delay not yet reached
{
MovHighByte(&PlayField16[si], bl);
return;
}
{
MovHighByte(&PlayField16[si], bl);
return;
}
- /
* calculate new random animation delay */
+ /
/ calculate new random animation delay
bl = -(subGetRandomNumber() & TerminalMaxCycles); // generate new random number
MovHighByte(&PlayField16[si], bl); // save new sequence number
bl = -(subGetRandomNumber() & TerminalMaxCycles); // generate new random number
MovHighByte(&PlayField16[si], bl); // save new sequence number
- /
* check terminal state (active or inactive) */
+ /
/ check terminal state (active or inactive)
bl = TerminalState[si] + 1;
if (bl == 8)
bl = 0;
bl = TerminalState[si] + 1;
if (bl == 8)
bl = 0;
@@
-109,7
+108,7
@@
void subAnimateTerminals(int si)
graphic = (bl < 8 ? aniTerminal : aniTerminalActive);
if (game.use_native_sp_graphics_engine)
graphic = (bl < 8 ? aniTerminal : aniTerminalActive);
if (game.use_native_sp_graphics_engine)
- GfxFrame[lx][ly] += getGraphicInfo_Delay(graphic);
+ GfxFrame
SP
[lx][ly] += getGraphicInfo_Delay(graphic);
GfxGraphic[lx][ly] = (bl < 8 ? aniTerminal : aniTerminalActive);
GfxGraphic[lx][ly] = (bl < 8 ? aniTerminal : aniTerminalActive);
@@
-122,9
+121,9
@@
void subAnimateTerminals(int si)
// Randomize random number generator
// ==========================================================================
// Randomize random number generator
// ==========================================================================
-void subRandomize()
+void subRandomize(
void
)
{
{
-
long
Tick = MyGetTickCount();
+
int
Tick = MyGetTickCount();
RandomSeed = (Tick ^ (Tick >> 16)) & 0xFFFF;
}
RandomSeed = (Tick ^ (Tick >> 16)) & 0xFFFF;
}
@@
-135,7
+134,7
@@
void subRandomize()
// Generate new random number, first method (see also sub_g_8580)
// ==========================================================================
// Generate new random number, first method (see also sub_g_8580)
// ==========================================================================
-int subGetRandomNumber()
+int subGetRandomNumber(
void
)
{
RandomSeed = (RandomSeed * 0x5E5 + 0x31) & 0xFFFF;
{
RandomSeed = (RandomSeed * 0x5E5 + 0x31) & 0xFFFF;