Exemple #1
0
	DLL_EXPORT_API npBool xnFoveStartup()
	{
		if (!__libFove)
		{
			__libFove = LoadDynamicLibrary("FoveClient");
			if (!__libFove) __libFove = LoadDynamicLibrary("x86\\FoveClient");
			if (!__libFove) __libFove = LoadDynamicLibrary("x64\\FoveClient");
			if (!__libFove) __libFove = LoadDynamicLibrary("x64/FoveClient");
			if (!__libFove) __libFove = LoadDynamicLibrary("x64/FoveClient");
			if (!__libFove)
			{
				return false;
			}

			GetFVRHeadsetPtr get_fvr_headset_ptr = (GetFVRHeadsetPtr)GetSymbolAddress(__libFove, "CGetFVRHeadset");
			if (!get_fvr_headset_ptr) return false;
			sHeadSet = get_fvr_headset_ptr();

			CGetFVRCompositorPtr get_fvr_compositor_ptr = (CGetFVRCompositorPtr)GetSymbolAddress(__libFove, "CGetFVRCompositor");
			if (!get_fvr_compositor_ptr) return false;
			sCompositor = get_fvr_compositor_ptr();
		}

		if(sHeadSet && !sFoveInitialized)
		{
			sFoveInitialized = sHeadSet->Initialise();
		}

		return sFoveInitialized;
	}
		npBool xnAudioInit()
		{
			if (OpenSLESLibrary) return true;

			OpenSLESLibrary = LoadDynamicLibrary("libOpenSLES");
			if (!OpenSLESLibrary) return false;

			SL_IID_ENGINE_PTR = (SLInterfaceID*)GetSymbolAddress(OpenSLESLibrary, "SL_IID_ENGINE");
			if (!SL_IID_ENGINE_PTR) return false;

			SL_IID_BUFFERQUEUE_PTR = (SLInterfaceID*)GetSymbolAddress(OpenSLESLibrary, "SL_IID_BUFFERQUEUE");
			if (!SL_IID_BUFFERQUEUE_PTR) return false;

			SL_IID_VOLUME_PTR = (SLInterfaceID*)GetSymbolAddress(OpenSLESLibrary, "SL_IID_VOLUME");
			if (!SL_IID_VOLUME_PTR) return false;

			SL_IID_PLAY_PTR = (SLInterfaceID*)GetSymbolAddress(OpenSLESLibrary, "SL_IID_PLAY");
			if (!SL_IID_PLAY_PTR) return false;

			SL_IID_PLAYBACKRATE_PTR = (SLInterfaceID*)GetSymbolAddress(OpenSLESLibrary, "SL_IID_PLAYBACKRATE");
			if (!SL_IID_PLAYBACKRATE_PTR) return false;

			slCreateEngineFunc = (slCreateEnginePtr)GetSymbolAddress(OpenSLESLibrary, "slCreateEngine");
			if (!slCreateEngineFunc) return false;

			return true;
		}
Exemple #3
0
static void RefreshAddresses(WATCHDATA *ptr, VARINFO *var, int address, THREAD *thread, int noscope)
{
    ptr->structNesting[ptr->nestingCount++] = var;
    while (var)
    {
        char buf[1048];
        int unscope = noscope;
        var->scope = ptr->structNesting[0]->scope;
        if (noscope)
            var->outofscope = TRUE;
        else
        {
            int val;
            var->outofscope = FALSE;
            if (thread)
                var->thread = thread;
            if (var->offset == -1)
            {
                DEBUG_INFO *dbg;
                int i;
                char name[2048];
                name[0] = 0;
                for (i=0; i < ptr->nestingCount-1; i++)
                    sprintf(name + strlen(name), "%s", ptr->structNesting[i]->structtag);
                sprintf(name + strlen(name), "@%s", var->membername);
                dbg = findDebug(ptr->structNesting[0]->scope->address);
                val = var->address = GetSymbolAddress(dbg, name);
                // static member data
            }
            else
            {
                val = var->address = address + var->offset;
            }
            if (var->constant)
                val = var->address;
            else if (var->pointer)
            {
                unscope = ((val = var->derefaddress) == -1 && !ReadValue(var->address, &val, 4, var)) || !val;
            }
            RefreshAddresses(ptr, var->subtype, val, thread, unscope);
        }
        var = var->link;
    }
    ptr->nestingCount--;
}