#endif
};
+static Bitmap *bitmap_font_initial = NULL;
+
static void InitSetup(void);
static void InitPlayerInfo(void);
static void InitLevelInfo(void);
InitEventFilter(FilterMouseMotionEvents);
- InitGfx();
InitElementProperties(); /* initializes IS_CHAR() for el2gfx() */
InitElementInfo();
+ InitGfx();
+
InitLevelInfo();
InitLevelArtworkInfo();
+
InitImages(); /* needs to know current level directory */
InitSound(); /* needs to know current level directory */
InitGadgets(); /* needs images + number of level series */
InitGraphicInfo(); /* initialize graphic info from config file */
- InitFontInfo(new_graphic_info[IMG_MENU_FONT_BIG].bitmap,
+ InitFontInfo(bitmap_font_initial,
+ new_graphic_info[IMG_MENU_FONT_BIG].bitmap,
new_graphic_info[IMG_MENU_FONT_MEDIUM].bitmap,
new_graphic_info[IMG_MENU_FONT_SMALL].bitmap,
new_graphic_info[IMG_MENU_FONT_EM].bitmap);
void InitGfx()
{
+#if 0
int i;
+#endif
/* initialize some global variables */
global.frames_per_second = 0;
/* create additional image buffers for double-buffering */
bitmap_db_field = CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH);
bitmap_db_door = CreateBitmap(3 * DXSIZE, DYSIZE + VYSIZE, DEFAULT_DEPTH);
-#if 1
- pix[PIX_DB_FIELD] = bitmap_db_field;
- pix[PIX_DB_DOOR] = bitmap_db_door;
-#endif
+#if 0
pix[PIX_FONT_SMALL] = LoadCustomImage(image_filename[PIX_FONT_SMALL]);
InitFontInfo(NULL, NULL, pix[PIX_FONT_SMALL], NULL);
+#else
+ bitmap_font_initial = LoadCustomImage(image_filename[PIX_FONT_SMALL]);
+
+ InitFontInfo(bitmap_font_initial, NULL, NULL, NULL, NULL);
+#endif
DrawInitText(WINDOW_TITLE_STRING, 20, FC_YELLOW);
DrawInitText(WINDOW_SUBTITLE_STRING, 50, FC_RED);
DrawInitText("Loading graphics:", 120, FC_GREEN);
+#if 0
for (i=0; i<NUM_PICTURES; i++)
{
+#if 0
if (i != PIX_FONT_SMALL)
+#endif
{
DrawInitText(image_filename[i], 150, FC_YELLOW);
pix[i] = LoadCustomImage(image_filename[i]);
}
}
+#endif
+#if 0
InitFontInfo(pix[PIX_FONT_BIG], pix[PIX_FONT_MEDIUM], pix[PIX_FONT_SMALL],
pix[PIX_FONT_EM]);
+#endif
InitTileClipmasks();
}
static boolean last_override_level_graphics = FALSE;
static boolean last_override_level_sounds = FALSE;
static boolean last_override_level_music = FALSE;
-
/* identifier for new artwork; default: artwork configured in setup */
char *gfx_new_identifier = artwork.gfx_current->identifier;
char *snd_new_identifier = artwork.snd_current->identifier;
char *mus_new_identifier = artwork.mus_current->identifier;
+ boolean redraw_screen = FALSE;
+
+ if (leveldir_current_identifier == NULL)
+ leveldir_current_identifier = leveldir_current->identifier;
+
+#if 0
+ printf("CURRENT GFX: '%s' ['%s']\n", artwork.gfx_current->identifier,
+ leveldir_current->graphics_set);
+ printf("CURRENT LEV: '%s' / '%s'\n", leveldir_current_identifier,
+ leveldir_current->identifier);
+#endif
#if 0
printf("graphics --> '%s' ('%s')\n",
if (strcmp(artwork.gfx_current_identifier, gfx_new_identifier) != 0 ||
last_override_level_graphics != setup.override_level_graphics)
{
+#if 0
+ printf("CHANGED GFX: '%s' -> '%s'\n",
+ artwork.gfx_current_identifier, gfx_new_identifier);
+#endif
+
+#if 0
int i;
+#endif
setLevelArtworkDir(artwork.gfx_first);
ClearRectangle(window, 0, 0, WIN_XSIZE, WIN_YSIZE);
+#if 0
for (i=0; i<NUM_PICTURES; i++)
{
DrawInitText(image_filename[i], 150, FC_YELLOW);
ReloadCustomImage(pix[i], image_filename[i]);
}
+#endif
ReinitializeGraphics();
FreeTileClipmasks();
InitTileClipmasks();
+
+#if 0
InitGfxBackground();
/* force redraw of (open or closed) door graphics */
SetDoorState(DOOR_OPEN_ALL);
CloseDoor(DOOR_CLOSE_ALL | DOOR_NO_DELAY);
+#endif
+#if 0
artwork.gfx_current_identifier = gfx_new_identifier;
+#else
+ artwork.gfx_current_identifier = artwork.gfx_current->identifier;
+#endif
last_override_level_graphics = setup.override_level_graphics;
+
+ redraw_screen = TRUE;
}
if (strcmp(artwork.snd_current_identifier, snd_new_identifier) != 0 ||
artwork.snd_current_identifier = snd_new_identifier;
last_override_level_sounds = setup.override_level_sounds;
+
+ redraw_screen = TRUE;
}
if (strcmp(artwork.mus_current_identifier, mus_new_identifier) != 0 ||
artwork.mus_current_identifier = mus_new_identifier;
last_override_level_music = setup.override_level_music;
+
+ redraw_screen = TRUE;
+ }
+
+ if (redraw_screen)
+ {
+ InitGfxBackground();
+
+ /* force redraw of (open or closed) door graphics */
+ SetDoorState(DOOR_OPEN_ALL);
+ CloseDoor(DOOR_CLOSE_ALL | DOOR_NO_DELAY);
}
#if 0
void CloseAllAndExit(int exit_value)
{
+#if 0
int i;
+#endif
StopSounds();
FreeAllSounds();
FreeAllImages();
FreeTileClipmasks();
+#if 0
for (i=0; i<NUM_BITMAPS; i++)
FreeBitmap(pix[i]);
+#endif
+
+ if (bitmap_font_initial)
+ FreeBitmap(bitmap_font_initial);
CloseVideoDisplay();
ClosePlatformDependantStuff();