Пример #1
0
//---------------------------------------------------------------------------//
// LiberaVars
//
//---------------------------------------------------------------------------//
void CCamara3D::LiberaVars()
{
  DISPOSE(m_pPathSrc);
  DISPOSE(m_pPathTgt);
  DISPOSE(m_pPathUp );
  DISPOSE(m_pPathFov);
}
Пример #2
0
//---------------------------------------------------------------------------//
// Load
//
//---------------------------------------------------------------------------//  
void CLink::Load(CNodeFile::CNode *pNode)
{
  DISPOSE(m_Device);
  DISPOSE(m_Behaviour);
  // Load Device
  switch (pNode->AttrAsInt("dev"))
  {
    case CLinkDevice::KEYBOARD:    m_Device = NEW CLinkDevice_Keyboard(); break;
    case CLinkDevice::BEAT:        m_Device = NEW CLinkDevice_Beat    (); break;
    case CLinkDevice::TIMER:       m_Device = NEW CLinkDevice_Beat    (); break;
    case CLinkDevice::WAVE:        m_Device = NEW CLinkDevice_Beat    (); break;
    case CLinkDevice::MIDI_NOTE:   m_Device = NEW CLinkDevice_Beat    (); break;
    case CLinkDevice::MIDI_SLIDER: m_Device = NEW CLinkDevice_Beat    (); break;
    case CLinkDevice::MIDI_CLOCK:  m_Device = NEW CLinkDevice_Beat    (); break;
  }
  if (m_Device)
    m_Device->Load(pNode);
  // Load Behaviour
  switch (pNode->AttrAsInt("beh"))
  {
    case CLinkBehaviour::CHECK_BOX: m_Behaviour = NEW CLinkBehaviour_CheckBox(0, false);   break;
    case CLinkBehaviour::COMBO_BOX: m_Behaviour = NEW CLinkBehaviour_ComboBox(0, 0, 0, 0); break;
    case CLinkBehaviour::TRACK_BAR: m_Behaviour = NEW CLinkBehaviour_TrackBar(0, 0);       break;
  }
  if (m_Behaviour)
    m_Behaviour->Load(pNode);
}
Пример #3
0
//********************************************************************
//
//********************************************************************
//--------------------------------------------------------------------
//
//--------------------------------------------------------------------
bool GraphSourceRandom::createStreams()
{
    bool bOK = true;

    if ( bOK )
    {
        mStreamVideo = NEW NWStreamVideo();
        bOK = mStreamVideo->init();
        if ( bOK )
            mStreamGroupOutput->addStream(mStreamVideo);
        else
            DISPOSE(mStreamVideo);
    }

    if ( bOK )
    {
        mStreamAudio = NEW NWStreamAudio();
        bOK = mStreamAudio->init();
        if ( bOK )
            mStreamGroupOutput->addStream(mStreamAudio);
        else
            DISPOSE(mStreamAudio);
    }

    if ( bOK )
    {
        sendStreamProperties();
    }

    return bOK;
}
Пример #4
0
bool compressStart( DESCRIPTOR_DATA * d )
{
   z_stream *s;

   if( d->mccp->out_compress )
      return TRUE;

   CREATE( s, z_stream, 1 );
   CREATE( d->mccp->out_compress_buf, unsigned char, COMPRESS_BUF_SIZE );

   s->next_in = NULL;
   s->avail_in = 0;

   s->next_out = d->mccp->out_compress_buf;
   s->avail_out = COMPRESS_BUF_SIZE;

   s->zalloc = Z_NULL;
   s->zfree = Z_NULL;
   s->opaque = NULL;

   if( deflateInit( s, 9 ) != Z_OK )
   {
      DISPOSE( d->mccp->out_compress_buf );
      DISPOSE( s );
      return FALSE;
   }

   write_to_descriptor( d, (const char *)start_compress2_str, 0 );

   d->can_compress = TRUE;
   d->mccp->out_compress = s;

   return TRUE;
}
Пример #5
0
void clear_news( bool sMatch, int nCount )
{
    int                     nCurrent = 1;
    NEWS_DATA              *news;

    if ( sMatch == FALSE ) {
        while ( ( news = first_news ) != NULL ) {
            STRFREE( news->data );
            UNLINK( news, first_news, last_news, next, prev );
            DISPOSE( news );
        }
    }
    else {
        for ( news = first_news; news != NULL; news = news->next ) {
            if ( nCount == nCurrent ) {
                STRFREE( news->data );
                UNLINK( news, first_news, last_news, next, prev );
                DISPOSE( news );
                break;
            }
            else
                nCurrent++;
        }
    }
}
Пример #6
0
void free_ban( BAN_DATA * pban )
{
    DISPOSE( pban->name );
    DISPOSE( pban->ban_time );
    STRFREE( pban->note );
    DISPOSE( pban->ban_by );
    DISPOSE( pban );
}
Пример #7
0
void free_holiday( HOLIDAY_DATA * day )
{
   UNLINK( day, first_holiday, last_holiday, next, prev );
   DISPOSE( day->announce );
   DISPOSE( day->name );
   DISPOSE( day );
   return;
}
/*
==================
Free Indielib managers
==================
*/
void CIndieLib::end() {
	
    // ----- Freeing objects -----

	_math                ->end();
	//_meshManager           ->end();
	_input               ->end();
	_entity2dManager     ->end();
	//_entity3dManager       ->end();
	_fontManager         ->end();
	_animationManager    ->end();
	_surfaceManager      ->end();
	_imageManager        ->end();
	//_lightManager      ->end();
	_render              ->end();

	DISPOSE(_math);
	//DISPOSE(_meshManager);
	DISPOSE(_input);
	DISPOSE(_entity2dManager);
	//DISPOSE(_entity3dManager);
	DISPOSE(_fontManager);
	DISPOSE(_animationManager);
	DISPOSE(_surfaceManager);
    DISPOSE(_imageManager);
	//DISPOSE(_lightManager);
	DISPOSE(_render);

	IndieLib::end();

    DISPOSE(_pinstance);
}
Пример #9
0
PUBLIC void STL_End(STL_PStringList l) {
    STL_PNode p, q;

    assert(l != NULL);
    for (p = l->first; p != NULL; p = q) {
        q = p->next;
        DISPOSE(p);
    }
    DISPOSE(l->first);
    l->nstr = 0;
}
Пример #10
0
/*
 * Libera dalla memoria un sinonimo
 */
void free_synonym( SYNO_DATA *synonym )
{
	if ( !synonym )
	{
		send_log( NULL, LOG_BUG, "free_synonym: synonym passato è NULL" );
		return;
	}

	DISPOSE( synonym->syn );
	DISPOSE( synonym );
}
Пример #11
0
/*
**  Free the map.
*/
void
MAPfree()
{
    register PAIR	*mp;

    for (mp = MAPdata; mp < MAPend; mp++) {
	DISPOSE(mp->Key);
	DISPOSE(mp->Value);
    }
    DISPOSE(MAPdata);
    MAPdata = NULL;
}
Пример #12
0
/*
 * Libera dalla memoria tutti le procedure speciali
 */
void free_all_specfuns( void )
{
	SPECFUN_DATA *specfun;

	for ( specfun = first_specfun;  specfun;  specfun = first_specfun )
	{
		UNLINK( specfun, first_specfun, last_specfun, next, prev );
		top_specfun--;

		DISPOSE( specfun->name );
		DISPOSE( specfun );
	}
}
Пример #13
0
//---------------------------------------------------------------------------//
// Destructor
//
//---------------------------------------------------------------------------//  
CMGEffect::~CMGEffect()
{
  g_pAppMain->VJController()->FXUnload(m_ID);
  if (m_ActiveScopePanel)
    m_ActiveScopePanel->SetParent (NULL);
  for (unsigned i = 0; i < m_VJScopeVars.size(); i++)
  {
    for (unsigned j = 0; j < m_VJScopeVars[i].size(); j++)
      DISPOSE(m_VJScopeVars[i][j]);
  }
  DISPOSE(m_Bitmap);
  g_pAppMain->ShowEffect(NULL);
  CMGControl::~CMGControl();
}
Пример #14
0
//---------------------------------------------------------------------------//
// Init
//
//---------------------------------------------------------------------------//
bool CFXAviVideo::Init(const string &sFile)
{
  m_bOk = true;
  if (sFile != "")
  {
    m_pAvi = NEW CAviDecoder;
    if (m_pAvi->Init(sFile.c_str(), m_Bpp))
    {
      // Overload target settings
      if (m_Bpp == 32)
        m_iTextura = g_pGestorMateriales->AddTextura(m_pAvi->GetWidth(), m_pAvi->GetHeight(), HARD_TEX_FORMAT_A8R8G8B8);
      else
        m_iTextura = g_pGestorMateriales->AddTextura(m_pAvi->GetWidth(), m_pAvi->GetHeight(), HARD_TEX_FORMAT_A1R5G5B5);
      if (m_iTextura < 0)
      {
        DISPOSE(m_pAvi);
        GLOG(("ERR: Can't initialize source texture for AVI file %s\n", sFile.c_str()));
        m_bOk = false;
      }
    }
    else
    {
      DISPOSE(m_pAvi);
      GLOG(("ERR: Can't initialize AVI file %s\n", sFile.c_str()));
      m_bOk = false;
    }
  }
  else
  {
    GLOG(("ERR: FXFile not specified for an FXAviVideo instance\n"));
    m_bOk = false;
  }

  // Save length
  if (IsOk())
  {
    m_fLength = m_pAvi->Length();
    m_fStart  = 0.f;
    m_fEnd    = 1.f;
    m_fCropL  = 0.f;
    m_fCropR  = 1.f;
    m_fCropT  = 0.f;
    m_fCropB  = 1.f;
    m_Color   = HARD_COLOR_ARGB(255,255,255,255);
    m_bInvert = false;
  }

  return (IsOk());
}
/**
 * This function returns 1 (true) if the 3d Mesh object passed as parameter exists and is
 * deleted from the manager successfully.
 * @param pMe			Pointer to an 3d Mesh object.
 */
bool IND_3dMeshManager::remove(IND_3dMesh *pMe) {
	g_debug->header("Freeing 3d Mesh", 5);

	if (!_ok || !pMe) {
		writeMessage();
		return 0;
	}

	// Search object
	bool mIs = 0;
	list <IND_3dMesh *>::iterator _listIter;
	for (_listIter  = _list3dMesh->begin();
	        _listIter != _list3dMesh->end();
	        _listIter++) {
		if ((*_listIter) == pMe) {
			mIs = 1;
			break;
		}
	}

	// Not found
	if (!mIs) {
		writeMessage();
		return 0;
	}

	// ----- Free object -----

	g_debug->header("Freeing 3d mesh:", 3);
	g_debug->dataChar(pMe->GetMeshName(), 1);

	// Quit from list
	delFromlist(pMe);

	// Free mesh
	if (pMe->_3dMesh._animController) {
		pMe->_3dMesh._animController->Release();
		pMe->_3dMesh._animController = 0;
	}

	// free hierarchy
	if (pMe->_3dMesh._frameRoot) {
		// Create a mesh heirarchy class to control the removal of memory for the frame heirarchy
		XMeshHierarchy memoryAllocator;
		D3DXFrameDestroy(pMe->_3dMesh._frameRoot, &memoryAllocator);
		pMe->_3dMesh._frameRoot = 0;
	}

	// Free bones
	if (pMe->_3dMesh._boneMatrices) {
		DISPOSEARRAY(pMe->_3dMesh._boneMatrices);
	}

	// Free the pointer
	DISPOSE(pMe);

	g_debug->header("Ok", 6);

	return 1;
}
Пример #16
0
void free_game( GAME_BOARD_DATA * board )
{
	if ( !board )
		return;

#ifdef IMC
	if ( board->type == TYPE_IMC )
	{
		imc_send_chess( board->player1 ? board->player1 : NULL, board->player2, "stop" );
		STRFREE( board->player2 );
	}
#endif

	if ( board->player1 )
	{
		if ( CHAR_DATA * ch = get_char_world( supermob, board->player1 ) )	// Added for bugfix - Findecano 23/11/07
		{
			ch_printf( ch, "The game has been stopped at %d total moves.\r\n", board->turn );
			ch->pcdata->game_board = NULL;
		}
	}

	if ( board->player2 )
	{
		if ( CHAR_DATA * ch = get_char_world( supermob, board->player2 ) )	// Added for bugfix - Findecano 23/11/07
		{
			ch_printf( ch, "The game has been stopped at %d total moves.\r\n", board->turn );
			ch->pcdata->game_board = NULL;
		}
	}
	STRFREE( board->player1 );
	STRFREE( board->player2 );
	DISPOSE( board );
}
Пример #17
0
//---------------------------------------------------------------------------//
// WinMain
//
//---------------------------------------------------------------------------//
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
  CoInitialize(NULL);
  InitFloatToStr();
  srand ((unsigned)time(NULL));

  // Load launcher
  CLauncher Launcher;
  if (Launcher.Show((unsigned)hInstance))
  {
      string lLogFile = "neonv2.log";
      GESTION_MEMORIA_INIT();
      GLOGSTART(LOGLISTBOX, (long)lLogFile.c_str());

      CLuaPlayer *pLuaPlayer = NEW CLuaPlayer();
      pLuaPlayer->Init(hInstance);

      while (pLuaPlayer->Update() && !s_End)
      {
        pLuaPlayer->Draw();
      }
      DISPOSE(pLuaPlayer);


      GLOGEND();
      GESTION_MEMORIA_END();
  }

  IAppOptions::EndInstance();

  return 0;
}
Пример #18
0
void comment_remove( CHAR_DATA * victim, NOTE_DATA * pnote )
{
   if( !victim->comments )
   {
      bug( "comment remove: null board", 0 );
      return;
   }

   if( !pnote )
   {
      bug( "comment remove: null pnote", 0 );
      return;
   }

   /*
    * Remove comment from linked list.
    */
   if( !pnote->prev )
      victim->comments = pnote->next;
   else
      pnote->prev->next = pnote->next;

   STRFREE( pnote->text );
   STRFREE( pnote->subject );
   STRFREE( pnote->to_list );
   STRFREE( pnote->date );
   STRFREE( pnote->sender );
   DISPOSE( pnote );

   /*
    * Rewrite entire list.
    */
   save_char_obj( victim );
   return;
}
Пример #19
0
//---------------------------------------------------------------------------//
// CreateFX
//
//---------------------------------------------------------------------------//  
CMGEffect *CMGEffect::Create(const string &sFile)
{
  CMGEffect *pEffect = NEW CMGEffect();
  if (!pEffect->Load(sFile))
    DISPOSE(pEffect);
  return pEffect;
}
Пример #20
0
void do_remcontract( CHAR_DATA * ch, char *argument )
{
   CONTRACT_DATA *contract;
   CONTRACT_DATA *scontract = NULL;

   if( argument[0] == '\0' )
   {
      send_to_char( "&RSyntax: remcontract <target name>\n\r", ch );
      return;
   }

   for( contract = ch->first_contract; contract; contract = contract->next_in_contract )
   {
      if( !str_cmp( contract->target, argument ) )
      {
         scontract = contract;
         break;
      }
   }

   if( !scontract || scontract == NULL )
   {
      send_to_char( "No such target.\n\r", ch );
      return;
   }

   STRFREE( scontract->target );
   UNLINK( scontract, ch->first_contract, ch->last_contract, next_in_contract, prev_in_contract );
   DISPOSE( scontract );

   send_to_char( "Contract removed.\n\r", ch );
   return;

}
Пример #21
0
//----------------------------------------------------------------------------
//
//----------------------------------------------------------------------------
NWThreadInstance::~NWThreadInstance()
{
    waitForEnd();

    DISPOSE(mNWThreadInitData);
    CloseHandle(mNWThreadHandle);
}
/*
==================
Free manager memory
==================
*/
void IND_TmxMapManager::freeVars() {
// FIXME: free chararray for name and free the TMXMap itself fo each of the IND_TmxMap
//	// Deletes all the manager entities
//	list <IND_Image *>::iterator mImageListIter;
//	for (mImageListIter  = _listImages->begin();
//	        mImageListIter != _listImages->end();
//	        mImageListIter++) {
//			FIBITMAP* handle = (*mImageListIter)->getFreeImageHandle();
//		if (handle) {
//			g_debug->header("Freeing image:", DebugApi::LogHeaderInfo);
//			g_debug->dataChar((*mImageListIter)->getName(), 1);
//
//			// Free image
//			FreeImage_Unload(handle);
//
//			// Free the string of the extension
//			DISPOSEARRAY((*mImageListIter)->_image._ext);
//		}
//	}
//
	// Clear list
	_listMaps->clear();

	// Free list
	DISPOSE(_listMaps);
}
Пример #23
0
void free_song_index( SONG_DATA *pSong )
{
    PERFORM_DATA *pPerf, *pPerf_next;

    free_string( pSong->name );
    free_string( pSong->description );
    free_string( pSong->comments );

    for ( pPerf = pSong->perform; pPerf; pPerf = pPerf_next )
    {
        pPerf_next = pPerf->next;
        free_string( pPerf->perform_prog[0] );
        free_string( pPerf->perform_prog[1] );
        free_string( pPerf->perform_prog[2] );
        free_string( pPerf->perform_prog[3] );
        DISPOSE( pPerf );
    }

    pSong->perform   = NULL;

    pSong->next      = song_index_free;
    song_index_free = pSong;

    return;
}
Пример #24
0
/*
 * Libera la struttura di una scacchiera
 */
void free_chessboard( CHESSBOARD_DATA *board )
{
	char	buf[MSL];

	if ( !board )
	{
		send_log( NULL, LOG_BUG, "free_board: board passata è NULL" );
		return;
	}

	sprintf( buf, "Il gioco è terminato dopo %d mosse.\r\n", board->moves );

	if ( board->player1 )
		send_to_char( board->player1, buf );

	if ( board->player2 )
		send_to_char( board->player2, buf );

	UNLINK( board, first_chessboard, last_chessboard, next, prev );
	top_chessboard--;

	board->player1 = NULL;
	board->player2 = NULL;
	board->turn	   = NULL;
	destroybv( board->flags1 );
	destroybv( board->flags2 );
	DISPOSE( board );
}
IND_Entity2d::~IND_Entity2d() {
    DISPOSE(_listBoundingCollision);

    if (_text) {
        free (_text);
    }
}
Пример #26
0
/* Take a qbit off a character */
void remove_qbit( CHAR_DATA * ch, int number )
{
   BIT_DATA *bit;

   if( IS_NPC( ch ) )
      return;

   if( number < 0 || number > MAX_xBITS )
      return;

   if( !ch->pcdata->first_qbit )
      return;

   bit = ch->pcdata->first_qbit;
   while( bit )
   {
      BIT_DATA *tmp;

      if( bit->number == number )
      {
         tmp = bit;
         bit = bit->next;
         UNLINK( tmp, ch->pcdata->first_qbit, ch->pcdata->last_qbit, next, prev );
         DISPOSE( tmp );
      }
      else
         bit = bit->next;
   }
}
Пример #27
0
//---------------------------------------------------------------------------//
// CreateFX
//
//---------------------------------------------------------------------------//  
CMGEffect *CMGEffect::Create(CNodeFile::CNode *pNode)
{
  CMGEffect *pEffect = NEW CMGEffect();
  if (!pEffect->Load(pNode))
    DISPOSE(pEffect);
  return pEffect;
}
Пример #28
0
//---------------------------------------------------------------------------//
// Clear
//
//---------------------------------------------------------------------------//
void CMGTreeView::Clear()
{
  m_Selected = NULL;
  DISPOSE(m_Root);
  SetRootItem(NULL);
  Repaint();
}
Пример #29
0
/*
==================
Release texture data in render side
==================
*/
void IND_Surface::freeTextureData() {
   if (!_surface) return;

    // Free textures
    int numTextures (getNumTextures());
    
    if(0 != numTextures) {
        //Free all texture handles from renderer
#ifdef INDIERENDER_DIRECTX
        //LOOP - All textures
        for (int i = 0; i < numTextures; i++) {
            _surface->_texturesArray [i]._texture->Release();
        }//LOOP END
#endif
#ifdef INDIERENDER_OPENGL
		glDeleteTextures(numTextures,_surface->_texturesArray);
#endif
	}

    _surface->_attributes._isHaveSurface = 0;
    _surface->_attributes._blocksX = 0;
    _surface->_attributes._blocksY = 0;
    _surface->_attributes._numTextures = 0;
    
    DISPOSE(_surface);
}
Пример #30
0
static void
Free_TarSCC(PSS_TarSCC scc)
{
    /* first check to make sure it is not the first scc in the tloop's list */
    if (scc->tloop->sccs == scc)
    {
        /* sanity check */
        if (scc->prev != NULL)
            P_punt("Free_TarSCC: Malformed SCC List");

        /* make sure we are not the last element in the list */
        if (scc->next)
        {
            scc->next->prev = NULL;
        }
        scc->tloop->sccs = scc->next;
    }
    else if (scc->next == NULL) /* last element in the list */
    {
        scc->prev->next = NULL;
    }
    else /* middle element */
    {
        /* sanity check */
        if (!(scc->next) || !(scc->prev))
            P_punt("Free_TarSCC: Malformed SCC List");

        scc->prev->next = scc->next;
        scc->next->prev = scc->prev;
    }

    List_reset(scc->tnode_list);

    DISPOSE(scc);
}