From 21a18d7968d4d44f1f15ed5d33e314653d2342b1 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 2 Dec 2017 00:23:15 +0100 Subject: [PATCH] partial disabling of CAP_POLY; new hook; aurac is std::array --- graph.cpp | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 5 deletions(-) diff --git a/graph.cpp b/graph.cpp index 80b97627..1ad539e6 100644 --- a/graph.cpp +++ b/graph.cpp @@ -129,6 +129,7 @@ void drawLightning() { lightat = ticks; } void drawSafety() { safetyat = ticks; } void drawShield(const transmatrix& V, eItem it) { +#if CAP_CURVE float ds = ticks / 300.; int col = iinf[it].color; if(it == itOrbShield && items[itOrbTime] && !orbused[it]) @@ -140,9 +141,11 @@ void drawShield(const transmatrix& V, eItem it) { for(int a=0; a<=S84*mt; a++) curvepoint(V*ddi0(a, d + sin(ds + M_PI*2*a/4/mt)*.1)); queuecurve(darkena(col, 0, 0xFF), 0x8080808, PPR_LINE); +#endif } void drawSpeed(const transmatrix& V) { +#if CAP_CURVE ld ds = ticks / 10.; int col = darkena(iinf[itOrbSpeed].color, 0, 0xFF); for(int b=0; bswordangle), (peace::on ? shMagicShovel : shMagicSword), darkena(iinf[itOrbSword].color, 0, 0xC0 + 0x30 * sin(ticks / 200.0))); if(items[itOrbSword2]) queuepoly(V*spin(esh+shmup::pc[multi::cpid]->swordangle+M_PI), (peace::on ? shMagicShovel : shMagicSword), darkena(iinf[itOrbSword2].color, 0, 0xC0 + 0x30 * sin(ticks / 200.0))); +#endif } else { @@ -271,6 +287,7 @@ void drawPlayerEffects(const transmatrix& V, cell *c, bool onplayer) { transmatrix Vnow = gmatrix[c] * rgpushxto0(inverse(gmatrix[c]) * tC0(V)) * spin(-hexshiftat(c)); +#if CAP_QUEUE if(!euclid) for(int a=0; a= 1 && i <= 7) if(b) { d = darkena(col, 1, 0xFF); b = 0; } if(i >= 8 && i <= 11 && stuntime >= 3) continue; - + queuepoly(V, shTortoise[i][b+small], d); if((i >= 5 && i <= 7) || (i >= 9 && i <= 10)) queuepoly(V * Mirror, shTortoise[i][b+small], d); @@ -358,6 +381,7 @@ namespace tortoise { queuepoly(V * Mirror, shTortoise[12][b+small], darkena(eyecolor, 0, 0xFF)); } } +#endif } int getMatchColor(int bits) { @@ -384,6 +408,7 @@ double footfun(double d) { bool ivoryz; void animallegs(const transmatrix& V, eMonster mo, int col, double footphase) { +#if CAP_POLY footphase /= SCALE; bool dog = mo == moRunDog; @@ -421,20 +446,25 @@ void animallegs(const transmatrix& V, eMonster mo, int col, double footphase) { if(x[2]) queuepolyat(VAML * Mirror * xpush(leftfoot/2), *x[2], col, PPR_MONSTER_FOOT); if(x[3]) queuepolyat(VAML * xpush(-rightfoot/2), *x[3], col, PPR_MONSTER_FOOT); if(x[3]) queuepolyat(VAML * Mirror * xpush(-leftfoot/2), *x[3], col, PPR_MONSTER_FOOT); +#endif } void ShadowV(const transmatrix& V, const hpcshape& bp, int prio) { +#if CAP_POLY if(mmspatial) { if(pmodel == mdHyperboloid || pmodel == mdBall) return; // shadows break the depth testing dynamicval p(poly_outline, OUTLINE_TRANS); queuepolyat(V, bp, SHADOW_MON, prio); } +#endif } void otherbodyparts(const transmatrix& V, int col, eMonster who, double footphase) { +#if CAP_POLY + #define VFOOT V #define VLEG mmscale(V, geom3::LEG) #define VGROIN mmscale(V, geom3::GROIN) @@ -507,6 +537,7 @@ void otherbodyparts(const transmatrix& V, int col, eMonster who, double footphas queuepoly(mmscale(V, geom3::GROIN1), shHumanGroin, col); if(who != moZombie) queuepoly(mmscale(V, geom3::NECK3), shHumanNeck, col); } +#endif } bool drawstar(cell *c) { @@ -519,6 +550,9 @@ bool drawstar(cell *c) { bool drawItemType(eItem it, cell *c, const transmatrix& V, int icol, int ticks, bool hidden) { char xch = iinf[it].glyph; +#if !CAP_POLY + return it; +#else int ct6 = c ? ctof(c) : 1; hpcshape *xsh = (it == itPirate || it == itKraken) ? &shPirateX : @@ -682,9 +716,11 @@ bool drawItemType(eItem it, cell *c, const transmatrix& V, int icol, int ticks, else if(it) return true; return false; +#endif } void drawTerraWarrior(const transmatrix& V, int t, int hp, double footphase) { +#if CAP_POLY ShadowV(V, shPBody); int col = linf[laTerracotta].color; int bcol = darkena(false ? 0xC0B23E : col, 0, 0xFF); @@ -696,12 +732,14 @@ void drawTerraWarrior(const transmatrix& V, int t, int hp, double footphase) { if(hp >= 2) queuepoly(VBODY, shTerraArmor3, darkena(t > 2 ? 0x612600 : col, 0, 0xFF)); queuepoly(VHEAD, shTerraHead, darkena(t > 4 ? 0x202020 : t > 3 ? 0x504040 : col, 0, 0xFF)); queuepoly(VHEAD, shPFace, bcol); +#endif } bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, int col, double footphase) { char xch = minf[m].glyph; +#if CAP_POLY if(m == moTortoise && where && where->stuntime >= 3) drawStunStars(V, where->stuntime-2); else if (m == moTortoise || m == moPlayer || (where && !where->stuntime)) ; @@ -1560,6 +1598,9 @@ bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, int col, dou else return true; return false; +#else + return true; +#endif } bool drawMonsterTypeDH(eMonster m, cell *where, const transmatrix& V, int col, bool dh, ld footphase) { @@ -1933,7 +1974,7 @@ cell *straightDownSeek; #define AURA 180 -int aurac[AURA+1][4]; +array,AURA+1> aurac; bool haveaura() { if(!(vid.aurastr>0 && !svg::in && (auraNOGL || vid.usingGL))) return false; @@ -4801,8 +4842,12 @@ bool allowIncreasedSight() { return false; } +purehookset hooks_drawmap; + void drawthemap() { + callhooks(hooks_drawmap); + frameid++; wavephase = (-(ticks / 100)) & 7; @@ -4983,9 +5028,11 @@ void drawmovestar(double dx, double dy) { if(rax == 0 || vid.axes == 4) return; int starcol = getcs().uicolor; - + +#if CAP_POLY if(vid.axes == 3) queuepoly(Centered, shMovestar, starcol); +#endif else for(int d=0; d<8; d++) { int col = starcol; @@ -4995,11 +5042,14 @@ void drawmovestar(double dx, double dy) { if(!leftclick && !rightclick && (d&1)) col &= 0xFFFFFF3F; #endif // EUCLIDEAN + +#if CAP_QUEUE if(euclid) queueline(tC0(Centered), Centered * ddi0(d * 10.5, 0.5) , col, 0); else // queueline(tC0(Centered), Centered * spin(M_PI*d/4)* xpush(d==0?.7:d==2?.6:.5) * C0, col >> darken); queueline(tC0(Centered), Centered * xspinpush0(M_PI*d/4, d==0?.7:d==2?.5:.2), col, 3); +#endif } } @@ -5075,6 +5125,7 @@ void drawfullmap() { } if(pmodel == mdHyperboloid) { +#if CAP_QUEUE int col = darkena(0x80, 0, 0x80); queueline(hpxyz(0,0,1), hpxyz(0,0,-vid.alpha), col, 0, PPR_CIRCLE); queueline(xpush(+4)*C0, hpxyz(0,0,0), col, 0, PPR_CIRCLE); @@ -5082,6 +5133,7 @@ void drawfullmap() { queueline(xpush(-4)*C0, hpxyz(0,0,0), col, 0, PPR_CIRCLE); queueline(xpush(-4)*C0, hpxyz(0,0,-vid.alpha), col, 0, PPR_CIRCLE); queueline(hpxyz(-1,0,0), hpxyz(1,0,0), col, 0, PPR_CIRCLE); +#endif } if(pmodel == mdPolygonal || pmodel == mdPolynomial) @@ -5404,11 +5456,13 @@ void animateReplacement(cell *a, cell *b, int layer) { } void drawBug(const cellwalker& cw, int col) { +#if CAP_POLY initquickqueue(); transmatrix V = shmup::ggmatrix(cw.c); if(cw.spin) V = V * ddspin(cw.c, cw.spin, S42); queuepoly(V, shBugBody, col); quickqueue(); +#endif } cell *viewcenter() {