Skip to content

Commit 8ea64c9

Browse files
Fix PNG writer, and signed/unsigned comparison with ZIP archives.
P.S. Also android fixes.
1 parent 17afb7c commit 8ea64c9

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

include/nbl/system/ICancellableAsyncQueueDispatcher.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ class ICancellableAsyncQueueDispatcher : public IAsyncQueueDispatcher<CRTP, Requ
186186
_NBL_DEBUG_BREAK_IF(didntUseFuture);
187187
}
188188

189+
// can only be called once!
189190
T& get()
190191
{
191192
future_base_t::wait();

include/nbl/system/ISystemPOSIX.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ class ISystemPOSIX : public ISystem
1313
class CCaller final : public ISystem::ICaller
1414
{
1515
public:
16+
CCaller(ISystemPOSIX* _system) : ICaller(_system) {}
17+
1618
core::smart_refctd_ptr<ISystemFile> createFile(const std::filesystem::path& filename, const core::bitflag<IFile::E_CREATE_FLAGS> flags) override;
1719
};
1820

src/nbl/asset/interchange/CImageWriterPNG.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ void PNGAPI user_write_data_fcn(png_structp png_ptr, png_bytep data, png_size_t
5252
//check=(png_size_t) file->write((const void*)data,(uint32_t)length);
5353
auto usrData = (CImageWriterPNG::SContext*)png_get_user_chunk_ptr(png_ptr);
5454

55-
system::ISystem::future_t<size_t> future;
56-
file->write(future, data, usrData->file_pos, length);
57-
usrData->file_pos += future.get();
58-
png_set_read_user_chunk_fn(png_ptr, usrData, nullptr);
59-
60-
if (future.get() != length)
55+
system::IFile::success_t success;
56+
file->write(success, data, usrData->file_pos, length);
57+
if (!success)
6158
png_error(png_ptr, "Write Error");
59+
60+
usrData->file_pos += success.getSizeToProcess();
61+
png_set_read_user_chunk_fn(png_ptr, usrData, nullptr);
6262
}
6363
#endif // _NBL_COMPILE_WITH_LIBPNG_
6464

src/nbl/system/CArchiveLoaderZip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ enum E_GZIP_FLAGS
7878
};
7979
struct SZipFileExtraHeader
8080
{
81-
int16_t ID;
81+
uint16_t ID;
8282
int16_t Size;
8383
};
8484

src/nbl/system/CSystemAndroid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ ISystem::SystemInfo CSystemAndroid::getSystemInfo() const
2828
{
2929
SystemInfo info;
3030
// TODO: hardcoded
31-
info.cpuFrequency = 1100;
31+
info.cpuFrequencyHz = 1100000000;
3232
info.totalMemory = 4ull<<30ull;
3333
info.availableMemory = 2ull<<30ull;
3434

0 commit comments

Comments
 (0)