diff --git a/source/blood/src/db.cpp b/source/blood/src/db.cpp index 652756ed3..526ab5a58 100644 --- a/source/blood/src/db.cpp +++ b/source/blood/src/db.cpp @@ -1273,7 +1273,8 @@ int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short } #ifdef YAX_ENABLE - yax_update(numyaxbunches > 0 ? 2 : 1); + // NUKE-TODO: Should be updated for new map format only + yax_update(0); #endif g_loadedMapVersion = 7; diff --git a/source/blood/src/mirrors.cpp b/source/blood/src/mirrors.cpp index 9e0e141ae..65e0d5c87 100644 --- a/source/blood/src/mirrors.cpp +++ b/source/blood/src/mirrors.cpp @@ -340,7 +340,7 @@ void sub_557C4(int x, int y, int interpolation) } } -void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz) +void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth) { if (videoGetRenderMode() == REND_POLYMER) return; @@ -384,8 +384,14 @@ void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz) { renderPrepareMirror(x,y,z,a,horiz,nWall,&cx,&cy,&ca); } - renderDrawRoomsQ16(cx, cy, z, ca,horiz,mirrorsector|MAXSECTORS); - viewProcessSprites(cx,cy,z); +#ifdef POLYMER + if (videoGetRenderMode() == REND_POLYMER) + polymer_setanimatesprites(viewProcessSprites, cx, cy, z, fix16_to_int(ca), smooth); +#endif + yax_preparedrawrooms(); + int32_t didmirror = renderDrawRoomsQ16(cx, cy, z, ca,horiz,mirrorsector|MAXSECTORS); + yax_drawrooms(viewProcessSprites, mirrorsector, didmirror, smooth); + viewProcessSprites(cx,cy,z,fix16_to_int(ca),smooth); renderDrawMasks(); if (GetWallType(nWall) != 501) renderCompleteMirror(); @@ -401,8 +407,14 @@ void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz) r_rorphase = 1; #endif int nSector = mirror[i].at4; +#ifdef POLYMER + if (videoGetRenderMode() == REND_POLYMER) + polymer_setanimatesprites(viewProcessSprites, x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10, fix16_to_int(a), smooth); +#endif + yax_preparedrawrooms(); renderDrawRoomsQ16(x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10, a, horiz, nSector|MAXSECTORS); - viewProcessSprites(x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10); + yax_drawrooms(viewProcessSprites, nSector, 0, smooth); + viewProcessSprites(x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10, fix16_to_int(a), smooth); short fstat = sector[nSector].floorstat; sector[nSector].floorstat |= 1; renderDrawMasks(); @@ -420,8 +432,14 @@ void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz) r_rorphase = 1; #endif int nSector = mirror[i].at4; +#ifdef POLYMER + if (videoGetRenderMode() == REND_POLYMER) + polymer_setanimatesprites(viewProcessSprites, x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10, fix16_to_int(a), smooth); +#endif + yax_preparedrawrooms(); renderDrawRoomsQ16(x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10, a, horiz, nSector|MAXSECTORS); - viewProcessSprites(x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10); + yax_drawrooms(viewProcessSprites, nSector, 0, smooth); + viewProcessSprites(x+mirror[i].at8, y+mirror[i].atc, z+mirror[i].at10, fix16_to_int(a), smooth); short cstat = sector[nSector].ceilingstat; sector[nSector].ceilingstat |= 1; renderDrawMasks(); diff --git a/source/blood/src/mirrors.h b/source/blood/src/mirrors.h index 4300dfe7c..eaddf737e 100644 --- a/source/blood/src/mirrors.h +++ b/source/blood/src/mirrors.h @@ -25,4 +25,4 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. void InitMirrors(void); void sub_5571C(char mode); void sub_557C4(int x, int y, int interpolation); -void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz); +void DrawMirrors(int x, int y, int z, fix16_t a, fix16_t horiz, int smooth); diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index 2d9c73476..02c705a67 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -2019,8 +2019,10 @@ uspritetype *viewAddEffect(int nTSprite, VIEW_EFFECT nViewEffect) LOCATION gPrevSpriteLoc[kMaxSprites]; -void viewProcessSprites(int cX, int cY, int cZ) +void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t smooth) { + UNREFERENCED_PARAMETER(cA); + UNREFERENCED_PARAMETER(smooth); dassert(spritesortcnt <= kMaxViewSprites); int nViewSprites = spritesortcnt; for (int nTSprite = nViewSprites-1; nTSprite >= 0; nTSprite--) @@ -3169,21 +3171,27 @@ void viewDrawScreen(void) vd0 = vc8+(8<<4); } v54 = ClipRange(v54, -200, 200); +#if 0 RORHACKOTHER: int ror_status[16]; for (int i = 0; i < 16; i++) ror_status[i] = TestBitString(gotpic, 4080 + i); - DrawMirrors(vd8, vd4, vd0, fix16_from_int(v50), fix16_from_int(v54 + defaultHoriz)); +#endif + yax_preparedrawrooms(); + DrawMirrors(vd8, vd4, vd0, fix16_from_int(v50), fix16_from_int(v54 + defaultHoriz), gInterpolate); drawrooms(vd8, vd4, vd0, v50, v54 + defaultHoriz, vcc); + yax_drawrooms(viewProcessSprites, vcc, 0, gInterpolate); +#if 0 bool do_ror_hack = false; for (int i = 0; i < 16; i++) if (!ror_status[i] && TestBitString(gotpic, 4080 + i)) do_ror_hack = true; if (do_ror_hack) goto RORHACKOTHER; +#endif memcpy(otherMirrorGotpic, gotpic+510, 2); memcpy(gotpic+510, bakMirrorGotpic, 2); - viewProcessSprites(vd8, vd4, vd0); + viewProcessSprites(vd8, vd4, vd0, v50, gInterpolate); renderDrawMasks(); renderRestoreTarget(); } @@ -3243,12 +3251,14 @@ RORHACKOTHER: cZ = vfc+(8<<8); } q16horiz = ClipRange(q16horiz, F16(-200), F16(200)); +#if 0 RORHACK: int ror_status[16]; for (int i = 0; i < 16; i++) ror_status[i] = TestBitString(gotpic, 4080+i); +#endif fix16_t deliriumPitchI = interpolate(fix16_from_int(deliriumPitchO), fix16_from_int(deliriumPitch), gInterpolate); - DrawMirrors(cX, cY, cZ, cA, q16horiz + fix16_from_int(defaultHoriz) + deliriumPitchI); + DrawMirrors(cX, cY, cZ, cA, q16horiz + fix16_from_int(defaultHoriz) + deliriumPitchI, gInterpolate); int bakCstat = gView->pSprite->cstat; if (gViewPos == 0) { @@ -3258,7 +3268,15 @@ RORHACK: { gView->pSprite->cstat |= 514; } +#ifdef POLYMER + if (videoGetRenderMode() == REND_POLYMER) + polymer_setanimatesprites(viewProcessSprites, cX, cY, cZ, fix16_to_int(cA), gInterpolate); +#endif + yax_preparedrawrooms(); renderDrawRoomsQ16(cX, cY, cZ, cA, q16horiz + fix16_from_int(defaultHoriz) + deliriumPitchI, nSectnum); + yax_drawrooms(viewProcessSprites, nSectnum, 0, gInterpolate); + viewProcessSprites(cX, cY, cZ, fix16_to_int(cA), gInterpolate); +#if 0 bool do_ror_hack = false; for (int i = 0; i < 16; i++) if (!ror_status[i] && TestBitString(gotpic, 4080+i)) @@ -3268,11 +3286,13 @@ RORHACK: gView->pSprite->cstat = bakCstat; goto RORHACK; } - - viewProcessSprites(cX, cY, cZ); - sub_5571C(1); - renderDrawMasks(); - sub_5571C(0); +#endif + if (videoGetRenderMode() == REND_CLASSIC) + { + sub_5571C(1); + renderDrawMasks(); + sub_5571C(0); + } sub_557C4(cX, cY, gInterpolate); renderDrawMasks(); gView->pSprite->cstat = bakCstat; diff --git a/source/blood/src/view.h b/source/blood/src/view.h index 232f2b311..ceb4e1c95 100644 --- a/source/blood/src/view.h +++ b/source/blood/src/view.h @@ -138,7 +138,7 @@ void UpdateFrame(void); void viewDrawInterface(int arg); uspritetype *viewInsertTSprite(int nSector, int nStatnum, uspritetype *pSprite); uspritetype *viewAddEffect(int nTSprite, VIEW_EFFECT nViewEffect); -void viewProcessSprites(int cX, int cY, int cZ); +void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t smooth); void CalcOtherPosition(spritetype *pSprite, int *pX, int *pY, int *pZ, int *vsectnum, int nAng, int zm); void CalcPosition(spritetype *pSprite, int *pX, int *pY, int *pZ, int *vsectnum, int nAng, int zm); void viewSetMessage(const char *pMessage); diff --git a/source/build/include/build.h b/source/build/include/build.h index 4fafc6fc6..17211056a 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -220,7 +220,7 @@ static FORCE_INLINE CONSTEXPR int32_t yax_waltosecmask(int32_t const walclipmask return ((walclipmask&1)<<9) | ((walclipmask&64)<<5); } void yax_preparedrawrooms(void); -void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t), +void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t,int32_t), int16_t sectnum, int32_t didmirror, int32_t smoothr); # define YAX_SKIPSECTOR(i) if (graysectbitmap[(i)>>3]&pow2char[(i)&7]) continue # define YAX_SKIPWALL(i) if (graywallbitmap[(i)>>3]&pow2char[(i)&7]) continue diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 73b19c3e3..6436d90df 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -864,7 +864,7 @@ void yax_preparedrawrooms(void) } } -void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t), +void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t,int32_t), int16_t sectnum, int32_t didmirror, int32_t smoothr) { static uint8_t havebunch[(YAX_MAXBUNCHES+7)>>3]; @@ -1085,7 +1085,7 @@ void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t), yax_globallev-YAX_MAXDRAWS, j, k, spritesortcnt, (double)(1000*(timerGetTicksU64()-t))/u64tickspersec); - SpriteAnimFunc(globalposx, globalposy, globalang, smoothr); + SpriteAnimFunc(globalposx, globalposy, globalposz, globalang, smoothr); renderDrawMasks(); } diff --git a/source/duke3d/src/astub.cpp b/source/duke3d/src/astub.cpp index 3407a8bb3..9e8246e40 100644 --- a/source/duke3d/src/astub.cpp +++ b/source/duke3d/src/astub.cpp @@ -2225,7 +2225,7 @@ static void ExtSE40Draw(int32_t spnum,int32_t x,int32_t y,int32_t z,int16_t a,in } drawrooms(x+offx,y+offy,z+offz,a,h,sprite[floor2].sectnum); - ExtAnalyzeSprites(0,0,0,0); + ExtAnalyzeSprites(0,0,0,0,0); renderDrawMasks(); M32_ResetFakeRORTiles(); @@ -2251,7 +2251,7 @@ static void ExtSE40Draw(int32_t spnum,int32_t x,int32_t y,int32_t z,int16_t a,in // Now re-draw drawrooms(x+offx,y+offy,z+offz,a,h,sprite[floor2].sectnum); - ExtAnalyzeSprites(0,0,0,0); + ExtAnalyzeSprites(0,0,0,0,0); renderDrawMasks(); M32_ResetFakeRORTiles(); } @@ -10500,7 +10500,7 @@ void ExtPreCheckKeys(void) // just before drawrooms videoEndDrawing(); //}}} } -void ExtAnalyzeSprites(int32_t ourx, int32_t oury, int32_t oura, int32_t smoothr) +void ExtAnalyzeSprites(int32_t ourx, int32_t oury, int32_t ourz, int32_t oura, int32_t smoothr) { int32_t i, k; uspritetype *tspr; diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index c20c6f5a5..7cdec4770 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -543,7 +543,7 @@ static void G_SE40(int32_t smoothratio) #ifdef POLYMER if (videoGetRenderMode() == REND_POLYMER) - polymer_setanimatesprites(G_DoSpriteAnimations, CAMERA(pos.x), CAMERA(pos.y), fix16_to_int(CAMERA(q16ang)), smoothratio); + polymer_setanimatesprites(G_DoSpriteAnimations, CAMERA(pos.x), CAMERA(pos.y), CAMERA(pos.z), fix16_to_int(CAMERA(q16ang)), smoothratio); #endif renderDrawRoomsQ16(sprite[sprite2].x + x, sprite[sprite2].y + y, z + renderz, CAMERA(q16ang), CAMERA(q16horiz), sect); @@ -552,7 +552,7 @@ static void G_SE40(int32_t smoothratio) if (drawing_ror == 2) // viewing from top G_OROR_DupeSprites(sp); - G_DoSpriteAnimations(CAMERA(pos.x),CAMERA(pos.y),fix16_to_int(CAMERA(q16ang)),smoothratio); + G_DoSpriteAnimations(CAMERA(pos.x),CAMERA(pos.y),CAMERA(pos.z),fix16_to_int(CAMERA(q16ang)),smoothratio); renderDrawMasks(); if (level) @@ -685,7 +685,7 @@ void G_HandleMirror(int32_t x, int32_t y, int32_t z, fix16_t a, fix16_t q16horiz // XXX: Sprites don't get drawn with TROR/Polymost #endif display_mirror = 1; - G_DoSpriteAnimations(tposx,tposy,fix16_to_int(tang),smoothratio); + G_DoSpriteAnimations(tposx,tposy,z,fix16_to_int(tang),smoothratio); display_mirror = 0; renderDrawMasks(); @@ -820,12 +820,12 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) #endif #ifdef POLYMER if (videoGetRenderMode() == REND_POLYMER) - polymer_setanimatesprites(G_DoSpriteAnimations, pSprite->x, pSprite->y, fix16_to_int(CAMERA(q16ang)), smoothRatio); + polymer_setanimatesprites(G_DoSpriteAnimations, pSprite->x, pSprite->y, pSprite->z, fix16_to_int(CAMERA(q16ang)), smoothRatio); #endif yax_preparedrawrooms(); renderDrawRoomsQ16(pSprite->x, pSprite->y, pSprite->z - ZOFFSET6, CAMERA(q16ang), fix16_from_int(pSprite->yvel), pSprite->sectnum); yax_drawrooms(G_DoSpriteAnimations, pSprite->sectnum, 0, smoothRatio); - G_DoSpriteAnimations(pSprite->x, pSprite->y, fix16_to_int(CAMERA(q16ang)), smoothRatio); + G_DoSpriteAnimations(pSprite->x, pSprite->y, pSprite->z, fix16_to_int(CAMERA(q16ang)), smoothRatio); renderDrawMasks(); } } @@ -1083,7 +1083,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) #endif #ifdef POLYMER if (videoGetRenderMode() == REND_POLYMER) - polymer_setanimatesprites(G_DoSpriteAnimations, CAMERA(pos.x),CAMERA(pos.y),fix16_to_int(CAMERA(q16ang)),smoothRatio); + polymer_setanimatesprites(G_DoSpriteAnimations, CAMERA(pos.x),CAMERA(pos.y),CAMERA(pos.z),fix16_to_int(CAMERA(q16ang)),smoothRatio); #endif // for G_PrintCoords dr_viewingrange = viewingrange; @@ -1098,7 +1098,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) if ((unsigned)ror_sprite < MAXSPRITES && drawing_ror == 1) // viewing from bottom G_OROR_DupeSprites(&sprite[ror_sprite]); #endif - G_DoSpriteAnimations(CAMERA(pos.x),CAMERA(pos.y),fix16_to_int(CAMERA(q16ang)),smoothRatio); + G_DoSpriteAnimations(CAMERA(pos.x),CAMERA(pos.y),CAMERA(pos.z),fix16_to_int(CAMERA(q16ang)),smoothRatio); #ifdef LEGACY_ROR drawing_ror = 0; #endif @@ -3604,8 +3604,9 @@ static inline void G_DoEventAnimSprites(int tspriteNum) spriteext[tsprOwner].tspr = NULL; } -void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t oura, int32_t smoothratio) +void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t ourz, int32_t oura, int32_t smoothratio) { + UNREFERENCED_PARAMETER(ourz); int32_t j, frameOffset, playerNum; intptr_t l; diff --git a/source/duke3d/src/game.h b/source/duke3d/src/game.h index 79a51140b..dd68169ab 100644 --- a/source/duke3d/src/game.h +++ b/source/duke3d/src/game.h @@ -389,7 +389,7 @@ const char* G_PrintBestTime(void); void G_BonusScreen(int32_t bonusonly); //void G_CheatGetInv(void); void G_DisplayRest(int32_t smoothratio); -void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t oura, int32_t smoothratio); +void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t ourz, int32_t oura, int32_t smoothratio); void G_DrawBackground(void); void G_DrawFrags(void); void G_HandleMirror(int32_t x, int32_t y, int32_t z, fix16_t a, fix16_t horiz, int32_t smoothratio); diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index 42995f20c..b10791a85 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -1203,14 +1203,14 @@ LUNATIC_EXTERN void G_ShowView(vec3_t vec, fix16_t a, fix16_t horiz, int sect, i G_HandleMirror(vec.x, vec.y, vec.z, a, horiz, smoothratio); #ifdef POLYMER if (videoGetRenderMode() == REND_POLYMER) - polymer_setanimatesprites(G_DoSpriteAnimations, vec.x, vec.y, fix16_to_int(a), smoothratio); + polymer_setanimatesprites(G_DoSpriteAnimations, vec.x, vec.y, vec.z, fix16_to_int(a), smoothratio); #endif yax_preparedrawrooms(); renderDrawRoomsQ16(vec.x, vec.y, vec.z, a, horiz, sect); yax_drawrooms(G_DoSpriteAnimations, sect, 0, smoothratio); display_mirror = 2; - G_DoSpriteAnimations(vec.x, vec.y, fix16_to_int(a), smoothratio); + G_DoSpriteAnimations(vec.x, vec.y, vec.z, fix16_to_int(a), smoothratio); display_mirror = 0; renderDrawMasks(); G_RestoreInterpolations(); diff --git a/source/duke3d/src/sector.cpp b/source/duke3d/src/sector.cpp index 8032fc1ed..4c24b7395 100644 --- a/source/duke3d/src/sector.cpp +++ b/source/duke3d/src/sector.cpp @@ -399,7 +399,7 @@ static void G_SetupCamTile(int spriteNum, int tileNum, int smoothRatio) yax_drawrooms(G_DoSpriteAnimations, SECT(spriteNum), 0, smoothRatio); display_mirror = 3; - G_DoSpriteAnimations(camera.x, camera.y, SA(spriteNum), smoothRatio); + G_DoSpriteAnimations(camera.x, camera.y, camera.z, SA(spriteNum), smoothRatio); display_mirror = saveMirror; renderDrawMasks(); diff --git a/source/rr/src/game.cpp b/source/rr/src/game.cpp index dfb06ce42..3afb9e79d 100644 --- a/source/rr/src/game.cpp +++ b/source/rr/src/game.cpp @@ -608,11 +608,11 @@ static void G_SE150_Draw(int32_t spnum, int32_t x, int32_t y, int32_t z, int32_t i = floor2; #ifdef POLYMER if (videoGetRenderMode() == REND_POLYMER) - polymer_setanimatesprites(G_DoSpriteAnimations, offx + sprite[i].x, offy + sprite[i].y, fix16_to_int(a), smoothratio); + polymer_setanimatesprites(G_DoSpriteAnimations, offx + sprite[i].x, offy + sprite[i].y, z, fix16_to_int(a), smoothratio); #endif renderDrawRoomsQ16(offx + sprite[i].x, offy + sprite[i].y, z, a, h, sprite[i].sectnum); - G_DoSpriteAnimations(offx + sprite[i].x, offy + sprite[i].y, fix16_to_int(a), smoothratio); + G_DoSpriteAnimations(offx + sprite[i].x, offy + sprite[i].y, z, fix16_to_int(a), smoothratio); renderDrawMasks(); for (j = 0; j < MAXSPRITES; j++) // restore ceiling or floor @@ -775,7 +775,7 @@ static void G_SE40(int32_t smoothratio) #ifdef POLYMER if (videoGetRenderMode() == REND_POLYMER) - polymer_setanimatesprites(G_DoSpriteAnimations, CAMERA(pos.x), CAMERA(pos.y), fix16_to_int(CAMERA(q16ang)), smoothratio); + polymer_setanimatesprites(G_DoSpriteAnimations, CAMERA(pos.x), CAMERA(pos.y), CAMERA(pos.z), fix16_to_int(CAMERA(q16ang)), smoothratio); #endif renderDrawRoomsQ16(sprite[sprite2].x + x, sprite[sprite2].y + y, z + renderz, CAMERA(q16ang), CAMERA(q16horiz), sect); @@ -784,7 +784,7 @@ static void G_SE40(int32_t smoothratio) if (drawing_ror == 2) // viewing from top G_OROR_DupeSprites(sp); - G_DoSpriteAnimations(CAMERA(pos.x),CAMERA(pos.y),fix16_to_int(CAMERA(q16ang)),smoothratio); + G_DoSpriteAnimations(CAMERA(pos.x),CAMERA(pos.y),CAMERA(pos.z),fix16_to_int(CAMERA(q16ang)),smoothratio); renderDrawMasks(); if (level) @@ -884,7 +884,7 @@ void G_HandleMirror(int32_t x, int32_t y, int32_t z, fix16_t a, fix16_t q16horiz // XXX: Sprites don't get drawn with TROR/Polymost #endif display_mirror = 1; - G_DoSpriteAnimations(tposx,tposy,fix16_to_int(tang),smoothratio); + G_DoSpriteAnimations(tposx,tposy,z,fix16_to_int(tang),smoothratio); display_mirror = 0; renderDrawMasks(); @@ -1009,12 +1009,12 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) #endif #ifdef POLYMER if (videoGetRenderMode() == REND_POLYMER) - polymer_setanimatesprites(G_DoSpriteAnimations, pSprite->x, pSprite->y, fix16_to_int(CAMERA(q16ang)), smoothRatio); + polymer_setanimatesprites(G_DoSpriteAnimations, pSprite->x, pSprite->y, pSprite->z, fix16_to_int(CAMERA(q16ang)), smoothRatio); #endif yax_preparedrawrooms(); renderDrawRoomsQ16(pSprite->x, pSprite->y, pSprite->z - ZOFFSET6, CAMERA(q16ang), fix16_from_int(pSprite->yvel), pSprite->sectnum); yax_drawrooms(G_DoSpriteAnimations, pSprite->sectnum, 0, smoothRatio); - G_DoSpriteAnimations(pSprite->x, pSprite->y, fix16_to_int(CAMERA(q16ang)), smoothRatio); + G_DoSpriteAnimations(pSprite->x, pSprite->y, pSprite->z, fix16_to_int(CAMERA(q16ang)), smoothRatio); renderDrawMasks(); } else @@ -1363,7 +1363,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) G_SE150(CAMERA(pos.x), CAMERA(pos.y), CAMERA(pos.z), CAMERA(q16ang), CAMERA(q16horiz), smoothRatio); #ifdef POLYMER if (videoGetRenderMode() == REND_POLYMER) - polymer_setanimatesprites(G_DoSpriteAnimations, CAMERA(pos.x),CAMERA(pos.y),fix16_to_int(CAMERA(q16ang)),smoothRatio); + polymer_setanimatesprites(G_DoSpriteAnimations, CAMERA(pos.x),CAMERA(pos.y),CAMERA(pos.z),fix16_to_int(CAMERA(q16ang)),smoothRatio); #endif // for G_PrintCoords dr_viewingrange = viewingrange; @@ -1377,7 +1377,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) renderDrawRoomsQ16(CAMERA(pos.x),CAMERA(pos.y),CAMERA(pos.z),CAMERA(q16ang),CAMERA(q16horiz),CAMERA(sect)); yax_drawrooms(G_DoSpriteAnimations, CAMERA(sect), 0, smoothRatio); - G_DoSpriteAnimations(CAMERA(pos.x),CAMERA(pos.y),fix16_to_int(CAMERA(q16ang)),smoothRatio); + G_DoSpriteAnimations(CAMERA(pos.x),CAMERA(pos.y),CAMERA(pos.z),fix16_to_int(CAMERA(q16ang)),smoothRatio); renderDrawMasks(); @@ -1421,7 +1421,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) } } - G_DoSpriteAnimations(CAMERA(pos.x),CAMERA(pos.y),fix16_to_int(CAMERA(q16ang)),smoothRatio); + G_DoSpriteAnimations(CAMERA(pos.x),CAMERA(pos.y),CAMERA(pos.z),fix16_to_int(CAMERA(q16ang)),smoothRatio); renderDrawMasks(); @@ -1463,7 +1463,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) } } - G_DoSpriteAnimations(CAMERA(pos.x),CAMERA(pos.y),fix16_to_int(CAMERA(q16ang)),smoothRatio); + G_DoSpriteAnimations(CAMERA(pos.x),CAMERA(pos.y),CAMERA(pos.z),fix16_to_int(CAMERA(q16ang)),smoothRatio); renderDrawMasks(); } @@ -1476,7 +1476,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) if (!RR && (unsigned)ror_sprite < MAXSPRITES && drawing_ror == 1) // viewing from bottom G_OROR_DupeSprites(&sprite[ror_sprite]); #endif - G_DoSpriteAnimations(CAMERA(pos.x),CAMERA(pos.y),fix16_to_int(CAMERA(q16ang)),smoothRatio); + G_DoSpriteAnimations(CAMERA(pos.x),CAMERA(pos.y),CAMERA(pos.z),fix16_to_int(CAMERA(q16ang)),smoothRatio); } #ifdef LEGACY_ROR drawing_ror = 0; @@ -4736,8 +4736,9 @@ static int G_CheckAdultTile(int tileNum) return 0; } -void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t oura, int32_t smoothratio) +void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t ourz, int32_t oura, int32_t smoothratio) { + UNREFERENCED_PARAMETER(ourz); int32_t j, frameOffset, playerNum; intptr_t l; diff --git a/source/rr/src/game.h b/source/rr/src/game.h index c5b26882c..acb4cae96 100644 --- a/source/rr/src/game.h +++ b/source/rr/src/game.h @@ -350,7 +350,7 @@ void G_BonusScreen(int32_t bonusonly); void G_BonusScreenRRRA(int32_t bonusonly); //void G_CheatGetInv(void); void G_DisplayRest(int32_t smoothratio); -void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t oura, int32_t smoothratio); +void G_DoSpriteAnimations(int32_t ourx, int32_t oury, int32_t ourz, int32_t oura, int32_t smoothratio); void G_DrawBackground(void); void G_DrawFrags(void); void G_HandleMirror(int32_t x, int32_t y, int32_t z, fix16_t a, fix16_t horiz, int32_t smoothratio); diff --git a/source/rr/src/sector.cpp b/source/rr/src/sector.cpp index 5bb923d70..5e89bef1d 100644 --- a/source/rr/src/sector.cpp +++ b/source/rr/src/sector.cpp @@ -507,7 +507,7 @@ static void G_SetupCamTile(int spriteNum, int tileNum, int smoothRatio) yax_drawrooms(G_DoSpriteAnimations, SECT(spriteNum), 0, smoothRatio); display_mirror = 3; - G_DoSpriteAnimations(camera.x, camera.y, SA(spriteNum), smoothRatio); + G_DoSpriteAnimations(camera.x, camera.y, camera.z, SA(spriteNum), smoothRatio); display_mirror = saveMirror; renderDrawMasks();