Commit Graph

256 Commits

Author SHA1 Message Date
lewa_j
63c4b2748c platform: win32: sdl: Fix zombie processes after early Sys_Error on windows+sdl 2021-01-16 01:13:57 +03:00
Gleb Mazovetskiy
4daa7c23a0 SDL2 GameController: Map axes to engine explicitly 2021-01-07 17:37:37 +03:00
Gleb Mazovetskiy
3e8e751dc7 GameController: Add separate D-Pad bindings
1. Adds separate D-Pad bindings so that they don't conflict with arrow
   keys on the keyboard.
2. Also adds some basic defaults for gamepad buttons.
2021-01-07 17:37:37 +03:00
Gleb Mazovetskiy
5e0a0765ce Trim all trailing whitespace
The `.editorconfig` file in this repo is configured to trim all trailing
whitespace regardless of whether the line is modified.

Trims all trailing whitespace in the repository to make the codebase easier
to work with in editors that respect `.editorconfig`.

`git blame` becomes less useful on these lines but it already isn't very useful.

Commands:

```
find . -type f -name '*.h' -exec sed --in-place 's/[[:space:]]\+$//' {} \+
find . -type f -name '*.c' -exec sed --in-place 's/[[:space:]]\+$//' {} \+
```
2021-01-04 20:55:10 +03:00
Gleb Mazovetskiy
9452a389a5 SDL GameController: Hotplug and multiple gamepads
1. Process events from all game controllers.
2. Support controller hotplug.
2021-01-02 18:00:36 +03:00
Gleb Mazovetskiy
33ba1f25f3 sys_linux.c: Increase buffer size for /proc/self/status
Fixes #263
2021-01-02 04:21:01 +03:00
Gleb Mazovetskiy
5a36a26dd1 Fix SDL_GAMECONTROLLER handling
1. Do not disable SDL_JOYSTICK events. Disabling these events causes
   game controller events to be disabled as well. Instead, filter these events out.

2. Fix button mapping (it was off by one).
2020-12-28 16:11:19 +03:00
Velaron
03668116d7 platform: win32: COM_CheckLibraryDirectDependency fixes 2020-09-03 22:04:13 +03:00
Velaron
d015e97eae engine: client: m_rawinput support on windows 2020-08-24 21:22:02 +03:00
Velaron
b4aecfbf23 engine: move some input code 2020-08-24 21:22:02 +03:00
mittorn
e96271a8a9 platform/android: make host.state actual in Android_UpdateSurface call 2020-07-12 05:16:08 +07:00
mittorn
f0c9aa1585 vid_android: workaround small output buffer 2020-07-10 09:51:00 +07:00
mittorn
4515d3e3cb platform/android: implement native software blitter, fix lost context on resize, fix safegl 2020-07-08 08:48:46 +07:00
mittorn
bef873e1f8 platform/android: enable dynamic dladdr, fix build 2020-07-08 08:45:24 +07:00
mittorn
98ffbaf87a android: fix fallbacks 2020-07-07 00:22:01 +07:00
Alibek Omarov
82c54b1b54 engine: disallow zero-width strings for getenv() 2020-04-19 13:02:51 +03:00
Alibek Omarov
88ab42cc15 Merge branch 'master' of https://github.com/FWGS/xash3d-fwgs 2020-03-29 17:46:12 +03:00
Alibek Omarov
89ca0dec5e platform: android: slightly more verbosity 2020-03-29 17:44:23 +03:00
FOTMarut
79a7b7b1a3 engine: platform: sdl: Fix mousewheel in SDL2
- See issue 143
- Tested on SDL2
- Untested on SDL1.2
2020-03-29 11:27:08 +03:00
mittorn
84a3f6883d sdl: add EGL hint 2020-02-25 12:59:04 +07:00
mittorn
02c68c3a70 platform/sdl: add missing Platform_Shutdown 2020-02-08 23:48:52 +07:00
mittorn
a0d09c9954 lib_static: fix warnings 2020-02-08 23:39:35 +07:00
mittorn
70cc52e203 posix/sdl: fix build 2020-02-08 23:38:19 +07:00
mittorn
51849c6140 platform: DOS4GW port 2020-02-08 23:15:40 +07:00
mittorn
3e3aff040e platform: add Platfrom_Init, Platform_Shutdown, Platform_MouseMove move platform-specific code from host.c 2020-02-08 23:15:40 +07:00
mittorn
2b90790071 network: add stub for systems without BSD sockets, WATTCP support 2020-02-08 23:15:40 +07:00
mittorn
3a416636f1 engine: mark GAME_EXPORT's 2020-01-19 08:15:54 +07:00
mittorn
bbd033c254 lib: restore dll loader support 2020-01-19 07:38:37 +07:00
mittorn
22dc5b7416 Merge branch 'lib' of https://github.com/FWGS/xash3d-fwgs 2020-01-18 07:15:45 +07:00
Alibek Omarov
d0dbd185ad engine: android: fix enum-conversion 2019-12-23 06:55:00 +03:00
Alibek Omarov
8399107826 engine: platform: android: remake video backend to use EGL through Java code 2019-12-02 01:01:39 +03:00
Alibek Omarov
fec0a6baf6 engine: platform: android: change package name 2019-12-01 02:17:51 +03:00
Alibek Omarov
0c3be639c5 engine: reliably tell client.dll about vid mode changes 2019-11-26 02:47:48 +03:00
Alibek Omarov
9421457b3a engine: big refactoring commit, instead of using platform-specific platform-specific macros, use appropriate macros set by public/build.h 2019-11-24 03:52:08 +03:00
Alibek Omarov
744f75d4a3
engine: linux: simplify Platform_DoubleTime 2019-11-20 16:45:55 +03:00
mittorn
37435365e2 platform/posix: fix _GNU_SOURCE define in lib_posix 2019-11-18 23:48:49 +07:00
mittorn
94fc0febc7 fix some comments 2019-11-18 21:13:21 +07:00
mittorn
177f8ed653 platform: introduce lib backends, add static linking, wscript: add optional projects support, add static linking support, scripts: add xshlib for advanced linking options 2019-11-18 03:31:55 +07:00
Alibek Omarov
0636dc45bd engine: sdl: fix resizing event handling 2019-11-12 02:04:18 +03:00
Alibek Omarov
4b930c7854 Revert "engine: platform: magx: add pre-init platform-specific hook"
This reverts commit 2958b14cc2.
2019-11-07 05:06:24 +03:00
Alibek Omarov
0cb591821a Merge sdl12-port into master 2019-11-06 22:29:04 +03:00
Alibek Omarov
79adaa11e0 lowmemory: merge 2019-11-05 01:15:31 +03:00
mittorn
1365020302 ref: add enum for screen rotation 2019-11-04 20:27:46 +07:00
Alibek Omarov
1f308a43c8 engine: fix build after lowmemory rebase 2019-11-02 08:56:07 +03:00
Alibek Omarov
2958b14cc2 engine: platform: magx: add pre-init platform-specific hook 2019-11-02 08:56:07 +03:00
Alibek Omarov
aa6674b032 engine: support compiling with gcc3 2019-11-02 08:56:07 +03:00
Alibek Omarov
9d826016b0 engine: finish sdl1.2 port 2019-11-02 08:56:07 +03:00
Alibek Omarov
4d5e7c0557 platform: minify changes, use SDL_VERSION_ATLEAST macro(left unfinished) 2019-11-02 08:56:07 +03:00
Alibek Omarov
8dafbaeda2 engine: platform: sdl: dirty wip sdl1.2 port 2019-11-02 08:56:07 +03:00
Aimless-Wanderer
00e5d42459 platform: android: fix macros 2019-10-31 18:42:34 +03:00
mittorn
291fdfac68 platform/evdev: add some keys, add keyevent debug 2019-10-31 13:22:58 +07:00
mittorn
7f6395fa7d ref: display transformation API 2019-10-31 01:36:07 +07:00
Alibek Omarov
e3c3b05396 engine: platform: android: don't check if XASH_ENGLIBDIR and XASH_GAMELIBDIR are null. Load library by direct path if PATH_SPLITTER was found. Partially fixes #74 2019-10-30 16:55:00 +03:00
Alibek Omarov
6e637456ef platform: define platform-specific posix-compatible library loaders as macros to reduce macros hell in lib_posix.c 2019-10-30 16:46:18 +03:00
mittorn
feb01b270e zone, platform: add swap allocator 2019-10-26 12:10:50 +07:00
mittorn
6723758edc platform/alsa: fix case when buffer size is POT, improve latency, calculate sample count 2019-10-26 05:49:23 +07:00
mittorn
23956a0b82 platform: alsa support 2019-10-25 09:04:52 +07:00
mittorn
803c396fa2 platform: new fbdev bakend, move in_evdev to bakends 2019-10-22 01:42:02 +07:00
Alibek Omarov
8be58bcd21 engine: android: fix EGL context create error condition 2019-10-11 17:36:56 +03:00
Alibek Omarov
06e38b45c8 engine: android: don't throw host error when initializing software renderer on Android 2019-10-11 11:53:52 +03:00
Alibek Omarov
d3dd671759 engine: android: quick hack to load libraries on aarch64 until we don't symlinking lib folder 2019-10-11 11:50:21 +03:00
Alibek Omarov
fa622168a0 engine: fix style, disable XASH_USE_SELECT 2019-10-11 08:51:30 +03:00
Alibek Omarov
6e2dbd4e1c engine: android: get rid of VLA 2019-10-05 03:33:13 +03:00
Alibek Omarov
fbb88a55cb engine: linux: fix C89 2019-10-05 02:10:46 +03:00
Alibek Omarov
dc207a449c engine: fix -Werror=strict-prototypes 2019-10-05 02:09:45 +03:00
mittorn
da11da97ad android: enable touch support 2019-09-28 20:09:26 +07:00
mittorn
0afc3d83c6 android: add stub for Platform_PreCreateMove 2019-09-28 04:26:19 +07:00
Alibek Omarov
5040cb83d0 engine: win32: lib: oops, fix wrong sizeof 2019-09-27 17:02:04 +03:00
Alibek Omarov
2b385ff1f4 engine: win32: lib: try to fix crash when checking dependencies 2019-09-27 16:56:20 +03:00
mittorn
7f3ee9ca71 input: merge touch support again. Fix m_ignore, fix EngineAppendMove 2019-09-27 02:19:03 +07:00
Alibek Omarov
4049c54511 engine: android: fix video backend not compiled 2019-09-19 18:17:56 +03:00
Alibek Omarov
07aa9595c0 engine: android: allow building dedicated on Android 2019-09-19 17:09:18 +03:00
Alibek Omarov
3032ce3bee engine: android: fix building dlsym_weak on latest NDK 2019-09-10 11:15:48 +06:00
Alibek Omarov
56938344b8 engine: win32: include shellapi.h 2019-08-09 03:07:56 +03:00
Alibek Omarov
00b9ac676e engine: win32: fix inconsistent dll linkage 2019-08-09 02:51:15 +03:00
Alibek Omarov
8bb6aa2c51 engine: don't include windows headers, as they globally included by port.h already 2019-08-09 02:46:29 +03:00
Alibek Omarov
7be094b563 sdl: vid: prevent infinite recursion if SDL failed create window with selected GL attributes 2019-08-03 19:01:35 +03:00
Alibek Omarov
2f8fec6b70 Remove trailing spaces, convert mistakenly put spaces to tabs. The most useful commit ever. 2019-07-19 20:23:08 +03:00
Alibek Omarov
4beba75159 engine: fix various compiler warnings 2019-07-13 23:25:03 +03:00
Alibek Omarov
b2895770b8 platform: remove unneeded argument from SNDDMA_Init 2019-07-12 22:42:13 +03:00
Alibek Omarov
1f7dfecf89 platform: posix: library: properly use directpath argument 2019-07-11 04:00:25 +03:00
Alibek Omarov
fa68108907 engine: input: adapt gamepad code for new engine, remove gamepad ids, as it was never used and probably will never be, small optimizations 2019-07-09 03:48:09 +03:00
Alibek Omarov
a8f7b4fc5c
win32: lib: remove unused variable, fix error message may be not printed 2019-06-30 17:26:57 +03:00
Alibek Omarov
f2d588574c sdl: vid: fix engine window being restored immediately after being maximized 2019-06-30 16:19:34 +03:00
Alibek Omarov
b5d9bf5dc8 engine: add a function to determine if library has direct dependency on chosen DLL(Win32 only) 2019-06-29 23:25:50 +03:00
Alibek Omarov
413882a8d5 sdl: fix typos 2019-06-29 23:25:00 +03:00
Alibek Omarov
c92f8f71a7 sdl: vid: allow to build with earlier versions of SDL2 2019-06-29 22:59:13 +03:00
Alibek Omarov
eb22ff53c4 sdl: vid: fix washed out screen on Windows and probably other platforms(#50) 2019-06-29 20:40:23 +03:00
Alibek Omarov
90ff7f24b3
sdl: vid: fix building with older SDL2 2019-05-29 18:41:43 +03:00
Alibek Omarov
db72378806 engine: android: fix building custom dlsym with NDK r19c, clean-up 2019-05-28 04:09:47 +03:00
Alibek Omarov
d596f4ea52 engine: android: vid: fix building with NDK r19c 2019-05-28 03:55:54 +03:00
Alibek Omarov
2e953bd1a9 ref_api: remove GL_OnContextCreated, remove return value of GL_RenderFrame 2019-05-12 18:02:59 +03:00
Alibek Omarov
57f9e7dda6 sdl: vid: fix forgotten return, slightly refactor SW_UnlockBuffer 2019-05-12 17:49:20 +03:00
Alibek Omarov
e9e4a1296d engine: android: fix possible crash in custom dlsym 2019-05-12 03:07:28 +03:00
Alibek Omarov
85c2126775 engine: android: implement egl context management 2019-05-12 03:06:55 +03:00
Alibek Omarov
fe14a360b4 engine: fix fs_offset_t/size_t conversion, const qualifiers 2019-05-02 19:12:23 +03:00
Alibek Omarov
29a48cb34c sdl: vid: fix disabling vsync when loading a level 2019-05-02 18:07:27 +03:00
Alibek Omarov
3fef353291 android: initial port 2019-05-02 18:07:03 +03:00
Alibek Omarov
1a700fd06b platform: move MSGBOX implementation to platform backends 2019-05-01 19:44:48 +03:00
Alibek Omarov
e3e2f3afe5 platform: move Sys_ShellExecute implementation to platform backends 2019-05-01 19:21:47 +03:00
Alibek Omarov
99478ba9bd sdl: vid: fix unitialized variables, better warning report 2019-04-13 21:49:01 +03:00
Alibek Omarov
211d3c5213 sdl: vid: refactor context creation, fix crash on exit on REF_SOFTWARE 2019-04-13 20:34:32 +03:00
mittorn
d5911b33b1 msvc8 support 2019-04-12 14:33:57 +07:00
mittorn
d5b6ccb3e2 ref: REF_SOFTWARE support with SDL_Surface/SDL_Renderer 2019-04-11 22:19:08 +07:00
Alibek Omarov
a9cf3357c7 ref: move GLES driver hint to SetAttribute as we don't choose GLES renderer in compile-time anymore 2019-04-04 22:43:33 +03:00
Alibek Omarov
92b89936b3 ref: make API thinner by moving simple calls into EngineGetParm(RenderGetParm with ref extensions), fix some UBs 2019-03-22 16:36:46 +03:00
mittorn
57320c0c25 ref: get rid of vidState, add GL_SwapBuffers to engine exports 2019-03-16 11:58:44 +07:00
Alibek Omarov
e5000742f1 ref: context creating prototype, not working yet 2019-03-16 05:15:32 +03:00
Alibek Omarov
234507b7f1 ref: fix all undefined references 2019-03-11 17:37:58 +03:00
Alibek Omarov
e193ac2c04 ref: more @mittorn's changes on RefAPI 2019-02-23 21:49:46 +03:00
Alibek Omarov
99bd7c81da ref: render code moved out of engine, doesn't compile, first API prototype 2019-02-18 21:25:26 +03:00
mittorn
23d0f33ad1 Refactor extension detection, add VBO detection 2019-02-07 00:36:15 +07:00
Alibek Omarov
103a2fccaa sdl: vid: rework safegl option 2019-01-27 02:26:23 +03:00
Alibek Omarov
7205f2d4fa sound: sdl: use SDL_setenv for crossplatform 2019-01-13 18:19:35 +05:00
Alibek Omarov
ac77bab967 sound: opensles: same fix applied for OpenSLES/Android backend 2019-01-07 04:17:40 +03:00
Alibek Omarov
9935e2c8d3 sound: sdl: set pulseaudio environment variables regardless of target OS, because PA is crossplatform 2019-01-07 04:09:55 +03:00
Alibek Omarov
80fc7209ed sound: move related function declarations to platform header. Remove unused. 2019-01-07 04:07:06 +03:00
Alibek Omarov
621cdba53c engine: android: restore OpenSL ES audio 2018-12-20 10:22:04 +03:00
Alibek Omarov
e7ddc6d6c5 engine: android: restore dlsym hack for old Android(<5.0) 2018-12-20 10:15:44 +03:00
mittorn
aed53c4fda Do not spam in console if vsync not availiable 2018-12-05 23:56:41 +07:00
a1batross
0964fb11e4 sdl: partially fix maximizing window on Windows 2018-11-29 21:43:51 +03:00
Alibek Omarov
1b9bfd8906 platform: sdl: fix compiling 2018-11-18 23:04:47 +03:00
Alibek Omarov
9d93eca572 platform: linux: fix descriptor leak 2018-11-18 17:50:15 +03:00
Alibek Omarov
7c772d6bfd engine: rework timer stuff, move to platform. Move debugger present checks to platform 2018-11-16 16:32:16 +03:00
Alibek Omarov
25d8a94c1c engine: fix implicit declaration, remove dead MsgDev now, fix const modifier loss in host.c 2018-11-16 15:25:04 +03:00
Night Owl
d4e5e609af Do not break video subsystem initialization. 2018-11-05 15:39:00 +05:00
Alibek Omarov
a03aa3ddb3 Merge 4281 update 2018-10-28 00:39:29 +03:00
Alibek Omarov
de838ec5e8 rename backend files for great justice and consistency 2018-10-27 23:28:29 +03:00
Alibek Omarov
90d2434bb0 platform: add Set/GetClipboardText calls. Remove unneeded SDL_SetHint call on Android, because Android does not use SDL anymore 2018-10-27 23:28:29 +03:00
Alibek Omarov
96e0167e47 platform: add GetMousePos, SetMousePos calls, fix typo 2018-10-27 23:28:29 +03:00
a1batross
68ed732928 win_con: fix version in title, change title for dedicated server 2018-10-24 20:55:00 +03:00
Alibek Omarov
7390d11505 platform_sdl: adapt SDL backend code to new platform backends system 2018-10-22 00:28:24 +03:00
Alibek Omarov
265f79fc72 platform: add GetNativeObject call 2018-10-22 00:21:05 +03:00
Alibek Omarov
a5258bea65 library: move win32 definitions to win_lib.c 2018-10-22 00:13:56 +03:00
Alibek Omarov
25f07ddb97 platform: introduce common header for platform-dependent functions. To keep clean code and engine platform-agnostic, now including headers from platform folder, except this one, is strictly prohibited. 2018-10-21 23:52:14 +03:00
Alibek Omarov
216b4f4147 vid_sdl: fix incorrect video modes list length 2018-10-10 23:36:34 +03:00
Alibek Omarov
844b3a39a7 vid_sdl: fix GL_UpdateContext, fix window created outside screen if positions were negative 2018-10-10 20:01:54 +03:00
mittorn
491188a0f3 Merge branch 'original' 2018-10-04 14:27:14 +07:00
Alibek Omarov
2edbcb996d Merge 4150 update. Fix some mistypings. Rename CL_IsQuakeCompatible to Host_IsQuakeCompatible, as it may be used in whole engine and even in dedicated builds. IN_RecalcCenter was not added, window center positions should be updated by backends. 2018-06-19 16:59:53 +03:00
Alibek Omarov
473810fc0c MSVC & Win32 related fixes 2018-06-14 20:32:40 +03:00
Alibek Omarov
7cdead7bac Merge 4143 update 2018-06-12 12:18:14 +03:00
Alibek Omarov
f26ac52102 Merge 4140 update 2018-06-11 14:04:50 +03:00
lewa_j
43b746d2f8 Fix MinGW build 2018-05-13 23:25:51 +03:00
Alibek Omarov
415e517107 Library loader refactoring. Not tested for platforms other than Linux 2018-05-01 21:52:00 +03:00
Alibek Omarov
0681209114 Remove useless host.type set, replace HOST_DEDICATED checks by Host_IsDedicated 2018-05-01 17:30:33 +03:00
Alibek Omarov
becd0eba03 Possibility to use dedicated version with SDL(it's used only by internal timer) 2018-05-01 17:30:33 +03:00
Alibek Omarov
3f2a8f7704 Remove vid_mode. VID_GetModeString now returns only supported modes from SDL2 2018-04-29 09:21:23 +03:00
Alibek Omarov
a3c90248a7 Remove unneeded argument in SDLash_KeyEvent. Remove copypasted code 2018-04-26 02:52:49 +03:00
Alibek Omarov
63513ec475 Small refactoring of EnableTextInput 2018-04-22 14:01:56 +03:00
mittorn
af7123f7dd Merge branch 'original' (except gldebug, msaa) 2018-04-19 20:47:41 +00:00