ref: afa5c513017b1d6dccd1dbee33fa79d110d4b19a
parent: f4fc7ec0a6cfa2b6a0db00f8d34f2f7d0471cd60
author: qwx <[email protected]>
date: Mon Nov 22 19:17:43 EST 2021
sim: rudimentary gather animations (idle ones) there actually sort of is an idle or waiting state between transitions, and either way the drawing is independent/concurrent, something better is needed
--- a/dat.h
+++ b/dat.h
@@ -126,6 +126,7 @@
enum{
PFidle = OSidle,
PFmove = OSmove,
+ PFgather = OSgather,
PFrich = OSrich,
PFmed = OSmed,
PFlow = OSlow,
--- a/drw.c
+++ b/drw.c
@@ -322,6 +322,8 @@
Pic *p;
n = mo->state;
+ if(n == OSskymaybe)
+ n = OSidle;
if(n < 0 || n > OSend){
dprint("frm: %M invalid animation frame %d\n", mo, n);
return nil;
--- a/fns.h
+++ b/fns.h
@@ -14,6 +14,7 @@
int pushmove(Mobj*);
int pushmovecommand(Point, Mobj*, Mobj*);
void resourcestate(Mobj*);
+void freezefrm(Mobj*, int);
void idlestate(Mobj*);
Mobj* derefmobj(int, long);
void nextstate(Mobj*);
--- a/sce/sce.db
+++ b/sce/sce.db
@@ -28,6 +28,8 @@
spr,scv,0x0001,17,0
spr,scv,0xc001,17,0
spr,scv,0x6001,17,0,1,2,3
+spr,scv,0x0002,17,0
+spr,scv,0xc002,17,0
spr,control,0x0000,1,0
spr,control,0xc000,1,0
spr,drone,0x0800,17,0,1,2,3,4
@@ -34,6 +36,8 @@
spr,drone,0xc800,17,0,1,2,3,4
spr,drone,0x0001,17,0,1,2,3,4
spr,drone,0xc001,17,0,1,2,3,4
+spr,drone,0x0802,17,0,1,2,3,4
+spr,drone,0xc802,17,0,1,2,3,4
spr,hatchery,0x0000,1,0,1,2,3,3,2,1,0
spr,hatchery,0xc000,1,0,0,0,0,0,0,0,0
spr,mutalisk,0x0000,17,0,1,2,3,4
--- a/sim.c
+++ b/sim.c
@@ -74,7 +74,8 @@
c->cleanupfn(mo);
if(c->nextfn != nil){
c->initfn = c->nextfn;
- mo->state = OSskymaybe;
+ freezefrm(mo, mo->state);
+ mo->state = OSskymaybe; /* FIXME: kind of overloading this just for drw.c */
}else
popcommand(mo);
}
--- a/sim.idle.c
+++ b/sim.idle.c
@@ -4,7 +4,7 @@
#include "dat.h"
#include "fns.h"
-static void
+void
freezefrm(Mobj *mo, int oldstate)
{
Pics *old, *new;