X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fgame%2Fsdl2%2Fg_system.pas;h=9cd1ee194b0ae4b89bb587e593c689067fd477cb;hp=992d6dc4c7091de9906f6f9808ef695c7553542c;hb=a280ce1ab3f2d28a227e7cf492a12c749e4d5290;hpb=7c06a96f799350b246c7ed39d30c2a08237edee5 diff --git a/src/game/sdl2/g_system.pas b/src/game/sdl2/g_system.pas index 992d6dc..9cd1ee1 100644 --- a/src/game/sdl2/g_system.pas +++ b/src/game/sdl2/g_system.pas @@ -124,7 +124,7 @@ implementation e_ResizeWindow(w, h); e_InitGL; g_Game_SetupScreenSize; - {$IFNDEF ANDOIRD} + {$IFNDEF ANDROID} (* This will fix menu reset on keyboard showing *) g_Menu_Reset; {$ENDIF} @@ -134,17 +134,17 @@ implementation {$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]); @@ -178,7 +178,8 @@ implementation 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); @@ -247,8 +248,6 @@ implementation procedure sys_Repaint; begin - if glRenderToFBO then - e_BlitFramebuffer(gWinSizeX, gWinSizeY); SDL_GL_SwapWindow(window) end; @@ -509,9 +508,11 @@ implementation e_KeyUpDown(key, down); g_Console_ProcessBind(key, down); end - else if gConsoleShow or gChatShow or (g_ActiveWindow <> nil) then + else begin - KeyPress(key) // key repeat in menus and shit + if g_dbg_input then + e_LogWritefln('Input Debug: keyrep, scancode=%s', [key]); + g_Console_ProcessBindRepeat(key); end end;