30 November 2021, 16:01 | #1 |
Registered User
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
|
DataTypes - "remapping" - sometimes not working
Hi,
I've been playing with Blitz, and wanted to have a picture in the window on my own screen. So I used datatypes and all is fine as long as I keep PTDA_Remap=False. I don't know if there is a bug in the system DataTypes or my way of doing this is wrong. And here is my way: - there is a WB screen (32 colors) - there is my screen (workbench like) - there is a backdrop|borderless window on my screen (covering whole) - I load the picture (PDTA_Remap=True, PDTA_Screen points to WB screen) - I use SetRGB24() to copy from PDTA_GRegs to my screen - and finally BlitBitMapRastPort (from PTDA_DestBitMap to my window\RPort) - the result is .. horrible - to fix it I need to copy all the colors from WB screen to my screen - but as per manual PDTA_GRegs should already have correct palette.. I won't post anything in Blitz here but there is a link with short C listing. https://github.com/asman2000/dtwb/blob/main/src/gfx.c. What am I doing wrong (in my approach)? Thanks. |
30 November 2021, 16:17 | #2 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
Try calling RethinkDisplay() to update the copper list to show the updated pallette? Just guessing.
|
30 November 2021, 16:21 | #3 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
You should either remap the picture to your screen or change the colors of the screen to those of the picture, but not both.
PDTA_Screen has to point to the destination screen (your screen, not the Workbench screen). And you have to call PDTA_PROCLAYOUT to do the actual remapping before you can get PTDA_DestBitMap and do BlitBitMapRastPort. |
30 November 2021, 16:37 | #4 | ||
Registered User
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
|
@Samurai_Crow
doesn't help... @thomas Quote:
I was sure that putting WB screen into PDTA_Screen will remap as per WB colors and then I would take these colors onto my screen and have picture displayed correctly (because I copied the colors from the screen that was pointed in PDTA_Screen into my screen) Quote:
|
||
30 November 2021, 16:46 | #5 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
You didn't mention it. I was not looking at the code, only at your list.
Attached is an example in C written after your description. |
30 November 2021, 17:04 | #6 |
Registered User
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
|
Thanks.
So there are 2 solution to have a picture on my screen and with colors that fit WB: - set PDTA_Screen to WB, remap, copy the wb colors over to my screen - copy from WB to my screen following colors: 0,1,2,3,17,18,19, set PDTA_Screen to my screen and do remapping |
30 November 2021, 17:28 | #7 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
You should not tie your program to the Workbench screen if you open your own screen. Datatypes.library allocates shared pens on the screen pointed to by PDTA_Screen. For this to work you at least have to assure that the screen does not go away while your DT object is connected to the screen, so you have to LockPubScreen(NULL).
If you open your own screen anyway, which covers the whole display and hides the Workbench screen, you should allow the WB screen to close and not stick it to your program. And no, it's probably more complicated than to copy fixed pens. The user can select different pens for different purposes in the Palette prefs. You should rather either copy all WB screen properties which can easily be done using SA_LikeWorkbench, or you should make your own properties for your screen independent from the WB screen. |
30 November 2021, 18:59 | #8 |
Registered User
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
|
I agree with all what you wrote here but anyway I need to think about it a little bit more
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Diabolik" & "Dylan Dog" & "Tex" & "Time Runners" series | DamienD | request.Old Rare Games | 20 | 21 July 2022 16:58 |
"Voices8" 8 Channel Soundtracker "DemoSongI" song - "This is the Amiga with 8 Voices" | DemosongIHunter | request.Music | 45 | 23 May 2022 20:07 |
"Screech!! v2.41" & "Screech!! [AGA] v2.51" - "HD install" --> "ADFs" | DamienD | request.Old Rare Games | 45 | 15 June 2020 12:42 |
Joystick working with "Launcher" but not with "Arcade" | FredB | support.FS-UAE | 1 | 12 October 2014 23:38 |
"Reminder "Lincs Amiga User Group aka "LAG" Meet Sat 5th of January 2013" | rockape | News | 4 | 30 January 2013 00:06 |
|
|