X-Git-Url: https://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fgame%2Fsdl2%2Fg_system.pas;h=f46c3278669f208ae7258eef957b5caab3991d89;hp=85e5d947e2dd9af743c1c4b5d48752ba40fbefd8;hb=2d2ce4c1770a59c3e780f3fd31249ce6043f374c;hpb=d63e6eaaecbc83b40c9b932b3381fc324f6a2461 diff --git a/src/game/sdl2/g_system.pas b/src/game/sdl2/g_system.pas index 85e5d94..f46c327 100644 --- a/src/game/sdl2/g_system.pas +++ b/src/game/sdl2/g_system.pas @@ -24,7 +24,7 @@ interface procedure sys_Delay (ms: Integer); (* --- Graphics --- *) - function sys_GetDispalyModes (bpp: Integer): SSArray; + function sys_GetDisplayModes (bpp: Integer): SSArray; function sys_SetDisplayMode (w, h, bpp: Integer; fullscreen: Boolean): Boolean; procedure sys_EnableVSync (yes: Boolean); procedure sys_Repaint; @@ -167,7 +167,7 @@ implementation SDL_GL_SetSwapInterval(0) end; - function sys_GetDispalyModes (bpp: Integer): SSArray; + function sys_GetDisplayModes (bpp: Integer): SSArray; var i, count, num, pw, ph: Integer; m: TSDL_DisplayMode; begin result := nil; @@ -408,20 +408,19 @@ implementation procedure HandleTextInput (var ev: TSDL_TextInputEvent); var ch: UnicodeChar; sch: AnsiChar; begin - if g_dbg_input then - e_LogWritefln('Input Debug: text, text=%s', [ev.text]); Utf8ToUnicode(@ch, PChar(ev.text), 1); - if IsValid1251(Word(ch)) then - begin - sch := AnsiChar(wchar2win(ch)); + sch := AnsiChar(wchar2win(ch)); + if g_dbg_input then + e_LogWritefln('Input Debug: text, text="%s", ch = %s, sch = %s', [ev.text, Ord(ch), Ord(sch)]); + if IsValid1251(Word(ch)) and IsPrintable1251(ch) then CharPress(sch); - end; end; function sys_HandleInput (): Boolean; var ev: TSDL_Event; begin result := false; + ZeroMemory(@ev, sizeof(ev)); while SDL_PollEvent(@ev) <> 0 do begin case ev.type_ of