mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-08-04 04:43:57 +00:00
ads-game:: model permanently switched to underlying geometry
This commit is contained in:
parent
de859c35aa
commit
22ef01964a
@ -47,10 +47,27 @@ void run_ads_game() {
|
|||||||
ci_at[c].rocks.clear();
|
ci_at[c].rocks.clear();
|
||||||
});
|
});
|
||||||
vctrV = new_vctrV = ads_matrix(Id, 0);
|
vctrV = new_vctrV = ads_matrix(Id, 0);
|
||||||
rogueviz::rv_hook(hooks_prestats, 100, view_ads_game);
|
rogueviz::rv_hook(hooks_frame, 100, view_ads_game);
|
||||||
|
rogueviz::rv_hook(hooks_prestats, 100, display_rsrc);
|
||||||
rogueviz::rv_hook(hooks_handleKey, 0, handleKey);
|
rogueviz::rv_hook(hooks_handleKey, 0, handleKey);
|
||||||
rogueviz::rv_hook(shmup::hooks_turn, 0, ads_turn);
|
rogueviz::rv_hook(shmup::hooks_turn, 0, ads_turn);
|
||||||
init_rsrc();
|
init_rsrc();
|
||||||
|
|
||||||
|
cgi.use_count++;
|
||||||
|
hybrid::in_underlying_geometry([] {
|
||||||
|
cgi.use_count++;
|
||||||
|
});
|
||||||
|
|
||||||
|
auto umap = hybrid::get_umap();
|
||||||
|
hybrid::actual_geometry = geometry;
|
||||||
|
geometry = hybrid::underlying;
|
||||||
|
hybrid::underlying_cgip->single_step = cgi.single_step;
|
||||||
|
hybrid::underlying_cgip->psl_steps = cgi.psl_steps;
|
||||||
|
cgip = hybrid::underlying_cgip;
|
||||||
|
hybrid::pmap = currentmap;
|
||||||
|
currentmap = umap;
|
||||||
|
pmodel = mdDisk;
|
||||||
|
cwt.at = centerover = currentmap->gamestart();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto shot_hooks =
|
auto shot_hooks =
|
||||||
|
@ -108,6 +108,8 @@ bool ads_turn(int idelta) {
|
|||||||
ld delta = idelta / anims::period;
|
ld delta = idelta / anims::period;
|
||||||
|
|
||||||
if(!(cmode & sm::NORMAL)) return false;
|
if(!(cmode & sm::NORMAL)) return false;
|
||||||
|
|
||||||
|
hybrid::in_actual([&] {
|
||||||
|
|
||||||
handle_crashes();
|
handle_crashes();
|
||||||
|
|
||||||
@ -136,6 +138,8 @@ bool ads_turn(int idelta) {
|
|||||||
if(a[16+7] && !la[16+7]) auto_rotate = !auto_rotate;
|
if(a[16+7] && !la[16+7]) auto_rotate = !auto_rotate;
|
||||||
if(a[16+8] && !la[16+8]) pushScreen(game_menu);
|
if(a[16+8] && !la[16+8]) pushScreen(game_menu);
|
||||||
|
|
||||||
|
if(auto_angle) pconf.model_orientation += ang;
|
||||||
|
|
||||||
if(true) {
|
if(true) {
|
||||||
|
|
||||||
/* proper time passed */
|
/* proper time passed */
|
||||||
@ -204,9 +208,12 @@ bool ads_turn(int idelta) {
|
|||||||
}
|
}
|
||||||
else view_pt += tc;
|
else view_pt += tc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(auto_angle) pconf.model_orientation -= ang;
|
||||||
|
|
||||||
fixmatrix_ads(current.T);
|
fixmatrix_ads(current.T);
|
||||||
fixmatrix_ads(vctrV.T);
|
fixmatrix_ads(vctrV.T);
|
||||||
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -127,15 +127,18 @@ void draw_game_cell(cell *cs, ads_matrix V, ld plev) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool view_ads_game() {
|
void view_ads_game() {
|
||||||
auto plev = cgi.plevel; /* we are in another CGI so we have no access to that... */
|
ld plev;
|
||||||
gen_budget = 3;
|
|
||||||
displayed.clear();
|
displayed.clear();
|
||||||
|
|
||||||
vctr = new_vctr;
|
hybrid::in_actual([&] {
|
||||||
vctrV = new_vctrV;
|
plev = cgi.plevel; /* we are in another CGI so we have no access to that... */
|
||||||
cross_result base;
|
gen_budget = 3;
|
||||||
if(1) {
|
|
||||||
|
vctr = new_vctr;
|
||||||
|
vctrV = new_vctrV;
|
||||||
|
cross_result base;
|
||||||
|
|
||||||
// todo rebase
|
// todo rebase
|
||||||
base = findflat(ads_point(C0, 0));
|
base = findflat(ads_point(C0, 0));
|
||||||
// println(hlog, base.h);
|
// println(hlog, base.h);
|
||||||
@ -161,19 +164,13 @@ bool view_ads_game() {
|
|||||||
else { current = bcurrent; }
|
else { current = bcurrent; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
);
|
||||||
// current = current * gpushxto0(p);
|
// current = current * gpushxto0(p);
|
||||||
// vctrV = rgpushxto0(p) * vctrV;
|
// vctrV = rgpushxto0(p) * vctrV;
|
||||||
|
|
||||||
hybrid::in_underlying_geometry([&] {
|
if(1) {
|
||||||
dynamicval<eModel> p(pmodel, mdDisk);
|
|
||||||
check_cgi();
|
|
||||||
cgi.require_basics();
|
|
||||||
cgi.require_shapes();
|
|
||||||
ptds.clear();
|
|
||||||
calcparam();
|
|
||||||
clearaura();
|
|
||||||
make_shape();
|
make_shape();
|
||||||
|
|
||||||
set<cell*> visited;
|
set<cell*> visited;
|
||||||
queue<pair<cell*, ads_matrix>> dq;
|
queue<pair<cell*, ads_matrix>> dq;
|
||||||
auto visit = [&] (cell *c, const ads_matrix& V) {
|
auto visit = [&] (cell *c, const ads_matrix& V) {
|
||||||
@ -229,15 +226,7 @@ bool view_ads_game() {
|
|||||||
string str = format(tformat, view_pt / TAU);
|
string str = format(tformat, view_pt / TAU);
|
||||||
queuestr(shiftless(Id), .1, str, 0xFFFF00, 8);
|
queuestr(shiftless(Id), .1, str, 0xFFFF00, 8);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(false) queuepolyat(shiftless(rgpushxto0(base.h)), cgi.shGem[0], 0x2020FFFF, PPR::LINE);
|
|
||||||
|
|
||||||
drawqueue();
|
|
||||||
drawaura();
|
|
||||||
});
|
|
||||||
check_cgi();
|
|
||||||
display_rsrc();
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
@ -68,4 +68,6 @@ ld how_much_invincibility = TAU / 4;
|
|||||||
|
|
||||||
player_data pdata, max_pdata, tank_pdata;
|
player_data pdata, max_pdata, tank_pdata;
|
||||||
|
|
||||||
|
bool auto_angle = true;
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
@ -84,7 +84,7 @@ void display(int id, int y, ld val, ld maxv, ld tank, ld unit) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_rsrc() {
|
bool display_rsrc() {
|
||||||
dynamicval<eGeometry> g(geometry, gEuclid);
|
dynamicval<eGeometry> g(geometry, gEuclid);
|
||||||
dynamicval<eModel> pm(pmodel, mdDisk);
|
dynamicval<eModel> pm(pmodel, mdDisk);
|
||||||
dynamicval<bool> ga(vid.always3, false);
|
dynamicval<bool> ga(vid.always3, false);
|
||||||
@ -102,6 +102,7 @@ void display_rsrc() {
|
|||||||
#undef D
|
#undef D
|
||||||
|
|
||||||
quickqueue();
|
quickqueue();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void gain_resource(eResourceType rsrc) {
|
void gain_resource(eResourceType rsrc) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user