From d25dcbff17d90baee9582a1a88ec6e6e7e322f79 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Tue, 11 Jun 2013 20:03:39 +0000 Subject: [PATCH] Polymer: Fix one-sided y-flipped floor-aligned sprites, introduced in r3776. Add a test case in test_tileoffsets.map. git-svn-id: https://svn.eduke32.com/eduke32@3869 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymer.c | 12 ++++++++++-- .../package/samples/test_tileoffsets.map | Bin 12534 -> 12710 bytes 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 75d99c51a..7306a093c 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -1484,8 +1484,12 @@ void polymer_drawsprite(int32_t snum) } } - if ((tspr->cstat & 64) && ((tspr->cstat>>4) & 3)) + if ((tspr->cstat & 64) && (tspr->cstat & SPR_ALIGN_MASK)) + { + if ((tspr->cstat & SPR_ALIGN_MASK)==SPR_FLOOR && (tspr->cstat & SPR_YFLIP)) + SWITCH_CULL_DIRECTION; bglEnable(GL_CULL_FACE); + } if ((!depth || mirrors[depth-1].plane) && !pr_ati_nodepthoffset) bglEnable(GL_POLYGON_OFFSET_FILL); @@ -1495,8 +1499,12 @@ void polymer_drawsprite(int32_t snum) if ((!depth || mirrors[depth-1].plane) && !pr_ati_nodepthoffset) bglDisable(GL_POLYGON_OFFSET_FILL); - if ((tspr->cstat & 64) && ((tspr->cstat>>4) & 3)) + if ((tspr->cstat & 64) && (tspr->cstat & SPR_ALIGN_MASK)) + { + if ((tspr->cstat & SPR_ALIGN_MASK)==SPR_FLOOR && (tspr->cstat & SPR_YFLIP)) + SWITCH_CULL_DIRECTION; bglDisable(GL_CULL_FACE); + } } void polymer_setanimatesprites(animatespritesptr animatesprites, int32_t x, int32_t y, int32_t a, int32_t smoothratio) diff --git a/polymer/eduke32/package/samples/test_tileoffsets.map b/polymer/eduke32/package/samples/test_tileoffsets.map index 99d42370c4d05b994ae2e687cfddc6ecfe393b05..7682aa983a01d30409a34d8bb2b0629977b22e39 100644 GIT binary patch delta 99 zcmeyCxGZ_Y4kkvy%{!TF^#mCL85kJm05JyxLn^}}28PM}Y%&7D2*FH-#ZW