• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ destination函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中destination函数的典型用法代码示例。如果您正苦于以下问题:C++ destination函数的具体用法?C++ destination怎么用?C++ destination使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了destination函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: LOG_DEBUG

    void UdpSearcher::search() {
        try{
            LOG_DEBUG("UdpSearcher::search start search");

            //¹ã²¥µØÖ·
            //LOG_DEBUG("UdpSearcher::search send msg to %s", addr_broadcast.to_string().c_str());
            udp::endpoint destination(address::from_string("255.255.255.255"), NET_BROADCAST_PORT);

            boost::array<char, 1> send_buf   = { 0 };
            socket_.send_to(boost::asio::buffer(send_buf), destination);

            socket_.async_receive_from(boost::asio::buffer(recvBuf),senderEndpoint,0 ,boost::bind(&UdpSearcher::reciveHandle, this, 
                boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred));

            timer_.expires_from_now(boost::posix_time::seconds(5));  
            timer_.async_wait(boost::bind(&UdpSearcher::timeoutHandle, this, boost::asio::placeholders::error));  
            ioServicePool_.start();
        }
        catch(std::exception& e) {
            LOG_ERROR("UdpSearcher::search error : %s ", e.what());
        }
    }
开发者ID:coderHsc,项目名称:sanguosha,代码行数:22,代码来源:AsioClient.cpp


示例2: source

void QUtilityData::saveColorImage(const std::string& fileName, const glm::uvec2& scale)
{
    QImage source(fileName.c_str());
    source = source.scaled(source.width() / scale.x, source.height() / scale.y);
    int width = source.width();
    int height = source.height();

    std::vector<cl_uchar4> destination(width * height);
    cl_uchar4* ptrDestination = destination.data();
    for (int y = 0; y < height; y++)
        for (int x = 0; x < width; x++)
        {
            QRgb label = source.pixel(x, y);
            ptrDestination->s[0] = qRed(label);
            ptrDestination->s[1] = qGreen(label);
            ptrDestination->s[2] = qBlue(label);
            ptrDestination->s[3] = qAlpha(label);
            ptrDestination++;
        };

    QIO::saveFileData(fileName + QGCSetting::extColor, destination.data(), destination.size() * sizeof(cl_uchar4));
}
开发者ID:15pengyi,项目名称:JF-Cut,代码行数:22,代码来源:QUtilityData.cpp


示例3: qCDebug

bool SharePlugin::receivePackage(const NetworkPackage& np)
{
/*
    //TODO: Write a test like this
    if (np.type() == PACKAGE_TYPE_PING) {

        qCDebug(KDECONNECT_PLUGIN_SHARE) << "sending file" << (QDesktopServices::storageLocation(QDesktopServices::HomeLocation) + "/.bashrc");

        NetworkPackage out(PACKAGE_TYPE_SHARE);
        out.set("filename", mDestinationDir + "itworks.txt");
        AutoClosingQFile* file = new AutoClosingQFile(QDesktopServices::storageLocation(QDesktopServices::HomeLocation) + "/.bashrc"); //Test file to transfer

        out.setPayload(file, file->size());

        device()->sendPackage(out);

        return true;

    }
*/

    qCDebug(KDECONNECT_PLUGIN_SHARE) << "File transfer";

    if (np.hasPayload()) {
        //qCDebug(KDECONNECT_PLUGIN_SHARE) << "receiving file";
        const QString filename = np.get<QString>("filename", QString::number(QDateTime::currentMSecsSinceEpoch()));
        const QUrl dir = destinationDir().adjusted(QUrl::StripTrailingSlash);
        QUrl destination(dir.toString() + '/' + filename);
        if (destination.isLocalFile() && QFile::exists(destination.toLocalFile())) {
            destination = QUrl(dir.toString() + '/' + KIO::suggestName(dir, filename));
        }

        FileTransferJob* job = np.createPayloadTransferJob(destination);
        job->setDeviceName(device()->name());
        connect(job, SIGNAL(result(KJob*)), this, SLOT(finished(KJob*)));
        KIO::getJobTracker()->registerJob(job);
        job->start();
    } else if (np.has("text")) {
开发者ID:tazio,项目名称:kdeconnect-kde,代码行数:38,代码来源:shareplugin.cpp


示例4: ASSERT

ScriptPromise AudioContext::suspendContext(ScriptState* scriptState)
{
    ASSERT(isMainThread());
    AutoLocker locker(this);

    ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState);
    ScriptPromise promise = resolver->promise();

    if (contextState() == Closed) {
        resolver->reject(
            DOMException::create(InvalidStateError, "Cannot suspend a context that has been closed"));
    } else {
        // Stop rendering now.
        if (destination())
            stopRendering();

        // Since we don't have any way of knowing when the hardware actually stops, we'll just
        // resolve the promise now.
        resolver->resolve();
    }

    return promise;
}
开发者ID:dstockwell,项目名称:blink,代码行数:23,代码来源:AudioContext.cpp


示例5: sizeof

void BlendBench::unalignedBlendArgb32()
{
    const int dimension = 1024;

    uchar *dstMemory = static_cast<uchar*>(::malloc(dimension * dimension * sizeof(quint32)));
    QImage destination(dstMemory, dimension, dimension, QImage::Format_ARGB32_Premultiplied);
    destination.fill(0x12345678); // avoid special cases of alpha

    uchar *srcMemory = static_cast<uchar*>(::malloc((dimension * dimension * sizeof(quint32)) + 16));
    QFETCH(int, offset);
    uchar *imageSrcMemory = srcMemory + (offset * sizeof(quint32));

    QImage src(imageSrcMemory, dimension, dimension, QImage::Format_ARGB32_Premultiplied);
    src.fill(0x87654321);

    QPainter painter(&destination);
    QBENCHMARK {
        painter.drawImage(QPoint(), src);
    }

    ::free(srcMemory);
    ::free(dstMemory);
}
开发者ID:fluxer,项目名称:katie,代码行数:23,代码来源:main.cpp


示例6: destination

// ---------------------------------------------------------------------------
// CStunTurnTests::TestSetSendingStatusUDPL
// ---------------------------------------------------------------------------
//
void CStunTurnTests::TestSetSendingStatusUDPL()
    {
    TInetAddr inetAddr;

	iWrapper->OutgoingAddr( inetAddr );
	iWrapper->SetIncomingAddrL( inetAddr );
	   	
	TInetAddr destination( KTestAddress, KTestServerPort );
	
    RDebug::Print( _L( "\nTEST CASE: Set Sending Status Active" ) );
    
	iNat.SetSendingStateL( iIfStub.LocalCandidateL(), EStreamingStateActive,
        destination );
    	
	iIfStub.StartActiveSchedulerL( KRunningTime );
	
	RDebug::Print( _L( "\nTEST CASE: Set Sending Status Passive" ) );
	
    iNat.SetSendingStateL( iIfStub.LocalCandidateL(), EStreamingStatePassive,
        destination );
    	
    iIfStub.StartActiveSchedulerL( KRunningTime );
    }
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:27,代码来源:stunturntests.cpp


示例7: source

void CCell::UpdateView()
{
  Helper * help = Helper::Instance();

	if( isVisible && unit != s_original )
	{
		QImage source( ":/" + help->GetItemNameByState( hextype ) );
		QImage destination( ":/" + help->GetItemNameByState( unit ) );
		//destination = destination.scaled( button->width(), button->height() );
		QPainter resultPainter(&source);

		resultPainter.setCompositionMode( QPainter::CompositionMode_SourceOver );
		resultPainter.drawImage( 0, 0, destination );
		resultPainter.end();    

		button->setIcon( QIcon( QPixmap::fromImage( source ) ) );
	}
	else
	{
		button->setIcon( QIcon(":/" + help->GetItemNameByVisible( isVisible, hextype ) ) );
		//button->setText( "1" );
	}
}                                                                           
开发者ID:n0ran,项目名称:BunnyMapRedactor,代码行数:23,代码来源:plist.cpp


示例8: destination

void jumpTableEntry::print() {
  if (is_unused()) { 
    std->print_cr("Unused {next = %d}", (int) destination());
    return;
  }
  if (is_nmethod_stub()) {
    std->print("Nmethod stub ");
    Disassembler::decode(jump_inst_addr(), state_addr());
    nmethod* nm = method();
    if (nm) {
      nm->key.print();
    } else {
      std->print_cr("{not pointing to nmethod}");
    }
    return;
  }

  if (is_block_closure_stub()) {
    std->print("Block closure stub");
    Disassembler::decode(jump_inst_addr(), state_addr());
    nmethod* nm = block_nmethod();
    if (nm) {
      nm->key.print();
    } else {
      std->print_cr("{not compiled yet}");
    }
    return;
  }

  if (is_link()) {
    std->print_cr("Link for:");
    jumpTable::jump_entry_for_at(link(), 0)->print();
    return;
  }

  fatal("unknown jump table entry");
}
开发者ID:tonyg,项目名称:Strongtalk,代码行数:37,代码来源:jumpTable.cpp


示例9: TEST_F

/// Graphical validations for Exponential variate generator.
/// @note Important! For this to work and files to be generated, this test must be run *outside* of VS 2013 Gtest plugin. This plugin redirects outputs.
TEST_F(ExponentialTrafficGeneratorTest, ExponentialGraphsGenerators) {
	std::shared_ptr<Message> source(new Message("This is a dummy entity for source."));
	std::shared_ptr<Message> destination(new Message("This is a dummy entity for destination."));
	std::shared_ptr<Message> tokenContents(new Message("This is a dummy Token contents."));
	unsigned int seed = 1;
	std::shared_ptr<Token> token(nullptr);
	std::ofstream outputFile; // Output file handle.
	int numberOfSamples = 300000; // Number of samples to generate for variate. Generate about 300,000 here such that the lambda = 0.5 approximates better the pdf equation.
	std::map<std::string, ExponentialTrafficGenerator> exponentialGeneratorMap; // Map to control exponential generator instances and their output filenames. (String comes first because the key must be constant.)

	// Set the fixed seed.
	simulatorGlobals.seedRandomNumberGenerator(seed);
	
	// Create exponential generators and populate maps with their references and output files.
	exponentialGeneratorMap.insert(std::pair<std::string, ExponentialTrafficGenerator>("exponential_Lambda0.5.csv",
		ExponentialTrafficGenerator(simulatorGlobals, scheduler, EventType::TRAFFIC_GENERATOR_ARRIVAL, tokenContents, source, destination, 1, 1.0/0.5)));
	exponentialGeneratorMap.insert(std::pair<std::string, ExponentialTrafficGenerator>("exponential_Lambda1.0.csv",
		ExponentialTrafficGenerator(simulatorGlobals, scheduler, EventType::TRAFFIC_GENERATOR_ARRIVAL, tokenContents, source, destination, 1, 1.0)));
	exponentialGeneratorMap.insert(std::pair<std::string, ExponentialTrafficGenerator>("exponential_Lambda1.5.csv", 
		ExponentialTrafficGenerator(simulatorGlobals, scheduler, EventType::TRAFFIC_GENERATOR_ARRIVAL, tokenContents, source, destination, 1, 1/1.5)));
	exponentialGeneratorMap.insert(std::pair<std::string, ExponentialTrafficGenerator>("exponential_Lambda3.0.csv", 
		ExponentialTrafficGenerator(simulatorGlobals, scheduler, EventType::TRAFFIC_GENERATOR_ARRIVAL, tokenContents, source, destination, 1, 1/3.0)));
	
	// Now generate all exponential samples for each generator.
	for (auto &exponentialGeneratorMapIterator : exponentialGeneratorMap) {
		// Turn on generator.
		exponentialGeneratorMapIterator.second.turnOn();
		// Open file for output.
		outputFile.open(exponentialGeneratorMapIterator.first);
		// Generate samples.
		for (int i = 0; i < numberOfSamples; ++i) {
			exponentialGeneratorMapIterator.second.createInstanceTrafficEvent();
			outputFile << scheduler.cause().occurAfterTime << std::endl;
		}
		outputFile.close();
	}
}
开发者ID:TauferLab,项目名称:QCN-Sim,代码行数:39,代码来源:ExponentialTrafficGeneratorTest.cpp


示例10: origin

void HelloWorld::drawPath(const std::vector<TileData*>& path)
{
    this->removeChildByName(DrawNodeStr);

    DrawNode* drawNode = DrawNode::create();

    Size mapSize = m_gamemap->getMapSize();
    Size tilesize = m_gamemap->getTileSize();
    int mapheight = mapSize.height * tilesize.height;

    int origin_x = path[0]->position().first * tilesize.width + tilesize.width / 2;
    int origin_y = path[0]->position().second * tilesize.height + tilesize.height / 2;
    Vec2 origin(origin_x, mapheight - origin_y);
    for (int index = 1; index < path.size(); ++index)
    {
        int destination_x = path[index]->position().first * tilesize.width + tilesize.width / 2;
        int destination_y = path[index]->position().second * tilesize.height + tilesize.height / 2;
        Vec2 destination(destination_x, mapheight - destination_y);
        drawNode->drawLine(origin, destination, Color4F(0.0, 1.0, 0.0, 1.0));
        origin = destination;
    }

    this->addChild(drawNode, 0, DrawNodeStr);
}
开发者ID:ssss3301,项目名称:TileMap,代码行数:24,代码来源:HelloWorldScene.cpp


示例11: strip_quotes

static Character const* __cdecl strip_quotes(Character const* const source) throw()
{
    // Count the number of quotation marks in the string, and compute the length
    // of the string, in case we need to allocate a new string:
    size_t quote_count   = 0;
    size_t source_length = 0;
    for (Character const* it = source; *it; ++it)
    {
        if (*it == '\"')
            ++quote_count;

        ++source_length;
    }

    // No quotes?  No problem!
    if (quote_count == 0)
        return nullptr;

    size_t const destination_length = source_length - quote_count + 1;
    __crt_unique_heap_ptr<Character> destination(_calloc_crt_t(Character, destination_length));
    if (destination.get() == nullptr)
        return nullptr;

    // Copy the string, stripping quotation marks:
    Character* destination_it = destination.get();
    for (Character const* source_it = source; *source_it; ++source_it)
    {
        if (*source_it == '\"')
            continue;

        *destination_it++ = *source_it;
    }

    *destination_it = '\0';
    return destination.detach();
}
开发者ID:DinrusGroup,项目名称:DinrusUcrtBased,代码行数:36,代码来源:tempnam.cpp


示例12: CV_Assert

void		MaskFilterBase::Process( cv::Mat& srcImage, cv::Mat& destImage )
{
	CV_Assert( srcImage.depth() != sizeof(uchar) );
	CV_Assert( srcImage.rows == destImage.rows );
	CV_Assert( srcImage.cols == destImage.cols );


	switch( srcImage.channels() )
	{
	case 1:
		CV_Assert(false);
	case 3:
		cv::Mat_<cv::Vec3b> source = srcImage;
		cv::Mat_<cv::Vec3b> destination = destImage;

		for ( int j = 1; j < srcImage.cols - 1; ++j  )
		{
			for (int i = 1; i < srcImage.rows - 1; ++i )
				destination( i, j ) = Filter( source, i, j, m_mask );
		}

	break;
	}
}
开发者ID:nieznanysprawiciel,项目名称:POBRImageRecognition,代码行数:24,代码来源:MaskFilterBase.cpp


示例13: setDestination

void MPG321::goEvent( SProcessEvent *event )
{
    if( !event->address().isEmpty() )
        setDestination( event->address() );

    QStringList arguments;
        arguments << "-v";
        arguments << "--rate";
        arguments << "44100";
        arguments << "--stereo";
        arguments << "--buffer";
        arguments << "3072";
        arguments << "--resync";
        arguments << "-w";
        arguments << destination();
        arguments << source();

    p->used_command.clear();
    p->used_command = application() + " ";
    for( int i=0 ; i<arguments.count() ; i++ )
    {
        QString str = arguments.at(i);
        if( str.contains(" ") )
            str = "\"" + str + "\"";

        p->used_command = p->used_command + str + " ";
    }

    p->log_str = p->used_command;
    emit itemicLogAdded( MPG321::Information , p->used_command );

    p->process->start( application() , arguments );

    p->timer->start( 25 );
    p->clock->start( 1000 );
}
开发者ID:realbardia,项目名称:silicon,代码行数:36,代码来源:mpg321.cpp


示例14: ShareJob

Plasma::ServiceJob *ShareService::createJob(const QString &operation,
                                            QMap<QString, QVariant> &parameters)
{
    return new ShareJob(destination(), operation, parameters, this);
}
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:5,代码来源:shareservice.cpp


示例15: showError

void ShareJob::start()
{
    //KService::Ptr service = KService::serviceByStorageId("plasma-share-pastebincom.desktop");
    KService::Ptr service = KService::serviceByStorageId(destination());
    if (!service) {
        showError(i18n("Could not find the provider with the specified destination"));
        return;
    }

    QString pluginName =
        service->property("X-KDE-PluginInfo-Name", QVariant::String).toString();

    const QString path =
        KStandardDirs::locate("data", "plasma/shareprovider/" + pluginName + '/' );

    if (path.isEmpty()) {
        showError(i18n("Invalid path for the requested provider"));
        return;
    }

    m_package = new Plasma::Package(path, ShareProvider::packageStructure());
    if (m_package->isValid()) {
        const QString mainscript =
            m_package->path() + m_package->structure()->contentsPrefixPaths().at(0) +
            m_package->structure()->path("mainscript");

        if (!QFile::exists(mainscript)) {
            showError(i18n("Selected provider does not have a valid script file"));
            return;
        }

        const QString interpreter =
            Kross::Manager::self().interpreternameForFile(mainscript);

        if (interpreter.isEmpty()) {
            showError(i18n("Selected provider does not provide a supported script file"));
            return;
        }

        m_action = new Kross::Action(parent(), pluginName);
        if (m_action) {
            m_provider = new ShareProvider(this);
            connect(m_provider, SIGNAL(readyToPublish()), this, SLOT(publish()));
            connect(m_provider, SIGNAL(finished(QString)),
                    this, SLOT(showResult(QString)));
            connect(m_provider, SIGNAL(finishedError(QString)),
                    this, SLOT(showError(QString)));

            // automatically connects signals and slots with the script
            m_action->addObject(m_provider, "provider",
                                Kross::ChildrenInterface::AutoConnectSignals);

            // set the main script file and load it
            m_action->setFile(mainscript);
            m_action->trigger();

            // check for any errors
            if(m_action->hadError()) {
                showError(i18n("Error trying to execute script"));
                return;
            }

            // do the work together with the loaded plugin
            const QStringList functions = m_action->functionNames();
            if (!functions.contains("url") || !functions.contains("contentKey") ||
                !functions.contains("setup")) {
                showError(i18n("Could not find all required functions"));
                return;
            }

            // call the methods from the plugin
            const QString url =
                m_action->callFunction("url", QVariantList()).toString();
            m_provider->setUrl(url);

            // setup the method (get/post)
            QVariant vmethod;
            if (functions.contains("method")) {
                vmethod =
                    m_action->callFunction("method", QVariantList()).toString();
            }

            // default is POST (if the plugin does not specify one method)
            const QString method = vmethod.isValid() ? vmethod.toString() : "POST";
            m_provider->setMethod(method);

            // setup the provider
            QVariant setup = m_action->callFunction("setup", QVariantList());

            // get the content from the parameters, set the url and add the file
            // then we can wait the signal to publish the information
            const QString contentKey =
                m_action->callFunction("contentKey", QVariantList()).toString();

            const QString content(parameters()["content"].toString());
            m_provider->addPostFile(contentKey, content);
        }
    }
}
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:99,代码来源:shareservice.cpp


示例16: lowDims

double trajOptimizerplus::eval(vector<double> &params) {

    cout << "IN EVAL "<<itrcount++<<" "<<params.size()<<endl;



    for (int i=0; i < params.size(); i++)
        cout << "PARAMS IN: "<<i<<" "<<params.at(i)<<endl;


    int factor = evidence.getFactor();

    pair<int, int> dims = grid.dims();
    int v_dim = seqFeat.num_V();

    /*
    pair<int, int> lowDims((int)ceil((float)dims.first/factor),
          (int)ceil((float)dims.second/factor));
    */
    vector<vector<vector<double> > >
    prior(dims.first, vector<vector<double> >(dims.second,
            vector<double> (v_dim,-HUGE_VAL)));

    double obj = 0.0;
    vector<double> gradient(params.size(), 0.0);
    vector<vector<vector<double> > > occupancy;
    vector<vector<double> > layerOccupancy;
    layerOccupancy.resize(dims.first,vector<double>(dims.second,-HUGE_VAL));
    vector<double> modelFeats, pathFeats;

    for (int i=0; i < evidence.size(); i++) {
        for (int j=0; j < params.size(); j++) {
            cout << "  "<<j<<" "<<params.at(j);
        }
        cout<<endl;

        cout << "Evidence #"<<i<<endl;
        vector<pair<int, int> >&  trajectory = evidence.at(i);
        vector<double>& velocityseq = evidence.at_v(i);
        pair<int,int>&  bot = evidence.at_bot(i);

        //  robot local blurres features
        for (int r=1; r <= NUMROBFEAT; r++) {
            cout << "Adding  Robot Feature "<<r<<endl;
            RobotLocalBlurFeature robblurFeat(grid,bot,10*r);
            //	RobotGlobalFeature robFeat(grid,bot);
            posFeatures.push_back(robblurFeat);
        }

        cout << "   Creating feature array"<<endl;
        FeatureArray featArray2(posFeatures);
        FeatureArray featArray(featArray2, factor);

        for (int rr=1; rr<= NUMROBFEAT; rr++)
            posFeatures.pop_back();

        // split different posfeatures and seqfeature weights
        vector<double> p_weights,s_weights;
        int itr = 0;
        for (; itr<featArray.size(); itr++)
            p_weights.push_back(params[itr]);
        for (; itr<params.size(); itr++)
            s_weights.push_back(params[itr]);

        //cout<<"Params"<<endl;
        Parameters p_parameters(p_weights), s_parameters(s_weights);
        /*    cout<<featArray.size()<<endl;
        	  cout<<params.size()<<endl;
        	  cout<<p_weights.size()<<endl;
        	  cout<<s_weights.size()<<endl;
        	  cout<<p_parameters.size()<<endl;
        	  cout<<s_parameters.size()<<endl;
        */
        //cout<<"Reward"<<endl;
        RewardMap rewards(featArray,seqFeat,p_parameters,s_parameters);
        DisSeqPredictor predictor(grid, rewards, engine);

        // sum of reward along the trajectory
        double cost = 0.0;
        //cout<< trajectory.size()<<endl;
        for (int j=0; j < trajectory.size(); j++) {
            //cout<<j<<" "<<trajectory.at(j).first<<" "<< trajectory.at(j).second<< " "<< seqFeat.getFeat(velocityseq.at(j))<<endl;
            cost+=rewards.at(trajectory.at(j).first, trajectory.at(j).second, seqFeat.getFeat(velocityseq.at(j)));
        }
        State initial(trajectory.front(),seqFeat.getFeat(velocityseq.front()));
        State destination(trajectory.back(),seqFeat.getFeat(velocityseq.back()));
        //for (int k=0;k<v_dim;k++)
        prior.at(destination.x()).at(destination.y()).at(destination.disV) = 0.0;

        cout << "Initial: "<<initial.x()<<"  "<<initial.y()<<"  "<<initial.disV<<endl;
        cout << "Destination: "<<destination.x()<<"  "
             <<destination.y()<<" "<<destination.disV<<endl;
        predictor.setStart(initial);
        predictor.setPrior(prior);

        double norm = predictor.forwardBackwardInference(initial, occupancy);

        for (int l=0; l<v_dim; l++) {
            BMPFile gridView(dims.first, dims.second);
            for (int x= 0; x<dims.first; x++) {
//.........这里部分代码省略.........
开发者ID:yy147379138,项目名称:local_IOC,代码行数:101,代码来源:trajoptimizerplus.cpp


示例17: clear

void ICStub::clear() {
  if (CompiledIC::is_icholder_entry(destination())) {
    InlineCacheBuffer::queue_for_release((CompiledICHolder*)cached_value());
  }
  _ic_site = NULL;
}
开发者ID:4T-Shirt,项目名称:OpenJDK-Research,代码行数:6,代码来源:icBuffer.cpp


示例18: destination

	void _VertexBuffer::Update()
	{
		if(m_Buffer)
		{
			m_Buffer->Release();

			m_Buffer=NULL;
		}

		// First we need to know the bufferSize

		m_BufferSizeInBytes=m_VertexSizeInBytes * m_Count;

		// Unique_ptr will free the pointer
		unique_ptr<char> destination(new char[m_BufferSizeInBytes]);
		
		int ByteWidth=m_VertexSizeInBytes;

		int offsetInBytes=0;

		if(m_Position)
		{
			char *destBase=destination.get();

			for(int i=0;i<m_Count;i++)
			{
				float *dest=(float *)destBase;

				*dest++=*m_Position++;
				*dest++=*m_Position++;
				*dest++=*m_Position++;

				destBase+=ByteWidth;
			}
		}

		if(m_Color)
		{
			char *destBase=destination.get();

			destBase+=m_OffsetForColor;

			for(int i=0;i<m_Count;i++)
			{
				float *dest=(float *)destBase;

				*dest++=*m_Color++;
				*dest++=*m_Color++;
				*dest++=*m_Color++;
				*dest++=*m_Color++;

				destBase+=ByteWidth;
			}
		}

		if(m_Normal)
		{
			char *destBase=destination.get();

			destBase+=m_OffsetForNormal;

			for(int i=0;i<m_Count;i++)
			{
				float *dest=(float *)destBase;

				*dest++=*m_Normal++;
				*dest++=*m_Normal++;
				*dest++=*m_Normal++;

				destBase+=ByteWidth;
			}
		}

		if(m_Tangent)
		{
			char *destBase=destination.get();

			destBase+=m_OffsetForTangent;

			for(int i=0;i<m_Count;i++)
			{
				float *dest=(float *)destBase;

				*dest++=*m_Tangent++;

				destBase+=ByteWidth;
			}
		}

		if(m_TexCoord)
		{
			char *destBase=destination.get();

			destBase+=m_OffsetForTexCoord;

			int numChannels=m_NumChannels;

			for(int channel=0;channel<numChannels;channel++)
			{			
				for(int i=0;i<m_Count;i++)
//.........这里部分代码省略.........
开发者ID:jmservera,项目名称:AllInOne,代码行数:101,代码来源:VertexBuffer.cpp


示例19: destination

bool TCPSocket::Connect( const rString& adress, const unsigned short port )
{
	IPv4Address destination( adress, port );
	return Connect( destination );
}
开发者ID:Robograde,项目名称:Robograde,代码行数:5,代码来源:TCPSocket.cpp


示例20: if

// Update: draw background
update_status ModuleSceneIntro::Update()
{
    // KEYBOARD
    if (!App->input->GetKey(SDL_SCANCODE_4) == KEY_DOWN)
        App->renderer->Blit(background, 0, 0, NULL, 0, 0);


    if (App->input->GetKey(SDL_SCANCODE_SPACE) == KEY_DOWN)
    {
        circles.add(App->physics->CreateObj(App->input->GetMouseX(), App->input->GetMouseY(), 0, 0, 25, 0, 0, 0, false, b_dynamic));
        circles.getLast()->data->listener = this;
    }

    if (time <= 50)
    {
        App->renderer->Blit(green, 274, 216, NULL);
        App->renderer->Blit(green, 193, 528, NULL);
        App->renderer->Blit(green, 505, 611, NULL);
        App->renderer->Blit(arrow_pink, 153, 799, NULL);
    }
    else if (time <= 100 && time > 50)
    {
        App->renderer->Blit(purple, 238, 215, NULL);
        App->renderer->Blit(purple, 185, 549, NULL);
        App->renderer->Blit(purple, 490, 591, NULL);
        App->renderer->Blit(arrow_pink, 117, 786, NULL);
    }
    else if (time <= 150 && time > 100)
    {
        App->renderer->Blit(blue, 201, 215, NULL);
        App->renderer->Blit(blue, 476, 570, NULL);
        App->renderer->Blit(blue, 177, 572, NULL);
    }
    else if (time > 150)
    {
        time = 0;
        App->player->score += 10;
    }
    // Prepare for raycast ------------------------------------------------------

    iPoint mouse;
    mouse.x = App->input->GetMouseX();
    mouse.y = App->input->GetMouseY();
    int ray_hit = ray.DistanceTo(mouse);

    fVector normal(0.0f, 0.0f);

    // All draw functions ------------------------------------------------------

    // ray -----------------
    if(ray_on == true)
    {
        fVector destination(mouse.x-ray.x, mouse.y-ray.y);
        destination.Normalize();
        destination *= ray_hit;

        App->renderer->DrawLine(ray.x, ray.y, ray.x + destination.x, ray.y + destination.y, 255, 255, 255);

        if(normal.x != 0.0f)
            App->renderer->DrawLine(ray.x + destination.x, ray.y + destination.y, ray.x + destination.x + normal.x * 25.0f, ray.y + destination.y + normal.y * 25.0f, 100, 255, 100);
    }

    char title[100];
    sprintf_s(title, "%s Balls: %d Score: %06d Best Score: %06d   Respawn Press < 1 >", TITLE, App->player->hp, App->player->score, App->player->best_score);
    App->window->SetTitle(title);
    time++;

    return UPDATE_CONTINUE;
}
开发者ID:GottaCodeHarder,项目名称:Wild-West-Pinball,代码行数:70,代码来源:ModuleSceneIntro.cpp



注:本文中的destination函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ destroy函数代码示例发布时间:2022-05-30
下一篇:
C++ destRect函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap