test/Makefile.wat
author Patrice Mandin <patmandin@gmail.com>
Thu, 19 Jan 2006 21:28:52 +0000
changeset 1257 448a9a64537b
parent 1190 173c063d4f55
permissions -rw-r--r--
[PATCH] SDL_GetVideoMode() does not find best mode, part 2

Following commit 1.51, I come accross a problem when SDL must choose between
several video modes that could suit the one asked.

If I ask 320x240 with this list:
768x480 768x240 640x400 640x200 384x480 384x240 320x400 320x200

The smallest selectables modes are 384x240 and 320x400. And SDL choose the later
in this list, but 384x240 is more suitable. So I added a check to compare
the pixel count (surface) of modes, and select the one which has the smallest
pixel count.

In my example, 384x240 has 92160 pixels, and 320x400 has 128000 pixels. So now
SDL will choose 384x240 for the asked 320x240 mode.
     1 #=============================================================================
     2 #          This is a Watcom makefile to build SDL.DLL for OS/2
     3 #
     4 # Makefile for test applications
     5 #=============================================================================
     6 
     7 # Create debug build or not?
     8 debug_build=defined
     9 
    10 #-----------------------------------------------------------------------------
    11 # The next part is somewhat general, for creation of EXE files.
    12 #-----------------------------------------------------------------------------
    13 
    14 cflags = $(debugflags) -bm -bt=OS2 -5 -fpi -sg -otexan -wx -ei
    15 
    16 .before
    17     set include=$(%os2tk)\h;$(%include);../include
    18 
    19 .extensions:
    20 .extensions: .exe .obj .c
    21 
    22 all :   testalpha.exe     &
    23         testbitmap.exe    &
    24         testcdrom.exe     &
    25         testcpuinfo.exe   &
    26         testjoystick.exe  &
    27         testkeys.exe      &
    28         testlock.exe      &
    29         testsem.exe       &
    30         testsprite.exe    &
    31         testtimer.exe     &
    32         testtypes.exe     &
    33         testver.exe       &
    34         testvidinfo.exe   &
    35         testwin.exe       &
    36         testwm.exe        &
    37         threadwin.exe     &
    38         torturethread.exe &
    39         checkkeys.exe
    40 
    41 .c.obj : .AUTODEPEND
    42     wcc386 -zq -bm -5s -ei -oteaxan -wx $[* $(cflags)
    43 
    44 .obj.exe : .AUTODEPEND
    45     wlink system os2v2 F $* L ..\src\sdl.lib name $@ op quiet
    46 
    47 clean : .SYMBOLIC
    48         @if exist *.exe del *.exe
    49         @if exist *.obj del *.obj
    50         @if exist *.map del *.map
    51         @if exist *.res del *.res
    52         @if exist *.lst del *.lst