Skip to content

Commit

Permalink
resync with master @ 599320b
Browse files Browse the repository at this point in the history
PROPERTY_HINT enum chaned, remove usage
  • Loading branch information
nikitalita committed Nov 16, 2022
1 parent b72985c commit 1b1153a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/all_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:
env:
GODOT_BASE_BRANCH: master
# Change the README too
GODOT_MAIN_SYNC_REF: dc4b6165962536b53c4c1471fcf0be43c70e2335
GODOT_MAIN_SYNC_REF: 5993209b2649c93b56789bfc243c5a6046ee77ce
SCONSFLAGS: verbose=yes warnings=all werror=no module_text_server_fb_enabled=yes minizip=yes debug_symbols=no
SCONSFLAGS_TEMPLATE: no_editor_splash=yes module_bmp_enabled=no module_camera_enabled=no module_cvtt_enabled=no module_mbedtls_enabled=no module_tga_enabled=no module_enet_enabled=no module_mobile_vr_enabled=no module_upnp_enabled=no module_noise_enabled=no module_websocket_enabled=no module_xatlas_unwrap_enabled=no module_squish_enabled=no use_static_cpp=yes builtin_freetype=yes builtin_libpng=yes builtin_zlib=yes builtin_libwebp=yes builtin_libogg=yes module_csg_enabled=yes module_gridmap_enabled=yes disable_3d=no
SCONS_CACHE_MSVC_CONFIG: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Rebuild Godot engine as described in https://docs.godotengine.org/en/latest/deve

### Requirements

Godot 4.0 (master branch) @ commit https://github.com/godotengine/godot/commit/dc4b6165962536b53c4c1471fcf0be43c70e2335
Godot 4.0 (master branch) @ commit https://github.com/godotengine/godot/commit/5993209b2649c93b56789bfc243c5a6046ee77ce
- Support for building on 3.x has been dropped and no new features are being pushed
- Godot RE Tools still retains the ability to decompile 3.x and 2.x projects, however.

Expand Down
6 changes: 3 additions & 3 deletions compat/image_parser_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ String ImageParserV2::image_v2_to_string(const Variant &r_v, bool is_pcfg) {
return imgstr;
}

Error ImageParserV2::write_image_v2_to_bin(Ref<FileAccess> f, const Variant &r_v, const PropertyHint p_hint) {
Error ImageParserV2::write_image_v2_to_bin(Ref<FileAccess> f, const Variant &r_v, bool compress_lossless) {
Ref<Image> val = r_v;
if (val.is_null() || val->is_empty()) {
f->store_32(V2Image::IMAGE_ENCODING_EMPTY);
Expand All @@ -103,13 +103,13 @@ Error ImageParserV2::write_image_v2_to_bin(Ref<FileAccess> f, const Variant &r_v

if (val->get_format() <= Image::FORMAT_RGB565) {
// can only compress uncompressed stuff
if (p_hint == PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS && Image::png_packer) {
if (compress_lossless && Image::png_packer) {
encoding = V2Image::IMAGE_ENCODING_LOSSLESS;
}
// We do not want to resave the image as lossy because of:
// 1) We lose fidelity from the original asset if we do
// 2) V4 encoding is incompatible with V2 and V3
else if (p_hint == PROPERTY_HINT_IMAGE_COMPRESS_LOSSY && Image::png_packer) {
else if (compress_lossless && Image::png_packer) {
encoding = V2Image::IMAGE_ENCODING_LOSSLESS;
}
}
Expand Down
2 changes: 1 addition & 1 deletion compat/image_parser_v2.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ImageParserV2 {
static Error parse_image_construct_v2(VariantParser::Stream *f, Variant &r_v, bool convert_indexed, int &line, String &p_err_str);

static Error decode_image_v2(Ref<FileAccess> f, Variant &r_v, bool convert_indexed = false);
static Error write_image_v2_to_bin(Ref<FileAccess> f, const Variant &r_v, const PropertyHint p_hint);
static Error write_image_v2_to_bin(Ref<FileAccess> f, const Variant &r_v, bool compress_lossless = true);
};

#endif // IMAGE_PARSER_V2_H
2 changes: 1 addition & 1 deletion compat/resource_loader_compat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2046,7 +2046,7 @@ Error ResourceLoaderCompat::write_variant_bin(Ref<FileAccess> fa, const Variant
if (ver_format_bin == 1 && res->is_class("Image")) {
fa->store_32(VariantBin::VARIANT_IMAGE);
// storing lossless compressed by default
ImageParserV2::write_image_v2_to_bin(fa, p_property, PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS);
ImageParserV2::write_image_v2_to_bin(fa, p_property, true);
} else {
fa->store_32(VariantBin::VARIANT_OBJECT);
if (res.is_null()) {
Expand Down

0 comments on commit 1b1153a

Please sign in to comment.