-Release Version 2.0.1 [?? ??? 2002]
+Release Version 2.0.1 [19 MAR 2002]
-----------------------------------
- bug in explosion code fixed that broke level 24 of "Baby Ghost Mine"
- several Supaplex emulation bugs fixed (thanks to Mihail Milushev):
- /dev/dsp support for NetBSD added (thanks to Krister Walfridsson)
- file permissions when saving files and creating directories changed
- some small sound bugs fixed
+ - added new contributed levels from the following players:
+ + Arno Luppold
+ + Barak Shacked
+ + Ben Braithwaite
+ + Dominik Seichter
+ + Emilio Hemken
+ + Glenn Alexander
+ + Helge Hafting
+ + Paul Sutton
Release Version 2.0.0 [01 JAN 2001]
-----------------------------------
dist-clean:
@$(MAKE_CMD) dist-clean
-dist: dist-unix dist-msdos dist-win32
+dist-build-all:
+ $(MAKE) clean
+ @BUILD_DIST=TRUE $(MAKE) x11 ; $(MAKE) dist-clean
+ @BUILD_DIST=TRUE $(MAKE) cross-win32 ; $(MAKE) dist-clean
+ @BUILD_DIST=TRUE $(MAKE) cross-msdos ; $(MAKE) dist-clean
+
+dist-all: dist-build-all dist-unix dist-msdos dist-win32
depend dep:
$(MAKE_CMD) depend
# OPTIONS = -O3
# OPTIONS = -DSYSV -Ae # may be needed for HP-UX
+ifdef BUILD_DIST # distribution build
+OPTIONS = -O3 -Wall
+endif
+
CFLAGS = $(OPTIONS) $(SYS_CFLAGS) $(CONFIG)
LDFLAGS = $(SYS_LDFLAGS) $(EXTRA_LDFLAGS) -lm
#ifndef S_IXOTH
#define S_IXOTH S_IXUSR
#endif
+#ifndef S_IRWXG
+#define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP)
+#endif
+#ifndef S_ISGID
+#define S_ISGID 0
+#endif
#endif /* PLATFORM_WIN32 */
/* file permissions for newly written files */
return getUserDataDir();
}
-void createDirectory(char *dir, char *text, int permission_class)
+static mode_t posix_umask(mode_t mask)
{
#if defined(PLATFORM_UNIX)
+ return umask(mask);
+#else
+ return 0;
+#endif
+}
+
+static int posix_mkdir(const char *pathname, mode_t mode)
+{
+#if defined(PLATFORM_WIN32)
+ return mkdir(pathname);
+#else
+ return mkdir(pathname, mode);
+#endif
+}
+
+void createDirectory(char *dir, char *text, int permission_class)
+{
/* leave "other" permissions in umask untouched, but ensure group parts
of USERDATA_DIR_MODE are not masked */
mode_t dir_mode = (permission_class == PERMS_PRIVATE ?
DIR_PERMS_PRIVATE : DIR_PERMS_PUBLIC);
- mode_t normal_umask = umask(0);
+ mode_t normal_umask = posix_umask(0);
mode_t group_umask = ~(dir_mode & S_IRWXG);
- umask(normal_umask & group_umask);
-#endif
+ posix_umask(normal_umask & group_umask);
if (access(dir, F_OK) != 0)
-#if defined(PLATFORM_WIN32)
- if (mkdir(dir) != 0)
-#else
- if (mkdir(dir, dir_mode) != 0)
-#endif
+ if (posix_mkdir(dir, dir_mode) != 0)
Error(ERR_WARN, "cannot create %s directory '%s'", text, dir);
-#if defined(PLATFORM_UNIX)
- umask(normal_umask); /* reset normal umask */
-#endif
+ posix_umask(normal_umask); /* reset normal umask */
}
void InitUserDataDirectory()
}
#endif
+inline Pixel SDLGetPixel(Bitmap *dst_bitmap, int x, int y)
+{
+ SDL_Surface *surface = dst_bitmap->surface;
+
+#ifdef FULLSCREEN_BUG
+ if (dst_bitmap == backbuffer || dst_bitmap == window)
+ {
+ x += video_xoffset;
+ y += video_yoffset;
+ }
+#endif
+
+ switch (surface->format->BytesPerPixel)
+ {
+ case 1: /* assuming 8-bpp */
+ {
+ return *((Uint8 *)surface->pixels + y * surface->pitch + x);
+ }
+ break;
+
+ case 2: /* probably 15-bpp or 16-bpp */
+ {
+ return *((Uint16 *)surface->pixels + y * surface->pitch / 2 + x);
+ }
+ break;
+
+ case 3: /* slow 24-bpp mode; usually not used */
+ {
+ /* does this work? */
+ Uint8 *pix = (Uint8 *)surface->pixels + y * surface->pitch + x * 3;
+ Uint32 color = 0;
+ int shift;
+
+ shift = surface->format->Rshift;
+ color |= *(pix + shift / 8) >> shift;
+ shift = surface->format->Gshift;
+ color |= *(pix + shift / 8) >> shift;
+ shift = surface->format->Bshift;
+ color |= *(pix + shift / 8) >> shift;
+
+ return color;
+ }
+ break;
+
+ case 4: /* probably 32-bpp */
+ {
+ return *((Uint32 *)surface->pixels + y * surface->pitch / 4 + x);
+ }
+ break;
+ }
+
+ return 0;
+}
+
/* ========================================================================= */
/* The following functions have been taken from the SGE library */
inline void SDLFillRectangle(Bitmap *, int, int, int, int, unsigned int);
inline void SDLDrawSimpleLine(Bitmap *, int, int, int, int, unsigned int);
inline void SDLDrawLine(Bitmap *, int, int, int, int, Uint32);
+inline Pixel SDLGetPixel(Bitmap *, int, int);
Bitmap *SDLLoadImage(char *);
#endif
}
+inline Pixel GetPixel(Bitmap *bitmap, int x, int y)
+{
+#if defined(TARGET_SDL)
+ return SDLGetPixel(bitmap, x, y);
+#elif defined(TARGET_ALLEGRO)
+ return AllegroGetPixel(bitmap->drawable, x, y);
+#else
+ unsigned long pixel_value;
+ XImage *pixel_image;
+
+ pixel_image = XGetImage(display, bitmap->drawable, x, y, 1, 1,
+ AllPlanes, ZPixmap);
+ pixel_value = XGetPixel(pixel_image, 0, 0);
+
+ XDestroyImage(pixel_image);
+
+ return pixel_value;
+#endif
+}
+
inline Pixel GetPixelFromRGB(Bitmap *bitmap, unsigned int color_r,
unsigned int color_g, unsigned int color_b)
{
inline void BlitBitmapMasked(Bitmap *, Bitmap *, int, int, int, int, int, int);
inline void DrawSimpleWhiteLine(Bitmap *, int, int, int, int);
inline void DrawLines(Bitmap *, struct XY *, int, Pixel);
+inline Pixel GetPixel(Bitmap *, int, int);
inline Pixel GetPixelFromRGB(Bitmap *, unsigned int,unsigned int,unsigned int);
inline Pixel GetPixelFromRGBcompact(Bitmap *, unsigned int);