diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index 9b2792d65..9bfca82ff 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -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); diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 2dfbec49b..ce21871a6 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -10041,7 +10041,7 @@ scriptwait: } else { - FCanvasTextureInfo::Add (camera, picnum, STACK(1)); + FCanvasTextureInfo::Add (camera, picnum, ACSToDouble(STACK(1))); } } sp -= 3; diff --git a/src/r_renderer.h b/src/r_renderer.h index 5d6ee856c..54952bc29 100644 --- a/src/r_renderer.h +++ b/src/r_renderer.h @@ -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; } diff --git a/src/r_utility.cpp b/src/r_utility.cpp index ead7d569b..22fba0f68 100644 --- a/src/r_utility.cpp +++ b/src/r_utility.cpp @@ -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)) { diff --git a/src/r_utility.h b/src/r_utility.h index 07fae0cbb..eb108e411 100644 --- a/src/r_utility.h +++ b/src/r_utility.h @@ -136,9 +136,9 @@ struct FCanvasTextureInfo TObjPtr 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); diff --git a/src/swrenderer/r_swrenderer.cpp b/src/swrenderer/r_swrenderer.cpp index 9e8c4c6eb..19bf055a6 100644 --- a/src/swrenderer/r_swrenderer.cpp +++ b/src/swrenderer/r_swrenderer.cpp @@ -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); diff --git a/src/swrenderer/r_swrenderer.h b/src/swrenderer/r_swrenderer.h index 06946321f..19f75758f 100644 --- a/src/swrenderer/r_swrenderer.h +++ b/src/swrenderer/r_swrenderer.h @@ -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; diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index f74c83e92..630e74abb 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -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