Menu

#4450 WINCE: Screen alignment in x2 scalers

closed-fixed
Graphics (902)
5
2009-07-26
2009-07-22
No

Using x2 scalers in the PocketPC/WinCE ports leads to alignment problems in WVGA devices.

When starting scummVM in landscape mode there will be a 'click-point/mouse cursor' off-set or misalignment of about a fifth of the width of the screen. I.e. when clicking on the screen the mouse cursor will place itself 1-1,5cm to the left of the clicking point.

The game screen (program area) itself is not centered in the screen, but is always aligned with the left side of the screen. Also when rotating the landscape mode 180 degrees.

This situation has been reproduced by Robin Watts under a VS2005 CE 5 pocket pc emulator set to a screen size of 480x800.

In Lostech's 0.14 build (http://www.embeddev.se/ScummVM_ARM_STATIC_2009_02_23.ZIP), this problem disappears when rotating the screen 180 degrees. I.e. the mouse cursor places itself exactly under the point clicked on the screen.
The screen is not centered but aligned with the left edge of the screen in this orientation as well

In a later build (Robin Watts' from 2009.07.21) the 180 degrees rotation is no longer possible. When trying to rotate 180 degrees the game area(program area) reverts to original size in the upper left corner of the screen in portrait mode.

Attached you will find screendumps that shows images from the latter build mentioned above, as well as the .ini file.

The game was started in debug mode, but no stderr and stdout was produced.

Discussion

  • Thomas Risan

    Thomas Risan - 2009-07-22

    .ini file

     
  • Thomas Risan

    Thomas Risan - 2009-07-22

    startup screen

     
  • Thomas Risan

    Thomas Risan - 2009-07-22

    x2 scaler chosen and game started

     
  • Thomas Risan

    Thomas Risan - 2009-07-22

    Using rotate monkey - reverting to upper left corner

     
  • Thomas Risan

    Thomas Risan - 2009-07-22

    The rotate monkey does not rotate anything but itself

     
  • Thomas Risan

    Thomas Risan - 2009-07-22

    Startupscreen after .ini file was generated

     
  • Thomas Risan

    Thomas Risan - 2009-07-22

    The attached images illustrates the problems with the x2 scaler and alignment.
    It's hard to illustrate the 'click-point/mouse cursor' issue, but it is very much present!

     
  • Robin Watts

    Robin Watts - 2009-07-23

    I have a fix for the offsetting problem.

    In SDL-1.2.6/src/video/wingapi/SDL_gapivideo.c
    in function GAPI_SetVideoMode
    at around line 706, there is code:

    if (rotation == SDL_ROTATE_NONE) {
    if (getScreenWidth(this) > width)
    padWidth = (getScreenWidth(this) - width) / 2;
    if (getScreenHeight(this) > height)
    padHeight = (getScreenHeight(this) - height) / 2;
    }
    else {
    if (getScreenWidth(this) > height)
    padWidth = (getScreenHeight(this) - width) / 2;
    if (getScreenHeight(this) > width)
    padHeight = (getScreenWidth(this) - height) / 2;
    }

    change this to:

    if (rotation == SDL_ROTATE_NONE) {
    if (getScreenWidth(this) > width)
    padWidth = (getScreenWidth(this) - width) / 2;
    if (getScreenHeight(this) > height)
    padHeight = (getScreenHeight(this) - height) / 2;
    }
    else {
    if (getScreenWidth(this) > height)
    padHeight = (getScreenWidth(this) - height) / 2;
    if (getScreenHeight(this) > width)
    padWidth = (getScreenHeight(this) - width) / 2;
    }

    and the offsetting is cured. This isn't in ScummVM's code itself, so I can't commit it as a fix. We should update the published diffs with this though.

     
  • Thomas Risan

    Thomas Risan - 2009-07-24

    Lostech's 0.14 stderr

     
  • Thomas Risan

    Thomas Risan - 2009-07-24

    stderr from Robin_Watts' latest build (w/fix)

     
  • Kostas Nakos

    Kostas Nakos - 2009-07-26
    • assigned_to: nobody --> knakos
    • summary: PocketPC/WINCE: Screen alignment in x2 scalers --> WINCE: Screen alignment in x2 scalers
     
  • Kostas Nakos

    Kostas Nakos - 2009-07-26
    • status: open --> closed-fixed
     
  • Kostas Nakos

    Kostas Nakos - 2009-07-26

    OK, committed to SDL branch with thanks to Robin. Fingers crossed there will be no adverse effects (the patch seems logical and tests are good). Updated SDL patches will be provided along with 1.0.0.

    BTW, there are no problems with the mouse I gather after this patch?

     
MongoDB Logo MongoDB