X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-editor.git;a=blobdiff_plain;f=src%2Feditor%2Fg_basic.pas;h=17254de80aa4fd977ac59a00baa85c124066f8af;hp=e7d3a71f0f099a35e7f1a89f20b55a0ef7f04a3b;hb=e784adbf59a182d6049d259d97ba92b06333b94d;hpb=7105f91988f424587dd22f78f4d9c56b108e82e6 diff --git a/src/editor/g_basic.pas b/src/editor/g_basic.pas index e7d3a71..17254de 100644 --- a/src/editor/g_basic.pas +++ b/src/editor/g_basic.pas @@ -7,6 +7,11 @@ interface uses LCLIntf, LCLType, LMessages; +const + EDITOR_VERSION = '0.667'; + EDITOR_BUILDDATE = {$I %DATE%}; + EDITOR_BUILDTIME = {$I %TIME%}; + Type String16 = String[16]; Char16 = packed array[0..15] of Char; @@ -19,6 +24,9 @@ Type TDirection = (D_LEFT, D_RIGHT); +function g_GetBuilderName (): AnsiString; +function g_GetBuildHash (full: Boolean = True): AnsiString; + function g_Collide(X1, Y1: Integer; Width1, Height1: Word; X2, Y2: Integer; Width2, Height2: Word): Boolean; function g_CollidePoint(X, Y, X2, Y2: Integer; Width, Height: Word): Boolean; @@ -53,6 +61,33 @@ implementation uses Math, g_map, MAPDEF, SysUtils; +{$PUSH} +{$WARN 2054 OFF} // unknwon env var +{$WARN 6018 OFF} // unreachable code +function g_GetBuilderName (): AnsiString; +begin + if {$I %D2DF_BUILD_USER%} <> '' then + result := {$I %D2DF_BUILD_USER%} // custom + else if {$I %USER%} <> '' then + result := {$I %USER%} // unix username + else if {$I %USERNAME%} <> '' then + result := {$I %USERNAME%} // windows username + else + result := 'unknown' +end; + +function g_GetBuildHash (full: Boolean = True): AnsiString; +begin + if {$I %D2DF_BUILD_HASH%} <> '' then + if full then + result := {$I %D2DF_BUILD_HASH%} + else + result := Copy({$I %D2DF_BUILD_HASH%}, 1, 7) + else + result := 'custom build' +end; +{$POP} + procedure g_ChangeDir(var dir: TDirection); begin if dir = D_LEFT then