summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 27be3c1)
raw | patch | inline | side by side (parent: 27be3c1)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 13 Jul 2022 14:20:06 +0000 (17:20 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 13 Jul 2022 14:20:06 +0000 (17:20 +0300) |
src/game/sdl/g_system.pas | patch | blob | history | |
src/game/sdl2/g_system.pas | patch | blob | history |
index 1f4061abf7fdc4ba9ff74475e09d7ece908356e1..0df28dc724dc5b391f37dc85b7a8373a12070727 100644 (file)
g_Game_ClearLoading;
end;
- function GetTitle (): PChar;
+ function GetTitle (): AnsiString;
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]))
+ result := Format(GameTitle, [info]);
end;
function InitWindow (w, h, bpp: Integer; fullScreen: Boolean): Boolean;
- var flags: Uint32;
+ var flags: Uint32; title: AnsiString;
begin
e_LogWritefln('InitWindow %s %s %s %s', [w, h, bpp, fullScreen]);
result := false;
e_LogWriteln('GL: unable to load OpenGL functions', TMsgType.Fatal);
exit;
end;
- SDL_WM_SetCaption(GetTitle(), nil);
+ title := GetTitle();
+ SDL_WM_SetCaption(PChar(title), nil);
gFullScreen := fullscreen;
gRC_FullScreen := fullscreen;
UpdateSize(w, h);
function sys_GetDisplayModes (bpp: Integer): SSArray;
var m: PPSDL_Rect; f: TSDL_PixelFormat; i, count: Integer;
begin
- SetLength(result, 0);
+ result := nil;
FillChar(f, sizeof(f), 0);
f.palette := nil;
f.BitsPerPixel := bpp;
index eec03232f7d26e99fd2619d39994ff5291b26257..9cd1ee194b0ae4b89bb587e593c689067fd477cb 100644 (file)
{$ENDIF}
end;
- function GetTitle (): PChar;
+ function GetTitle (): AnsiString;
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]))
+ result := Format(GameTitle, [info]);
end;
function InitWindow (w, h, bpp: Integer; fullScreen, maximized: Boolean): Boolean;
- var flags: UInt32; x, y: cint;
+ var flags: UInt32; x, y: cint; title: AnsiString;
begin
// note: on window close make: if assigned(oglDeinitCB) then oglDeinitCB;
e_LogWritefln('InitWindow %s %s %s %s', [w, h, bpp, fullScreen]);
x := wx;
y := wy
end;
- window := SDL_CreateWindow(GetTitle(), x, y, w, h, flags);
+ title := GetTitle();
+ window := SDL_CreateWindow(PChar(title), x, y, w, h, flags);
if window <> nil then
begin
context := SDL_GL_CreateContext(window);