mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
fixed_facing option, not only in racing
This commit is contained in:
parent
92d98847fb
commit
94ce1eb541
38
config.cpp
38
config.cpp
@ -175,6 +175,7 @@ void initConfig() {
|
||||
|
||||
addsaver(vid.ballangle, "ball angle", 20);
|
||||
addsaver(vid.yshift, "Y shift", 0);
|
||||
addsaver(vid.fixed_facing, "fixed facing", 0);
|
||||
addsaver(vid.camera_angle, "camera angle", 0);
|
||||
addsaver(vid.ballproj, "ballproj", 1);
|
||||
addsaver(vid.monmode, "monster display mode", DEFAULT_MONMODE);
|
||||
@ -1325,6 +1326,13 @@ void show3D() {
|
||||
dialog::addBreak(50);
|
||||
dialog::addSelItem(XLAT("Y shift"), fts3(vid.yshift), 'y');
|
||||
dialog::addSelItem(XLAT("camera rotation"), fts3(vid.camera_angle), 's');
|
||||
dialog::addSelItem(XLAT("fixed facing"), vid.fixed_facing ? fts(vid.fixed_facing_dir) : XLAT("OFF"), 'f');
|
||||
dialog::add_action([] () { vid.fixed_facing = !vid.fixed_facing;
|
||||
if(vid.fixed_facing) {
|
||||
dialog::editNumber(vid.fixed_facing_dir, 0, 360, 15, 90, "", "");
|
||||
dialog::dialogflags |= sm::CENTER;
|
||||
}
|
||||
});
|
||||
dialog::addBreak(50);
|
||||
dialog::addSelItem(XLAT("model used"), conformal::get_model_name(pmodel), 'M');
|
||||
|
||||
@ -1333,6 +1341,27 @@ void show3D() {
|
||||
dialog::addBoolItem(XLAT("3D monsters/walls on the surface"), rug::spatial_rug, 'S');
|
||||
dialog::add_action([] () { rug::spatial_rug = !rug::spatial_rug; });
|
||||
}
|
||||
dialog::addBoolItem(XLAT("configure TPP automatically"), pmodel == mdDisk && vid.camera_angle, 'T');
|
||||
dialog::add_action([] () {
|
||||
if(pmodel == mdDisk && vid.camera_angle) {
|
||||
vid.yshift = 0;
|
||||
vid.camera_angle = 0;
|
||||
vid.xposition = 0;
|
||||
vid.yposition = 0;
|
||||
vid.scale = 1;
|
||||
vid.fixed_facing = false;
|
||||
}
|
||||
else {
|
||||
vid.yshift = -0.3;
|
||||
vid.camera_angle = -45;
|
||||
vid.scale = 18/16. * vid.xres / vid.yres / multi::players;
|
||||
vid.xposition = 0;
|
||||
vid.yposition = -0.9;
|
||||
vid.fixed_facing = true;
|
||||
vid.fixed_facing_dir = 90;
|
||||
}
|
||||
});
|
||||
|
||||
if(rug::rugged && !rug::spatial_rug)
|
||||
dialog::addBreak(100);
|
||||
else if(non_spatial_model())
|
||||
@ -1811,6 +1840,15 @@ int read_config_args() {
|
||||
shift_arg_formula(vid.xposition);
|
||||
shift_arg_formula(vid.yposition);
|
||||
}
|
||||
else if(argis("-fixdir")) {
|
||||
PHASEFROM(2);
|
||||
vid.fixed_facing = true;
|
||||
shift_arg_formula(vid.fixed_facing_dir);
|
||||
}
|
||||
else if(argis("-fixdiroff")) {
|
||||
PHASEFROM(2);
|
||||
vid.fixed_facing = false;
|
||||
}
|
||||
else if(argis("-msmoff")) {
|
||||
PHASEFROM(2); memory_saving_mode = false;
|
||||
}
|
||||
|
3
hyper.h
3
hyper.h
@ -992,9 +992,10 @@ enum eStereo { sOFF, sAnaglyph, sLR, sODS };
|
||||
|
||||
struct videopar {
|
||||
ld scale, alpha, sspeed, mspeed, yshift, camera_angle;
|
||||
ld ballangle, ballproj, euclid_to_sphere, twopoint_param, stretch, binary_width;
|
||||
ld ballangle, ballproj, euclid_to_sphere, twopoint_param, stretch, binary_width, fixed_facing_dir;
|
||||
int mobilecompasssize;
|
||||
int aurastr, aurasmoothen;
|
||||
bool fixed_facing;
|
||||
|
||||
int linequality;
|
||||
|
||||
|
10
hypgraph.cpp
10
hypgraph.cpp
@ -981,6 +981,16 @@ void drawEuclidean() {
|
||||
}
|
||||
|
||||
void spinEdge(ld aspd) {
|
||||
|
||||
if(playerfound && vid.fixed_facing) {
|
||||
hyperpoint H = gpushxto0(playerV * C0) * playerV * xpush0(5);
|
||||
downspin = atan2(H[1], H[0]);
|
||||
downspin += vid.fixed_facing_dir * degree;
|
||||
if(flipplayer) downspin += M_PI;
|
||||
while(downspin < -M_PI) downspin += 2*M_PI;
|
||||
while(downspin > +M_PI) downspin -= 2*M_PI;
|
||||
aspd = (1 + 2 * abs(downspin)) * aspd;
|
||||
}
|
||||
if(downspin > aspd) downspin = aspd;
|
||||
if(downspin < -aspd) downspin = -aspd;
|
||||
View = spin(downspin) * View;
|
||||
|
Loading…
Reference in New Issue
Block a user