English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 14 February 2018, 20:16   #2141
PeterK
Registered User
 
Join Date: Apr 2005
Location: Hangover
Posts: 1,812
You probably have to call IconControlA() with ICONCTRLA_GetImage2 just to generate the delayed image2 and the mask2, except for WB 3.0/3.1 where Blt(Mask)BitMapRastPort() is patched by icon.library to generate the true image just in time.

(On WB 3.5+ this is done automatically by a call to DrawIconState(). Or you could use my command NoDelayedImage2, but that would be a decision of the user, I think.)


@Akira
All clear signal:
Don't worry about the delayed image2 or mask2. The delay is only activated for the Workbench task, not for other programs.

My assembler code for converting an image structure in A0 into a 40 byte bitmap in A1, but this code may only work for color icons, because they always use real planes. For old-style images you also have to take PlanePick and PlaneOnOff into acount.
Code:
preparebitmap       ADDQ.W         #4,A0                    ; image width etc
                    MOVEM.W        (A0)+,D0-D1              ; width, height
                    ADDQ.L         #8,D0
                    ADDQ.L         #7,D0
                    LSR.L          #4,D0
                    ADD.L          D0,D0                    ; plane bytes/row
                    MOVE.W         D0,(A1)+                 ; bytes/row
                    MOVE.W         D1,(A1)+                 ; row count
                    MULU.W         D0,D1                    ; total plane size
                    MOVE.W         (A0)+,D0                 ; depth
                    MOVEA.L        (A0),A0                  ; planar image data
                    CMPI.W         #8,D0
                    BLS.S          .depthok
                    MOVEQ          #8,D0                    ; limit to 8 planes
.depthok            MOVE.W         D0,(A1)+                 ; flags, depth
                    CLR.W          (A1)                     ; clear pad word !!
                    ADDA.W         #30,A1
                    CLR.L          (A1)                     ; plane 7
                    CLR.L          -(A1)                    ; plane 6
                    CLR.L          -(A1)                    ; plane 5
                    CLR.L          -(A1)                    ; plane 4
                    CLR.L          -(A1)                    ; plane 3
                    CLR.L          -(A1)                    ; plane 2
                    CLR.L          -(A1)                    ; plane 1
                    CLR.L          -(A1)                    ; plane 0
                    BRA.S          .countdowndepth

.nextpointer        MOVE.L         A0,(A1)+                 ; image data offsets
                    ADDA.L         D1,A0                    ; add planesize
.countdowndepth     DBRA           D0,.nextpointer
                    RTS

Last edited by PeterK; 15 February 2018 at 01:21.
PeterK is offline  
AdSense AdSense  
Old Today, 01:58   #2142
kolla
Registered User
kolla's Avatar
 
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 818
Looks to me that the new RAM: icon feature only works when RAM: is labeled "Ram Disk", I tend to name my RAM: something more Norwegian, so I am back to soft link
kolla is offline  
Old Today, 02:23   #2143
PeterK
Registered User
 
Join Date: Apr 2005
Location: Hangover
Posts: 1,812
Yes, I should have mentioned this in my readme:
Quote:
There are some restrictions for the supported volume names for the device RAM:

1.) the name may have up to 10 characters including the ":", plus the Null terminator of the string.
2.) it could be "ram:", upper or lower case are allowed.
3.) it could be "ram "...... like "Ram Disk:", upper or lower case allowed.
4.) it could be "RamD"...... like "RamDisk:" or "RamDrive:", first 4 chars must match exactly.

So, names like "Rambo:", "Ramses:" or "Ramazzotti:" are not supported because that could also be possible volume names of a floppy disk, CD or HDD. The name length is limited because I don't want to get in conflict with other disk icons in RAM:Env/Sys.
It's impossible to suppport localized names for the volume "Ram Disk:". (Btw, what is the Norwegian name?)
PeterK is offline  
Old Today, 03:31   #2144
kolla
Registered User
kolla's Avatar
 
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 818
I use a variety of names, in Norwegian typically "Minne", but even with English I tend to call it "Memory" rather than the long (and somewhat cumbersome) "Ram Disk". To be honest, I took it for granted that label was irrelevant, and the only thing mattering was device name RAM, and was a little baffled when I found out (SnoopDOS) that the label made a difference when trying to save position.
kolla is offline  
Old Today, 03:37   #2145
PeterK
Registered User
 
Join Date: Apr 2005
Location: Hangover
Posts: 1,812
The problem is that it's not so easy to get the device name of a volume name. Or can you tell me how? Functions like NameFromLock() always return the volume name. "Memory:" could also be the label of a floppy disk and your floppy should not get a Ram Disk icon.

I really don't want to do something like this:
http://www.amiga.org/forums/showthread.php?p=835753

Last edited by PeterK; Today at 04:30.
PeterK is offline  
Old Today, 04:51   #2146
kolla
Registered User
kolla's Avatar
 
Join Date: Nov 2007
Location: Trondheim, Norway
Posts: 818
Yeah... well, I only have superficial knowledge about how things are meant to work, but I don't quite understand why labels are used at all in this context. Def_icons, from what I understand, should only relate to device drives, and not volume labels. RAM: can have tons of labels, but it will always be RAM:. Even if I relabel the RAM: drive during startup-sequence, ENV:Sys/def_RAM.info is still used, so _something_ knows that it still is RAM:

Btw, at some point I asked ThoR if he could implement handling of RAM:'s Disk.info in ram-handler (where I think it belongs), but he declined.
kolla is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
ClassicWB Full and icon.library 46.4 Retroplay project.ClassicWB 6 03 December 2012 13:47
WB library conflict/versions Akira support.Apps 3 22 July 2010 19:47
PNG Icon to Color Icon Converter? Leandro Jardim request.Apps 1 24 May 2010 05:39
What's the latest version of icon.library for OS3.9? NovaCoder support.Apps 3 30 June 2009 16:43
Requesting icon.library v44+... nikvest request.Other 2 16 September 2007 02:58

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 09:32.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Page generated in 0.27832 seconds with 14 queries