예제 #1
0
int main(int argCount, char *arg[]){	
	if (argCount == 4){
	
		clock_t start, end;
		
		// Load two files
		HEAD *dry = getFile(arg[1]);
		HEAD *iresp = getFile(arg[2]);
		HEAD *output = malloc(sizeof(HEAD));
		if (dry == NULL || iresp == NULL || output == NULL){
			printf("MAIN - Could not load sample files\n");
			destroyAll(dry, iresp, output);
			exit(-1);
		}	
		printf("MAIN - Created Space for 3 files\n");
		// Determine data size for output file
		U_INT dataSize;
		U_INT impSize;
		memcpy(&dataSize, &dry->head[DATA_SIZE], WORD);
		memcpy(&impSize, &iresp->head[DATA_SIZE], WORD);
		
		U_INT outSamples = ((dataSize + impSize)/2) - 1;
		output->head = generateHead(dataSize + impSize - HALFWORD);
		output->data = calloc(sizeof(float), outSamples);
		if (output->head == NULL || output->data == NULL){
			printf("MAIN - Could not generate output file\n");
			destroyAll(dry, iresp, output);
			exit(-1);
		}
		
		// Convolve
		printf("MAIN - setup output file, starting convolve...\n");
		start = clock();
		inputSide(dry, iresp, output);
		end = clock();
		printf("MAIN - finished convolution in %ld\n", (end - start)/CLOCKS_PER_SEC);
		
		// Save file
		writeToFile(output, arg[3]);
		printf("MAIN - Wrote to file\n");
		
		// Clean up
		destroyAll(dry, iresp, output);
		printf("MAIN - Cleaned up data\n");
		
	} else {
		printf("invalid number of arguments\n");
		exit(0);
	} 
}
예제 #2
0
HashingBase &HashingBase::operator=(const HashingBase &H)
{
	destroyAll();
	free(m_table);
	copyAll(H);
	return *this;
}
PUBeamRender::~PUBeamRender()
{
    if (!_particleSystem)
        return;

    destroyAll();
}
PURibbonTrailRender::~PURibbonTrailRender()
{
    if (!_particleSystem)
        return;

    destroyAll();
}
예제 #5
0
void
ResultSet::clear()
{
   // Clearing the ResultSet is simple, as the superclass UtlSList is the
   // entirety of its state.
   destroyAll();
}
예제 #6
0
	void ParticleManager::shutdown() {
		_newParticles.clear();
		for (std::vector<std::string>::iterator p = _deletedParticles.begin( ); p != _deletedParticles.end(); ++p) {
			destroy(*p);
		}
		_deletedParticles.clear();		
		destroyAll();
	}
예제 #7
0
void HashingBase::clear()
{
	destroyAll();
	free(m_table);

	m_count = 0;
	init(m_minTableSize);
}
예제 #8
0
    //---------------------------------------------------------------------
    OverlayManager::~OverlayManager()
    {
		destroyAllOverlayElements(false);
		destroyAllOverlayElements(true);
        destroyAll();

        // Unregister with resource group manager
		ResourceGroupManager::getSingleton()._unregisterScriptLoader(this);
    }
예제 #9
0
	void MaterialInstance::setShadersEnabled (bool enabled)
	{
		if (enabled == mShadersEnabled)
			return;
		mShadersEnabled = enabled;

		// trigger updates
		if (mMaterial.get())
			destroyAll();
	}
예제 #10
0
//----------------------------------------------------------------------------//
FontManager::~FontManager()
{
    Logger::getSingleton().logEvent(
        "---- Begining cleanup of Font system ----");

    destroyAll();

    char addr_buff[32];
    sprintf(addr_buff, "(%p)", static_cast<void*>(this));
    Logger::getSingleton().logEvent(
        "CEGUI::FontManager singleton destroyed. " + String(addr_buff));
}
예제 #11
0
//----------------------------------------------------------------------------//
ImageManager::~ImageManager()
{
    destroyAll();

    while (!d_factories.empty())
        removeImageType(d_factories.begin()->first);

    char addr_buff[32];
    std::sprintf(addr_buff, "(%p)", static_cast<void*>(this));
    Logger::getSingleton().logEvent(
       "[CEGUI::ImageManager] Singleton destroyed " + String(addr_buff));
}
예제 #12
0
    //---------------------------------------------------------------------
    OverlayManager::~OverlayManager()
    {
		destroyAllOverlayElements(false);
		destroyAllOverlayElements(true);
        destroyAll();

		for(FactoryMap::iterator i = mFactories.begin(); i != mFactories.end(); ++i)
        {
            OGRE_DELETE i->second;
        }

        // Unregister with resource group manager
		ResourceGroupManager::getSingleton()._unregisterScriptLoader(this);
    }
예제 #13
0
// Assignment operator
UtlCopyableSList& UtlCopyableSList::operator=(const UtlCopyableSList& rhs)
{
   if (this == &rhs)            // handle the assignment to self case
      return *this;

   destroyAll();
   UtlSListIterator it(rhs);
   UtlCopyableContainable* item;
   while(item = static_cast<UtlCopyableContainable*>(it()))
   {
      insert(item->clone());
   }

   return *this;
}
예제 #14
0
void FileTransferManager::readFromConfig()
{
	kdebugf();

	destroyAll();
	QDomElement fts_elem = xml_config_file->findElement(xml_config_file->rootElement(), "FileTransfers");
	if (fts_elem.isNull())
		return;

	QDomNodeList ft_list = fts_elem.elementsByTagName("FileTransfer");
	FileTransfer *ft;
	for (unsigned int i = 0; i < ft_list.count(); i++)
	{
		ft = FileTransfer::fromDomElement(ft_list.item(i).toElement(), this);
		connect(ft, SIGNAL(fileTransferFinished(FileTransfer *)), this, SLOT(fileTransferFinishedSlot(FileTransfer *)));
	}

	kdebugf2();
}
예제 #15
0
int startGame(){
	configAll();

	BITMAP * nave = load_bitmap("img/35x45/nave.bmp",NULL);
	BITMAP * alien = load_bitmap("img/35x45/alien.bmp", NULL);
	BITMAP * gun = load_bitmap("img/35x45/gun.bmp", NULL);
	BITMAP * init = load_bitmap("img/start.bmp", NULL);
	BITMAP * bg = load_bitmap("img/bartop.bmp", NULL);
	BITMAP * buffer = create_bitmap(SCREEN_W,SCREEN_H);
	SAMPLE * sound = load_wav("wav/tiro.wav");
	SAMPLE * music = load_sample("wav/laserHit.wav");

	initStart(buffer,init);
	install_int_ex(countXa,SECS_TO_TIMER(1));
	install_int_ex(countGun,MSEC_TO_TIMER(1));
	gameControll(nave,buffer,alien,gun,bg,sound,music);
	destroyAll(nave,buffer,alien,gun,init,bg,sound,music);
	return 0;
}
예제 #16
0
FileTransferManager::~FileTransferManager()
{
	kdebugf();

	writeToConfig();

	notification_manager->unregisterEvent("FileTransfer");
 	notification_manager->unregisterEvent("FileTransfer/IncomingFile");
	notification_manager->unregisterEvent("FileTransfer/Finished");

	disconnect(kadu, SIGNAL(keyPressed(QKeyEvent*)), this, SLOT(kaduKeyPressed(QKeyEvent*)));

	UserBox::removeActionDescription(sendFileActionDescription);
	delete sendFileActionDescription;

	dcc_manager->removeHandler(this);

	disconnect(chat_manager, SIGNAL(chatWidgetCreated(ChatWidget *)), this, SLOT(chatCreated(ChatWidget *)));
	disconnect(chat_manager, SIGNAL(chatWidgetDestroying(ChatWidget *)), this, SLOT(chatDestroying(ChatWidget *)));

	foreach(ChatWidget *it, chat_manager->chats())
		chatDestroying(it);

	destroyAll();

	kadu->removeMenuActionDescription(fileTransferWindowActionDescription);
	delete fileTransferWindowActionDescription;

	if (fileTransferWindow)
	{
		disconnect(this, SIGNAL(newFileTransfer(FileTransfer *)),
			fileTransferWindow, SLOT(newFileTransfer(FileTransfer *)));
		delete fileTransferWindow;
	}

	kdebugf2();
}
예제 #17
0
gkParticleManager::~gkParticleManager()
{
	destroyAll();

	delete m_private; m_private = 0;
}
예제 #18
0
LinkListBase::~LinkListBase()
{
	destroyAll();
	delete mHead;
	delete mTail;
}
예제 #19
0
int qml_interface::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0:
            itFogz();
            break;
        case 1:
            destroyAll();
            break;
        case 2:
            fair();
            break;
        case 3:
            pCloudy();
            break;
        case 4:
            cloudy();
            break;
        case 5:
            rain();
            break;
        case 6:
            thunder();
            break;
        case 7:
            snow();
            break;
        case 8:
            updateSlot();
            break;
        case 9:
            replyFinished((*reinterpret_cast< QNetworkReply*(*)>(_a[1])));
            break;
        case 10: {
            QString _r = getWindSpeed();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r;
        }
        break;
        case 11: {
            QString _r = getWindDirection();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r;
        }
        break;
        case 12: {
            QString _r = getTemperature();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r;
        }
        break;
        case 13: {
            QString _r = getTime();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r;
        }
        break;
        case 14: {
            QString _r = depsurx();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r;
        }
        break;
        case 15: {
            QString _r = arvsurx();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r;
        }
        break;
        case 16: {
            QString _r = depsury();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r;
        }
        break;
        case 17: {
            QString _r = arvsury();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r;
        }
        break;
        case 18: {
            QString _r = depsurz();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r;
        }
        break;
        case 19: {
            QString _r = arvsurz();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r;
        }
        break;
        case 20: {
            QString _r = getNextUpdate();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r;
        }
        break;
        case 21: {
            QString _r = getFrequence();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r;
        }
        break;
        case 22: {
            QString _r = getSymbol();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r;
        }
        break;
        case 23:
            ItFogs();
            break;
        case 24: {
            int _r = getPositionCiel();
            if (_a[0]) *reinterpret_cast< int*>(_a[0]) = _r;
        }
        break;
        case 25:
            setSymbol();
            break;
        case 26: {
            QString _r = getRandomInteger();
            if (_a[0]) *reinterpret_cast< QString*>(_a[0]) = _r;
        }
        break;
        default:
            ;
        }
        _id -= 27;
    }
#ifndef QT_NO_PROPERTIES
    else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0:
            *reinterpret_cast< Forecast*>(_v) = getCurrentForecast();
            break;
        }
        _id -= 1;
    } else if (_c == QMetaObject::WriteProperty) {
        _id -= 1;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 1;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 1;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
TextureManager::~TextureManager() {

	destroyAll();
}
예제 #21
0
ResultSet::~ResultSet() 
{
    // make sure we destroy the records 
    // we allocated in the addValue method
    destroyAll();
}
gkHUDManager::~gkHUDManager()
{
	destroyAll();
}
예제 #23
0
gkTextManager::~gkTextManager()
{
	destroyAll();
}
예제 #24
0
EntityMgr::~EntityMgr() {
    destroyAll();
}
예제 #25
0
Viewer::~Viewer() {
	//@@ a faire
	destroyAll();

	fprintf(stdout, "\n");
}
void PURibbonTrailRender::unPrepare()
{
    destroyAll();
}
예제 #27
0
void
Splot_EnemyFleet::update ()
{
  State_t& state = SPLOT_STATE_SINGLETON::instance ()->get ();
  GameState_t& game_state = SPLOT_STATE_SINGLETON::instance ()->gameState ();

  //-- maintain fleet enemies
  float tmp_size, size[2], position[3], score = 0.0F;
  int num = 0;
  Splot_EnemyAircraft* prev, *tmp;
  Splot_EnemyAircraft* current = inherited::free_list_;
  while (current)
  {
    num++;
    current->update ();

    position[0] = current->position_[0];
    position[1] = current->position_[1];
    position[2] = current->position_[2];
    // add some damage explosions to the bosses when hit
    if (current->type_ >= ENEMYAIRCRAFT_BOSS_0)
    {
      tmp_size = current->size_[0]*0.7F;
      size[0] = tmp_size;
      size[1] = tmp_size;
      if ((current->damage_ > current->baseDamage_*0.7F) &&
          !(state.game_frame%18))
      {
        position[0] = current->position_[0]+SRAND*size[0];
        position[1] = current->position_[1]+SRAND*size[1];
        //position[2] = current->position_[2];
        state.explosions->add (EXPLOSION_ENEMY_DAMAGED, position, 0, 1.0);
      } // end IF
      if ((current->damage_ > current->baseDamage_*0.5F) &&
          !(state.game_frame%10))
      {
        position[0] = current->position_[0]+SRAND*size[0];
        position[1] = current->position_[1]+SRAND*size[1];
        //position[2] = current->position_[2];
        state.explosions->add (EXPLOSION_ENEMY_DAMAGED, position, 0, 1.0);
      } // end IF
      if ((current->damage_ > current->baseDamage_*0.3F) &&
          !(state.game_frame%4))
      {
        position[0] = current->position_[0]+SRAND*size[0];
        position[1] = current->position_[1]+SRAND*size[1];
        //position[2] = current->position_[2];
        state.explosions->add (EXPLOSION_ENEMY_DAMAGED, position, 0, 1.0);
      } // end IF
    } // end IF

    //-------------- remove enemies that got through

    if ((current->position_[1] < -8.0F) &&
        (current->type_ != ENEMYAIRCRAFT_GNAT))
      state.status_display->enemyWarning (1.0F-((current->position_[1]+14.0F)/6.0F));
    if (current->position_[1] < -14.0F)
    {
      current->damage_ = 1.0F;
      current->age_ = 0;
      state.player->loseShip ();
      state.tip_ship_past++;
    } // end IF

    // if enemies are critically damaged, destroy them
    if (current->damage_ <= 0.0F)
    {
      current = current->get_next ();
      continue;
    } // end IF

    prev = NULL;
    tmp = inherited::free_list_;
    while (tmp)
    {
      if (tmp == current)
        break;

      prev = tmp;
      tmp = tmp->get_next ();
    } // end WHILE
    tmp = current->get_next ();
    if (prev)
      prev->set_next (tmp);
    else
      inherited::free_list_ = tmp;
    inherited::size_--;

    position[0] = current->position_[0];
    position[1] = current->position_[1];
    if (current->age_) // *NOTE*: set age to 0 for quiet deletion...
      switch (current->type_)
      {
        case ENEMYAIRCRAFT_BOSS_0:
        case ENEMYAIRCRAFT_BOSS_1:
          destroyAll ();
          bossExplosion (current);

          if (state.game_mode != GAMEMODE_GAME_OVER)
          {
            //-- trigger end of level
            score += SCORE_END_OF_LEVEL;
            state.game_mode = GAMEMODE_LEVEL_COMPLETE;
            state.player_success = 0;
          } // end IF
          break;
        case ENEMYAIRCRAFT_OMNI:
          score += SCORE_KILL_OMNI;
          state.explosions->add (EXPLOSION_ENEMY_DAMAGED, current->position_);
          state.explosions->add (EXPLOSION_ENEMY_DAMAGED, current->position_, -3, 0.7F);
          state.explosions->add (EXPLOSION_ENEMY_AMMUNITION_4, current->position_);
          state.audio->play (SOUND_EXPLOSION_LIGHT, current->position_);
          break;
        case ENEMYAIRCRAFT_RAYGUN:
          score += SCORE_KILL_RAYGUN;
          state.explosions->add (EXPLOSION_ENEMY_DESTROYED, current->position_);
          position[0] = current->position_[0]+0.55F;
          state.explosions->add (EXPLOSION_ENEMY_DESTROYED, position, -5, 1.5F);
          position[0] = current->position_[0]-0.5F;
          position[1] = current->position_[1]+0.2F;
          state.explosions->add (EXPLOSION_ENEMY_DESTROYED, position, -15);
          position[0] = current->position_[0];
          state.explosions->add (EXPLOSION_ENEMY_DESTROYED, position, -20, 2.0F);
          state.explosions->add (EXPLOSION_ENEMY_DAMAGED, position, -30, 2.0F);
          state.audio->play (SOUND_EXPLOSION_DEFAULT, current->position_);
          state.audio->play (SOUND_EXPLOSION_HEAVY, current->position_);
          break;
        case ENEMYAIRCRAFT_TANK:
          score += SCORE_KILL_TANK;
          state.explosions->add (EXPLOSION_ENEMY_DESTROYED, position, -5, 2.5F);
          position[0] = current->position_[0]-0.9F;
          position[1] = current->position_[1]-1.0F;
          state.explosions->add (EXPLOSION_ENEMY_DESTROYED, position, -0, 1.5F);
          position[0] = current->position_[0]+1.0F;
          position[1] = current->position_[1]-0.8F;
          state.explosions->add (EXPLOSION_ENEMY_DESTROYED, position, -13, 2.0F);
          state.explosions->add (EXPLOSION_ENEMY_DESTROYED, position, -2, 1.0F);
          position[0] = current->position_[0]+0.7F;
          position[1] = current->position_[1]+0.7F;
          state.explosions->add (EXPLOSION_ENEMY_DESTROYED, position, -20, 1.7F);
          position[0] = current->position_[0]-0.7F;
          position[1] = current->position_[1]+0.9F;
          state.explosions->add (EXPLOSION_ENEMY_DESTROYED, position, -8, 1.5F);
          state.audio->play (SOUND_EXPLOSION_DEFAULT, current->position_);
          state.audio->play (SOUND_EXPLOSION_HEAVY, current->position_);
          break;
        case ENEMYAIRCRAFT_GNAT:
          score += SCORE_KILL_GNAT;
          state.explosions->add (EXPLOSION_ENEMY_AMMUNITION_4, current->position_);
          state.audio->play (SOUND_EXPLOSION_LIGHT, current->position_);
          break;
        default: //-- extra damage explosion delayed for bloom effect *TODO*
          score += SCORE_KILL_DEFAULT;
          state.explosions->add (EXPLOSION_ENEMY_DESTROYED, current->position_);
          state.explosions->add (EXPLOSION_ENEMY_DAMAGED, current->position_, -15);
          state.audio->play (SOUND_EXPLOSION_DEFAULT, current->position_);
          break;
      } // end SWITCH

    Splot_Screen::remove (current);
    current = tmp;
  } // end WHILE
  game_state.score += score;
}
예제 #28
0
void HttpConnectionMap::clearHttpConnectionMap()
{
    destroyAll();
}
예제 #29
0
gkGroupManager::~gkGroupManager()
{
	destroyAll();
}
예제 #30
0
// Destructor
UtlCopyableSList::~UtlCopyableSList()
{
   destroyAll();
}