mirror of https://github.com/mgba-emu/mgba.git
GBA Video: Skip attempting to render offscreen sprites in OpenGL
This commit is contained in:
parent
7640c38684
commit
99e622eb43
1
CHANGES
1
CHANGES
|
@ -89,6 +89,7 @@ Misc:
|
||||||
- GBA: Allow pausing event loop while CPU is blocked
|
- GBA: Allow pausing event loop while CPU is blocked
|
||||||
- GBA BIOS: Division by zero should emit a FATAL error
|
- GBA BIOS: Division by zero should emit a FATAL error
|
||||||
- GBA Video: Convert OpenGL VRAM texture to integer
|
- GBA Video: Convert OpenGL VRAM texture to integer
|
||||||
|
- GBA Video: Skip attempting to render offscreen sprites in OpenGL
|
||||||
- Debugger: Keep track of global cycle count
|
- Debugger: Keep track of global cycle count
|
||||||
- FFmpeg: Add looping option for GIF/APNG
|
- FFmpeg: Add looping option for GIF/APNG
|
||||||
- mGUI: Show battery percentage
|
- mGUI: Show battery percentage
|
||||||
|
|
|
@ -1669,6 +1669,11 @@ void GBAVideoGLRendererDrawSprite(struct GBAVideoGLRenderer* renderer, struct GB
|
||||||
spriteY -= 256;
|
spriteY -= 256;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (x + totalWidth <= 0 || x >= GBA_VIDEO_HORIZONTAL_PIXELS) {
|
||||||
|
// These sprites aren't displayed but affect cycle counting
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const struct GBAVideoGLShader* shader = &renderer->objShader[GBAObjAttributesAGet256Color(sprite->a)];
|
const struct GBAVideoGLShader* shader = &renderer->objShader[GBAObjAttributesAGet256Color(sprite->a)];
|
||||||
const GLuint* uniforms = shader->uniforms;
|
const GLuint* uniforms = shader->uniforms;
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, renderer->fbo[GBA_GL_FBO_OBJ]);
|
glBindFramebuffer(GL_FRAMEBUFFER, renderer->fbo[GBA_GL_FBO_OBJ]);
|
||||||
|
|
Loading…
Reference in New Issue