Skip to content

Commit 7eae24c

Browse files
committed
Fixed a few comments
1 parent 29eb064 commit 7eae24c

File tree

4 files changed

+5
-34
lines changed

4 files changed

+5
-34
lines changed

examples_tests/20.Megatexture/main.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,18 @@ struct commit_t
149149
};
150150
STextureData getTextureData(core::vector<commit_t>& _out_commits, const asset::ICPUImage* _img, asset::ICPUVirtualTexture* _vt, asset::ISampler::E_TEXTURE_CLAMP _uwrap, asset::ISampler::E_TEXTURE_CLAMP _vwrap, asset::ISampler::E_TEXTURE_BORDER_COLOR _borderColor)
151151
{
152-
const auto& extent = _img->getCreationParameters().extent;
152+
auto img = _vt->createUpscaledImage(_img);
153+
const auto& extent = img->getCreationParameters().extent;
153154

154-
auto imgAndOrigSz = asset::ICPUVirtualTexture::createPoTPaddedSquareImageWithMipLevels(_img, _uwrap, _vwrap, _borderColor);
155+
auto imgAndOrigSz = asset::ICPUVirtualTexture::createPoTPaddedSquareImageWithMipLevels(img.get(), _uwrap, _vwrap, _borderColor);
155156

156157
asset::IImage::SSubresourceRange subres;
157158
subres.baseMipLevel = 0u;
158159
subres.levelCount = core::findLSB(core::roundDownToPoT<uint32_t>(std::max(extent.width, extent.height))) + 1;
159160
subres.baseArrayLayer = 0u;
160161
subres.layerCount = 1u;
161162

162-
auto addr = _vt->alloc(_img->getCreationParameters().format, imgAndOrigSz.second, subres, _uwrap, _vwrap);
163+
auto addr = _vt->alloc(img->getCreationParameters().format, imgAndOrigSz.second, subres, _uwrap, _vwrap);
163164
commit_t cm{ addr, std::move(imgAndOrigSz.first), subres, _uwrap, _vwrap, _borderColor };
164165

165166
_out_commits.push_back(cm);

include/nbl/macros.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@
6262
#if defined(_NBL_DEBUG) || defined(_NBL_RELWITHDEBINFO)
6363
// TODO even though it is defined in RWDI build, _DEBUG #define is not defined in msvc (in rwdi) so debug break is not triggered anyway
6464
// idk what about other compilers
65-
//#define _NBL_DEBUG_BREAK_IF( _CONDITION_ ) _NBL_BREAK_IF(_CONDITION_)
66-
#define _NBL_DEBUG_BREAK_IF( _CONDITION_ )
65+
#define _NBL_DEBUG_BREAK_IF( _CONDITION_ ) _NBL_BREAK_IF(_CONDITION_)
6766
#else
6867
#define _NBL_DEBUG_BREAK_IF( _CONDITION_ )
6968
#endif

src/nbl/asset/interchange/CImageLoaderTGA.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -108,34 +108,6 @@ bool CImageLoaderTGA::isALoadableFileFormat(io::IReadFile* _file) const
108108
//os::Printer::log("Invalid (non-TGA) file!", _file->getFileName().c_str(), ELL_ERROR);
109109
return false;
110110
}
111-
112-
// why did it even check gamma in isALoadableFileFormat ???
113-
/*
114-
float gamma;
115-
116-
if (footer.ExtensionOffset == 0)
117-
{
118-
os::Printer::log("Gamma information is not present! Assuming 2.333333", ELL_WARNING);
119-
gamma = 2.333333f;
120-
}
121-
else
122-
{
123-
STGAExtensionArea extension;
124-
_file->seek(footer.ExtensionOffset);
125-
_file->read(&extension, sizeof(STGAExtensionArea));
126-
127-
gamma = extension.Gamma;
128-
129-
if (gamma == 0.0f)
130-
{
131-
os::Printer::log("Gamma information is not present! Assuming 2.333333", ELL_WARNING);
132-
gamma = 2.333333f;
133-
}
134-
135-
// TODO - pass gamma to LoadAsset()?
136-
// Actually I think metadata will be in used here in near future
137-
}
138-
*/
139111

140112
_file->seek(prevPos);
141113

src/nbl/ext/MitsubaLoader/CMitsubaLoader.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,6 @@ auto CMitsubaLoader::genBSDFtreeTraversal(SContext& ctx, const CElementBSDF* _bs
12991299

13001300
if (!getBuiltinAsset<asset::ICPUImage, asset::IAsset::ET_IMAGE>(key.c_str(), m_assetMgr))
13011301
{
1302-
printf("%s\n", bumpmap_element->id.c_str());
13031302
auto derivmap = createDerivMap(ctx, bumpmap.get(),sampler.get(),wasNormal);
13041303
asset::SAssetBundle imgBundle(nullptr,{ derivmap });
13051304
ctx.override_->insertAssetIntoCache(std::move(imgBundle), key, ctx.inner, 0u);

0 commit comments

Comments
 (0)