mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-08-04 12:58:10 +00:00
added an option to disable background particles and to change font size on desktop
This commit is contained in:
parent
ae3feb2055
commit
9f48dcf3f6
@ -1014,6 +1014,10 @@ void saveHighQualityShot(const char *fname, const char *caption, int fade) {
|
|||||||
#if CAP_SDL
|
#if CAP_SDL
|
||||||
bool setfsize = true;
|
bool setfsize = true;
|
||||||
|
|
||||||
|
void do_setfsize() {
|
||||||
|
vid.fsize = min(vid.yres * fontscale/ 3200, vid.xres * fontscale/ 4800), setfsize = false;
|
||||||
|
}
|
||||||
|
|
||||||
void setvideomode() {
|
void setvideomode() {
|
||||||
|
|
||||||
DEBB(DF_INIT, (debugfile,"setvideomode\n"));
|
DEBB(DF_INIT, (debugfile,"setvideomode\n"));
|
||||||
@ -1023,7 +1027,7 @@ void setvideomode() {
|
|||||||
if(vid.yres > vid.yscr) vid.yres = vid.yscr * 9/10, setfsize = true;
|
if(vid.yres > vid.yscr) vid.yres = vid.yscr * 9/10, setfsize = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(setfsize) vid.fsize = min(vid.yres / 32, vid.xres / 48), setfsize = false;
|
if(setfsize) do_setfsize();
|
||||||
|
|
||||||
int flags = 0;
|
int flags = 0;
|
||||||
|
|
||||||
@ -1047,7 +1051,7 @@ void setvideomode() {
|
|||||||
if(vid.full && !s) {
|
if(vid.full && !s) {
|
||||||
vid.xres = vid.xscr;
|
vid.xres = vid.xscr;
|
||||||
vid.yres = vid.yscr;
|
vid.yres = vid.yscr;
|
||||||
vid.fsize = min(vid.yres / 32, vid.xres / 48);
|
do_setfsize();
|
||||||
s = SDL_SetVideoMode(vid.xres, vid.yres, 32, flags | SDL_FULLSCREEN);
|
s = SDL_SetVideoMode(vid.xres, vid.yres, 32, flags | SDL_FULLSCREEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
double randd() { return (rand() % 1000000) / 1000000. + .0000005; }
|
double randd() { return (rand() % 1000000) / 1000000. + .0000005; }
|
||||||
|
|
||||||
|
double cellgfxdist(cell *c, int i) {
|
||||||
|
return purehepta ? tessf : (c->type == 6 && (i&1)) ? hexhexdist : crossf;
|
||||||
|
}
|
||||||
|
|
||||||
transmatrix cellrelmatrix(cell *c, int i) {
|
transmatrix cellrelmatrix(cell *c, int i) {
|
||||||
double d =
|
double d = cellgfxdist(c, i);
|
||||||
purehepta ? tessf : (c->type == 6 && (i&1)) ? hexhexdist : crossf;
|
|
||||||
return ddspin(c, i) * xpush(d) * iddspin(c->mov[i], c->spin(i), euclid ? 0 : S42);
|
return ddspin(c, i) * xpush(d) * iddspin(c->mov[i], c->spin(i), euclid ? 0 : S42);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
16
config.cpp
16
config.cpp
@ -273,6 +273,7 @@ void initConfig() {
|
|||||||
addsaver(conformal::autobandhistory, "automatic band history");
|
addsaver(conformal::autobandhistory, "automatic band history");
|
||||||
addsaver(conformal::dospiral, "do spiral");
|
addsaver(conformal::dospiral, "do spiral");
|
||||||
|
|
||||||
|
addsaver(vid.backeffects, "background particle effects", (ISMOBILE || ISPANDORA) ? false : true);
|
||||||
// control
|
// control
|
||||||
|
|
||||||
addsaver(vid.joyvalue, "vid.joyvalue", 4800);
|
addsaver(vid.joyvalue, "vid.joyvalue", 4800);
|
||||||
@ -590,6 +591,7 @@ void showGraphConfig() {
|
|||||||
dialog::addSelItem(XLAT("movement animation speed"), fts(vid.mspeed), 'm');
|
dialog::addSelItem(XLAT("movement animation speed"), fts(vid.mspeed), 'm');
|
||||||
|
|
||||||
dialog::addBoolItem(XLAT("extra graphical effects"), (vid.particles), 'u');
|
dialog::addBoolItem(XLAT("extra graphical effects"), (vid.particles), 'u');
|
||||||
|
dialog::addBoolItem(XLAT("background particle effects"), (vid.backeffects), 'p');
|
||||||
|
|
||||||
#ifdef WHATEVER
|
#ifdef WHATEVER
|
||||||
dialog::addSelItem(XLAT("whatever"), fts(whatever), 'j');
|
dialog::addSelItem(XLAT("whatever"), fts(whatever), 'j');
|
||||||
@ -606,9 +608,7 @@ void showGraphConfig() {
|
|||||||
|
|
||||||
dialog::addSelItem(XLAT("inventory/kill mode"), XLAT(glyphmodenames[vid.graphglyph]), 'd');
|
dialog::addSelItem(XLAT("inventory/kill mode"), XLAT(glyphmodenames[vid.graphglyph]), 'd');
|
||||||
|
|
||||||
#if ISMOBILE==1
|
|
||||||
dialog::addSelItem(XLAT("font scale"), its(fontscale), 'b');
|
dialog::addSelItem(XLAT("font scale"), its(fontscale), 'b');
|
||||||
#endif
|
|
||||||
|
|
||||||
dialog::addSelItem(XLAT("sight range"), its(sightrange), 'r');
|
dialog::addSelItem(XLAT("sight range"), its(sightrange), 'r');
|
||||||
|
|
||||||
@ -691,10 +691,14 @@ void showGraphConfig() {
|
|||||||
dialog::editNumber(vid.framelimit, 5, 300, 10, 300, XLAT("framerate limit"), "");
|
dialog::editNumber(vid.framelimit, 5, 300, 10, 300, XLAT("framerate limit"), "");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ISMOBILE
|
if(xuni =='b') {
|
||||||
if(xuni =='b')
|
dialog::editNumber(fontscale, 25, 400, 10, 100, XLAT("font scale"), "");
|
||||||
dialog::editNumber(fontscale, 0, 400, 10, 100, XLAT("font scale"), "");
|
if(!ISMOBILE)
|
||||||
#endif
|
dialog::reaction = [] () { setfsize = true; if(fontscale < 25) fontscale = 25; do_setfsize(); };
|
||||||
|
}
|
||||||
|
|
||||||
|
if(xuni =='p')
|
||||||
|
vid.backeffects = !vid.backeffects;
|
||||||
|
|
||||||
if(xuni =='z')
|
if(xuni =='z')
|
||||||
dialog::editNumber(vid.aurastr, 0, 256, 10, 128, XLAT("aura brightness"), "");
|
dialog::editNumber(vid.aurastr, 0, 256, 10, 128, XLAT("aura brightness"), "");
|
||||||
|
10
graph.cpp
10
graph.cpp
@ -4337,8 +4337,14 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(c->land == laBlizzard)
|
if(c->land == laBlizzard) {
|
||||||
blizzardcells[c].frame = frameid;
|
if(vid.backeffects)
|
||||||
|
blizzardcells[c].frame = frameid;
|
||||||
|
else {
|
||||||
|
forCellIdEx(c2, i, c) if(againstWind(c, c2))
|
||||||
|
queuepoly(V * ddspin(c, i) * xpush(cellgfxdist(c, i)/2), shWindArrow, 0x8080FF80);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(c->land == laWhirlwind) {
|
if(c->land == laWhirlwind) {
|
||||||
whirlwind::calcdirs(c);
|
whirlwind::calcdirs(c);
|
||||||
|
2
hud.cpp
2
hud.cpp
@ -253,7 +253,7 @@ void displayglyph2(int cx, int cy, int buttonsize, int i) {
|
|||||||
if(t == IC_OTHER)
|
if(t == IC_OTHER)
|
||||||
mouseovers = XLAT("objects found: %1", it);
|
mouseovers = XLAT("objects found: %1", it);
|
||||||
if(t == IC_NAI)
|
if(t == IC_NAI)
|
||||||
mouseovers = XLATN(it);
|
mouseovers = XLATT1(it);
|
||||||
if(t == IC_ORB)
|
if(t == IC_ORB)
|
||||||
mouseovers = XLAT("orb power: %1", eItem(i));
|
mouseovers = XLAT("orb power: %1", eItem(i));
|
||||||
if(it == itGreenStone) {
|
if(it == itGreenStone) {
|
||||||
|
4
hyper.h
4
hyper.h
@ -361,6 +361,8 @@ struct videopar {
|
|||||||
bool samegender; // same gender for the Princess?
|
bool samegender; // same gender for the Princess?
|
||||||
int language;
|
int language;
|
||||||
|
|
||||||
|
bool backeffects; // background particle effects
|
||||||
|
|
||||||
int killreduction, itemreduction, portreduction;
|
int killreduction, itemreduction, portreduction;
|
||||||
|
|
||||||
multi::config scfg;
|
multi::config scfg;
|
||||||
@ -822,6 +824,8 @@ namespace dialog {
|
|||||||
};
|
};
|
||||||
|
|
||||||
extern vector<item> items;
|
extern vector<item> items;
|
||||||
|
|
||||||
|
extern reaction_t reaction;
|
||||||
|
|
||||||
item& lastItem();
|
item& lastItem();
|
||||||
extern unsigned int *palette;
|
extern unsigned int *palette;
|
||||||
|
3
init.cpp
3
init.cpp
@ -179,11 +179,12 @@
|
|||||||
#define CAP_SHMUP_GOOD (!ISMOBWEB)
|
#define CAP_SHMUP_GOOD (!ISMOBWEB)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int fontscale = 100;
|
||||||
|
|
||||||
#if ISMOBILE
|
#if ISMOBILE
|
||||||
#define EXTRALICENSE "\n\nHyperRogue soundtrack by Shawn Parrotte (http://www.shawnparrotte.com), under the Creative Commons BY-SA 3.0 license, http://creativecommons.org/licenses/by-sa/3.0/"
|
#define EXTRALICENSE "\n\nHyperRogue soundtrack by Shawn Parrotte (http://www.shawnparrotte.com), under the Creative Commons BY-SA 3.0 license, http://creativecommons.org/licenses/by-sa/3.0/"
|
||||||
#undef XEXTRALICENSE
|
#undef XEXTRALICENSE
|
||||||
|
|
||||||
int fontscale = 100;
|
|
||||||
bool buttonclicked;
|
bool buttonclicked;
|
||||||
void gdpush(int t);
|
void gdpush(int t);
|
||||||
#endif
|
#endif
|
||||||
|
@ -652,7 +652,7 @@ hpcshape
|
|||||||
shEgg,
|
shEgg,
|
||||||
shSpikedRing, shTargetRing, shSawRing, shGearRing, shPeaceRing, shHeptaRing,
|
shSpikedRing, shTargetRing, shSawRing, shGearRing, shPeaceRing, shHeptaRing,
|
||||||
shSpearRing, shLoveRing,
|
shSpearRing, shLoveRing,
|
||||||
shDaisy, shTriangle, shNecro, shStatue, shKey,
|
shDaisy, shTriangle, shNecro, shStatue, shKey, shWindArrow,
|
||||||
shGun,
|
shGun,
|
||||||
shFigurine, shTreat,
|
shFigurine, shTreat,
|
||||||
shElementalShard,
|
shElementalShard,
|
||||||
@ -1363,6 +1363,7 @@ void buildpolys() {
|
|||||||
|
|
||||||
bshape(shMercuryBridge[0], PPR_FLOOR, scalef*spzoom6, 365);
|
bshape(shMercuryBridge[0], PPR_FLOOR, scalef*spzoom6, 365);
|
||||||
bshape(shMercuryBridge[1], PPR_FLOOR, scalef*spzoomd7, 366);
|
bshape(shMercuryBridge[1], PPR_FLOOR, scalef*spzoomd7, 366);
|
||||||
|
bshape(shWindArrow, PPR_HEPTAMARK, scalef, 367);
|
||||||
|
|
||||||
bshape(shPalaceGate, PPR_STRUCT1, scalef, 47);
|
bshape(shPalaceGate, PPR_STRUCT1, scalef, 47);
|
||||||
bshape(shSemiFeatherFloor[0], PPR_FLOOR, scalef*spzoom6, 48);
|
bshape(shSemiFeatherFloor[0], PPR_FLOOR, scalef*spzoom6, 48);
|
||||||
@ -2860,6 +2861,8 @@ NEWSHAPE, 364, 1, 2, -0.486619,0.002830, -0.418060,0.040577, -0.427473,0.022591,
|
|||||||
NEWSHAPE, 365, 1, 2, -0.236444,-0.000864, -0.300824,-0.142089, 0.027603,-0.331178, 0.117026,-0.205327,
|
NEWSHAPE, 365, 1, 2, -0.236444,-0.000864, -0.300824,-0.142089, 0.027603,-0.331178, 0.117026,-0.205327,
|
||||||
NEWSHAPE, 366, 1, 2, 0.120242,0.202432, 0.476077,0.202192,
|
NEWSHAPE, 366, 1, 2, 0.120242,0.202432, 0.476077,0.202192,
|
||||||
|
|
||||||
|
NEWSHAPE, 367, 1, 2, -0.096569,0.019944, 0.040859,0.019906, 0.037742,0.058710, 0.116624,-0.000000,
|
||||||
|
|
||||||
NEWSHAPE
|
NEWSHAPE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user