Ignore:
Timestamp:
Apr 17, 2011, 11:56:44 PM (11 years ago)
Author:
Sam Hocevar
Message:

style: remove trailing spaces, fix copyright statements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/collide.cpp

    r490 r494  
    22 *  Abuse - dark 2D side-scrolling platform game
    33 *  Copyright (c) 1995 Crack dot Com
     4 *  Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
    45 *
    56 *  This software was released into the Public Domain. As with most public
     
    5152{
    5253  collide_patch *next;
    53   for (collide_patch *p=first;p;p=next)
     54  for (collide_patch *p=first; p; p=next)
    5455  {
    5556    next=p->next;
     
    161162  int32_t sx1,sy1,sx2,sy2,tx1,ty1,tx2,ty2,hitx=0,hity=0,t_centerx;
    162163
    163   for (int l=0;l<attack_total;l++)
     164  for (int l=0; l<attack_total; l++)
    164165  {
    165166    subject=attack_list[l];
     
    168169
    169170
    170     for (int j=0;j<target_total && !rec;j++)
    171     {
    172       target=target_list[j];   
     171    for (int j=0; j<target_total && !rec; j++)
     172    {
     173      target=target_list[j];
    173174      target->picture_space(tx1,ty1,tx2,ty2);
    174175      if (!(sx2<tx1 || sy2<ty1 || sx1>tx2 || sy1>ty2))  // check to see if picture spaces collide
     
    181182      t_centerx=target->x_center();
    182183      point_list *s_hit,*t_damage;
    183    
     184
    184185      s_hit=subject->current_figure()->hit;
    185186
     
    191192      unsigned char *s_dat=s_hit->data,*t_dat;
    192193      int i,j;
    193       for (i=(int)s_hit->tot-1;i>0 && !rec;i--)
    194       {
    195         for (t_dat=t_damage->data,j=(int)t_damage->tot-1;j>0 && !rec;j--)
     194      for (i=(int)s_hit->tot-1; i>0 && !rec; i--)
     195      {
     196        for (t_dat=t_damage->data,j=(int)t_damage->tot-1; j>0 && !rec; j--)
    196197        {
    197198          int32_t x1,y1,x2,y2,          // define the two line segments to check
    198199          xp1,yp1,xp2,yp2;
    199200
    200           xp1=target->x+target->tx(*t_dat);  t_dat++;   
     201          xp1=target->x+target->tx(*t_dat);  t_dat++;
    201202          yp1=target->y+target->ty(*t_dat);  t_dat++;
    202203          xp2=target->x+target->tx(*t_dat);
     
    207208          x2=subject->x+subject->tx(s_dat[2]);
    208209          y2=subject->y+subject->ty(s_dat[3]);
    209    
     210
    210211
    211212          // ok, now we know which line segemnts to check for intersection
    212213          // now check to see if (x1,y1-x2,y2) intercest with (xp1,yp1-xp2,yp2)
    213           int32_t _x2=x2,_y2=y2;   
     214          int32_t _x2=x2,_y2=y2;
    214215          setback_intersect(x1, y1, x2, y2, xp1, yp1, xp2, yp2,0);
    215216
     
    223224        }
    224225        s_dat+=2;
    225       }       
     226      }
    226227    }
    227228      }
Note: See TracChangeset for help on using the changeset viewer.