-#define COMPILE_DATE_STRING "[2002-09-06 18:36]"
+#define COMPILE_DATE_STRING "[2002-09-06 19:21]"
InitGfx();
InitElementProperties(); /* initializes IS_CHAR() for el2gfx() */
InitElementInfo();
- InitGraphicInfo();
InitLevelInfo();
InitLevelArtworkInfo();
/* load custom images */
ReloadCustomImages();
+ InitGraphicInfo();
}
static void InitMixer()
}
ReloadCustomImages();
+ InitGraphicInfo();
FreeTileClipmasks();
InitTileClipmasks();
/* always start with reliable default values */
for(i=0; i<MAX_GRAPHICS; i++)
{
- graphic_info[i].bitmap = pix[PIX_SP]; /* graphic that ... */
- graphic_info[i].src_x = 0; /* ... contains ... */
- graphic_info[i].src_y = 0; /* ... empty space. */
+ graphic_info[i].bitmap = NULL;
+ graphic_info[i].src_x = 0;
+ graphic_info[i].src_y = 0;
graphic_info[i].anim_frames = 1;
graphic_info[i].anim_delay = 0;
graphic_info[i].anim_mode = ANIM_NORMAL;
- }
- for(i=0; i<MAX_GRAPHICS; i++)
getGraphicSource(i, &graphic_info[i].bitmap,
&graphic_info[i].src_x, &graphic_info[i].src_y);
+ }
}
void InitElementProperties()
{ "bd_diamond", "bd_diamond.pcx" },
{ "bd_diamond.frame_xpos", "0" },
{ "bd_diamond.num_frames", "1" },
+ { "robot_wheel", "bd_diamond.pcx" },
+ { "robot_wheel.frame_xpos", "0" },
+ { "robot_wheel.num_frames", "4" },
};
struct ArtworkConfigInfo sound_config[] =
void getGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y)
{
- if (graphic >= GFX_START_ROCKSSCREEN && graphic <= GFX_END_ROCKSSCREEN)
+ if (graphic >= 0 && graphic_info[graphic].bitmap != NULL)
+ {
+ *bitmap = graphic_info[graphic].bitmap;
+ *x = graphic_info[graphic].src_x;
+ *y = graphic_info[graphic].src_y;
+ }
+ else if (graphic >= GFX_START_ROCKSSCREEN && graphic <= GFX_END_ROCKSSCREEN)
{
graphic -= GFX_START_ROCKSSCREEN;
*bitmap = pix[PIX_BACK];
int el2gfx(int element)
{
- int graphic_OLD = el2gfx_OLD(element);
int graphic_NEW = element_info[element].graphic;
+#if DEBUG
+ int graphic_OLD = el2gfx_OLD(element);
+
if (element >= MAX_ELEMENTS)
{
Error(ERR_WARN, "el2gfx: element == %d >= MAX_ELEMENTS", element);
Error(ERR_WARN, "el2gfx: graphic_NEW (%d) != graphic_OLD (%d)",
graphic_NEW, graphic_OLD);
}
+#endif
return graphic_NEW;
}