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

View File

@ -858,11 +858,11 @@ begin
FLandscape.OnStaticInserted := @OnStaticInserted; FLandscape.OnStaticInserted := @OnStaticInserted;
if FileExists(FAppDir + 'nodraw.txt') then if FileExists(FAppDir + 'nodraw.txt') then
begin
acNoDraw.Enabled := True;
FLandscape.LoadNoDrawMap(FAppDir + 'nodraw.txt'); FLandscape.LoadNoDrawMap(FAppDir + 'nodraw.txt');
end else if FileExists(FConfigDir + 'nodraw.txt') then
acNoDraw.Enabled := False; FLandscape.LoadNoDrawMap(FConfigDir + 'nodraw.txt');
if FileExists(ResMan.GetFile('nodraw.txt')) then
FLandscape.LoadNoDrawMap(ResMan.GetFile('nodraw.txt'));
FTextureManager := TLandTextureManager.Create; FTextureManager := TLandTextureManager.Create;
FScreenBuffer := TScreenBuffer.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 T$2
#Statics
S$1 S$1
S$2198 S$2198-$21A4
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$21BC S$21BC
S$5690 S$5690