![]() |
ENGLISH VERSION |
|
![]() |
Links | | | Forum | | | Kommentare | | | News melden |
![]() |
Chat | | | Umfragen | | | Newsticker | | | Archiv |
![]() |
amiga-news.de Forum > Programmierung > GA_BackFill | [ - Suche - Neue Beiträge - Registrieren - Login - ] |
1 -2- | [ - Beitrag schreiben - ] |
03.08.2009, 20:29 Uhr AGSzabo Posts: 1663 Nutzer |
OK, ich habe das problem der farbtiefe gelöst!code:move.l xuiTb_rastport(a3),a0 move.l rp_BitMap(a0),a0 moveq #BMA_DEPTH,d1 jsr _LVOGetBitMapAttr(a6) move.l d0,d2 cmp.l #8,d2 bgt.b .24 move.l #BMF_MINPLANES,d3 bra.b .size .24 move.l #BMF_MINPLANES|BMF_SPECIALFMT|PIXFMT_RGB24,d3 .size move.w xuiTb_width(a3),d0 move.w xuiTb_griffheight(a3),d1 sub.l a0,a0 ; no friend, later: set rp-bm as friend jsr _LVOAllocBitMap(a6) move.l d0,xuiTb_offbitmap(a3) ; set new offbitmap with actual dimens alte nachricht: @thomas: hi, ok, ich habe das SDK, kann ab er da kein cybergrafix finden. weil beim laden mit dem datatype ja auch ein 24-bit bild raus kommt, das mit den normalen gfxlibfunktionen gehandelt wird, müsste es auch ohne cybergraphics gehen. es seidenn da wird gepatcht.... ps: ich habe da was gefunden: http://aminet.net/package/dev/misc/CGraphX-DevKit -- Sam os4.1, e-uae 39bb2 - A4000d 39bb2 - Cyberst.MK3 060 50mhz 128mb - Cybervis. - Ariadne_II - ide DVD und 320gb HD (nur 128gb) - HD Floppy -- A500 3.1 adide 50mb -- Duron 1600mhz Ubuntu Linux / WinXP -- BenQ FP93G TFT - 1048 like CRT - HP psc1110 [ Dieser Beitrag wurde von AGSzabo am 04.08.2009 um 11:15 Uhr geändert. ] [ - Antworten - Zitieren - Direktlink - ] |
10.08.2009, 21:22 Uhr Holger Posts: 8116 Nutzer |
Zitat:Nein, moveq initialisiert das Register mit einem vorzeichenbehafteten 32 Bit-Wert, der zwischen -128 und +127 liegt. Oder anders gesagt, die übrigen Bits werden nicht "geleert", sondern auf den Wert des höchstwertigen Bits des angegebenen Bytes gesetzt. Also, moveq #-1,d0 setzt z.B. alle 32 Bits von d0 auf 1. mfg -- Good coders do not comment. What was hard to write should be hard to read too. [ - Antworten - Zitieren - Direktlink - ] |
21.09.2009, 05:18 Uhr AGSzabo Posts: 1663 Nutzer |
lang ists her, jetzt geht diese frage in die zweite runde! ich habe endlich herausgefunden wir man eine füllroutine an das gadget hängt, nämlich einfach den pointer auf die routine in GA_BackFill übergeben. Aber nun die frage, wie übermittle ich private paramter an diese routine (zb die füllfarbe)? Andreas -- Sam mini os4.1 -- e-uae 39bb2 -- A4000D 3.0 - 2mbchip/8mbfast - Ariadne_II - ide DVD und HD -- A500 3.1 (mkick) adide 50mb -- Duron 1600mhz Ubuntu Linux / WinXP -- BenQ FP93G TFT - 1048 like CRT - HP psc1110 [ - Antworten - Zitieren - Direktlink - ] |
21.09.2009, 08:31 Uhr thomas Posts: 7719 Nutzer |
Indem du nochmal genau nachliest, was da übergeben wird. "Einfach den Pointer auf die Routine" ist nicht richtig. Weitere Informationen findest du in den Autodocs von utility.library/CallHookPkt und in der Include-Datei utility/hooks.h (schau dir bitte die hooks.h an, da sind wesentlich mehr Kommentare drin, als in hooks.i). Außerdem gibt es auf der Developer-CD unter Reference/Amiga Mail Vol.2 eine ausführliche Diskussion der Features, die mit Kick 2.0 dazugekommen sind. Unter anderem auch Callback-Hooks (Kapitel I-43). Gruß Thomas -- Email: thomas-rapp@web.de Home: thomas-rapp.homepage.t-online.de/ [ - Antworten - Zitieren - Direktlink - ] |
21.09.2009, 10:18 Uhr AGSzabo Posts: 1663 Nutzer |
@thomas: ich habe das meiste davon schon studiert. > "Einfach den Pointer auf die Routine" ist nicht richtig. es funktioniert aber. da dachte ich, es wäre so gedacht. ich meine woran will layers erkennen dass da eine routine statt einer struktur ist? ich dachte, es könnte nur 1 von beiden richtig sein: routine oder struktur! gruß -- Sam mini os4.1 -- e-uae 39bb2 -- A4000D 3.0 - 2mbchip/8mbfast - Ariadne_II - ide DVD und HD -- A500 3.1 (mkick) adide 50mb -- Duron 1600mhz Ubuntu Linux / WinXP -- BenQ FP93G TFT - 1048 like CRT - HP psc1110 [ - Antworten - Zitieren - Direktlink - ] |
21.09.2009, 10:48 Uhr thomas Posts: 7719 Nutzer |
@AGSzabo:Zitat: Es funktioniert definitiv nicht. Vielleicht sieht deine Routine so aus, daß zufällig an Offset 8 eine gültige Adresse in deinem Programm steht. Zitat: Und warum machst du es dann trotzdem falsch ? Selbst wenn etwas scheinbar funktioniert, heißt das noch lange nicht, daß es richtig ist. Halte dich an die Anleitungen, dann funktioniert es auch in Zukunft und auf allen Platformen. Gruß Thomas -- Email: thomas-rapp@web.de Home: thomas-rapp.homepage.t-online.de/ [ - Antworten - Zitieren - Direktlink - ] |
21.09.2009, 13:43 Uhr AGSzabo Posts: 1663 Nutzer |
@thomas: ok, ich bin jetzt nochmal deine tips durchgegangen und JETZT funktioniert ES, allerdings nur unter os 4! code:WG_fillbghook movem.w d2/d3,-(a7) addq.l #4,a1 movem.w (a1)+,d0-d3 move.l h_Data(a0),a0 move.l xuiWG_drawinfo(a0),a0 move.l xuiDI_imagetable(a0),a0 move.l xuiIT_tabsbgimage(a0),a0 move.l a2,a1 bsr _xuiImageFill movem.w (a7)+,d2/d3 rts Unter os 3.9 ist der hintergrund immer um ungefähr die hälfte des zu füllenden rectangles verschoben. Aber das macht nichts, wenn ich irgendwie abprüfen kann welche version drin ist? ich müsste blos wissen ab welcher version genau das funtioniert und welche library diese version ahben muss. Unter os 3.x brauche ich keinen backfill weil da der hintergrund des colorwheels garnicht beeinflusst wird. Trotzdem sollte es unter os3.x auch funktionieren und ich wüsste gerne warum nicht. -- Sam mini os4.1 -- e-uae 39bb2 -- A4000D 3.0 - 2mbchip/8mbfast - Ariadne_II - ide DVD und HD -- A500 3.1 (mkick) adide 50mb -- Duron 1600mhz Ubuntu Linux / WinXP -- BenQ FP93G TFT - 1048 like CRT - HP psc1110 [ - Antworten - Zitieren - Direktlink - ] |
21.09.2009, 15:05 Uhr thomas Posts: 7719 Nutzer |
@AGSzabo:Zitat: Warum glaubst du immer, daß das Betriebssystem schuld ist, wenn du etwas falsch gemacht hast ? Zitat: Das liegt vermutlich daran: code:move.l a2,a1 Bei den Autodocs von layers.library/InstallLayerHook steht dieser Nachsatz: code:The RastPort you are passed back is the same one passed to the function. You should *not* use "layered" rendering functions on this RastPort. Generally, you will wish to do BitMap operations such as BltBitMap(). The callback is a raw, low-level rendering call-back. If you need to call a rendering operation with a RastPort, make sure you use a copy of the RastPort and NULL the Layer pointer. Das heißt, du darfst den RastPort, den du bekommst, nicht direkt benutzen, sondern du mußt einen eigenen nehmen, in den du rp->BitMap einträgst. Oder du machst eine Kopie des RastPorts und setzt temprp->Layer auf NULL. Jedenfalls darfst du nicht das Original benutzen. Gruß Thomas -- Email: thomas-rapp@web.de Home: thomas-rapp.homepage.t-online.de/ [ - Antworten - Zitieren - Direktlink - ] |
21.09.2009, 16:09 Uhr AGSzabo Posts: 1663 Nutzer |
@thomas: ok, jetzt geht es. mit bitmap statt rp zwar nicht, aber mit kopie des rp schon. EDIT oh, es geht doch nicht, bzw nur manchmal... code:WG_fillbghook move.l a2,-(a7) movem.w d2-d4,-(a7) addq.l #4,a1 movem.w (a1)+,d0-d3 move.l h_Data(a0),a0 move.l xuiWG_drawinfo(a0),a0 move.l xuiDI_imagetable(a0),a0 move.l xuiIT_tabsbgimage(a0),a0 lea -rp_SIZEOF(a7),a7 move.l a7,a1 move.w #rp_SIZEOF/2,d4 subq.w #1,d4 .copy_rp move.w (a2)+,(a1)+ dbf d4,.copy_rp move.l a7,a1 clr.l rp_Layer(a1) bsr _xuiImageFill lea rp_SIZEOF(a7),a7 movem.w (a7)+,d2-d4 move.l (a7)+,a2 rts EDIT ... ehm, stack 8000 sollte reichen? -- Sam mini os4.1 -- e-uae 39bb2 -- A4000D 3.0 - 2mbchip/8mbfast - Ariadne_II - ide DVD und HD -- A500 3.1 (mkick) adide 50mb -- Duron 1600mhz Ubuntu Linux / WinXP -- BenQ FP93G TFT - 1048 like CRT - HP psc1110 [ Dieser Beitrag wurde von AGSzabo am 21.09.2009 um 16:53 Uhr geändert. ] [ Dieser Beitrag wurde von AGSzabo am 21.09.2009 um 16:55 Uhr geändert. ] [ Dieser Beitrag wurde von AGSzabo am 21.09.2009 um 17:02 Uhr geändert. ] [ - Antworten - Zitieren - Direktlink - ] |
21.09.2009, 18:25 Uhr Holger Posts: 8116 Nutzer |
Zitat:Ich seh da irgendwie nicht, dass Du sicherstellst, dass in den höherwertigen bytes kein Unsinn drinsteht... Und gleich noch einen Ratschlag: wenn Du Register sicherst, sichere die ganzen Register, nicht nur die unteren zwei bytes, bloß weil Du meinst, die anderen nicht zu verändern. Die gesparten Nanosekunden (auf den meisten Systemen sparst Du eh nichts) sind die Fehlerquelle nicht wert, insbesondere, wenn man immer sieht, wie ineffizient Dein Code insgesamt ist. Da sparst Du hier definitiv am falschen Ende. mfg -- Good coders do not comment. What was hard to write should be hard to read too. [ - Antworten - Zitieren - Direktlink - ] |
21.09.2009, 19:30 Uhr AGSzabo Posts: 1663 Nutzer |
@Holger: > Ich seh da irgendwie nicht, dass Du sicherstellst, dass in den höherwertigen bytes kein Unsinn drinsteht... nee, das hab ich zigmal abgecheckt und auch ausprobiert es extra zu nullen. geht trotzdem nicht. ganze register retten? ok, so habe ich es früher gemacht. vielleicht war das besser. mal vorsichtig angefragt, darf ich im Hook (in der ImageFill funktion) das "BlitBitMapRastport" benutzen oder nicht? ich finde in den docs keine hinweise ob das nen layer baraucht oder nicht. vielleicht ist das mein fehler? -- Sam mini os4.1 -- e-uae 39bb2 -- A4000D 3.0 - 2mbchip/8mbfast - Ariadne_II - ide DVD und HD -- A500 3.1 (mkick) adide 50mb -- Duron 1600mhz Ubuntu Linux / WinXP -- BenQ FP93G TFT - 1048 like CRT - HP psc1110 [ Dieser Beitrag wurde von AGSzabo am 21.09.2009 um 19:31 Uhr geändert. ] [ - Antworten - Zitieren - Direktlink - ] |
21.09.2009, 19:32 Uhr slin Posts: 30 Nutzer |
Zitat:Diese Frage kann Dir zum Beispiel StackSnoop beantworten ![]() [ - Antworten - Zitieren - Direktlink - ] |
21.09.2009, 19:34 Uhr AGSzabo Posts: 1663 Nutzer |
@slin: ah, das ist eine großartige idee! gleich mal versuchen... -- Sam mini os4.1 -- e-uae 39bb2 -- A4000D 3.0 - 2mbchip/8mbfast - Ariadne_II - ide DVD und HD -- A500 3.1 (mkick) adide 50mb -- Duron 1600mhz Ubuntu Linux / WinXP -- BenQ FP93G TFT - 1048 like CRT - HP psc1110 [ - Antworten - Zitieren - Direktlink - ] |
22.09.2009, 19:49 Uhr Holger Posts: 8116 Nutzer |
@AGSzabo: Vielleicht solltest Du ja doch auch mal die _xuiImageFill Routine mit posten... mfg -- Good coders do not comment. What was hard to write should be hard to read too. [ - Antworten - Zitieren - Direktlink - ] |
22.09.2009, 19:58 Uhr AGSzabo Posts: 1663 Nutzer |
@Holger: ok, ist aber nicht kurz! code:WG_fillbghook movem.l d2-d5/a3/a4/a6,-(a7) lea 4(a1),a3 move.l h_Data(a0),a0 move.l xuiWG_drawinfo(a0),a4 lea -rp_SIZEOF(a7),a7 move.l a7,a1 move.l gfxbase(pc),a6 jsr _LVOInitRastPort(a6) move.l a7,a1 move.l rp_BitMap(a2),rp_BitMap(a1) move.l libbase(pc),a6 btst #xuiBB_USEBGIMAGES,xuiB_configflags(a6) beq.b .pen_fill move.l xuiDI_imagetable(a4),a0 move.l xuiIT_tabsbgimage(a0),d0 bne.b .image_fill .pen_fill move.l xuiDI_pentable(a4),a0 move.b xuiPT_backpen(a0),d0 move.l gfxbase(pc),a6 jsr _LVOSetAPen(a6) move.l a7,a1 movem.w (a3)+,d0-d3 jsr _LVORectFill(a6) bra.b .restack .image_fill move.l d0,a0 movem.w (a3)+,d0-d3 bsr _xuiImageFill .restack lea rp_SIZEOF(a7),a7 movem.l (a7)+,d2-d5/a3/a4/a6 rts code:_xuiImageFill ; d0-d3 left, top, right, bottom ; a0 *imagenode may be null ; a1 *rastport cmp.l #0,a0 beq.b .rts pushm a0/a1/a2/a6 movem.l d2-d7,-(a7) movem.w d0-d3,-(a7) move.l a1,-(a7) move.l xuiIN_bitmap(a0),-(a7) move.l xuiIN_bitmapheader(a0),a2 move.l gfxbase(pc),a6 STRUCTURE ImageFillHelp,0 UWORD ifh_width UWORD ifh_height UWORD ifh_1stxoffset UWORD ifh_1styoffset UWORD ifh_restx UWORD ifh_resty UWORD ifh_xrepeats UWORD ifh_yrepeats UWORD ifh_currentx UWORD ifh_currenty LABEL ifh_SIZEOF APTR ifh_bitmap APTR ifh_rastport UWORD ifh_left UWORD ifh_top lea -ifh_SIZEOF(a7),a7 ; startpunkt festlegen move.w d0,ifh_currentx(a7) move.w d1,ifh_currenty(a7) ; left und top offset berechnen, damit ; mehrere gefüllte flächen nahtlos zusammen passen moveq #0,d4 move.w d0,d4 divu.w bmh_Width(a2),d4 swap d4 move.w d4,ifh_1stxoffset(a7) moveq #0,d5 move.w d1,d5 divu.w bmh_Height(a2),d5 swap d5 move.w d5,ifh_1styoffset(a7) ; höhe und breite, zahl der widerholungen und restgröße berechnen sub.w d0,d2 addq.w #1,d2 move.w d2,ifh_width(a7) moveq #0,d6 move.w d2,d6 move.w bmh_Width(a2),d2 clr.w ifh_xrepeats(a7) sub.w d2,d6 bge.b .div_x add.w ifh_1stxoffset(a7),d6 bra.b .set_rx .div_x add.w ifh_1stxoffset(a7),d6 divu.w d2,d6 move.w d6,ifh_xrepeats(a7) swap d6 .set_rx move.w d6,ifh_restx(a7) sub.w d1,d3 addq.w #1,d3 move.w d3,ifh_height(a7) moveq #0,d7 move.w d3,d7 move.w bmh_Height(a2),d3 clr.w ifh_yrepeats(a7) sub.w d3,d7 bge.b .div_y add.w ifh_1styoffset(a7),d7 bra.b .set_ry .div_y add.w ifh_1styoffset(a7),d7 divu.w d3,d7 move.w d7,ifh_yrepeats(a7) swap d7 .set_ry move.w d7,ifh_resty(a7) ; init x- and yrepcount moveq #0,d6 moveq #0,d7 .loop_y .loop_x move.w bmh_Width(a2),d4 move.w bmh_Height(a2),d5 move.w ifh_1stxoffset(a7),d0 move.w ifh_1styoffset(a7),d1 tst.w d6 bne.b .no_xoffset sub.w d0,d4 bra.b .if_yoffset .no_xoffset moveq #0,d0 .if_yoffset tst.w d7 bne.b .no_yoffset sub.w d1,d5 bra.b .offsets_ok .no_yoffset moveq #0,d1 .offsets_ok ; nur noch ein rest übrig? cmp.w ifh_xrepeats(a7),d6 ble.b .not_restx move.w ifh_restx(a7),d4 .not_restx cmp.w ifh_yrepeats(a7),d7 ble.b .not_resty move.w ifh_resty(a7),d5 .not_resty ; test fit cmp.w ifh_width(a7),d4 ble.b .if_higher move.w ifh_width(a7),d4 .if_higher cmp.w ifh_height(a7),d5 ble.b .size_ok move.w ifh_height(a7),d5 .size_ok ; left top im dest-rastport move.w ifh_currentx(a7),d2 move.w ifh_currenty(a7),d3 movem.l ifh_SIZEOF(a7),a0/a1 push d6 move.b #$C0,d6 jsr _LVOBltBitMapRastPort(a6) pop d6 ; advance x add.w d4,ifh_currentx(a7) addq.w #1,d6 move.w ifh_xrepeats(a7),d2 addq.w #1,d2 cmp.w d2,d6 ble.b .loop_x ; reset xpos to left move.w ifh_left(a7),ifh_currentx(a7) moveq #0,d6 ; advance y add.w d5,ifh_currenty(a7) addq.w #1,d7 move.w ifh_yrepeats(a7),d3 addq.w #1,d3 cmp.w d3,d7 ble.b .loop_y lea ifh_SIZEOF(a7),a7 addq #8,a7 movem.w (a7)+,d0-d3 movem.l (a7)+,d2-d7 popm a0/a1/a2/a6 .rts rts das kosmisch-komische ist, dass es manchmal funktiopniert und manchaml nicht! -- Sam mini os4.1 -- e-uae 39bb2 -- A4000D 3.0 - 2mbchip/8mbfast - Ariadne_II - ide DVD und HD -- A500 3.1 (mkick) adide 50mb -- Duron 1600mhz Ubuntu Linux / WinXP -- BenQ FP93G TFT - 1048 like CRT - HP psc1110 [ - Antworten - Zitieren - Direktlink - ] |
1 -2- | [ - Beitrag schreiben - ] |
amiga-news.de Forum > Programmierung > GA_BackFill | [ - Suche - Neue Beiträge - Registrieren - Login - ] |
![]() |
Impressum |
Datenschutzerklärung |
Netiquette |
Werbung |
Kontakt
Copyright © 1998-2025 by amiga-news.de - alle Rechte vorbehalten. |
![]() |