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