mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-04-01 00:07:02 +00:00
reduced the number of bird animation frames
This commit is contained in:
parent
b9693553bf
commit
99aeb04185
@ -588,11 +588,11 @@ void geometry_information::clone_shape(hpcshape& sh, hpcshape& target) {
|
|||||||
target.e = isize(hpc);
|
target.e = isize(hpc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void geometry_information::animate_bird(hpcshape& orig, hpcshape animated[30], ld body) {
|
void geometry_information::animate_bird(hpcshape& orig, hpcshape_animated& animated, ld body) {
|
||||||
for(int i=0; i<=15; i++) {
|
for(int i=0; i<=WINGS; i++) {
|
||||||
auto& tgt = animated[i];
|
auto& tgt = animated[i];
|
||||||
clone_shape(orig, tgt);
|
clone_shape(orig, tgt);
|
||||||
ld alpha = cos(12 * degree * i) * 30 * degree;
|
ld alpha = cos(180. * degree * i / WINGS) * 30 * degree;
|
||||||
for(int i=tgt.s; i<tgt.e; i++) {
|
for(int i=tgt.s; i<tgt.e; i++) {
|
||||||
if(abs(hpc[i][1]) > body) {
|
if(abs(hpc[i][1]) > body) {
|
||||||
ld off = hpc[i][1] > 0 ? body : -body;
|
ld off = hpc[i][1] > 0 ? body : -body;
|
||||||
|
@ -1227,8 +1227,9 @@ void drawPlayer(eMonster m, cell *where, const transmatrix& V, color_t col, doub
|
|||||||
|
|
||||||
int wingphase(int period, int phase = 0) {
|
int wingphase(int period, int phase = 0) {
|
||||||
ld t = fractick(period, phase);
|
ld t = fractick(period, phase);
|
||||||
int ti = int(t * 30) % 30;
|
const int WINGS2 = WINGS * 2;
|
||||||
if(ti > 15) ti = 30 - ti;
|
int ti = int(t * WINGS2) % WINGS2;
|
||||||
|
if(ti > WINGS) ti = WINGS2 - ti;
|
||||||
return ti;
|
return ti;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
hyper.h
13
hyper.h
@ -4326,6 +4326,10 @@ void initShape(int sg, int id);
|
|||||||
|
|
||||||
extern int usershape_changes;
|
extern int usershape_changes;
|
||||||
|
|
||||||
|
static const int WINGS = 4;
|
||||||
|
|
||||||
|
typedef array<hpcshape, WINGS+1> hpcshape_animated;
|
||||||
|
|
||||||
struct geometry_information {
|
struct geometry_information {
|
||||||
|
|
||||||
/* basic geometry parameters */
|
/* basic geometry parameters */
|
||||||
@ -4463,10 +4467,11 @@ hpcshape
|
|||||||
|
|
||||||
shPBodyOnly, shPBodyArm, shPBodyHand, shPHeadOnly,
|
shPBodyOnly, shPBodyArm, shPBodyHand, shPHeadOnly,
|
||||||
|
|
||||||
shAnimatedEagle[16], shAnimatedTinyEagle[16], shAnimatedGadfly[16], shAnimatedHawk[16], shAnimatedButterfly[16],
|
|
||||||
shAnimatedGargoyle[16], shAnimatedGargoyle2[16], shAnimatedBat[16], shAnimatedBat2[16],
|
|
||||||
|
|
||||||
shDodeca;
|
shDodeca;
|
||||||
|
|
||||||
|
hpcshape_animated
|
||||||
|
shAnimatedEagle, shAnimatedTinyEagle, shAnimatedGadfly, shAnimatedHawk, shAnimatedButterfly,
|
||||||
|
shAnimatedGargoyle, shAnimatedGargoyle2, shAnimatedBat, shAnimatedBat2;
|
||||||
|
|
||||||
vector<hpcshape> shPlainWall3D, shWireframe3D, shWall3D, shMiniWall3D;
|
vector<hpcshape> shPlainWall3D, shWireframe3D, shWall3D, shMiniWall3D;
|
||||||
|
|
||||||
@ -4574,7 +4579,7 @@ hpcshape
|
|||||||
void make_revolution(hpcshape& sh, int mx = 180, ld push = 0);
|
void make_revolution(hpcshape& sh, int mx = 180, ld push = 0);
|
||||||
void make_revolution_cut(hpcshape &sh, int each = 180, ld push = 0, ld width = 99);
|
void make_revolution_cut(hpcshape &sh, int each = 180, ld push = 0, ld width = 99);
|
||||||
void clone_shape(hpcshape& sh, hpcshape& target);
|
void clone_shape(hpcshape& sh, hpcshape& target);
|
||||||
void animate_bird(hpcshape& orig, hpcshape animated[16], ld body);
|
void animate_bird(hpcshape& orig, hpcshape_animated& animated, ld body);
|
||||||
void slimetriangle(hyperpoint a, hyperpoint b, hyperpoint c, ld rad, int lev);
|
void slimetriangle(hyperpoint a, hyperpoint b, hyperpoint c, ld rad, int lev);
|
||||||
void balltriangle(hyperpoint a, hyperpoint b, hyperpoint c, ld rad, int lev);
|
void balltriangle(hyperpoint a, hyperpoint b, hyperpoint c, ld rad, int lev);
|
||||||
void make_ball(hpcshape& sh, ld rad, int lev);
|
void make_ball(hpcshape& sh, ld rad, int lev);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user