Build fixes
This commit is contained in:
@@ -18,7 +18,10 @@ directory open_dir(const char *dirname) {
|
|||||||
directory dir;
|
directory dir;
|
||||||
dir.handle = FindFirstFileA(pattern, &data);
|
dir.handle = FindFirstFileA(pattern, &data);
|
||||||
if (dir.handle == INVALID_HANDLE_VALUE) {
|
if (dir.handle == INVALID_HANDLE_VALUE) {
|
||||||
kong_log(LOG_LEVEL_ERROR, "FindFirstFile failed (%d)\n", GetLastError());
|
////
|
||||||
|
// kong_log(LOG_LEVEL_ERROR, "FindFirstFile failed (%d)\n", GetLastError());
|
||||||
|
printf("FindFirstFile failed (%d)\n", GetLastError());
|
||||||
|
////
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
FindNextFileA(dir.handle, &data);
|
FindNextFileA(dir.handle, &data);
|
||||||
|
|||||||
+2
-62
@@ -669,66 +669,6 @@ class VisualStudioExporter extends Exporter {
|
|||||||
this.p('</ItemDefinitionGroup>', indent);
|
this.p('</ItemDefinitionGroup>', indent);
|
||||||
}
|
}
|
||||||
|
|
||||||
windowsSDKs() {
|
|
||||||
// Environment* env = Environment::GetCurrent(args);
|
|
||||||
// Isolate* isolate = env->isolate();
|
|
||||||
// std::vector<Local<Value>> result;
|
|
||||||
// HKEY key;
|
|
||||||
// LSTATUS status = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots", 0, KEY_READ | KEY_QUERY_VALUE, &key);
|
|
||||||
// char name[256];
|
|
||||||
// DWORD nameLength;
|
|
||||||
// for (DWORD i = 0;; ++i) {
|
|
||||||
// nameLength = sizeof(name);
|
|
||||||
// status = RegEnumKeyExA(key, i, &name[0], &nameLength, NULL, NULL, NULL, NULL);
|
|
||||||
// if (status != ERROR_SUCCESS) {
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// result.emplace_back(String::NewFromUtf8(isolate, name).ToLocalChecked());
|
|
||||||
// }
|
|
||||||
// RegCloseKey(key);
|
|
||||||
// args.GetReturnValue().Set(Array::New(isolate, result.data(), result.size()));
|
|
||||||
}
|
|
||||||
|
|
||||||
findWindowsSdk() {
|
|
||||||
let sdks = windowsSDKs();
|
|
||||||
let best = [0, 0, 0, 0];
|
|
||||||
for (let key of sdks) {
|
|
||||||
let elements = key.split('\\');
|
|
||||||
let last = elements[elements.length - 1];
|
|
||||||
if (last.indexOf('.') >= 0) {
|
|
||||||
let numstrings = last.split('.');
|
|
||||||
let nums = [];
|
|
||||||
for (let str of numstrings) {
|
|
||||||
nums.push(parseInt(str));
|
|
||||||
}
|
|
||||||
if (nums[0] > best[0]) {
|
|
||||||
best = nums;
|
|
||||||
}
|
|
||||||
else if (nums[0] === best[0]) {
|
|
||||||
if (nums[1] > best[1]) {
|
|
||||||
best = nums;
|
|
||||||
}
|
|
||||||
else if (nums[1] === best[1]) {
|
|
||||||
if (nums[2] > best[2]) {
|
|
||||||
best = nums;
|
|
||||||
}
|
|
||||||
else if (nums[2] === best[2]) {
|
|
||||||
if (nums[3] > best[3]) {
|
|
||||||
best = nums;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (best[0] > 0) {
|
|
||||||
return best[0] + '.' + best[1] + '.' + best[2] + '.' + best[3];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
globals(indent) {
|
globals(indent) {
|
||||||
if (goptions.visualstudio === 'vs2022') {
|
if (goptions.visualstudio === 'vs2022') {
|
||||||
this.p('<VCProjectVersion>16.0</VCProjectVersion>', indent);
|
this.p('<VCProjectVersion>16.0</VCProjectVersion>', indent);
|
||||||
@@ -2672,8 +2612,8 @@ function write_ts_project(projectdir, options) {
|
|||||||
let files = fs_readdir(src);
|
let files = fs_readdir(src);
|
||||||
if (src.endsWith(".ts")) {
|
if (src.endsWith(".ts")) {
|
||||||
// Add file instead of dir
|
// Add file instead of dir
|
||||||
files = [src.substring(src.lastIndexOf("/") + 1, src.length)];
|
files = [src.substring(src.lastIndexOf(path_sep) + 1, src.length)];
|
||||||
src = src.substring(0, src.lastIndexOf("/"));
|
src = src.substring(0, src.lastIndexOf(path_sep));
|
||||||
}
|
}
|
||||||
for (let file of files) {
|
for (let file of files) {
|
||||||
if (file.endsWith(".ts")) {
|
if (file.endsWith(".ts")) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ flags.lite = true;
|
|||||||
let project = new Project("ArmorPad");
|
let project = new Project("ArmorPad");
|
||||||
project.add_tsfiles("sources");
|
project.add_tsfiles("sources");
|
||||||
|
|
||||||
project.add_shaders("../../shaders/draw/*.kong",);
|
project.add_shaders("../../shaders/draw/*.kong");
|
||||||
project.add_assets("../../assets/font_mono.ttf", { destination: "data/{name}" });
|
project.add_assets("../../assets/font_mono.ttf", { destination: "data/{name}" });
|
||||||
project.add_assets("../../assets/text_coloring.json", { destination: "data/{name}" });
|
project.add_assets("../../assets/text_coloring.json", { destination: "data/{name}" });
|
||||||
project.add_tsfiles("../../sources/ts/iron");
|
project.add_tsfiles("../../sources/ts/iron");
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ function encode_storage(): string {
|
|||||||
return config_json;
|
return config_json;
|
||||||
}
|
}
|
||||||
|
|
||||||
function shutdown() {
|
function on_shutdown() {
|
||||||
let storage_string: string = sys_string_to_buffer(encode_storage());
|
let storage_string: string = sys_string_to_buffer(encode_storage());
|
||||||
iron_file_save_bytes(iron_internal_save_path() + "/config.json", storage_string, 0);
|
iron_file_save_bytes(iron_internal_save_path() + "/config.json", storage_string, 0);
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@ function main() {
|
|||||||
|
|
||||||
sys_notify_on_frames(render);
|
sys_notify_on_frames(render);
|
||||||
_iron_set_drop_files_callback(drop_files);
|
_iron_set_drop_files_callback(drop_files);
|
||||||
iron_set_application_state_callback(null, null, null, null, shutdown);
|
iron_set_application_state_callback(null, null, null, null, on_shutdown);
|
||||||
}
|
}
|
||||||
|
|
||||||
function armpack_to_string(bytes: buffer_t): string {
|
function armpack_to_string(bytes: buffer_t): string {
|
||||||
|
|||||||
Reference in New Issue
Block a user