Skip to content

Commit 423d1ce

Browse files
committed
we are getting closer, fix temporary object reference by a pointer, don't log on android build in openEXR loader
1 parent ca1d2e5 commit 423d1ce

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

examples_tests/43.SumAndCDFFilters/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ class SumAndCDFFilterSampleApp : public NonGraphicalApplicationBase
6868

6969
public:
7070

71-
void setSystem(core::smart_refctd_ptr<nbl::system::ISystem>&& system) override
71+
void setSystem(core::smart_refctd_ptr<nbl::system::ISystem>&& _system) override
7272
{
73-
system = std::move(system);
73+
system = std::move(_system);
7474
}
7575

7676
NON_GRAPHICAL_APP_CONSTRUCTOR(SumAndCDFFilterSampleApp);

src/nbl/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ option(_NBL_COMPILE_WITH_GLTF_LOADER_ "Compile with GLTF Loader" ON)
122122
option(_NBL_COMPILE_WITH_GLTF_WRITER_ "Compile with GLTF Writer" ON)
123123

124124
if(NBL_BUILD_ANDROID)
125-
# TODO - remove those bellow in future
126-
set(_NBL_COMPILE_WITH_OPEN_EXR_ OFF CACHE BOOL "Off for Android purposes at the moment" FORCE) # TODO - check it out
127125
set(_NBL_COMPILE_WITH_BAW_LOADER_ OFF CACHE BOOL "Off for Android purposes at the moment" FORCE) # TODO - remove when BAW-v4 is done
128126
set(_NBL_COMPILE_WITH_BAW_WRITER_ OFF CACHE BOOL "Off for Android purposes at the moment" FORCE) # TODO - remove when BAW-v4 is done
129127
set(_NBL_COMPILE_WITH_OBJ_LOADER_ OFF CACHE BOOL "Off for Android purposes at the moment" FORCE)

src/nbl/asset/interchange/CImageLoaderOpenEXR.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,9 @@ namespace nbl
356356

357357
if (params.format == EF_UNKNOWN)
358358
{
359+
#ifndef _NBL_PLATFORM_ANDROID_
359360
_params.logger.log("LOAD EXR: incorrect format specified for " + suffixOfChannels + " channels - skipping the file %s", system::ILogger::ELL_INFO, file.fileName());
361+
#endif // ! _NBL_PLATFORM_ANDROID_
360362
continue;
361363
}
362364

@@ -463,6 +465,7 @@ namespace nbl
463465
const auto bChannel = doesTheChannelExist("B", mapOfChannels);
464466
const auto aChannel = doesTheChannelExist("A", mapOfChannels);
465467

468+
#ifndef _NBL_PLATFORM_ANDROID_
466469
if (rChannel && gChannel && bChannel && aChannel)
467470
logger.log("LOAD EXR: loading " + suffixName + " RGBA file %s", system::ILogger::ELL_INFO, fileName.c_str());
468471
else if (rChannel && gChannel && bChannel)
@@ -473,6 +476,7 @@ namespace nbl
473476
logger.log("LOAD EXR: loading " + suffixName + " R file %s", system::ILogger::ELL_INFO, fileName.c_str());
474477
else
475478
logger.log("LOAD EXR: the file's channels are invalid to load %s", system::ILogger::ELL_ERROR, fileName.c_str());
479+
#endif // ! _NBL_PLATFORM_ANDROID_
476480

477481
auto doesMapOfChannelsFormatHaveTheSameFormatLikePassedToIt = [&](const PixelType ImfTypeToCompare)
478482
{
@@ -521,7 +525,9 @@ namespace nbl
521525
if (isTheBitActive(9))
522526
{
523527
versionField.Compoment.singlePartFileCompomentSubTypes = SContext::VersionField::Compoment::TILES;
528+
#ifndef _NBL_PLATFORM_ANDROID_
524529
logger.log("LOAD EXR: the file consist of not supported tiles %s", system::ILogger::ELL_ERROR, file.fileName());
530+
#endif // !_NBL_PLATFORM_ANDROID_
525531
return false;
526532
}
527533
else
@@ -531,14 +537,18 @@ namespace nbl
531537
{
532538
versionField.Compoment.type = SContext::VersionField::Compoment::MULTI_PART_FILE;
533539
versionField.Compoment.singlePartFileCompomentSubTypes = SContext::VersionField::Compoment::SCAN_LINES_OR_TILES;
540+
#ifndef _NBL_PLATFORM_ANDROID_
534541
logger.log("LOAD EXR: the file is a not supported multi part file %s", system::ILogger::ELL_ERROR, file.fileName());
542+
#endif // ! _NBL_PLATFORM_ANDROID_
535543
return false;
536544
}
537545

538546
if (!isTheBitActive(9) && isTheBitActive(11) && isTheBitActive(12))
539547
{
540548
versionField.doesItSupportDeepData = true;
549+
#ifndef _NBL_PLATFORM_ANDROID_
541550
logger.log("LOAD EXR: the file consist of not supported deep data%s", system::ILogger::ELL_ERROR, file.fileName());
551+
#endif // ! _NBL_PLATFORM_ANDROID_
542552
return false;
543553
}
544554
else

src/nbl/system/CFilePOSIX.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ namespace nbl::system
1212
CFilePOSIX::CFilePOSIX(core::smart_refctd_ptr<ISystem>&& sys, const std::filesystem::path& _filename, core::bitflag<E_CREATE_FLAGS> _flags) :
1313
base_t(std::move(sys), _filename, _flags)
1414
{
15-
const char* name_c_str = _filename.string().c_str();
15+
auto filenameStream = _filename.string();
16+
const char* name_c_str = filenameStream.c_str();
1617
int createFlags = O_LARGEFILE;
1718
int mappingFlags;
1819
if ((_flags.value & ECF_READ_WRITE) == ECF_READ_WRITE)

0 commit comments

Comments
 (0)