EMI: Always write sprites to the depth buffer.

This commit is contained in:
Joni Vähämäki 2014-08-05 23:09:16 +03:00
parent ee24b2c12f
commit 398f2afa98
3 changed files with 7 additions and 15 deletions

View file

@ -878,13 +878,7 @@ void GfxOpenGL::drawSprite(const Sprite *sprite) {
} }
if (g_grim->getGameType() == GType_MONKEY4) { if (g_grim->getGameType() == GType_MONKEY4) {
if (_currentActor->isInOverworld()) { glDepthMask(GL_TRUE);
// The Overworld actors don't have a proper sort order
// so we rely on the z coordinates
glDepthMask(GL_TRUE);
} else {
glDepthMask(GL_FALSE);
}
float halfWidth = sprite->_width / 2; float halfWidth = sprite->_width / 2;
float halfHeight = sprite->_height / 2; float halfHeight = sprite->_height / 2;

View file

@ -964,7 +964,11 @@ void GfxOpenGLS::drawModelFace(const Mesh *mesh, const MeshFace *face) {
} }
void GfxOpenGLS::drawSprite(const Sprite *sprite) { void GfxOpenGLS::drawSprite(const Sprite *sprite) {
glDepthMask(GL_FALSE); if (g_grim->getGameType() == GType_MONKEY4) {
glDepthMask(GL_TRUE);
} else {
glDepthMask(GL_FALSE);
}
if (sprite->_blendMode == Sprite::BlendAdditive) { if (sprite->_blendMode == Sprite::BlendAdditive) {
glBlendFunc(GL_SRC_ALPHA, GL_ONE); glBlendFunc(GL_SRC_ALPHA, GL_ONE);

View file

@ -876,13 +876,7 @@ void GfxTinyGL::drawSprite(const Sprite *sprite) {
} }
if (g_grim->getGameType() == GType_MONKEY4) { if (g_grim->getGameType() == GType_MONKEY4) {
if (_currentActor->isInOverworld()) { tglDepthMask(TGL_TRUE);
// The Overworld actors don't have a proper sort order
// so we rely on the z coordinates
tglDepthMask(TGL_TRUE);
} else {
tglDepthMask(TGL_FALSE);
}
float halfWidth = sprite->_width / 2; float halfWidth = sprite->_width / 2;
float halfHeight = sprite->_height / 2; float halfHeight = sprite->_height / 2;