コード例 #1
0
ファイル: hw_renderhacks.cpp プロジェクト: usernameak/gzdoom
void HWDrawInfo::DispatchRenderHacks()
{
	TMap<int, gl_subsectorrendernode*>::Pair *pair;
	TMap<int, gl_floodrendernode*>::Pair *fpair;
	TMap<int, gl_subsectorrendernode*>::Iterator ofi(otherFloorPlanes);
	GLFlat glflat;
	glflat.section = nullptr;
	while (ofi.NextPair(pair))
	{
		auto sec = hw_FakeFlat(&Level->sectors[pair->Key], in_area, false);
		glflat.ProcessSector(this, sec, SSRF_RENDERFLOOR | SSRF_PLANEHACK);
	}

	TMap<int, gl_subsectorrendernode*>::Iterator oci(otherCeilingPlanes);
	while (oci.NextPair(pair))
	{
		auto sec = hw_FakeFlat(&Level->sectors[pair->Key], in_area, false);
		glflat.ProcessSector(this, sec, SSRF_RENDERCEILING | SSRF_PLANEHACK);
	}

	TMap<int, gl_floodrendernode*>::Iterator ffi(floodFloorSegs);
	while (ffi.NextPair(fpair))
	{
		auto sec = hw_FakeFlat(&Level->sectors[fpair->Key], in_area, false);
		glflat.ProcessSector(this, sec, SSRF_RENDERFLOOR | SSRF_FLOODHACK);
	}

	TMap<int, gl_floodrendernode*>::Iterator fci(floodCeilingSegs);
	while (fci.NextPair(fpair))
	{
		auto sec = hw_FakeFlat(&Level->sectors[fpair->Key], in_area, false);
		glflat.ProcessSector(this, sec, SSRF_RENDERCEILING | SSRF_FLOODHACK);
	}
}
コード例 #2
0
ファイル: main.cpp プロジェクト: opieproject/opie
static void createSymlinks( const QString &location, const QString &package )
{

    QFile inFile( location + "/usr/lib/ipkg/info/" + package + ".list" );
    mkdir( "/usr/lib/ipkg", 0777 );
    mkdir( listDir, 0777 );

    QFile outFile( listDir + package + ".list");

//    odebug << "createSymlinks " << inFile.name().ascii() << " -> " << outFile.name().ascii() << "" << oendl;



    if ( inFile.open(IO_ReadOnly) && outFile.open(IO_WriteOnly)) {
        QTextStream in(&inFile);
        QTextStream out(&outFile);

        QString s;
        while ( !in.eof() ) {        // until end of file...
            s = in.readLine();       // line of text excluding '\n'
//      odebug << "Read: " << s.ascii() << "" << oendl;
            if (s.find(location,0,true) >= 0) {
//          odebug << "Found!" << oendl;
                s = s.replace(location,"");
            }
//      odebug << "Read after: " << s.ascii() << "" << oendl;

            // for s, do link/mkdir.
            if ( s.right(1) == "/" ) {
//      odebug << "do mkdir for " << s.ascii() << "" << oendl;
                mkdir( s.ascii(), 0777 );
                //possible optimization: symlink directories
                //that don't exist already. -- Risky.
            } else {
//      odebug << "do symlink for " << s.ascii() << "" << oendl;
                QFileInfo ffi( s );
                //Don't try to symlink if a regular file exists already
                if ( !ffi.exists() || ffi.isSymLink() ) {
                    if (symlink( (location+s).ascii(), s.ascii() ) != 0) {
                        if (errno == ENOENT) {
//          perror("Symlink Failed! ");
                            QString e=s.ascii();
                            e = e.replace(ffi.fileName(),"");
//          odebug << "DirName : " << e.ascii() << "" << oendl;
                            system ( QString("mkdir -p ")+e.ascii() );
                            if (symlink( (location+s).ascii(), s.ascii() ) != 0)
                                odebug << "Big problem creating symlink and directory" << oendl;
                        }
                    }
//          odebug << "Created << s.ascii() << oendl;
                    out << s << "\n";
                } else {
                    odebug << "" << s.ascii() << "  exists already, not symlinked" << oendl;
                }
            }
        }
        inFile.close();
        outFile.close();
    }
}
コード例 #3
0
ファイル: main.cpp プロジェクト: opieproject/opie
static void removeSymlinks( const QString &package )
{
    QFile inFile( listDir + package + ".list" );

    if ( inFile.open(IO_ReadOnly) ) {
        QTextStream in(&inFile);

        QString s;
        while ( !in.eof() ) {        // until end of file...
            s = in.readLine();       // line of text excluding '\n'
//      odebug << "remove symlink " << s.ascii() << "" << oendl;
            QFileInfo ffi( s );
            //Confirm that it's still a symlink.
            if ( ffi.isSymLink() ) {
                unlink( s.ascii() );
//          odebug << "Removed " << s.ascii() << oendl; }
//      else
//      odebug << "Not removed " << s.ascii() << "" << oendl;
            }
        }
        inFile.close();
        inFile.remove();
    }
}