mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-14 08:30:50 +00:00
ZScript version of SetCameraToTexture
This commit is contained in:
parent
316af5a400
commit
29402ff685
2 changed files with 15 additions and 0 deletions
|
@ -65,6 +65,7 @@
|
||||||
#include "p_maputl.h"
|
#include "p_maputl.h"
|
||||||
#include "sbar.h"
|
#include "sbar.h"
|
||||||
#include "math/cmath.h"
|
#include "math/cmath.h"
|
||||||
|
#include "vm.h"
|
||||||
|
|
||||||
|
|
||||||
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
|
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
|
||||||
|
@ -983,6 +984,18 @@ void FCanvasTextureInfo::Add (AActor *viewpoint, FTextureID picnum, int fov)
|
||||||
List = probe;
|
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
|
// FCanvasTextureInfo :: UpdateAll
|
||||||
|
|
|
@ -93,6 +93,8 @@ struct TexMan
|
||||||
native static Vector2 GetScaledSize(TextureID tex);
|
native static Vector2 GetScaledSize(TextureID tex);
|
||||||
native static Vector2 GetScaledOffset(TextureID tex);
|
native static Vector2 GetScaledOffset(TextureID tex);
|
||||||
native static int CheckRealHeight(TextureID tex);
|
native static int CheckRealHeight(TextureID tex);
|
||||||
|
|
||||||
|
native static void SetCameraToTexture(Actor viewpoint, String texture, int fov);
|
||||||
}
|
}
|
||||||
|
|
||||||
enum DrawTextureTags
|
enum DrawTextureTags
|
||||||
|
|
Loading…
Reference in a new issue