Files
oot/tools/ZAPD/ZAPD/HighLevel/HLTexture.cpp
T
fig02 1ff2f0f849 ZAPD update (#612)
* remove roompoly

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "fd4d53a26"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "fd4d53a26"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"
2021-01-08 19:38:28 -05:00

16 lines
385 B
C++

#include "HLTexture.h"
#include "../StringHelper.h"
#include <stb_image.h>
using namespace std;
HLTexture* HLTexture::FromPNG(std::string pngFilePath, HLTextureType texType)
{
int comp;
HLTexture* tex = new HLTexture();
tex->type = texType;
tex->bmpRgba = (uint8_t*)stbi_load((pngFilePath).c_str(), (int*)&tex->width, (int*)&tex->height, &comp, STBI_rgb_alpha);
return tex;
}