rnd-19980810
authorHolger Schemel <info@artsoft.org>
Mon, 10 Aug 1998 15:08:46 +0000 (17:08 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:30:19 +0000 (10:30 +0200)
16 files changed:
CHANGES
COPYRIGHT [deleted file]
DISCLAIMER [deleted file]
INSTALLATION [deleted file]
RECOMMENDATIONS [deleted file]
THIS_IS_NOW_FREEWARE [deleted file]
src/Makefile
src/events.c
src/game.c
src/game.h
src/gfxloader.c
src/init.c
src/main.c
src/main.h
src/random.c
src/tools.c

diff --git a/CHANGES b/CHANGES
index 441f3d06284e0b4070131ff229f5a3c9ac5467a7..5ad2b64da8e931abf1d3576d0f9a984de33c2ade 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,23 +1,6 @@
 
 
-Release Version 1.0 [9 APR 97]
-------------------------------
-       - the game now contains many really playable levels,
-         not only a few levels for testing
-       - the game is now even better playable by keyboard
-         (now you have the same gameplay functionality
-         compared to playing with a joystick. Especially
-         there are diagonal directions with keyboard playing
-         and the fire buttons are mapped to the shift keys)
-       - a lot of new elements for better emulation of levels
-         from the games "Boulderdash", "Emerald Mine" and
-         "Sokoban". New elements to build "Dynablaster" style
-         levels.
-       - enhanced functionality of the level tape recorder
-         to make it possible to go on with a game at any tape
-         position
-
 Prerelease Version 0.9b [4 NOV 95]
 Prerelease Version 0.9b [4 NOV 95]
-----------------------------------
+------------------------------------
        - the game is now completely Freeware
        - the game is now better playable by keyboard
          (in the last version, the player was making more than
        - the game is now completely Freeware
        - the game is now better playable by keyboard
          (in the last version, the player was making more than
diff --git a/COPYRIGHT b/COPYRIGHT
deleted file mode 100644 (file)
index b2b7fc7..0000000
--- a/COPYRIGHT
+++ /dev/null
@@ -1,25 +0,0 @@
-This program is copyrighted (c) 1995 by Holger Schemel.
-
-It is freely distributable as long as no profit is made with it
-and as long as the package is left complete and unmodified.
-
-The fact that this program comes with full source does not mean
-that you can do what you want with it - it is only intended to
-give you the chance to build it on your own machine.
-
-If you want to distribute this program on CDROM, you have to ask for
-permission first -- just send me E-Mail and tell me what kind of
-CDROM it is. Normally I will give my permission if
- - the CDROM itself contains only freely distributable software
- - the author of this program (me!) gets a free copy of the CDROM
- - the program is distributed in its original, unmodified package
-
-If the three conditions above are fulfilled, this permission will
-automatically given to the following CDROM distributions:
- - InfoMagic "LINUX Developer's Resource"
- - The Debian Linux Distribution CDROM
- - any CDROM with a mirror of sunsite.unc.edu or a mirror of another
-   FTP server that contains this program
-
-If you are in doubt (e.g., want to distribute a pre-installed version),
-feel free to mail me about it (see the file 'README' in this archive).
diff --git a/DISCLAIMER b/DISCLAIMER
deleted file mode 100644 (file)
index b6e06a6..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-THIS GAME IS PROVIDED "AS IS" -- USE IT AT YOUR OWN RISK!
-IF THIS GAME BLOWS UP YOUR COMPUTER OR OPERATING SYSTEM
-OR ANYTHING ELSE, IT'S NOT MY FAULT! I'M NOT RESPONSIBLE
-FOR ANY DAMAGE THAT MIGHT BE CAUSED BY MY PROGRAM!
diff --git a/INSTALLATION b/INSTALLATION
deleted file mode 100644 (file)
index 298ff6d..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-
-WHAT TO DO TO INSTALL "ROCKS_N_DIAMONDS-0.9" ON YOUR SYSTEM
-===========================================================
-
-If you have a Linux system (Intel based, a.out, kernel 1.2.x), you
-can use the precompiled binary.
-
-If you have another Unix system, or an ELF system or just want to
-compile the program by yourself, do the following:
-
-Edit the file "Makefile" and set the following options:
-
-XPM_INCLUDE_FILE       -       change this to the location where you
-                               have your XPM-Library include file.
-
-                               You must have the XPM-Library "libXpm"
-                               installed on your system to run this game.
-                               If you don't have it, look at your local
-                               FTP site with X11 archive to get it! :)
-
-GAME_DIR               -       You can leave these values untouched
-                               if you use the default location for
-                               the game directory.
-                               If you want to move it to other places in
-                               your directory tree, just change them
-                               accordingly. (You can use symlinks instead,
-                               of course.)
-                               You might want to set GAME_DIR to the full
-                               path of the game in your file system, so
-                               you don't have to go to the game directory
-                               when you want to play it.
-
-SOUNDS                 -       If you never want to hear any sounds,
-                               set this to "-DNO_SOUNDS", but be warned:
-                               It's much less fun playing without sound! :)
-                               (The program detects by itself if it can
-                               play sounds or not, anyway.)
-
-SCORE_ENTRIES          -       Set this to "-DONE_PER_NAME" if you want
-                               to allow only one entry per player in the
-                               score file for each level. This is useful
-                               if there are many players to prevent one
-                               single player to "flood" the Hall Of Fame
-                               of every level completely with his name...
-                               On single user systems, "-DMANY_PER_NAME"
-                               might be useful to have your name more
-                               than once in the list.
-
-SYSTEM                 -       If you have problems with the default
-                               settings, it might be useful to uncomment
-                               one of the defines for "SYSTEM" in the
-                               Makefile, which defines values like
-                               "-DSYSV" and something like that.
-
-CC, INCL, LIBS         -       Set these ones to the appropriate values
-                               you usually use on your system to compile.
-
-
-Now you can 'make clean' and 'make' and the game binary should be
-compiled right out of the box. I have tested it with "-Wall" on my
-system, so I hope that it compiles fine on other systems, too.
-
-The program should compile and run on Linux (of course),
-HP-UX, AIX, Net-BSD, SUN and IRIX.
-
-Have fun!
-
-Holger Schemel, 22. Oktober 1995
diff --git a/RECOMMENDATIONS b/RECOMMENDATIONS
deleted file mode 100644 (file)
index a08795b..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-
-Some recommendations for more fun playing Rocks'n'Diamonds:
-===========================================================
-
-About sound
------------
-It is highly recommended to have a decent sound interface for playing
-this game (although it only comes with bad-quality 8000-Hz-samples to
-save memory and to be compatible with /dev/audio).
-
-The best sound platform is an actual Linux system with (at least) kernel
-1.2.x, because it offers some nice real-time sound features which are
-needed to have background music loops in the game.
-
-On all other systems you don't have music loops, but you still have all
-the other sounds.
-
-
-About game speed
-----------------
-You should have a relatively fast hardware.
-
-The game was developed on a i486/33 (which is three years old now),
-and you should probably better not try to run it on a slower system.
-
-You should have an accelerated graphic card; I have found out that it
-starts being playable on my 486/33 with an old ISA cirrus logic 5426
-graphic card, which has a blitter that is supported by XFree86[tm],
-but that it was nearly unplayable on a 486/66 with old, unaccelerated
-ET4000.
-
-If all works fine, you should have something around 30 frames per second.
-
-If you think that the game is to slow to play, you should try out the
-following things:
-
-- Set "Buffered Gfx" to "off" in the setup menu. Normally (on a fast
-  enough system) you should use buffered graphics, which means that
-  all graphics is drawn into an invisible Pixmap and is then copied
-  to the X11 window to avoid flickering. If you disable this double
-  buffering, the graphic is directly drawn into the window. This can
-  cause some slight flickering, but makes graphic operations roughly
-  twice as fast compared to double buffering.
-
-- Set "Game Music" to "off" in the setup menu (and maybe "sound loops"
-  too). Where disabling buffered graphics may be required with slow
-  graphics hardware, disabling sound is especially recommended on slow
-  CPU systems (486/33 and slower), because the sound server eats up a
-  significant amount of CPU time when playing long sounds.
-
-You might also notice that bigger levels tend to be slower on slow
-systems.
-
-About the option "Fading" in the setup menu: It gives a nice looking
-fading when switching to a new screen, but you should really only try
-this out if you think that you have a very fast graphics hardware.
-
-
-About music
------------
-The background music loops are ripped out from several nice music albums.
-Just have a look at the info screen to find out from which album each
-sound loop came from -- they are all very well done pieces of music, but
-unfortunately they don't sound better after converting them to 8 kHz
-samples (to conform to standard SUN /dev/audio). Maybe I change this to
-a better quality in the future, but at the moment, where the sounds
-directory has a size of nearly a megabyte, I'll stay with 8 kHz samples.
-
-So, if you have a non-Linux system (which cannot play sound loops) or
-don't like the "telephone quality" of the music loops, just get some of
-these CDs and play them while your playing the game! ;-)
-
-
-About game-play
----------------
-It is *strongly recommended* to play this game with a high-quality joystick.
-That means, throw your $10 joystick out of the window and buy a decent
-Competition-Pro Digital PC joystick or a high-quality CH Products Analog
-joystick. Believe me, it doubles the fun of playing the game.
-
-If you only have a normal Unix system (and no fine Linux system), you
-are forced to play with the keyboard. It works, but is not only less fun,
-but also more difficult with some levels, because you cannot move in
-diagonal directions with keyboard control at the moment. Another bad thing
-is that you will have some problems when pressing many keys at the same
-time. This might change in the future, when I implement a better keyboard
-handling which not only solves these problems but allows diagonal directions,
-too.
-
diff --git a/THIS_IS_NOW_FREEWARE b/THIS_IS_NOW_FREEWARE
deleted file mode 100644 (file)
index c0e5098..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-
-THIS GAME IS NOW COMPLETELY FREEWARE!
-=====================================
-
-In version 0.9, I planned to offer the possibility to become a
-registered user and get special level series for registered users
-only and some more things.
-
-Now I have decided that it is better to distribute it as Freeware,
-that means: Freely distributable, but still copyrighted software.
-
-If you like this game, please send me mail about it!
-
-       aeglos@valinor.owl.de
-
-or SnailMail:
-
-       Holger Schemel
-       Sennehof 28
-       33659 Bielefeld
-       GERMANY
-
-Have fun!
index 22682e11bd4aeaff4e4626bba6d0fac094825b69..01a64c2edfd228a89205bbb2bb456abf9a5ceca2 100644 (file)
@@ -20,7 +20,7 @@ SCORE_ENTRIES = -DMANY_PER_NAME               # many score entries per name
 # because the GIF loading routines are still a bit beta.
 # If you use the Xpm library, convert the GIF files to Xpm
 # files (and the mask files ('*Maske.gif') to xbm files).
 # because the GIF loading routines are still a bit beta.
 # If you use the Xpm library, convert the GIF files to Xpm
 # files (and the mask files ('*Maske.gif') to xbm files).
-XPM_INCLUDE_FILE = -DXPM_INCLUDE_FILE="<X11/xpm.h>"
+XPM_INCLUDE_FILE = -DXPM_INCLUDE_FILE="<X11/xpm.h>"
 
 CONFIG = $(GAME_DIR) $(SOUNDS) $(JOYSTICK)     \
         $(SCORE_ENTRIES) $(XPM_INCLUDE_FILE)
 
 CONFIG = $(GAME_DIR) $(SOUNDS) $(JOYSTICK)     \
         $(SCORE_ENTRIES) $(XPM_INCLUDE_FILE)
@@ -38,8 +38,8 @@ DEBUG = -DDEBUG -g -Wall
 # LIBS = -L/usr/local/X11/lib -lXpm -lX11 -lm -lsocket -R/usr/local/X11/lib
 #                                      # for SunOS and others
 
 # LIBS = -L/usr/local/X11/lib -lXpm -lX11 -lm -lsocket -R/usr/local/X11/lib
 #                                      # for SunOS and others
 
-LIBS = -L/usr/X11R6/lib -lXpm -lX11 -lm
-LIBS = -L/usr/X11R6/lib -lX11 -lm
+LIBS = -L/usr/X11R6/lib -lXpm -lX11 -lm
+LIBS = -L/usr/X11R6/lib -lX11 -lm
 
 # CFLAGS = -O2 $(CONFIG) $(SYSTEM)
 CFLAGS = $(DEBUG) $(CONFIG) $(SYSTEM) $(INCL)
 
 # CFLAGS = -O2 $(CONFIG) $(SYSTEM)
 CFLAGS = $(DEBUG) $(CONFIG) $(SYSTEM) $(INCL)
@@ -87,9 +87,13 @@ all: $(OBJS)
 clean:
        $(RM) $(OBJS)
 
 clean:
        $(RM) $(OBJS)
 
+BACKUP_DIR = /home/aeglos/BACKUP/rnd
+BACKUP_DATE = `date +%y%m%d`
+BACKUP_FILE = $(BACKUP_DIR)/rnd-$(BACKUP_DATE).tgz
+
 backup:
 backup:
-       @echo "tar cvzf /usr/AEGLOS/BACKUP/rnd-`date +%Y%m%d | cut -b 3-8`.tgz *.c *.h Makefile"
-       @tar cvzf /usr/AEGLOS/BACKUP/rnd-`date +%Y%m%d | cut -b 3-8`.tgz *.c *.h Makefile
+       @echo "tar cvzf $(BACKUP_FILE) *.c *.h Makefile"
+       @tar cvzf $(BACKUP_FILE) *.c *.h Makefile
 
 depend:
        for i in $(SRCS); do $(CPP) $(CFLAGS) -M $$i; done > .depend
 
 depend:
        for i in $(SRCS); do $(CPP) $(CFLAGS) -M $$i; done > .depend
index 63856e59f6480535de10aa9de2440577df04db7c..69b67685b87b95f7503fdd6a75843f12fc531076 100644 (file)
@@ -265,6 +265,7 @@ void HandleButton(int mx, int my, int button)
 int Gamespeed = 4;
 int Movemethod = 0;
 int Movespeed[2] = { 10, 3 };
 int Gamespeed = 4;
 int Movemethod = 0;
 int Movespeed[2] = { 10, 3 };
+char *Movespeed_text[2] = { "asynchron", "syncron" };
 
 void HandleKey(KeySym key, int key_status)
 {
 
 void HandleKey(KeySym key, int key_status)
 {
@@ -351,9 +352,15 @@ void HandleKey(KeySym key, int key_status)
       joy |= JOY_BUTTON_1 | JOY_DOWN;
       break;
     case XK_Shift_L:           /* Linker Feuerknopf */
       joy |= JOY_BUTTON_1 | JOY_DOWN;
       break;
     case XK_Shift_L:           /* Linker Feuerknopf */
+    case XK_Control_L:
+    case XK_Alt_L:
+    case XK_Meta_L:
       joy |= JOY_BUTTON_1;
       break;
     case XK_Shift_R:           /* Rechter Feuerknopf */
       joy |= JOY_BUTTON_1;
       break;
     case XK_Shift_R:           /* Rechter Feuerknopf */
+    case XK_Control_R:
+    case XK_Alt_R:
+    case XK_Meta_R:
     case XK_B:                 /* (Bombe legen) */
     case XK_b:
       joy |= JOY_BUTTON_2;
     case XK_B:                 /* (Bombe legen) */
     case XK_b:
       joy |= JOY_BUTTON_2;
@@ -456,14 +463,16 @@ void HandleKey(KeySym key, int key_status)
        case XK_8:
        case XK_9:
          Movespeed[Movemethod] = (Movemethod == 0 ? 4 : 0) + (key - XK_0);
        case XK_8:
        case XK_9:
          Movespeed[Movemethod] = (Movemethod == 0 ? 4 : 0) + (key - XK_0);
-         printf("method == %d, speed == %d\n",
-                Movemethod, Movespeed[Movemethod]);
+         printf("method == %d, speed == %d (%s)\n",
+                Movemethod, Movespeed[Movemethod],
+                Movespeed_text[Movemethod]);
          break;
 
        case XK_a:
          Movemethod = !Movemethod;
          break;
 
        case XK_a:
          Movemethod = !Movemethod;
-         printf("method == %d, speed == %d\n",
-                Movemethod, Movespeed[Movemethod]);
+         printf("method == %d, speed == %d (%s)\n",
+                Movemethod, Movespeed[Movemethod],
+                Movespeed_text[Movemethod]);
          break;
 
        case XK_f:
          break;
 
        case XK_f:
@@ -490,9 +499,13 @@ void HandleKey(KeySym key, int key_status)
 #endif
 
        case XK_x:
 #endif
 
        case XK_x:
-         /*
+
          {
          {
-           int i,j,k, num_steps = 4, step_size = TILEX / num_steps;
+           int i,j,k, num_steps = 16, step_size = TILEX / num_steps;
+           static long scroll_delay=0;
+           long scroll_delay_value = 4*4 / num_steps;
+
+           printf("Scroll test\n");
 
            for(i=0;i<10;i++)
            {
 
            for(i=0;i<10;i++)
            {
@@ -501,24 +514,43 @@ void HandleKey(KeySym key, int key_status)
                for(k=0;k<num_steps;k++)
                {
                  int xxx = j*TILEX+k*step_size;
                for(k=0;k<num_steps;k++)
                {
                  int xxx = j*TILEX+k*step_size;
-
-                 XCopyArea(display,backbuffer,window,gc,
-                           REAL_SX+xxx,REAL_SY,
-                           FULL_SXSIZE-xxx,FULL_SYSIZE,
-                           REAL_SX,REAL_SY);
-                 XCopyArea(display,backbuffer,window,gc,
-                           REAL_SX,REAL_SY,
-                           xxx,FULL_SYSIZE,
-                           REAL_SX+FULL_SXSIZE-xxx,REAL_SY);
-
-                 XFlush(display);
-                 XSync(display,FALSE);
+                 int done = 0;
+
+                 while(!done)
+                 {
+                   if (DelayReached(&scroll_delay, scroll_delay_value))
+                   {
+                     XCopyArea(display,backbuffer,window,gc,
+                               SX+xxx,SY,
+                               SXSIZE-xxx,SYSIZE,
+                               SX,SY);
+                     XCopyArea(display,backbuffer,window,gc,
+                               SX,SY,
+                               xxx,SYSIZE,
+                               SX+SXSIZE-xxx,SY);
+  
+                     XFlush(display);
+                     XSync(display,FALSE);
+
+                     done = 1;
+                   }
+                   else
+                   {
+                     Delay(1000);
+                   }
+                 }
+  
+                 /*
+                 Delay(160000 / num_steps);
+                 */
+                 /*
                  Delay(120000 / num_steps);
                  Delay(120000 / num_steps);
+                 */
                }
              }
            }
          }
                }
              }
            }
          }
-         */
+
          break;
 
        default:
          break;
 
        default:
@@ -613,6 +645,13 @@ void HandleJoystick()
        return;
       }
 
        return;
       }
 
+
+
+      if (PlayerMovPos)
+       ScrollFigure(0);
+
+
+
       if (tape.pausing || PlayerGone)
        joy = 0;
 
       if (tape.pausing || PlayerGone)
        joy = 0;
 
index e170331debf8e5d7f306e301144b6e8e56910b94..15c379531fc488fc94a14f84cc5b0c02b7d6cc5e 100644 (file)
@@ -2798,6 +2798,15 @@ BOOL MoveFigureOneStep(int dx, int dy, int real_dx, int real_dy)
   JX = newJX;
   JY = newJY;
 
   JX = newJX;
   JY = newJY;
 
+
+  JX2 = oldJX;
+  JY2 = oldJY;
+
+  PlayerMovPos = TILEX/4;
+  PlayerMovPos = (dx > 0 || dy > 0 ? -1 : 1) * 3*TILEX/4;
+
+  ScrollFigure(-1);
+
   if (Store[oldJX][oldJY])
   {
     DrawGraphic(SCROLLX(oldJX),SCROLLY(oldJY),el2gfx(Store[oldJX][oldJY]));
   if (Store[oldJX][oldJY])
   {
     DrawGraphic(SCROLLX(oldJX),SCROLLY(oldJY),el2gfx(Store[oldJX][oldJY]));
@@ -2896,6 +2905,24 @@ BOOL MoveFigure(int dx, int dy)
   return(moved);
 }
 
   return(moved);
 }
 
+void ScrollFigure(int init)
+{
+  static long actual_frame_counter;
+
+  if (init)
+  {
+    actual_frame_counter = FrameCounter;
+    return;
+  }
+  else if (!FrameReached(&actual_frame_counter,1))
+    return;
+
+  PlayerMovPos += (PlayerMovPos > 0 ? -1 : 1) * TILEX/4;
+
+  DrawLevelElement(JX2,JY2, Feld[JX2][JY2]);
+  DrawPlayerField();
+}
+
 void TestIfGoodThingHitsBadThing(int goodx, int goody)
 {
   int i, killx = goodx, killy = goody;
 void TestIfGoodThingHitsBadThing(int goodx, int goody)
 {
   int i, killx = goodx, killy = goody;
index 8b76cb7aea155dd7c2acda4102b177f522176d0d..3fdd4a5290207d1fa69f51c58fc2bd978586ec59 100644 (file)
@@ -76,6 +76,9 @@ void GameActions(void);
 void ScrollLevel(int, int);
 BOOL MoveFigureOneStep(int, int, int, int);
 BOOL MoveFigure(int, int);
 void ScrollLevel(int, int);
 BOOL MoveFigureOneStep(int, int, int, int);
 BOOL MoveFigure(int, int);
+
+void ScrollFigure(int);
+
 void TestIfGoodThingHitsBadThing(int, int);
 void TestIfBadThingHitsGoodThing(int, int);
 void TestIfHeroHitsBadThing(void);
 void TestIfGoodThingHitsBadThing(int, int);
 void TestIfBadThingHitsGoodThing(int, int);
 void TestIfHeroHitsBadThing(void);
index d0bd1cbae59fb299998e9b8c26c3c456344590fd..c84a3cd711a00b8dd5176894fe907decbeb88cfd 100644 (file)
@@ -779,10 +779,18 @@ static int ConvertXImageDepth(Display *display, XImage **image)
     register int dwx, dwy;
     byte *data;
 
     register int dwx, dwy;
     byte *data;
 
-    data = (byte *)malloc(width * height);
+    data = (byte *)malloc(width * height * depth);
     old_image = *image;
     old_image = *image;
+
+    /*
     new_image = XCreateImage(display,visual,depth,
                             ZPixmap,0,data,width,height,8,0);
     new_image = XCreateImage(display,visual,depth,
                             ZPixmap,0,data,width,height,8,0);
+                            */
+
+    new_image = XGetImage(display,RootWindow(display,screen),
+                         0,0,width,height,0xffffffff,ZPixmap);
+
+
     if (!new_image)
       return(GIF_NoMemory);
 
     if (!new_image)
       return(GIF_NoMemory);
 
@@ -811,13 +819,17 @@ static int ConvertXImageDepth(Display *display, XImage **image)
     }
     else       /* other format change than 8 bit -> 4 bit */
     {
     }
     else       /* other format change than 8 bit -> 4 bit */
     {
-      register unsigned long pixel_value;
+      unsigned long pixel_value;
 
       for (dwx=0; dwx<width; dwx++)
       {
        for (dwy=0; dwy<height; dwy++)
        {
          pixel_value = XGetPixel(old_image, dwx, dwy);
 
       for (dwx=0; dwx<width; dwx++)
       {
        for (dwy=0; dwy<height; dwy++)
        {
          pixel_value = XGetPixel(old_image, dwx, dwy);
+
+         if (pixel_value > 0xff)
+           printf("pixel = %lx", pixel_value);
+
          XPutPixel(new_image, dwx, dwy, pixel_value);
        }
       }
          XPutPixel(new_image, dwx, dwy, pixel_value);
        }
       }
index c9fc72c86fa0bb0201664034196178ac7b6cfcff..0f0bd65234873a2ea12c2877b54c65b68c810924 100644 (file)
@@ -361,6 +361,9 @@ void InitGfx()
   pix[PIX_DB_DOOR] = XCreatePixmap(display, window,
                                   3*DXSIZE,DYSIZE+VYSIZE,
                                   XDefaultDepth(display,screen));
   pix[PIX_DB_DOOR] = XCreatePixmap(display, window,
                                   3*DXSIZE,DYSIZE+VYSIZE,
                                   XDefaultDepth(display,screen));
+  pix[PIX_DB_FIELD] = XCreatePixmap(display, window,
+                                   SXSIZE+2*TILEX,SYSIZE+2*TILEY,
+                                   XDefaultDepth(display,screen));
 
   if (!pix[PIX_DB_BACK] || !pix[PIX_DB_DOOR])
   {
 
   if (!pix[PIX_DB_BACK] || !pix[PIX_DB_DOOR])
   {
@@ -384,6 +387,7 @@ void InitGfx()
   }
 
   drawto = drawto_field = backbuffer = pix[PIX_DB_BACK];
   }
 
   drawto = drawto_field = backbuffer = pix[PIX_DB_BACK];
+  fieldbuffer = pix[PIX_DB_FIELD];
 
   XCopyArea(display,pix[PIX_BACK],backbuffer,gc,
            0,0, WIN_XSIZE,WIN_YSIZE, 0,0);
 
   XCopyArea(display,pix[PIX_BACK],backbuffer,gc,
            0,0, WIN_XSIZE,WIN_YSIZE, 0,0);
index 2db25f2eecdc237fa2b245c3c762e262836bd6d9..9918892c00c6b7c814775755132fc82d0ec4a0cf 100644 (file)
@@ -29,7 +29,7 @@ Pixmap                clipmask[NUM_PIXMAPS];
 XpmAttributes  xpm_att[NUM_PICTURES];
 #endif
 
 XpmAttributes  xpm_att[NUM_PICTURES];
 #endif
 
-Drawable        drawto, drawto_field, backbuffer;
+Drawable        drawto, drawto_field, backbuffer, fieldbuffer;
 Colormap       cmap;
 
 int            sound_pipe[2];
 Colormap       cmap;
 
 int            sound_pipe[2];
@@ -80,8 +80,8 @@ long          Elementeigenschaften[MAX_ELEMENTS];
 int            level_nr, leveldir_nr, num_leveldirs;
 int            lev_fieldx,lev_fieldy, scroll_x,scroll_y;
 
 int            level_nr, leveldir_nr, num_leveldirs;
 int            lev_fieldx,lev_fieldy, scroll_x,scroll_y;
 
-int            JX,JY, ZX,ZY, ExitX,ExitY;
-int            PlayerMovDir, PlayerFrame, PlayerPushing;
+int            JX,JY, JX2,JY2, ZX,ZY, ExitX,ExitY;
+int            PlayerMovDir, PlayerMovPos, PlayerFrame, PlayerPushing;
 int            PlayerGone,LevelSolved,GameOver;
 int            FrameCounter,TimeFrames,TimeLeft,Score;
 int            Gems,SokobanFields,Lights,Friends;
 int            PlayerGone,LevelSolved,GameOver;
 int            FrameCounter,TimeFrames,TimeLeft,Score;
 int            Gems,SokobanFields,Lights,Friends;
index 36c0978dbe05f90f23345f68af3de173a49e007e..6023c372f332b454e04b7d5a3cf58f9aaa39e87b 100644 (file)
@@ -65,7 +65,12 @@ typedef int BOOL;
 #define IN_SCR_FIELD(x,y) ((x)>=0 && (x)<SCR_FIELDX && (y)>=0 &&(y)<SCR_FIELDY)
 #define IN_LEV_FIELD(x,y) ((x)>=0 && (x)<lev_fieldx && (y)>=0 &&(y)<lev_fieldy)
 
 #define IN_SCR_FIELD(x,y) ((x)>=0 && (x)<SCR_FIELDX && (y)>=0 &&(y)<SCR_FIELDY)
 #define IN_LEV_FIELD(x,y) ((x)>=0 && (x)<lev_fieldx && (y)>=0 &&(y)<lev_fieldy)
 
+/*
 #define IS_PLAYER(x,y)         (JX==(x) && JY==(y))
 #define IS_PLAYER(x,y)         (JX==(x) && JY==(y))
+*/
+
+#define IS_PLAYER(x,y)         ((JX==(x) && JY==(y)) || (JX2==(x) && JY2==(y)))
+
 #define IS_FREE(x,y)           (Feld[x][y]==EL_LEERRAUM && !IS_PLAYER(x,y))
 #define IS_FREE_OR_PLAYER(x,y) (Feld[x][y]==EL_LEERRAUM)
 #define IS_MOVING(x,y)         (MovPos[x][y]!=0)
 #define IS_FREE(x,y)           (Feld[x][y]==EL_LEERRAUM && !IS_PLAYER(x,y))
 #define IS_FREE_OR_PLAYER(x,y) (Feld[x][y]==EL_LEERRAUM)
 #define IS_MOVING(x,y)         (MovPos[x][y]!=0)
@@ -147,9 +152,10 @@ typedef int BOOL;
 /* Pixmaps without them */
 #define PIX_DB_BACK            6
 #define PIX_DB_DOOR            7
 /* Pixmaps without them */
 #define PIX_DB_BACK            6
 #define PIX_DB_DOOR            7
+#define PIX_DB_FIELD           8
 
 #define NUM_PICTURES           6
 
 #define NUM_PICTURES           6
-#define NUM_PIXMAPS            8
+#define NUM_PIXMAPS            9
 
 /* boundaries of arrays etc. */
 #define MAX_NAMELEN            (10+1)
 
 /* boundaries of arrays etc. */
 #define MAX_NAMELEN            (10+1)
@@ -245,7 +251,7 @@ extern Pixmap               pix[];
 extern XpmAttributes   xpm_att[];
 #endif
 
 extern XpmAttributes   xpm_att[];
 #endif
 
-extern Drawable        drawto, drawto_field, backbuffer;
+extern Drawable        drawto, drawto_field, backbuffer, fieldbuffer;
 extern Colormap                cmap;
 
 extern int             sound_pipe[2];
 extern Colormap                cmap;
 
 extern int             sound_pipe[2];
@@ -295,8 +301,8 @@ extern long         Elementeigenschaften[MAX_ELEMENTS];
 extern int             level_nr, leveldir_nr, num_leveldirs;
 extern int             lev_fieldx,lev_fieldy, scroll_x,scroll_y;
 
 extern int             level_nr, leveldir_nr, num_leveldirs;
 extern int             lev_fieldx,lev_fieldy, scroll_x,scroll_y;
 
-extern int             JX,JY, ZX,ZY, ExitX,ExitY;
-extern int             PlayerMovDir, PlayerFrame, PlayerPushing;
+extern int             JX,JY, JX2,JY2, ZX,ZY, ExitX,ExitY;
+extern int             PlayerMovDir, PlayerMovPos, PlayerFrame, PlayerPushing;
 extern int             PlayerGone,LevelSolved,GameOver;
 extern int             FrameCounter,TimeFrames,TimeLeft,Score;
 extern int             Gems,SokobanFields,Lights,Friends;
 extern int             PlayerGone,LevelSolved,GameOver;
 extern int             FrameCounter,TimeFrames,TimeLeft,Score;
 extern int             Gems,SokobanFields,Lights,Friends;
@@ -951,7 +957,7 @@ extern char         *progname;
 #define VERSION_STRING         "1.1"
 #define GAMETITLE_STRING       "Rocks'n'Diamonds"
 #define WINDOWTITLE_STRING     GAMETITLE_STRING " " VERSION_STRING
 #define VERSION_STRING         "1.1"
 #define GAMETITLE_STRING       "Rocks'n'Diamonds"
 #define WINDOWTITLE_STRING     GAMETITLE_STRING " " VERSION_STRING
-#define COPYRIGHT_STRING       "Copyright ^1995-97 by Holger Schemel"
+#define COPYRIGHT_STRING       "Copyright ^1995-98 by Holger Schemel"
 
 /* Leerer Login- und Alias-Name */
 #define EMPTY_LOGIN            "NO_LOGIN"
 
 /* Leerer Login- und Alias-Name */
 #define EMPTY_LOGIN            "NO_LOGIN"
index bbac6e5bdbee7d9471b64cf633b53c0fe1cfd567..e85a9f0293eedc30cb86aef174ed6b19d4e620c2 100644 (file)
@@ -24,7 +24,6 @@
 #include <ansidecl.h>
 #include <errno.h>
 #include <limits.h>
 #include <ansidecl.h>
 #include <errno.h>
 #include <limits.h>
-#include <stddef.h>
 #include <stdlib.h>
 
 #include "random.h"
 #include <stdlib.h>
 
 #include "random.h"
index 7ffa3c19226725869b5eebfe3883402bd4bd220d..2bbf09019da7a375d0d175bd7bc6e203b7c14e83 100644 (file)
@@ -258,6 +258,9 @@ void DrawPlayerField()
 {
   int x = JX, y = JY;
   int sx = SCROLLX(x), sy = SCROLLY(y);
 {
   int x = JX, y = JY;
   int sx = SCROLLX(x), sy = SCROLLY(y);
+
+  int sxx = 0, syy = 0;
+
   int element = Feld[x][y];
   int graphic, phase;
   BOOL draw_thru_mask = FALSE;
   int element = Feld[x][y];
   int graphic, phase;
   BOOL draw_thru_mask = FALSE;
@@ -306,10 +309,24 @@ void DrawPlayerField()
 
   graphic += PlayerFrame;
 
 
   graphic += PlayerFrame;
 
+
+  if (PlayerMovPos)
+  {
+    if (PlayerMovDir == MV_LEFT || PlayerMovDir == MV_RIGHT)
+      sxx = PlayerMovPos;
+    else
+      syy = PlayerMovPos;
+  }
+
+
   if (draw_thru_mask)
   if (draw_thru_mask)
-    DrawGraphicThruMask(sx,sy, graphic);
+    DrawGraphicThruMask(sx + sxx, sy + syy, graphic);
   else
   else
-    DrawGraphic(sx,sy, graphic);
+    DrawGraphicShifted(sx,sy,sxx,syy,graphic,CUT_NO_CUTTING);
+  /*
+    DrawGraphic(sx + sxx, sy + syy, graphic);
+    */
+
 
   /* draw things in front of player (EL_DYNAMIT || EL_DYNABOMB) */
 
 
   /* draw things in front of player (EL_DYNAMIT || EL_DYNABOMB) */