X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fshared%2FMAPDEF.pas;h=5316d010f6a7875df557254d7ea4df71b3d35136;hb=2f57c630d9545543d340f9dbcc516cc64c260f0f;hp=c636117e7ba64b43b4c4c65845f3f6386630ba86;hpb=44b1b8d4008737947a55103121e2a607a1927a88;p=d2df-sdl.git diff --git a/src/shared/MAPDEF.pas b/src/shared/MAPDEF.pas index c636117..5316d01 100644 --- a/src/shared/MAPDEF.pas +++ b/src/shared/MAPDEF.pas @@ -1,9 +1,8 @@ -(* 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 - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * the Free Software Foundation, version 3 of the License ONLY. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -64,6 +63,8 @@ type function isTransparent (): Boolean; inline; function isOpaque (): Boolean; inline; + function isBlack (): Boolean; inline; + function isWhite (): Boolean; inline; end; {$INCLUDE mapdef.inc} @@ -143,7 +144,7 @@ type //function Direction (): Byte; inline; // direction, ubyte // trigger - function trigRec (): TDynRecord; inline; + function trigRec (): TDynRecord; {inline;} function Enabled (): Boolean; inline; // enabled, bool function TriggerType (): Byte; inline; // type, ubyte function ActivateType (): Byte; inline; // activatetype, ubyte @@ -200,6 +201,8 @@ begin 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; // ////////////////////////////////////////////////////////////////////////// // @@ -283,7 +286,7 @@ var 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; @@ -294,7 +297,7 @@ var 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; @@ -347,7 +350,7 @@ end; // ////////////////////////////////////////////////////////////////////////// // // trigger -function TDynRecordHelper.trigRec (): TDynRecord; inline; +function TDynRecordHelper.trigRec (): TDynRecord; {inline;} var fld: TDynField; begin