openalbridge/openalwrap.c
changeset 2220 110266ba2ef7
parent 2216 82e7da49c26a
child 2257 7eb31efcfb9b
equal deleted inserted replaced
2219:07f5345ecae7 2220:110266ba2ef7
   384 		/*wrapper for fadein*/
   384 		/*wrapper for fadein*/
   385 		return openal_fade(index, quantity, FADE_IN);
   385 		return openal_fade(index, quantity, FADE_IN);
   386 	}
   386 	}
   387 
   387 
   388 	
   388 	
       
   389 	ALint openal_setposition(uint32_t index, float x, float y, float z) {
       
   390 		if(openalReady == AL_FALSE)	{
       
   391 			fprintf(stderr, "ERROR: OpenAL not initialized\n");
       
   392 			return AL_FALSE;
       
   393 		}
       
   394 		if (index >= globalindex) {
       
   395 			fprintf(stderr, "ERROR: index out of bounds (got %d, max %d)\n", index, globalindex);
       
   396 			return AL_FALSE;
       
   397 		}
       
   398 		
       
   399 		alSource3f(Sources[index], AL_POSITION, x, y, z);
       
   400 		if (AlGetError("ERROR %d: setting position for last sound\n") != AL_TRUE)
       
   401 			return AL_FALSE;
       
   402 		
       
   403 		return AL_TRUE;
       
   404 	}
   389 	ALint openal_playsound(uint32_t index){
   405 	ALint openal_playsound(uint32_t index){
   390 		if(openalReady == AL_FALSE)
   406 		if(openalReady == AL_FALSE)	{
   391 		{
       
   392 			fprintf(stderr, "ERROR: OpenAL not initialized\n");
   407 			fprintf(stderr, "ERROR: OpenAL not initialized\n");
   393 			return AL_FALSE;
   408 			return AL_FALSE;
   394 		}
   409 		}
   395 
   410 
   396 		/*Play sound number index*/
   411 		/*Play sound number index*/