Add update links for FreeBSD, NetBSD, Windows ARM

This commit is contained in:
UnknownShadow200 2024-05-30 19:56:34 +10:00
parent b3716e259e
commit bbda33cd5a
4 changed files with 43 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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;
}