mirror of
https://github.com/FunKey-Project/RetroFE.git
synced 2025-12-12 17:58:53 +01:00
BUG correction: tests for disabling or not dithering was also disabling cache for scaling, so scaling was recomputed at every frame
Signed-off-by: Vincent-FK <vincent.buso@funkey-project.com>
This commit is contained in:
parent
2530514e55
commit
260178ef44
@ -87,7 +87,7 @@ void Image::allocateGraphicsMemory()
|
||||
}
|
||||
|
||||
/* Convert to RGB 32bit if necessary */
|
||||
if(img_tmp->format->BitsPerPixel != 32){
|
||||
if(imgBitsPerPx_ != 32){
|
||||
texture_ = SDL_CreateRGBSurface(0, img_tmp->w, img_tmp->h, 32, 0, 0, 0, 0);
|
||||
SDL_BlitSurface(img_tmp, NULL, texture_, NULL);
|
||||
|
||||
@ -135,13 +135,15 @@ void Image::draw()
|
||||
scaling_needed = rect.w!=0 && rect.h!=0 && (texture_->w != rect.w || texture_->h != rect.h);
|
||||
if(scaling_needed){
|
||||
cache_scaling_needed = (texture_prescaled_ == NULL)?true:(texture_prescaled_->w != rect.w || texture_prescaled_->h != rect.h);
|
||||
if(cache_scaling_needed && imgBitsPerPx_ > 16 && ditheringAuthorized_){
|
||||
needDithering_ = true;
|
||||
if(cache_scaling_needed){
|
||||
texture_prescaled_ = SDL::zoomSurface(texture_, NULL, &rect);
|
||||
if(texture_prescaled_ == NULL){
|
||||
printf("ERROR in %s - Could not create texture_prescaled_\n", __func__);
|
||||
use_prescaled = false;
|
||||
}
|
||||
if(imgBitsPerPx_ > 16 && ditheringAuthorized_){
|
||||
needDithering_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(texture_prescaled_ != NULL){
|
||||
@ -159,11 +161,11 @@ void Image::draw()
|
||||
}
|
||||
|
||||
/* Dithering */
|
||||
/*if(needDithering_){
|
||||
printf("Dither: %s\n", file_.c_str());
|
||||
if(needDithering_){
|
||||
//printf("Dither: %s\n", file_.c_str());
|
||||
SDL::ditherSurface32bppTo16Bpp(surfaceToRender);
|
||||
needDithering_ = false;
|
||||
}*/
|
||||
}
|
||||
|
||||
/* Render */
|
||||
SDL::renderCopy(surfaceToRender, baseViewInfo.Alpha, NULL, &rect, baseViewInfo);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user