some changes

This commit is contained in:
Felix Geyer 2004-08-13 15:34:50 +00:00
parent 27bb44a7fe
commit 0181a491d8
2 changed files with 18 additions and 13 deletions

View File

@ -42,13 +42,13 @@ var
sr: TSearchRec;
i: Word;
begin
WriteLn('AMXXSC compile.exe');
WriteLn(' by the AMX Mod X Dev Team');
WriteLn('//AMXXSC compile.exe');
WriteLn('// by the AMX Mod X Dev Team');
WriteLn;
if not FileExists(ExtractFilePath(ParamStr(0))+'amxxsc.exe') then
begin
WriteLn('Could not find amxxsc.exe');
WriteLn('// Could not find amxxsc.exe');
AppExit;
end;
@ -64,7 +64,7 @@ begin
else
begin
WriteLn;
WriteLn('File not found.');
WriteLn('// File not found.');
end;
end;
end
@ -78,7 +78,7 @@ begin
end
else
begin
WriteLn('No file found.');
WriteLn('// No file found.');
end;
FindClose(sr);
end;

View File

@ -65,23 +65,28 @@ begin
if (FilePath='') then
FilePath := ExtractFilePath(ParamStr(0));
if FileExists(Compiled) and ( GetAgeFromDat(FileName)=FileAge(Name) ) then
Exit;
WriteLn;
WriteLn('//// '+ExtractFileName(FileName));
if FileExists(Compiled) and ( GetAgeFromDat(FileName)=FileAge(Name) ) then
begin
WriteLn('// Already compiled.');
WriteLn('// ----------------------------------------');
Exit;
end;
Output := TStringList.Create;
try
cStart := GetTickCount;
if not GetConsoleOutput(ExtractFilePath(ParamStr(0))+'amxxsc.exe "'+FilePath+FileName+'" "-o'+Compiled+'"',Output) then
begin
WriteLn('Internal error.');
WriteLn('// Internal error.');
AppExit;
end;
cEnd := GetTickCount;
for i := 2 to (Output.Count-1) do
for i := 3 to (Output.Count-1) do
begin
WriteLn('// '+Output.Strings[i]);
end;
@ -91,7 +96,7 @@ begin
WriteLn('// ----------------------------------------');
Output.Free;
except
WriteLn('Internal error.');
WriteLn('// Internal error.');
AppExit;
end;
@ -135,7 +140,7 @@ begin
FillChar(SecurityAttr, SizeOf(TSecurityAttributes), 0);
SecurityAttr.nLength := SizeOf(SecurityAttr);
SecurityAttr.bInheritHandle := true;
SecurityAttr.bInheritHandle := True;
SecurityAttr.lpSecurityDescriptor := nil;
CreatePipe(PipeOutputRead, PipeOutputWrite, @SecurityAttr, 0);
@ -158,7 +163,7 @@ begin
Stream := TMemoryStream.Create;
try
while true do begin
while True do begin
Succeed := ReadFile(PipeOutputRead, Buffer, 255, NumberOfBytesRead, nil);
if not Succeed then Break;
Stream.Write(Buffer, NumberOfBytesRead);