Editor: pasta-base do projeto tambem com separador \ (Windows)
O project_set_dir procurava so '/', entao num caminho do Windows (ex.: jogo-3d\minecraft.sb) ele nao achava a pasta: os assets relativos (carregue o PNG, etc.) abriam com o caminho errado e davam "libpng: No such file or directory". Agora aceita '\' tambem. Achado testando o build de Windows 2000 na VM real (QEMU). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5e4dda2a77
commit
207d8c2078
1 file changed
+2
@@ -3648,6 +3648,8 @@ static void project_set_dir(const char* path) {
|
|||||||
if (!path || !path[0] || strlen(path) >= sizeof(buf)) return;
|
if (!path || !path[0] || strlen(path) >= sizeof(buf)) return;
|
||||||
strcpy(buf, path);
|
strcpy(buf, path);
|
||||||
char* slash = strrchr(buf, '/');
|
char* slash = strrchr(buf, '/');
|
||||||
|
char* bslash = strrchr(buf, '\\'); /* Windows usa \ */
|
||||||
|
if (bslash && (!slash || bslash > slash)) slash = bslash;
|
||||||
if (!slash) return;
|
if (!slash) return;
|
||||||
*slash = '\0';
|
*slash = '\0';
|
||||||
if (buf[0]) tb_path_set_base(buf);
|
if (buf[0]) tb_path_set_base(buf);
|
||||||
|
|||||||
Reference in new issue
Block a user