1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

added CAP_SHAPES: poly system works, but no shapes are used

This commit is contained in:
? 2019-02-17 19:39:44 +01:00 committed by Zeno Rogue
parent 4586516a58
commit a3eb161235
9 changed files with 116 additions and 66 deletions

View File

@ -43,7 +43,7 @@ blizzardcell* getbcell(cell *c) {
}
void drawBlizzards() {
#if CAP_POLY && CAP_FIELD
#if CAP_SHAPES && CAP_FIELD
poly_outline = OUTLINE_NONE;
auto it = blizzardcells.begin();
bcells.clear();
@ -220,7 +220,7 @@ void drawArrowTraps() {
#if CAP_QUEUE
queueline(tC0(t0), tC0(t1), 0xFF0000FF, 4 + vid.linequality, PPR::ITEM);
#endif
#if CAP_POLY
#if CAP_SHAPES
if((c->wparam & 7) == 3 && !shmup::on) {
// queueline(t0 * randomPointIn(r[0]->type), t1 * randomPointIn(r[1]->type), 0xFFFFFFFF, 4, PPR::ITEM);
int tt = int(fractick(64) * 401);

View File

@ -337,7 +337,9 @@ struct debugScreen {
if(!what && current_display->sidescreen) what = mouseover;
if(what) {
#if CAP_SHAPES
queuepoly(gmatrix[what], shAsymmetric, 0x80808080);
#endif
char buf[200];
sprintf(buf, "%p", what);
dialog::addSelItem("mpdist", its(what->mpdist), 'd');

View File

@ -1,5 +1,5 @@
namespace hr {
#if CAP_POLY
#if CAP_SHAPES
vector<plain_floorshape*> all_plain_floorshapes;
vector<escher_floorshape*> all_escher_floorshapes;
@ -591,8 +591,6 @@ namespace gp {
qfloorinfo qfi;
int chasmg;
void set_no_floor() {
qfi.fshape = NULL;
qfi.shape = NULL;

100
graph.cpp
View File

@ -325,7 +325,7 @@ void drawPlayerEffects(const transmatrix& V, cell *c, bool onplayer) {
using namespace sword;
if(shmup::on) {
#if CAP_POLY
#if CAP_SHAPES
if(items[itOrbSword])
queuepoly(V*spin(shmup::pc[multi::cpid]->swordangle), (peace::on ? shMagicShovel : shMagicSword), darkena(iinf[itOrbSword].color, 0, 0xC0 + 0x30 * sintick(200)));
@ -338,7 +338,7 @@ void drawPlayerEffects(const transmatrix& V, cell *c, bool onplayer) {
int& ang = angle[multi::cpid];
ang %= S42;
#if CAP_QUEUE || CAP_POLY
#if CAP_QUEUE || CAP_SHAPES
transmatrix Vnow = gmatrix[c] * rgpushxto0(inverse(gmatrix[c]) * tC0(V)) * ddspin(c,0,M_PI); // (IRREGULAR ? ddspin(c,0,M_PI) : spin(-hexshiftat(c)));
#endif
@ -354,7 +354,7 @@ void drawPlayerEffects(const transmatrix& V, cell *c, bool onplayer) {
}
#endif
#if CAP_POLY
#if CAP_SHAPES
if(items[itOrbSword])
queuepoly(Vnow*spin(M_PI+(-1-2*ang)*2*M_PI/S84), (peace::on ? shMagicShovel : shMagicSword), darkena(iinf[itOrbSword].color, 0, 0x80 + 0x70 * sintick(200)));
@ -389,7 +389,7 @@ void drawPlayerEffects(const transmatrix& V, cell *c, bool onplayer) {
}
void drawStunStars(const transmatrix& V, int t) {
#if CAP_POLY
#if CAP_SHAPES
for(int i=0; i<3*t; i++) {
transmatrix V2 = V * spin(M_PI * 2 * i / (3*t) + ptick(200));
queuepolyat(V2, shFlailBall, 0xFFFFFFFF, PPR::STUNSTARS);
@ -402,7 +402,7 @@ namespace tortoise {
// small is 0 or 2
void draw(const transmatrix& V, int bits, int small, int stuntime) {
#if CAP_POLY
#if CAP_SHAPES
color_t eyecolor = getBit(bits, tfEyeHue) ? 0xFF0000 : 0xC0C0C0;
color_t shellcolor = getBit(bits, tfShellHue) ? 0x00C040 : 0xA06000;
color_t scutecolor = getBit(bits, tfScuteHue) ? 0x00C040 : 0xA06000;
@ -464,7 +464,7 @@ double footfun(double d) {
bool ivoryz;
void animallegs(const transmatrix& V, eMonster mo, color_t col, double footphase) {
#if CAP_POLY
#if CAP_SHAPES
footphase /= SCALE;
bool dog = mo == moRunDog;
@ -507,22 +507,21 @@ void animallegs(const transmatrix& V, eMonster mo, color_t col, double footphase
bool noshadow;
#if CAP_SHAPES
void ShadowV(const transmatrix& V, const hpcshape& bp, PPR prio) {
#if CAP_POLY
if(mmspatial) {
if(pmodel == mdHyperboloid || pmodel == mdBall || pmodel == mdHemisphere || noshadow)
return; // shadows break the depth testing
dynamicval<color_t> p(poly_outline, OUTLINE_TRANS);
queuepolyat(V, bp, SHADOW_MON, prio);
}
#endif
}
#endif
#if CAP_SHAPES
transmatrix otherbodyparts(const transmatrix& V, color_t col, eMonster who, double footphase) {
#if CAP_POLY
#define VFOOT V
#define VLEG mmscale(V, geom3::LEG)
#define VGROIN mmscale(V, geom3::GROIN)
@ -600,10 +599,9 @@ transmatrix otherbodyparts(const transmatrix& V, color_t col, eMonster who, doub
return spin(rightfoot * wobble);
#else
return Id;
#endif
}
#endif
bool drawstar(cell *c) {
for(int t=0; t<c->type; t++)
@ -622,7 +620,7 @@ bool drawing_usershape_on(cell *c, mapeditor::eShapegroup sg) {
}
bool drawItemType(eItem it, cell *c, const transmatrix& V, int icol, int pticks, bool hidden) {
#if !CAP_POLY
#if !CAP_SHAPES
return it;
#else
char xch = iinf[it].glyph;
@ -806,8 +804,8 @@ bool drawItemType(eItem it, cell *c, const transmatrix& V, int icol, int pticks,
#endif
}
#if CAP_SHAPES
void drawTerraWarrior(const transmatrix& V, int t, int hp, double footphase) {
#if CAP_POLY
ShadowV(V, shPBody);
color_t col = linf[laTerracotta].color;
int bcol = darkena(false ? 0xC0B23E : col, 0, 0xFF);
@ -819,12 +817,12 @@ void drawTerraWarrior(const transmatrix& V, int t, int hp, double footphase) {
if(hp >= 2) queuepoly(VBS, 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
}
#endif
bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, color_t col, double footphase) {
#if CAP_POLY
#if CAP_SHAPES
char xch = minf[m].glyph;
if(m == moTortoise && where && where->stuntime >= 3)
@ -1917,7 +1915,7 @@ void drawWormSegments() {
bool dont_face_pc = false;
bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col) {
#if CAP_POLY
#if CAP_SHAPES
bool darkhistory = conformal::includeHistory && conformal::inkillhistory.count(c);
@ -2536,7 +2534,7 @@ transmatrix applyDowndir(cell *c, const cellfunction& cf) {
return ddspin(c, patterns::downdir(c, cf), M_PI);
}
#if CAP_POLY
#if CAP_SHAPES
void set_towerfloor(cell *c, const cellfunction& cf = coastvalEdge) {
if(weirdhyperbolic || sphere) {
set_floor(shFloor);
@ -2588,6 +2586,8 @@ void set_zebrafloor(cell *c) {
void set_maywarp_floor(cell *c);
int chasmg;
void set_reptile_floor(cell *c, const transmatrix& V, color_t col, bool nodetails = false) {
auto si =
@ -3333,7 +3333,9 @@ bool use_swapped_duals() {
return (masterless && !a4) || GOLDBERG;
}
#if CAP_POLY
int wavephase;
#if CAP_SHAPES
void floorShadow(cell *c, const transmatrix& V, color_t col) {
if(pmodel == mdHyperboloid || pmodel == mdBall || pmodel == mdHemisphere || noshadow)
return; // shadows break the depth testing
@ -3366,8 +3368,6 @@ void set_maywarp_floor(cell *c) {
else set_floor(shFloor);
}
int wavephase;
void escherSidewall(cell *c, int sidepar, const transmatrix& V, color_t col) {
if(sidepar >= SIDE_SLEV && sidepar <= SIDE_SLEV+2) {
int sl = sidepar - SIDE_SLEV;
@ -3460,7 +3460,7 @@ int gridcolor(cell *c1, cell *c2) {
return Dark(0x202020);
}
#if CAP_POLY
#if CAP_SHAPES
void pushdown(cell *c, int& q, const transmatrix &V, double down, bool rezoom, bool repriority) {
// since we might be changing priorities, we have to make sure that we are sorting correctly
@ -3611,7 +3611,7 @@ int getSnakelevColor(cell *c, int i, int last, int fd, color_t wcol) {
return darkena(col, fd, 0xFF);
}
#if CAP_POLY
#if CAP_SHAPES
void draw_wall(cell *c, const transmatrix& V, color_t wcol, color_t& zcol, int ct6, int fd) {
zcol = wcol;
color_t wcol0 = wcol;
@ -3689,7 +3689,6 @@ int colorhash(color_t i) {
return (i * 0x471211 + i*i*0x124159 + i*i*i*0x982165) & 0xFFFFFF;
}
#if CAP_POLY
void draw_gravity_particles(cell *c, const transmatrix V) {
int u = (int)(size_t)(c);
u = ((u * 137) + (u % 1000) * 51) % 1000;
@ -3758,7 +3757,6 @@ void draw_gravity_particles(cell *c, const transmatrix V) {
}
}
}
#endif
void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
@ -3788,7 +3786,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
}
if(just_gmatrix) return;
#if CAP_POLY
#if CAP_SHAPES
set_floor(shFloor);
#endif
ivoryz = isGravityLand(c->land);
@ -3813,7 +3811,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
buildAutomatonRule(c);
#endif
#if CAP_POLY
#if CAP_SHAPES
viewBuggyCells(c,V);
#endif
@ -3897,9 +3895,11 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
queuestr(V, (cd > 9 ? .6 : 1) * .2, label, 0xFF000000 + dc, 1);
} */
#if CAP_SHAPES
if(c->land == laNone && (cmode & sm::MAP)) {
queuepoly(V, shTriangle, 0xFF0000FF);
}
#endif
char ch = winf[c->wall].glyph;
color_t wcol, fcol, asciicol;
@ -3957,8 +3957,10 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
asciicol = wcol;
#if CAP_SHAPES
if(c->land == laNone && c->wall == waNone)
queuepoly(V, shTriangle, 0xFFFF0000);
#endif
if(c->wall == waThumperOn) {
ld ds = fractick(160);
@ -4040,17 +4042,19 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
}
int ctype = c->type;
#if CAP_POLY
#if CAP_SHAPES
int ct6 = ctof(c);
#endif
bool error = false;
#if CAP_SHAPES
chasmg = chasmgraph(c);
#endif
int fd = getfd(c);
#if CAP_POLY
#if CAP_SHAPES
int flooralpha = 255;
#endif
@ -4070,10 +4074,12 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
(!wmspatial) ? &V :
sl ? &(Vd0= mscale(V, geom3::SLEV[sl])) :
highwall(c) ? &(Vd0= mscale(V, (1+geom3::WALL)/2)) :
#if CAP_SHAPES
(chasmg==1) ? &(Vd0 = mscale(V, geom3::LAKE)) :
#endif
&V;
#if CAP_POLY
#if CAP_SHAPES
transmatrix Vf0;
const transmatrix& Vf = (chasmg && wmspatial) ? (Vf0=mscale(V, geom3::BOTTOM)) : V;
#endif
@ -4091,7 +4097,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
mapeditor::drawtrans = V * applyPatterndir(c, si);
#endif
#if CAP_POLY
#if CAP_SHAPES
// floor
bool eoh = euclid || !BITRUNCATED;
@ -4873,7 +4879,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
if(!(it || c->monst || c->cpdist == 0)) error = true;
}
#if CAP_POLY
#if CAP_SHAPES
int sha = shallow(c);
if(wmspatial && sha) {
@ -4975,22 +4981,29 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
}
if(true) {
#if CAP_SHAPES
int q = ptds.size();
#endif
error |= drawMonster(V, ctype, c, moncol);
#if CAP_SHAPES
if(Vboat != &V && Vboat != &Vboat0 && q != isize(ptds))
pushdown(c, q, V, -geom3::factor_to_lev(zlevel(tC0((*Vboat)))),
!isMultitile(c->monst), false);
#endif
}
#if CAP_SHAPES
if(!shmup::on && sword::at(c)) {
queuepolyat(V, shDisk, 0xC0404040, PPR::SWORDMARK);
}
#endif
#if CAP_TEXTURE
if(!texture::using_aura())
#endif
addaura(tC0(V), zcol, fd);
#if CAP_SHAPES
int ad = airdist(c);
if(ad == 1 || ad == 2) {
@ -5013,8 +5026,9 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
}
}
}
#endif
#if CAP_POLY
#if CAP_SHAPES
if(c->land == laBlizzard) {
if(vid.backeffects) {
if(c->cpdist <= getDistLimit())
@ -5025,10 +5039,12 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
queuepoly(V * ddspin(c, i) * xpush(cellgfxdist(c, i)/2), shWindArrow, 0x8080FF80);
}
}
#endif
if(items[itOrbGravity] && c->cpdist <= 5)
draw_gravity_particles(c, V);
#if CAP_SHAPES
if(c->land == laWhirlwind) {
whirlwind::calcdirs(c);
@ -5255,7 +5271,7 @@ void fallingMonsterAnimation(cell *c, eMonster m, int id) {
void queuecircleat(cell *c, double rad, color_t col) {
if(!c) return;
if(!gmatrix.count(c)) return;
#if CAP_POLY
#if CAP_SHAPES
if(vid.stereo_mode || sphere) {
dynamicval<color_t> p(poly_outline, col);
queuepolyat(gmatrix[c] * spintick(100), shGem[1], 0, PPR::LINE);
@ -5291,7 +5307,7 @@ void drawMarkers() {
if(!(cmode & sm::NORMAL)) return;
callhooks(hooks_markers);
#if CAP_POLY
#if CAP_SHAPES
viewmat();
#endif
@ -5382,7 +5398,7 @@ void drawMarkers() {
#endif
// process mouse
#if CAP_POLY
#if CAP_SHAPES
if((vid.axes == 4 || (vid.axes == 1 && !mousing)) && !shmup::on) {
if(multi::players == 1) {
forCellIdAll(c2, d, cwt.at) IG(c2) drawMovementArrows(c2, confusingGeometry() ? Gm(cwt.at) * calc_relative_matrix(c2, cwt.at, d) : Gm(c2));
@ -5417,7 +5433,7 @@ void drawMarkers() {
queuecircleat(mouseover, 0.6, darkena(iinf[orbToTarget].color, 0, 0xFF));
}
#endif
#if CAP_POLY
#if CAP_SHAPES
if(orbToTarget && rand() % 200 < ticks - lastt) {
if(orbToTarget == itOrbDragon)
drawFireParticles(mouseover, 2);
@ -5448,7 +5464,7 @@ void drawMarkers() {
}
void drawFlashes() {
#if CAP_QUEUE && CAP_POLY
#if CAP_QUEUE
for(int k=0; k<isize(flashes); k++) {
flashdata& f = flashes[k];
transmatrix V;
@ -5465,10 +5481,12 @@ void drawFlashes() {
bool kill = tim > f.size;
if(f.spd) {
#if CAP_SHAPES
kill = tim > 300;
int partcol = darkena(f.color, 0, max(255 - tim*255/300, 0));
poly_outline = OUTLINE_DEFAULT;
queuepoly(V * spin(f.angle) * xpush(f.spd * tim * scalefactor / 50000.), shParticle[f.size], partcol);
#endif
}
else if(f.size == 1000) {
@ -5766,7 +5784,7 @@ void drawmovestar(double dx, double dy) {
if(0);
#if CAP_POLY
#if CAP_SHAPES
else if(vid.axes == 3)
queuepoly(Centered, shMovestar, starcol);
#endif
@ -5868,7 +5886,7 @@ void drawfullmap() {
}
*/
#if CAP_POLY && CAP_QUEUE
#if CAP_QUEUE
draw_boundary(0);
draw_boundary(1);
@ -6246,7 +6264,7 @@ void animateReplacement(cell *a, cell *b, int layer, int direction_hinta, int di
}
void drawBug(const cellwalker& cw, color_t col) {
#if CAP_POLY
#if CAP_SHAPES
initquickqueue();
transmatrix V = ggmatrix(cw.at);
if(cw.spin) V = V * ddspin(cw.at, cw.spin, M_PI);

View File

@ -301,7 +301,7 @@ bool nohud, nomenukey;
hookset<bool()> *hooks_prestats;
#if CAP_POLY
#if CAP_SHAPES
void drawMobileArrow(int i) {
int dir = i;
@ -372,7 +372,7 @@ void drawStats() {
legalmoves[MAX_EDGE] ? 0xFF0000FF : 0xFF000080
);
#endif
#if CAP_POLY
#if CAP_SHAPES
for(int i=0; i<cwt.at->type; i++) drawMobileArrow(i);
#endif
if(hypot(mousex-xmove, mousey-yb) <= rad) getcstat = '-';

15
hyper.h
View File

@ -2084,7 +2084,9 @@ namespace mapeditor {
bool drawUserShape(const transmatrix& V, eShapegroup group, int id, color_t color, cell *c, PPR prio = PPR::DEFAULT);
}
#if CAP_SHAPES
void ShadowV(const transmatrix& V, const struct hpcshape& bp, PPR prio = PPR::MONSTER_SHADOW);
#endif
#define OUTLINE_NONE 0x000000FF
#define OUTLINE_FRIEND 0x00FF00FF
@ -2173,7 +2175,9 @@ namespace quotientspace {
void killFriendlyIvy();
#if CAP_SHAPES
void pushdown(cell *c, int& q, const transmatrix &V, double down, bool rezoom, bool repriority);
#endif
extern bool viewdists;
@ -3838,9 +3842,12 @@ namespace glhr {
}
void prettypoly(const vector<hyperpoint>& t, color_t fillcol, color_t linecol, int lev);
#if CAP_SHAPES
dqi_poly& queuepolyat(const transmatrix& V, const hpcshape& h, color_t col, PPR prio);
#endif
dqi_poly& queuetable(const transmatrix& V, const vector<glvertex>& f, int cnt, color_t linecol, color_t fillcol, PPR prio);
#if CAP_SHAPES
struct floorshape;
struct qfloorinfo {
@ -3852,7 +3859,6 @@ struct qfloorinfo {
};
extern qfloorinfo qfi;
extern int chasmg;
struct hpcshape {
int s, e;
@ -3862,6 +3868,7 @@ struct hpcshape {
};
extern hpcshape shFullCross[2];
#endif
int fix6(int a);
int fix7(int a);
@ -4000,8 +4007,10 @@ namespace gp {
extern bool debug_geometry;
#if CAP_SHAPES
dqi_poly& queuepoly(const transmatrix& V, const hpcshape& h, color_t col);
dqi_poly& queuepolyat(const transmatrix& V, const hpcshape& h, color_t col, PPR prio);
#endif
void queuestr(const hyperpoint& h, int size, const string& chr, color_t col, int frame = 0);
void queuechr(const transmatrix& V, double size, char chr, color_t col, int frame = 0);
@ -4049,6 +4058,7 @@ void set_blizzard_frame(cell *c, int frameid);
#define SIDE_WTS3 7
#define SIDEPARS 8
#if CAP_SHAPES
struct floorshape {
bool is_plain;
int shapeid;
@ -4081,6 +4091,7 @@ extern plain_floorshape
shBigTriangle, shTriheptaFloor, shBigHepta;
extern escher_floorshape shDragonFloor, shPowerFloor, shRedRockFloor[3];
#endif
#if ISMOBILE
bool buttonclicked;
@ -4151,7 +4162,9 @@ ld frac(ld x);
extern color_t poly_outline;
#if CAP_SHAPES
extern hpcshape shDisk, shTriangle, shHeptaMarker, shSnowball, shDiskT, shDiskS, shDiskSq, shDiskM, shTinyBird, shTinyShark, shAsymmetric;
#endif
extern std::mt19937 hrngen;

View File

@ -1226,7 +1226,7 @@ void circle_around_center(ld radius, color_t linecol, color_t fillcol, PPR prio)
return;
}
#endif
#if CAP_POLY && CAP_QUEUE
#if CAP_QUEUE
for(int i=0; i<=360; i++) curvepoint(xspinpush0(i * degree, 10));
auto& c = queuecurve(linecol, fillcol, prio);
if(pmodel == mdDisk && hyperbolic && vid.alpha <= -1)
@ -1241,7 +1241,7 @@ color_t periodcolor = 0x00FF0080;
color_t ringcolor = darkena(0xFF, 0, 0xFF);
color_t modelcolor = 0;
#if CAP_QUEUE && CAP_POLY
#if CAP_QUEUE
void draw_model_elements() {
switch(pmodel) {

View File

@ -6,6 +6,19 @@
namespace hr {
unsigned char& part(color_t& col, int i) {
unsigned char* c = (unsigned char*) &col;
#if ISMOBILE
return c[i];
#else
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
return c[sizeof(col) - 1 - i];
#else
return c[i];
#endif
#endif
}
ld signum(ld x) { return x<0?-1:x>0?1:0; }
bool asign(ld y1, ld y2) {
@ -89,10 +102,13 @@ color_t poly_outline;
extern long double polydata[];
#if CAP_SHAPES
hpcshape *last = NULL;
#endif
vector<unique_ptr<drawqueueitem>> ptds;
#if CAP_SHAPES
void hpcpush(hyperpoint h) {
if(sphere) h = mid(h,h);
ld threshold = (sphere ? (ISMOBWEB || NONSTDVAR ? .04 : .001) : 0.1) * pow(.25, vid.linequality);
@ -120,6 +136,7 @@ void chasmifyPoly(double fac, double fac2, int k) {
hpc.push_back(hpc[last->s]);
last->flags |= POLY_ISSIDE;
}
#endif
#if CAP_GL
color_t text_color;
@ -187,7 +204,7 @@ void glflush() {
}
#endif
#if CAP_POLY
#if CAP_SHAPES
void shift(hpcshape& sh, double dx, double dy, double dz) {
hyperpoint H = hpxyz(dx, dy, dz);
transmatrix m = rgpushxto0(H);
@ -768,19 +785,6 @@ void fixMercator(bool tinf) {
}
unsigned char& part(color_t& col, int i) {
unsigned char* c = (unsigned char*) &col;
#if ISMOBILE
return c[i];
#else
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
return c[sizeof(col) - 1 - i];
#else
return c[i];
#endif
#endif
}
bool in_twopoint = false;
ld glhypot2(glvertex a, glvertex b) {
@ -1506,6 +1510,7 @@ void drawqueue() {
}
}
#if CAP_SHAPES
hpcshape
shSemiFloorSide[SIDEPARS],
shBFloor[2],
@ -1600,9 +1605,11 @@ hpcshape
shAsymmetric,
shDodeca;
#endif
ld tentacle_length;
#if CAP_SHAPES
#define USERLAYERS 32
struct usershapelayer {
@ -2698,6 +2705,10 @@ void initShape(int sg, int id) {
}
}
}
#else
void buildpolys() { }
#endif
template<class T, class... U> T& queuea(PPR prio, U... u) {
ptds.push_back(unique_ptr<T>(new T (u...)));
@ -2705,6 +2716,7 @@ template<class T, class... U> T& queuea(PPR prio, U... u) {
return (T&) *ptds.back();
}
#if CAP_SHAPES
dqi_poly& queuepolyat(const transmatrix& V, const hpcshape& h, color_t col, PPR prio) {
if(prio == PPR::DEFAULT) prio = h.prio;
@ -2737,6 +2749,7 @@ dqi_poly& queuepolyat(const transmatrix& V, const hpcshape& h, color_t col, PPR
ptd.intester = h.intester;
return ptd;
}
#endif
void addfloats(vector<GLfloat>& v, hyperpoint h) {
for(int i=0; i<3; i++) v.push_back(h[i]);
@ -2760,6 +2773,7 @@ dqi_poly& queuetable(const transmatrix& V, const vector<glvertex>& f, int cnt, c
return ptd;
}
#if CAP_SHAPES
dqi_poly& queuepoly(const transmatrix& V, const hpcshape& h, color_t col) {
return queuepolyat(V,h,col,h.prio);
}
@ -2767,6 +2781,7 @@ dqi_poly& queuepoly(const transmatrix& V, const hpcshape& h, color_t col) {
void queuepolyb(const transmatrix& V, const hpcshape& h, color_t col, int b) {
queuepolyat(V,h,col,h.prio+b);
}
#endif
void curvepoint(const hyperpoint& H1) {
curvedata.push_back(glhr::pointtogl(H1));
@ -2877,9 +2892,12 @@ void queuecircle(const transmatrix& V, double size, color_t col) {
}
void queuemarkerat(const transmatrix& V, color_t col) {
#if CAP_SHAPES
queuepolyat(V, shTriangle, col, PPR::LINE);
#endif
}
#if CAP_SHAPES
long double polydata[] = {
// shStarFloor[0] (6x1)
NEWSHAPE, 1,6,1, 0.267355,0.153145, 0.158858,0.062321, 0.357493,-0.060252,
@ -3628,6 +3646,7 @@ NEWSHAPE, 388, 1, 1, 0.046590,0.284199, 0.028110,0.325611, 0.098711,0.333738, 0.
NEWSHAPE
};
#endif
#endif

View File

@ -3316,7 +3316,7 @@ bool boatAt(cell *c) {
hookset<bool(const transmatrix&, cell*, shmup::monster*)> *hooks_draw;
bool drawMonster(const transmatrix& V, cell *c, const transmatrix*& Vboat, transmatrix& Vboat0, const transmatrix *Vdp) {
#if CAP_POLY
#if CAP_SHAPES
pair<mit, mit> p =
monstersAt.equal_range(c);