diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/bmp/image_loader_bmp.cpp | 176 | ||||
-rw-r--r-- | modules/bmp/image_loader_bmp.h | 4 | ||||
-rw-r--r-- | modules/bullet/SCsub | 2 | ||||
-rw-r--r-- | modules/etc/SCsub | 2 | ||||
-rw-r--r-- | modules/freetype/SCsub | 6 | ||||
-rw-r--r-- | modules/mono/mono_gd/gd_mono_log.cpp | 2 | ||||
-rw-r--r-- | modules/opus/SCsub | 12 | ||||
-rw-r--r-- | modules/svg/SCsub | 2 | ||||
-rw-r--r-- | modules/tga/image_loader_tga.cpp | 6 | ||||
-rw-r--r-- | modules/theora/SCsub | 2 | ||||
-rw-r--r-- | modules/vhacd/SCsub | 2 | ||||
-rw-r--r-- | modules/webm/SCsub | 2 | ||||
-rw-r--r-- | modules/webm/libvpx/SCsub | 4 | ||||
-rw-r--r-- | modules/websocket/SCsub | 2 | ||||
-rw-r--r-- | modules/xatlas_unwrap/SCsub | 19 |
15 files changed, 163 insertions, 80 deletions
diff --git a/modules/bmp/image_loader_bmp.cpp b/modules/bmp/image_loader_bmp.cpp index 509b30c7e6..bcc992db24 100644 --- a/modules/bmp/image_loader_bmp.cpp +++ b/modules/bmp/image_loader_bmp.cpp @@ -33,6 +33,7 @@ Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image, const uint8_t *p_buffer, const uint8_t *p_color_buffer, + const uint32_t color_table_size, const bmp_header_s &p_header) { Error err = OK; @@ -49,42 +50,82 @@ Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image, if (p_header.bmp_info_header.bmp_compression != BI_RGB) { err = FAILED; } + // Check whether we can load it - if (!(bits_per_pixel == 8 || bits_per_pixel == 24 || bits_per_pixel == 32)) { - err = FAILED; - } + if (bits_per_pixel == 1) { + // Requires bit unpacking... + ERR_FAIL_COND_V(width % 8 != 0, ERR_UNAVAILABLE); + ERR_FAIL_COND_V(height % 8 != 0, ERR_UNAVAILABLE); + + } else if (bits_per_pixel == 4) { + // Requires bit unpacking... + ERR_FAIL_COND_V(width % 2 != 0, ERR_UNAVAILABLE); + ERR_FAIL_COND_V(height % 2 != 0, ERR_UNAVAILABLE); + } else if (bits_per_pixel == 16) { + + ERR_FAIL_V(ERR_UNAVAILABLE); + } if (err == OK) { - uint32_t line_width = ((p_header.bmp_info_header.bmp_width * - p_header.bmp_info_header.bmp_bit_count / 8) + - 3) & - ~3; + // Image data (might be indexed) + PoolVector<uint8_t> data; + int data_len = 0; + + if (bits_per_pixel <= 8) { // indexed + data_len = width * height; + } else { // color + data_len = width * height * 4; + } + ERR_FAIL_COND_V(data_len == 0, ERR_BUG); + err = data.resize(data_len); - PoolVector<uint8_t> image_data; - err = image_data.resize(width * height * 4); + PoolVector<uint8_t>::Write data_w = data.write(); + uint8_t *write_buffer = data_w.ptr(); - PoolVector<uint8_t>::Write image_data_w = image_data.write(); - uint8_t *write_buffer = image_data_w.ptr(); + const uint32_t width_bytes = width * bits_per_pixel / 8; + const uint32_t line_width = (width_bytes + 3) & ~3; - const uint32_t color_index_max = p_header.bmp_info_header.bmp_colors_used - 1; + // The actual data traversal is determined by + // the data width in case of 8/4/1 bit images + const uint32_t w = bits_per_pixel >= 24 ? width : width_bytes; const uint8_t *line = p_buffer + (line_width * (height - 1)); + for (unsigned int i = 0; i < height; i++) { const uint8_t *line_ptr = line; - for (unsigned int j = 0; j < width; j++) { + + for (unsigned int j = 0; j < w; j++) { switch (bits_per_pixel) { + case 1: { + uint8_t color_index = *line_ptr; + + write_buffer[index + 0] = (color_index >> 7) & 1; + write_buffer[index + 1] = (color_index >> 6) & 1; + write_buffer[index + 2] = (color_index >> 5) & 1; + write_buffer[index + 3] = (color_index >> 4) & 1; + write_buffer[index + 4] = (color_index >> 3) & 1; + write_buffer[index + 5] = (color_index >> 2) & 1; + write_buffer[index + 6] = (color_index >> 1) & 1; + write_buffer[index + 7] = (color_index >> 0) & 1; + + index += 8; + line_ptr += 1; + } break; + case 4: { + uint8_t color_index = *line_ptr; + + write_buffer[index + 0] = (color_index >> 4) & 0x0f; + write_buffer[index + 1] = color_index & 0x0f; + + index += 2; + line_ptr += 1; + } break; case 8: { - uint8_t color_index = CLAMP(*line_ptr, 0, color_index_max); - uint32_t color = 0x000000; + uint8_t color_index = *line_ptr; - if (p_color_buffer != NULL) - color = ((uint32_t *)p_color_buffer)[color_index]; + write_buffer[index] = color_index; - write_buffer[index + 2] = color & 0xff; - write_buffer[index + 1] = (color >> 8) & 0xff; - write_buffer[index + 0] = (color >> 16) & 0xff; - write_buffer[index + 3] = 0xff; - index += 4; + index += 1; line_ptr += 1; } break; case 24: { @@ -94,6 +135,7 @@ Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image, write_buffer[index + 1] = (color >> 8) & 0xff; write_buffer[index + 0] = (color >> 16) & 0xff; write_buffer[index + 3] = 0xff; + index += 4; line_ptr += 3; } break; @@ -104,6 +146,7 @@ Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image, write_buffer[index + 1] = (color >> 8) & 0xff; write_buffer[index + 0] = (color >> 16) & 0xff; write_buffer[index + 3] = color >> 24; + index += 4; line_ptr += 4; } break; @@ -111,7 +154,51 @@ Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image, } line -= line_width; } - p_image->create(width, height, 0, Image::FORMAT_RGBA8, image_data); + + if (p_color_buffer == NULL || color_table_size == 0) { // regular pixels + + p_image->create(width, height, 0, Image::FORMAT_RGBA8, data); + + } else { // data is in indexed format, extend it + + // Palette data + PoolVector<uint8_t> palette_data; + palette_data.resize(color_table_size * 4); + + PoolVector<uint8_t>::Write palette_data_w = palette_data.write(); + uint8_t *pal = palette_data_w.ptr(); + + const uint8_t *cb = p_color_buffer; + + for (unsigned int i = 0; i < color_table_size; ++i) { + uint32_t color = *((uint32_t *)cb); + + pal[i * 4 + 0] = (color >> 16) & 0xff; + pal[i * 4 + 1] = (color >> 8) & 0xff; + pal[i * 4 + 2] = (color)&0xff; + pal[i * 4 + 3] = 0xff; + + cb += 4; + } + // Extend palette to image + PoolVector<uint8_t> extended_data; + extended_data.resize(data.size() * 4); + + PoolVector<uint8_t>::Write ex_w = extended_data.write(); + uint8_t *dest = ex_w.ptr(); + + const int num_pixels = width * height; + + for (int i = 0; i < num_pixels; i++) { + dest[0] = pal[write_buffer[i] * 4 + 0]; + dest[1] = pal[write_buffer[i] * 4 + 1]; + dest[2] = pal[write_buffer[i] * 4 + 2]; + dest[3] = pal[write_buffer[i] * 4 + 3]; + + dest += 4; + } + p_image->create(width, height, 0, Image::FORMAT_RGBA8, extended_data); + } } } return err; @@ -123,12 +210,9 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f, bmp_header_s bmp_header; Error err = ERR_INVALID_DATA; - static const size_t FILE_HEADER_SIZE = 14; - static const size_t INFO_HEADER_SIZE = 40; - // A valid bmp file should always at least have a // file header and a minimal info header - if (f->get_len() > FILE_HEADER_SIZE + INFO_HEADER_SIZE) { + if (f->get_len() > BITMAP_FILE_HEADER_SIZE + BITMAP_INFO_HEADER_MIN_SIZE) { // File Header bmp_header.bmp_file_header.bmp_signature = f->get_16(); if (bmp_header.bmp_file_header.bmp_signature == BITMAP_SIGNATURE) { @@ -138,9 +222,14 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f, // Info Header bmp_header.bmp_info_header.bmp_header_size = f->get_32(); + ERR_FAIL_COND_V(bmp_header.bmp_info_header.bmp_header_size < BITMAP_INFO_HEADER_MIN_SIZE, ERR_FILE_CORRUPT); + bmp_header.bmp_info_header.bmp_width = f->get_32(); bmp_header.bmp_info_header.bmp_height = f->get_32(); + bmp_header.bmp_info_header.bmp_planes = f->get_16(); + ERR_FAIL_COND_V(bmp_header.bmp_info_header.bmp_planes != 1, ERR_FILE_CORRUPT); + bmp_header.bmp_info_header.bmp_bit_count = f->get_16(); bmp_header.bmp_info_header.bmp_compression = f->get_32(); bmp_header.bmp_info_header.bmp_size_image = f->get_32(); @@ -153,23 +242,30 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f, if (bmp_header.bmp_info_header.bmp_compression != BI_RGB) { ERR_EXPLAIN("Unsupported bmp file: " + f->get_path()); f->close(); - ERR_FAIL_V(err) + ERR_FAIL_V(ERR_UNAVAILABLE); } - - f->seek(FILE_HEADER_SIZE + - bmp_header.bmp_info_header.bmp_header_size); - - if (bmp_header.bmp_info_header.bmp_bit_count < 16 && bmp_header.bmp_info_header.bmp_colors_used == 0) - bmp_header.bmp_info_header.bmp_colors_used = 1 << bmp_header.bmp_info_header.bmp_bit_count; - - // Color table is usually 4 bytes per color -> [B][G][R][0] - uint32_t color_table_size = bmp_header.bmp_info_header.bmp_colors_used * 4; + // Don't rely on sizeof(bmp_file_header) as structure padding + // adds 2 bytes offset leading to misaligned color table reading + uint32_t ct_offset = BITMAP_FILE_HEADER_SIZE + + bmp_header.bmp_info_header.bmp_header_size; + f->seek(ct_offset); + + uint32_t color_table_size = 0; + + // bmp_colors_used may report 0 despite having a color table + // for 4 and 1 bit images, so don't rely on this information + if (bmp_header.bmp_info_header.bmp_bit_count <= 8) { + // Support 256 colors max + color_table_size = 1 << bmp_header.bmp_info_header.bmp_bit_count; + } + ERR_FAIL_COND_V(color_table_size == 0, ERR_BUG); PoolVector<uint8_t> bmp_color_table; if (color_table_size > 0) { - err = bmp_color_table.resize(color_table_size); + // Color table is usually 4 bytes per color -> [B][G][R][0] + err = bmp_color_table.resize(color_table_size * 4); PoolVector<uint8_t>::Write bmp_color_table_w = bmp_color_table.write(); - f->get_buffer(bmp_color_table_w.ptr(), color_table_size); + f->get_buffer(bmp_color_table_w.ptr(), color_table_size * 4); } f->seek(bmp_header.bmp_file_header.bmp_file_offset); @@ -186,7 +282,7 @@ Error ImageLoaderBMP::load_image(Ref<Image> p_image, FileAccess *f, PoolVector<uint8_t>::Read bmp_buffer_r = bmp_buffer.read(); PoolVector<uint8_t>::Read bmp_color_table_r = bmp_color_table.read(); err = convert_to_image(p_image, bmp_buffer_r.ptr(), - bmp_color_table_r.ptr(), bmp_header); + bmp_color_table_r.ptr(), color_table_size, bmp_header); } f->close(); } diff --git a/modules/bmp/image_loader_bmp.h b/modules/bmp/image_loader_bmp.h index b27a47d402..0082cf778a 100644 --- a/modules/bmp/image_loader_bmp.h +++ b/modules/bmp/image_loader_bmp.h @@ -37,6 +37,9 @@ class ImageLoaderBMP : public ImageFormatLoader { protected: static const unsigned BITMAP_SIGNATURE = 0x4d42; + static const unsigned BITMAP_FILE_HEADER_SIZE = 14; // bmp_file_header_s + static const unsigned BITMAP_INFO_HEADER_MIN_SIZE = 40; // bmp_info_header_s + enum bmp_compression_s { BI_RGB = 0x00, BI_RLE8 = 0x01, @@ -76,6 +79,7 @@ protected: static Error convert_to_image(Ref<Image> p_image, const uint8_t *p_buffer, const uint8_t *p_color_buffer, + const uint32_t color_table_size, const bmp_header_s &p_header); public: diff --git a/modules/bullet/SCsub b/modules/bullet/SCsub index 7e714ba43f..e7c2fff54c 100644 --- a/modules/bullet/SCsub +++ b/modules/bullet/SCsub @@ -188,7 +188,7 @@ if env['builtin_bullet']: env_bullet.Append(CPPPATH=[thirdparty_dir]) # if env['target'] == "debug" or env['target'] == "release_debug": - # env_bullet.Append(CCFLAGS=['-DBT_DEBUG']) + # env_bullet.Append(CPPFLAGS=['-DBT_DEBUG']) env_thirdparty = env_bullet.Clone() env_thirdparty.disable_warnings() diff --git a/modules/etc/SCsub b/modules/etc/SCsub index 6e963ef766..eb2738053b 100644 --- a/modules/etc/SCsub +++ b/modules/etc/SCsub @@ -31,7 +31,7 @@ env_etc.Append(CPPPATH=[thirdparty_dir]) # upstream uses c++11 if not env.msvc: - env_etc.Append(CCFLAGS="-std=c++11") + env_etc.Append(CXXFLAGS="-std=c++11") env_thirdparty = env_etc.Clone() env_thirdparty.disable_warnings() diff --git a/modules/freetype/SCsub b/modules/freetype/SCsub index c2d165f367..f2cd9f9a60 100644 --- a/modules/freetype/SCsub +++ b/modules/freetype/SCsub @@ -72,9 +72,9 @@ if env['builtin_freetype']: # Also needed in main env for scene/ env.Append(CPPPATH=[thirdparty_dir + "/include"]) - env_freetype.Append(CCFLAGS=['-DFT2_BUILD_LIBRARY', '-DFT_CONFIG_OPTION_USE_PNG']) + env_freetype.Append(CPPFLAGS=['-DFT2_BUILD_LIBRARY', '-DFT_CONFIG_OPTION_USE_PNG']) if (env['target'] != 'release'): - env_freetype.Append(CCFLAGS=['-DZLIB_DEBUG']) + env_freetype.Append(CPPFLAGS=['-DZLIB_DEBUG']) # Also requires libpng headers if env['builtin_libpng']: @@ -100,4 +100,4 @@ if env['builtin_freetype']: # Godot source files env_freetype.add_source_files(env.modules_sources, "*.cpp") # Used in scene/, needs to be in main env -env.Append(CCFLAGS=['-DFREETYPE_ENABLED']) +env.Append(CPPFLAGS=['-DFREETYPE_ENABLED']) diff --git a/modules/mono/mono_gd/gd_mono_log.cpp b/modules/mono/mono_gd/gd_mono_log.cpp index 3191cdbd53..087a7a2e5c 100644 --- a/modules/mono/mono_gd/gd_mono_log.cpp +++ b/modules/mono/mono_gd/gd_mono_log.cpp @@ -172,7 +172,7 @@ void GDMonoLog::initialize() { OS::Time time_now = OS::get_singleton()->get_time(); int pid = OS::get_singleton()->get_process_id(); - String log_file_name = format("%d-%02d-%02d %02d:%02d:%02d (%d).txt", + String log_file_name = format("%d_%02d_%02d %02d.%02d.%02d (%d).txt", date_now.year, date_now.month, date_now.day, time_now.hour, time_now.min, time_now.sec, pid); diff --git a/modules/opus/SCsub b/modules/opus/SCsub index b72144c679..a1325734e2 100644 --- a/modules/opus/SCsub +++ b/modules/opus/SCsub @@ -139,7 +139,7 @@ if env['builtin_opus']: opus_sources_silk = [] if env["platform"] in ["android", "iphone", "javascript"]: - env_opus.Append(CFLAGS=["-DFIXED_POINT"]) + env_opus.Append(CPPFLAGS=["-DFIXED_POINT"]) opus_sources_silk = [ "silk/fixed/LTP_analysis_filter_FIX.c", "silk/fixed/LTP_scale_ctrl_FIX.c", @@ -208,7 +208,7 @@ if env['builtin_opus']: if env['builtin_libogg']: env_opus.Append(CPPPATH=["#thirdparty/libogg"]) - env_opus.Append(CFLAGS=["-DHAVE_CONFIG_H"]) + env_opus.Append(CPPFLAGS=["-DHAVE_CONFIG_H"]) thirdparty_include_paths = [ "", @@ -222,14 +222,14 @@ if env['builtin_opus']: if env["platform"] == "android": if ("android_arch" in env and env["android_arch"] in ["armv6", "armv7"]): - env_opus.Append(CFLAGS=["-DOPUS_ARM_OPT"]) + env_opus.Append(CPPFLAGS=["-DOPUS_ARM_OPT"]) elif ("android_arch" in env and env["android_arch"] == "arm64v8"): - env_opus.Append(CFLAGS=["-DOPUS_ARM64_OPT"]) + env_opus.Append(CPPFLAGS=["-DOPUS_ARM64_OPT"]) elif env["platform"] == "iphone": if ("arch" in env and env["arch"] == "arm"): - env_opus.Append(CFLAGS=["-DOPUS_ARM_OPT"]) + env_opus.Append(CPPFLAGS=["-DOPUS_ARM_OPT"]) elif ("arch" in env and env["arch"] == "arm64"): - env_opus.Append(CFLAGS=["-DOPUS_ARM64_OPT"]) + env_opus.Append(CPPFLAGS=["-DOPUS_ARM64_OPT"]) env_thirdparty = env_opus.Clone() env_thirdparty.disable_warnings() diff --git a/modules/svg/SCsub b/modules/svg/SCsub index 22f0b1e3eb..66d9b3bf75 100644 --- a/modules/svg/SCsub +++ b/modules/svg/SCsub @@ -16,7 +16,7 @@ env_svg.Append(CPPPATH=[thirdparty_dir]) # FIXME: Needed in editor/editor_themes.cpp for now, but ideally there # shouldn't be a dependency on modules/ and its own 3rd party deps. env.Append(CPPPATH=[thirdparty_dir]) -env.Append(CCFLAGS=["-DSVG_ENABLED"]) +env.Append(CPPFLAGS=["-DSVG_ENABLED"]) env_thirdparty = env_svg.Clone() env_thirdparty.disable_warnings() diff --git a/modules/tga/image_loader_tga.cpp b/modules/tga/image_loader_tga.cpp index 419229677b..a3c0f5ded7 100644 --- a/modules/tga/image_loader_tga.cpp +++ b/modules/tga/image_loader_tga.cpp @@ -148,9 +148,11 @@ Error ImageLoaderTGA::convert_to_image(Ref<Image> p_image, const uint8_t *p_buff uint8_t a = 0xff; if (p_header.color_map_depth == 24) { - r = (p_palette[(index * 3) + 0]); + // Due to low-high byte order, the color table must be + // read in the same order as image data (little endian) + r = (p_palette[(index * 3) + 2]); g = (p_palette[(index * 3) + 1]); - b = (p_palette[(index * 3) + 2]); + b = (p_palette[(index * 3) + 0]); } else { return ERR_INVALID_DATA; } diff --git a/modules/theora/SCsub b/modules/theora/SCsub index 98c4274a7e..f98db2359c 100644 --- a/modules/theora/SCsub +++ b/modules/theora/SCsub @@ -66,7 +66,7 @@ if env['builtin_libtheora']: thirdparty_sources += thirdparty_sources_x86_vc if (env["x86_libtheora_opt_gcc"] or env["x86_libtheora_opt_vc"]): - env_theora.Append(CCFLAGS=["-DOC_X86_ASM"]) + env_theora.Append(CPPFLAGS=["-DOC_X86_ASM"]) thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] diff --git a/modules/vhacd/SCsub b/modules/vhacd/SCsub index 11cd5f4743..fdd3ddc1e6 100644 --- a/modules/vhacd/SCsub +++ b/modules/vhacd/SCsub @@ -29,7 +29,7 @@ env_vhacd.Append(CPPFLAGS=["-DGODOT_ENET"]) # upstream uses c++11 if not env.msvc: - env_vhacd.Append(CCFLAGS="-std=c++11") + env_vhacd.Append(CXXFLAGS="-std=c++11") env_thirdparty = env_vhacd.Clone() env_thirdparty.disable_warnings() diff --git a/modules/webm/SCsub b/modules/webm/SCsub index cb35b926ab..dcc9a45044 100644 --- a/modules/webm/SCsub +++ b/modules/webm/SCsub @@ -19,7 +19,7 @@ env_webm.Append(CPPPATH=[thirdparty_dir, thirdparty_dir + "libwebm/"]) # upstream uses c++11 if (not env_webm.msvc): - env_webm.Append(CCFLAGS="-std=c++11") + env_webm.Append(CXXFLAGS="-std=c++11") # also requires libogg, libvorbis and libopus if env['builtin_libogg']: diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub index 2639d20620..5bf4ea3464 100644 --- a/modules/webm/libvpx/SCsub +++ b/modules/webm/libvpx/SCsub @@ -323,7 +323,7 @@ if webm_cpu_x86: elif cpu_bits == '64': env_libvpx["ASCPU"] = 'X86_64' - env_libvpx.Append(CCFLAGS=['-DWEBM_X86ASM']) + env_libvpx.Append(CPPFLAGS=['-DWEBM_X86ASM']) webm_simd_optimizations = True @@ -337,7 +337,7 @@ if webm_cpu_arm: env_libvpx["ASFLAGS"] = '' env_libvpx["ASCOM"] = '$AS $ASFLAGS -o $TARGET $SOURCES' - env_libvpx.Append(CCFLAGS=['-DWEBM_ARMASM']) + env_libvpx.Append(CPPFLAGS=['-DWEBM_ARMASM']) webm_simd_optimizations = True diff --git a/modules/websocket/SCsub b/modules/websocket/SCsub index 0345e533bc..12b4969cf7 100644 --- a/modules/websocket/SCsub +++ b/modules/websocket/SCsub @@ -88,7 +88,7 @@ if env['builtin_libwebsockets'] and not env["platform"] == "javascript": # alrea env_lws.Append(CPPPATH=[helper_dir]) if env["platform"] == "uwp": - env_lws.Append(CCFLAGS=["/DLWS_MINGW_SUPPORT"]) + env_lws.Append(CPPFLAGS=["/DLWS_MINGW_SUPPORT"]) env_thirdparty = env_lws.Clone() env_thirdparty.disable_warnings() diff --git a/modules/xatlas_unwrap/SCsub b/modules/xatlas_unwrap/SCsub index ad364d5aaf..7a40945f27 100644 --- a/modules/xatlas_unwrap/SCsub +++ b/modules/xatlas_unwrap/SCsub @@ -1,7 +1,5 @@ #!/usr/bin/env python -import platform - Import('env') Import('env_modules') @@ -21,23 +19,6 @@ if env['builtin_xatlas']: if (not env.msvc): env_xatlas_unwrap.Append(CXXFLAGS="-std=c++11") - if env["platform"] == 'x11': - # if not specifically one of the *BSD, then use LINUX as default - if platform.system() == "FreeBSD": - env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_FREEBSD", "-DPOSH_COMPILER_GCC"]) - elif platform.system() == "OpenBSD": - env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_OPENBSD", "-DPOSH_COMPILER_GCC"]) - else: - env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_LINUX", "-DPOSH_COMPILER_GCC"]) - elif env["platform"] == 'osx': - env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_DARWIN", "-DPOSH_COMPILER_GCC"]) - elif env["platform"] == 'windows': - if env.msvc: - env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_WIN32", "-DNV_CC_MSVC", "-DPOSH_COMPILER_MSVC" ]) - else: - env_xatlas_unwrap.Append(CCFLAGS=["-DNV_OS_MINGW", "-DNV_CC_GNUC", "-DPOSH_COMPILER_GCC", "-U__STRICT_ANSI__"]) - env.Append(LIBS=["dbghelp"]) - env_thirdparty = env_xatlas_unwrap.Clone() env_thirdparty.disable_warnings() env_thirdparty.add_source_files(env.modules_sources, thirdparty_sources) |