home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / a / amix2410.zip / PATCH1.OPT < prev    next >
Text File  |  1992-08-26  |  3KB  |  127 lines

  1. *** 1.1    1992/08/23 17:46:38
  2. --- tigcurs.c    1992/08/23 15:59:22
  3. ***************
  4. *** 2,7 ****
  5. --- 2,9 ----
  6.    * Functions to manipulate the cursor on the Tiga screen
  7.    *
  8.    * 22 Jun 90 Erich Rickheit KSC  Admitted responsibility
  9. +  * Patchlevel: tigcurs.c_1.1
  10. +  *   May 92 Rick Schaeffer fixed cursor overflow problems
  11.    */
  12.   
  13.   #define NEED_EVENTS
  14. ***************
  15. *** 61,67 ****
  16.     unsigned char   *dat;
  17.     struct CursPriv *cPriv;
  18.   
  19. -   pCursor->refcnt++;
  20.     width=(int)(pCursor->bits->width);
  21.     height=(int)(pCursor->bits->height);
  22.     pitch=PixmapBytePad(width,1);
  23. --- 63,68 ----
  24. ***************
  25. *** 83,90 ****
  26.       }
  27.     cPriv->data=dat;
  28.   
  29. !   cPriv->gspcursor=(PTR)gsp_malloc(sizeof(CURSOR)*8);
  30. !   if(!cPriv->gspcursor)
  31.       {
  32.         Xfree(dat);
  33.         Xfree(cPriv);
  34. --- 84,90 ----
  35.       }
  36.     cPriv->data=dat;
  37.   
  38. !   if (tigrequest(sizeof(CURSOR)*8,&cPriv->gspcursor,1)==0)
  39.       {
  40.         Xfree(dat);
  41.         Xfree(cPriv);
  42. ***************
  43. *** 92,104 ****
  44.         return FALSE;
  45.       }
  46.   
  47. !   cPriv->gspdata=(PTR)gsp_malloc(pitch*8*height*2);
  48. !   if(!cPriv->gspdata)
  49.       {
  50. !       gsp_free(cPriv->gspcursor);
  51.         Xfree(dat);
  52.         Xfree(cPriv);
  53.         ErrorF("No GSP memory for cursor data\n");
  54.         return FALSE;
  55.       }
  56.   
  57. --- 92,104 ----
  58.         return FALSE;
  59.       }
  60.   
  61. !   if (tigrequest(pitch*8*height*2,&cPriv->gspdata,1)==0)
  62.       {
  63. !       tigfree(cPriv->gspcursor);
  64.         Xfree(dat);
  65.         Xfree(cPriv);
  66.         ErrorF("No GSP memory for cursor data\n");
  67. +       ErrorF("Asked for pitch %d,width %d,height %d\n",pitch,width,height);
  68.         return FALSE;
  69.       }
  70.   
  71. ***************
  72. *** 154,166 ****
  73.   { 
  74.     struct CursPriv *cPriv=(struct CursPriv *)pCurs->devPriv[pScr->myNum];
  75.     
  76. !   if(pCurs->refcnt)
  77.       {
  78. -       pCurs->refcnt--;
  79.         if(cPriv)
  80.       {
  81. !       if(cPriv->gspdata) gsp_free(cPriv->gspdata);
  82. !       if(cPriv->gspcursor) gsp_free(cPriv->gspcursor);
  83.         Xfree(cPriv->data);
  84.         Xfree(cPriv);
  85.         pCurs->devPriv[pScr->myNum]=NULL;
  86. --- 154,170 ----
  87.   { 
  88.     struct CursPriv *cPriv=(struct CursPriv *)pCurs->devPriv[pScr->myNum];
  89.     
  90. !   if (pCurs->refcnt >= 0)
  91.       {
  92.         if(cPriv)
  93.       {
  94. !       if(cPriv->gspdata) {
  95. !         tigfree(cPriv->gspdata);
  96. !         }
  97. !       if (cPriv->gspcursor) {
  98. !         tigfree(cPriv->gspcursor);
  99. !         }
  100.         Xfree(cPriv->data);
  101.         Xfree(cPriv);
  102.         pCurs->devPriv[pScr->myNum]=NULL;
  103. ***************
  104. *** 184,190 ****
  105.        ScreenPtr  pScreen;
  106.        CursorPtr  pCursor;
  107.   { 
  108. -   int width,height,pitch;
  109.     struct CursPriv *cPriv;  
  110.   
  111.     cPriv=(struct CursPriv *)pCursor->devPriv[pScreen->myNum];
  112. --- 188,193 ----
  113. ***************
  114. *** 193,202 ****
  115.         ErrorF("No cursor info\n");
  116.         return FALSE;
  117.       }
  118. -   width=cPriv->tcurs.width;
  119. -   height=cPriv->tcurs.height;
  120. -   pitch=cPriv->tcurs.pitch/8;
  121.   
  122.     set_curs_state(0);
  123.     set_curs_shape(cPriv->gspcursor);
  124. --- 196,201 ----
  125.