Opened 15 years ago

Closed 15 years ago

Last modified 5 years ago

#4450 closed defect (fixed)

WINCE: Screen alignment in x2 scalers

Reported by: SF/pncfreak Owned by: SF/knakos
Priority: normal Component: Port: WinCE
Version: Keywords:
Cc: Game:

Description

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.

Ticket imported from: #2825418. Ticket imported from: bugs/4450.

Attachments (8)

scummvm.ini (2.5 KB ) - added by SF/pncfreak 15 years ago.
.ini file
1startupscreen.jpg (9.2 KB ) - added by SF/pncfreak 15 years ago.
startup screen
2IndyFoA.jpg (18.6 KB ) - added by SF/pncfreak 15 years ago.
x2 scaler chosen and game started
3UsingRotateMonkey.jpg (7.8 KB ) - added by SF/pncfreak 15 years ago.
Using rotate monkey - reverting to upper left corner
4UsingRotateMonkeyNoReaction.jpg (7.8 KB ) - added by SF/pncfreak 15 years ago.
The rotate monkey does not rotate anything but itself
5SecondStartupScreenAfterIniWasGenerated.jpg (17.3 KB ) - added by SF/pncfreak 15 years ago.
Startupscreen after .ini file was generated
scummvm_stderr.txt (525 bytes ) - added by SF/pncfreak 15 years ago.
Lostech's 0.14 stderr
scummvm_stderr.2.txt (1.7 KB ) - added by SF/pncfreak 15 years ago.
stderr from Robin_Watts' latest build (w/fix)

Download all attachments as: .zip

Change History (14)

by SF/pncfreak, 15 years ago

Attachment: scummvm.ini added

.ini file

by SF/pncfreak, 15 years ago

Attachment: 1startupscreen.jpg added

startup screen

by SF/pncfreak, 15 years ago

Attachment: 2IndyFoA.jpg added

x2 scaler chosen and game started

by SF/pncfreak, 15 years ago

Attachment: 3UsingRotateMonkey.jpg added

Using rotate monkey - reverting to upper left corner

by SF/pncfreak, 15 years ago

The rotate monkey does not rotate anything but itself

by SF/pncfreak, 15 years ago

Startupscreen after .ini file was generated

comment:1 by SF/pncfreak, 15 years ago

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!

comment:2 by SF/robinwatts, 15 years ago

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.

by SF/pncfreak, 15 years ago

Attachment: scummvm_stderr.txt added

Lostech's 0.14 stderr

by SF/pncfreak, 15 years ago

Attachment: scummvm_stderr.2.txt added

stderr from Robin_Watts' latest build (w/fix)

comment:3 by SF/knakos, 15 years ago

Owner: set to SF/knakos
Summary: PocketPC/WINCE: Screen alignment in x2 scalersWINCE: Screen alignment in x2 scalers

comment:4 by SF/knakos, 15 years ago

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?

comment:5 by SF/knakos, 15 years ago

Resolution: fixed
Status: newclosed

comment:6 by digitall, 5 years ago

Component: Port: WinCE
Note: See TracTickets for help on using tickets.