Change camera texture FOV to doubles.

This commit is contained in:
nashmuhandes 2017-09-01 04:37:29 +08:00 committed by Christoph Oelckers
parent b80bf6930a
commit f96f71044f
8 changed files with 13 additions and 13 deletions

View file

@ -987,7 +987,7 @@ struct FGLInterface : public FRenderer
void WriteSavePic (player_t *player, FileWriter *file, int width, int height) override;
void StartSerialize(FSerializer &arc) override;
void EndSerialize(FSerializer &arc) override;
void RenderTextureView (FCanvasTexture *self, AActor *viewpoint, int fov) override;
void RenderTextureView (FCanvasTexture *self, AActor *viewpoint, double fov) override;
void PreprocessLevel() override;
void CleanLevelData() override;
bool RequireGLNodes() override;
@ -1098,7 +1098,7 @@ void FGLInterface::Init()
CVAR(Bool, gl_usefb, false , CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
extern TexFilter_s TexFilter[];
void FGLInterface::RenderTextureView (FCanvasTexture *tex, AActor *Viewpoint, int FOV)
void FGLInterface::RenderTextureView (FCanvasTexture *tex, AActor *Viewpoint, double FOV)
{
FMaterial * gltex = FMaterial::ValidateTexture(tex, false);

View file

@ -10041,7 +10041,7 @@ scriptwait:
}
else
{
FCanvasTextureInfo::Add (camera, picnum, STACK(1));
FCanvasTextureInfo::Add (camera, picnum, ACSToDouble(STACK(1)));
}
}
sp -= 3;

View file

@ -49,7 +49,7 @@ struct FRenderer
virtual void OnModeSet () {}
virtual void SetClearColor(int color) = 0;
virtual void Init() = 0;
virtual void RenderTextureView (FCanvasTexture *tex, AActor *viewpoint, int fov) = 0;
virtual void RenderTextureView (FCanvasTexture *tex, AActor *viewpoint, double fov) = 0;
virtual void PreprocessLevel() {}
virtual void CleanLevelData() {}
virtual bool RequireGLNodes() { return false; }

View file

@ -1014,7 +1014,7 @@ void R_SetupFrame (FRenderViewpoint &viewpoint, FViewWindow &viewwindow, AActor
//
//==========================================================================
void FCanvasTextureInfo::Add (AActor *viewpoint, FTextureID picnum, int fov)
void FCanvasTextureInfo::Add (AActor *viewpoint, FTextureID picnum, double fov)
{
FCanvasTextureInfo *probe;
FCanvasTexture *texture;
@ -1062,7 +1062,7 @@ DEFINE_ACTION_FUNCTION(_TexMan, SetCameraToTexture)
PARAM_PROLOGUE;
PARAM_OBJECT(viewpoint, AActor);
PARAM_STRING(texturename); // [ZZ] there is no point in having this as FTextureID because it's easier to refer to a cameratexture by name and it isn't executed too often to cache it.
PARAM_INT(fov);
PARAM_FLOAT(fov);
FTextureID textureid = TexMan.CheckForTexture(texturename, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable);
FCanvasTextureInfo::Add(viewpoint, textureid, fov);
return 0;
@ -1150,7 +1150,7 @@ void FCanvasTextureInfo::Serialize(FSerializer &arc)
if (arc.BeginArray("canvastextures"))
{
AActor *viewpoint = nullptr;
int fov;
double fov;
FTextureID picnum;
while (arc.BeginObject(nullptr))
{

View file

@ -136,9 +136,9 @@ struct FCanvasTextureInfo
TObjPtr<AActor*> Viewpoint;
FCanvasTexture *Texture;
FTextureID PicNum;
int FOV;
double FOV;
static void Add (AActor *viewpoint, FTextureID picnum, int fov);
static void Add (AActor *viewpoint, FTextureID picnum, double fov);
static void UpdateAll ();
static void EmptyList ();
static void Serialize(FSerializer &arc);

View file

@ -272,7 +272,7 @@ void FSoftwareRenderer::SetClearColor(int color)
mScene.SetClearColor(color);
}
void FSoftwareRenderer::RenderTextureView (FCanvasTexture *tex, AActor *viewpoint, int fov)
void FSoftwareRenderer::RenderTextureView (FCanvasTexture *tex, AActor *viewpoint, double fov)
{
auto renderTarget = r_polyrenderer ? PolyRenderer::Instance()->RenderTarget : mScene.MainThread()->Viewport->RenderTarget;
auto &cameraViewpoint = r_polyrenderer ? PolyRenderer::Instance()->Viewpoint : mScene.MainThread()->Viewport->viewpoint;
@ -290,7 +290,7 @@ void FSoftwareRenderer::RenderTextureView (FCanvasTexture *tex, AActor *viewpoin
CameraLight savedCameraLight = *CameraLight::Instance();
DAngle savedfov = cameraViewpoint.FieldOfView;
R_SetFOV (cameraViewpoint, (double)fov);
R_SetFOV (cameraViewpoint, fov);
if (r_polyrenderer)
PolyRenderer::Instance()->RenderViewToCanvas(viewpoint, Canvas, 0, 0, tex->GetWidth(), tex->GetHeight(), tex->bFirstUpdate);

View file

@ -30,7 +30,7 @@ struct FSoftwareRenderer : public FRenderer
void OnModeSet() override;
void SetClearColor(int color) override;
void Init() override;
void RenderTextureView (FCanvasTexture *tex, AActor *viewpoint, int fov) override;
void RenderTextureView (FCanvasTexture *tex, AActor *viewpoint, double fov) override;
void PreprocessLevel() override;
void CleanLevelData() override;

View file

@ -95,7 +95,7 @@ struct TexMan
native static Vector2 GetScaledOffset(TextureID tex);
native static int CheckRealHeight(TextureID tex);
native static void SetCameraToTexture(Actor viewpoint, String texture, int fov);
native static void SetCameraToTexture(Actor viewpoint, String texture, double fov);
}
enum DrawTextureTags