[ncplayer] use unique_ptr for view plane

pull/1477/head
nick black 3 years ago committed by Nick Black
parent 6d4635fc5b
commit 0100e26d62

@ -346,11 +346,8 @@ int rendered_mode_player_inner(NotCurses& nc, int argc, char** argv,
nopts.rows = dimy - 1; // don't want kitty to scroll on pixels FIXME nopts.rows = dimy - 1; // don't want kitty to scroll on pixels FIXME
nopts.cols = dimx; nopts.cols = dimx;
nopts.resizecb = ncplane_resize_maximize; nopts.resizecb = ncplane_resize_maximize;
struct ncplane* n = ncplane_create(*stdn, &nopts); // FIXME make c++ style auto n = std::make_unique<Plane>(*stdn, &nopts);
if(!n){ n->move_bottom();
return -1;
}
ncplane_move_bottom(n);
for(auto i = 0 ; i < argc ; ++i){ for(auto i = 0 ; i < argc ; ++i){
std::unique_ptr<Visual> ncv; std::unique_ptr<Visual> ncv;
ncv = std::make_unique<Visual>(argv[i]); ncv = std::make_unique<Visual>(argv[i]);
@ -359,13 +356,13 @@ int rendered_mode_player_inner(NotCurses& nc, int argc, char** argv,
vopts.flags |= NCVISUAL_OPTION_HORALIGNED | NCVISUAL_OPTION_VERALIGNED; vopts.flags |= NCVISUAL_OPTION_HORALIGNED | NCVISUAL_OPTION_VERALIGNED;
vopts.y = NCALIGN_CENTER; vopts.y = NCALIGN_CENTER;
vopts.x = NCALIGN_CENTER; vopts.x = NCALIGN_CENTER;
vopts.n = n; vopts.n = *n;
vopts.scaling = scalemode; vopts.scaling = scalemode;
vopts.blitter = blitter; vopts.blitter = blitter;
if(vopts.blitter == NCBLIT_PIXEL){ if(vopts.blitter == NCBLIT_PIXEL){
notcurses_check_pixel_support(nc); notcurses_check_pixel_support(nc);
} }
ncplane_erase(n); n->erase();
do{ do{
struct marshal marsh = { struct marshal marsh = {
.subtitle_plane = nullptr, .subtitle_plane = nullptr,

Loading…
Cancel
Save