English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 30 November 2021, 16:01   #1
peceha
Registered User
 
peceha's Avatar
 
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.
peceha is offline  
Old 30 November 2021, 16:17   #2
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
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.
Samurai_Crow is offline  
Old 30 November 2021, 16:21   #3
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
Quote:
Originally Posted by peceha View Post
- I use SetRGB24() to copy from PDTA_GRegs to my screen
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.
thomas is offline  
Old 30 November 2021, 16:37   #4
peceha
Registered User
 
peceha's Avatar
 
Join Date: Dec 2017
Location: Poland
Age: 47
Posts: 282
@Samurai_Crow
doesn't help...

@thomas


Quote:
PDTA_Screen has to point to the destination screen (your screen, not the Workbench screen).
You should either remap the picture to your screen or change the colors of the screen to those of the picture, but not both.
So this is my mistake...
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:
And you have to call PDTA_PROCLAYOUT to do the actual remapping before you can get PTDA_DestBitMap and do BlitBitMapRastPort.
I really do, the listing in the link was not written by me (no C here.. ) and I don't quite understand what I'm seeing there - actually I do but I need time to go through it.
peceha is offline  
Old 30 November 2021, 16:46   #5
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 6,985
Quote:
Originally Posted by peceha View Post
I really do
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.
Attached Files
File Type: lha dtscr.lha (3.3 KB, 75 views)
thomas is offline  
Old 30 November 2021, 17:04   #6
peceha
Registered User
 
peceha's Avatar
 
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
peceha is offline  
Old 30 November 2021, 17:28   #7
thomas
Registered User
 
thomas's Avatar
 
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.
thomas is offline  
Old 30 November 2021, 18:59   #8
peceha
Registered User
 
peceha's Avatar
 
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
peceha is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 23:07.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09023 seconds with 16 queries