Convert linebreaks from CRLF to LF

This commit is contained in:
kichikuou
2022-04-03 11:34:48 +09:00
parent 82ce12e82c
commit cc75dd7c94
34 changed files with 10891 additions and 10891 deletions
+38 -38
View File
@@ -1,38 +1,38 @@
#ifdef _WIN32
#include <windows.h>
#undef ERROR
#endif
#include "common.h"
SDL_RWops* open_resource(const char* name, const char* type) {
#ifdef _WIN32
// On Windows, read from resource.
HINSTANCE hInst = GetModuleHandle(NULL);
HRSRC hRes = FindResource(hInst, name, type);
HGLOBAL hGlobal = LoadResource(hInst, hRes);
if (!hGlobal) {
WARNING("Cannot load resource %s (type: %s)", name, type);
return NULL;
}
return SDL_RWFromConstMem(LockResource(hGlobal), SizeofResource(hInst, hRes));
#else
// On Android, read from APK assets.
// On other platforms, read from a file under RESOURCE_PATH.
char path[_MAX_PATH];
sprintf_s(path, _MAX_PATH, "%s%s/%s", RESOURCE_PATH, type, name);
return SDL_RWFromFile(path, "rb");
#endif
}
SDL_RWops* open_file(const char* name) {
#ifdef __ANDROID__
// We cannot use SDL_RWFromFile() because it does not resolve relative
// paths using the current directory on Android.
FILE *fp = fopen(name, "rb");
if (!fp)
return NULL;
return SDL_RWFromFP(fp, SDL_TRUE);
#else
return SDL_RWFromFile(name, "rb");
#endif
}
#ifdef _WIN32
#include <windows.h>
#undef ERROR
#endif
#include "common.h"
SDL_RWops* open_resource(const char* name, const char* type) {
#ifdef _WIN32
// On Windows, read from resource.
HINSTANCE hInst = GetModuleHandle(NULL);
HRSRC hRes = FindResource(hInst, name, type);
HGLOBAL hGlobal = LoadResource(hInst, hRes);
if (!hGlobal) {
WARNING("Cannot load resource %s (type: %s)", name, type);
return NULL;
}
return SDL_RWFromConstMem(LockResource(hGlobal), SizeofResource(hInst, hRes));
#else
// On Android, read from APK assets.
// On other platforms, read from a file under RESOURCE_PATH.
char path[_MAX_PATH];
sprintf_s(path, _MAX_PATH, "%s%s/%s", RESOURCE_PATH, type, name);
return SDL_RWFromFile(path, "rb");
#endif
}
SDL_RWops* open_file(const char* name) {
#ifdef __ANDROID__
// We cannot use SDL_RWFromFile() because it does not resolve relative
// paths using the current directory on Android.
FILE *fp = fopen(name, "rb");
if (!fp)
return NULL;
return SDL_RWFromFP(fp, SDL_TRUE);
#else
return SDL_RWFromFile(name, "rb");
#endif
}