mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-09-24 12:01:40 +00:00
Merge branch 'master' into hooks-naming
This commit is contained in:
@@ -395,15 +395,15 @@ void bantar_frame() {
|
||||
map<int, map<int, vector<unique_ptr<drawqueueitem>>>> xptds;
|
||||
for(int i=0; i<4; i++) for(auto& p: subscr[i])
|
||||
xptds[int(p->prio)][i].push_back(move(p));
|
||||
|
||||
|
||||
for(auto& sm: xptds) for(auto& sm2: sm.second) {
|
||||
int i = sm2.first;
|
||||
ptds.clear();
|
||||
for(auto& p: sm2.second) ptds.push_back(move(p));
|
||||
|
||||
vid.scale = .5;
|
||||
vid.xposition = (!(i&2)) ? xdst : -xdst;
|
||||
vid.yposition = (!(i&1)) ? ydst : -ydst;
|
||||
pconf.scale = .5;
|
||||
pconf.xposition = (!(i&2)) ? xdst : -xdst;
|
||||
pconf.yposition = (!(i&1)) ? ydst : -ydst;
|
||||
calcparam();
|
||||
drawqueue();
|
||||
}
|
||||
@@ -436,8 +436,8 @@ void bantar_anim() {
|
||||
breakanim = true;
|
||||
}
|
||||
mapeditor::drawplayer = true;
|
||||
vid.xposition = vid.yposition = 0;
|
||||
vid.scale = 1;
|
||||
pconf.xposition = pconf.yposition = 0;
|
||||
pconf.scale = 1;
|
||||
}
|
||||
|
||||
bool bmap;
|
||||
|
||||
@@ -145,7 +145,7 @@ void collatz_video(const string &fname) {
|
||||
if(vizid == &collatz_id) {
|
||||
sightrange_bonus = 3;
|
||||
genrange_bonus = 3;
|
||||
dronemode = true; vid.camera_angle = -45; rog3 = true; patterns::whichShape = '8';
|
||||
dronemode = true; pconf.camera_angle = -45; rog3 = true; patterns::whichShape = '8';
|
||||
vid.aurastr = 512;
|
||||
|
||||
collatz::lookup(763, 60);
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace flocking {
|
||||
for(int i=0; i<isize(cl.lst); i++) {
|
||||
cell *c2 = cl.lst[i];
|
||||
transmatrix T = calc_relative_matrix(c2, c1, C0);
|
||||
if(hypot_d(WDIM, inverse_exp(tC0(T), iTable, false)) <= check_range) {
|
||||
if(hypot_d(WDIM, inverse_exp(tC0(T))) <= check_range) {
|
||||
relmatrices[c1][c2] = T;
|
||||
forCellEx(c3, c2) cl.add(c3);
|
||||
}
|
||||
@@ -198,7 +198,7 @@ namespace flocking {
|
||||
// at2 is like m2->at but relative to m->at
|
||||
|
||||
// m2's position relative to m (tC0 means *(0,0,1))
|
||||
hyperpoint ac = inverse_exp(tC0(at2), iTable, false);
|
||||
hyperpoint ac = inverse_exp(tC0(at2));
|
||||
if(use_rot) ac = Rot * ac;
|
||||
|
||||
// distance and azimuth to m2
|
||||
|
||||
+4
-1
@@ -2,6 +2,8 @@
|
||||
|
||||
#include "../hyper.h"
|
||||
|
||||
#if !ISWEB
|
||||
|
||||
namespace hr {
|
||||
|
||||
eGeometry gJanko1(eGeometry(-1));
|
||||
@@ -27,7 +29,7 @@ struct jmatrix : array<array<int, 7>, 7> {
|
||||
};
|
||||
|
||||
vector<jmatrix> jms;
|
||||
unordered_map<jmatrix, int> ids;
|
||||
std::unordered_map<jmatrix, int> ids;
|
||||
|
||||
jmatrix J, Z, id;
|
||||
|
||||
@@ -142,3 +144,4 @@ auto shot_hooks = addHook(hooks_args, 100, [] {
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -638,11 +638,11 @@ void draw_ncee() {
|
||||
nctinf2.tvertices.clear();
|
||||
|
||||
ld map_ypos = vid.yres * (mapping_split + 1) / 2 - cd->ycenter;
|
||||
ld sca2 = (vid.yres * (1-mapping_split) / 2 - 10) / vid.scale;
|
||||
ld sca2 = (vid.yres * (1-mapping_split) / 2 - 10) / pconf.scale;
|
||||
|
||||
if(show_mapping) {
|
||||
for(int iter=-10; iter<=10; iter++) {
|
||||
ld maxx = period * vid.scale / 4;
|
||||
ld maxx = period * pconf.scale / 4;
|
||||
ld scax = sca2 * maxx / 0.5;
|
||||
ld xpos = scax * 2 * iter;
|
||||
curvepoint(hpxy(xpos-scax, map_ypos-sca2));
|
||||
@@ -714,7 +714,7 @@ void draw_ncee() {
|
||||
z = !z;
|
||||
for(int s=0; s<3; s++) {
|
||||
curvepoint(hc(c[s].x, c[s].y));
|
||||
nctinf.tvertices.push_back(glhr::makevertex((vx[c[s].y][c[s].x]/cscale-delta)*vid.scale/2+.5, vy[c[s].y][c[s].x]*vid.scale/2+.5, 0));
|
||||
nctinf.tvertices.push_back(glhr::makevertex((vx[c[s].y][c[s].x]/cscale-delta)*pconf.scale/2+.5, vy[c[s].y][c[s].x]*pconf.scale/2+.5, 0));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -800,7 +800,7 @@ void prepare_ncee_map() {
|
||||
dynamicval<int> cgl(vid.cells_generated_limit, 9999999);
|
||||
dynamicval<bool> r(rug::display_warning, false);
|
||||
// vid.consider_shader_projection = false;
|
||||
vid.scale = 0.5;
|
||||
pconf.scale = 0.5;
|
||||
rug::init();
|
||||
rug::prepareTexture();
|
||||
rug::rugged = false;
|
||||
|
||||
@@ -34,7 +34,7 @@ array<hyperpoint, 3> mts;
|
||||
|
||||
rug::rugpoint *pt(hyperpoint h, hyperpoint c, int id) {
|
||||
auto r = rug::addRugpoint(C0, -1);
|
||||
r->flat = h;
|
||||
r->native = h;
|
||||
r->x1 = (1 + c[0]) / 16 + (id/8) / 8.;
|
||||
r->y1 = (1 + c[1]) / 16 + (id%8) / 8.;
|
||||
r->valid = true;
|
||||
@@ -190,7 +190,7 @@ void run_snub(int v, int w) {
|
||||
create_model();
|
||||
printf("points = %d tris = %d side = %d\n", isize(rug::points), isize(rug::triangles), isize(sideangles));
|
||||
rug::model_distance = euclid ? 4 : 2;
|
||||
rug::rug_perspective = hyperbolic;
|
||||
vid.rug_config.model = hyperbolic ? mdPerspective : mdEquidistant;
|
||||
showstartmenu = false;
|
||||
snubon = true;
|
||||
rug::invert_depth = hyperbolic;
|
||||
|
||||
@@ -30,7 +30,7 @@ hyperpoint spcoord(hyperpoint h) {
|
||||
|
||||
rug::rugpoint *pt(hyperpoint h, hyperpoint c) {
|
||||
auto r = rug::addRugpoint(C0, -1);
|
||||
r->flat = spcoord(h);
|
||||
r->native = spcoord(h);
|
||||
r->x1 = c[0];
|
||||
r->y1 = c[1];
|
||||
r->valid = true;
|
||||
@@ -120,17 +120,17 @@ void make_staircase() {
|
||||
|
||||
println(hlog, "scurvature = ", scurvature, " progress = ", progress, " strafe=", strafex, ",", strafey);
|
||||
rug::renderonce = true;
|
||||
rug::rug_perspective = true;
|
||||
vid.rug_config.model = mdPerspective;
|
||||
if(scurvature > -1e-6 && scurvature < 1e-6) {
|
||||
rug::gwhere = gEuclid;
|
||||
rug::gwhere = rug::rgEuclid;
|
||||
acurvature = 1;
|
||||
}
|
||||
else if(scurvature < 0) {
|
||||
rug::gwhere = gNormal;
|
||||
rug::gwhere = rug::rgHyperbolic;
|
||||
acurvature = -scurvature;
|
||||
}
|
||||
else {
|
||||
rug::gwhere = gSphere;
|
||||
rug::gwhere = rug::rgSphere;
|
||||
acurvature = scurvature;
|
||||
}
|
||||
rug::ruggospeed = acurvature;
|
||||
|
||||
@@ -87,13 +87,9 @@ bool sunflower_cell(cell *c, transmatrix V) {
|
||||
|
||||
if(adjust_rug) {
|
||||
using namespace rug;
|
||||
if(rug_perspective)
|
||||
push_all_points(2, +model_distance);
|
||||
|
||||
model_distance = sqrt(zdensity) * distance_per_rug;
|
||||
|
||||
if(rug_perspective)
|
||||
push_all_points(2, -model_distance);
|
||||
}
|
||||
|
||||
iqty = qty;
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ int readArgs() {
|
||||
|
||||
if(0) ;
|
||||
|
||||
else if(argis("-tol")) {
|
||||
else if(argis("-tree")) {
|
||||
PHASE(3); shift(); tree::read(args());
|
||||
}
|
||||
|
||||
|
||||
@@ -111,9 +111,9 @@ struct trianglemaker {
|
||||
|
||||
// println(hlog, "uds = ", uds);
|
||||
|
||||
for(int a=0; a<3; a++) println(hlog, sqhypot_d(3, inverse_exp(start + ds[a] * ca, iTable, false)));
|
||||
for(int a=0; a<3; a++) println(hlog, sqhypot_d(3, inverse_exp(start + ds[a] * ca)));
|
||||
|
||||
for(int a=0; a<3; a++) println(hlog, sqhypot_d(3, inverse_exp(uds[a], iTable, false)));
|
||||
for(int a=0; a<3; a++) println(hlog, sqhypot_d(3, inverse_exp(uds[a])));
|
||||
|
||||
// compute cube vertices
|
||||
|
||||
|
||||
Reference in New Issue
Block a user