diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index c408be190..d5a6f5175 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -2234,7 +2234,7 @@ DETONATE: A_FindPlayer(s, &x); - if (x < 2048) + if (x < VIEWSCREEN_ACTIVE_DISTANCE) { if (SP == 1) g_curViewscreen = i; diff --git a/polymer/eduke32/source/demo.c b/polymer/eduke32/source/demo.c index dbd336238..8e47349e7 100644 --- a/polymer/eduke32/source/demo.c +++ b/polymer/eduke32/source/demo.c @@ -959,10 +959,7 @@ nextdemo_nomenu: G_PrintGameQuotes(screenpeek); if (ud.last_camsprite != ud.camerasprite) - { ud.last_camsprite = ud.camerasprite; -// ud.camera_time = totalclock+(TICRATE*2); - } if (VOLUMEONE) { diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index b48162f32..57ce8d95e 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -2526,7 +2526,7 @@ static void G_PrintCoords(int32_t snum) y += 7; Bsprintf(tempbuf,"THOLD= %d", ps->transporter_hold); printext256(x,y+54,31,-1,tempbuf,0); - Bsprintf(tempbuf,"GAMETIC= %d",g_moveThingsCount); + Bsprintf(tempbuf,"GAMETIC= %d, TOTALCLOCK=%d", g_moveThingsCount, totalclock); printext256(x,y+63,31,-1,tempbuf,0); #ifdef DEBUGGINGAIDS Bsprintf(tempbuf,"NUMSPRITES= %d", Numsprites); @@ -7435,7 +7435,7 @@ void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t oura, int32_t smoo t->xrepeat += 8; t->yrepeat += 8; } - else if (g_curViewscreen >= 0 && OW != i && display_mirror != 3 && waloff[TILE_VIEWSCR] && walock[TILE_VIEWSCR] > 200 ) + else if (g_curViewscreen >= 0 && OW != i && display_mirror != 3 && waloff[TILE_VIEWSCR] && walock[TILE_VIEWSCR] > 200) { // this exposes a sprite sorting issue which needs to be debugged further... #if 0 diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 4f3ad6d05..d06e980f8 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -1626,8 +1626,10 @@ void G_ResetTimers(uint8_t keepgtics) totalclock = cloudtotalclock = ototalclock = lockclock = 0; ready2send = 1; g_levelTextTime = 85; + if (!keepgtics) g_moveThingsCount = 0; + if (g_curViewscreen >= 0) actor[g_curViewscreen].t_data[0] = 0; } diff --git a/polymer/eduke32/source/premap.h b/polymer/eduke32/source/premap.h index 04b2a5d83..250294fab 100644 --- a/polymer/eduke32/source/premap.h +++ b/polymer/eduke32/source/premap.h @@ -55,7 +55,6 @@ void P_ResetPlayer(int32_t snum); void P_ResetStatus(int32_t snum); void P_ResetWeapons(int32_t snum); void G_ClearFIFO(void); -void G_SetupCamTile(int32_t i,int32_t wn); void G_ResetInterpolations(void); #ifdef __cplusplus diff --git a/polymer/eduke32/source/sector.c b/polymer/eduke32/source/sector.c index 084e33112..ce6da6983 100644 --- a/polymer/eduke32/source/sector.c +++ b/polymer/eduke32/source/sector.c @@ -363,9 +363,9 @@ int32_t SetAnimation(int32_t animsect,int32_t *animptr, int32_t thegoal, int32_t return j; } -void G_SetupCamTile(int32_t i, int32_t wn) +static void G_SetupCamTile(int32_t i, int32_t wn) { - int32_t const mir = display_mirror; + const int32_t mir = display_mirror; //if (waloff[wn] == 0) loadtile(wn); setviewtotile(wn, tilesiz[wn].y, tilesiz[wn].x); @@ -385,7 +385,7 @@ void G_SetupCamTile(int32_t i, int32_t wn) void G_AnimateCamSprite(void) { - int32_t i = g_curViewscreen; + const int32_t i = g_curViewscreen; #ifdef DEBUG_VALGRIND_NO_SMC return; @@ -395,15 +395,15 @@ void G_AnimateCamSprite(void) if (totalclock >= T1 + ud.camera_time) { - const DukePlayer_t *ps = g_player[screenpeek].ps; + const DukePlayer_t *const ps = g_player[screenpeek].ps; if (ps->newowner >= 0) OW = ps->newowner; - if (OW >= 0 && dist(&sprite[ps->i], &sprite[i]) < 8192) + if (OW >= 0 && dist(&sprite[ps->i], &sprite[i]) < VIEWSCREEN_ACTIVE_DISTANCE) { if (waloff[TILE_VIEWSCR] == 0) - allocatepermanenttile(TILE_VIEWSCR,tilesiz[PN].x<<2,tilesiz[PN].y<<2); + allocatepermanenttile(TILE_VIEWSCR, tilesiz[PN].x<<2, tilesiz[PN].y<<2); else walock[TILE_VIEWSCR] = 255; diff --git a/polymer/eduke32/source/sector.h b/polymer/eduke32/source/sector.h index 8920b2e77..d7a168621 100644 --- a/polymer/eduke32/source/sector.h +++ b/polymer/eduke32/source/sector.h @@ -36,6 +36,8 @@ extern "C" { #define MAXANIMATES 256 #define MAXANIMWALLS 512 +#define VIEWSCREEN_ACTIVE_DISTANCE 8192 + typedef struct { int16_t wallnum, tag; } animwalltype;