Free Hero Mesh

Diff
Login
This is a mirror of the main repository for Free Hero Mesh. New tickets and changes will not be accepted at this mirror.

Differences From Artifact [17b60b9454]:

To Artifact [d436eb2e04]:


341
342
343
344
345
346
347
348
349


350
351
352
353
354
355
356
341
342
343
344
345
346
347


348
349
350
351
352
353
354
355
356







-
-
+
+







  an->vimage=(f&0x08?objects[n]->image:a0);
  if(f&0x10) an->ltime=an->vtime=t/2;
  switch(f&0x07) {
    case 0: an->status=0; an->step->flag=0; break;
    case 1: an->status=ANISTAT_LOGICAL; an->step->flag=ANI_ONCE; break;
    case 2: an->status=ANISTAT_VISUAL|ANISTAT_LOGICAL; an->step->flag=ANI_ONCE; break;
    case 3: an->status=ANISTAT_VISUAL; an->step->flag=ANI_ONCE; break;
    case 4: an->status=ANISTAT_VISUAL; an->step->flag=ANI_LOOP; break;
    case 5: an->status=ANISTAT_VISUAL; an->step->flag=ANI_LOOP|ANI_OSC; break;
    case 4: an->status=ANISTAT_VISUAL|ANISTAT_LOGICAL; an->step->flag=ANI_LOOP; break;
    case 5: an->status=ANISTAT_VISUAL|ANISTAT_LOGICAL; an->step->flag=ANI_LOOP|ANI_OSC; break;
    case 6: an->status=ANISTAT_VISUAL|ANISTAT_SYNCHRONIZED; an->step->flag=ANI_LOOP|ANI_SYNC; an->step->slot=t&7; break;
    case 7: an->status=ANISTAT_LOGICAL; an->step->flag=ANI_ONCE; objects[n]->image=a0; break;
  }
}

static void animate_sync(Uint32 n,Uint32 sl,Uint32 a0) {
  Animation*an=objects[n]->anim;
655
656
657
658
659
660
661
662
663
664
665






666
667
668
669
670
671
672
655
656
657
658
659
660
661




662
663
664
665
666
667
668
669
670
671
672
673
674







-
-
-
-
+
+
+
+
+
+







  int i,j;
  Uint8 r=0;
  Uint32 e[8]={VOIDLINK,VOIDLINK,VOIDLINK,VOIDLINK,VOIDLINK,VOIDLINK,VOIDLINK,VOIDLINK};
  Uint8 re[8]={0,0,0,0,0,0,0,0};
  Value v;
  if(StackProtection()) Throw("Call stack overflow");
  for(i=0;i<8;i++) if(b&(1<<i)) e[i]=obj_layer_at(1<<i,x,y);
  for(i=0;i<7;i++) for(j=i;j<8;j++) if(e[i]==e[j]) e[j]=VOIDLINK;
  if(n!=VOIDLINK) v=send_message(VOIDLINK,n,MSG_COLLIDE,NVALUE(x),NVALUE(y),NVALUE(b));
  if(v.t) Throw("Type mismatch in COLLIDE");
  r=v.u;
  for(i=0;i<7;i++) for(j=i+1;j<8;j++) if(e[i]==e[j]) e[j]=VOIDLINK;
  if(n!=VOIDLINK) {
    v=send_message(VOIDLINK,n,MSG_COLLIDE,NVALUE(x),NVALUE(y),NVALUE(b));
    if(v.t) Throw("Type mismatch in COLLIDE");
    r=v.u;
  }
  for(i=0;i<8;i++) if(e[i]!=VOIDLINK && !(r&0x02)) {
    v=send_message(n,e[i],MSG_COLLIDEBY,NVALUE(n==VOIDLINK?0:objects[n]->x),NVALUE(n==VOIDLINK?0:objects[n]->y),CVALUE(c));
    if(v.t) Throw("Type mismatch in COLLIDEBY");
    r|=re[i]=v.u;
  }
  if(!(r&0x01)) {
    // See if we can destroy some objects to make room