diff --git a/src/gapi/d3d11.h b/src/gapi/d3d11.h index 0620e38..801a7e1 100644 --- a/src/gapi/d3d11.h +++ b/src/gapi/d3d11.h @@ -277,7 +277,7 @@ namespace GAPI { TexFormat fmt; 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)); } @@ -288,8 +288,8 @@ namespace GAPI { bool isDepth = fmt == FMT_DEPTH || fmt == FMT_SHADOW; bool isCube = (opt & OPT_CUBEMAP) != 0; bool isVolume = (opt & OPT_VOLUME) != 0; - bool isTarget = (opt & OPT_TARGET); - bool isDynamic = (opt & OPT_DYNAMIC); + bool isTarget = (opt & OPT_TARGET) != 0; + bool isDynamic = (opt & OPT_DYNAMIC) != 0; static const struct FormatDesc { int bpp; diff --git a/src/level.h b/src/level.h index 91964de..1b159c0 100644 --- a/src/level.h +++ b/src/level.h @@ -93,11 +93,11 @@ struct Level : IGame { if (nextLevel != TR::LVL_MAX) return; TR::LevelID id = TR::LVL_MAX; - #ifdef _OS_WEB - if (level.id == TR::LVL_TR1_2 && level.version != TR::VER_TR1_PC) - id = TR::LVL_TR1_TITLE; - else - #endif + //#ifdef _OS_WEB + // if (level.id == TR::LVL_TR1_2 && level.version != TR::VER_TR1_PC) + // id = TR::LVL_TR1_TITLE; + // else + //#endif id = (level.isEnd() || level.isHome()) ? level.getTitleId() : TR::LevelID(level.id + 1); TR::isGameEnded = level.isEnd(); @@ -1710,7 +1710,7 @@ struct Level : IGame { short4 uv = t.getMinMax(); uv.z++; 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++) { @@ -1718,15 +1718,16 @@ struct Level : IGame { short4 uv = t.getMinMax(); uv.z++; 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++) { char buf[256]; sprintf(buf, "texture/%s_%d.png", TR::LEVEL_INFO[level.id].name, i); if (Stream::exists(buf)) { + Stream stream(buf); 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); } }