@ -16,7 +16,7 @@ public class UniQuake: MonoBehaviour
#endif
#endif
#endif
#endif
private const int MemSize = 0 x4000000 ; // 64 MB of heap space
private const int MemSize = 0 x8000000 ; // 128 MB of heap space
private IntPtr libraryHandle ;
private IntPtr libraryHandle ;
@ -73,7 +73,9 @@ public class UniQuake: MonoBehaviour
quakeParms = new QuakeParms
quakeParms = new QuakeParms
{
{
baseDir = Application . persistentDataPath ,
baseDir = Application . persistentDataPath ,
cacheDir = null ,
userDir = null , // TODO set this if user prefs need to be stored somewhere specific, otherwise this will be the same as baseDir
numCpus = SystemInfo . processorCount ,
errState = 0 ,
} ;
} ;
quakeParms . SetArguments ( arguments . ToArray ( ) ) ;
quakeParms . SetArguments ( arguments . ToArray ( ) ) ;
quakeParms . AllocateMemory ( MemSize ) ;
quakeParms . AllocateMemory ( MemSize ) ;
@ -82,8 +84,8 @@ public class UniQuake: MonoBehaviour
try
try
{
{
UniQuake_SetFmodSystem ( AudioManager . Instance . FmodSystem . handle ) ;
UniQuake_Init ( quakeParms , systemModule . ToInt Ptr, renderModule . ToInt Ptr) ;
// UniQuake_SetFmodSystem(AudioManager.Instance.FmodSystem.handle);
UniQuake_Init ( quakeParms . ToNativePtr ( ) , systemModule . Callbacks Ptr, renderModule . Callbacks Ptr) ;
initialized = true ;
initialized = true ;
}
}
catch ( QuakeException ex )
catch ( QuakeException ex )
@ -149,7 +151,7 @@ public class UniQuake: MonoBehaviour
}
}
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void UniQuake_InitFunc ( QuakeParms parms , IntPtr sysCalls , IntPtr glCalls ) ;
private delegate void UniQuake_InitFunc ( IntPtr parms , IntPtr sysCalls , IntPtr glCalls ) ;
private UniQuake_InitFunc UniQuake_Init ;
private UniQuake_InitFunc UniQuake_Init ;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
@ -176,7 +178,7 @@ public class UniQuake: MonoBehaviour
UniQuake_Init = LoadLibraryFunction < UniQuake_InitFunc > ( "UniQuake_Init" ) ;
UniQuake_Init = LoadLibraryFunction < UniQuake_InitFunc > ( "UniQuake_Init" ) ;
UniQuake_Update = LoadLibraryFunction < UniQuake_UpdateFunc > ( "UniQuake_Update" ) ;
UniQuake_Update = LoadLibraryFunction < UniQuake_UpdateFunc > ( "UniQuake_Update" ) ;
UniQuake_Shutdown = LoadLibraryFunction < UniQuake_ShutdownFunc > ( "UniQuake_Shutdown" ) ;
UniQuake_Shutdown = LoadLibraryFunction < UniQuake_ShutdownFunc > ( "UniQuake_Shutdown" ) ;
UniQuake_SetFmodSystem = LoadLibraryFunction < UniQuake_SetFmodSystemFunc > ( "UniQuake_SetFmodSystem" ) ;
// UniQuake_SetFmodSystem = LoadLibraryFunction<UniQuake_SetFmodSystemFunc>("UniQuake_SetFmodSystem");
}
}
private TDelegate LoadLibraryFunction < TDelegate > ( string functionName )
private TDelegate LoadLibraryFunction < TDelegate > ( string functionName )