|
|
@ -665,6 +665,56 @@ TEST_CASE("Bitmaps") {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SUBCASE("BitmapMoveOffscreenLeft") {
|
|
|
|
|
|
|
|
// first, assemble a visual equivalent to 2x2 cells
|
|
|
|
|
|
|
|
auto y = nc_->tcache.cellpixy * 2;
|
|
|
|
|
|
|
|
auto x = nc_->tcache.cellpixx * 2;
|
|
|
|
|
|
|
|
std::vector<uint32_t> v(x * y * 4, htole(0xffccccff));
|
|
|
|
|
|
|
|
auto ncv = ncvisual_from_rgba(v.data(), y, sizeof(decltype(v)::value_type) * x, x);
|
|
|
|
|
|
|
|
REQUIRE(nullptr != ncv);
|
|
|
|
|
|
|
|
struct ncvisual_options vopts = {
|
|
|
|
|
|
|
|
.n = nullptr,
|
|
|
|
|
|
|
|
.scaling = NCSCALE_NONE,
|
|
|
|
|
|
|
|
.y = 0, .x = 0,
|
|
|
|
|
|
|
|
.begy = 0, .begx = 0,
|
|
|
|
|
|
|
|
.leny = 0, .lenx = 0,
|
|
|
|
|
|
|
|
.blitter = NCBLIT_PIXEL,
|
|
|
|
|
|
|
|
.flags = NCVISUAL_OPTION_NODEGRADE,
|
|
|
|
|
|
|
|
.transcolor = 0,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
auto n = ncvisual_render(nc_, ncv, &vopts);
|
|
|
|
|
|
|
|
for(int i = 0 ; i <= ncplane_dim_x(n_) ; ++i){
|
|
|
|
|
|
|
|
CHECK(0 == ncplane_move_yx(n, 0, i));
|
|
|
|
|
|
|
|
CHECK(0 == notcurses_render(nc_));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
REQUIRE(nullptr != n);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SUBCASE("BitmapMoveOffscreenRight") {
|
|
|
|
|
|
|
|
// first, assemble a visual equivalent to 2x2 cells
|
|
|
|
|
|
|
|
auto y = nc_->tcache.cellpixy * 2;
|
|
|
|
|
|
|
|
auto x = nc_->tcache.cellpixx * 2;
|
|
|
|
|
|
|
|
std::vector<uint32_t> v(x * y * 4, htole(0xffccccff));
|
|
|
|
|
|
|
|
auto ncv = ncvisual_from_rgba(v.data(), y, sizeof(decltype(v)::value_type) * x, x);
|
|
|
|
|
|
|
|
REQUIRE(nullptr != ncv);
|
|
|
|
|
|
|
|
struct ncvisual_options vopts = {
|
|
|
|
|
|
|
|
.n = nullptr,
|
|
|
|
|
|
|
|
.scaling = NCSCALE_NONE,
|
|
|
|
|
|
|
|
.y = 0, .x = ncplane_dim_x(n_) - 3,
|
|
|
|
|
|
|
|
.begy = 0, .begx = 0,
|
|
|
|
|
|
|
|
.leny = 0, .lenx = 0,
|
|
|
|
|
|
|
|
.blitter = NCBLIT_PIXEL,
|
|
|
|
|
|
|
|
.flags = NCVISUAL_OPTION_NODEGRADE,
|
|
|
|
|
|
|
|
.transcolor = 0,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
auto n = ncvisual_render(nc_, ncv, &vopts);
|
|
|
|
|
|
|
|
for(int i = ncplane_dim_x(n_) - 3 ; i >= 0 ; --i){
|
|
|
|
|
|
|
|
CHECK(0 == ncplane_move_yx(n, 0, i));
|
|
|
|
|
|
|
|
CHECK(0 == notcurses_render(nc_));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
REQUIRE(nullptr != n);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SUBCASE("BitmapMoveOffscreenDown") {
|
|
|
|
SUBCASE("BitmapMoveOffscreenDown") {
|
|
|
|
// first, assemble a visual equivalent to 2x2 cells
|
|
|
|
// first, assemble a visual equivalent to 2x2 cells
|
|
|
|
auto y = nc_->tcache.cellpixy * 2;
|
|
|
|
auto y = nc_->tcache.cellpixy * 2;
|
|
|
|