1
0
forked from 0ad/0ad
Commit Graph

33 Commits

Author SHA1 Message Date
12cceed3d9 Fix hotkeys not releasing properly.
a4852c4c01 changed hotkeys to use scancode, but didn't change g_keys to
reflect that, and this could break hotkey release.
This fixes that by explicitly using scancodes. Note that we might want a
g_keys map in the future, but it seems un-necessary at the moment.

Also remove the last remnants of 'negated' hotkeys, which were disabled
following b995135138.

Tested By: OptimusShepard
Fixes #5922

Differential Revision: https://code.wildfiregames.com/D3379
This was SVN commit r24645.
2021-01-16 15:24:58 +00:00
aa025b514b Fix out of bounds access in Hotkey.cpp. Patch by echotangoecho.
Differential Revision: https://code.wildfiregames.com/D211
This was SVN commit r19613.
2017-05-19 18:01:22 +00:00
9a2d0f803e Remove disabled by default SDL1 support.
Refs #2041.

This was SVN commit r17470.
2015-12-14 10:52:21 +00:00
69c8b89f84 Fixes blank window after maximizing, minimizing, then restoring the game on Windows. In SDL2, this is an SDL_WINDOWEVENT_EXPOSED event, which we must handle to reset the game's minimized state. Refs #2041
This was SVN commit r15832.
2014-10-04 00:46:53 +00:00
26dbac8d57 fixes to SoundManager external interface, clean up ifdef situation, and SoundGroup playin
This was SVN commit r13474.
2013-06-13 12:12:44 +00:00
71b25d5bd4 big SoundManager checkin,futureproof javascript interface, isolate external calls to remove OpenAL references
This was SVN commit r13455.
2013-06-06 11:13:57 +00:00
bf959e1c46 fix build when using --without-audio
This was SVN commit r13389.
2013-05-02 13:58:28 +00:00
0cad19ecec double check that the sound manager has been created before using
This was SVN commit r13353.
2013-04-10 12:03:17 +00:00
b301d5c84d fades music in and out when switching to background, also honors g_PauseOnFocusLoss
This was SVN commit r13352.
2013-04-10 11:51:42 +00:00
c9a5d5cee5 pause music and ambient sounds when game pauses
This was SVN commit r13347.
2013-04-07 04:13:15 +00:00
3fab2729b5 Partial SDL2 compatibility
This was SVN commit r11033.
2012-02-06 22:47:35 +00:00
893cb2668e Renames our sdl.h to libsdl.h, to avoid case sensitivity errors when it includes SDL.h.
This was SVN commit r10904.
2012-01-12 23:32:27 +00:00
6bb54ee1d4 Fix Windows build
This was SVN commit r10896.
2012-01-11 23:04:33 +00:00
d07eac218c SDL 1.3 build fixes.
Support SDL_CONFIG environment variable in update-workspaces to pick
non-default sdl-config.
Avoid non-standard use of SDL/ in include paths.

This was SVN commit r10895.
2012-01-11 22:50:39 +00:00
707539ad69 Don't scroll the game view when the mouse is outside the window
This was SVN commit r7283.
2010-01-23 20:40:15 +00:00
8a52113e60 huge cleanup and conversion of most string handling (especially paths) to unicode
please note: format strings must be %hs for char* arguments and %ls for
wchar_t*

This was SVN commit r7161.
2009-11-03 21:46:35 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
c0ed950657 had to remove uint and ulong from lib/types.h due to conflict with other library.
this snowballed into a massive search+destroy of the hodgepodge of
mostly equivalent types we had in use (int, uint, unsigned, unsigned
int, i32, u32, ulong, uintN).

it is more efficient to use 64-bit types in 64-bit mode, so the
preferred default is size_t (for anything remotely resembling a size or
index). tile coordinates are ssize_t to allow more efficient conversion
to/from floating point. flags are int because we almost never need more
than 15 distinct bits, bit test/set is not slower and int is fastest to
type. finally, some data that is pretty much directly passed to OpenGL
is now typed accordingly.

after several hours, the code now requires fewer casts and less
guesswork.

other changes:
- unit and player IDs now have an "invalid id" constant in the
respective class to avoid casting and -1
- fix some endian/64-bit bugs in the map (un)packing. added a
convenience function to write/read a size_t.
- ia32: change CPUID interface to allow passing in ecx (required for
cache topology detection, which I need at work). remove some unneeded
functions from asm, replace with intrinsics where possible.

This was SVN commit r5942.
2008-05-11 18:48:32 +00:00
ad55f9f1bc pending improvements and partial fixes to self-tests
fix: g_frequencyFilter is now in globals.cpp instead of in main (since
other modules access it and main.cpp isn't included in the self-test)
fix: globals.h now avoids dragging sdl.h into other projects
allocators: got rid of references to the old master header (must now
include the specific header, e.g. dynarray.h)

This was SVN commit r5534.
2008-01-03 22:07:18 +00:00
8f066e18ee Ignore non-standard mouse buttons, instead of crashing
This was SVN commit r5098.
2007-05-26 18:38:38 +00:00
bc24974496 # sweng
forward declare SDL_event. remove SDL dependency of network code.
refs #140

This was SVN commit r4252.
2006-08-26 21:52:18 +00:00
3d26549032 Fixed file properties - removed svn:executable and svn:keywords (left over from CVS conversion?) from all files; set svn:eol-style=native for *.cpp, *.h (and fixed files with inconsistent line endings)
This was SVN commit r3802.
2006-04-23 23:14:18 +00:00
fcfa746244 Linux compat changes, fix for (really old) bug in VertexBufferManager shutdown, GUI header reorganization for gcc 4.0
This was SVN commit r3437.
2006-01-29 18:23:47 +00:00
6af5888866 replace g_active with more clear g_app_has_focus and g_app_minimized
reinstate g_keys - realized that atlas mode cannot call SDL_GetKeyState
main: use g_app_minimized etc. to use up less CPU time when app isn't
active (makes debugging more bearable)

This was SVN commit r3070.
2005-10-31 18:36:36 +00:00
8c76dc34af g_keys[] has been made redundant by SDL's key array; use SDL_GetKeyState instead to get address of new keys array
fix W4 warnings (unused param and type conversion mostly)

This was SVN commit r3068.
2005-10-31 16:26:51 +00:00
2452e29f0d remove key- and mouse-state-clear code (previously called after alt+tab out). wsdl now takes care of this: by maintaining its own key array+sending up events for all currently down keys; and by capturing the mouse on each click.
-- this fixes "cursor keys require ctrl" bug reported by jason
wdbg_sym: fix warning
wsdl: as above and also better SDL_ACTIVEEVENT handling
mmgr: 500µs -> 500s -> 500us :)

This was SVN commit r3065.
2005-10-31 01:15:49 +00:00
0a202da843 also add code here to reset buttons when alt+tabbing out, analogous to CGUI (thanks to Philip for mentioning the problem)
This was SVN commit r3004.
2005-10-24 21:43:39 +00:00
a5a9f4b657 g++ compilation fixes.
Fix: Unix symbol resolver ignores NULL parameters like Windows resolver
instead of crashing.
Fix: Bugs and crashes in the input system, caused by wrong use of
SDL_BUTTON_* constants.

This was SVN commit r2984.
2005-10-21 18:32:16 +00:00
32cfc6d807 minimap: now use GUI event system instead of polling. fixes broken click feature.
textureentry: add performance note
list, text: fix mousewheel direction
input: was going to add a deque to allow registering handlers in back
and front. obviated by minimap fix, though. cleaned up a bit and renamed
stuff (again, sigh).
loaderthunks: fixed weird alignment/padding warning

This was SVN commit r2979.
2005-10-20 15:27:39 +00:00
bed9363bfe lib/input.h was old+bad code. fixed in_add_handler return type to enum; renamed EV_PASS to IN_PASS; no longer include sdl.h from other code (instead rely on input.h)
This was SVN commit r2975.
2005-10-20 17:44:56 +00:00
a953a8ef57 debug_assert now displays function name also. this neatly avoids the need for __func__ in every debug_warn, which also breaks on Linux. all such constructions have been removed.
This was SVN commit r2968.
2005-10-19 06:29:55 +00:00
02341916dc Minimap: refactor if() spanning 200 lines into if(!) return
cause of minimap click no longer working has been found:
GlobalInputHandler isn't getting called due to incorrect order of
registration. fix is pending.

game: add code from ScEd that fixes lack of player color (by setting up
local players)
thanks to Simon for finding the cause (I want that crystal ball :D)

This was SVN commit r2967.
2005-10-19 06:11:21 +00:00
953d2621dd timer: improved timer_add_client - no longer has fixed-size storage. btw, name will change here - not happy with SUM_TIMER.
GUI/input code: moved g_active, g_keys etc. into ps/Globals; it has its
own input handler as well

all users of fopen(): add file_make_full_native_path to get correct path
even though current dir = system/

This was SVN commit r2954.
2005-10-16 23:16:08 +00:00