engine: platform: move SDL2 support code into sdl2 subdirectory. Change XASH_SDL macro value from 12 to 1 for SDL1.2

This commit is contained in:
Alibek Omarov
2025-05-05 05:15:10 +03:00
parent 3d26ba1ed8
commit aa2e5eb3cc
9 changed files with 21 additions and 21 deletions
+2 -2
View File
@@ -254,8 +254,8 @@ void Platform_SetCursorType( VGUI_DefaultCursor type );
int Platform_GetClipboardText( char *buffer, size_t size );
void Platform_SetClipboardText( const char *buffer );
#if XASH_SDL == 12
#define SDL_SetWindowGrab( wnd, state ) SDL_WM_GrabInput( (state) )
#if XASH_SDL == 1
#define SDL_SetWindowGrab( wnd, state ) SDL_WM_GrabInput( (state) ? SDL_GRAB_ON : SDL_GRAB_OFF )
#define SDL_MinimizeWindow( wnd ) SDL_WM_IconifyWindow()
#define SDL_IsTextInputActive() host.textmode
#endif
@@ -1,6 +1,6 @@
/*
events.c - SDL event system handlers
Copyright (C) 2015-2017 a1batross
host_sdl2.c - SDL event system handlers
Copyright (C) 2015-2025 a1batross
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ GNU General Public License for more details.
#include "input.h"
#include "client.h"
#include "vgui_draw.h"
#include "events.h"
#include "platform_sdl2.h"
#include "sound.h"
#include "vid_common.h"
@@ -19,7 +19,7 @@ GNU General Public License for more details.
#include "input.h"
#include "client.h"
#include "vgui_draw.h"
#include "events.h"
#include "platform_sdl2.h"
#include "sound.h"
#include "vid_common.h"
@@ -19,7 +19,7 @@ GNU General Public License for more details.
#include "keydefs.h"
#include "input.h"
#include "client.h"
#include "events.h"
#include "platform_sdl2.h"
static const int g_button_mapping[] =
{
@@ -1,5 +1,5 @@
/*
events.h - SDL backend internal header
platform_sdl2.h - SDL backend internal header
Copyright (C) 2015-2018 a1batross
This program is free software: you can redistribute it and/or modify
@@ -18,7 +18,7 @@ GNU General Public License for more details.
#define KEYWRAPPER_H
#ifdef XASH_SDL
#include "platform/platform.h"
#include "platform.h"
// window management
void VID_RestoreScreenResolution( void );
@@ -14,7 +14,7 @@ GNU General Public License for more details.
*/
#include "common.h"
#include "platform/platform.h"
#include "platform.h"
#if XASH_SOUND == SOUND_SDL
#include "sound.h"
@@ -14,8 +14,8 @@ GNU General Public License for more details.
*/
#include <SDL.h>
#include "platform/platform.h"
#include "events.h"
#include "platform.h"
#include "platform_sdl2.h"
#if XASH_TIMER == TIMER_SDL
double Platform_DoubleTime( void )
@@ -17,7 +17,7 @@ GNU General Public License for more details.
#include "common.h"
#include "client.h"
#include "vid_common.h"
#include "platform/sdl/events.h"
#include "platform_sdl2.h"
static vidmode_t *vidmodes = NULL;
static int num_vidmodes = 0;