home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18581 < prev    next >
Encoding:
Internet Message Format  |  1993-01-12  |  4.5 KB

  1. Path: sparky!uunet!mcsun!fuug!funic!sauna.cs.hut.fi!news.cs.hut.fi!s37732v
  2. From: s37732v@snakemail.hut.fi (Markus Juhani Aalto)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Any known bugs with ClipBlit?
  5. Date: 12 Jan 93 19:00:06 GMT
  6. Organization: Helsinki University of Technology, Finland
  7. Lines: 109
  8. Distribution: comp
  9. Message-ID: <S37732V.93Jan12210007@lk-hp-20.hut.fi>
  10. NNTP-Posting-Host: lk-hp-20.hut.fi
  11.  
  12.  
  13. Hi!
  14.  
  15. I'm still developing my Listview gadget replacement with BOOPSI and
  16. now I'm optimizing it for better speed. Previously I refreshed whole
  17. listview gadget (print all text) when for example arrow gadget was
  18. pressed and this was little too slow. So now I started to use
  19. ClipBlit to blit all valid lines to new places and refresh only few
  20. lines. And now my listview really scrolls. It's blazingly fast even
  21. in about 700*520*4 window. But I got one problem.
  22.  
  23. When I open the window with listview gadget. Everything goes fine. 
  24. Arrow gadgets and scroll gadget moves text in listview very fast and
  25. smoothly until I put another window over the listview gadget so that
  26. I can still access the control (arrows etc..) gadgets. Also I can
  27. see part of the listview. 
  28.  
  29. So now if I press for example the UP arrow, text moves up and those places
  30. coming below the overlapping window are totally messed up. All other
  31. parts of the listview are fine.
  32.  
  33. I'm using SIMPLEREFRESH window if it matters. 
  34.  
  35. I include here again the parts of my GM_RENDER method and routine which
  36. makes the blitting.
  37.  
  38. ----------------- CLip -------------------
  39.             lvw = (struct ListViewClass *)INST_DATA( cl, o);
  40.             lvw->Locked = 1;
  41.             {
  42.                 struct gpRender *gpr = (struct gpRender *)msg;
  43.                 ULONG Count = lvw->FirstItemToRender;
  44.                 REND_FUNC func = lvw->ItemRenderer;
  45.                 struct Node *node = lvw->topNode;
  46.                 int i;
  47.  
  48.                 if(gpr->gpr_Redraw == GREDRAW_UPDATE) {
  49.                     for( i=0; i < Count; i++ ) {
  50.                         node = NextNode(node);
  51.                     }
  52.  
  53.             /* Check if we are scrolling, so that we have to
  54.                blit things to right places. */
  55.                     if( lvw->Scroll ) {
  56.                         MakeListViewBlit((struct Gadget *)o,gpr,lvw);
  57.                         lvw->Scroll = FALSE;
  58.                     }
  59.  
  60.                     while(Count <= lvw->LastItemToRender) {
  61.                         RetVal = (*func)(node, (struct Gadget *)o,
  62.                                 gpr,Count,lvw->RenderString);
  63.                         if(node) {
  64.                             node = NextNode(node);
  65.                             if( IsLastNode(node) ) {
  66.                                 node = NULL;
  67.                             }
  68.                         }
  69.                         Count++;
  70.                     }
  71.                 }
  72.  
  73.  
  74.  
  75. /* Here is the blitting routine. */
  76.  
  77. VOID MakeListViewBlit(  struct Gadget *gadg,
  78.                         struct gpRender *gpr,
  79.                         struct ListViewClass *lvw)
  80. {
  81.     WORD YSize = gpr->gpr_RPort->Font->tf_YSize;
  82.  
  83.     WaitBlit();
  84.     if( lvw->FirstItemToRender == 0 ) {
  85.     /* We scroll up. */
  86.         ClipBlit(gpr->gpr_RPort, 2 + gadg->LeftEdge, 2 + gadg->TopEdge,
  87.                 gpr->gpr_RPort, 2 + gadg->LeftEdge,
  88.                 2 + gadg->TopEdge + (1 + lvw->LastItemToRender)*YSize,
  89.                 gadg->Width - 4,
  90.                 (lvw->Visible - lvw->LastItemToRender - 1)*YSize,0xC0);
  91.     }
  92.     else if( lvw->LastItemToRender == lvw->Visible - 1) {
  93.     /* We scroll down! */
  94.         ClipBlit(gpr->gpr_RPort, 2 + gadg->LeftEdge,
  95.                 2 + gadg->TopEdge + 
  96.               YSize*(lvw->Visible - lvw->FirstItemToRender),
  97.                 gpr->gpr_RPort, 2 + gadg->LeftEdge,
  98.                 2 + gadg->TopEdge,
  99.                 gadg->Width - 4, lvw->FirstItemToRender*YSize,0xC0);
  100.     }
  101.  
  102.     /* I just put this here to make sure that ClipBlit problem didn't 
  103.        happen because this was missing. */
  104.     WaitBlit();
  105. }
  106.  
  107. ------------------ clip --------------------
  108.  
  109. Oh! I'm using KS2.04! 
  110. --
  111.  
  112.  
  113. **************************************************************************
  114. *         Markus Aalto              | Helsinki University of Technology  *
  115. *                                   |                                    *
  116. *  EMail: s37732v@vipunen.hut.fi    | Faculty of Electric Engineering    *
  117. *  Fax:   358-0-8746991 (Sometimes) |                                    *
  118. *                                   | Undergraduate in Computer Science  *
  119. **************************************************************************
  120.         
  121.