use early returns for "I_Finish" stuff
i like that more, less checks for stuff
This commit is contained in:
1 parent
7dbd95d556
commit
237aeb7834
1 file changed
+20
-16
+20
-16
@@ -1329,14 +1329,12 @@ void I_UpdateNoBlit(void)
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
OglSdlFinishUpdate(cv_vidwait.value);
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
#endif
|
||||
if (rendermode == render_soft)
|
||||
{
|
||||
SDL_RenderCopy(renderer, texture, NULL, NULL);
|
||||
SDL_RenderPresent(renderer);
|
||||
}
|
||||
SDL_RenderCopy(renderer, texture, NULL, NULL);
|
||||
SDL_RenderPresent(renderer);
|
||||
}
|
||||
|
||||
exposevideo = SDL_FALSE;
|
||||
@@ -1371,7 +1369,15 @@ void I_FinishUpdate(void)
|
||||
ST_AskToJoinEnvelope();
|
||||
#endif
|
||||
|
||||
if (rendermode == render_soft && vid.screens[0])
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
OglSdlFinishUpdate(cv_vidwait.value);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (vid.screens[0])
|
||||
{
|
||||
void *pixels;
|
||||
int pitch;
|
||||
@@ -1393,12 +1399,6 @@ void I_FinishUpdate(void)
|
||||
SDL_RenderCopy(renderer, texture, &src_rect, NULL);
|
||||
SDL_RenderPresent(renderer);
|
||||
}
|
||||
#ifdef HWRENDER
|
||||
else if (rendermode == render_opengl)
|
||||
{
|
||||
OglSdlFinishUpdate(cv_vidwait.value);
|
||||
}
|
||||
#endif
|
||||
|
||||
exposevideo = SDL_FALSE;
|
||||
}
|
||||
@@ -1421,7 +1421,8 @@ void I_ReadScreen(UINT8 * restrict scr, INT32 scale)
|
||||
{
|
||||
if (rendermode != render_soft)
|
||||
I_Error("I_ReadScreen: called while in non-software mode");
|
||||
else if (scale == 1)
|
||||
|
||||
if (scale == 1)
|
||||
VID_BlitLinearScreen(vid.screens[0], scr, vid.width, vid.height, vid.width, vid.width);
|
||||
else
|
||||
{
|
||||
@@ -1596,8 +1597,9 @@ static SDL_bool Impl_CreateContext(void)
|
||||
}
|
||||
|
||||
SDL_GL_MakeCurrent(window, sdlglcontext);
|
||||
|
||||
return SDL_TRUE;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if (rendermode == render_soft)
|
||||
{
|
||||
@@ -1637,9 +1639,11 @@ static SDL_bool Impl_CreateContext(void)
|
||||
}
|
||||
|
||||
SDL_RenderSetLogicalSize(renderer, BASEVIDWIDTH, BASEVIDHEIGHT);
|
||||
|
||||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
return SDL_TRUE;
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
|
||||
|
||||
Reference in new issue
Block a user