ZScript version of SetCameraToTexture

This commit is contained in:
ZZYZX 2017-04-19 12:01:56 +03:00 committed by Christoph Oelckers
parent 316af5a400
commit 29402ff685
2 changed files with 15 additions and 0 deletions

View file

@ -65,6 +65,7 @@
#include "p_maputl.h"
#include "sbar.h"
#include "math/cmath.h"
#include "vm.h"
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
@ -983,6 +984,18 @@ void FCanvasTextureInfo::Add (AActor *viewpoint, FTextureID picnum, int fov)
List = probe;
}
// [ZZ] expose this to ZScript
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);
FTextureID textureid = TexMan.CheckForTexture(texturename, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable);
FCanvasTextureInfo::Add(viewpoint, textureid, fov);
return 0;
}
//==========================================================================
//
// FCanvasTextureInfo :: UpdateAll

View file

@ -93,6 +93,8 @@ struct TexMan
native static Vector2 GetScaledSize(TextureID tex);
native static Vector2 GetScaledOffset(TextureID tex);
native static int CheckRealHeight(TextureID tex);
native static void SetCameraToTexture(Actor viewpoint, String texture, int fov);
}
enum DrawTextureTags