mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-14 23:26:00 +08:00
Run clang-format
This commit is contained in:
parent
01d54380ac
commit
96a8b2c69b
13
tiny_gltf.h
13
tiny_gltf.h
@ -1253,7 +1253,8 @@ struct FsCallbacks {
|
||||
bool FileExists(const std::string &abs_filename, void *);
|
||||
|
||||
///
|
||||
/// Expand file path(e.g. `~` to home directory on posix, `%APPDATA%` to `C:\Users\tinygltf\AppData`)
|
||||
/// Expand file path(e.g. `~` to home directory on posix, `%APPDATA%` to
|
||||
/// `C:\Users\tinygltf\AppData`)
|
||||
///
|
||||
/// @param[in] filepath File path string. Assume UTF-8
|
||||
/// @param[in] userdata User data. Set to `nullptr` if you don't need it.
|
||||
@ -2495,7 +2496,7 @@ static inline std::wstring UTF8ToWchar(const std::string &str) {
|
||||
|
||||
static inline std::string WcharToUTF8(const std::wstring &wstr) {
|
||||
int str_size = WideCharToMultiByte(CP_UTF8, 0, wstr.data(), (int)wstr.size(),
|
||||
nullptr, 0, NULL, NULL);
|
||||
nullptr, 0, NULL, NULL);
|
||||
std::string str(str_size, 0);
|
||||
WideCharToMultiByte(CP_UTF8, 0, wstr.data(), (int)wstr.size(), &str[0],
|
||||
(int)str.size(), NULL, NULL);
|
||||
@ -2638,7 +2639,8 @@ bool ReadWholeFile(std::vector<unsigned char> *out, std::string *err,
|
||||
__gnu_cxx::stdio_filebuf<char> wfile_buf(file_descriptor, std::ios_base::in);
|
||||
std::istream f(&wfile_buf);
|
||||
#elif defined(_MSC_VER) || defined(_LIBCPP_VERSION)
|
||||
// For libcxx, assume _LIBCPP_HAS_OPEN_WITH_WCHAR is defined to accept `wchar_t *`
|
||||
// For libcxx, assume _LIBCPP_HAS_OPEN_WITH_WCHAR is defined to accept
|
||||
// `wchar_t *`
|
||||
std::ifstream f(UTF8ToWchar(filepath).c_str(), std::ifstream::binary);
|
||||
#else
|
||||
// Unknown compiler/runtime
|
||||
@ -7345,8 +7347,9 @@ static void SerializeGltfModel(Model *model, json &o) {
|
||||
|
||||
// Also add "KHR_lights_punctual" to `extensionsUsed`
|
||||
{
|
||||
auto has_khr_lights_punctual = std::find_if(
|
||||
extensionsUsed.begin(), extensionsUsed.end(), [](const std::string &s) {
|
||||
auto has_khr_lights_punctual =
|
||||
std::find_if(extensionsUsed.begin(), extensionsUsed.end(),
|
||||
[](const std::string &s) {
|
||||
return (s.compare("KHR_lights_punctual") == 0);
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user