i_video: few type fixes for sdl3

This commit is contained in:
Alug committed 2025-12-01 16:48:29 +01:00
1 parent 2392f0484c
commit c6ca5a6f0f
1 file changed
+16 -14
+16 -14
View File
@@ -342,7 +342,7 @@ static INT32 Impl_SDL_Keysym_To_Keycode(SDL_KeyboardEvent evt)
return Impl_SDL_Scancode_To_Keycode(evt);
}
static boolean native_input_active = false;
static bool native_input_active = false;
// used to supress the games shift/alt handling
boolean I_UseNativeKeyboard(void)
@@ -578,7 +578,7 @@ static void Impl_HandleMouseMotionEvent(SDL_MouseMotionEvent evt)
if (!USE_MOUSEINPUT)
return;
const boolean windowinfocus = (SDL_GetMouseFocus() == window && SDL_GetKeyboardFocus() == window);
const bool windowinfocus = (SDL_GetMouseFocus() == window && SDL_GetKeyboardFocus() == window);
if (!windowinfocus)
{
@@ -1229,7 +1229,7 @@ static void VID_Command_Mode_f (void)
// Get the desktop resolution from the current display the gamewindow resides on
static void I_CheckDesktopRes(void)
{
int currentDisplayIndex = -1;
SDL_DisplayID currentDisplayIndex = 0;
const SDL_DisplayMode *curmode;
desktopwidth = 0;
@@ -1275,7 +1275,7 @@ void RefreshOGLSDLSurface(void)
void I_DownSample(void)
{
boolean needrefresh = false;
bool needrefresh = false;
if (!cv_glframebuffer.value || !supportFBO || (cv_glscreentextures.value == 0)) // no sense to do this crap if we cant benefit from it
{
@@ -1314,8 +1314,8 @@ static void SDLSetMode(INT32 width, INT32 height, bool fullscreen)
static bool wasfullscreen = false;
int sw_texture_format = SDL_PIXELFORMAT_ABGR8888;
realwidth = vid.width;
realheight = vid.height;
realwidth = (Uint16)vid.width;
realheight = (Uint16)vid.height;
if (window)
{
@@ -1374,8 +1374,8 @@ static void SDLSetMode(INT32 width, INT32 height, bool fullscreen)
SDL_SetRenderLogicalPresentation(renderer, width, height, SDL_LOGICAL_PRESENTATION_LETTERBOX);
// Set up Texture
realwidth = width;
realheight = height;
realwidth = (Uint16)width;
realheight = (Uint16)height;
if (texture != NULL)
{
@@ -1394,7 +1394,7 @@ static SDL_FRect src_rect = { 0, 0, 0, 0 };
void I_FinishUpdate(void)
{
if (rendermode == render_none)
return; //Alam: No software or OpenGl surface
return; // Alam: No software or OpenGl surface
SCR_CalculateFPS();
@@ -1403,7 +1403,7 @@ void I_FinishUpdate(void)
if (cv_ticrate.value)
SCR_DisplayTicRate();
const boolean isserverplayer = consoleplayer == serverplayer;
const bool isserverplayer = consoleplayer == serverplayer;
if (cv_showping.value && ((netgame && !isserverplayer) ||
(simulated_lag != 0 && isserverplayer && Playing())))
@@ -1582,8 +1582,8 @@ static int IsCustomResolutionInList(int list_size)
//
static void I_FillScreenResolutionsList(boolean force)
{
SDL_DisplayID currentDisplayIndex = -1;
static SDL_DisplayID oldDisplayIndex = -1;
SDL_DisplayID currentDisplayIndex = 0;
static SDL_DisplayID oldDisplayIndex = 0;
SDL_DisplayMode mode;
SDL_DisplayMode **displaymodes = NULL;
int i = 0, list_size = 0;
@@ -1752,7 +1752,7 @@ void VID_PrepareModeList(void)
static UINT32 refresh_rate;
static UINT32 VID_GetRefreshRate(void)
{
int index = SDL_GetDisplayForWindow(window);
SDL_DisplayID index = 0;
const SDL_DisplayMode *displaymode = NULL;
if (SDL_WasInit(SDL_INIT_VIDEO) == 0)
@@ -1761,6 +1761,7 @@ static UINT32 VID_GetRefreshRate(void)
return 0;
}
index = SDL_GetDisplayForWindow(window);
displaymode = SDL_GetDesktopDisplayMode(index);
if (!displaymode)
@@ -1845,6 +1846,7 @@ static bool Impl_CreateContext(void)
if (!renderer)
{
SDL_PropertiesID props = SDL_CreateProperties();
if (props == 0)
{
I_Error("Couldn't create rendering properties: %s", SDL_GetError());
@@ -1939,7 +1941,7 @@ static void Impl_SetWindowIcon(void)
static FILE * OpenRendererFile(const char * mode)
{
char * path = va(pandf,srb2home,"renderer.txt");
char * path = va(pandf, srb2home, "renderer.txt");
return fopen(path, mode);
}