Exemplo n.º 1
0
/* Open a module via an SDL_rwop.  The loader will initialize the specified
   song-player 'player'. */
MODULE* Player_LoadRW(SDL_RWops *rw,int maxchan,BOOL curious)
{
	MODULE* result=NULL;
	struct MREADER* reader=_mm_new_rwops_reader (rw);

	if (reader) {
		result=Player_LoadGeneric(reader,maxchan,curious);
		_mm_delete_rwops_reader(reader);
	}
	return result;
}
Exemplo n.º 2
0
Mix_Chunk *Mix_LoadWAV_RW(SDL_RWops *src, int freesrc)
{
	SAMPLE *sample;
   	struct MREADER* reader = _mm_new_rwops_reader (src);
   	if (reader) {
   		sample = Sample_LoadGeneric(reader);
		if(reader) free(reader);
		return (Mix_Music *) sample;
   	}
   	else
	{
        printf("Could not load sample, reason: %s\n", MikMod_strerror(MikMod_errno));
	}
	return NULL;
}
Exemplo n.º 3
0
/* SDL_RWops compatibility */
Mix_Music *Mix_LoadMUS_RW(SDL_RWops *rw)
{
	//Sanity check: only MOD!
	if (detect_music_type(rw) != MUS_MOD){
		printf("Error: format not supported.\n");
		return NULL;
	}
	
	MODULE *module;
   	struct MREADER* reader = _mm_new_rwops_reader (rw);
   	if (reader) {
   		module = Player_LoadGeneric(reader,64,0);
		if(reader) free(reader);
		return (Mix_Music *) module;
   	}
   	else
	{
        printf("Could not load module, reason: %s\n", MikMod_strerror(MikMod_errno));
	}
	return NULL;
}