From 525af7685ea65ef9f6cafaf563ffbfb063c9df37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 11 Jun 2017 21:01:38 -0700 Subject: [PATCH] Renaming CrtFile* -> File*. --- examples/07-callback/callback.cpp | 2 +- examples/common/entry/entry.cpp | 14 ++++---------- src/bgfx.cpp | 4 +--- tools/geometryc/geometryc.cpp | 2 +- tools/shaderc/shaderc.cpp | 32 +++++++++++++++---------------- tools/texturev/texturev.cpp | 4 ++-- 6 files changed, 25 insertions(+), 33 deletions(-) diff --git a/examples/07-callback/callback.cpp b/examples/07-callback/callback.cpp index d8101d914..ea48006a0 100644 --- a/examples/07-callback/callback.cpp +++ b/examples/07-callback/callback.cpp @@ -108,7 +108,7 @@ void imageWriteTga(bx::WriterI* _writer, uint32_t _width, uint32_t _height, uint void saveTga(const char* _filePath, uint32_t _width, uint32_t _height, uint32_t _srcPitch, const void* _src, bool _grayscale, bool _yflip) { - bx::CrtFileWriter writer; + bx::FileWriter writer; bx::Error err; if (bx::open(&writer, _filePath, false, &err) ) { diff --git a/examples/common/entry/entry.cpp b/examples/common/entry/entry.cpp index e65a04f80..22bacfd52 100644 --- a/examples/common/entry/entry.cpp +++ b/examples/common/entry/entry.cpp @@ -56,10 +56,9 @@ namespace entry static String s_currentDir; -#if BX_CONFIG_CRT_FILE_READER_WRITER - class FileReader : public bx::CrtFileReader + class FileReader : public bx::FileReader { - typedef bx::CrtFileReader super; + typedef bx::FileReader super; public: virtual bool open(const char* _filePath, bx::Error* _err) BX_OVERRIDE @@ -70,9 +69,9 @@ namespace entry } }; - class FileWriter : public bx::CrtFileWriter + class FileWriter : public bx::FileWriter { - typedef bx::CrtFileWriter super; + typedef bx::FileWriter super; public: virtual bool open(const char* _filePath, bool _append, bx::Error* _err) BX_OVERRIDE @@ -82,7 +81,6 @@ namespace entry return super::open(filePath.getPtr(), _append, _err); } }; -#endif // BX_CONFIG_CRT_FILE_READER_WRITER void setCurrentDir(const char* _dir) { @@ -443,10 +441,8 @@ BX_PRAGMA_DIAGNOSTIC_POP(); } } -#if BX_CONFIG_CRT_FILE_READER_WRITER s_fileReader = BX_NEW(g_allocator, FileReader); s_fileWriter = BX_NEW(g_allocator, FileWriter); -#endif // BX_CONFIG_CRT_FILE_READER_WRITER cmdInit(); cmdAdd("mouselock", cmdMouseLock); @@ -468,13 +464,11 @@ BX_PRAGMA_DIAGNOSTIC_POP(); cmdShutdown(); -#if BX_CONFIG_CRT_FILE_READER_WRITER BX_DELETE(g_allocator, s_fileReader); s_fileReader = NULL; BX_DELETE(g_allocator, s_fileWriter); s_fileWriter = NULL; -#endif // BX_CONFIG_CRT_FILE_READER_WRITER if (BX_ENABLED(ENTRY_CONFIG_PROFILER) && NULL != s_rmt) diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 718251cdc..50de2ce7e 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -117,19 +117,17 @@ namespace bgfx { BX_UNUSED(_filePath, _width, _height, _pitch, _data, _size, _yflip); -#if BX_CONFIG_CRT_FILE_READER_WRITER const int32_t len = bx::strLen(_filePath)+5; char* filePath = (char*)alloca(len); bx::strCopy(filePath, len, _filePath); bx::strCat(filePath, len, ".tga"); - bx::CrtFileWriter writer; + bx::FileWriter writer; if (bx::open(&writer, filePath) ) { bimg::imageWriteTga(&writer, _width, _height, _pitch, _data, false, _yflip); bx::close(&writer); } -#endif // BX_CONFIG_CRT_FILE_READER_WRITER } virtual void captureBegin(uint32_t /*_width*/, uint32_t /*_height*/, uint32_t /*_pitch*/, TextureFormat::Enum /*_format*/, bool /*_yflip*/) BX_OVERRIDE diff --git a/tools/geometryc/geometryc.cpp b/tools/geometryc/geometryc.cpp index 56408080c..58b2465f4 100644 --- a/tools/geometryc/geometryc.cpp +++ b/tools/geometryc/geometryc.cpp @@ -851,7 +851,7 @@ int main(int _argc, const char* _argv[]) PrimitiveArray primitives; - bx::CrtFileWriter writer; + bx::FileWriter writer; if (!bx::open(&writer, outFilePath) ) { printf("Unable to open output file '%s'.", outFilePath); diff --git a/tools/shaderc/shaderc.cpp b/tools/shaderc/shaderc.cpp index a275ff5fa..f2e335f2a 100644 --- a/tools/shaderc/shaderc.cpp +++ b/tools/shaderc/shaderc.cpp @@ -211,7 +211,7 @@ namespace bgfx return len; } - class Bin2cWriter : public bx::CrtFileWriter + class Bin2cWriter : public bx::FileWriter { public: Bin2cWriter(const char* _name) @@ -226,7 +226,7 @@ namespace bgfx virtual void close() BX_OVERRIDE { generate(); - return bx::CrtFileWriter::close(); + return bx::FileWriter::close(); } virtual int32_t write(const void* _data, int32_t _size, bx::Error*) BX_OVERRIDE @@ -300,7 +300,7 @@ namespace bgfx } bx::Error err; - int32_t size = bx::CrtFileWriter::write(out, len, &err); + int32_t size = bx::FileWriter::write(out, len, &err); va_end(argList); @@ -331,7 +331,7 @@ namespace bgfx File(const char* _filePath) : m_data(NULL) { - bx::CrtFileReader reader; + bx::FileReader reader; if (bx::open(&reader, _filePath) ) { m_size = (uint32_t)bx::getSize(&reader); @@ -442,7 +442,7 @@ namespace bgfx void writeFile(const char* _filePath, const void* _data, int32_t _size) { - bx::CrtFileWriter out; + bx::FileWriter out; if (bx::open(&out, _filePath) ) { bx::write(&out, _data, _size); @@ -1056,7 +1056,7 @@ namespace bgfx bool compiled = false; - bx::CrtFileReader reader; + bx::FileReader reader; if (!bx::open(&reader, filePath) ) { fprintf(stderr, "Unable to open file '%s'.\n", filePath); @@ -1236,7 +1236,7 @@ namespace bgfx if (raw) { - bx::CrtFileWriter* writer = NULL; + bx::FileWriter* writer = NULL; if (NULL != bin2c) { @@ -1244,7 +1244,7 @@ namespace bgfx } else { - writer = new bx::CrtFileWriter; + writer = new bx::FileWriter; } if (!bx::open(writer, outFilePath) ) @@ -1382,7 +1382,7 @@ namespace bgfx if (preprocessOnly) { - bx::CrtFileWriter writer; + bx::FileWriter writer; if (!bx::open(&writer, outFilePath) ) { @@ -1397,7 +1397,7 @@ namespace bgfx } { - bx::CrtFileWriter* writer = NULL; + bx::FileWriter* writer = NULL; if (NULL != bin2c) { @@ -1405,7 +1405,7 @@ namespace bgfx } else { - writer = new bx::CrtFileWriter; + writer = new bx::FileWriter; } if (!bx::open(writer, outFilePath) ) @@ -1468,7 +1468,7 @@ namespace bgfx { std::string ofp = outFilePath; ofp += ".d"; - bx::CrtFileWriter writer; + bx::FileWriter writer; if (bx::open(&writer, ofp.c_str() ) ) { writef(&writer, "%s : %s\n", outFilePath, preprocessor.m_depends.c_str() ); @@ -1852,7 +1852,7 @@ namespace bgfx if (preprocessOnly) { - bx::CrtFileWriter writer; + bx::FileWriter writer; if (!bx::open(&writer, outFilePath) ) { @@ -1878,7 +1878,7 @@ namespace bgfx } { - bx::CrtFileWriter* writer = NULL; + bx::FileWriter* writer = NULL; if (NULL != bin2c) { @@ -1886,7 +1886,7 @@ namespace bgfx } else { - writer = new bx::CrtFileWriter; + writer = new bx::FileWriter; } if (!bx::open(writer, outFilePath) ) @@ -2178,7 +2178,7 @@ namespace bgfx { std::string ofp = outFilePath; ofp += ".d"; - bx::CrtFileWriter writer; + bx::FileWriter writer; if (bx::open(&writer, ofp.c_str() ) ) { writef(&writer, "%s : %s\n", outFilePath, preprocessor.m_depends.c_str() ); diff --git a/tools/texturev/texturev.cpp b/tools/texturev/texturev.cpp index 54b738ac5..24e9b6c05 100644 --- a/tools/texturev/texturev.cpp +++ b/tools/texturev/texturev.cpp @@ -646,7 +646,7 @@ void associate() GetTempPathA(MAX_PATH, temp); bx::strCat(temp, MAX_PATH, "\\texturev.reg"); - bx::CrtFileWriter writer; + bx::FileWriter writer; bx::Error err; if (bx::open(&writer, temp, false, &err) ) { @@ -677,7 +677,7 @@ void associate() str += "\n"; - bx::CrtFileWriter writer; + bx::FileWriter writer; bx::Error err; if (bx::open(&writer, "/tmp/texturev.sh", false, &err) ) {