X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fgame%2Fsdl%2Fg_system.pas;h=0df28dc724dc5b391f37dc85b7a8373a12070727;hp=1f4061abf7fdc4ba9ff74475e09d7ece908356e1;hb=a280ce1ab3f2d28a227e7cf492a12c749e4d5290;hpb=27be3c11b7c197efd13813735285e36f6c7c1485 diff --git a/src/game/sdl/g_system.pas b/src/game/sdl/g_system.pas index 1f4061a..0df28dc 100644 --- a/src/game/sdl/g_system.pas +++ b/src/game/sdl/g_system.pas @@ -124,17 +124,17 @@ implementation 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; @@ -158,7 +158,8 @@ implementation 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); @@ -184,7 +185,7 @@ implementation 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;