We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 831 - post fix for GAPI hires
Summary: post fix for GAPI hires
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: x86 Linux
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-08 03:40 UTC by Andrey
Modified: 2009-10-09 19:04 UTC (History)
0 users

See Also:


Attachments
gapi_hires_fix (1.87 KB, patch)
2009-10-08 03:40 UTC, Andrey
Details | Diff
gapi_hires_fix (5.19 KB, patch)
2009-10-09 08:08 UTC, Andrey
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey 2009-10-08 03:40:02 UTC
Created attachment 402 [details]
gapi_hires_fix

I think that gapi->hiresFix need to set true not only for a fixed screen
resolution, but also within range: from 320 to 640 or from 240 to 480 or from
400 to 800.
Comment 1 Andrey 2009-10-08 17:15:00 UTC
Hi developers!
Yesterday I tested the Samsung SGH-i780 (display 320x320, 96dpi and 128dpi):

system display width (orig): 240
system display height (orig): 240
Video properties:
display bpp: 16
display width: 320
display height: 320
system display width: 240
system display height: 240
x pitch: 2
y pitch: 640
gapi flags: 0x80
user orientation: 0
system orientation: 0
gapi orientation: 0
video memory: 0x4cf00000
need update: 1
hi-res fix: 1
VGA is available on the device: 1
use raw framebuffer: 0
video surface bpp: 16
video surface width: 320
video surface height: 320
mouse/arrows transformation angle: 0

He ratio scale is equal to 240 / 320 = 1.33333
So the code is incorrect for hiresFix mode:

SDL_dibevents.c:
static void GapiTransform(GapiInfo *gapiInfo, LONG *x, LONG *y) {
    Sint16 rotatedX;
    Sint16 rotatedY;

    if(gapiInfo->hiresFix)
    {
        *x *= 2;     <- can be use gapiInfo->scale ?
        *y *= 2;
    }
Comment 2 Andrey 2009-10-09 08:08:04 UTC
Created attachment 404 [details]
gapi_hires_fix

I made a mistake with the conclusions.
And last time I as was mistaken with conclusions.
Now I thought about in more detail the algorithm works.
I have made it that the project fheroes2 well worked.
The result of my work in attachment.
I have a possibility to check up it on different models pocketpc.
I checked various modes screen of 320x320, 320x240, 640x480, 800x400.
Comment 3 Sam Lantinga 2009-10-09 19:04:15 UTC
Your fix is in for the next release.  Thanks!