1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

dual:: changed the default geometries in shmup, also removed redundant scales and added missing PHASEFROM

This commit is contained in:
Zeno Rogue 2019-05-29 21:30:34 +02:00
parent 1e07644c43
commit 029463d509

View File

@ -75,17 +75,16 @@ namespace dual {
int main_side; int main_side;
gamedata dgd[2]; gamedata dgd[2];
ld scales[2];
transmatrix player_orientation[2]; transmatrix player_orientation[2];
void switch_to(int k) { void switch_to(int k) {
if(k != currently_loaded) { if(k != currently_loaded) {
scales[currently_loaded] = vid.scale; // gamedata has shmup::on because tutorial needs changing it, but dual should keep it fixed
dynamicval<bool> smon(shmup::on);
player_orientation[currently_loaded] = gpushxto0(tC0(cwtV)) * cwtV; player_orientation[currently_loaded] = gpushxto0(tC0(cwtV)) * cwtV;
dgd[currently_loaded].storegame(); dgd[currently_loaded].storegame();
currently_loaded = k; currently_loaded = k;
dgd[currently_loaded].restoregame(); dgd[currently_loaded].restoregame();
vid.scale = scales[currently_loaded];
} }
} }
@ -181,13 +180,29 @@ namespace dual {
void enable() { void enable() {
if(dual::state) return; if(dual::state) return;
stop_game(); stop_game();
eGeometry b = geometry;
eVariation v = variation;
for(int s=0; s<2; s++) { for(int s=0; s<2; s++) {
// dynamicval<display_data*> pds(current_display, &subscreens::player_displays[s]); // dynamicval<display_data*> pds(current_display, &subscreens::player_displays[s]);
variation = eVariation::pure; if(shmup::on) {
geometry = s == 0 ? gEuclidSquare : gArchimedean; geometry = b;
variation = v;
// 'do what I mean'
if(euclid)
geometry = s == 0 ? b : (ginf[geometry].vertex == 3 ? gNormal : g45);
else
geometry = s == 0 ? (ginf[geometry].vertex == 3 ? gEuclid : gEuclidSquare) : b;
if(geometry == gEuclid) variation = eVariation::bitruncated;
}
else {
variation = eVariation::pure;
geometry = s == 0 ? gEuclidSquare : gArchimedean;
}
firstland = specialland = laCrossroads4; firstland = specialland = laCrossroads4;
arcm::current.parse("4,4,4,4,4"); if(geometry == gArchimedean)
scales[s] = vid.scale; arcm::current.parse("4,4,4,4,4");
check_cgi();
cgi.require_basics();
dgd[s].storegame(); dgd[s].storegame();
} }
@ -207,14 +222,17 @@ namespace dual {
if(0) ; if(0) ;
else if(argis("-dual0")) { else if(argis("-dual0")) {
PHASEFROM(2);
enable(); enable();
switch_to(0); switch_to(0);
} }
else if(argis("-dual1")) { else if(argis("-dual1")) {
PHASEFROM(2);
enable(); enable();
switch_to(1); switch_to(1);
} }
else if(argis("-dualoff")) { else if(argis("-dualoff")) {
PHASEFROM(2);
disable(); disable();
} }
else return 1; else return 1;