This commit is contained in:
luboslenco
2025-04-01 11:11:06 +02:00
parent 962af692d8
commit 7306ab79b1
5 changed files with 9 additions and 123 deletions
+7 -3
View File
@@ -15,8 +15,12 @@ let dir = flags.name.toLowerCase();
if (!flags.lite) {
project.add_define("IDLE_SLEEP");
if (graphics === "vulkan") {
project.add_project("./sources/libs/to_spirv");
project.add_cfiles('sources/libs/kong/libs/*.c');
project.add_cfiles('sources/libs/kong/*.c');
project.add_cfiles('sources/libs/kong/backends/*.c');
if (platform === "windows") {
project.add_define('_CRT_SECURE_NO_WARNINGS');
project.add_lib('d3dcompiler');
}
if (flags.with_onnx) {
@@ -260,7 +264,7 @@ if (fs_exists(os_cwd() + "/icon.png")) {
project.add_include_dir("sources/libs");
project.add_cfiles("sources/libs/gc.c");
project.add_cfiles("sources/libs/dir.c");
project.add_cfiles("sources/libs/kong/dir.c");
project.add_include_dir("sources");
project.add_cfiles("sources/iron.c");
project.add_define("IRON_C_PATH=\"" + os_cwd() + "/build/iron.c" + "\"");
+1 -5
View File
@@ -317,7 +317,7 @@ string_t *iron_get_arg(i32 index) {
#include "iron_math.h"
#include "iron_net.h"
#include <lz4x.h>
#include "dir.h"
#include "kong/dir.h"
#ifdef WITH_AUDIO
#include "iron_audio.h"
#endif
@@ -374,10 +374,6 @@ const char *iphonegetresourcepath();
char mobile_title[1024];
#endif
#if defined(IRON_VULKAN) && defined(KRAFIX_LIBRARY)
int krafix_compile(const char *source, char *output, int *length, const char *targetlang, const char *system, const char *shadertype, int version);
#endif
extern iron_gpu_command_list_t commandList;
static iron_gpu_buffer_t constant_buffer;
static iron_gpu_texture_t *render_target;
-94
View File
@@ -1,94 +0,0 @@
// Copyright (c) 2022 the Kongruent development team
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
// 3. This notice may not be removed or altered from any source distribution.
#include "dir.h"
#include <stddef.h>
#include <stdio.h>
#ifdef _WIN32
#include <Windows.h>
directory open_dir(const char *dirname) {
char pattern[1024];
strcpy(pattern, dirname);
strcat(pattern, "\\*");
WIN32_FIND_DATAA data;
directory dir;
dir.handle = FindFirstFileA(pattern, &data);
if (dir.handle == INVALID_HANDLE_VALUE) {
return dir;
}
FindNextFileA(dir.handle, &data);
return dir;
}
file read_next_file(directory *dir) {
WIN32_FIND_DATAA data;
file file;
file.valid = FindNextFileA(dir->handle, &data) != 0;
if (file.valid) {
strcpy(file.name, data.cFileName);
}
else {
file.name[0] = 0;
}
return file;
}
void close_dir(directory *dir) {
FindClose(dir->handle);
}
#else
#include <string.h>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>
directory open_dir(const char *dirname) {
directory dir;
dir.handle = opendir(dirname);
return dir;
}
file read_next_file(directory *dir) {
struct dirent *entry = readdir(dir->handle);
while (entry != NULL && (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)) {
entry = readdir(dir->handle);
}
file f;
f.valid = entry != NULL;
if (f.valid) {
strcpy(f.name, entry->d_name);
}
return f;
}
void close_dir(directory *dir) {}
#endif
-16
View File
@@ -1,16 +0,0 @@
#pragma once
#include <stdbool.h>
typedef struct directory {
void *handle;
} directory;
typedef struct file {
bool valid;
char name[256];
} file;
directory open_dir(const char *dirname);
file read_next_file(directory *dir);
void close_dir(directory *dir);
+1 -5
View File
@@ -1,7 +1,4 @@
#include "dir.h"
#include "log.h"
#include <stddef.h>
#include <stdio.h>
@@ -18,8 +15,7 @@ directory open_dir(const char *dirname) {
directory dir;
dir.handle = FindFirstFileA(pattern, &data);
if (dir.handle == INVALID_HANDLE_VALUE) {
kong_log(LOG_LEVEL_ERROR, "FindFirstFile failed (%d)\n", GetLastError());
exit(1);
return dir;
}
FindNextFileA(dir.handle, &data);
return dir;