From: Holger Schemel Date: Mon, 10 Aug 1998 15:08:46 +0000 (+0200) Subject: rnd-19980810 X-Git-Tag: 1.2.0^2~99 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=cf5b3a1e9077e88eb40ce2fb59e985a0ae037c84;p=rocksndiamonds.git rnd-19980810 --- diff --git a/CHANGES b/CHANGES index 441f3d06..5ad2b64d 100644 --- 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] ----------------------------------- +------------------------------------ - 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 index b2b7fc7d..00000000 --- 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 index b6e06a6e..00000000 --- a/DISCLAIMER +++ /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 index 298ff6d6..00000000 --- a/INSTALLATION +++ /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 index a08795b4..00000000 --- a/RECOMMENDATIONS +++ /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 index c0e5098a..00000000 --- a/THIS_IS_NOW_FREEWARE +++ /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! diff --git a/src/Makefile b/src/Makefile index 22682e11..01a64c2e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -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). -# XPM_INCLUDE_FILE = -DXPM_INCLUDE_FILE="" +XPM_INCLUDE_FILE = -DXPM_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/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) @@ -87,9 +87,13 @@ all: $(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: - @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 diff --git a/src/events.c b/src/events.c index 63856e59..69b67685 100644 --- a/src/events.c +++ b/src/events.c @@ -265,6 +265,7 @@ void HandleButton(int mx, int my, int button) int Gamespeed = 4; int Movemethod = 0; int Movespeed[2] = { 10, 3 }; +char *Movespeed_text[2] = { "asynchron", "syncron" }; 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 */ + case XK_Control_L: + case XK_Alt_L: + case XK_Meta_L: 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; @@ -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); - 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; - 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: @@ -490,9 +499,13 @@ void HandleKey(KeySym key, int key_status) #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++) { @@ -501,24 +514,43 @@ void HandleKey(KeySym key, int key_status) for(k=0;k 0 || dy > 0 ? -1 : 1) * 3*TILEX/4; + + ScrollFigure(-1); + 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); } +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; diff --git a/src/game.h b/src/game.h index 8b76cb7a..3fdd4a52 100644 --- a/src/game.h +++ b/src/game.h @@ -76,6 +76,9 @@ void GameActions(void); 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); diff --git a/src/gfxloader.c b/src/gfxloader.c index d0bd1cba..c84a3cd7 100644 --- a/src/gfxloader.c +++ b/src/gfxloader.c @@ -779,10 +779,18 @@ static int ConvertXImageDepth(Display *display, XImage **image) register int dwx, dwy; byte *data; - data = (byte *)malloc(width * height); + data = (byte *)malloc(width * height * depth); old_image = *image; + + /* 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); @@ -811,13 +819,17 @@ static int ConvertXImageDepth(Display *display, XImage **image) } else /* other format change than 8 bit -> 4 bit */ { - register unsigned long pixel_value; + unsigned long pixel_value; for (dwx=0; dwx 0xff) + printf("pixel = %lx", pixel_value); + XPutPixel(new_image, dwx, dwy, pixel_value); } } diff --git a/src/init.c b/src/init.c index c9fc72c8..0f0bd652 100644 --- a/src/init.c +++ b/src/init.c @@ -361,6 +361,9 @@ void InitGfx() 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]) { @@ -384,6 +387,7 @@ void InitGfx() } 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); diff --git a/src/main.c b/src/main.c index 2db25f2e..9918892c 100644 --- a/src/main.c +++ b/src/main.c @@ -29,7 +29,7 @@ Pixmap clipmask[NUM_PIXMAPS]; XpmAttributes xpm_att[NUM_PICTURES]; #endif -Drawable drawto, drawto_field, backbuffer; +Drawable drawto, drawto_field, backbuffer, fieldbuffer; 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 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; diff --git a/src/main.h b/src/main.h index 36c0978d..6023c372 100644 --- a/src/main.h +++ b/src/main.h @@ -65,7 +65,12 @@ typedef int BOOL; #define IN_SCR_FIELD(x,y) ((x)>=0 && (x)=0 &&(y)=0 && (x)=0 &&(y) #include #include -#include #include #include "random.h" diff --git a/src/tools.c b/src/tools.c index 7ffa3c19..2bbf0901 100644 --- a/src/tools.c +++ b/src/tools.c @@ -258,6 +258,9 @@ void DrawPlayerField() { 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; @@ -306,10 +309,24 @@ void DrawPlayerField() graphic += PlayerFrame; + + if (PlayerMovPos) + { + if (PlayerMovDir == MV_LEFT || PlayerMovDir == MV_RIGHT) + sxx = PlayerMovPos; + else + syy = PlayerMovPos; + } + + if (draw_thru_mask) - DrawGraphicThruMask(sx,sy, graphic); + DrawGraphicThruMask(sx + sxx, sy + syy, graphic); 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) */