summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a030274)
raw | patch | inline | side by side (parent: a030274)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 6 Nov 2019 14:50:28 +0000 (17:50 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 6 Nov 2019 14:50:28 +0000 (17:50 +0300) |
src/game/g_basic.pas | patch | blob | history | |
src/game/g_main.pas | patch | blob | history | |
src/game/sdl/g_system.pas | patch | blob | history | |
src/game/sdl2/g_system.pas | patch | blob | history |
diff --git a/src/game/g_basic.pas b/src/game/g_basic.pas
index 92a7955d505d74db05049759ad63e67b5e1bc4ad..7024514be8898ce6796ea8dd5b9213f69e8c6893 100644 (file)
--- a/src/game/g_basic.pas
+++ b/src/game/g_basic.pas
DWArray = array of DWORD;
String20 = String[20];
+function g_GetBuilderName (): AnsiString;
+function g_GetBuildHash (full: Boolean = True): AnsiString;
+
function g_CreateUID(UIDType: Byte): Word;
function g_GetUIDType(UID: Word): Byte;
function g_Collide(X1, Y1: Integer; Width1, Height1: Word;
Math, geom, e_log, g_map, g_gfx, g_player, SysUtils, MAPDEF,
StrUtils, e_graphics, g_monsters, g_items, g_game;
+{$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_USER%} <> '' then
+ if full then
+ result := {$I %D2DF_BUILD_HASH%}
+ else
+ result := Copy({$I %D2DF_BUILD_HASH%}, 1, 7)
+ else
+ result := 'custom build'
+end;
+{$POP}
+
function g_PatchLength(X1, Y1, X2, Y2: Integer): Word;
begin
Result := Min(Round(Hypot(Abs(X2-X1), Abs(Y2-Y1))), 65535);
diff --git a/src/game/g_main.pas b/src/game/g_main.pas
index 9fadc1beddc6e0c68f2e36ae6ecb39f3e0693985..8142dd83c30f7c1fd14b4a28fe650aec0769415a 100644 (file)
--- a/src/game/g_main.pas
+++ b/src/game/g_main.pas
e_InitWritelnDriver();
e_WriteLog('Doom 2D: Forever version ' + GAME_VERSION + ' proto ' + IntToStr(NET_PROTOCOL_VER), TMsgType.Notify);
e_WriteLog('Build date: ' + GAME_BUILDDATE + ' ' + GAME_BUILDTIME, TMsgType.Notify);
+ e_WriteLog('Build hash: ' + g_GetBuildHash(), TMsgType.Notify);
+ e_WriteLog('Build by: ' + g_GetBuilderName(), TMsgType.Notify);
e_LogWritefln('Force bin dir: %s', [forceBinDir], TMsgType.Notify);
e_LogWritefln('BINARY PATH: [%s]', [binPath], TMsgType.Notify);
index 4cb69f90349c26ac449f029ded27ff3e30303747..bdb4addacd31ae280b01274772671f61683ab014 100644 (file)
SysUtils, SDL, Math,
{$INCLUDE ../nogl/noGLuses.inc}
e_log, e_graphics, e_input, e_sound,
- g_options, g_window, g_console, g_game, g_menu, g_gui, g_main;
+ g_options, g_window, g_console, g_game, g_menu, g_gui, g_main, g_basic;
const
- GameTitle = 'Doom 2D: Forever (SDL 1.2)';
+ GameTitle = 'Doom 2D: Forever (SDL 1.2, %s)';
var
userResize: Boolean;
g_Game_ClearLoading;
end;
+ function GetTitle (): PChar;
+ var info: AnsiString;
+ begin
+ info := g_GetBuildHash(false);
+ if info = 'custom build' then
+ info := info + ' by ' + g_GetBuilderName() + ' ' + GAME_BUILDDATE + ' ' + GAME_BUILDTIME;
+ result := PChar(Format(GameTitle, [info]))
+ end;
+
function InitWindow (w, h, bpp: Integer; fullScreen: Boolean): Boolean;
var flags: Uint32;
begin
{$IFDEF NOGL_INIT}
nogl_Init;
{$ENDIF}
- SDL_WM_SetCaption(GameTitle, nil);
+ SDL_WM_SetCaption(GetTitle(), nil);
UpdateSize(w, h);
result := True
end
index f46c3278669f208ae7258eef957b5caab3991d89..6750d68e6364570a0485647bc8c61d7e1bf832d4 100644 (file)
{$IFDEF ENABLE_HOLMES}
g_holmes, sdlcarcass, fui_ctls,
{$ENDIF}
- g_touch, g_options, g_window, g_console, g_game, g_menu, g_gui, g_main;
+ g_touch, g_options, g_window, g_console, g_game, g_menu, g_gui, g_main, g_basic;
const
- GameTitle = 'Doom 2D: Forever (SDL 2)';
+ GameTitle = 'Doom 2D: Forever (SDL 2, %s)';
var
window: PSDL_Window;
{$ENDIF}
end;
+ function GetTitle (): PChar;
+ var info: AnsiString;
+ begin
+ info := g_GetBuildHash(false);
+ if info = 'custom build' then
+ info := info + ' by ' + g_GetBuilderName() + ' ' + GAME_BUILDDATE + ' ' + GAME_BUILDTIME;
+ result := PChar(Format(GameTitle, [info]))
+ end;
+
function InitWindow (w, h, bpp: Integer; fullScreen: Boolean): Boolean;
var flags: UInt32;
begin
{$ENDIF}
flags := SDL_WINDOW_OPENGL or SDL_WINDOW_RESIZABLE;
if fullScreen then flags := flags or SDL_WINDOW_FULLSCREEN;
- window := SDL_CreateWindow(GameTitle, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, w, h, flags);
+ window := SDL_CreateWindow(GetTitle(), SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, w, h, flags);
if window <> nil then
begin
context := SDL_GL_CreateContext(window);