示例#1
0
void sound_loop(int snd)
{
	if (!settings->sound_enabled)
		return;
	
	pxt_Play(-1, snd, -1);
}
示例#2
0
void sound(int snd)
{
	if (!settings->sound_enabled)
		return;
	
	pxt_Stop(snd);
	pxt_Play(-1, snd, 0);
}
示例#3
0
int SDL_main(int argc, char *argv[])
{
	stat("Entering main loop");
	testblit();

	if (SSInit()) return 1;
	if (pxt_init()) return 1;
	
	if (pxt_LoadSoundFX(pxt_dir, sndcache, 0x75)) {
		printf("Can't load\n");
		return 1;
	}

	if (org_init(org_wavetable, pxt_dir, ORG_VOLUME))
	{
		staterr("Music failed to initialize");
		return 1;
	}

	music(19);

	while(!quitting)
	{
		org_run();
		
		SDL_Event pie;
		if (SDL_PollEvent(&pie))
		{
			if (pie.type == SDL_KEYDOWN) {
				
				if(pie.key.keysym.sym == SDLK_F3)
					quitting = true;
				else if(pie.key.keysym.sym == SDLK_BTN_A)
					pxt_Play(-1, 1, 1);
				else if(pie.key.keysym.sym == SDLK_BTN_B)
					org_stop();
				else if(pie.key.keysym.sym == SDLK_BTN_Y)
					music(random(1,42));
			}
		}
	}


	pxt_freeSoundFX();
	SSClose();

	return 0;
}