mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
halved animatedbird space usage
This commit is contained in:
parent
9a1858e2f9
commit
488c25ecea
@ -589,10 +589,10 @@ void geometry_information::clone_shape(hpcshape& sh, hpcshape& target) {
|
||||
}
|
||||
|
||||
void geometry_information::animate_bird(hpcshape& orig, hpcshape animated[30], ld body) {
|
||||
for(int i=0; i<30; i++) {
|
||||
for(int i=0; i<=15; i++) {
|
||||
auto& tgt = animated[i];
|
||||
clone_shape(orig, tgt);
|
||||
ld alpha = sin(12 * degree * i) * 30 * degree;
|
||||
ld alpha = cos(12 * degree * i) * 30 * degree;
|
||||
for(int i=tgt.s; i<tgt.e; i++) {
|
||||
if(abs(hpc[i][1]) > body) {
|
||||
ld off = hpc[i][1] > 0 ? body : -body;
|
||||
@ -990,6 +990,7 @@ void geometry_information::make_3d_models() {
|
||||
make_revolution_cut(shButterflyWing, 180, 0, 0.05*S);
|
||||
finishshape();
|
||||
|
||||
DEBB(DF_POLY, ("animatebirds"));
|
||||
animate_bird(shEagle, shAnimatedEagle, 0.05*S);
|
||||
animate_bird(shTinyBird, shAnimatedTinyEagle, 0.05*S/2);
|
||||
|
||||
@ -1001,6 +1002,8 @@ void geometry_information::make_3d_models() {
|
||||
animate_bird(shBatWings, shAnimatedBat, 0.05*S);
|
||||
animate_bird(shBatBody, shAnimatedBat2, 0.05*S);
|
||||
|
||||
DEBB(DF_POLY, ("disablers"));
|
||||
|
||||
disable(shWolfRearLeg);
|
||||
disable(shWolfFrontLeg);
|
||||
disable(shDogRearLeg);
|
||||
|
@ -1227,7 +1227,9 @@ void drawPlayer(eMonster m, cell *where, const transmatrix& V, color_t col, doub
|
||||
|
||||
int wingphase(int period, int phase = 0) {
|
||||
ld t = fractick(period, phase);
|
||||
return int(t * 30) % 30;
|
||||
int ti = int(t * 30) % 30;
|
||||
if(ti > 15) ti = 30 - ti;
|
||||
return ti;
|
||||
}
|
||||
|
||||
transmatrix wingmatrix(int period, int phase = 0) {
|
||||
|
6
hyper.h
6
hyper.h
@ -4463,8 +4463,8 @@ hpcshape
|
||||
|
||||
shPBodyOnly, shPBodyArm, shPBodyHand, shPHeadOnly,
|
||||
|
||||
shAnimatedEagle[30], shAnimatedTinyEagle[30], shAnimatedGadfly[30], shAnimatedHawk[30], shAnimatedButterfly[30],
|
||||
shAnimatedGargoyle[30], shAnimatedGargoyle2[30], shAnimatedBat[30], shAnimatedBat2[30],
|
||||
shAnimatedEagle[16], shAnimatedTinyEagle[16], shAnimatedGadfly[16], shAnimatedHawk[16], shAnimatedButterfly[16],
|
||||
shAnimatedGargoyle[16], shAnimatedGargoyle2[16], shAnimatedBat[16], shAnimatedBat2[16],
|
||||
|
||||
shDodeca;
|
||||
|
||||
@ -4574,7 +4574,7 @@ hpcshape
|
||||
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 clone_shape(hpcshape& sh, hpcshape& target);
|
||||
void animate_bird(hpcshape& orig, hpcshape animated[30], ld body);
|
||||
void animate_bird(hpcshape& orig, hpcshape animated[16], ld body);
|
||||
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 make_ball(hpcshape& sh, ld rad, int lev);
|
||||
|
Loading…
Reference in New Issue
Block a user