- camera display fix.

This is one fucked up mess of code.
This commit is contained in:
Christoph Oelckers 2020-07-05 11:54:50 +02:00
parent 2e78c08856
commit c08b8dc17b
3 changed files with 9 additions and 6 deletions

View file

@ -1713,6 +1713,7 @@ void checksectors_d(int snum)
sprite[neartagsprite].owner = i; sprite[neartagsprite].owner = i;
sprite[neartagsprite].yvel = 1; sprite[neartagsprite].yvel = 1;
camsprite = neartagsprite;
j = p->cursectnum; j = p->cursectnum;

View file

@ -1303,7 +1303,7 @@ int GameInterface::app_main()
if (RR) if (RR)
tileDelete(0); tileDelete(0);
if (RRRA)
tileDelete(13); tileDelete(13);
if (numplayers == 1 && boardfilename[0] != 0) if (numplayers == 1 && boardfilename[0] != 0)

View file

@ -37,7 +37,7 @@ void G_AnimateCamSprite(int smoothRatio)
if (g_curViewscreen < 0) if (g_curViewscreen < 0)
return; return;
int const spriteNum = g_curViewscreen; int spriteNum = g_curViewscreen;
if (totalclock >= T1(spriteNum) + ud.camera_time) if (totalclock >= T1(spriteNum) + ud.camera_time)
{ {
@ -46,11 +46,13 @@ void G_AnimateCamSprite(int smoothRatio)
if (pPlayer->newowner >= 0) if (pPlayer->newowner >= 0)
OW(spriteNum) = pPlayer->newowner; OW(spriteNum) = pPlayer->newowner;
if (OW(spriteNum) >= 0 && dist(&sprite[pPlayer->i], &sprite[spriteNum]) < VIEWSCREEN_ACTIVE_DISTANCE) if (OW(spriteNum) >= 0 && dist(&sprite[pPlayer->i], &sprite[spriteNum]) < VIEWSCREEN_ACTIVE_DISTANCE)
{ {
TileFiles.MakeCanvas(TILE_VIEWSCR, tilesiz[PN(spriteNum)].x, tilesiz[PN(spriteNum)].y); TileFiles.MakeCanvas(TILE_VIEWSCR, tilesiz[PN(spriteNum)].x, tilesiz[PN(spriteNum)].y);
vec3_t const camera = G_GetCameraPosition(spriteNum, smoothRatio); vec3_t const camera = G_GetCameraPosition(OW(spriteNum), smoothRatio);
int ang = SA(OW(spriteNum));
int const saveMirror = display_mirror; int const saveMirror = display_mirror;
auto canvas = renderSetTarget(TILE_VIEWSCR); auto canvas = renderSetTarget(TILE_VIEWSCR);
@ -59,10 +61,10 @@ void G_AnimateCamSprite(int smoothRatio)
screen->RenderTextureView(canvas, [=](IntRect& rect) screen->RenderTextureView(canvas, [=](IntRect& rect)
{ {
yax_preparedrawrooms(); yax_preparedrawrooms();
drawrooms(camera.x, camera.y, camera.z, SA(spriteNum), 100 + sprite[spriteNum].shade, SECT(spriteNum)); drawrooms(camera.x, camera.y, camera.z, ang, 100 + sprite[OW(spriteNum)].shade, SECT(OW(spriteNum)));
display_mirror = 3; display_mirror = 3;
fi.animatesprites(camera.x, camera.y, SA(spriteNum), smoothRatio); fi.animatesprites(camera.x, camera.y, ang, smoothRatio);
display_mirror = saveMirror; display_mirror = saveMirror;
renderDrawMasks(); renderDrawMasks();