]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commit
vid: refactor modesetting fallbacks
authorbones_was_here <bones_was_here@xonotic.au>
Mon, 15 Apr 2024 01:21:18 +0000 (11:21 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Sun, 21 Apr 2024 13:59:14 +0000 (23:59 +1000)
commit43ffddbbca73368e5d6fa66f357a77be35de6c28
tree00a132e4c1069787c9a85459bf72dbe065d25678
parent71e366e8129cb97bda348fa9bf86727c5e7887c7
vid: refactor modesetting fallbacks

Moves setting of cvars from VID_Mode into VID_Restart_f because we only
need to do it if a vid_restart fails after changes were made, during
normal startup the only source of config changes is the fallbacks cvar
array which already sets them as they're tested.
This avoids unnecessary clobbering and callbacks under normal
circumstances and makes vid_restart code more self-contained.

Refers to cvars by pointer instead of string for robustness.

Removes persistent storage of last known good mode, it's only needed in
VID_Restart_f and it would be verbose and error-prone to keep it updated
as well as the current mode when applying cvar changes and SDL events.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
vid.h
vid_shared.c