15 November 2013, 11:50 | #1 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,349
|
Off-by-one error with RTG image scaling?
[This could possibly be a bug in Wine, I guess.]
I noticed an off-by-one error when the RTG image is scaled ("Always scale in windowed mode" checked). I changed screenmode to P96 640×480. Opening the settings window and changing window size to 1280×960 causes one pixel row to be missing (so the scaled RTG display occupies 1280×959 pixels). If I change window size to 1280×961 the entire RTG display is shown correctly. It turns out that on setting window size to 1280×962, 1280×964, 1280×966 etc. (all of which should give the same perfect 2× scaling since window width is unchanged), there is the same one pixel row missing. With window sizes 1280×963, 1280×965, 1280×967 etc. the image appears correctly. |
15 November 2013, 16:20 | #2 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,570
|
I can't duplicate. 961 adds extra black line at the bottom. 960 looks fine.
|
16 November 2013, 09:45 | #3 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,349
|
Hmm this is strange. Maybe the specific issue I noticed was a Wine bug.
However I just tested in Windows Vista SP2 with Classic theme. There seems to be an off-by-one problem relating to the RTG window width, but only in DirectDraw mode. (My laptop has an Nvidia graphics chip by the way.) |
17 November 2013, 16:20 | #4 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,570
|
Did the height problem happen in both DD and D3D?
|
17 November 2013, 16:32 | #5 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,349
|
If I remember correctly, in Wine I only saw the problem in D3D mode. But that's because — at least with the very recent version of Wine I tested with — the DirectDraw display seems to be rendered with bilinear filtering. So a missing or extra row wouldn't be as noticeable.
|
19 November 2013, 21:37 | #6 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,349
|
After playing with the settings some more I noticed the off-by-one problem with image width in Vista with both D3D and DirectDraw, with native chipset modes. This is with null filter, automatic resize 2×.
In the attached pics I've pointed to the missing/extra pixel column. The exact position of the column might vary depending on Windows version, graphics driver etc. Also with DirectDraw there are refresh problems when you open the settings window. The image is scaled 2×. On opening the settings window, if you drag it around, the newly-exposed parts of the main window are drawn with an unscaled image, see pics. If you click on the desktop (so making the WinUAE window inactive) the entire main window is redrawn with unscaled image. On dismissing the settings window, the display is shown scaled again. (Pics were taken with WinUAE 2.7.0b13.) |
27 November 2013, 17:59 | #7 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,349
|
A guess as to what the problem might be, if it's something to do with texture sizes. Converting float to int always rounds towards zero. If you actually want to round to the nearest integer instead, you could/should add 0.5 to the value.
|
27 November 2013, 18:08 | #8 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,570
|
Can't duplicate. Requires at least config file and WB config that has exact same screen mode/overscan/etc prefs.
(coordinates have +0.5 added or it wouldn't work at all, there would be really ugly line from top/left to bottom/right and also it wouldn't affect DD at all) |
27 November 2013, 19:32 | #9 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,349
|
Here's a config I used in Windows Vista. Boot an unmodified Workbench 3.1 disk. Run WBPattern prefs and set the crosshatch background, then set Workbench window to backdrop. (Could switching back and forth between the D3D and DirectDraw screenshots give any clues?)
|
30 November 2013, 13:35 | #10 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,570
|
Confirmed but it makes no sense in DD mode. More debugging after 2.7.0.
|
01 December 2013, 19:18 | #11 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,349
|
Just as another point of information, I tested using a Windows 7 SP1 VM using VirtualBox. There was no problem with the DirectDraw image. I couldn't test D3D in VirtualBox.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pre-Scaling before Bilinear Scaling? | rsn8887 | request.UAE Wishlist | 6 | 05 September 2015 19:13 |
Off-by-one problem with 2x scaling | mark_k | support.WinUAE | 0 | 05 February 2013 22:41 |
Scaling in RTG modes | mark_k | support.WinUAE | 4 | 08 March 2012 15:57 |
Invalid Kickstart Image WHDLOAD error | TronPlayer | support.Games | 5 | 16 November 2010 20:59 |
Heimdall 2 AGA - error during resload_loadkick Invalid kickstart image | DanE | support.Games | 0 | 26 September 2006 15:08 |
|
|