Whitespace and formatting cleanups.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2832 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -86,7 +86,8 @@ TFB_ReInitGraphics (int driver, int flags, int width, int height)
|
||||
int togglefullscreen = 0;
|
||||
char caption[200];
|
||||
|
||||
if (GfxFlags == (flags ^ TFB_GFXFLAGS_FULLSCREEN) && driver == GraphicsDriver &&
|
||||
if (GfxFlags == (flags ^ TFB_GFXFLAGS_FULLSCREEN) &&
|
||||
driver == GraphicsDriver &&
|
||||
width == ScreenWidthActual && height == ScreenHeightActual)
|
||||
{
|
||||
togglefullscreen = 1;
|
||||
@@ -97,17 +98,20 @@ TFB_ReInitGraphics (int driver, int flags, int width, int height)
|
||||
if (driver == TFB_GFXDRIVER_SDL_OPENGL)
|
||||
{
|
||||
#ifdef HAVE_OPENGL
|
||||
result = TFB_GL_ConfigureVideo (driver, flags, width, height, togglefullscreen);
|
||||
result = TFB_GL_ConfigureVideo (driver, flags, width, height,
|
||||
togglefullscreen);
|
||||
#else
|
||||
driver = TFB_GFXDRIVER_SDL_PURE;
|
||||
log_add (log_Warning, "OpenGL support not compiled in,"
|
||||
" so using pure SDL driver");
|
||||
result = TFB_Pure_ConfigureVideo (driver, flags, width, height, togglefullscreen);
|
||||
result = TFB_Pure_ConfigureVideo (driver, flags, width, height,
|
||||
togglefullscreen);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
result = TFB_Pure_ConfigureVideo (driver, flags, width, height, togglefullscreen);
|
||||
result = TFB_Pure_ConfigureVideo (driver, flags, width, height,
|
||||
togglefullscreen);
|
||||
}
|
||||
|
||||
sprintf (caption, "The Ur-Quan Masters v%d.%d.%d%s",
|
||||
@@ -219,7 +223,8 @@ TFB_ProcessEvents ()
|
||||
{
|
||||
int flags = GfxFlags ^ TFB_GFXFLAGS_FULLSCREEN;
|
||||
FlushInput ();
|
||||
TFB_ReInitGraphics (GraphicsDriver, flags, ScreenWidthActual, ScreenHeightActual);
|
||||
TFB_ReInitGraphics (GraphicsDriver, flags, ScreenWidthActual,
|
||||
ScreenHeightActual);
|
||||
TFB_SwapBuffers (TFB_REDRAW_YES);
|
||||
}
|
||||
|
||||
@@ -265,16 +270,16 @@ TFB_SwapBuffers (int force_full_redraw)
|
||||
last_fade_amount == 255 && last_transition_amount == 255)
|
||||
return;
|
||||
|
||||
if (force_full_redraw == TFB_REDRAW_NO && (fade_amount != 255 || transition_amount != 255 ||
|
||||
if (force_full_redraw == TFB_REDRAW_NO &&
|
||||
(fade_amount != 255 || transition_amount != 255 ||
|
||||
last_fade_amount != 255 || last_transition_amount != 255))
|
||||
{
|
||||
force_full_redraw = TFB_REDRAW_FADING;
|
||||
}
|
||||
|
||||
last_fade_amount = fade_amount;
|
||||
last_transition_amount = transition_amount;
|
||||
|
||||
graphics_backend->preprocess (force_full_redraw, transition_amount, fade_amount);
|
||||
graphics_backend->preprocess (force_full_redraw, transition_amount,
|
||||
fade_amount);
|
||||
graphics_backend->screen (TFB_SCREEN_MAIN, 255, NULL);
|
||||
|
||||
if (transition_amount != 255)
|
||||
@@ -394,11 +399,11 @@ void TFB_BlitSurface (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst,
|
||||
maxh = src->h - srcy;
|
||||
if (maxh < h)
|
||||
h = maxh;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
srcx = srcy = 0;
|
||||
srcx = 0;
|
||||
srcy = 0;
|
||||
w = src->w;
|
||||
h = src->h;
|
||||
}
|
||||
@@ -623,7 +628,8 @@ TFB_FlushGraphics () // Only call from main thread!!
|
||||
(current_fade == 255 && last_fade != 255) ||
|
||||
(current_transition == 255 && last_transition != 255))
|
||||
{
|
||||
TFB_SwapBuffers (TFB_REDRAW_FADING); // if fading, redraw every frame
|
||||
TFB_SwapBuffers (TFB_REDRAW_FADING);
|
||||
// if fading, redraw every frame
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -883,15 +889,19 @@ TFB_FlushGraphics () // Only call from main thread!!
|
||||
case TFB_DRAWCOMMANDTYPE_REINITVIDEO:
|
||||
{
|
||||
int oldDriver = GraphicsDriver;
|
||||
if (TFB_ReInitGraphics (DC.data.reinitvideo.driver, DC.data.reinitvideo.flags,
|
||||
if (TFB_ReInitGraphics (DC.data.reinitvideo.driver,
|
||||
DC.data.reinitvideo.flags,
|
||||
DC.data.reinitvideo.width, DC.data.reinitvideo.height))
|
||||
{
|
||||
log_add (log_Error, "Could not provide requested mode: "
|
||||
"reverting to last known driver.");
|
||||
if (TFB_ReInitGraphics (oldDriver, DC.data.reinitvideo.flags,
|
||||
DC.data.reinitvideo.width, DC.data.reinitvideo.height))
|
||||
if (TFB_ReInitGraphics (oldDriver,
|
||||
DC.data.reinitvideo.flags,
|
||||
DC.data.reinitvideo.width,
|
||||
DC.data.reinitvideo.height))
|
||||
{
|
||||
log_add (log_Fatal, "Couldn't reinit at that point either."
|
||||
log_add (log_Fatal,
|
||||
"Couldn't reinit at that point either. "
|
||||
"Your video has been somehow tied in knots.");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
@@ -902,9 +912,7 @@ TFB_FlushGraphics () // Only call from main thread!!
|
||||
}
|
||||
|
||||
if (livelock_deterrence)
|
||||
{
|
||||
Unlock_DCQ ();
|
||||
}
|
||||
|
||||
TFB_SwapBuffers (TFB_REDRAW_NO);
|
||||
RenderedFrames++;
|
||||
|
||||
Reference in New Issue
Block a user