mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-02 20:29:17 +00:00
flatmodel now always use the standard geometry graphics
This commit is contained in:
parent
1d94bd76f8
commit
d046023164
16
hud.cpp
16
hud.cpp
@ -406,6 +406,14 @@ EX void drawStats() {
|
||||
auto xc = cd->xcenter;
|
||||
auto yc = cd->ycenter;
|
||||
|
||||
if(vid.radarsize > 0 && h)
|
||||
#if CAP_RACING
|
||||
if(!racing::on)
|
||||
#endif
|
||||
if(!peace::on)
|
||||
if(!(cmode & sm::MISSION))
|
||||
draw_radar(cornermode);
|
||||
|
||||
flat_model_enabler fme;
|
||||
|
||||
if(crosshair_color && crosshair_size > 0) {
|
||||
@ -416,14 +424,6 @@ EX void drawStats() {
|
||||
quickqueue();
|
||||
}
|
||||
|
||||
if(vid.radarsize > 0 && h)
|
||||
#if CAP_RACING
|
||||
if(!racing::on)
|
||||
#endif
|
||||
if(!peace::on)
|
||||
if(!(cmode & sm::MISSION))
|
||||
draw_radar(cornermode);
|
||||
|
||||
if(haveMobileCompass()) {
|
||||
initquickqueue();
|
||||
using namespace shmupballs;
|
||||
|
55
hypgraph.cpp
55
hypgraph.cpp
@ -1555,50 +1555,45 @@ transmatrix screenpos(ld x, ld y) {
|
||||
In 2D, this does not work (as HyperRogue reduces matrices to 3x3) so we use the native disk projection
|
||||
*/
|
||||
|
||||
EX eModel flat_model() { return MDIM == 4 ? mdPixel : mdDisk; }
|
||||
int flat_on;
|
||||
eGeometry backup_geometry;
|
||||
projection_configuration backup_pconf;
|
||||
bool backup_always3;
|
||||
|
||||
/** \brief enable the 'flat' model for drawing HUD. See hr::flat_model_enabler */
|
||||
EX void enable_flat_model() {
|
||||
EX void enable_flat_model(int val) {
|
||||
if(flat_on < 1 && flat_on + val >= 1) {
|
||||
#if CAP_GL
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
#endif
|
||||
pmodel = flat_model();
|
||||
backup_geometry = geometry;
|
||||
backup_pconf = pconf;
|
||||
geometry = gNormal;
|
||||
pmodel = mdDisk;
|
||||
pconf.alpha = 1;
|
||||
pconf.scale = 1;
|
||||
pconf.camera_angle = 0;
|
||||
pconf.stretch = 1;
|
||||
if(prod) pconf.alpha = 30, pconf.scale = 30;
|
||||
backup_always3 = vid.always3;
|
||||
vid.always3 = false;
|
||||
check_cgi();
|
||||
cgi.require_shapes();
|
||||
calcparam();
|
||||
}
|
||||
if(flat_on >= 1 && flat_on + val < 1) {
|
||||
geometry = backup_geometry;
|
||||
pconf = backup_pconf;
|
||||
vid.always3 = backup_always3;
|
||||
calcparam();
|
||||
check_cgi();
|
||||
}
|
||||
flat_on += val;
|
||||
}
|
||||
|
||||
#if HDR
|
||||
/** \brief enable the 'flat' model for drawing HUD. Use RAII so it will be switched back later */
|
||||
namespace stretch { extern ld factor; }
|
||||
|
||||
#if CAP_RAY
|
||||
namespace ray { extern bool in_use; }
|
||||
#endif
|
||||
|
||||
struct flat_model_enabler {
|
||||
projection_configuration bak;
|
||||
ld sf;
|
||||
bool ru;
|
||||
flat_model_enabler() {
|
||||
bak = pconf;
|
||||
sf = stretch::factor; stretch::factor = 0;
|
||||
#if CAP_RAY
|
||||
ru = ray::in_use; ray::in_use = false;
|
||||
#endif
|
||||
enable_flat_model();
|
||||
}
|
||||
~flat_model_enabler() {
|
||||
pconf = bak;
|
||||
stretch::factor = sf;
|
||||
#if CAP_RAY
|
||||
ray::in_use = ru;
|
||||
#endif
|
||||
calcparam();
|
||||
}
|
||||
flat_model_enabler() { enable_flat_model(+1); }
|
||||
~flat_model_enabler() { enable_flat_model(-1); }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user