@@ -893,59 +893,6 @@ static void I_FillScreenResolutionsList(void)
893
893
}
894
894
}
895
895
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
-
949
896
// e6y
950
897
// It is a simple test of CPU cache misses.
951
898
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)
984
931
// Calculates the screen resolution, possibly using the supplied guide
985
932
void I_CalculateRes (int width , int height )
986
933
{
987
- if (desired_fullscreen && exclusive_fullscreen )
988
- {
989
- I_ClosestResolution (& width , & height );
990
- }
934
+ SCREENWIDTH = width ;
935
+ SCREENHEIGHT = height ;
991
936
992
- if (V_IsOpenGLMode ()) {
993
- SCREENWIDTH = width ;
994
- SCREENHEIGHT = height ;
937
+ if (V_IsOpenGLMode ())
938
+ {
995
939
SCREENPITCH = SCREENWIDTH ;
996
- } else {
940
+ }
941
+ else
942
+ {
997
943
unsigned int count1 , count2 ;
998
944
int pitch1 , pitch2 ;
999
945
1000
- SCREENWIDTH = width ;//(width+15) & ~15;
1001
- SCREENHEIGHT = height ;
1002
-
1003
946
// e6y
1004
947
// Trying to optimise screen pitch for reducing of CPU cache misses.
1005
948
// It is extremally important for wiping in software.
0 commit comments