Skip to content

Commit

Permalink
Alternative framebuffer approach
Browse files Browse the repository at this point in the history
  • Loading branch information
raven02 committed Mar 18, 2014
1 parent 44e9484 commit 9a4c17e
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions GPU/GLES/Framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,26 +617,11 @@ static void EstimateDrawingSize(int &drawing_width, int &drawing_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;
}
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) {
drawing_width = viewport_width;
drawing_height = viewport_height;
} else {
drawing_width = default_width;
drawing_height = default_height;
}
drawing_width = region_width;
drawing_height = region_height;
}
}

Expand Down Expand Up @@ -721,19 +706,14 @@ void FramebufferManager::SetRenderFrameBuffer() {
VirtualFramebuffer *vfb = 0;
for (size_t i = 0; i < vfbs_.size(); ++i) {
VirtualFramebuffer *v = vfbs_[i];
if (MaskedEqual(v->fb_address, fb_address)) {
if (MaskedEqual(v->fb_address, fb_address) && v->format == fmt) {
vfb = v;
// Update fb stride in case it changed
vfb->fb_stride = fb_stride;
if (v->width < drawing_width && v->height < drawing_height) {
v->width = drawing_width;
v->height = drawing_height;
}
if (v->format != fmt) {
v->width = drawing_width;
v->height = drawing_height;
v->format = fmt;
}
break;
}
}
Expand Down

0 comments on commit 9a4c17e

Please sign in to comment.