home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / pd_share / program / code / stubshack / HeapGraph / !HeapDisp / c / Redaw < prev    next >
Encoding:
Text File  |  1994-11-23  |  1.5 KB  |  69 lines

  1. #include "DeskLib:WimpSWIs.h"
  2.  
  3. #include "Shell.Shell.h"
  4.  
  5. #include "Redraw.h"
  6. #include "Structs.h"
  7.  
  8.  
  9.  
  10.  
  11. void    HeapRedrawer(
  12.         Shell_convertpoint    convert,
  13.         wimp_point        rectsize,
  14.         void            *reference,
  15.         const wimp_rect        *redrawrect
  16.         )
  17. {
  18. app_block    *app = (app_block *) reference;
  19. int        i, minpos, maxpos;
  20. int        lastymax = 0;
  21.  
  22.  
  23. minpos = (redrawrect->min.y-2*Shell_PIXELYSIZE) * app->words_per_os + app->min_mem;
  24. maxpos = (redrawrect->max.y+2*Shell_PIXELYSIZE) * app->words_per_os + app->min_mem;
  25.  
  26. for ( i=0; i<app->num_blocks; i++)    {
  27.     int    ymin, ymax;
  28.  
  29.     if ( app->blocks[i].pos > maxpos)            break;
  30.     if ( app->blocks[i].pos+app->blocks[i].size < minpos)    continue;
  31.  
  32.     ymin = (app->blocks[i].pos-app->min_mem) / app->words_per_os;
  33.     ymax = (app->blocks[i].pos-app->min_mem+app->blocks[i].size) / app->words_per_os;
  34.  
  35.  
  36.     if ( ymin>=lastymax)    {
  37.         Wimp_SetColour( colour_BLACK);
  38.         Shell_RectangleFill2( 0, lastymax, rectsize.x, ymin, convert);
  39.         }
  40.  
  41.     /*if ( ymax-ymin>Shell_PIXELYSIZE)*/    {
  42.         Wimp_SetColour( 8 + (app->blocks[i].ref & 7));
  43.         Shell_RectangleFill2( 0, ymin, rectsize.x, ymax, convert);
  44.         }
  45.  
  46.     /*
  47.     Wimp_SetColour( colour_WHITE);
  48.     Shell_Move( 0, ymin, convert);
  49.     GFX_Plot( plot_SOLIDEXFINAL + plot_DRAWRELFORE, rectsize.x, 0);
  50.     Shell_Move( 0, ymax, convert);
  51.     GFX_Plot( plot_SOLIDEXFINAL + plot_DRAWRELFORE, rectsize.x, 0);
  52.     */
  53.  
  54.     lastymax = ymax /*+Shell_PIXELYSIZE*/;
  55.  
  56.     }
  57.  
  58.  
  59. if ( rectsize.y>lastymax)    {
  60.     Wimp_SetColour( colour_BLACK);
  61.     Shell_RectangleFill2( 0, lastymax, rectsize.x, rectsize.y, convert);
  62.     }
  63.  
  64.  
  65. return;
  66. }
  67.  
  68.  
  69.