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:
parent
f366e4fbad
commit
9a731572f6
@ -718,6 +718,7 @@ EX void initConfig() {
|
||||
addsaver(fat_edges, "fat-edges");
|
||||
param_f(vid.sspeed, "sspeed", "scrollingspeed", 0);
|
||||
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.aurasmoothen, "aura smoothen", 5);
|
||||
param_enum(vid.graphglyph, "graphglyph", "graphical items/kills", 1)
|
||||
@ -1648,6 +1649,14 @@ EX void showGraphConfig() {
|
||||
});
|
||||
|
||||
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');
|
||||
|
||||
|
12
graph.cpp
12
graph.cpp
@ -72,7 +72,7 @@ EX int animation_lcm = 0;
|
||||
|
||||
EX ld ptick(int period, ld phase IS(0)) {
|
||||
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)) {
|
||||
@ -816,8 +816,8 @@ EX bool drawItemType(eItem it, cell *c, const shiftmatrix& V, color_t icol, int
|
||||
}
|
||||
|
||||
#if CAP_SHAPES
|
||||
auto sinptick = [c, pticks] (int period) { return c ? sintick(period) : sin(animation_factor * pticks / period);};
|
||||
auto spinptick = [c, pticks] (int period, ld phase) { return c ? spintick(period, phase) : spin((animation_factor * pticks + phase) / 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 * vid.ispeed * pticks + phase) / period); };
|
||||
int ct6 = c ? ctof(c) : 1;
|
||||
hpcshape *xsh =
|
||||
(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) {
|
||||
ld h = cgi.human_height;
|
||||
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 */
|
||||
qfi.fshape = &cgi.shMFloor2;
|
||||
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) {
|
||||
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/50), cgi.shMFloor4, darkena(icol, 0, 0xFF));
|
||||
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
|
||||
{
|
||||
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.shMFloor4, darkena(icol, 0, 0xFF) & hider);
|
||||
queuepoly(V2, cgi.shGem[ct6], 0xFFD500FF & hider);
|
||||
|
Loading…
Reference in New Issue
Block a user