$(CONFIG_SCORE_ENTRIES) $(XPM_INCLUDE_FILE)
# DEBUG = -DDEBUG -g -Wall -ansi -pedantic
-DEBUG = -DDEBUG -g -Wall
+# DEBUG = -DDEBUG -g -Wall
# DEBUG = -O3 -Wall -ansi -pedantic
-# DEBUG = -O3 -Wall
+DEBUG = -O3 -Wall
# DEBUG = -O3
# SYSTEM = -Aa -D_HPUX_SOURCE -Dhpux # for HP-UX (obsolete)
};
#endif
+#ifdef DEBUG
+#if 0
+ static struct PictureFileInfo test_pic1 =
+ {
+ "RocksFont2",
+ FALSE
+ };
+ static struct PictureFileInfo test_pic2 =
+ {
+ "mouse",
+ FALSE
+ };
+#endif
+#endif
+
static struct
{
int start;
debug_print_timestamp(0, NULL); /* initialize timestamp function */
#endif
+#ifdef DEBUG
+#if 0
+ printf("Test: Loading RocksFont2.pcx ...\n");
+ LoadGfx(PIX_SMALLFONT,&test_pic1);
+ printf("Test: Done.\n");
+ printf("Test: Loading mouse.pcx ...\n");
+ LoadGfx(PIX_SMALLFONT,&test_pic2);
+ printf("Test: Done.\n");
+#endif
+#endif
+
+
+
LoadGfx(PIX_SMALLFONT,&pic[PIX_SMALLFONT]);
DrawInitText(WINDOW_TITLE_STRING,20,FC_YELLOW);
DrawInitText(COPYRIGHT_STRING,50,FC_RED);
display->screens[display->default_screen].height = YRES;
set_mouse_sprite(display->mouse_ptr);
+
+#if 0
+ set_mouse_sprite_focus(1, 1);
+#endif
+
set_mouse_speed(1, 1);
set_mouse_range(display->screens[display->default_screen].x + 1,
display->screens[display->default_screen].y + 1,
/* read the graphic file in PCX format to internal image structure */
if ((image = Read_PCX_to_Image(filename)) == NULL)
+ {
+ Error(ERR_RETURN, "Read_PCX_to_Image failed");
return NULL;
+ }
/* convert internal image structure to allegro bitmap structure */
if ((bitmap = Image_to_AllegroBitmap(image)) == NULL)
+ {
+ Error(ERR_RETURN, "Image_to_AllegroBitmap failed");
return NULL;
+ }
set_palette(global_colormap);
file_length = ftell(file);
rewind(file);
- if (file_length < PCX_HEADER_SIZE + PCX_COLORMAP_SIZE)
+ if (file_length < PCX_HEADER_SIZE)
{
+ /* PCX file is too short to contain a valid PCX header */
fclose(file);
return NULL;
}
filename, pcx.xmax, pcx.ymax,
pcx.color_planes);
printf("depth: %d\n", pcx.bits_per_pixel);
+ printf("color_planes: %d\n", pcx.color_planes);
printf("bytes_per_line: %d\n", pcx.bytes_per_line);
printf("palette type: %s\n",
(pcx.palette_type == 1 ? "color" :
return NULL;
}
+ if (file_length < PCX_HEADER_SIZE + PCX_COLORMAP_SIZE)
+ {
+ /* PCX file is too short to contain a valid 256 colors colormap */
+ fclose(file);
+ return NULL;
+ }
+
/* read colormap data */
if (!PCX_ReadColormap(image, buffer_ptr, buffer_last))
{