1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-04 11:37:55 +00:00

removed unused shTentacleX and shTentacle; shIBranch can now be dependant on the edge length

This commit is contained in:
Zeno Rogue
2025-08-18 14:48:00 +02:00
parent 67b4af049b
commit 6540c29cbe
4 changed files with 36 additions and 23 deletions

View File

@@ -896,7 +896,7 @@ void geometry_information::make_3d_models() {
&shEagle, &shFemaleBody, &shFlailMissile, &shGadflyWing, &shGargoyleWings, &shHawk, &shJiangShi, &shKnife, &shEagle, &shFemaleBody, &shFlailMissile, &shGadflyWing, &shGargoyleWings, &shHawk, &shJiangShi, &shKnife,
&shPBody, &shPHead, &shRaiderBody, &shReptileBody, &shSkeletonBody, &shTongue, &shTrapArrow, &shTrylobite, &shPBody, &shPHead, &shRaiderBody, &shReptileBody, &shSkeletonBody, &shTongue, &shTrapArrow, &shTrylobite,
&shWaterElemental, &shWolfBody, &shYeti, &shWormHead, &shWormHead, &shDragonHead, &shDragonSegment, &shDragonTail, &shWaterElemental, &shWolfBody, &shYeti, &shWormHead, &shWormHead, &shDragonHead, &shDragonSegment, &shDragonTail,
&shTentacleX, &shTentHead, &shILeaf[0], &shILeaf[1], &shWormSegment, &shSmallWormSegment, &shTentHead, &shILeaf[0], &shILeaf[1], &shWormSegment, &shSmallWormSegment,
&shWormTail, &shSmallWormTail, &shFrogBody }) &shWormTail, &shSmallWormTail, &shFrogBody })
make_shadow(*sh); make_shadow(*sh);

View File

@@ -167,6 +167,10 @@ enum class ePipeEnd {sharp, ball};
struct embedding_method; struct embedding_method;
struct length_adjusted_shapes {
hpcshape shIBranch;
};
/** basic geometry parameters */ /** basic geometry parameters */
struct geometry_information { struct geometry_information {
@@ -293,7 +297,7 @@ hpcshape
shFigurine, shTreat, shSmallTreat, shFigurine, shTreat, shSmallTreat,
shElementalShard, shElementalShard,
// shBranch, // shBranch,
shIBranch, shTentacle, shTentacleX, shILeaf[3], shILeaf[3],
shMovestar, shMovestar,
shWolf, shYeti, shDemon, shGDemon, shEagle, shGargoyleWings, shGargoyleBody, shWolf, shYeti, shDemon, shGDemon, shEagle, shGargoyleWings, shGargoyleBody,
shFoxTail1, shFoxTail2, shFoxTail1, shFoxTail2,
@@ -395,6 +399,9 @@ hpcshape
map<int, hpcshape> shPipe; map<int, hpcshape> shPipe;
length_adjusted_shapes lash_default;
map<int, length_adjusted_shapes> lash;
vector<hpcshape> shPlainWall3D, shWireframe3D, shWall3D, shMiniWall3D; vector<hpcshape> shPlainWall3D, shWireframe3D, shWall3D, shMiniWall3D;
vector<hyperpoint> walltester; vector<hyperpoint> walltester;
@@ -483,9 +490,11 @@ hpcshape
void initPolyForGL(); void initPolyForGL();
void extra_vertices(); void extra_vertices();
transmatrix ddi(int a, ld x); transmatrix ddi(int a, ld x);
void drawTentacle(hpcshape &h, ld rad, ld var, ld divby); void drawTentacle(ld rad, ld var, ld divby, ld tlength);
hyperpoint hpxyzsc(double x, double y, double z); hyperpoint hpxyzsc(double x, double y, double z);
hyperpoint turtlevertex(int u, double x, double y, double z); hyperpoint turtlevertex(int u, double x, double y, double z);
length_adjusted_shapes& get_lash(ld len);
void bshape(hpcshape& sh, PPR prio); void bshape(hpcshape& sh, PPR prio);
void finishshape(); void finishshape();

View File

@@ -1355,7 +1355,7 @@ EX bool drawMonsterType(eMonster m, cell *where, const shiftmatrix& V1, color_t
} }
else if(isMagneticPole(m)) { else if(isMagneticPole(m)) {
if(m == moNorthPole) if(m == moNorthPole)
queuepolyat(VBODY * spin180(), cgi.shTentacle, 0x000000C0, PPR::TENTACLE1); queuepolyat(VBODY * spin180(), cgi.lash_default.shIBranch, 0x000000C0, PPR::TENTACLE1);
queuepolyat(VBODY, cgi.shDisk, darkena(col, 0, 0xFF), PPR::MONSTER_BODY); queuepolyat(VBODY, cgi.shDisk, darkena(col, 0, 0xFF), PPR::MONSTER_BODY);
} }
else if(isMetalBeast(m) || m == moBrownBug) { else if(isMetalBeast(m) || m == moBrownBug) {
@@ -1555,7 +1555,8 @@ EX bool drawMonster(const shiftmatrix& Vparam, int ct, cell *c, color_t col, col
return false; return false;
if(isIvy(c) || isMutantIvy(c) || c->monst == moFriendlyIvy) { if(isIvy(c) || isMutantIvy(c) || c->monst == moFriendlyIvy) {
queuepoly(Vb, cgi.shIBranch, (col << 8) + 0xFF); auto& lash = (geometry == gNormal && BITRUNCATED) ? cgi.lash_default : cgi.get_lash(hdist0(currentmap->adj(c, c->mondir) * C0));
queuepoly(Vb, lash.shIBranch, (col << 8) + 0xFF);
christmas_lights(c, Vb); christmas_lights(c, Vb);
} }
@@ -1574,11 +1575,6 @@ EX bool drawMonster(const shiftmatrix& Vparam, int ct, cell *c, color_t col, col
drawMonsterType(moGhost, c, Vs, col, footphase, asciicol); drawMonsterType(moGhost, c, Vs, col, footphase, asciicol);
col = minf[moTentacletail].color; col = minf[moTentacletail].color;
} }
/*
queuepoly(at_smart_lof(Vb, cgi.ABODY), cgi.shTentacleX, 0xFFFFFFFF);
queuepoly(at_smart_lof(Vb, cgi.ABODY), cgi.shTentacle, (col << 8) + 0xFF);
ShadowV(Vb, cgi.shTentacleX, PPR::GIANTSHADOW);
*/
bool hexsnake = c->monst == moHexSnake || c->monst == moHexSnakeTail; bool hexsnake = c->monst == moHexSnake || c->monst == moHexSnakeTail;
bool thead = c->monst == moTentacle || c->monst == moTentaclewait || c->monst == moTentacleEscaping; bool thead = c->monst == moTentacle || c->monst == moTentaclewait || c->monst == moTentacleEscaping;
hpcshape& sh = hexsnake ? cgi.shWormSegment : cgi.shSmallWormSegment; hpcshape& sh = hexsnake ? cgi.shWormSegment : cgi.shSmallWormSegment;

View File

@@ -156,13 +156,7 @@ void geometry_information::extra_vertices() {
transmatrix geometry_information::ddi(int a, ld x) { return xspinpush(a * S_step, x); } transmatrix geometry_information::ddi(int a, ld x) { return xspinpush(a * S_step, x); }
void geometry_information::drawTentacle(hpcshape &h, ld rad, ld var, ld divby) { void geometry_information::drawTentacle(ld rad, ld var, ld divby, ld tlength) {
double tlength = max(crossf, hexhexdist);
if(geometry == gBinaryTiling) tlength *= 0.7;
if(geometry == gBinary4) tlength *= 0.45;
#if CAP_ARCM
if(arcm::in()) tlength = arcm::current.scale();
#endif
int max = int(20 * pow(2, vid.linequality)); int max = int(20 * pow(2, vid.linequality));
for(ld i=0; i<=max; i++) for(ld i=0; i<=max; i++)
hpcpush(ddi(S21, rad + var * sin(i * M_PI/divby)) * ddi(0, tlength * i/max) * C0); hpcpush(ddi(S21, rad + var * sin(i * M_PI/divby)) * ddi(0, tlength * i/max) * C0);
@@ -1167,6 +1161,17 @@ void geometry_information::configure_floorshapes() {
for(int i=0; i<3; i++) shRedRockFloor[i].scale = .9 - .1 * i; for(int i=0; i<3; i++) shRedRockFloor[i].scale = .9 - .1 * i;
} }
length_adjusted_shapes& geometry_information::get_lash(ld len) {
int id = int(len * 100 + .5);
if(lash.count(id)) return lash[id];
auto& res = lash[id];
bshape(res.shIBranch, PPR::TENTACLE1);
drawTentacle(crossf * .1, crossf * .2, 5, len);
finishshape();
extra_vertices();
return res;
}
void geometry_information::prepare_shapes() { void geometry_information::prepare_shapes() {
require_basics(); require_basics();
if(cgflags & qRAYONLY) return; if(cgflags & qRAYONLY) return;
@@ -1343,12 +1348,15 @@ void geometry_information::prepare_shapes() {
wormscale = WDIM == 3 ? 3 : 1; wormscale = WDIM == 3 ? 3 : 1;
// first layer monsters // first layer monsters
bshape(shTentacleX, PPR::TENTACLE0); bshape(lash_default.shIBranch, PPR::TENTACLE1);
drawTentacle(shTentacleX, crossf * .25, crossf * .1, 10); double tlength = max(crossf, hexhexdist);
bshape(shIBranch, PPR::TENTACLE1); if(geometry == gBinaryTiling) tlength *= 0.7;
drawTentacle(shIBranch, crossf * .1, crossf * .2, 5); if(geometry == gBinary4) tlength *= 0.45;
bshape(shTentacle, PPR::TENTACLE1); #if CAP_ARCM
drawTentacle(shTentacle, crossf * .2, crossf * .1, 10); if(arcm::in()) tlength = arcm::current.scale();
#endif
drawTentacle(crossf * .1, crossf * .2, 5, tlength);
copyshape(shJoint, shDisk, PPR::ONTENTACLE); copyshape(shJoint, shDisk, PPR::ONTENTACLE);
bshape(shTentHead, PPR::ONTENTACLE, scalefactor * wormscale, 79); bshape(shTentHead, PPR::ONTENTACLE, scalefactor * wormscale, 79);
bshape(shWormHead, PPR::ONTENTACLE, scalefactor * wormscale, 80); bshape(shWormHead, PPR::ONTENTACLE, scalefactor * wormscale, 80);