- Added more nodraw.txt locations

- Improved nodraw.txt parsing
This commit is contained in:
Andreas Schneider 2009-12-18 14:24:35 +01:00
parent 7adf94010a
commit e502321f35
3 changed files with 43 additions and 24 deletions

View File

@ -1127,21 +1127,44 @@ end;
procedure TLandscape.LoadNoDrawMap(AFileName: String);
var
noDrawFile: TextFile;
line: String;
id: Integer;
line, ids1, ids2: String;
i, id1, id2, splitPos: Integer;
begin
AssignFile(noDrawFile, AFileName);
Reset(noDrawFile);
while not EOF(noDrawFile) do
begin
ReadLn(noDrawFile, line);
if TryStrToInt(Copy(line, 2, Length(line)), id) then
if (Length(line) > 0) and (line[1] in ['S', 'T']) then
begin
if line[1] = 'S' then
Inc(id, $4000);
splitPos := Pos('-', line);
if splitPos > 1 then
begin
ids1 := Copy(line, 2, splitPos - 2);
ids2 := Copy(line, splitPos + 1, Length(line));
if TryStrToInt(ids1, id1) and TryStrToInt(ids2, id2) then
begin
if line[1] = 'S' then
begin
Inc(id1, $4000);
Inc(id2, $4000);
end;
if id < FDrawMap.Size then
FDrawMap[id] := False;
for i := id1 to id2 do
if i < FDrawMap.Size then
FDrawMap[i] := False;
end;
end else
begin
ids1 := Copy(line, 2, Length(line));
if TryStrToInt(ids1, id1) then
begin
if line[1] = 'S' then
Inc(id1, $4000);
if id1 < FDrawMap.Size then
FDrawMap[id1] := False;
end;
end;
end;
end;
CloseFile(noDrawFile);

View File

@ -858,11 +858,11 @@ begin
FLandscape.OnStaticInserted := @OnStaticInserted;
if FileExists(FAppDir + 'nodraw.txt') then
begin
acNoDraw.Enabled := True;
FLandscape.LoadNoDrawMap(FAppDir + 'nodraw.txt');
end else
acNoDraw.Enabled := False;
if FileExists(FConfigDir + 'nodraw.txt') then
FLandscape.LoadNoDrawMap(FConfigDir + 'nodraw.txt');
if FileExists(ResMan.GetFile('nodraw.txt')) then
FLandscape.LoadNoDrawMap(ResMan.GetFile('nodraw.txt'));
FTextureManager := TLandTextureManager.Create;
FScreenBuffer := TScreenBuffer.Create;

View File

@ -1,17 +1,13 @@
# This file contains a list of all tiles to be ignored when the "NoDraw"
# option is not active.
# Lines starting with T are terrain tiles, S indicated static tiles.
# A - between numbers indicates a range of tiles.
#Terrain
T$2
#Statics
S$1
S$2198
S$2199
S$219A
S$219B
S$219C
S$219D
S$219E
S$219F
S$21A0
S$21A1
S$21A2
S$21A3
S$21A4
S$2198-$21A4
S$21BC
S$5690