Skip to content

Commit

Permalink
Update PPSSPP to v0.9.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
PGGB committed Mar 1, 2014
1 parent 3064b98 commit 6a10c15
Show file tree
Hide file tree
Showing 8 changed files with 185 additions and 72 deletions.
2 changes: 1 addition & 1 deletion Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.9.6</string>
<string>0.9.7.2</string>
<key>NSPrincipalClass</key>
<string>OEGameCoreController</string>
<key>OEGameCoreClass</key>
Expand Down
2 changes: 2 additions & 0 deletions NativeApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ void NativeInitGraphics()
gl_lost_manager_init();
}

void NativeResized(){}

void NativeRender()
{
glstate.Restore();
Expand Down
97 changes: 91 additions & 6 deletions PPSSPP.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions PPSSPPGameCore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ - (BOOL)loadFileAtPath:(NSString *)path error:(NSError **)error

_coreParam.renderWidth = 480;
_coreParam.renderHeight = 272;
_coreParam.outputWidth = 480;
_coreParam.outputHeight = 272;
_coreParam.pixelWidth = 480;
_coreParam.pixelHeight = 272;

Expand Down
5 changes: 4 additions & 1 deletion gfx/gl_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#endif
#else // OpenGL
// Now that glew is upgraded beyond 4.3, we can define MAY_HAVE_GLES3 on GL platforms
#define MAY_HAVE_GLES3 1
//#define MAY_HAVE_GLES3 1
//#include <GL/glew.h>
#if defined(__APPLE__)
#include <OpenGL/gl.h>
Expand All @@ -32,6 +32,9 @@
#endif

#define glDrawTextureNV
#define glBindFragDataLocationIndexed
#define glBindFragDataLocation glBindFragDataLocationEXT
#define GL_ONE_MINUS_SRC1_ALPHA GL_ONE_MINUS_SRC_ALPHA

#if !defined(GLchar) && !defined(__APPLE__)
typedef char GLchar;
Expand Down
141 changes: 81 additions & 60 deletions gfx_es2/fbo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct FBO {
FBOColorDepth colorDepth;
};

static FBO *g_overriddenBackbuffer;

// On PC, we always use GL_DEPTH24_STENCIL8.
// On Android, we try to use what's available.
Expand Down Expand Up @@ -244,72 +245,92 @@ void fbo_unbind() {
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, framebuffer);
}

void fbo_override_backbuffer(FBO *fbo) {
g_overriddenBackbuffer = fbo;
}

void fbo_bind_as_render_target(FBO *fbo) {
if (gl_extensions.FBO_ARB) {
if (gl_extensions.GLES3) {
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo->handle);
} else {
// This will collide with bind_for_read - but there's nothing in ES 2.0
// that actually separate them anyway of course, so doesn't matter.
glBindFramebuffer(GL_FRAMEBUFFER, fbo->handle);
}
}else{
#ifndef USING_GLES2
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo->handle);
if (true) {
#else
if (gl_extensions.GLES3) {
#endif
}
}

void fbo_bind_for_read(FBO *fbo) {
if (gl_extensions.FBO_ARB) {
if (gl_extensions.GLES3) {
glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo->handle);
} else {
// This will collide with bind_as_render_target - but there's nothing in ES 2.0
// that actually separate them anyway of course, so doesn't matter.
glBindFramebuffer(GL_FRAMEBUFFER, fbo->handle);
}
} else {
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo->handle);
} else {
// This will collide with bind_for_read - but there's nothing in ES 2.0
// that actually separate them anyway of course, so doesn't matter.
glBindFramebuffer(GL_FRAMEBUFFER, fbo->handle);
}
}else{
#ifndef USING_GLES2
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo->handle);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo->handle);
#endif
}
}
}
}

void fbo_bind_color_as_texture(FBO *fbo, int color) {
if (fbo) {
glBindTexture(GL_TEXTURE_2D, fbo->color_texture);
}
}

void fbo_destroy(FBO *fbo) {
if (gl_extensions.FBO_ARB) {
glBindFramebuffer(GL_FRAMEBUFFER, fbo->handle);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, 0);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glDeleteFramebuffers(1, &fbo->handle);
glDeleteRenderbuffers(1, &fbo->z_stencil_buffer);
} else {
void fbo_bind_for_read(FBO *fbo) {
if (gl_extensions.FBO_ARB) {
#ifndef USING_GLES2
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo->handle);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glDeleteFramebuffersEXT(1, &fbo->handle);
glDeleteRenderbuffersEXT(1, &fbo->z_stencil_buffer);
if (true) {
#else
if (gl_extensions.GLES3) {
#endif
}

glDeleteTextures(1, &fbo->color_texture);
delete fbo;
}

void fbo_get_dimensions(FBO *fbo, int *w, int *h) {
*w = fbo->width;
*h = fbo->height;
}

int fbo_get_color_texture(FBO *fbo) {
return fbo->color_texture;
}
glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo->handle);
} else {
// This will collide with bind_as_render_target - but there's nothing in ES 2.0
// that actually separate them anyway of course, so doesn't matter.
glBindFramebuffer(GL_FRAMEBUFFER, fbo->handle);
}
} else {
#ifndef USING_GLES2
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo->handle);
#endif
}
}

void fbo_bind_color_as_texture(FBO *fbo, int color) {
if (fbo) {
glBindTexture(GL_TEXTURE_2D, fbo->color_texture);
}
}

void fbo_destroy(FBO *fbo) {
if (gl_extensions.FBO_ARB) {
glBindFramebuffer(GL_FRAMEBUFFER, fbo->handle);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, 0);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
glDeleteFramebuffers(1, &fbo->handle);
glDeleteRenderbuffers(1, &fbo->z_stencil_buffer);
} else {
#ifndef USING_GLES2
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo->handle);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER_EXT, 0);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glDeleteFramebuffersEXT(1, &fbo->handle);
glDeleteRenderbuffersEXT(1, &fbo->z_stencil_buffer);
#endif
}

glDeleteTextures(1, &fbo->color_texture);
delete fbo;
}

void fbo_get_dimensions(FBO *fbo, int *w, int *h) {
*w = fbo->width;
*h = fbo->height;
}

int fbo_get_color_texture(FBO *fbo) {
return fbo->color_texture;
}

int fbo_get_depth_buffer(FBO *fbo) {
return fbo->z_buffer;
}

int fbo_get_stencil_buffer(FBO *fbo) {
return fbo->stencil_buffer;
}
6 changes: 5 additions & 1 deletion gfx_es2/fbo.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ void fbo_unbind();
void fbo_destroy(FBO *fbo);
void fbo_get_dimensions(FBO *fbo, int *w, int *h);

int fbo_get_color_texture(FBO *fbo);
int fbo_get_color_texture(FBO *fbo);
int fbo_get_depth_buffer(FBO *fbo);
int fbo_get_stencil_buffer(FBO *fbo);

void fbo_override_backbuffer(FBO *fbo); // Makes unbind bind this instead of the real backbuffer.
2 changes: 1 addition & 1 deletion ppsspp
Submodule ppsspp updated 365 files

0 comments on commit 6a10c15

Please sign in to comment.