1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-12 16:14:25 +02:00

fix warnings

This commit is contained in:
XProger
2020-05-08 03:54:51 +03:00
parent 252eef9680
commit 901d49c504
2 changed files with 12 additions and 11 deletions

View File

@@ -277,7 +277,7 @@ namespace GAPI {
TexFormat fmt; TexFormat fmt;
uint32 opt; uint32 opt;
Texture(int width, int height, int depth, uint32 opt) : tex2D(NULL), tex3D(NULL), SRV(NULL), DSV(NULL), width(width), height(height), depth(depth), origWidth(width), origHeight(height), origDepth(depth), fmt(FMT_RGBA), opt(opt) { Texture(int width, int height, int depth, uint32 opt) : ID(NULL), SRV(NULL), DSV(NULL), width(width), height(height), depth(depth), origWidth(width), origHeight(height), origDepth(depth), fmt(FMT_RGBA), opt(opt) {
memset(RTV, 0, sizeof(RTV)); memset(RTV, 0, sizeof(RTV));
} }
@@ -288,8 +288,8 @@ namespace GAPI {
bool isDepth = fmt == FMT_DEPTH || fmt == FMT_SHADOW; bool isDepth = fmt == FMT_DEPTH || fmt == FMT_SHADOW;
bool isCube = (opt & OPT_CUBEMAP) != 0; bool isCube = (opt & OPT_CUBEMAP) != 0;
bool isVolume = (opt & OPT_VOLUME) != 0; bool isVolume = (opt & OPT_VOLUME) != 0;
bool isTarget = (opt & OPT_TARGET); bool isTarget = (opt & OPT_TARGET) != 0;
bool isDynamic = (opt & OPT_DYNAMIC); bool isDynamic = (opt & OPT_DYNAMIC) != 0;
static const struct FormatDesc { static const struct FormatDesc {
int bpp; int bpp;

View File

@@ -93,11 +93,11 @@ struct Level : IGame {
if (nextLevel != TR::LVL_MAX) return; if (nextLevel != TR::LVL_MAX) return;
TR::LevelID id = TR::LVL_MAX; TR::LevelID id = TR::LVL_MAX;
#ifdef _OS_WEB //#ifdef _OS_WEB
if (level.id == TR::LVL_TR1_2 && level.version != TR::VER_TR1_PC) // if (level.id == TR::LVL_TR1_2 && level.version != TR::VER_TR1_PC)
id = TR::LVL_TR1_TITLE; // id = TR::LVL_TR1_TITLE;
else // else
#endif //#endif
id = (level.isEnd() || level.isHome()) ? level.getTitleId() : TR::LevelID(level.id + 1); id = (level.isEnd() || level.isHome()) ? level.getTitleId() : TR::LevelID(level.id + 1);
TR::isGameEnded = level.isEnd(); TR::isGameEnded = level.isEnd();
@@ -1710,7 +1710,7 @@ struct Level : IGame {
short4 uv = t.getMinMax(); short4 uv = t.getMinMax();
uv.z++; uv.z++;
uv.w++; uv.w++;
level.fillObjectTexture((Tile32*)tiles[t.tile].data, uv, &t); level.fillObjectTexture((AtlasTile*)tiles[t.tile].data, uv, &t);
} }
for (int i = 0; i < level.spriteTexturesCount; i++) { for (int i = 0; i < level.spriteTexturesCount; i++) {
@@ -1718,15 +1718,16 @@ struct Level : IGame {
short4 uv = t.getMinMax(); short4 uv = t.getMinMax();
uv.z++; uv.z++;
uv.w++; uv.w++;
level.fillObjectTexture((Tile32*)tiles[t.tile].data, uv, &t); level.fillObjectTexture((AtlasTile*)tiles[t.tile].data, uv, &t);
} }
for (int i = 0; i < level.tilesCount; i++) { for (int i = 0; i < level.tilesCount; i++) {
char buf[256]; char buf[256];
sprintf(buf, "texture/%s_%d.png", TR::LEVEL_INFO[level.id].name, i); sprintf(buf, "texture/%s_%d.png", TR::LEVEL_INFO[level.id].name, i);
if (Stream::exists(buf)) { if (Stream::exists(buf)) {
Stream stream(buf);
delete[] tiles[i].data; delete[] tiles[i].data;
tiles[i].data = (uint32*)Texture::LoadPNG(Stream(buf), tiles[i].width, tiles[i].height); tiles[i].data = (uint32*)Texture::LoadPNG(stream, tiles[i].width, tiles[i].height);
} }
} }