Esempio n. 1
0
void vTraceDtor(APG_PARSER_CTX* spParserCtx){
	if(spParserCtx->vpTraceCtx){
		APG_TRACE_CTX* spCtx = (APG_TRACE_CTX*)spParserCtx->vpTraceCtx;
		vVecDtor(spCtx->vpVecRecordStack);
		vMemFree(spParserCtx->vpMemCtx, spCtx->uipRules);
		if(spParserCtx->uiUdtCount){vMemFree(spParserCtx->vpMemCtx, spCtx->uipUdts);}
		memset((void*)spCtx, 0, sizeof(APG_TRACE_CTX));
		vMemFree(spParserCtx->vpMemCtx, spParserCtx->vpTraceCtx);
		spParserCtx->vpTraceCtx = NULL;
	}
}
Esempio n. 2
0
void* F_CALLBACK VisionFM_Realloc(void *ptr, unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr)
{
#ifndef _VISION_XENON
  if (ptr)
  {
    unsigned int iOldSize = g_FmodAllocations[ptr];
    g_FmodAllocations.RemoveKey(ptr);

    void* pNewPtr = vMemAlloc(size);
    g_FmodAllocations.SetAt(pNewPtr, size);

    memcpy(pNewPtr, ptr, iOldSize < size ? iOldSize : size);
    vMemFree(ptr);

    return pNewPtr;
  }
  else
  {
    void* ptr = vMemAlloc(size);
    g_FmodAllocations.SetAt(ptr, size);
    return vMemAlloc(size);
  }
#else
  return VFmodXenonRealloc(ptr, size, (type & FMOD_MEMORY_XBOX360_PHYSICAL)!=0);
#endif
}
Esempio n. 3
0
void VFmodManager::DeInitFmodSystem()
{
  IVisCallbackDataObject_cl dataBefore(&OnBeforeDeinitializeFmod);
  OnBeforeDeinitializeFmod.TriggerCallbacks(&dataBefore);

  m_pSoundResourceManager->PurgeUnusedResources();
  m_pEventGroupManager->PurgeUnusedResources();

  if (m_pEventSystem)
  { 
    m_pMusicGroup->release();
    m_pMusicGroup = NULL;

    FMOD_ERRORCHECK( m_pEventSystem->release());
#ifdef VFMOD_SUPPORTS_NETWORK
    if (m_config.bUseNetworkSystem)
      FMOD::NetEventSystem_Shutdown();
#endif
    m_pEventSystem = NULL;
    m_pSystem = NULL;
  }

  if (pMemoryPool)
  {
#ifndef _VISION_XENON
    vMemFree(pMemoryPool);
#else 
    VFmodXenonFree(pMemoryPool, true);
#endif
    pMemoryPool = NULL;
  }

  IVisCallbackDataObject_cl dataAfter(&OnAfterDeinitializeFmod);
  OnAfterDeinitializeFmod.TriggerCallbacks(&dataAfter);
}
Esempio n. 4
0
/** Destroys a timer component.
@param vpCtx context handle previously returned from vpTimerCtor()
@see vpTimerCtor()
*/
void vTimerDtor(void* vpCtx)
{
  APG_TIMER* spCtx = (APG_TIMER*)vpCtx;
  if(vpCtx && spCtx->vpValidate == vpCtx)
  {
    spCtx->vpValidate = NULL;
    vMemFree(spCtx->vpMemCtx, vpCtx);
  }
}
Esempio n. 5
0
void F_CALLBACK VisionFM_Free(void *ptr, FMOD_MEMORY_TYPE type, const char *sourcestr)
{
#ifndef _VISION_XENON
  g_FmodAllocations.RemoveKey(ptr);
  vMemFree(ptr);
#else
  VFmodXenonFree(ptr, (type & FMOD_MEMORY_XBOX360_PHYSICAL)!=0);
#endif
}
Esempio n. 6
0
/** Constructs a timer component.
@param vpMemCtx pointer to a Memory component
@see Memory.c
@see vpMemCtor()
@return a context handle
*/
void* vpTimerCtor(void* vpMemCtx)
{
  void* vpRet = NULL;
  APG_TIMER* spCtx = NULL;
  while(APG_TRUE)
  {

    if(!vpMemCtx){break;}
    if(!uiMemValidate(vpMemCtx)){break;}
    spCtx = (APG_TIMER*)vpMemAlloc(vpMemCtx, sizeof(APG_TIMER));
    if(!spCtx){break;}
    memset((void*)spCtx, 0, sizeof(APG_TIMER));
    spCtx->vpMemCtx = vpMemCtx;
    spCtx->dClocksPerSec = (double)CLOCKS_PER_SEC;
    spCtx->vpValidate = (void*)spCtx;
    vpRet = (void*)spCtx;
    break;
  }
  if(vpMemCtx)
  {
    if(!vpRet && spCtx){vMemFree(vpMemCtx, (void*)spCtx);}
  }
  return vpRet;
}