projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added support for custom graphics for many elements of MM game engine
[rocksndiamonds.git]
/
src
/
game_mm
/
mm_game.c
diff --git
a/src/game_mm/mm_game.c
b/src/game_mm/mm_game.c
index 093e837363e306753ca2f178aa1340680c7c1898..1ef6339e826957c521ef5d79efc81935cbd8ebba 100644
(file)
--- a/
src/game_mm/mm_game.c
+++ b/
src/game_mm/mm_game.c
@@
-436,7
+436,7
@@
static void InitMovDir_MM(int x, int y)
}
}
}
}
-static void InitField(int x, int y
, boolean init_game
)
+static void InitField(int x, int y)
{
int element = Tile[x][y];
{
int element = Tile[x][y];
@@
-537,7
+537,6
@@
static void InitCycleElements_RotateSingleStep(void)
Tile[x][y] = next_element;
Tile[x][y] = next_element;
- DrawField_MM(x, y);
game_mm.cycle[i].steps -= step;
}
}
game_mm.cycle[i].steps -= step;
}
}
@@
-656,7
+655,7
@@
void InitGameEngine_MM(void)
Frame[x][y] = 0;
Stop[x][y] = FALSE;
Frame[x][y] = 0;
Stop[x][y] = FALSE;
- InitField(x, y
, TRUE
);
+ InitField(x, y);
}
}
}
}
@@
-691,6
+690,11
@@
void InitGameActions_MM(void)
cycle_steps_done++;
}
cycle_steps_done++;
}
+ AdvanceFrameCounter();
+ AdvanceGfxFrame();
+
+ DrawLevel_MM();
+
BackToFront();
ColorCycling();
BackToFront();
ColorCycling();
@@
-945,7
+949,7
@@
void ScanLaser(void)
if (element == EL_EMPTY)
{
if (element == EL_EMPTY)
{
- if (!HitOnlyAnEdge(
element,
hit_mask))
+ if (!HitOnlyAnEdge(hit_mask))
break;
}
else if (element == EL_FUSE_ON)
break;
}
else if (element == EL_FUSE_ON)
@@
-1315,7
+1319,7
@@
void DrawLaser_MM(void)
boolean HitElement(int element, int hit_mask)
{
boolean HitElement(int element, int hit_mask)
{
- if (HitOnlyAnEdge(
element,
hit_mask))
+ if (HitOnlyAnEdge(hit_mask))
return FALSE;
if (IS_MOVING(ELX, ELY) || IS_BLOCKED(ELX, ELY))
return FALSE;
if (IS_MOVING(ELX, ELY) || IS_BLOCKED(ELX, ELY))
@@
-1638,7
+1642,7
@@
boolean HitElement(int element, int hit_mask)
return TRUE;
}
return TRUE;
}
-boolean HitOnlyAnEdge(int
element, int
hit_mask)
+boolean HitOnlyAnEdge(int hit_mask)
{
// check if the laser hit only the edge of an element and, if so, go on
{
// check if the laser hit only the edge of an element and, if so, go on
@@
-1697,7
+1701,7
@@
boolean HitOnlyAnEdge(int element, int hit_mask)
boolean HitPolarizer(int element, int hit_mask)
{
boolean HitPolarizer(int element, int hit_mask)
{
- if (HitOnlyAnEdge(
element,
hit_mask))
+ if (HitOnlyAnEdge(hit_mask))
return FALSE;
if (IS_DF_GRID(element))
return FALSE;
if (IS_DF_GRID(element))
@@
-1895,7
+1899,7
@@
boolean HitBlock(int element, int hit_mask)
boolean HitLaserSource(int element, int hit_mask)
{
boolean HitLaserSource(int element, int hit_mask)
{
- if (HitOnlyAnEdge(
element,
hit_mask))
+ if (HitOnlyAnEdge(hit_mask))
return FALSE;
PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
return FALSE;
PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_HITTING);
@@
-1907,7
+1911,7
@@
boolean HitLaserSource(int element, int hit_mask)
boolean HitLaserDestination(int element, int hit_mask)
{
boolean HitLaserDestination(int element, int hit_mask)
{
- if (HitOnlyAnEdge(
element,
hit_mask))
+ if (HitOnlyAnEdge(hit_mask))
return FALSE;
if (element != EL_EXIT_OPEN &&
return FALSE;
if (element != EL_EXIT_OPEN &&
@@
-2143,7
+2147,7
@@
boolean HitReflectingWalls(int element, int hit_mask)
}
}
}
}
- if (!HitOnlyAnEdge(
element,
hit_mask))
+ if (!HitOnlyAnEdge(hit_mask))
{
laser.overloaded = TRUE;
{
laser.overloaded = TRUE;
@@
-2155,7
+2159,7
@@
boolean HitReflectingWalls(int element, int hit_mask)
boolean HitAbsorbingWalls(int element, int hit_mask)
{
boolean HitAbsorbingWalls(int element, int hit_mask)
{
- if (HitOnlyAnEdge(
element,
hit_mask))
+ if (HitOnlyAnEdge(hit_mask))
return FALSE;
if (ABS(XS) == 4 &&
return FALSE;
if (ABS(XS) == 4 &&
@@
-2398,6
+2402,16
@@
static void GrowAmoeba(int x, int y)
}
}
}
}
+static void DrawFieldAnimated_MM(int x, int y)
+{
+ if (IS_BLOCKED(x, y))
+ return;
+
+ DrawField_MM(x, y);
+
+ laser.redraw = TRUE;
+}
+
static void Explode_MM(int x, int y, int phase, int mode)
{
int num_phase = 9, delay = 2;
static void Explode_MM(int x, int y, int phase, int mode)
{
int num_phase = 9, delay = 2;
@@
-2470,7
+2484,7
@@
static void Explode_MM(int x, int y, int phase, int mode)
Store[x][y] = Store2[x][y] = 0;
MovDir[x][y] = MovPos[x][y] = MovDelay[x][y] = 0;
Store[x][y] = Store2[x][y] = 0;
MovDir[x][y] = MovPos[x][y] = MovDelay[x][y] = 0;
- InitField(x, y
, FALSE
);
+ InitField(x, y);
DrawField_MM(x, y);
}
else if (!(phase % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
DrawField_MM(x, y);
}
else if (!(phase % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
@@
-3056,7
+3070,7
@@
void ColorCycling(void)
}
}
}
}
-static void GameActions_MM_Ext(
struct MouseActionInfo action
)
+static void GameActions_MM_Ext(
void
)
{
int element;
int x, y, i;
{
int element;
int x, y, i;
@@
-3084,6
+3098,8
@@
static void GameActions_MM_Ext(struct MouseActionInfo action)
MeltIce(x, y);
else if (IS_WALL_CHANGING(element) && Store[x][y] == EL_WALL_AMOEBA)
GrowAmoeba(x, y);
MeltIce(x, y);
else if (IS_WALL_CHANGING(element) && Store[x][y] == EL_WALL_AMOEBA)
GrowAmoeba(x, y);
+ else
+ DrawFieldAnimated_MM(x, y);
}
AutoRotateMirrors();
}
AutoRotateMirrors();
@@
-3678,7
+3694,7
@@
void GameActions_MM(struct MouseActionInfo action)
boolean element_clicked = ClickElement(action.lx, action.ly, action.button);
boolean button_released = (action.button == MB_RELEASED);
boolean element_clicked = ClickElement(action.lx, action.ly, action.button);
boolean button_released = (action.button == MB_RELEASED);
- GameActions_MM_Ext(
action
);
+ GameActions_MM_Ext();
CheckSingleStepMode_MM(element_clicked, button_released);
}
CheckSingleStepMode_MM(element_clicked, button_released);
}
@@
-3962,7
+3978,7
@@
void RaiseScoreElement_MM(int element)
// Mirror Magic game engine snapshot handling functions
// ----------------------------------------------------------------------------
// Mirror Magic game engine snapshot handling functions
// ----------------------------------------------------------------------------
-void SaveEngineSnapshotValues_MM(
ListNode **buffers
)
+void SaveEngineSnapshotValues_MM(
void
)
{
int x, y;
{
int x, y;