English Amiga Board

Go Back   English Amiga Board > Coders > Coders. System

Thread Tools
Old 14 February 2018, 20:16   #2141
Registered User
Join Date: Apr 2005
Location: Hangover
Posts: 1,809
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.)

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.
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

Last edited by PeterK; 15 February 2018 at 01:21.
PeterK is offline  
AdSense AdSense  
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 15:51.

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