diff --git a/src/shared/MAPDEF.pas b/src/shared/MAPDEF.pas
index c636117e7ba64b43b4c4c65845f3f6386630ba86..cc63613f5377e05f9e461fd576f1400ff1cc6ed2 100644 (file)
--- a/src/shared/MAPDEF.pas
+++ b/src/shared/MAPDEF.pas
-(* Copyright (C) DooM 2D:Forever Developers
+(* Copyright (C) Doom 2D: Forever Developers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
function isTransparent (): Boolean; inline;
function isOpaque (): Boolean; inline;
function isTransparent (): Boolean; inline;
function isOpaque (): Boolean; inline;
+ function isBlack (): Boolean; inline;
+ function isWhite (): Boolean; inline;
end;
{$INCLUDE mapdef.inc}
end;
{$INCLUDE mapdef.inc}
end;
function TDFColor.isTransparent (): Boolean; inline; begin result := (a = 0); end;
function TDFColor.isOpaque (): Boolean; inline; begin result := (a = 255); end;
end;
function TDFColor.isTransparent (): Boolean; inline; begin result := (a = 0); end;
function TDFColor.isOpaque (): Boolean; inline; begin result := (a = 255); end;
+function TDFColor.isBlack (): Boolean; inline; begin result := (r = 0) and (g = 0) and (b = 0); end;
+function TDFColor.isWhite (): Boolean; inline; begin result := (r = 255) and (g = 255) and (b = 255); end;
// ////////////////////////////////////////////////////////////////////////// //
// ////////////////////////////////////////////////////////////////////////// //
begin
fld := field[aname];
if (fld = nil) then raise Exception.Create(Format('field ''%s'' not found in record ''%s'' of type ''%s''', [aname, typeName, id]));
begin
fld := field[aname];
if (fld = nil) then raise Exception.Create(Format('field ''%s'' not found in record ''%s'' of type ''%s''', [aname, typeName, id]));
- if (fld.baseType <> TPoint) then raise Exception.Create(Format('field ''%s'' in record ''%s'' of type ''%s'' has invalid data type', [aname, typeName, id]));
+ if (fld.baseType <> fld.TType.TPoint) then raise Exception.Create(Format('field ''%s'' in record ''%s'' of type ''%s'' has invalid data type', [aname, typeName, id]));
result := TDFPoint.Create(fld.ival, fld.ival2);
end;
result := TDFPoint.Create(fld.ival, fld.ival2);
end;
begin
fld := field[aname];
if (fld = nil) then raise Exception.Create(Format('field ''%s'' not found in record ''%s'' of type ''%s''', [aname, typeName, id]));
begin
fld := field[aname];
if (fld = nil) then raise Exception.Create(Format('field ''%s'' not found in record ''%s'' of type ''%s''', [aname, typeName, id]));
- if (fld.baseType <> TSize) and (fld.baseType <> TPoint) then raise Exception.Create(Format('field ''%s'' in record ''%s'' of type ''%s'' has invalid data type', [aname, typeName, id]));
+ if (fld.baseType <> fld.TType.TSize) and (fld.baseType <> fld.TType.TPoint) then raise Exception.Create(Format('field ''%s'' in record ''%s'' of type ''%s'' has invalid data type', [aname, typeName, id]));
result := TDFSize.Create(fld.ival, fld.ival2);
end;
result := TDFSize.Create(fld.ival, fld.ival2);
end;