diff --git a/source/build/include/build.h b/source/build/include/build.h index 488369b0e..6d3549eca 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -463,11 +463,6 @@ void renderCompleteMirror(void); int32_t renderDrawRoomsQ16(int32_t daposx, int32_t daposy, int32_t daposz, fixed_t daang, fixed_t dahoriz, int16_t dacursectnum); -static FORCE_INLINE int32_t drawrooms(int32_t daposx, int32_t daposy, int32_t daposz, int16_t daang, int16_t dahoriz, int16_t dacursectnum) -{ - return renderDrawRoomsQ16(daposx, daposy, daposz, IntToFixed(daang), IntToFixed(dahoriz), dacursectnum); -} - void renderDrawMasks(void); void videoInit(); void videoClearViewableArea(int32_t dacol); diff --git a/source/games/duke/src/render.cpp b/source/games/duke/src/render.cpp index 72aec4be6..d5a4f2e34 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -259,9 +259,9 @@ void renderMirror(int cposx, int cposy, int cposz, binangle cang, fixedhoriz cho // //--------------------------------------------------------------------------- -static inline int16_t getcamspriteang(DDukeActor* newOwner, double const smoothratio) +static inline binangle getcamspriteang(DDukeActor* newOwner, double const smoothratio) { - return newOwner->tempang + xs_CRoundToInt(fmulscale16(((newOwner->s.ang - newOwner->tempang + 1024) & 2047) - 1024, smoothratio)); + return buildfang(newOwner->tempang + fmulscale16(((newOwner->s.ang - newOwner->tempang + 1024) & 2047) - 1024, smoothratio)); } //--------------------------------------------------------------------------- @@ -295,9 +295,9 @@ void animatecamsprite(double smoothratio) auto camera = &camsprite->GetOwner()->s; auto ang = getcamspriteang(camsprite->GetOwner(), smoothratio); // Note: no ROR or camera here for now - the current setup has no means to detect these things before rendering the scene itself. - drawrooms(camera->x, camera->y, camera->z, ang, camera->shade, camera->sectnum); // why 'shade'...? + renderDrawRoomsQ16(camera->x, camera->y, camera->z, ang.asq16(), IntToFixed(camera->shade), camera->sectnum); // why 'shade'...? display_mirror = 1; // should really be 'display external view'. - fi.animatesprites(camera->x, camera->y, ang, smoothratio); + fi.animatesprites(camera->x, camera->y, ang.asbuild(), smoothratio); display_mirror = 0; renderDrawMasks(); }); @@ -517,7 +517,7 @@ void displayrooms(int snum, double smoothratio) if (s->yvel < 0) s->yvel = -100; else if (s->yvel > 199) s->yvel = 300; - cang = buildang(ud.cameraactor->tempang + xs_CRoundToInt(fmulscale16(((s->ang + 1024 - ud.cameraactor->tempang) & 2047) - 1024, smoothratio))); + cang = buildfang(ud.cameraactor->tempang + fmulscale16(((s->ang + 1024 - ud.cameraactor->tempang) & 2047) - 1024, smoothratio)); auto bh = buildhoriz(s->yvel); se40code(s->x, s->y, s->z, cang, bh, smoothratio); @@ -581,7 +581,7 @@ void displayrooms(int snum, double smoothratio) if (p->newOwner != nullptr) { auto spr = &p->newOwner->s; - cang = buildang(getcamspriteang(p->newOwner, smoothratio)); + cang = getcamspriteang(p->newOwner, smoothratio); choriz = buildhoriz(spr->shade); cposx = spr->pos.x; cposy = spr->pos.y;