- pass sector pointer to render_camtex.

This commit is contained in:
Christoph Oelckers 2021-12-02 00:26:02 +01:00
parent a22634f228
commit eb0f91e26b
4 changed files with 8 additions and 8 deletions

View file

@ -364,17 +364,17 @@ void render_drawrooms(spritetype* playersprite, const vec3_t& position, int sect
All.Unclock();
}
void render_camtex(spritetype* playersprite, const vec3_t& position, int sectnum, binangle angle, fixedhoriz horizon, binangle rollang, FGameTexture* camtex, IntRect& rect, double smoothratio)
void render_camtex(spritetype* playersprite, const vec3_t& position, sectortype* sect, binangle angle, fixedhoriz horizon, binangle rollang, FGameTexture* camtex, IntRect& rect, double smoothratio)
{
updatesector(position.x, position.y, &sectnum);
if (sectnum < 0) return;
updatesector(position.x, position.y, &sect);
if (!sect) return;
screen->RenderState()->SetVertexBuffer(screen->mVertexData);
// now render the main view
float ratio = camtex->GetDisplayWidth() / camtex->GetDisplayHeight();
FRenderViewpoint r_viewpoint = SetupViewpoint(playersprite, position, sectnum, angle, horizon, rollang);
FRenderViewpoint r_viewpoint = SetupViewpoint(playersprite, position, sectnum(sect), angle, horizon, rollang);
if (cl_capfps) r_viewpoint.TicFrac = smoothratio;
RenderViewpoint(r_viewpoint, &rect, r_viewpoint.FieldOfView.Degrees, ratio, ratio, false, false);

View file

@ -5,7 +5,7 @@ class FSerializer;
struct IntRect;
void render_drawrooms(spritetype* playersprite, const vec3_t& position, int sectnum, binangle angle, fixedhoriz horizon, binangle rollang, double smoothratio);
void render_camtex(spritetype* playersprite, const vec3_t& position, int sectnum, binangle angle, fixedhoriz horizon, binangle rollang, FGameTexture* camtex, IntRect& rect, double smoothratio);
void render_camtex(spritetype* playersprite, const vec3_t& position, sectortype* sect, binangle angle, fixedhoriz horizon, binangle rollang, FGameTexture* camtex, IntRect& rect, double smoothratio);
struct PortalDesc
{

View file

@ -123,7 +123,7 @@ void GameInterface::UpdateCameras(double smoothratio)
}
else
{
render_camtex(camera, camera->pos, camera->sectnum, ang, buildhoriz(camera->shade), buildang(0), tex, rect, smoothratio);
render_camtex(camera, camera->pos, camera->sector(), ang, buildhoriz(camera->shade), buildang(0), tex, rect, smoothratio);
}
display_mirror = 0;
});

View file

@ -426,13 +426,13 @@ void drawroomstotile(int daposx, int daposy, int daposz,
{
if (!testnewrenderer)
{
renderDrawRoomsQ16(daposx, daposy, daposz, ang.asq16(), horiz.asq16(), sectnum(dacursect), false);
renderDrawRoomsQ16(daposx, daposy, daposz, ang.asq16(), horiz.asq16(), dacursect, false);
analyzesprites(pm_tsprite, pm_spritesortcnt, daposx, daposy, daposz, ang.asbuild());
renderDrawMasks();
}
else
{
render_camtex(nullptr, { daposx, daposy, daposz }, sectnum(dacursect), ang, horiz, buildang(0), tileGetTexture(tilenume), rect, smoothratio);
render_camtex(nullptr, { daposx, daposy, daposz }, dacursect, ang, horiz, buildang(0), tileGetTexture(tilenume), rect, smoothratio);
}
});