raze/source/core/textures/buildtiles.h

59 lines
1.3 KiB
C
Raw Normal View History

2020-05-24 05:58:56 +00:00
#pragma once
#include <limits.h>
2020-05-24 05:58:56 +00:00
#include "textures.h"
#include "image.h"
#include "i_time.h"
#include "intvec.h"
#include "name.h"
#include "tiletexture.h"
#include "maptypes.h"
#include "texinfo.h"
#include "texturemanager.h"
2020-05-24 11:53:27 +00:00
// all that's left here is the wrappers that need to go away.
2020-05-24 11:53:27 +00:00
2020-05-24 05:58:56 +00:00
inline const FTextureID spritetypebase::spritetexture() const
2020-05-24 05:58:56 +00:00
{
return tileGetTextureID(picnum);
}
2020-05-24 05:58:56 +00:00
inline void spritetypebase::setspritetexture(FTextureID tex)
{
picnum = legacyTileNum(tex);
}
//[[deprecated]]
inline int tileForName(const char* name)
{
auto texid = TexMan.CheckForTexture(name, ETextureType::Any, FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ReturnAll);
if (!texid.isValid()) return -1;
return legacyTileNum(texid);
}
//[[deprecated]]
2020-05-24 05:58:56 +00:00
inline int tileWidth(int num)
{
auto texid = tileGetTextureID(num);
if (!texid.isValid()) return 1;
else return (int)TexMan.GetGameTexture(texid)->GetDisplayWidth();
2020-05-24 05:58:56 +00:00
}
//[[deprecated]]
2020-05-24 05:58:56 +00:00
inline int tileHeight(int num)
{
auto texid = tileGetTextureID(num);
if (!texid.isValid()) return 1;
else return (int)TexMan.GetGameTexture(texid)->GetDisplayHeight();
}
//[[deprecated]]
inline FGameTexture* tileGetTexture(int tile, bool animate = false)
2020-05-24 10:31:38 +00:00
{
auto texid = tileGetTextureID(tile);
if (animate) tileUpdatePicnum(texid);
return TexMan.GetGameTexture(texid);
}