Code Search for Developers
 
 
  

removeMSPragma.pl from Scorched 3D at Krugle


Show removeMSPragma.pl syntax highlighted

use strict;

my @dirs =
(
	"3dsparse",
	"common",
	"coms",
	"dialogs",
	"engine",
	"GLEXT",
	"GLW",
	"landscape",
	"landscapedef",
	"client",
	"server",
	"actions",
	"cgext",
	"scorched",
	"sprites",
	"tankai",
	"target",
	"XML",
	"ships",
	"tankgraph",
	"tank",
	"boids",
	"placement",
	"sound",
	"weapons"
);

my $dir;
foreach $dir (@dirs)
{
	opendir(IN, "../src/$dir") || die "ERROR: DIR \"$dir\"";
	my @files = grep { /\.h/ } readdir(IN);
	closedir(IN);

	my $file;
	foreach $file (@files)
	{
		open (INFILE, "../src/$dir/$file") || die "ERROR: File \"../$dir/$file\"";
		my @filelines = <INFILE>;
		close (INFILE);

		my $index = -1;
		for (my $i=0; $i<=$#filelines; $i++)
		{
			if ($filelines[$i] =~ /pragma once/)
			{
				$index = $i;
			}
		}

		if ($index != -1)
		{
			my $incline = "__INCLUDE_".$file."_INCLUDE__";
			$incline =~ s/\.//g;

			print "$dir/$file\n";

			$filelines[$index] = "#if !defined($incline)\n#define $incline\n";
			push @filelines, "\n#endif // $incline\n";

			open(OUTFILE, ">../src/$dir/$file") || die "ERROR: Out $file";
			print OUTFILE @filelines;
			close (OUTFILE);
		}
	}
}




See more files for this project here

Scorched 3D

Scorched3D is a 3D remake of the popular 2D artillery game Scorched Earth.\r\nScorched3D can be played against the computer, other players and remotely across the internet or LAN.

Project homepage: http://sourceforge.net/projects/scorched3d
Programming language(s): C,C++,XML
License: gpl2

  addGPLLines.pl
  checkIncludeCase.pl
  checkMakeRefs.pl
  convertAccessories38-381.pl
  copyall.bat
  copyallnodata.bat
  copyjustsrc.bat
  createAMMakefile.pl
  dos2unixall
  exclude.txt
  exclude2.txt
  generateDiff.pl
  hmm.txt
  make_todo.pl
  moveGroups.pl
  ms3d_ascii_export.py
  openal-config
  removeMSPragma.pl
  removeSlash.pl
  resource.h
  resource.rc
  showChangedOptions.pl
  splitlandscapefile.pl
  updateAmbientSounds.pl
  vcfiles.pl
  weaponDocs.pl
  wxWinFromRC.pl