projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
127f39b
)
added basic game engine integration for Mirror Magic game engine code
author
Holger Schemel
<info@artsoft.org>
Fri, 17 Feb 2017 22:29:43 +0000
(23:29 +0100)
committer
Holger Schemel
<info@artsoft.org>
Fri, 23 Mar 2018 22:21:08 +0000
(23:21 +0100)
src/game.c
patch
|
blob
|
history
src/game.h
patch
|
blob
|
history
src/game_mm/mm_game.c
patch
|
blob
|
history
src/game_mm/mm_game.h
patch
|
blob
|
history
src/game_mm/mm_main.c
patch
|
blob
|
history
diff --git
a/src/game.c
b/src/game.c
index 13f264e8614f3c3a9cde745e95c2de62096dae69..b5eea7d8b71b25c8604b425c0d3bb5be95881b3c 100644
(file)
--- a/
src/game.c
+++ b/
src/game.c
@@
-2150,6
+2150,8
@@
void UpdateGameControlValues()
level.native_em_level->lev->time :
level.game_engine_type == GAME_ENGINE_TYPE_SP ?
level.native_sp_level->game_sp->time_played :
level.native_em_level->lev->time :
level.game_engine_type == GAME_ENGINE_TYPE_SP ?
level.native_sp_level->game_sp->time_played :
+ level.game_engine_type == GAME_ENGINE_TYPE_MM ?
+ game_mm.energy_left :
game.no_time_limit ? TimePlayed : TimeLeft);
int score = (local_player->LevelSolved ?
local_player->LevelSolved_CountingScore :
game.no_time_limit ? TimePlayed : TimeLeft);
int score = (local_player->LevelSolved ?
local_player->LevelSolved_CountingScore :
@@
-2157,16
+2159,23
@@
void UpdateGameControlValues()
level.native_em_level->lev->score :
level.game_engine_type == GAME_ENGINE_TYPE_SP ?
level.native_sp_level->game_sp->score :
level.native_em_level->lev->score :
level.game_engine_type == GAME_ENGINE_TYPE_SP ?
level.native_sp_level->game_sp->score :
+ level.game_engine_type == GAME_ENGINE_TYPE_MM ?
+ game_mm.score :
local_player->score);
int gems = (level.game_engine_type == GAME_ENGINE_TYPE_EM ?
level.native_em_level->lev->required :
level.game_engine_type == GAME_ENGINE_TYPE_SP ?
level.native_sp_level->game_sp->infotrons_still_needed :
local_player->score);
int gems = (level.game_engine_type == GAME_ENGINE_TYPE_EM ?
level.native_em_level->lev->required :
level.game_engine_type == GAME_ENGINE_TYPE_SP ?
level.native_sp_level->game_sp->infotrons_still_needed :
+ level.game_engine_type == GAME_ENGINE_TYPE_MM ?
+ game_mm.kettles_still_needed :
local_player->gems_still_needed);
int exit_closed = (level.game_engine_type == GAME_ENGINE_TYPE_EM ?
level.native_em_level->lev->required > 0 :
level.game_engine_type == GAME_ENGINE_TYPE_SP ?
level.native_sp_level->game_sp->infotrons_still_needed > 0 :
local_player->gems_still_needed);
int exit_closed = (level.game_engine_type == GAME_ENGINE_TYPE_EM ?
level.native_em_level->lev->required > 0 :
level.game_engine_type == GAME_ENGINE_TYPE_SP ?
level.native_sp_level->game_sp->infotrons_still_needed > 0 :
+ level.game_engine_type == GAME_ENGINE_TYPE_MM ?
+ game_mm.kettles_still_needed > 0 ||
+ game_mm.lights_still_needed > 0 :
local_player->gems_still_needed > 0 ||
local_player->sokobanfields_still_needed > 0 ||
local_player->lights_still_needed > 0);
local_player->gems_still_needed > 0 ||
local_player->sokobanfields_still_needed > 0 ||
local_player->lights_still_needed > 0);
@@
-3935,6
+3944,10
@@
void InitGame()
{
InitGameEngine_SP();
}
{
InitGameEngine_SP();
}
+ else if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
+ {
+ InitGameEngine_MM();
+ }
else
{
DrawLevel(REDRAW_FIELD);
else
{
DrawLevel(REDRAW_FIELD);
@@
-4268,7
+4281,10
@@
static void PlayerWins(struct PlayerInfo *player)
player->GameOver = TRUE;
player->score_final = (level.game_engine_type == GAME_ENGINE_TYPE_EM ?
player->GameOver = TRUE;
player->score_final = (level.game_engine_type == GAME_ENGINE_TYPE_EM ?
- level.native_em_level->lev->score : player->score);
+ level.native_em_level->lev->score :
+ level.game_engine_type == GAME_ENGINE_TYPE_MM ?
+ game_mm.score :
+ player->score);
player->LevelSolved_CountingTime = (game.no_time_limit ? TimePlayed :
TimeLeft);
player->LevelSolved_CountingTime = (game.no_time_limit ? TimePlayed :
TimeLeft);
@@
-10834,6
+10850,21
@@
static void CheckLevelTime()
if (game_sp.GameOver) /* game lost */
AllPlayersGone = TRUE;
}
if (game_sp.GameOver) /* game lost */
AllPlayersGone = TRUE;
}
+ else if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
+ {
+ if (game_mm.LevelSolved &&
+ !game_mm.GameOver) /* game won */
+ {
+ PlayerWins(local_player);
+
+ game_mm.GameOver = TRUE;
+
+ AllPlayersGone = TRUE;
+ }
+
+ if (game_mm.GameOver) /* game lost */
+ AllPlayersGone = TRUE;
+ }
if (TimeFrames >= FRAMES_PER_SECOND)
{
if (TimeFrames >= FRAMES_PER_SECOND)
{
@@
-11032,6
+11063,21
@@
void GameActionsExt()
if (game_sp.GameOver) /* game lost */
AllPlayersGone = TRUE;
}
if (game_sp.GameOver) /* game lost */
AllPlayersGone = TRUE;
}
+ else if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
+ {
+ if (game_mm.LevelSolved &&
+ !game_mm.GameOver) /* game won */
+ {
+ PlayerWins(local_player);
+
+ game_mm.GameOver = TRUE;
+
+ AllPlayersGone = TRUE;
+ }
+
+ if (game_mm.GameOver) /* game lost */
+ AllPlayersGone = TRUE;
+ }
if (local_player->LevelSolved && !local_player->LevelSolved_GameEnd)
GameWon();
if (local_player->LevelSolved && !local_player->LevelSolved_GameEnd)
GameWon();
@@
-11214,6
+11260,10
@@
void GameActionsExt()
{
GameActions_SP_Main();
}
{
GameActions_SP_Main();
}
+ else if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
+ {
+ GameActions_MM_Main();
+ }
else
{
GameActions_RND_Main();
else
{
GameActions_RND_Main();
@@
-11300,6
+11350,18
@@
void GameActions_SP_Main()
}
}
}
}
+void GameActions_MM_Main()
+{
+ byte effective_action[MAX_PLAYERS];
+ boolean warp_mode = (tape.playing && tape.warp_forward && !tape.pausing);
+ int i;
+
+ for (i = 0; i < MAX_PLAYERS; i++)
+ effective_action[i] = stored_player[i].effective_action;
+
+ GameActions_MM(effective_action, warp_mode);
+}
+
void GameActions_RND_Main()
{
GameActions_RND();
void GameActions_RND_Main()
{
GameActions_RND();
@@
-14743,6
+14805,8
@@
ListNode *SaveEngineSnapshotBuffers()
SaveEngineSnapshotValues_EM();
if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
SaveEngineSnapshotValues_SP(&buffers);
SaveEngineSnapshotValues_EM();
if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
SaveEngineSnapshotValues_SP(&buffers);
+ if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
+ SaveEngineSnapshotValues_MM(&buffers);
/* save values stored in special snapshot structure */
/* save values stored in special snapshot structure */
@@
-14752,6
+14816,8
@@
ListNode *SaveEngineSnapshotBuffers()
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(engine_snapshot_em));
if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(engine_snapshot_sp));
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(engine_snapshot_em));
if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(engine_snapshot_sp));
+ if (level.game_engine_type == GAME_ENGINE_TYPE_MM)
+ SaveSnapshotBuffer(&buffers, ARGS_ADDRESS_AND_SIZEOF(engine_snapshot_mm));
/* save further RND engine values */
/* save further RND engine values */
@@
-14893,6
+14959,8
@@
void LoadEngineSnapshotValues()
LoadEngineSnapshotValues_EM();
if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
LoadEngineSnapshotValues_SP();
LoadEngineSnapshotValues_EM();
if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
LoadEngineSnapshotValues_SP();
+ if (level.game_engine_type == GAME_ENGINE_TYPE_SP)
+ LoadEngineSnapshotValues_MM();
}
void LoadEngineSnapshotSingle()
}
void LoadEngineSnapshotSingle()
diff --git
a/src/game.h
b/src/game.h
index 70df8a252b0b8de56d3a045a5aa31593710e8963..65e0375a75e9db07ba9dc6dcc0485c291486deaf 100644
(file)
--- a/
src/game.h
+++ b/
src/game.h
@@
-370,6
+370,7
@@
void StartGameActions(boolean, boolean, int);
void GameActions(void);
void GameActions_EM_Main();
void GameActions_SP_Main();
void GameActions(void);
void GameActions_EM_Main();
void GameActions_SP_Main();
+void GameActions_MM_Main();
void GameActions_RND_Main();
void GameActions_RND();
void GameActions_RND_Main();
void GameActions_RND();
diff --git
a/src/game_mm/mm_game.c
b/src/game_mm/mm_game.c
index 5e42ceaaa4160697e4fe06a64c54022ada904f36..9534849f1341077ed8483e1e4a5f9f4a8da9067d 100644
(file)
--- a/
src/game_mm/mm_game.c
+++ b/
src/game_mm/mm_game.c
@@
-21,7
+21,7
@@
#define OVERLOAD_XSIZE ENERGY_XSIZE
#define OVERLOAD_YSIZE MAX_LASER_OVERLOAD
#define OVERLOAD_XSIZE ENERGY_XSIZE
#define OVERLOAD_YSIZE MAX_LASER_OVERLOAD
-/* values for Explode() */
+/* values for Explode
_MM
() */
#define EX_PHASE_START 0
#define EX_NORMAL 0
#define EX_KETTLE 1
#define EX_PHASE_START 0
#define EX_NORMAL 0
#define EX_KETTLE 1
@@
-71,27
+71,15
@@
#define AUTO_ROTATE_DELAY CLICK_DELAY_SHORT
/* forward declaration for internal use */
#define AUTO_ROTATE_DELAY CLICK_DELAY_SHORT
/* forward declaration for internal use */
+static int MovingOrBlocked2Element_MM(int, int);
+static void Bang_MM(int, int);
+static void RaiseScore_MM(int);
+static void RemoveMovingField_MM(int, int);
+static void InitMovingField_MM(int, int, int);
+static void ContinueMoving_MM(int, int);
+static void Moving2Blocked_MM(int, int, int *, int *);
-void GetPlayerConfig()
-{
- if (!audio.sound_available)
- setup.sound = FALSE;
-
- if (!audio.loops_available)
- {
- setup.sound_loops = FALSE;
- setup.sound_music = FALSE;
- }
-
- if (!video.fullscreen_available)
- setup.fullscreen = FALSE;
-
- setup.sound_simple = setup.sound;
-
- SetAudioMode(setup.sound);
-}
-
static int get_element_angle(int element)
{
int element_phase = get_element_phase(element);
static int get_element_angle(int element)
{
int element_phase = get_element_phase(element);
@@
-121,7
+109,7
@@
static int get_mirrored_angle(int laser_angle, int mirror_angle)
return (reflected_angle + 16) % 16;
}
return (reflected_angle + 16) % 16;
}
-
void InitMovDir
(int x, int y)
+
static void InitMovDir_MM
(int x, int y)
{
int element = Feld[x][y];
static int direction[3][4] =
{
int element = Feld[x][y];
static int direction[3][4] =
@@
-222,7
+210,7
@@
static void InitField(int x, int y, boolean init_game)
game_mm.pacman[game_mm.num_pacman].dir = phase + ((phase + 1) % 2) * 2;
game_mm.num_pacman++;
#else
game_mm.pacman[game_mm.num_pacman].dir = phase + ((phase + 1) % 2) * 2;
game_mm.num_pacman++;
#else
- InitMovDir(x, y);
+ InitMovDir
_MM
(x, y);
#endif
}
else if (IS_MCDUFFIN(element) || IS_LASER(element))
#endif
}
else if (IS_MCDUFFIN(element) || IS_LASER(element))
@@
-309,7
+297,7
@@
static void InitLaser()
native_mm_level.laser_blue * 0xFF);
}
native_mm_level.laser_blue * 0xFF);
}
-void InitGame()
+void InitGame
Engine_MM
()
{
int i, x, y;
{
int i, x, y;
@@
-371,9
+359,11
@@
void InitGame()
InitCycleElements();
InitLaser();
InitCycleElements();
InitLaser();
+#if 0
/* copy default game door content to main double buffer */
BlitBitmap(pix[PIX_DOOR], drawto,
DOOR_GFX_PAGEX5, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE, DX, DY);
/* copy default game door content to main double buffer */
BlitBitmap(pix[PIX_DOOR], drawto,
DOOR_GFX_PAGEX5, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE, DX, DY);
+#endif
#if 0
DrawText(DX_LEVEL, DY_LEVEL,
#if 0
DrawText(DX_LEVEL, DY_LEVEL,
@@
-392,25
+382,30
@@
void InitGame()
*/
MapGameButtons();
*/
MapGameButtons();
+#if 0
/* copy actual game door content to door double buffer for OpenDoor() */
BlitBitmap(drawto, pix[PIX_DB_DOOR],
DX, DY, DXSIZE, DYSIZE, DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1);
/* copy actual game door content to door double buffer for OpenDoor() */
BlitBitmap(drawto, pix[PIX_DB_DOOR],
DX, DY, DXSIZE, DYSIZE, DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1);
+#endif
OpenDoor(DOOR_OPEN_ALL);
if (setup.sound_loops)
PlaySoundExt(SND_FUEL, SOUND_MAX_VOLUME, SOUND_MAX_RIGHT, SND_CTRL_PLAY_LOOP);
OpenDoor(DOOR_OPEN_ALL);
if (setup.sound_loops)
PlaySoundExt(SND_FUEL, SOUND_MAX_VOLUME, SOUND_MAX_RIGHT, SND_CTRL_PLAY_LOOP);
+#if 0 // !!! TEMPORARILY DISABLED !!!
for(i=0; i<=game_mm.energy_left; i+=2)
{
if (!setup.sound_loops)
PlaySoundStereo(SND_FUEL, SOUND_MAX_RIGHT);
for(i=0; i<=game_mm.energy_left; i+=2)
{
if (!setup.sound_loops)
PlaySoundStereo(SND_FUEL, SOUND_MAX_RIGHT);
+#if 0
BlitBitmap(pix[PIX_DOOR], drawto,
DOOR_GFX_PAGEX4 + XX_ENERGY,
DOOR_GFX_PAGEY1 + YY_ENERGY + ENERGY_YSIZE - i,
ENERGY_XSIZE, i,
DX_ENERGY, DY_ENERGY + ENERGY_YSIZE - i);
BlitBitmap(pix[PIX_DOOR], drawto,
DOOR_GFX_PAGEX4 + XX_ENERGY,
DOOR_GFX_PAGEY1 + YY_ENERGY + ENERGY_YSIZE - i,
ENERGY_XSIZE, i,
DX_ENERGY, DY_ENERGY + ENERGY_YSIZE - i);
+#endif
redraw_mask |= REDRAW_DOOR_1;
BackToFront();
redraw_mask |= REDRAW_DOOR_1;
BackToFront();
@@
-427,9
+422,12
@@
void InitGame()
if (setup.sound_loops)
StopSound(SND_FUEL);
if (setup.sound_loops)
StopSound(SND_FUEL);
+#endif
+#if 0
if (setup.sound_music && num_bg_loops)
PlayMusic(level_nr % num_bg_loops);
if (setup.sound_music && num_bg_loops)
PlayMusic(level_nr % num_bg_loops);
+#endif
ScanLaser();
}
ScanLaser();
}
@@
-545,7
+543,12
@@
int ScanPixel()
mask_x = (graphic_mask % GFX_PER_LINE) * TILEX + dx;
mask_y = (graphic_mask / GFX_PER_LINE) * TILEY + dy;
mask_x = (graphic_mask % GFX_PER_LINE) * TILEX + dx;
mask_y = (graphic_mask / GFX_PER_LINE) * TILEY + dy;
+#if 1
+ // !!! temporary fix to compile -- change to game graphics !!!
+ pixel = (ReadPixel(drawto, mask_x, mask_y) ? 1 : 0);
+#else
pixel = (ReadPixel(pix[PIX_BACK], mask_x, mask_y) ? 1 : 0);
pixel = (ReadPixel(pix[PIX_BACK], mask_x, mask_y) ? 1 : 0);
+#endif
}
}
else
}
}
else
@@
-1053,7
+1056,7
@@
boolean HitElement(int element, int hit_mask)
return FALSE;
if (IS_MOVING(ELX, ELY) || IS_BLOCKED(ELX, ELY))
return FALSE;
if (IS_MOVING(ELX, ELY) || IS_BLOCKED(ELX, ELY))
- element = MovingOrBlocked2Element(ELX, ELY);
+ element = MovingOrBlocked2Element
_MM
(ELX, ELY);
#if 0
printf("HitElement (1): element == %d\n", element);
#if 0
printf("HitElement (1): element == %d\n", element);
@@
-1242,10
+1245,10
@@
boolean HitElement(int element, int hit_mask)
IS_PACMAN(element))
{
if (!IS_PACMAN(element))
IS_PACMAN(element))
{
if (!IS_PACMAN(element))
- Bang(ELX, ELY);
+ Bang
_MM
(ELX, ELY);
if (element == EL_PACMAN)
if (element == EL_PACMAN)
- Bang(ELX, ELY);
+ Bang
_MM
(ELX, ELY);
if (element == EL_KETTLE || element == EL_CELL)
{
if (element == EL_KETTLE || element == EL_CELL)
{
@@
-1254,7
+1257,7
@@
boolean HitElement(int element, int hit_mask)
DrawText(DX_KETTLES, DY_KETTLES,
int2str(--game_mm.kettles_still_needed, 3), FONT_TEXT_2);
#endif
DrawText(DX_KETTLES, DY_KETTLES,
int2str(--game_mm.kettles_still_needed, 3), FONT_TEXT_2);
#endif
- RaiseScore(10);
+ RaiseScore
_MM
(10);
if (game_mm.kettles_still_needed == 0)
{
if (game_mm.kettles_still_needed == 0)
{
@@
-1301,11
+1304,11
@@
boolean HitElement(int element, int hit_mask)
else if (element == EL_KEY)
game_mm.num_keys++;
else if (element == EL_LIGHTBALL)
else if (element == EL_KEY)
game_mm.num_keys++;
else if (element == EL_LIGHTBALL)
- RaiseScore(10);
+ RaiseScore
_MM
(10);
else if (IS_PACMAN(element))
{
DeletePacMan(ELX, ELY);
else if (IS_PACMAN(element))
{
DeletePacMan(ELX, ELY);
- RaiseScore(50);
+ RaiseScore
_MM
(50);
}
return FALSE;
}
return FALSE;
@@
-1611,7
+1614,7
@@
boolean HitBlock(int element, int hit_mask)
hit_mask == HIT_MASK_RIGHT));
AddLaserEdge(LX, LY);
hit_mask == HIT_MASK_RIGHT));
AddLaserEdge(LX, LY);
- Bang(ELX, ELY);
+ Bang
_MM
(ELX, ELY);
game_mm.num_keys--;
if (element == EL_GATE_STONE && Box[ELX][ELY])
game_mm.num_keys--;
if (element == EL_GATE_STONE && Box[ELX][ELY])
@@
-2153,7
+2156,7
@@
void GrowAmoeba(int x, int y)
}
}
}
}
-
void Explode
(int x, int y, int phase, int mode)
+
static void Explode_MM
(int x, int y, int phase, int mode)
{
int num_phase = 9, delay = 2;
int last_phase = num_phase * delay;
{
int num_phase = 9, delay = 2;
int last_phase = num_phase * delay;
@@
-2171,8
+2174,8
@@
void Explode(int x, int y, int phase, int mode)
if (IS_MOVING(x, y) || IS_BLOCKED(x, y))
{
/* put moving element to center field (and let it explode there) */
if (IS_MOVING(x, y) || IS_BLOCKED(x, y))
{
/* put moving element to center field (and let it explode there) */
- center_element = MovingOrBlocked2Element(x, y);
- RemoveMovingField(x, y);
+ center_element = MovingOrBlocked2Element
_MM
(x, y);
+ RemoveMovingField
_MM
(x, y);
Feld[x][y] = center_element;
}
Feld[x][y] = center_element;
}
@@
-2210,7
+2213,7
@@
void Explode(int x, int y, int phase, int mode)
DrawLaser(0, DL_LASER_DISABLED);
laser.num_edges = 0;
DrawLaser(0, DL_LASER_DISABLED);
laser.num_edges = 0;
- Bang(laser.start_edge.x, laser.start_edge.y);
+ Bang
_MM
(laser.start_edge.x, laser.start_edge.y);
Store[x][y] = EL_EMPTY;
}
else if (IS_MCDUFFIN(Store[x][y]))
Store[x][y] = EL_EMPTY;
}
else if (IS_MCDUFFIN(Store[x][y]))
@@
-2263,7
+2266,7
@@
void Explode(int x, int y, int phase, int mode)
}
}
}
}
-
void Bang
(int x, int y)
+
static void Bang_MM
(int x, int y)
{
int element = Feld[x][y];
int mode = EX_NORMAL;
{
int element = Feld[x][y];
int mode = EX_NORMAL;
@@
-2297,7
+2300,7
@@
void Bang(int x, int y)
else
PlaySoundStereo((mode == EX_SHORT ? SND_WHOOSH : SND_KABUMM), ST(x));
else
PlaySoundStereo((mode == EX_SHORT ? SND_WHOOSH : SND_KABUMM), ST(x));
- Explode(x, y, EX_PHASE_START, mode);
+ Explode
_MM
(x, y, EX_PHASE_START, mode);
}
void TurnRound(int x, int y)
}
void TurnRound(int x, int y)
@@
-2372,7
+2375,7
@@
void TurnRound(int x, int y)
}
}
}
}
-
void StartMoving
(int x, int y)
+
static void StartMoving_MM
(int x, int y)
{
int element = Feld[x][y];
{
int element = Feld[x][y];
@@
-2393,7
+2396,7
@@
void StartMoving(int x, int y)
/* now make next step */
/* now make next step */
- Moving2Blocked
(x, y, &newx, &newy);
/* get next screen position */
+ Moving2Blocked
_MM(x, y, &newx, &newy);
/* get next screen position */
if (element == EL_PACMAN &&
IN_LEV_FIELD(newx, newy) && IS_EATABLE4PACMAN(Feld[newx][newy]) &&
if (element == EL_PACMAN &&
IN_LEV_FIELD(newx, newy) && IS_EATABLE4PACMAN(Feld[newx][newy]) &&
@@
-2413,14
+2416,14
@@
void StartMoving(int x, int y)
return;
}
return;
}
- InitMovingField(x, y, MovDir[x][y]);
+ InitMovingField
_MM
(x, y, MovDir[x][y]);
}
if (MovDir[x][y])
}
if (MovDir[x][y])
- ContinueMoving(x, y);
+ ContinueMoving
_MM
(x, y);
}
}
-
void ContinueMoving
(int x, int y)
+
static void ContinueMoving_MM
(int x, int y)
{
int element = Feld[x][y];
int direction = MovDir[x][y];
{
int element = Feld[x][y];
int direction = MovDir[x][y];
@@
-2451,7
+2454,7
@@
void ContinueMoving(int x, int y)
if (element == EL_PACMAN)
{
if (Store[newx][newy] == EL_BOMB)
if (element == EL_PACMAN)
{
if (Store[newx][newy] == EL_BOMB)
- Bang(newx, newy);
+ Bang
_MM
(newx, newy);
if (IS_WALL_AMOEBA(Store[newx][newy]) &&
(LX + 2 * XS) / TILEX == newx &&
if (IS_WALL_AMOEBA(Store[newx][newy]) &&
(LX + 2 * XS) / TILEX == newx &&
@@
-2556,8
+2559,8
@@
void ClickElement(int mx, int my, int button)
}
else if (element == EL_LIGHTBALL)
{
}
else if (element == EL_LIGHTBALL)
{
- Bang(x, y);
- RaiseScore(10);
+ Bang
_MM
(x, y);
+ RaiseScore
_MM
(10);
DrawLaser(0, DL_LASER_ENABLED);
}
DrawLaser(0, DL_LASER_ENABLED);
}
@@
-2721,7
+2724,7
@@
void DeletePacMan(int px, int py)
{
int i, j;
{
int i, j;
- Bang(px, py);
+ Bang
_MM
(px, py);
if (game_mm.num_pacman <= 1)
{
if (game_mm.num_pacman <= 1)
{
@@
-2786,7
+2789,7
@@
void ColorCycling(void)
}
}
}
}
-void GameActions
(
)
+void GameActions
_MM(byte action[MAX_PLAYERS], boolean warp_mode
)
{
static unsigned int action_delay = 0;
static unsigned int pacman_delay = 0;
{
static unsigned int action_delay = 0;
static unsigned int pacman_delay = 0;
@@
-2819,11
+2822,11
@@
void GameActions()
element = Feld[x][y];
if (!IS_MOVING(x, y) && CAN_MOVE(element))
element = Feld[x][y];
if (!IS_MOVING(x, y) && CAN_MOVE(element))
- StartMoving(x, y);
+ StartMoving
_MM
(x, y);
else if (IS_MOVING(x, y))
else if (IS_MOVING(x, y))
- ContinueMoving(x, y);
+ ContinueMoving
_MM
(x, y);
else if (IS_EXPLODING(element))
else if (IS_EXPLODING(element))
- Explode(x, y, Frame[x][y], EX_NORMAL);
+ Explode
_MM
(x, y, Frame[x][y], EX_NORMAL);
else if (element == EL_EXIT_OPENING)
OpenExit(x, y);
else if (element == EL_GRAY_BALL_OPENING)
else if (element == EL_EXIT_OPENING)
OpenExit(x, y);
else if (element == EL_GRAY_BALL_OPENING)
@@
-2839,7
+2842,7
@@
void GameActions()
#if 1
/* !!! CHANGE THIS: REDRAW ONLY WHEN NEEDED !!! */
#if 1
/* !!! CHANGE THIS: REDRAW ONLY WHEN NEEDED !!! */
- /* redraw after Explode() ... */
+ /* redraw after Explode
_MM
() ... */
if (laser.redraw)
DrawLaser(0, DL_LASER_ENABLED);
laser.redraw = FALSE;
if (laser.redraw)
DrawLaser(0, DL_LASER_ENABLED);
laser.redraw = FALSE;
@@
-2863,10
+2866,12
@@
void GameActions()
game_mm.energy_left--;
if (game_mm.energy_left >= 0)
{
game_mm.energy_left--;
if (game_mm.energy_left >= 0)
{
+#if 0
BlitBitmap(pix[PIX_DOOR], drawto,
DOOR_GFX_PAGEX5 + XX_ENERGY, DOOR_GFX_PAGEY1 + YY_ENERGY,
ENERGY_XSIZE, ENERGY_YSIZE - game_mm.energy_left,
DX_ENERGY, DY_ENERGY);
BlitBitmap(pix[PIX_DOOR], drawto,
DOOR_GFX_PAGEX5 + XX_ENERGY, DOOR_GFX_PAGEY1 + YY_ENERGY,
ENERGY_XSIZE, ENERGY_YSIZE - game_mm.energy_left,
DX_ENERGY, DY_ENERGY);
+#endif
redraw_mask |= REDRAW_DOOR_1;
}
else if (setup.time_limit)
redraw_mask |= REDRAW_DOOR_1;
}
else if (setup.time_limit)
@@
-2978,6
+2983,7
@@
void GameActions()
if (laser.overloaded)
{
if (laser.overloaded)
{
+#if 0
BlitBitmap(pix[PIX_DOOR], drawto,
DOOR_GFX_PAGEX4 + XX_OVERLOAD,
DOOR_GFX_PAGEY1 + YY_OVERLOAD + OVERLOAD_YSIZE
BlitBitmap(pix[PIX_DOOR], drawto,
DOOR_GFX_PAGEX4 + XX_OVERLOAD,
DOOR_GFX_PAGEY1 + YY_OVERLOAD + OVERLOAD_YSIZE
@@
-2985,14
+2991,17
@@
void GameActions()
OVERLOAD_XSIZE, laser.overload_value,
DX_OVERLOAD, DY_OVERLOAD + OVERLOAD_YSIZE
- laser.overload_value);
OVERLOAD_XSIZE, laser.overload_value,
DX_OVERLOAD, DY_OVERLOAD + OVERLOAD_YSIZE
- laser.overload_value);
+#endif
redraw_mask |= REDRAW_DOOR_1;
}
else
{
redraw_mask |= REDRAW_DOOR_1;
}
else
{
+#if 0
BlitBitmap(pix[PIX_DOOR], drawto,
DOOR_GFX_PAGEX5 + XX_OVERLOAD, DOOR_GFX_PAGEY1 + YY_OVERLOAD,
OVERLOAD_XSIZE, OVERLOAD_YSIZE - laser.overload_value,
DX_OVERLOAD, DY_OVERLOAD);
BlitBitmap(pix[PIX_DOOR], drawto,
DOOR_GFX_PAGEX5 + XX_OVERLOAD, DOOR_GFX_PAGEY1 + YY_OVERLOAD,
OVERLOAD_XSIZE, OVERLOAD_YSIZE - laser.overload_value,
DX_OVERLOAD, DY_OVERLOAD);
+#endif
redraw_mask |= REDRAW_DOOR_1;
}
redraw_mask |= REDRAW_DOOR_1;
}
@@
-3049,17
+3058,17
@@
void GameActions()
laser.num_edges = 0;
#endif
laser.num_edges = 0;
#endif
- Bang(ELX, ELY);
+ Bang
_MM
(ELX, ELY);
laser.dest_element = EL_EXPLODING_OPAQUE;
#if 0
laser.dest_element = EL_EXPLODING_OPAQUE;
#if 0
- Bang(ELX, ELY);
+ Bang
_MM
(ELX, ELY);
laser.num_damages--;
DrawLaser(0, DL_LASER_DISABLED);
laser.num_edges = 0;
laser.num_damages--;
DrawLaser(0, DL_LASER_DISABLED);
laser.num_edges = 0;
- Bang(laser.start_edge.x, laser.start_edge.y);
+ Bang
_MM
(laser.start_edge.x, laser.start_edge.y);
if (Request("Bomb killed Mc Duffin ! Play it again ?",
REQ_ASK | REQ_STAY_CLOSED))
if (Request("Bomb killed Mc Duffin ! Play it again ?",
REQ_ASK | REQ_STAY_CLOSED))
@@
-3144,11
+3153,13
@@
void GameActions()
int x = RND(26);
int y = RND(26);
int x = RND(26);
int y = RND(26);
+#if 0
BlitBitmap(pix[PIX_BACK], drawto,
SX + (graphic % GFX_PER_LINE) * TILEX + x,
SY + (graphic / GFX_PER_LINE) * TILEY + y, 6, 6,
SX + ELX * TILEX + x,
SY + ELY * TILEY + y);
BlitBitmap(pix[PIX_BACK], drawto,
SX + (graphic % GFX_PER_LINE) * TILEX + x,
SY + (graphic / GFX_PER_LINE) * TILEY + y, 6, 6,
SX + ELX * TILEX + x,
SY + ELY * TILEY + y);
+#endif
MarkTileDirty(ELX, ELY);
BackToFront();
MarkTileDirty(ELX, ELY);
BackToFront();
@@
-3440,11
+3451,13
@@
void GameActions()
{
for(i=game_mm.energy_left; i<=MAX_LASER_ENERGY; i+=2)
{
{
for(i=game_mm.energy_left; i<=MAX_LASER_ENERGY; i+=2)
{
+#if 0
BlitBitmap(pix[PIX_DOOR], drawto,
DOOR_GFX_PAGEX4 + XX_ENERGY,
DOOR_GFX_PAGEY1 + YY_ENERGY + ENERGY_YSIZE - i,
ENERGY_XSIZE, i, DX_ENERGY,
DY_ENERGY + ENERGY_YSIZE - i);
BlitBitmap(pix[PIX_DOOR], drawto,
DOOR_GFX_PAGEX4 + XX_ENERGY,
DOOR_GFX_PAGEY1 + YY_ENERGY + ENERGY_YSIZE - i,
ENERGY_XSIZE, i, DX_ENERGY,
DY_ENERGY + ENERGY_YSIZE - i);
+#endif
redraw_mask |= REDRAW_DOOR_1;
BackToFront();
redraw_mask |= REDRAW_DOOR_1;
BackToFront();
@@
-3528,9
+3541,17
@@
void MovePacMen()
for(i=1; i<33; i+=2)
{
for(i=1; i<33; i+=2)
{
+#if 1
+ // !!! temporary fix to compile -- change to game graphics !!!
+ BlitBitmap(drawto, window,
+ SX + g * TILEX, SY + 4 * TILEY, TILEX, TILEY,
+ ox + i * mx, oy + i * my);
+#else
BlitBitmap(pix[PIX_BACK], window,
SX + g * TILEX, SY + 4 * TILEY, TILEX, TILEY,
ox + i * mx, oy + i * my);
BlitBitmap(pix[PIX_BACK], window,
SX + g * TILEX, SY + 4 * TILEY, TILEX, TILEY,
ox + i * mx, oy + i * my);
+#endif
+
#if 0
FlushDisplay();
Delay(1);
#if 0
FlushDisplay();
Delay(1);
@@
-3568,7
+3589,7
@@
void MovePacMen()
}
}
}
}
-void GameWon()
+void GameWon
_MM
()
{
int hi_pos;
boolean raise_level = FALSE;
{
int hi_pos;
boolean raise_level = FALSE;
@@
-3592,18
+3613,20
@@
void GameWon()
/*
if (game_mm.energy_left > 0 && !(game_mm.energy_left % 10))
/*
if (game_mm.energy_left > 0 && !(game_mm.energy_left % 10))
- RaiseScore(native_mm_level.score[SC_ZEITBONUS]);
+ RaiseScore
_MM
(native_mm_level.score[SC_ZEITBONUS]);
*/
*/
- RaiseScore(5);
+ RaiseScore
_MM
(5);
game_mm.energy_left--;
if (game_mm.energy_left >= 0)
{
game_mm.energy_left--;
if (game_mm.energy_left >= 0)
{
+#if 0
BlitBitmap(pix[PIX_DOOR], drawto,
DOOR_GFX_PAGEX5 + XX_ENERGY, DOOR_GFX_PAGEY1 + YY_ENERGY,
ENERGY_XSIZE, ENERGY_YSIZE - game_mm.energy_left,
DX_ENERGY, DY_ENERGY);
BlitBitmap(pix[PIX_DOOR], drawto,
DOOR_GFX_PAGEX5 + XX_ENERGY, DOOR_GFX_PAGEY1 + YY_ENERGY,
ENERGY_XSIZE, ENERGY_YSIZE - game_mm.energy_left,
DX_ENERGY, DY_ENERGY);
+#endif
redraw_mask |= REDRAW_DOOR_1;
}
redraw_mask |= REDRAW_DOOR_1;
}
@@
-3624,7
+3647,7
@@
void GameWon()
if (!setup.sound_loops)
PlaySoundStereo(SND_SIRR, SOUND_MAX_RIGHT);
if (TimePlayed < 999 && !(TimePlayed % 10))
if (!setup.sound_loops)
PlaySoundStereo(SND_SIRR, SOUND_MAX_RIGHT);
if (TimePlayed < 999 && !(TimePlayed % 10))
- RaiseScore(native_mm_level.score[SC_ZEITBONUS]);
+ RaiseScore
_MM
(native_mm_level.score[SC_ZEITBONUS]);
if (TimePlayed < 900 && !(TimePlayed % 10))
TimePlayed += 10;
else
if (TimePlayed < 900 && !(TimePlayed % 10))
TimePlayed += 10;
else
@@
-3661,7
+3684,7
@@
void GameWon()
else if (level_nr < leveldir_current->last_level)
raise_level = TRUE; /* advance to next level */
else if (level_nr < leveldir_current->last_level)
raise_level = TRUE; /* advance to next level */
- if ((hi_pos = NewHiScore()) >= 0)
+ if ((hi_pos = NewHiScore
_MM
()) >= 0)
{
game_status = HALLOFFAME;
// DrawHallOfFame(hi_pos);
{
game_status = HALLOFFAME;
// DrawHallOfFame(hi_pos);
@@
-3679,7
+3702,7
@@
void GameWon()
BackToFront();
}
BackToFront();
}
-int NewHiScore()
+int NewHiScore
_MM
()
{
int k, l;
int position = -1;
{
int k, l;
int position = -1;
@@
-3739,7
+3762,7
@@
int NewHiScore()
return position;
}
return position;
}
-
void InitMovingField
(int x, int y, int direction)
+
static void InitMovingField_MM
(int x, int y, int direction)
{
int newx = x + (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0);
int newy = y + (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0);
{
int newx = x + (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0);
int newy = y + (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0);
@@
-3750,7
+3773,7
@@
void InitMovingField(int x, int y, int direction)
Feld[newx][newy] = EL_BLOCKED;
}
Feld[newx][newy] = EL_BLOCKED;
}
-
void Moving2Blocked
(int x, int y, int *goes_to_x, int *goes_to_y)
+
static void Moving2Blocked_MM
(int x, int y, int *goes_to_x, int *goes_to_y)
{
int direction = MovDir[x][y];
int newx = x + (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0);
{
int direction = MovDir[x][y];
int newx = x + (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0);
@@
-3760,7
+3783,8
@@
void Moving2Blocked(int x, int y, int *goes_to_x, int *goes_to_y)
*goes_to_y = newy;
}
*goes_to_y = newy;
}
-void Blocked2Moving(int x, int y, int *comes_from_x, int *comes_from_y)
+static void Blocked2Moving_MM(int x, int y,
+ int *comes_from_x, int *comes_from_y)
{
int oldx = x, oldy = y;
int direction = MovDir[x][y];
{
int oldx = x, oldy = y;
int direction = MovDir[x][y];
@@
-3778,7
+3802,7
@@
void Blocked2Moving(int x, int y, int *comes_from_x, int *comes_from_y)
*comes_from_y = oldy;
}
*comes_from_y = oldy;
}
-
int MovingOrBlocked2Element
(int x, int y)
+
static int MovingOrBlocked2Element_MM
(int x, int y)
{
int element = Feld[x][y];
{
int element = Feld[x][y];
@@
-3786,7
+3810,7
@@
int MovingOrBlocked2Element(int x, int y)
{
int oldx, oldy;
{
int oldx, oldy;
- Blocked2Moving(x, y, &oldx, &oldy);
+ Blocked2Moving
_MM
(x, y, &oldx, &oldy);
return Feld[oldx][oldy];
}
else
return Feld[oldx][oldy];
}
else
@@
-3803,7
+3827,7
@@
static void RemoveField(int x, int y)
}
#endif
}
#endif
-
void RemoveMovingField
(int x, int y)
+
static void RemoveMovingField_MM
(int x, int y)
{
int oldx = x, oldy = y, newx = x, newy = y;
{
int oldx = x, oldy = y, newx = x, newy = y;
@@
-3812,13
+3836,13
@@
void RemoveMovingField(int x, int y)
if (IS_MOVING(x, y))
{
if (IS_MOVING(x, y))
{
- Moving2Blocked(x, y, &newx, &newy);
+ Moving2Blocked
_MM
(x, y, &newx, &newy);
if (Feld[newx][newy] != EL_BLOCKED)
return;
}
else if (Feld[x][y] == EL_BLOCKED)
{
if (Feld[newx][newy] != EL_BLOCKED)
return;
}
else if (Feld[x][y] == EL_BLOCKED)
{
- Blocked2Moving(x, y, &oldx, &oldy);
+ Blocked2Moving
_MM
(x, y, &oldx, &oldy);
if (!IS_MOVING(oldx, oldy))
return;
}
if (!IS_MOVING(oldx, oldy))
return;
}
@@
-3870,7
+3894,7
@@
void PlaySoundLevel(int x, int y, int sound_nr)
PlaySoundExt(sound_nr, volume, stereo, SND_CTRL_PLAY_SOUND);
}
PlaySoundExt(sound_nr, volume, stereo, SND_CTRL_PLAY_SOUND);
}
-
void RaiseScore
(int value)
+
static void RaiseScore_MM
(int value)
{
game_mm.score += value;
#if 0
{
game_mm.score += value;
#if 0
@@
-3879,15
+3903,15
@@
void RaiseScore(int value)
#endif
}
#endif
}
-void RaiseScoreElement(int element)
+void RaiseScoreElement
_MM
(int element)
{
switch(element)
{
case EL_PACMAN:
{
switch(element)
{
case EL_PACMAN:
- RaiseScore(native_mm_level.score[SC_PACMAN]);
+ RaiseScore
_MM
(native_mm_level.score[SC_PACMAN]);
break;
case EL_KEY:
break;
case EL_KEY:
- RaiseScore(native_mm_level.score[SC_KEY]);
+ RaiseScore
_MM
(native_mm_level.score[SC_KEY]);
break;
default:
break;
break;
default:
break;
diff --git
a/src/game_mm/mm_game.h
b/src/game_mm/mm_game.h
index 2098506f85a9b1bda94da5d4ff14cb3d18a3b0af..75edb4294788b1b88dc749aec1c89bd913be482b 100644
(file)
--- a/
src/game_mm/mm_game.h
+++ b/
src/game_mm/mm_game.h
@@
-32,7
+32,7
@@
void InitGame(void);
void InitMovDir(int, int);
void InitAmoebaNr(int, int);
void GameWon(void);
void InitMovDir(int, int);
void InitAmoebaNr(int, int);
void GameWon(void);
-int NewHiScore(void);
+int NewHiScore
_MM
(void);
void InitMovingField(int, int, int);
void Moving2Blocked(int, int, int *, int *);
void Blocked2Moving(int, int, int *, int *);
void InitMovingField(int, int, int);
void Moving2Blocked(int, int, int *, int *);
void Blocked2Moving(int, int, int *, int *);
diff --git
a/src/game_mm/mm_main.c
b/src/game_mm/mm_main.c
index 44ca0ad0830c88b252b1d8b57a2a786552183068..bdca42f63632409c1fa41e0d457a5590a5d6af0a 100644
(file)
--- a/
src/game_mm/mm_main.c
+++ b/
src/game_mm/mm_main.c
@@
-22,8
+22,12
@@
short Hit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
short Box[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
short Angle[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
short Box[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
short Angle[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+short Frame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+
unsigned int Elementeigenschaften[MAX_ELEMENTS];
unsigned int Elementeigenschaften[MAX_ELEMENTS];
+struct LaserInfo laser;
+
short LX,LY, XS,YS, ELX,ELY;
short CT,Ct;
short LX,LY, XS,YS, ELX,ELY;
short CT,Ct;