X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=2eced3e30f9af07d0162b6b5c00012c125e80457;hb=4b0f1eb4220d2dbe4cffb288f745661b32c96a5b;hp=134cf74aeadfee1f092b95fb9496cb1adc9b2b09;hpb=4dcd7afc3645fa20c7868263eb09764e68240acd;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 134cf74a..2eced3e3 100644 --- a/src/init.c +++ b/src/init.c @@ -19,14 +19,15 @@ #include "tools.h" #include "files.h" #include "joystick.h" -#include "gfxloader.h" +#include "gfxload.h" +#include "gifload.h" #include #ifdef DEBUG -/* + #define DEBUG_TIMING -*/ + #endif struct PictureFileInfo @@ -93,6 +94,7 @@ void InitSound() if (sound_status==SOUND_OFF) return; +#ifndef MSDOS if (access(sound_device_name,W_OK)<0) { fprintf(stderr,"%s: cannot access sound device - no sounds\n",progname); @@ -114,9 +116,16 @@ void InitSound() sound_loops_allowed = TRUE; sound_loops_on = TRUE; #endif +#else + sound_loops_allowed = TRUE; + sound_loops_on = TRUE; +#endif for(i=0;ipicture_filename) { + + + + + + sprintf(basefilename,"%s%s",pic->picture_filename,".gif"); + DrawInitText(basefilename,150,FC_YELLOW); + sprintf(filename,"%s/%s",GFX_PATH,basefilename); + +#ifdef DEBUG_TIMING + count1 = Counter(); +#endif + + Read_GIF_to_Image(display, window, filename); + +#ifdef DEBUG_TIMING + count2 = Counter(); + printf("GIF LOADING %s IN %.2f SECONDS\n", + filename,(float)(count2-count1)/100.0); +#endif + + + + + + sprintf(basefilename,"%s%s",pic->picture_filename,picture_ext); DrawInitText(basefilename,150,FC_YELLOW); +#ifdef MSDOS + rest(100); +#endif MSDOS sprintf(filename,"%s/%s",GFX_PATH,basefilename); #ifdef DEBUG_TIMING @@ -440,9 +533,19 @@ void LoadGfx(int pos, struct PictureFileInfo *pic) #ifdef XPM_INCLUDE_FILE xpm_att[pos].valuemask = XpmCloseness; + xpm_att[pos].closeness = 65535; + + /* xpm_att[pos].closeness = 20000; + */ + +#if 0 xpm_err = XpmReadFileToPixmap(display,window,filename, &pix[pos],&shapemask,&xpm_att[pos]); +#else + xpm_err = XpmSuccess; +#endif + switch(xpm_err) { case XpmOpenFailed: @@ -501,10 +604,11 @@ void LoadGfx(int pos, struct PictureFileInfo *pic) #ifdef DEBUG_TIMING count2 = Counter(); - printf("LOADING %s IN %.2f SECONDS\n", + printf("XPM LOADING %s IN %.2f SECONDS\n", filename,(float)(count2-count1)/100.0); #endif +#if 0 if (!pix[pos]) { fprintf(stderr, "%s: cannot read graphics file '%s'.\n", @@ -512,14 +616,22 @@ void LoadGfx(int pos, struct PictureFileInfo *pic) CloseAll(); exit(-1); } +#endif + } /* zugehörige Maske laden (wenn vorhanden) */ if (pic->picture_with_mask) { +#ifdef MSDOS + xbm_err = BitmapSuccess; + clipmask[pos] = DUMMY_MASK; + goto msdos_jmp; +#else sprintf(basefilename,"%s%s",pic->picture_filename,picturemask_ext); DrawInitText(basefilename,150,FC_YELLOW); sprintf(filename,"%s/%s",GFX_PATH,basefilename); +#endif #ifdef DEBUG_TIMING count1 = Counter(); @@ -527,8 +639,16 @@ void LoadGfx(int pos, struct PictureFileInfo *pic) #ifdef XPM_INCLUDE_FILE +#if 0 xbm_err = XReadBitmapFile(display,window,filename, &width,&height,&clipmask[pos],&hot_x,&hot_y); +#else + xbm_err = BitmapSuccess; +#endif + +#ifdef MSDOS +msdos_jmp: +#endif switch(xbm_err) { case BitmapSuccess: @@ -588,6 +708,7 @@ void LoadGfx(int pos, struct PictureFileInfo *pic) filename,(float)(count2-count1)/100.0); #endif +#if 0 if (!clipmask[pos]) { fprintf(stderr, "%s: cannot read graphics file '%s'.\n", @@ -595,7 +716,12 @@ void LoadGfx(int pos, struct PictureFileInfo *pic) CloseAll(); exit(-1); } +#endif + } + + pix[pos] = test_pix[test_picture_count-1]; + clipmask[pos] = test_clipmask[test_picture_count-1]; } void InitElementProperties()