diff --git a/src/Core.h b/src/Core.h index 169aca2c0..050ad4b86 100644 --- a/src/Core.h +++ b/src/Core.h @@ -129,7 +129,8 @@ typedef cc_uint8 cc_bool; #define CC_GFX_BACKEND_GL 1 #define CC_GFX_BACKEND_D3D9 2 #define CC_GFX_BACKEND_D3D11 3 -#define CC_GFX_BACKEND_SOFTGPU 4 +#define CC_GFX_BACKEND_VULKAN 4 +#define CC_GFX_BACKEND_SOFTGPU 11 #define CC_BUILD_NETWORKING #define CC_BUILD_FREETYPE diff --git a/src/Platform_Posix.c b/src/Platform_Posix.c index 286683220..eaf6f1a7d 100644 --- a/src/Platform_Posix.c +++ b/src/Platform_Posix.c @@ -1050,6 +1050,20 @@ cc_bool Updater_Clean(void) { return true; } #else const struct UpdaterInfo Updater_Info = { "&eCompile latest source code to update", 0 }; #endif +#elif defined CC_BUILD_FREEBSD + #if __x86_64__ + const struct UpdaterInfo Updater_Info = { "", 1, { { "OpenGL", "cc-fbsd64-gl1" } } }; + #elif __i386__ + const struct UpdaterInfo Updater_Info = { "", 1, { { "OpenGL", "cc-fbsd32-gl1" } } }; + #else + const struct UpdaterInfo Updater_Info = { "&eCompile latest source code to update", 0 }; + #endif +#elif defined CC_BUILD_NETBSD + #if __x86_64__ + const struct UpdaterInfo Updater_Info = { "", 1, { { "OpenGL", "cc-netbsd64-gl1" } } }; + #else + const struct UpdaterInfo Updater_Info = { "&eCompile latest source code to update", 0 }; + #endif #else const struct UpdaterInfo Updater_Info = { "&eCompile latest source code to update", 0 }; #endif diff --git a/src/Platform_Windows.c b/src/Platform_Windows.c index 3eb6b99fd..a4f324766 100644 --- a/src/Platform_Windows.c +++ b/src/Platform_Windows.c @@ -726,18 +726,30 @@ cc_result Process_StartOpen(const cc_string* args) { #define UPDATE_SRC TEXT(UPDATE_FILE) cc_bool Updater_Supported = true; +#if defined _M_IX86 const struct UpdaterInfo Updater_Info = { "&eDirect3D 9 is recommended", 2, { -#if _WIN64 - { "Direct3D9", "ClassiCube.64.exe" }, - { "OpenGL", "ClassiCube.64-opengl.exe" } -#else { "Direct3D9", "ClassiCube.exe" }, { "OpenGL", "ClassiCube.opengl.exe" } -#endif } }; +#elif defined _M_X64 +const struct UpdaterInfo Updater_Info = { + "&eDirect3D 9 is recommended", 2, + { + { "Direct3D9", "ClassiCube.64.exe" }, + { "OpenGL", "ClassiCube.64-opengl.exe" } + } +}; +#elif defined _M_ARM64 +const struct UpdaterInfo Updater_Info = { "", 1, { { "Direct3D11", "cc-arm64-d3d11.exe" } } }; +#elif defined _M_ARM +const struct UpdaterInfo Updater_Info = { "", 1, { { "Direct3D11", "cc-arm32-d3d11.exe" } } }; +#else +const struct UpdaterInfo Updater_Info = { "&eCompile latest source code to update", 0 }; +#endif +}; cc_bool Updater_Clean(void) { return DeleteFile(UPDATE_TMP) || GetLastError() == ERROR_FILE_NOT_FOUND; diff --git a/src/SystemFonts.c b/src/SystemFonts.c index dc2644717..d9c54dfe5 100644 --- a/src/SystemFonts.c +++ b/src/SystemFonts.c @@ -258,20 +258,26 @@ void FallbackFont_DrawText(struct DrawTextArgs* args, struct Bitmap* bmp, int x, #include "freetype/ftmodapi.h" #include "freetype/ftglyph.h" -int cc_strncmp(const char* a, const char* b, size_t maxCount) { +int cc_strncmp(const char* strA, const char* strB, size_t maxCount) { + const unsigned char* a = (const unsigned char*)strA; + const unsigned char* b = (const unsigned char*)strB; int i; + for (i = 0; a[i] && i < maxCount; i++) { - if (a[i] != b[i]) return (unsigned char)a[i] - (unsigned char)b[i]; + if (a[i] != b[i]) return a[i] - b[i]; } return 0; } -int cc_strcmp(const char* a, const char* b) { +int cc_strcmp(const char* strA, const char* strB) { + const unsigned char* a = (const unsigned char*)strA; + const unsigned char* b = (const unsigned char*)strB; int i; + for (i = 0; a[i]; i++) { - if (a[i] != b[i]) return (unsigned char)a[i] - (unsigned char)b[i]; + if (a[i] != b[i]) return a[i] - b[i]; } return 0; }