Advertisement
ZoriaRPG

Possible Fix for Script Drawing of CSet2

Oct 28th, 2018
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 19.49 KB | None | 0 0
  1. //add calls to
  2.  
  3. /*
  4. void putcombotranslucent(BITMAP* dest,int x,int y,int cmbdat,int cset,int opacity)
  5.  
  6. and
  7.  
  8. void putcombo(BITMAP* dest,int x,int y,int cmbdat,int cset)
  9.  
  10. to use in DrawCombo, FastCombo, DrawLayer, and DrawScreen
  11.  
  12. */
  13.  
  14. class TileHelper
  15. {
  16. public:
  17.  
  18.     static void OldPutTile(BITMAP* _Dest, int tile, int x, int y, int w, int h, int color, int flip, byte skiprows=0)
  19.     {
  20.         // Past the end of the tile page?
  21.         if(skiprows>0 && tile%TILES_PER_ROW+w>=TILES_PER_ROW)
  22.         {
  23.             byte w2=(tile+w)%TILES_PER_ROW;
  24.             OldPutTile(_Dest, tile, x, y, w-w2, h, color, flip);
  25.             OldPutTile(_Dest, tile+(w-w2)+(skiprows*TILES_PER_ROW), x+16*(w-w2), y, w2, h, color, flip);
  26.             return;
  27.         }
  28.        
  29.         switch(flip)
  30.         {
  31.         case 1:
  32.             for(int j=0; j<h; j++)
  33.                 for(int k=w-1; k>=0; k--)
  34.                     oldputtile16(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+j*16, color, flip);
  35.                    
  36.             break;
  37.            
  38.         case 2:
  39.             for(int j=h-1; j>=0; j--)
  40.                 for(int k=0; k<w; k++)
  41.                     oldputtile16(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+((h-1)-j)*16, color, flip);
  42.                    
  43.             break;
  44.            
  45.         case 3:
  46.             for(int j=h-1; j>=0; j--)
  47.                 for(int k=w-1; k>=0; k--)
  48.                     oldputtile16(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+((h-1)-j)*16, color, flip);
  49.                    
  50.             break;
  51.            
  52.         case 0:
  53.         default:
  54.             for(int j=0; j<h; j++)
  55.                 for(int k=0; k<w; k++)
  56.                     oldputtile16(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+j*16, color, flip);
  57.                    
  58.             break;
  59.         }
  60.     }
  61.    
  62.     static void OverTile(BITMAP* _Dest, int tile, int x, int y, int w, int h, int color, int flip, byte skiprows=0)
  63.     {
  64.         if(skiprows>0 && tile%TILES_PER_ROW+w>=TILES_PER_ROW)
  65.         {
  66.             byte w2=(tile+w)%TILES_PER_ROW;
  67.             OverTile(_Dest, tile, x, y, w-w2, h, color, flip);
  68.             OverTile(_Dest, tile+(w-w2)+(skiprows*TILES_PER_ROW), x+16*(w-w2), y, w2, h, color, flip);
  69.             return;
  70.         }
  71.        
  72.         switch(flip)
  73.         {
  74.         case 1:
  75.             for(int j=0; j<h; j++)
  76.                 for(int k=w-1; k>=0; k--)
  77.                     overtile16(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+j*16, color, flip);
  78.                    
  79.             break;
  80.            
  81.         case 2:
  82.             for(int j=h-1; j>=0; j--)
  83.                 for(int k=0; k<w; k++)
  84.                     overtile16(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+((h-1)-j)*16, color, flip);
  85.                    
  86.             break;
  87.            
  88.         case 3:
  89.             for(int j=h-1; j>=0; j--)
  90.                 for(int k=w-1; k>=0; k--)
  91.                     overtile16(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+((h-1)-j)*16, color, flip);
  92.                    
  93.             break;
  94.            
  95.         default:
  96.             for(int j=0; j<h; j++)
  97.                 for(int k=0; k<w; k++)
  98.                     overtile16(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+j*16, color, flip);
  99.                    
  100.             break;
  101.         }
  102.     }
  103.    
  104.     static void OverTileTranslucent(BITMAP* _Dest, int tile, int x, int y, int w, int h, int color, int flip, int opacity, byte skiprows=0)
  105.     {
  106.         if(skiprows>0 && tile%TILES_PER_ROW+w>=TILES_PER_ROW)
  107.         {
  108.             byte w2=(tile+w)%TILES_PER_ROW;
  109.             OverTileTranslucent(_Dest, tile, x, y, w-w2, h, color, flip, opacity);
  110.             OverTileTranslucent(_Dest, tile+(w-w2)+(skiprows*TILES_PER_ROW), x+16*(w-w2), y, w2, h, color, flip, opacity);
  111.             return;
  112.         }
  113.        
  114.         switch(flip)
  115.         {
  116.         case 1:
  117.             for(int j=0; j<h; j++)
  118.                 for(int k=w-1; k>=0; k--)
  119.                     overtiletranslucent16(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+j*16, color, flip, opacity);
  120.                    
  121.             break;
  122.            
  123.         case 2:
  124.             for(int j=h-1; j>=0; j--)
  125.                 for(int k=0; k<w; k++)
  126.                     overtiletranslucent16(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+((h-1)-j)*16, color, flip, opacity);
  127.                    
  128.             break;
  129.            
  130.         case 3:
  131.             for(int j=h-1; j>=0; j--)
  132.                 for(int k=w-1; k>=0; k--)
  133.                     overtiletranslucent16(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+((h-1)-j)*16, color, flip, opacity);
  134.                    
  135.             break;
  136.            
  137.         default:
  138.             for(int j=0; j<h; j++)
  139.                 for(int k=0; k<w; k++)
  140.                     overtiletranslucent16(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+j*16, color, flip, opacity);
  141.                    
  142.             break;
  143.         }
  144.     }
  145.    
  146.     static void PutTileTranslucent(BITMAP* _Dest, int tile, int x, int y, int w, int h, int color, int flip, int opacity, byte skiprows=0)
  147.     {
  148.         if(skiprows>0 && tile%TILES_PER_ROW+w>=TILES_PER_ROW)
  149.         {
  150.             byte w2=(tile+w)%TILES_PER_ROW;
  151.             PutTileTranslucent(_Dest, tile, x, y, w-w2, h, color, flip, opacity);
  152.             PutTileTranslucent(_Dest, tile+(w-w2)+(skiprows*TILES_PER_ROW), x+16*(w-w2), y, w2, h, color, flip, opacity);
  153.             return;
  154.         }
  155.        
  156.         switch(flip)
  157.         {
  158.         case 1:
  159.             for(int j=0; j<h; j++)
  160.                 for(int k=w-1; k>=0; k--)
  161.                     puttiletranslucent16(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+j*16, color, flip, opacity);
  162.                    
  163.             break;
  164.            
  165.         case 2:
  166.             for(int j=h-1; j>=0; j--)
  167.                 for(int k=0; k<w; k++)
  168.                     puttiletranslucent16(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+((h-1)-j)*16, color, flip, opacity);
  169.                    
  170.             break;
  171.            
  172.         case 3:
  173.             for(int j=h-1; j>=0; j--)
  174.                 for(int k=w-1; k>=0; k--)
  175.                     puttiletranslucent16(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+((h-1)-j)*16, color, flip, opacity);
  176.                    
  177.             break;
  178.            
  179.         default:
  180.             for(int j=0; j<h; j++)
  181.                 for(int k=0; k<w; k++)
  182.                     puttiletranslucent16(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+j*16, color, flip, opacity);
  183.                    
  184.             break;
  185.         }
  186.     }
  187.  
  188.     static void OldPutCombo(BITMAP* _Dest, int tile, int x, int y, int w, int h, int color, int flip, byte skiprows=0)
  189.     {
  190.         // Past the end of the tile page?
  191.         if(skiprows>0 && tile%TILES_PER_ROW+w>=TILES_PER_ROW)
  192.         {
  193.             byte w2=(tile+w)%TILES_PER_ROW;
  194.             oldputblock8(_Dest, tile, x, y, w-w2, h, color, flip,15);
  195.             oldputblock8(_Dest, tile+(w-w2)+(skiprows*TILES_PER_ROW), x+16*(w-w2), y, w2, h, color, flip,15);
  196.             return;
  197.         }
  198.        
  199.         switch(flip)
  200.         {
  201.         case 1:
  202.             for(int j=0; j<h; j++)
  203.                 for(int k=w-1; k>=0; k--)
  204.                     oldputblock8(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+j*16, color, flip,15);
  205.                    
  206.             break;
  207.            
  208.         case 2:
  209.             for(int j=h-1; j>=0; j--)
  210.                 for(int k=0; k<w; k++)
  211.                     oldputblock8(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+((h-1)-j)*16, color, flip,15);
  212.                    
  213.             break;
  214.            
  215.         case 3:
  216.             for(int j=h-1; j>=0; j--)
  217.                 for(int k=w-1; k>=0; k--)
  218.                     oldputblock8(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+((h-1)-j)*16, color, flip,15);
  219.                    
  220.             break;
  221.            
  222.         case 0:
  223.         default:
  224.             for(int j=0; j<h; j++)
  225.                 for(int k=0; k<w; k++)
  226.                     oldputblock8(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+j*16, color, flip,15);
  227.                    
  228.             break;
  229.         }
  230.     }
  231.    
  232.     static void OverCombo(BITMAP* _Dest, int tile, int x, int y, int w, int h, int color, int flip, byte skiprows=0)
  233.     {
  234.         if(skiprows>0 && tile%TILES_PER_ROW+w>=TILES_PER_ROW)
  235.         {
  236.             byte w2=(tile+w)%TILES_PER_ROW;
  237.             overblock8(_Dest, tile, x, y, w-w2, h, color, flip,15);
  238.             overblock8(_Dest, tile+(w-w2)+(skiprows*TILES_PER_ROW), x+16*(w-w2), y, w2, h, color, flip,15);
  239.             return;
  240.         }
  241.        
  242.         switch(flip)
  243.         {
  244.         case 1:
  245.             for(int j=0; j<h; j++)
  246.                 for(int k=w-1; k>=0; k--)
  247.                     overblock8(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+j*16, color, flip,15);
  248.                    
  249.             break;
  250.            
  251.         case 2:
  252.             for(int j=h-1; j>=0; j--)
  253.                 for(int k=0; k<w; k++)
  254.                     overblock8(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+((h-1)-j)*16, color, flip,15);
  255.                    
  256.             break;
  257.            
  258.         case 3:
  259.             for(int j=h-1; j>=0; j--)
  260.                 for(int k=w-1; k>=0; k--)
  261.                     overblock8(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+((h-1)-j)*16, color, flip,15);
  262.                    
  263.             break;
  264.            
  265.         default:
  266.             for(int j=0; j<h; j++)
  267.                 for(int k=0; k<w; k++)
  268.                     overblock8(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+j*16, color, flip,15);
  269.                    
  270.             break;
  271.         }
  272.     }
  273.    
  274.     static void OverComboTranslucent(BITMAP* _Dest, int tile, int x, int y, int w, int h, int color, int flip, int opacity, byte skiprows=0)
  275.     {
  276.         if(skiprows>0 && tile%TILES_PER_ROW+w>=TILES_PER_ROW)
  277.         {
  278.             byte w2=(tile+w)%TILES_PER_ROW;
  279.             overblocktranslucent8(_Dest, tile, x, y, w-w2, h, color, flip, 15, opacity);
  280.             overblocktranslucent8(_Dest, tile+(w-w2)+(skiprows*TILES_PER_ROW), x+16*(w-w2), y, w2, h, color, flip, 15, opacity);
  281.             return;
  282.         }
  283.        
  284.         switch(flip)
  285.         {
  286.         case 1:
  287.             for(int j=0; j<h; j++)
  288.                 for(int k=w-1; k>=0; k--)
  289.                     overblocktranslucent8(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+j*16, color, flip, 15, opacity);
  290.                    
  291.             break;
  292.            
  293.         case 2:
  294.             for(int j=h-1; j>=0; j--)
  295.                 for(int k=0; k<w; k++)
  296.                     overblocktranslucent8(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+((h-1)-j)*16, color, flip, 15, opacity);
  297.                    
  298.             break;
  299.            
  300.         case 3:
  301.             for(int j=h-1; j>=0; j--)
  302.                 for(int k=w-1; k>=0; k--)
  303.                     overblocktranslucent8(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+((h-1)-j)*16, color, flip, 15, opacity);
  304.                    
  305.             break;
  306.            
  307.         default:
  308.             for(int j=0; j<h; j++)
  309.                 for(int k=0; k<w; k++)
  310.                     overblocktranslucent8(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+j*16, color, flip, 15, opacity);
  311.                    
  312.             break;
  313.         }
  314.     }
  315.    
  316.     static void PutComboTranslucent(BITMAP* _Dest, int tile, int x, int y, int w, int h, int color, int flip, int opacity, byte skiprows=0)
  317.     {
  318.         if(skiprows>0 && tile%TILES_PER_ROW+w>=TILES_PER_ROW)
  319.         {
  320.             byte w2=(tile+w)%TILES_PER_ROW;
  321.             overblocktranslucent8(_Dest, tile, x, y, w-w2, h, color, flip, 15, opacity);
  322.             overblocktranslucent8(_Dest, tile+(w-w2)+(skiprows*TILES_PER_ROW), x+16*(w-w2), y, w2, h, color, flip, 15, opacity);
  323.             return;
  324.         }
  325.        
  326.         switch(flip)
  327.         {
  328.         case 1:
  329.             for(int j=0; j<h; j++)
  330.                 for(int k=w-1; k>=0; k--)
  331.                     overblocktranslucent8(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+j*16, color, flip, 15,opacity);
  332.                    
  333.             break;
  334.            
  335.         case 2:
  336.             for(int j=h-1; j>=0; j--)
  337.                 for(int k=0; k<w; k++)
  338.                     overblocktranslucent8(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+((h-1)-j)*16, color, flip, 15, opacity);
  339.                    
  340.             break;
  341.            
  342.         case 3:
  343.             for(int j=h-1; j>=0; j--)
  344.                 for(int k=w-1; k>=0; k--)
  345.                     overblocktranslucent8(_Dest, tile+(j*TILES_PER_ROW)+k, x+((w-1)-k)*16, y+((h-1)-j)*16, color, 15, flip, opacity);
  346.                    
  347.             break;
  348.            
  349.         default:
  350.             for(int j=0; j<h; j++)
  351.                 for(int k=0; k<w; k++)
  352.                     overblocktranslucent8(_Dest, tile+(j*TILES_PER_ROW)+k, x+k*16, y+j*16, color, flip, 15, opacity);
  353.                    
  354.             break;
  355.         }
  356.     }
  357. };
  358.  
  359.  
  360.  
  361. void do_drawcombor(BITMAP *bmp, int *sdci, int xoffset, int yoffset)
  362. {
  363.     //sdci[1]=layer
  364.     //sdci[2]=x
  365.     //sdci[3]=y
  366.     //sdci[4]=combo
  367.     //sdci[5]=tile width
  368.     //sdci[6]=tile height
  369.     //sdci[7]=color (cset)
  370.     //sdci[8]=scale x
  371.     //sdci[9]=scale y
  372.     //sdci[10]=rotation anchor x
  373.     //sdci[11]=rotation anchor y
  374.     //sdci[12]=rotation angle
  375.     //sdci[13]=frame
  376.     //sdci[14]=flip
  377.     //sdci[15]=transparency
  378.     //sdci[16]=opacity
  379.    
  380.     int w = sdci[5]/10000;
  381.     int h = sdci[6]/10000;
  382.    
  383.     if(w<1||h<1||h>20||w>20)
  384.     {
  385.         return;
  386.     }
  387.    
  388.     int xscale=sdci[8]/10000;
  389.     int yscale=sdci[9]/10000;
  390.     int rx = sdci[10]/10000; //these work now
  391.     int ry = sdci[11]/10000; //these work now
  392.     float rotation=sdci[12]/10000;
  393.    
  394.     bool transparency=sdci[15]!=0;
  395.     int opacity=sdci[16]/10000;
  396.     int color=sdci[7]/10000;
  397.     int x1=sdci[2]/10000;
  398.     int y1=sdci[3]/10000;
  399.    
  400.     //const newcombo & c = combobuf[(sdci[4]/10000)];
  401.     int tiletodraw = sdci[4]/10000;
  402.     //int tiletodraw = combo_tile(c, x1, y1);
  403.     int flip = ((sdci[14]/10000) & 3) ^ c.flip;
  404.     int skiprows=combobuf[(sdci[4]/10000)].skipanimy;
  405.    
  406.    
  407.     //don't scale if it's not safe to do so
  408.     bool canscale = true;
  409.    
  410.     if(xscale==0||yscale==0)
  411.     {
  412.         return;
  413.     }
  414.    
  415.     if(xscale<0||yscale<0)
  416.         canscale = false; //default size
  417.        
  418.     if((xscale>0 && yscale>0) || rotation)   //scaled or rotated
  419.     {
  420.         BITMAP* pbitty = script_drawing_commands.AquireSubBitmap(w*16, h*16);   //-pbitty in the hisouse. :D
  421.        
  422.         if(transparency)
  423.         {
  424.             TileHelper::OverCombo(pbitty, tiletodraw, 0, 0, w, h, color, flip, skiprows);
  425.         }
  426.         else //no transparency
  427.         {
  428.             TileHelper::OldPutCombo(pbitty, tiletodraw, 0, 0, w, h, color, flip, skiprows);
  429.         }
  430.        
  431.         if(rotation != 0) // rotate
  432.         {
  433.             //fixed point sucks ;0
  434.             if(rx>-777||ry>-777) //set the rotation anchor and rotate around that
  435.             {
  436.                 int xy[2];
  437.                 fixed ra1=itofix(sdci[12]%10000)/10000;
  438.                 fixed ra2=itofix(sdci[12]/10000);
  439.                 fixed ra=ra1+ra2;
  440.                 xy[ 0]=rx + fixtoi((fixcos(ra) * (x1 - rx) - fixsin(ra) * (y1 - ry)));     //x1
  441.                 xy[ 1]=ry + fixtoi((fixsin(ra) * (x1 - rx) + fixcos(ra) * (y1 - ry)));     //y1
  442.                 x1=xy[0];
  443.                 y1=xy[1];
  444.             }
  445.            
  446.             if(canscale) //scale first
  447.             {
  448.                 BITMAP* tempbit = create_bitmap_ex(8, xscale>512?512:xscale, yscale>512?512:yscale);
  449.                 clear_bitmap(tempbit);
  450.                
  451.                 stretch_sprite(tempbit, pbitty, 0, 0, xscale, yscale);
  452.                
  453.                 if(opacity < 128)
  454.                 {
  455.                     clear_bitmap(prim_bmp);
  456.                     rotate_sprite(prim_bmp, tempbit, 0, 0, degrees_to_fixed(rotation));
  457.                     draw_trans_sprite(bmp, prim_bmp, x1+xoffset, y1+yoffset);
  458.                 }
  459.                 else
  460.                 {
  461.                     rotate_sprite(bmp, tempbit, x1+xoffset, y1+yoffset, degrees_to_fixed(rotation));
  462.                 }
  463.                
  464.                 destroy_bitmap(tempbit);
  465.             }
  466.             else //no scale
  467.             {
  468.                 if(opacity < 128)
  469.                 {
  470.                     clear_bitmap(prim_bmp);
  471.                     rotate_sprite(prim_bmp, pbitty, 0, 0, degrees_to_fixed(rotation));
  472.                     draw_trans_sprite(bmp, prim_bmp, x1+xoffset, y1+yoffset);
  473.                 }
  474.                 else
  475.                 {
  476.                     rotate_sprite(bmp, pbitty, x1+xoffset, y1+yoffset, degrees_to_fixed(rotation));
  477.                 }
  478.             }
  479.         }
  480.         else //scale only
  481.         {
  482.             if(canscale)
  483.             {
  484.                 if(opacity<128)
  485.                 {
  486.                     clear_bitmap(prim_bmp);
  487.                     stretch_sprite(prim_bmp, pbitty, 0, 0, xscale, yscale);
  488.                     draw_trans_sprite(bmp, prim_bmp, x1+xoffset, y1+yoffset);
  489.                 }
  490.                 else
  491.                 {
  492.                     stretch_sprite(bmp, pbitty, x1+xoffset, y1+yoffset, xscale, yscale);
  493.                 }
  494.             }
  495.             else //error -do not scale
  496.             {
  497.                 if(opacity<128)
  498.                 {
  499.                     draw_trans_sprite(bmp, prim_bmp, x1+xoffset, y1+yoffset);
  500.                 }
  501.                 else
  502.                 {
  503.                     draw_sprite(bmp, pbitty, x1+xoffset, y1+yoffset);
  504.                 }
  505.             }
  506.         }
  507.        
  508.         script_drawing_commands.ReleaseSubBitmap(pbitty); //rap sucks
  509.     }
  510.     else // no scale or rotation
  511.     {
  512.         if(transparency)
  513.         {
  514.             if(opacity<=127)
  515.                 TileHelper::OverComboTranslucent(bmp, tiletodraw, xoffset+x1, yoffset+y1, w, h, color, flip, opacity, skiprows);
  516.             else
  517.                 TileHelper::OverCombo(bmp, tiletodraw, xoffset+x1, yoffset+y1, w, h, color, flip, skiprows);
  518.         }
  519.         else
  520.         {
  521.             if(opacity<=127)
  522.                 TileHelper::PutComboTranslucent(bmp, tiletodraw, xoffset+x1, yoffset+y1, w, h, color, flip, opacity, skiprows);
  523.             else
  524.                 TileHelper::OldPutCombo(bmp, tiletodraw, xoffset+x1, yoffset+y1, w, h, color, flip, skiprows);
  525.         }
  526.     }
  527. }
  528.  
  529. void draw_mapscr(BITMAP *b, const mapscr& m, int x, int y, bool transparent)
  530. {
  531.     for(int i(0); i < 176; ++i)
  532.     {
  533.         const int x2 = ((i&15)<<4) + x;
  534.         const int y2 = (i&0xF0) + y;
  535.        
  536.         const newcombo & c = combobuf[ m.data[i] ];
  537.         const int tile = combo_tile(c, x2, y2);
  538.        
  539.         if(transparent)
  540.             overblocktranslucent8(b, tile, x2, y2, m.cset[i], c.flip, 15, 128);
  541.         else
  542.             overblock8(b, tile, x2, y2, m.cset[i], c.flip, 15);
  543.     }
  544. }
  545.  
  546. void do_fastcombor(BITMAP *bmp, int *sdci, int xoffset, int yoffset)
  547. {
  548.     /* layer, x, y, tile, color opacity */
  549.    
  550.     int opacity = sdci[6] / 10000;
  551.     int x1 = sdci[2] / 10000;
  552.     int y1 = sdci[3] / 10000;
  553.     int index = sdci[4]/10000;
  554.    
  555.     //if( index >= MAXCOMBOS ) return; //bleh.
  556.     const newcombo & c = combobuf[index];
  557.    
  558.     if(opacity < 128)
  559.         overblocktranslucent8(bmp, combo_tile(c, x1, y1), xoffset+x1, yoffset+y1, sdci[5]/10000, (int)c.flip, 15, opacity);
  560.     else
  561.         overblock8(bmp, combo_tile(c, x1, y1), xoffset+x1, yoffset+y1, sdci[5]/10000, (int)c.flip, 15);
  562. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement