Skip to content

Commit 0a5e76b

Browse files
authored
Dont force closest res in exclusive fullscreen (#708)
1 parent 34d4f1e commit 0a5e76b

File tree

1 file changed

+7
-64
lines changed

1 file changed

+7
-64
lines changed

prboom2/src/SDL/i_video.c

Lines changed: 7 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -893,59 +893,6 @@ static void I_FillScreenResolutionsList(void)
893893
}
894894
}
895895

896-
// e6y
897-
// Function for trying to set the closest supported resolution if the requested mode can't be set correctly.
898-
// For example dsda-doom.exe -geom 1025x768 -nowindow will set 1024x768.
899-
// It should be used only for fullscreen modes.
900-
static void I_ClosestResolution (int *width, int *height)
901-
{
902-
int display_index = 0;
903-
int twidth, theight;
904-
int cwidth = 0, cheight = 0;
905-
int i, count;
906-
unsigned int closest = UINT_MAX;
907-
unsigned int dist;
908-
909-
if (!SDL_WasInit(SDL_INIT_VIDEO))
910-
return;
911-
912-
count = SDL_GetNumDisplayModes(display_index);
913-
914-
if (count > 0)
915-
{
916-
for(i=0; i<count; ++i)
917-
{
918-
SDL_DisplayMode mode;
919-
SDL_GetDisplayMode(display_index, i, &mode);
920-
921-
twidth = mode.w;
922-
theight = mode.h;
923-
924-
if (twidth == *width && theight == *height)
925-
return;
926-
927-
//if (iteration == 0 && (twidth < *width || theight < *height))
928-
// continue;
929-
930-
dist = (twidth - *width) * (twidth - *width) +
931-
(theight - *height) * (theight - *height);
932-
933-
if (dist < closest)
934-
{
935-
closest = dist;
936-
cwidth = twidth;
937-
cheight = theight;
938-
}
939-
}
940-
if (closest != 4294967295u)
941-
{
942-
*width = cwidth;
943-
*height = cheight;
944-
return;
945-
}
946-
}
947-
}
948-
949896
// e6y
950897
// It is a simple test of CPU cache misses.
951898
unsigned int I_TestCPUCacheMisses(int width, int height, unsigned int mintime)
@@ -984,22 +931,18 @@ unsigned int I_TestCPUCacheMisses(int width, int height, unsigned int mintime)
984931
// Calculates the screen resolution, possibly using the supplied guide
985932
void I_CalculateRes(int width, int height)
986933
{
987-
if (desired_fullscreen && exclusive_fullscreen)
988-
{
989-
I_ClosestResolution(&width, &height);
990-
}
934+
SCREENWIDTH = width;
935+
SCREENHEIGHT = height;
991936

992-
if (V_IsOpenGLMode()) {
993-
SCREENWIDTH = width;
994-
SCREENHEIGHT = height;
937+
if (V_IsOpenGLMode())
938+
{
995939
SCREENPITCH = SCREENWIDTH;
996-
} else {
940+
}
941+
else
942+
{
997943
unsigned int count1, count2;
998944
int pitch1, pitch2;
999945

1000-
SCREENWIDTH = width;//(width+15) & ~15;
1001-
SCREENHEIGHT = height;
1002-
1003946
// e6y
1004947
// Trying to optimise screen pitch for reducing of CPU cache misses.
1005948
// It is extremally important for wiping in software.

0 commit comments

Comments
 (0)