From ef182b225e8905d56dd77b56330487436e8c3436 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 9 Jul 2018 21:02:23 +0200 Subject: [PATCH] all hr functions/variables used in rogueviz now listed in hyper.h --- cell.cpp | 12 ------------ help.cpp | 5 ----- hyper.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ polygons.cpp | 4 ++-- 4 files changed, 57 insertions(+), 19 deletions(-) diff --git a/cell.cpp b/cell.cpp index 46098b25..b95b0660 100644 --- a/cell.cpp +++ b/cell.cpp @@ -236,15 +236,6 @@ namespace torusconfig { int newqty, newdy, newsdx, newsdy; int torus_cx, torus_cy; - static const flagtype TF_SINGLE = 1; - static const flagtype TF_SIMPLE = 2; - static const flagtype TF_WEIRD = 4; - - static const flagtype TF_HEX = 16; - static const flagtype TF_SQUARE = 32; - - static const flagtype TF_KLEIN = 256; - vector tmodes = { {"single row (hex)", TF_SINGLE | TF_HEX}, {"single row (squares)", TF_SINGLE | TF_SQUARE}, @@ -790,9 +781,6 @@ cellwalker& operator += (cellwalker& cw, wmirror_t) { return cw; } -template cellwalker operator + (cellwalker h, T t) { return h += t; } -template cellwalker operator - (cellwalker h, T t) { return h += (-t); } - cellwalker& operator ++ (cellwalker& h, int) { return h += 1; } cellwalker& operator -- (cellwalker& h, int) { return h -= 1; } diff --git a/help.cpp b/help.cpp index cce90fb7..bafda27a 100644 --- a/help.cpp +++ b/help.cpp @@ -7,11 +7,6 @@ string help; function help_delegate; -struct help_extension { - char key; - string text; - reaction_t action; - }; vector help_extensions; vector extra_keys = { diff --git a/hyper.h b/hyper.h index 0d7797e8..151f6b15 100644 --- a/hyper.h +++ b/hyper.h @@ -720,6 +720,9 @@ namespace shmup { extern hookset *hooks_draw; extern hookset *hooks_kill; extern hookset *hooks_describe; + + void turn(int); + extern monster *lmousetarget; } static const int NOHINT = -1; @@ -1552,6 +1555,7 @@ namespace dialog { void addHelp(); void addBack(); + void add_action(reaction_t action); } void checkStunKill(cell *dest); @@ -1589,6 +1593,7 @@ extern bool ivoryz; #define SHADOW_MON 0x30 bool drawMonsterType(eMonster m, cell *where, const transmatrix& V, int col, double footphase); + void drawPlayerEffects(const transmatrix& V, cell *c, bool onPlayer); // monster movement animations @@ -1948,6 +1953,7 @@ namespace linepatterns { void setColor(ePattern id, int col); void drawAll(); void showMenu(); + void switchAlpha(ePattern id, int col); }; transmatrix ddspin(cell *c, int d, int bonus = 0); @@ -3436,6 +3442,17 @@ namespace torusconfig { }; extern vector tmodes; + + enum : flagtype { + TF_SINGLE = 1, + TF_SIMPLE = 2, + TF_WEIRD = 4, + TF_HEX = 16, + TF_SQUARE = 32, + TF_KLEIN = 256 + }; + + flagtype tmflags(); } namespace fieldpattern { @@ -3598,4 +3615,42 @@ struct pathdata { extern int timetowait; +extern vector > airmap; +extern void compute_graphical_distance(); +extern ld scalef; + +struct help_extension { + char key; + string text; + reaction_t action; + }; + +extern vector help_extensions; + +namespace gamestack { + bool pushed(); + } + +namespace geom3 { + extern ld BODY; + } + +void queuestr(const transmatrix& V, double size, const string& chr, int col, int frame = 0, int align = 8); +void queuestr(int x, int y, int shift, int size, string str, int col, int frame = 0, int align = 8); + +ld frac(ld x); + +cellwalker& operator += (cellwalker& cw, wstep_t); +cellwalker& operator += (cellwalker& cw, int spin); + +template cellwalker operator + (cellwalker h, T t) { return h += t; } +template cellwalker operator - (cellwalker h, T t) { return h += (-t); } + +bool cwstepcreates(cellwalker& cw); +extern int poly_outline; + +extern hpcshape shDisk, shTriangle, shHeptaMarker, shSnowball, shDiskT, shDiskS, shDiskSq, shDiskM; + +extern std::mt19937 hrngen; + } diff --git a/polygons.cpp b/polygons.cpp index eb956398..ed5a7317 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -2356,7 +2356,7 @@ void queueline(const hyperpoint& H1, const hyperpoint& H2, int col, int prf, int ptd.prio = prio << PSHIFT; } -void queuestr(int x, int y, int shift, int size, string str, int col, int frame = 0, int align = 8) { +void queuestr(int x, int y, int shift, int size, string str, int col, int frame, int align) { polytodraw& ptd = nextptd(); ptd.kind = pkString; ptd.u.chr.x = x; @@ -2618,7 +2618,7 @@ void queuestr(const hyperpoint& h, int size, const string& chr, int col, int fra queuestr(xc, yc, sc, size, chr, col, frame); } -void queuestr(const transmatrix& V, double size, const string& chr, int col, int frame = 0, int align = 8) { +void queuestr(const transmatrix& V, double size, const string& chr, int col, int frame, int align) { int xc, yc, sc; getcoord0(tC0(V), xc, yc, sc); int xs, ys, ss; getcoord0(V * xpush0(.5), xs, ys, ss); queuestr(xc, yc, sc, int(sqrt(squar(xc-xs)+squar(yc-ys)) * size), chr, col, frame, align);