1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-20 04:09:59 +00:00

all hr functions/variables used in rogueviz now listed in hyper.h

This commit is contained in:
Zeno Rogue 2018-07-09 21:02:23 +02:00
parent 887deae03f
commit ef182b225e
4 changed files with 57 additions and 19 deletions

View File

@ -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<torusmode_info> 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 <class T> cellwalker operator + (cellwalker h, T t) { return h += t; }
template <class T> 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; }

View File

@ -7,11 +7,6 @@ string help;
function<void()> help_delegate;
struct help_extension {
char key;
string text;
reaction_t action;
};
vector<help_extension> help_extensions;
vector<string> extra_keys = {

55
hyper.h
View File

@ -720,6 +720,9 @@ namespace shmup {
extern hookset<bool(const transmatrix&, cell*, shmup::monster*)> *hooks_draw;
extern hookset<bool(shmup::monster*)> *hooks_kill;
extern hookset<bool(shmup::monster*, string&)> *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<torusmode_info> 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<pair<cell*, int> > airmap;
extern void compute_graphical_distance();
extern ld scalef;
struct help_extension {
char key;
string text;
reaction_t action;
};
extern vector<help_extension> 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 <class T> cellwalker operator + (cellwalker h, T t) { return h += t; }
template <class T> 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;
}

View File

@ -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);