Initial checkin of v1.04 - KTX file format support, basic ETC1 compression/decompression, Linux makefile with proper gcc options, lots of high-level improvements to get crnlib into a state where I can more easily add additional formats.
This commit is contained in:
@@ -554,4 +554,25 @@ namespace crnlib
|
||||
return !*pWild;
|
||||
}
|
||||
|
||||
bool file_utils::write_buf_to_file(const char* pPath, const void* pData, size_t data_size)
|
||||
{
|
||||
FILE *pFile = NULL;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// Compiling with MSVC
|
||||
if (fopen_s(&pFile, pPath, "wb"))
|
||||
return false;
|
||||
#else
|
||||
pFile = fopen(pPath, "wb");
|
||||
#endif
|
||||
if (!pFile)
|
||||
return false;
|
||||
|
||||
bool success = fwrite(pData, 1, data_size, pFile) == data_size;
|
||||
|
||||
fclose(pFile);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
} // namespace crnlib
|
||||
|
||||
Reference in New Issue
Block a user