1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

Added idle animation option, fixed palace hypersian rugs using "ticks" instead of "pticks"

This commit is contained in:
Charlotte Peppers 2022-01-31 14:21:36 -07:00
parent f366e4fbad
commit 9a731572f6
No known key found for this signature in database
GPG Key ID: 999661E1478F22CF
3 changed files with 17 additions and 6 deletions

View File

@ -718,6 +718,7 @@ EX void initConfig() {
addsaver(fat_edges, "fat-edges"); addsaver(fat_edges, "fat-edges");
param_f(vid.sspeed, "sspeed", "scrollingspeed", 0); param_f(vid.sspeed, "sspeed", "scrollingspeed", 0);
param_f(vid.mspeed, "mspeed", "movement speed", 1); param_f(vid.mspeed, "mspeed", "movement speed", 1);
param_f(vid.ispeed, "ispeed", "idle speed", 1);
addsaver(vid.aurastr, "aura strength", ISMOBILE ? 0 : 128); addsaver(vid.aurastr, "aura strength", ISMOBILE ? 0 : 128);
addsaver(vid.aurasmoothen, "aura smoothen", 5); addsaver(vid.aurasmoothen, "aura smoothen", 5);
param_enum(vid.graphglyph, "graphglyph", "graphical items/kills", 1) param_enum(vid.graphglyph, "graphglyph", "graphical items/kills", 1)
@ -1649,6 +1650,14 @@ EX void showGraphConfig() {
dialog::addSelItem(XLAT("movement animation speed"), fts(vid.mspeed), 'm'); dialog::addSelItem(XLAT("movement animation speed"), fts(vid.mspeed), 'm');
dialog::addSelItem(XLAT("idle animation speed"), fts(vid.ispeed), 'i');
dialog::add_action([] {
dialog::editNumber(vid.ispeed, 0, 4, 0.1, 1,
XLAT("idle animation speed"),
"0 = disable\n\nThis affects non-movement animations such as orb effects, item rotation, and more."
);
});
dialog::addItem(XLAT("extra graphical effects"), 'u'); dialog::addItem(XLAT("extra graphical effects"), 'u');
dialog::addBreak(50); dialog::addBreak(50);

View File

@ -72,7 +72,7 @@ EX int animation_lcm = 0;
EX ld ptick(int period, ld phase IS(0)) { EX ld ptick(int period, ld phase IS(0)) {
if(animation_lcm) animation_lcm = animation_lcm * (period / gcd(animation_lcm, period)); if(animation_lcm) animation_lcm = animation_lcm * (period / gcd(animation_lcm, period));
return (ticks * animation_factor) / period + phase * 2 * M_PI; return (ticks * animation_factor * vid.ispeed) / period + phase * 2 * M_PI;
} }
EX ld fractick(int period, ld phase IS(0)) { EX ld fractick(int period, ld phase IS(0)) {
@ -816,8 +816,8 @@ EX bool drawItemType(eItem it, cell *c, const shiftmatrix& V, color_t icol, int
} }
#if CAP_SHAPES #if CAP_SHAPES
auto sinptick = [c, pticks] (int period) { return c ? sintick(period) : sin(animation_factor * pticks / period);}; auto sinptick = [c, pticks] (int period) { return c ? sintick(period) : sin(animation_factor * vid.ispeed * pticks / period);};
auto spinptick = [c, pticks] (int period, ld phase) { return c ? spintick(period, phase) : spin((animation_factor * pticks + phase) / period); }; auto spinptick = [c, pticks] (int period, ld phase) { return c ? spintick(period, phase) : spin((animation_factor * vid.ispeed * pticks + phase) / period); };
int ct6 = c ? ctof(c) : 1; int ct6 = c ? ctof(c) : 1;
hpcshape *xsh = hpcshape *xsh =
(it == itPirate || it == itKraken) ? &cgi.shPirateX : (it == itPirate || it == itKraken) ? &cgi.shPirateX :
@ -934,7 +934,7 @@ EX bool drawItemType(eItem it, cell *c, const shiftmatrix& V, color_t icol, int
if(GDIM == 3 && WDIM == 2) { if(GDIM == 3 && WDIM == 2) {
ld h = cgi.human_height; ld h = cgi.human_height;
dynamicval<qfloorinfo> qfi2(qfi, qfi); dynamicval<qfloorinfo> qfi2(qfi, qfi);
shiftmatrix V2 = V * spin(ticks / 1500.); shiftmatrix V2 = V * spin(pticks * vid.ispeed / 1500.);
/* divisors should be higher than in plate renderer */ /* divisors should be higher than in plate renderer */
qfi.fshape = &cgi.shMFloor2; qfi.fshape = &cgi.shMFloor2;
draw_shapevec(c, V2 * zpush(-h/30), qfi.fshape->levels[0], 0xFFD500FF, PPR::WALL); draw_shapevec(c, V2 * zpush(-h/30), qfi.fshape->levels[0], 0xFFD500FF, PPR::WALL);
@ -947,7 +947,7 @@ EX bool drawItemType(eItem it, cell *c, const shiftmatrix& V, color_t icol, int
} }
else if(WDIM == 3 && c) { else if(WDIM == 3 && c) {
ld h = cgi.human_height; ld h = cgi.human_height;
shiftmatrix V2 = Vit * spin(ticks / 1500.); shiftmatrix V2 = Vit * spin(pticks * vid.ispeed / 1500.);
draw_floorshape(c, V2 * zpush(h/100), cgi.shMFloor3, 0xFFD500FF); draw_floorshape(c, V2 * zpush(h/100), cgi.shMFloor3, 0xFFD500FF);
draw_floorshape(c, V2 * zpush(h/50), cgi.shMFloor4, darkena(icol, 0, 0xFF)); draw_floorshape(c, V2 * zpush(h/50), cgi.shMFloor4, darkena(icol, 0, 0xFF));
queuepoly(V2, cgi.shGem[ct6], 0xFFD500FF); queuepoly(V2, cgi.shGem[ct6], 0xFFD500FF);
@ -959,7 +959,7 @@ EX bool drawItemType(eItem it, cell *c, const shiftmatrix& V, color_t icol, int
#endif #endif
{ {
color_t hider = hidden ? 0xFFFFFF20 : 0xFFFFFFFF; color_t hider = hidden ? 0xFFFFFF20 : 0xFFFFFFFF;
shiftmatrix V2 = Vit * spin(ticks / 1500.); shiftmatrix V2 = Vit * spin(pticks * vid.ispeed / 1500.);
draw_floorshape(c, V2, cgi.shMFloor3, 0xFFD500FF & hider); draw_floorshape(c, V2, cgi.shMFloor3, 0xFFD500FF & hider);
draw_floorshape(c, V2, cgi.shMFloor4, darkena(icol, 0, 0xFF) & hider); draw_floorshape(c, V2, cgi.shMFloor4, darkena(icol, 0, 0xFF) & hider);
queuepoly(V2, cgi.shGem[ct6], 0xFFD500FF & hider); queuepoly(V2, cgi.shGem[ct6], 0xFFD500FF & hider);

View File

@ -416,6 +416,8 @@ struct videopar {
eThreatLevel faraway_highlight; // draw attention to monsters on the horizon eThreatLevel faraway_highlight; // draw attention to monsters on the horizon
int faraway_highlight_color; // 0 = monster color, 100 = red-green oscillation int faraway_highlight_color; // 0 = monster color, 100 = red-green oscillation
ld ispeed;
}; };
extern videopar vid; extern videopar vid;