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;
|
int togglefullscreen = 0;
|
||||||
char caption[200];
|
char caption[200];
|
||||||
|
|
||||||
if (GfxFlags == (flags ^ TFB_GFXFLAGS_FULLSCREEN) && driver == GraphicsDriver &&
|
if (GfxFlags == (flags ^ TFB_GFXFLAGS_FULLSCREEN) &&
|
||||||
|
driver == GraphicsDriver &&
|
||||||
width == ScreenWidthActual && height == ScreenHeightActual)
|
width == ScreenWidthActual && height == ScreenHeightActual)
|
||||||
{
|
{
|
||||||
togglefullscreen = 1;
|
togglefullscreen = 1;
|
||||||
@@ -97,17 +98,20 @@ TFB_ReInitGraphics (int driver, int flags, int width, int height)
|
|||||||
if (driver == TFB_GFXDRIVER_SDL_OPENGL)
|
if (driver == TFB_GFXDRIVER_SDL_OPENGL)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_OPENGL
|
#ifdef HAVE_OPENGL
|
||||||
result = TFB_GL_ConfigureVideo (driver, flags, width, height, togglefullscreen);
|
result = TFB_GL_ConfigureVideo (driver, flags, width, height,
|
||||||
|
togglefullscreen);
|
||||||
#else
|
#else
|
||||||
driver = TFB_GFXDRIVER_SDL_PURE;
|
driver = TFB_GFXDRIVER_SDL_PURE;
|
||||||
log_add (log_Warning, "OpenGL support not compiled in,"
|
log_add (log_Warning, "OpenGL support not compiled in,"
|
||||||
" so using pure SDL driver");
|
" so using pure SDL driver");
|
||||||
result = TFB_Pure_ConfigureVideo (driver, flags, width, height, togglefullscreen);
|
result = TFB_Pure_ConfigureVideo (driver, flags, width, height,
|
||||||
|
togglefullscreen);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
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",
|
sprintf (caption, "The Ur-Quan Masters v%d.%d.%d%s",
|
||||||
@@ -219,7 +223,8 @@ TFB_ProcessEvents ()
|
|||||||
{
|
{
|
||||||
int flags = GfxFlags ^ TFB_GFXFLAGS_FULLSCREEN;
|
int flags = GfxFlags ^ TFB_GFXFLAGS_FULLSCREEN;
|
||||||
FlushInput ();
|
FlushInput ();
|
||||||
TFB_ReInitGraphics (GraphicsDriver, flags, ScreenWidthActual, ScreenHeightActual);
|
TFB_ReInitGraphics (GraphicsDriver, flags, ScreenWidthActual,
|
||||||
|
ScreenHeightActual);
|
||||||
TFB_SwapBuffers (TFB_REDRAW_YES);
|
TFB_SwapBuffers (TFB_REDRAW_YES);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,16 +270,16 @@ TFB_SwapBuffers (int force_full_redraw)
|
|||||||
last_fade_amount == 255 && last_transition_amount == 255)
|
last_fade_amount == 255 && last_transition_amount == 255)
|
||||||
return;
|
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))
|
last_fade_amount != 255 || last_transition_amount != 255))
|
||||||
{
|
|
||||||
force_full_redraw = TFB_REDRAW_FADING;
|
force_full_redraw = TFB_REDRAW_FADING;
|
||||||
}
|
|
||||||
|
|
||||||
last_fade_amount = fade_amount;
|
last_fade_amount = fade_amount;
|
||||||
last_transition_amount = transition_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);
|
graphics_backend->screen (TFB_SCREEN_MAIN, 255, NULL);
|
||||||
|
|
||||||
if (transition_amount != 255)
|
if (transition_amount != 255)
|
||||||
@@ -394,11 +399,11 @@ void TFB_BlitSurface (SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst,
|
|||||||
maxh = src->h - srcy;
|
maxh = src->h - srcy;
|
||||||
if (maxh < h)
|
if (maxh < h)
|
||||||
h = maxh;
|
h = maxh;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
srcx = srcy = 0;
|
srcx = 0;
|
||||||
|
srcy = 0;
|
||||||
w = src->w;
|
w = src->w;
|
||||||
h = src->h;
|
h = src->h;
|
||||||
}
|
}
|
||||||
@@ -623,7 +628,8 @@ TFB_FlushGraphics () // Only call from main thread!!
|
|||||||
(current_fade == 255 && last_fade != 255) ||
|
(current_fade == 255 && last_fade != 255) ||
|
||||||
(current_transition == 255 && last_transition != 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
|
else
|
||||||
{
|
{
|
||||||
@@ -883,15 +889,19 @@ TFB_FlushGraphics () // Only call from main thread!!
|
|||||||
case TFB_DRAWCOMMANDTYPE_REINITVIDEO:
|
case TFB_DRAWCOMMANDTYPE_REINITVIDEO:
|
||||||
{
|
{
|
||||||
int oldDriver = GraphicsDriver;
|
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))
|
DC.data.reinitvideo.width, DC.data.reinitvideo.height))
|
||||||
{
|
{
|
||||||
log_add (log_Error, "Could not provide requested mode: "
|
log_add (log_Error, "Could not provide requested mode: "
|
||||||
"reverting to last known driver.");
|
"reverting to last known driver.");
|
||||||
if (TFB_ReInitGraphics (oldDriver, DC.data.reinitvideo.flags,
|
if (TFB_ReInitGraphics (oldDriver,
|
||||||
DC.data.reinitvideo.width, DC.data.reinitvideo.height))
|
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.");
|
"Your video has been somehow tied in knots.");
|
||||||
exit (EXIT_FAILURE);
|
exit (EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
@@ -902,9 +912,7 @@ TFB_FlushGraphics () // Only call from main thread!!
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (livelock_deterrence)
|
if (livelock_deterrence)
|
||||||
{
|
|
||||||
Unlock_DCQ ();
|
Unlock_DCQ ();
|
||||||
}
|
|
||||||
|
|
||||||
TFB_SwapBuffers (TFB_REDRAW_NO);
|
TFB_SwapBuffers (TFB_REDRAW_NO);
|
||||||
RenderedFrames++;
|
RenderedFrames++;
|
||||||
|
|||||||
Reference in New Issue
Block a user