foxygit / doom Log in
commit a44cef97897474df434501daca50a07b50019aa2
Merge: 2532daf4 ed77a8fe
Author:     Simon Howard <fraggle@soulsphere.org>
AuthorDate: Sat Jun 4 20:31:42 2016 -0400
Commit:     Simon Howard <fraggle@soulsphere.org>
CommitDate: Sat Jun 4 20:31:42 2016 -0400

    Merge remote-tracking branch 'origin/master' into sdl2-branch

 pkg/osx/GNUmakefile |   4 +-
 src/doom/d_main.c   |  26 +++++++++++-
 src/i_video.c       |  16 ++++----
 src/i_video.h       |   3 --
 src/setup/display.c |   7 ----
 src/strife/d_main.c |   8 +++-
 src/v_diskicon.c    | 113 ++++++++++++++++++++++++++++++++++++++++++++--------
 src/v_diskicon.h    |  15 ++-----
 src/w_wad.c         |   4 +-
 9 files changed, 140 insertions(+), 56 deletions(-)

diff --cc src/doom/d_main.c
index d4584052,1b708381..7675f0a7
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@@ -428,10 -450,8 +450,10 @@@ void D_DoomLoop (void
      I_GraphicsCheckCommandLine();
      I_SetGrabMouseCallback(D_GrabMouseCallback);
      I_InitGraphics();
-     V_EnableLoadingDisk(SCREENWIDTH - LOADING_DISK_W, SCREENHEIGHT - LOADING_DISK_H);
+     EnableLoadingDisk();

 +    TryRunTics();
 +
      V_RestoreBuffer();
      R_ExecuteSetViewSize();

diff --cc src/i_video.c
index 1499a0df,8004b539..d13786e5
--- a/src/i_video.c
+++ b/src/i_video.c
@@@ -98,23 -171,23 +99,14 @@@ int usemouse = 1

  int png_screenshots = 0;

- // Display disk activity indicator.
-
- int show_diskicon = 1;
-
- // Only display the disk icon if more then this much bytes have been read
- // during the previous tic.
 -// if true, I_VideoBuffer is screen->pixels
--
- int diskicon_readbytes = 0;
 -static boolean native_surface;
--
  // Screen width and height, from configuration file.

 -int screen_width = SCREENWIDTH;
 -int screen_height = SCREENHEIGHT;
 -
 -// Color depth.
 +int window_width = SCREENWIDTH * 2;
 +int window_height = SCREENHEIGHT_4_3 * 2;

 -int screen_bpp = 0;
 +// Fullscreen mode, 0x0 for SDL_WINDOW_FULLSCREEN_DESKTOP.

 -// Automatically adjust video settings if the selected mode is
 -// not a valid video mode.
 -
 -static int autoadjust_video_settings = 1;
 +int fullscreen_width = 0, fullscreen_height = 0;

  // Run in full screen mode?  (int type for config code)

@@@ -663,39 -955,46 +655,45 @@@ void I_FinishUpdate (void
  	    I_VideoBuffer[ (SCREENHEIGHT-1)*SCREENWIDTH + i] = 0x0;
      }

+     // Draw disk icon before blit, if necessary.
+     V_DrawDiskIcon();
+
 -    // draw to screen
 -
 -    BlitArea(0, 0, SCREENWIDTH, SCREENHEIGHT);
 -
      if (palette_to_set)
      {
 -        SDL_SetColors(screenbuffer, palette, 0, 256);
 +        SDL_SetPaletteColors(screenbuffer->format->palette, palette, 0, 256);
          palette_to_set = false;
 +    }

 -        // In native 8-bit mode, if we have a palette to set, the act
 -        // of setting the palette updates the screen
 +    // Blit from the paletted 8-bit screen buffer to the intermediate
 +    // 32-bit RGBA buffer that we can load into the texture.

 -        if (screenbuffer == screen)
 -        {
 -            return;
 -        }
 -    }
 +    SDL_LowerBlit(screenbuffer, &blit_rect, rgbabuffer, &blit_rect);

 -    // In 8in32 mode, we must blit from the fake 8-bit screen buffer
 -    // to the real screen before doing a screen flip.
 +    // Update the intermediate texture with the contents of the RGBA buffer.

 -    if (screenbuffer != screen)
 -    {
 -        SDL_Rect dst_rect;
 +    SDL_UpdateTexture(texture, NULL, rgbabuffer->pixels, rgbabuffer->pitch);

 -        // Center the buffer within the full screen space.
 +    // Make sure the pillarboxes are kept clear each frame.

 -        dst_rect.x = (screen->w - screenbuffer->w) / 2;
 -        dst_rect.y = (screen->h - screenbuffer->h) / 2;
 +    SDL_RenderClear(renderer);

 -        SDL_BlitSurface(screenbuffer, NULL, screen, &dst_rect);
 -    }
 +    // Render this intermediate texture into the upscaled texture
 +    // using "nearest" integer scaling.
 +
 +    SDL_SetRenderTarget(renderer, texture_upscaled);
 +    SDL_RenderCopy(renderer, texture, NULL, NULL);
 +
 +    // Finally, render this upscaled texture to screen using linear scaling.

 -    SDL_Flip(screen);
 +    SDL_SetRenderTarget(renderer, NULL);
 +    SDL_RenderCopy(renderer, texture_upscaled, NULL, NULL);
 +
 +    // Draw!
 +
 +    SDL_RenderPresent(renderer);
+
+     // Restore background and undo the disk indicator, if it was drawn.
+     V_RestoreDiskBackground();
  }


diff --cc src/setup/display.c
index e2ae2f76,a4278efd..1f34f1fd
--- a/src/setup/display.c
+++ b/src/setup/display.c
@@@ -238,13 -560,7 +238,6 @@@ static void AdvancedDisplayConfig(TXT_U
                                        &show_endoom));
      }

-     if (gamemission == doom || gamemission == strife)
-     {
-         TXT_AddWidget(window,
-                       TXT_NewCheckBox("Show disk activity indicator",
-                                       &show_diskicon));
-     }
-
 -#ifdef HAVE_LIBPNG
      TXT_AddWidget(window,
                    TXT_NewCheckBox("Save screenshots in PNG format",
                                    &png_screenshots));