From 3c34256867f41d60e0b5b40718caf8f99b2da2fe Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 27 Aug 2016 01:42:07 +0000 Subject: [PATCH] Fix a software mode crash bug involving bad animation flags set on tiles git-svn-id: https://svn.eduke32.com/eduke32@5836 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/a-c.c | 4 +++- polymer/eduke32/build/src/engine.c | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/polymer/eduke32/build/src/a-c.c b/polymer/eduke32/build/src/a-c.c index e2fb4962e..bd9d11658 100644 --- a/polymer/eduke32/build/src/a-c.c +++ b/polymer/eduke32/build/src/a-c.c @@ -63,6 +63,8 @@ void setpalookupaddress(char *paladdr) { ghlinepal = paladdr; } void setuphlineasm4(int32_t bxinc, int32_t byinc) { gbxinc = bxinc; gbyinc = byinc; } void hlineasm4(bssize_t cnt, int32_t skiploadincs, int32_t paloffs, uint32_t by, uint32_t bx, intptr_t p) { + Bassert(gbuf); + if (!skiploadincs) { gbxinc = asm1; gbyinc = asm2; } const char *const A_C_RESTRICT palptr = &ghlinepal[paloffs]; @@ -75,7 +77,7 @@ void hlineasm4(bssize_t cnt, int32_t skiploadincs, int32_t paloffs, uint32_t by, #ifdef CLASSIC_SLICE_BY_4 for (; cnt>=4; cnt-=4, pp-=4) { -#if 0 +#if 1 *pp = palptr[buf[((bx>>log32.x)<>log32.y)]]; *(pp-1) = palptr[buf[(((bx-inc.x)>>log32.x)<>log32.y)]]; *(pp-2) = palptr[buf[(((bx-(inc.x<<1))>>log32.x)<>log32.y)]]; diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index e69b9a7e6..fd36cc2bd 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -2639,11 +2639,11 @@ static int32_t setup_globals_cf1(const usectortype *sec, int32_t pal, int32_t zd globalpicnum = picnum; if ((unsigned)globalpicnum >= MAXTILES) globalpicnum = 0; + DO_TILE_ANIM(globalpicnum, 0); setgotpic(globalpicnum); if ((tilesiz[globalpicnum].x <= 0) || (tilesiz[globalpicnum].y <= 0)) return 1; - DO_TILE_ANIM(globalpicnum, 0); - if (waloff[globalpicnum] == 0) loadtile(globalpicnum); + globalbufplc = waloff[globalpicnum]; globalshade = shade; @@ -8699,9 +8699,9 @@ void drawmapview(int32_t dax, int32_t day, int32_t zoome, int16_t ang) } globalpicnum = sec->floorpicnum; if ((unsigned)globalpicnum >= (unsigned)MAXTILES) globalpicnum = 0; + DO_TILE_ANIM(globalpicnum, s); setgotpic(globalpicnum); if ((tilesiz[globalpicnum].x <= 0) || (tilesiz[globalpicnum].y <= 0)) continue; - DO_TILE_ANIM(globalpicnum, s); if (waloff[globalpicnum] == 0) loadtile(globalpicnum); globalbufplc = waloff[globalpicnum]; globalshade = max(min(sec->floorshade,numshades-1),0); @@ -8824,9 +8824,9 @@ void drawmapview(int32_t dax, int32_t day, int32_t zoome, int16_t ang) globalpicnum = spr->picnum; globalpal = spr->pal; // GL needs this, software doesn't if ((unsigned)globalpicnum >= (unsigned)MAXTILES) globalpicnum = 0; + DO_TILE_ANIM(globalpicnum, s); setgotpic(globalpicnum); if ((tilesiz[globalpicnum].x <= 0) || (tilesiz[globalpicnum].y <= 0)) continue; - DO_TILE_ANIM(globalpicnum, s); if (waloff[globalpicnum] == 0) loadtile(globalpicnum); globalbufplc = waloff[globalpicnum];