diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index 4413580bc..03b18d219 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -7,7 +7,7 @@ target_sources(SRB2SDL2 PRIVATE i_net.c i_system.cpp i_main.c - i_video.c + i_video.cpp dosstr.c endtxt.c hwsym_sdl.c diff --git a/src/sdl/i_video.c b/src/sdl/i_video.cpp similarity index 98% rename from src/sdl/i_video.c rename to src/sdl/i_video.cpp index 2eb773ada..074e8e52a 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.cpp @@ -622,7 +622,7 @@ static INT32 SDLJoyAxis(const Sint16 axis, evtype_t which) static void Impl_HandleWindowEvent(SDL_WindowEvent evt) { -#define FOCUSUNION (mousefocus | (kbfocus << 1)) +#define FOCUSUNION static_cast(mousefocus | (kbfocus << 1)) static SDL_bool firsttimeonmouse = SDL_TRUE; static SDL_bool mousefocus = SDL_TRUE; static SDL_bool kbfocus = SDL_TRUE; @@ -1073,7 +1073,7 @@ void I_GetEvent(void) for (i = 0; i < MAXSPLITSCREENPLAYERS; i++) { - if (newcontroller && (!JoyInfo[i].dev || !SDL_GameControllerGetAttached(JoyInfo[i].dev))) + if (newcontroller && (!JoyInfo[i].dev || !SDL_GameControllerGetAttached(JoyInfo[i].dev))) { UINT8 j; @@ -1686,7 +1686,7 @@ boolean VID_CheckRenderer(void) if (setrenderneeded) { - rendermode = setrenderneeded; + rendermode = static_cast(setrenderneeded); rendererchanged = true; #ifdef HWRENDER @@ -1718,7 +1718,7 @@ boolean VID_CheckRenderer(void) } // Create a new window. - Impl_CreateWindow(USE_FULLSCREEN); + Impl_CreateWindow(static_cast(USE_FULLSCREEN)); // From there, the OpenGL context was already created. contextcreated = true; @@ -1735,7 +1735,7 @@ boolean VID_CheckRenderer(void) setrenderneeded = 0; } - SDLSetMode(vid.width, vid.height, USE_FULLSCREEN, (setmodeneeded ? SDL_TRUE : SDL_FALSE)); + SDLSetMode(vid.width, vid.height, static_cast(USE_FULLSCREEN), (setmodeneeded ? SDL_TRUE : SDL_FALSE)); Impl_VideoSetupBuffer(); if (rendermode == render_soft) @@ -1828,7 +1828,7 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen) #endif // Create a window - window = SDL_CreateWindow("SRB2Kart "VERSIONSTRING, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, + window = SDL_CreateWindow("SRB2Kart " VERSIONSTRING, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, realwidth, realheight, flags); @@ -1895,7 +1895,7 @@ static void Impl_VideoSetupBuffer(void) vid.direct = NULL; if (vid.buffer) free(vid.buffer); - vid.buffer = calloc(vid.rowbytes*vid.height, NUMSCREENS); + vid.buffer = static_cast(calloc(vid.rowbytes*vid.height, NUMSCREENS)); if (!vid.buffer) { I_Error("%s", M_GetText("Not enough memory for video buffer\n")); @@ -1919,8 +1919,8 @@ void I_StartupGraphics(void) CV_RegisterVar (&cv_vidwait); CV_RegisterVar (&cv_stretch); CV_RegisterVar (&cv_alwaysgrabmouse); - disable_mouse = M_CheckParm("-nomouse"); - disable_fullscreen = M_CheckParm("-win") ? 1 : 0; + disable_mouse = static_cast(M_CheckParm("-nomouse")); + disable_fullscreen = M_CheckParm("-win") ? SDL_TRUE : SDL_FALSE; keyboard_started = true; @@ -1955,7 +1955,7 @@ void I_StartupGraphics(void) { if (!stricmp(modeparm, renderer_list[i].strvalue)) { - chosenrendermode = renderer_list[i].value; + chosenrendermode = static_cast(renderer_list[i].value); break; } i++; @@ -1983,8 +1983,8 @@ void I_StartupGraphics(void) if (chosenrendermode != render_none) rendermode = chosenrendermode; - usesdl2soft = M_CheckParm("-softblit"); - borderlesswindow = M_CheckParm("-borderless"); + usesdl2soft = M_CheckParm("-softblit") ? SDL_TRUE : SDL_FALSE; + borderlesswindow = M_CheckParm("-borderless") ? SDL_TRUE : SDL_FALSE; //SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY>>1,SDL_DEFAULT_REPEAT_INTERVAL<<2); VID_Command_ModeList_f();