[cblit] x/y mixup in geom calculations

This commit is contained in:
nick black 2021-11-01 14:49:00 -04:00 committed by nick black
parent 55eec67a23
commit 1cc597698a

View File

@ -403,6 +403,10 @@ int ncvisual_geom_inner(const tinfo* ti, const ncvisual* n,
geom->rcellx = *outx / ti->cellpixx + !!(*outx % ti->cellpixx); geom->rcellx = *outx / ti->cellpixx + !!(*outx % ti->cellpixx);
geom->rcelly = *outy / ti->cellpixy + !!(*outy % ti->cellpixy); geom->rcelly = *outy / ti->cellpixy + !!(*outy % ti->cellpixy);
}else{ // cellblit }else{ // cellblit
if(vopts->pxoffx || vopts->pxoffy){
logerror("pixel offsets cannot be used with cell blitting\n");
return -1;
}
int dispcols, disprows; int dispcols, disprows;
if(vopts->n == NULL || (vopts->flags & NCVISUAL_OPTION_CHILDPLANE)){ // create plane if(vopts->n == NULL || (vopts->flags & NCVISUAL_OPTION_CHILDPLANE)){ // create plane
if(scaling == NCSCALE_NONE || scaling == NCSCALE_NONE_HIRES){ if(scaling == NCSCALE_NONE || scaling == NCSCALE_NONE_HIRES){
@ -422,10 +426,6 @@ int ncvisual_geom_inner(const tinfo* ti, const ncvisual* n,
} // else stretch } // else stretch
} }
}else{ }else{
if(vopts->pxoffx || vopts->pxoffy){
logerror("pixel offsets cannot be used with cell blitting\n");
return -1;
}
if(scaling == NCSCALE_NONE || scaling == NCSCALE_NONE_HIRES){ if(scaling == NCSCALE_NONE || scaling == NCSCALE_NONE_HIRES){
dispcols = geom->lenx; dispcols = geom->lenx;
disprows = geom->leny; disprows = geom->leny;
@ -450,8 +450,8 @@ int ncvisual_geom_inner(const tinfo* ti, const ncvisual* n,
*placey = ncplane_valign(vopts->n, *placey, disprows / geom->scaley); *placey = ncplane_valign(vopts->n, *placey, disprows / geom->scaley);
} }
} }
geom->rcelly = dispcols; geom->rcelly = disprows;
geom->rcellx = disprows; geom->rcellx = dispcols;
geom->rpixy = geom->leny; geom->rpixy = geom->leny;
geom->rpixx = geom->lenx; geom->rpixx = geom->lenx;
} }