Version 1.5.0
-------------
- - SDL!!!
+ - can be compiled with SDL library to build native Windows version
- trying to open already busy audio device does not block the game
- fixed network playing bug (patch from web site)
+ - SDL version can load and play music modules
+ - fixed element description in level editor for EM doors and keys
Release Version 1.4.0 [27 OCT 1999]
-----------------------------------
};
#endif
-#ifdef TARGET_X11
+#if defined(TARGET_X11_NATIVE)
static struct
{
int start;
InitFontInfo(pix[PIX_BIGFONT], pix[PIX_MEDIUMFONT], pix[PIX_SMALLFONT]);
+ /* initialize pixmap array for special X11 tile clipping to Pixmap 'None' */
+ for(i=0; i<NUM_TILES; i++)
+ tile_clipmask[i] = None;
+
#if defined(TARGET_X11)
+ /* This stuff is needed because X11 (XSetClipOrigin(), to be precise) is
+ often very slow when preparing a masked XCopyArea() for big Pixmaps.
+ To prevent this, create small (tile-sized) mask Pixmaps which will then
+ be set much faster with XSetClipOrigin() and speed things up a lot. */
+
/* create graphic context structures needed for clipping */
clip_gc_values.graphics_exposures = False;
clip_gc_valuemask = GCGraphicsExposures;
}
}
- /* initialize pixmap array to Pixmap 'None' */
- for(i=0; i<NUM_TILES; i++)
- tile_clipmask[i] = None;
-
+#if defined(TARGET_X11_NATIVE)
/* create only those clipping Pixmaps we really need */
for(i=0; tile_needs_clipping[i].start>=0; i++)
{
src_x, src_y, TILEX, TILEY, 0, 0);
}
}
+#endif /* TARGET_X11_ANTIVE */
#endif /* TARGET_X11 */
}
{
char *process_name = "";
FILE *error = stderr;
+ char *newline = "\n";
/* display warnings only when running in verbose mode */
if (mode & ERR_WARN && !options.verbose)
return;
#if !defined(PLATFORM_UNIX)
+ newline = "\r\n";
+
if ((error = openErrorFile()) == NULL)
{
- printf("Cannot write to error output file!\n");
+ printf("Cannot write to error output file!%s", newline);
program.exit_function(1);
}
#endif
vfprintf(error, format, ap);
va_end(ap);
- fprintf(error, "\n");
+ fprintf(error, "%s", newline);
}
if (mode & ERR_HELP)
- fprintf(error, "%s: Try option '--help' for more information.\n",
- program.command_basename);
+ fprintf(error, "%s: Try option '--help' for more information.%s",
+ program.command_basename, newline);
if (mode & ERR_EXIT)
- fprintf(error, "%s%s: aborting\n", program.command_basename, process_name);
+ fprintf(error, "%s%s: aborting%s",
+ program.command_basename, process_name, newline);
if (error != stderr)
fclose(error);
}
}
-void XMapWindow(Display *display, Window window)
-{
- int x, y;
- unsigned int width, height;
- boolean mouse_off;
-
- x = AllegroDefaultScreen().x;
- y = AllegroDefaultScreen().y;
- width = AllegroDefaultScreen().width;
- height = AllegroDefaultScreen().height;
-
- mouse_off = hide_mouse(display, x, y, width, height);
- blit((BITMAP *)window, video_bitmap, 0, 0, x, y, width, height);
-
- if (mouse_off)
- unhide_mouse(display);
-}
-
-static unsigned long AllocColorCell(int r, int g, int b)
+Pixel AllegroAllocColorCell(int r, int g, int b)
{
byte pixel_mapping = 0;
int i;
if (global_colormap_entries_used < MAX_COLORS)
global_colormap_entries_used++;
+ i = global_colormap_entries_used - 1;
+
global_colormap[i].r = r;
global_colormap[i].g = g;
global_colormap[i].b = b;
+ set_palette(global_colormap);
+
pixel_mapping = i;
}
return pixel_mapping;
}
+void XMapWindow(Display *display, Window window)
+{
+ int x, y;
+ unsigned int width, height;
+ boolean mouse_off;
+
+ x = AllegroDefaultScreen().x;
+ y = AllegroDefaultScreen().y;
+ width = AllegroDefaultScreen().width;
+ height = AllegroDefaultScreen().height;
+
+ mouse_off = hide_mouse(display, x, y, width, height);
+ blit((BITMAP *)window, video_bitmap, 0, 0, x, y, width, height);
+
+ if (mouse_off)
+ unhide_mouse(display);
+}
+
Display *XOpenDisplay(char *display_name)
{
Screen *screen;
screen[0].white_pixel = 0xFF;
screen[0].black_pixel = 0x00;
#else
- screen[0].white_pixel = AllocColorCell(0xFFFF, 0xFFFF, 0xFFFF);
- screen[0].black_pixel = AllocColorCell(0x0000, 0x0000, 0x0000);
+ screen[0].white_pixel = AllegroAllocColorCell(0xFFFF, 0xFFFF, 0xFFFF);
+ screen[0].black_pixel = AllegroAllocColorCell(0x0000, 0x0000, 0x0000);
#endif
screen[0].video_bitmap = NULL;
pixel_mapping[i] = j;
}
#else
- pixel_mapping[i] = AllocColorCell(image->rgb.red[i],
- image->rgb.green[i],
- image->rgb.blue[i]);
+ pixel_mapping[i] = AllegroAllocColorCell(image->rgb.red[i],
+ image->rgb.green[i],
+ image->rgb.blue[i]);
#endif
}
return errno_pcx;
*pixmap = (Pixmap)bitmap;
+#if 0
*pixmap_mask = (Pixmap)bitmap;
+ /* !!! two pointers on same bitmap => second free() fails !!! */
+#else
+ /* pixmap_mask will never be used in Allegro (which uses masked_blit()),
+ so use non-NULL dummy pointer to empty Pixmap */
+ /*
+ *pixmap_mask = (Pixmap)checked_calloc(sizeof(Pixmap));
+ */
+ *pixmap_mask = (Pixmap)DUMMY_MASK;
+#endif
return PCX_Success;
}
freeze_mouse_flag = FALSE;
}
+Pixel AllegroGetPixel(Drawable d, int x, int y)
+{
+ return getpixel((BITMAP *)d, x, y);
+}
+
void MSDOSOpenAudio(void)
{
if (allegro_init_audio())
XKeyEvent xkey;
} XEvent;
+Pixel AllegroAllocColorCell(int, int, int);
+
void XMapWindow(Display *, Window);
Display *XOpenDisplay(char *);
Window XCreateSimpleWindow(Display *, Window, int, int,
void XAutoRepeatOff(Display *);
void AllegroDrawLine(Drawable, int, int, int, int, Pixel);
+Pixel AllegroGetPixel(Drawable, int, int);
void MSDOSOpenAudio(void);
void MSDOSCloseAudio(void);
#if defined(TARGET_SDL)
pixel = SDL_MapRGB(bitmap->surface->format, color_r, color_g, color_b);
+#elif defined(TARGET_ALLEGRO)
+ pixel = AllegroAllocColorCell(color_r << 8, color_g << 8, color_b << 8);
#elif defined(TARGET_X11_NATIVE)
XColor xcolor;
"normal wall (BD style)",
"rock (BD style)",
"open exit",
- "unknown",
+ "black orb bomb",
"amoeba",
"mole", /* 110 */
"penguin",
"arrow down",
"pig",
"fire breathing dragon",
- "unknown",
+ "red key (EM style)",
"letter ' '", /* 120 */
"letter '!'",
"letter '\"'",
"growing wall (horizontal)", /* 200 */
"growing wall (vertical)",
"growing wall (all directions)",
- "unused",
- "unused",
- "unused",
- "unused",
- "unused",
- "unused",
- "unused",
+ "red door (EM style)",
+ "yellow door (EM style)",
+ "green door (EM style)",
+ "blue door (EM style)",
+ "yellow key (EM style)",
+ "green key (EM style)",
+ "blue key (EM style)",
"empty space", /* 210 */
"zonk",
"base",
"hardware",
"chip (upper half)",
"chip (lower half)",
- "unknown", /* 250 */
- "unknown",
- "unknown",
- "unknown",
+ "gray door (EM style, red key)", /* 250 */
+ "gray door (EM style, yellow key)",
+ "gray door (EM style, green key)",
+ "gray door (EM style, blue key)",
"unknown",
"unknown",
DrawTextFCentered(ybottom, FC_BLUE, "Press any key or button for next page");
+#if 0
PlaySoundLoop(background_loop[num]);
+#endif
}
void DrawHelpScreenCreditsText()