Skip to content

Commit

Permalink
Merge pull request #6067 from raven02/patch-56
Browse files Browse the repository at this point in the history
Make the EstimateDrawingSize() simpler
  • Loading branch information
hrydgard committed May 14, 2014
2 parents 642bb37 + 8664fba commit c31a1b1
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions GPU/GLES/Framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,34 +618,25 @@ static void EstimateDrawingSize(int &drawing_width, int &drawing_height) {

DEBUG_LOG(SCEGE,"viewport : %ix%i, region : %ix%i , scissor: %ix%i, stride: %i, %i", viewport_width,viewport_height, region_width, region_height, scissor_width, scissor_height, fb_stride, gstate.isModeThrough());

// Viewport may return 0x0 for example FF Type-0 and we set it to 480x272
// Viewport may return 0x0 for example FF Type-0 / God of War and we set it to 480x272
if (viewport_width <= 1 && viewport_height <=1) {
viewport_width = default_width;
viewport_height = default_height;
}

if (fb_stride > 0 && fb_stride < 512) {
// Correct scissor size has to be used to render like character shadow in Mortal Kombat .
if (fb_stride == scissor_width && region_width != scissor_width) {
drawing_width = scissor_width;
drawing_height = scissor_height;
} else {
drawing_width = viewport_width;
drawing_height = viewport_height;
}
} else {
// Correct region size has to be used when fb_width equals to region_width for exmaple GTA/Midnight Club/MSG Peace Maker .
if (fb_stride == region_width && region_width == viewport_width) {
drawing_width = region_width;
drawing_height = region_height;
} else if (fb_stride == viewport_width) {
if (fb_stride > 0 && fb_stride <= 512) {
if (fb_stride == viewport_width) {
drawing_width = viewport_width;
drawing_height = viewport_height;
} else {
drawing_width = default_width;
drawing_height = default_height;
drawing_width = scissor_width;
drawing_height = scissor_height;
}
} else {
drawing_width = default_width;
drawing_height = default_height;
}

}

void FramebufferManager::DestroyFramebuf(VirtualFramebuffer *v) {
Expand Down

0 comments on commit c31a1b1

Please sign in to comment.