Exemplo n.º 1
0
 public static FMOD_RESULT Memory_Initialize(
     ByteBuffer poolmem,
     int poollen,
     FMOD_MEMORY_ALLOCCALLBACK useralloc,
     FMOD_MEMORY_REALLOCCALLBACK userrealloc,
     FMOD_MEMORY_FREECALLBACK userfree,
     int memtypeflags) {
   if (poolmem != null && !poolmem.isDirect()) {
     throw new NonDirectBufferException();
   }
   if (useralloc != null && userrealloc != null && userfree != null) {
     CallbackManager.addCallback(25, useralloc, 0);
     CallbackManager.addCallback(27, userrealloc, 0);
     CallbackManager.addCallback(26, userfree, 0);
   } else {
     useralloc = null;
     userrealloc = null;
     userfree = null;
   }
   int javaResult =
       FmodExJNI.FmodEx_Memory_Initialize(
           poolmem,
           BufferUtils.getPositionInBytes(poolmem),
           poollen,
           useralloc == null ? false : true,
           userrealloc == null ? false : true,
           userfree == null ? false : true,
           memtypeflags);
   return FMOD_RESULT.get(javaResult);
 }
Exemplo n.º 2
0
 public static FMOD_RESULT File_GetDiskBusy(IntBuffer busy) {
   if (busy != null && !busy.isDirect()) {
     throw new NonDirectBufferException();
   }
   int javaResult = FmodExJNI.FmodEx_File_GetDiskBusy(busy, BufferUtils.getPositionInBytes(busy));
   return FMOD_RESULT.get(javaResult);
 }
Exemplo n.º 3
0
 public static FMOD_RESULT Debug_GetLevel(IntBuffer level) {
   if (level != null && !level.isDirect()) {
     throw new NonDirectBufferException();
   }
   int javaResult = FmodExJNI.FmodEx_Debug_GetLevel(level, BufferUtils.getPositionInBytes(level));
   return FMOD_RESULT.get(javaResult);
 }
Exemplo n.º 4
0
 public static FMOD_RESULT Memory_GetStats(
     IntBuffer currentalloced, IntBuffer maxalloced, boolean blocking) {
   if (currentalloced != null && !currentalloced.isDirect()) {
     throw new NonDirectBufferException();
   }
   if (maxalloced != null && !maxalloced.isDirect()) {
     throw new NonDirectBufferException();
   }
   int javaResult =
       FmodExJNI.FmodEx_Memory_GetStats(
           currentalloced,
           BufferUtils.getPositionInBytes(currentalloced),
           maxalloced,
           BufferUtils.getPositionInBytes(maxalloced),
           blocking);
   return FMOD_RESULT.get(javaResult);
 }
Exemplo n.º 5
0
 public static FMOD_RESULT Debug_SetLevel(int level) {
   int javaResult = FmodExJNI.FmodEx_Debug_SetLevel(level);
   return FMOD_RESULT.get(javaResult);
 }
Exemplo n.º 6
0
 public static String FMOD_ErrorString(FMOD_RESULT errCode) {
   return FmodExJNI.FMOD_ErrorString(errCode.asInt());
 }
Exemplo n.º 7
0
 public static FMOD_RESULT System_Create(System system) {
   int javaResult = FmodExJNI.FmodEx_System_Create(system);
   return FMOD_RESULT.get(javaResult);
 }
Exemplo n.º 8
0
 public static FMOD_RESULT File_SetDiskBusy(int busy) {
   int javaResult = FmodExJNI.FmodEx_File_SetDiskBusy(busy);
   return FMOD_RESULT.get(javaResult);
 }
Exemplo n.º 9
0
 private void errorCheck(FMOD_RESULT result) {
   if (result != FMOD_RESULT.FMOD_OK) {
     printfExit("FMOD error! (%d) %s\n", result.asInt(), FmodEx.FMOD_ErrorString(result));
   }
 }
Exemplo n.º 10
0
 private void checkError(FMOD_RESULT result, String s) {
   if (result != FMOD_RESULT.FMOD_OK) {
     throw new RuntimeException(
         "FMOD error: " + result.asInt() + " " + FmodEx.FMOD_ErrorString(result));
   }
 }