From 1901a2f3d8df5634e905434a84d2e987d9581873 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Wed, 31 Jul 2024 16:50:30 +0200 Subject: [PATCH] Windows build fixes --- sources/krom.h | 3 ++- tools/make.js | 27 +++++++++++++++------------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/sources/krom.h b/sources/krom.h index 0192a115..ef9b36bb 100644 --- a/sources/krom.h +++ b/sources/krom.h @@ -823,6 +823,7 @@ void krom_init(string_t *title, i32 width, i32 height, bool vsync, i32 window_mo frame.color_bits = 32; frame.depth_bits = 0; frame.stencil_bits = 0; + frame.samples_per_pixel = 1; kinc_init(title, win.width, win.height, &win, &frame); kinc_random_init((int)(kinc_time() * 1000)); @@ -1132,7 +1133,7 @@ kinc_g4_shader_t *krom_g4_create_vertex_shader_from_source(string_t *source) { bool hasPos = strstr(temp_string_vs, "pos :") != NULL; bool hasTex = strstr(temp_string_vs, "tex :") != NULL; - i32_map_t *attributes = calloc(sizeof(i32_map_t), 1); + i32_map_t *attributes = i32_map_create(); int index = 0; if (hasBone) i32_map_set(attributes, "bone", index++); if (hasCol) i32_map_set(attributes, "col", index++); diff --git a/tools/make.js b/tools/make.js index 2bee7c0b..1e1cde2f 100644 --- a/tools/make.js +++ b/tools/make.js @@ -345,11 +345,12 @@ class Exporter { } nice_path(from, to, filepath) { - let absolute = path_normalize(filepath); - if (!path_isabs(absolute)) { - absolute = path_resolve(from, filepath); - } - return path_relative(to, absolute); + return filepath; + // let absolute = path_normalize(filepath); + // if (!path_isabs(absolute)) { + // absolute = path_resolve(from, filepath); + // } + // return path_relative(to, absolute); } } @@ -794,11 +795,12 @@ class VisualStudioExporter extends Exporter { let incstring = ""; let includedirs = project.getIncludeDirs(); for (let include of includedirs) { - let relativized = path_relative(to, path_resolve(from, include)); - if (relativized === "") { - relativized = "."; - } - incstring += relativized + ";"; + // let relativized = path_relative(to, path_resolve(from, include)); + // if (relativized === "") { + // relativized = "."; + // } + // incstring += relativized + ";"; + incstring += include + ";"; } if (incstring.length > 0) incstring = incstring.substr(0, incstring.length - 1); @@ -3350,8 +3352,9 @@ function main() { make = os_exec('xcodebuild', xcode_options, { cwd: "build" }); } else if (goptions.target == 'windows') { - let vswhere = path_join(os_env('ProgramFiles(x86)'), 'Microsoft Visual Studio', 'Installer', 'vswhere.exe'); - let vsvars = os_exec(vswhere, ['-products', '*', '-latest', '-find', 'VC\\Auxiliary\\Build\\vcvars64.bat']).stdout.trim(); + // let vswhere = path_join(os_env('ProgramFiles(x86)'), 'Microsoft Visual Studio', 'Installer', 'vswhere.exe'); + // let vsvars = os_exec(vswhere, ['-products', '*', '-latest', '-find', 'VC\\Auxiliary\\Build\\vcvars64.bat']).trim(); + let vsvars = "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat"; fs_writefile(path_join("build", 'build.bat'), '@call "' + vsvars + '"\n' + '@MSBuild.exe "' + path_resolve("build", project_name + '.vcxproj') + '" /m /clp:ErrorsOnly /p:Configuration=' + (goptions.debug ? 'Debug' : 'Release') + ',Platform=x64'); make = os_exec('build.bat', [], { cwd: "build" }); }