721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
|
return r;
}
static void set_order(Uint32 obj) {
// To avoid confusing order of execution at the wrong time,
// calling this function is limited to only certain times.
Object*o=objects[obj];
Uint8 ord=classes[objects[obj]->class]->order;
Uint8 u;
Sint32 v0,v1;
Uint16 p=orders[ord]+1;
Uint32 n=firstobj;
for(;;) {
if(n==obj || n==VOIDLINK) goto notfound;
u=classes[objects[n]->class]->order;
if(u<ord) goto found;
if(u==ord) {
criteria: switch(orders[p]) {
case OP_RET: goto found;
case OP_DENSITY: v0=o->density; v1=objects[n]->density; goto compare;
case OP_DENSITY_C: v1=o->density; v0=objects[n]->density; goto compare;
case OP_IMAGE: v0=o->image; v1=objects[n]->image; goto compare;
case OP_IMAGE_C: v1=o->image; v0=objects[n]->image; goto compare;
case OP_MISC1:
|
|
|
|
>
|
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
|
return r;
}
static void set_order(Uint32 obj) {
// To avoid confusing order of execution at the wrong time,
// calling this function is limited to only certain times.
Object*o=objects[obj];
Uint8 ord=classes[o->class]->order;
Uint8 u;
Sint32 v0,v1;
Uint16 p;
Uint32 n=firstobj;
for(;;) {
if(n==obj || n==VOIDLINK) goto notfound;
u=classes[objects[n]->class]->order;
if(u<ord || !(objects[n]->oflags&OF_ORDERED)) goto found;
if(u==ord) {
p=orders[ord]+1;
criteria: switch(orders[p]) {
case OP_RET: goto found;
case OP_DENSITY: v0=o->density; v1=objects[n]->density; goto compare;
case OP_DENSITY_C: v1=o->density; v0=objects[n]->density; goto compare;
case OP_IMAGE: v0=o->image; v1=objects[n]->image; goto compare;
case OP_IMAGE_C: v1=o->image; v0=objects[n]->image; goto compare;
case OP_MISC1:
|
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
|
}
}
n=objects[n]->next;
}
found:
// Now it has been found; insert this object previous to the found object, removing from its existing slot.
// (Objects are executed in reverse order, so previous in the linked list means executed next)
if(firstobj==obj) firstobj=o->next;
if(lastobj==obj) lastobj=o->prev;
if(o->prev!=VOIDLINK) objects[o->prev]->next=o->next;
if(o->next!=VOIDLINK) objects[o->next]->prev=o->prev;
o->prev=objects[n]->prev;
o->next=n;
objects[n]->prev=obj;
if(o->prev==VOIDLINK) firstobj=obj;
if(objects[n]->next==VOIDLINK) lastobj=n;
notfound:
objects[obj]->oflags|=OF_ORDERED;
}
static Uint32 create(Uint32 from,Uint16 c,Uint32 x,Uint32 y,Uint32 im,Uint32 d) {
Uint32 m,n;
int i,xx,yy;
|
|
|
|
<
<
|
<
|
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
|
}
}
n=objects[n]->next;
}
found:
// Now it has been found; insert this object previous to the found object, removing from its existing slot.
// (Objects are executed in reverse order, so previous in the linked list means executed next)
if(o->prev==VOIDLINK) firstobj=o->next; else objects[o->prev]->next=o->next;
if(o->next==VOIDLINK) lastobj=o->prev; else objects[o->next]->prev=o->prev;
o->next=n;
o->prev=objects[n]->prev;
objects[n]->prev=obj;
if(o->prev==VOIDLINK) firstobj=obj; else objects[o->prev]->next=obj;
notfound:
objects[obj]->oflags|=OF_ORDERED;
}
static Uint32 create(Uint32 from,Uint16 c,Uint32 x,Uint32 y,Uint32 im,Uint32 d) {
Uint32 m,n;
int i,xx,yy;
|