void DrawMaskedBorder(int redraw_mask)
{
/* do not draw masked screen borders when displaying title screens */
- if (effectiveGameStatus() == GAME_MODE_TITLE ||
- effectiveGameStatus() == GAME_MODE_MESSAGE)
+ if (effectiveGameStatus() == GAME_MODE_TITLE)
return;
if (redraw_mask & REDRAW_ALL)
int real_preview_xsize = MIN(level_xsize, preview.xsize);
int real_preview_ysize = MIN(level_ysize, preview.ysize);
int dst_x = SX + ALIGNED_XPOS(preview.x, preview_width, preview.align);
- int dst_y = SY + preview.y;
+ int dst_y = SY + ALIGNED_YPOS(preview.y, preview_height, preview.valign);
int x, y;
DrawBackground(dst_x, dst_y, preview_width, preview_height);
struct TextPosInfo *pos = &menu.main.text.level_info_2;
char label_text[MAX_OUTPUT_LINESIZE + 1];
int max_len_label_text;
+#if 1
+ int font_nr = pos->font;
+ int i;
+
+ if (mode == MICROLABEL_LEVEL_AUTHOR_HEAD ||
+ mode == MICROLABEL_IMPORTED_FROM_HEAD ||
+ mode == MICROLABEL_IMPORTED_BY_HEAD)
+ font_nr = pos->font_alt;
+#else
int font_nr = FONT_TEXT_2;
int i;
mode == MICROLABEL_IMPORTED_FROM_HEAD ||
mode == MICROLABEL_IMPORTED_BY_HEAD)
font_nr = FONT_TEXT_3;
+#endif
#if 1
max_len_label_text = getMaxTextLength(pos, font_nr);
int level_ysize = lev_fieldy + (show_level_border ? 2 : 0);
int last_game_status = game_status; /* save current game status */
+#if 0
/* force PREVIEW font on preview level */
game_status = GAME_MODE_PSEUDO_PREVIEW;
+#endif
if (restart)
{
{
struct TextPosInfo *pos = &menu.main.text.level_info_1;
char label_text[MAX_OUTPUT_LINESIZE + 1];
+#if 1
+ int font_nr = pos->font;
+#else
int font_nr = FONT_TEXT_1;
+#endif
#if 1
int max_len_label_text = getMaxTextLength(pos, font_nr);
#else
/* clear door drawing field */
DrawBackground(DX, DY, DXSIZE, DYSIZE);
- /* force DOOR font on preview level */
+ /* force DOOR font inside door area */
game_status = GAME_MODE_PSEUDO_DOOR;
/* write text for request */
static struct Mapping_EM_to_RND_player player_mapping[MAX_PLAYERS][SPR_MAX];
#endif
-void getGraphicSourceExt_EM(int player_nr, int anim, int frame_em,
- Bitmap **src_bitmap, int *src_x, int *src_y)
+void ResetGfxAnimation_EM(int x, int y, int tile)
{
- int element = player_mapping[player_nr][anim].element_rnd;
- int action = player_mapping[player_nr][anim].action;
- int direction = player_mapping[player_nr][anim].direction;
+ GfxFrame[x][y] = 0;
+}
+
+void getGraphicSourceObjectExt_EM(int tile, int frame_em,
+ Bitmap **src_bitmap, int *src_x, int *src_y,
+ int x, int y)
+{
+ int element = object_mapping[tile].element_rnd;
+ int action = object_mapping[tile].action;
+ int direction = object_mapping[tile].direction;
+ boolean is_backside = object_mapping[tile].is_backside;
+ boolean action_removing = (action == ACTION_DIGGING ||
+ action == ACTION_SNAPPING ||
+ action == ACTION_COLLECTING);
+ int effective_element = (frame_em > 0 ? element :
+ is_backside ? EL_EMPTY :
+ action_removing ? EL_EMPTY :
+ element);
+ int graphic = (direction == MV_NONE ?
+ el_act2img(effective_element, action) :
+ el_act_dir2img(effective_element, action, direction));
+ struct GraphicInfo *g = &graphic_info[graphic];
+ int sync_frame;
+
+ if (graphic_info[graphic].anim_global_sync)
+ sync_frame = FrameCounter;
+ else
+ sync_frame = 7 - frame_em;
+
+ SetRandomAnimationValue(x, y);
+
+ int frame = getAnimationFrame(g->anim_frames,
+ g->anim_delay,
+ g->anim_mode,
+ g->anim_start_frame,
+ sync_frame);
+ getGraphicSourceExt(graphic, frame, src_bitmap, src_x, src_y, FALSE);
+}
+
+void getGraphicSourcePlayerExt_EM(int player_nr, int anim, int frame_em,
+ Bitmap **src_bitmap, int *src_x, int *src_y)
+{
+ int element = player_mapping[player_nr][anim].element_rnd;
+ int action = player_mapping[player_nr][anim].action;
+ int direction = player_mapping[player_nr][anim].direction;
int graphic = (direction == MV_NONE ?
el_act2img(element, action) :
el_act_dir2img(element, action, direction));
struct GraphicInfo *g = &graphic_info[graphic];
- // struct GraphicInfo_EM *g_em = &graphic_info_em_player[p][i][7 - j];
- // Bitmap *src_bitmap;
- // int src_x, src_y;
- // int sync_frame = j;
- int sync_frame = 7 - frame_em;
+ int sync_frame;
InitPlayerGfxAnimation(&stored_player[player_nr], action, direction);
+ stored_player[player_nr].StepFrame = 7 - frame_em;
+
+ sync_frame = stored_player[player_nr].Frame;
+
#if 0
printf("::: %d: %d, %d [%d]\n",
player_nr,
FrameCounter);
#endif
- sync_frame = stored_player[player_nr].Frame;
-
int frame = getAnimationFrame(g->anim_frames,
g->anim_delay,
g->anim_mode,
sync_frame);
getGraphicSourceExt(graphic, frame, src_bitmap, src_x, src_y, FALSE);
-
-#if 0
- g_em->bitmap = src_bitmap;
- g_em->src_x = src_x;
- g_em->src_y = src_y;
- g_em->src_offset_x = 0;
- g_em->src_offset_y = 0;
- g_em->dst_offset_x = 0;
- g_em->dst_offset_y = 0;
- g_em->width = TILEX;
- g_em->height = TILEY;
-#endif
}
void InitGraphicInfo_EM(void)
#endif
}
-void PlayMenuSound()
+void PlayMenuSoundExt(int sound)
{
- int sound = menu.sound[game_status];
-
if (sound == SND_UNDEFINED)
return;
PlaySound(sound);
}
+void PlayMenuSound()
+{
+ PlayMenuSoundExt(menu.sound[game_status]);
+}
+
void PlayMenuSoundStereo(int sound, int stereo_position)
{
if (sound == SND_UNDEFINED)
PlaySoundStereo(sound, stereo_position);
}
-void PlayMenuSoundIfLoop()
+void PlayMenuSoundIfLoopExt(int sound)
{
- int sound = menu.sound[game_status];
-
if (sound == SND_UNDEFINED)
return;
PlaySoundLoop(sound);
}
-void PlayMenuMusic()
+void PlayMenuSoundIfLoop()
{
- int music = menu.music[game_status];
+ PlayMenuSoundIfLoopExt(menu.sound[game_status]);
+}
+void PlayMenuMusicExt(int music)
+{
if (music == MUS_UNDEFINED)
return;
PlayMusic(music);
}
+void PlayMenuMusic()
+{
+ PlayMenuMusicExt(menu.music[game_status]);
+}
+
void PlaySoundActivating()
{
#if 0