193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
|
i--;
j=fgetc(fp)<<16; j|=fgetc(fp)<<24; j|=fgetc(fp)<<0; j|=fgetc(fp)<<8;
l_offset=ftell(fp); l_size=j;
if(i>4 && nam[i-4]=='.' && nam[i-3]=='W' && nam[i-1]=='V' && (nam[i-2]=='A' || nam[i-2]=='Z')) {
j=nam[i-2];
nam[i-4]=0;
if(is_user) {
if(nusersounds>0x03FD) goto done;
i=nusersounds++;
usersounds=realloc(usersounds,nusersounds*sizeof(WaveSound));
user_sound_names=realloc(user_sound_names,nusersounds*sizeof(Uint8*));
if(!usersounds || !user_sound_names) fatal("Allocation failed\n");
user_sound_names[i]=strdup(nam);
if(!user_sound_names[i]) fatal("Allocation failed\n");
ws=usersounds+i;
|
|
|
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
|
i--;
j=fgetc(fp)<<16; j|=fgetc(fp)<<24; j|=fgetc(fp)<<0; j|=fgetc(fp)<<8;
l_offset=ftell(fp); l_size=j;
if(i>4 && nam[i-4]=='.' && nam[i-3]=='W' && nam[i-1]=='V' && (nam[i-2]=='A' || nam[i-2]=='Z')) {
j=nam[i-2];
nam[i-4]=0;
if(is_user) {
if(nusersounds>255) goto done;
i=nusersounds++;
usersounds=realloc(usersounds,nusersounds*sizeof(WaveSound));
user_sound_names=realloc(user_sound_names,nusersounds*sizeof(Uint8*));
if(!usersounds || !user_sound_names) fatal("Allocation failed\n");
user_sound_names[i]=strdup(nam);
if(!user_sound_names[i]) fatal("Allocation failed\n");
ws=usersounds+i;
|
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
|
Value v;
char buf[256];
if(main_options['T'] && main_options['v']) {
if(mmltuning) printf("mmltempo=%d; mmlvolume=%d; mmltuning[96]=%d\n",(int)mmltempo,(int)mmlvolume,(int)mmltuning[96]);
for(i=0;i<nusersounds;i++) printf("%d: %s (ptr=%p, len=%d bytes)\n",i,user_sound_names[i],usersounds[i].data,usersounds[i].len);
fflush(stdout);
}
if(!screen) return;
nitems=nstandardsounds+nusersounds+8;
columns=(screen->w-16)/240?:1;
scrmax=(nitems+columns-1)/columns;
set_cursor(XC_arrow);
redraw:
SDL_FillRect(screen,0,0x02);
r.x=r.y=0;
|
|
|
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
|
Value v;
char buf[256];
if(main_options['T'] && main_options['v']) {
if(mmltuning) printf("mmltempo=%d; mmlvolume=%d; mmltuning[96]=%d\n",(int)mmltempo,(int)mmlvolume,(int)mmltuning[96]);
for(i=0;i<nusersounds;i++) printf("%d: %s (ptr=%p, len=%d bytes)\n",i,user_sound_names[i],usersounds[i].data,usersounds[i].len);
fflush(stdout);
}
if(!screen || !sound_on) return;
nitems=nstandardsounds+nusersounds+8;
columns=(screen->w-16)/240?:1;
scrmax=(nitems+columns-1)/columns;
set_cursor(XC_arrow);
redraw:
SDL_FillRect(screen,0,0x02);
r.x=r.y=0;
|