Skip to content

Commit

Permalink
Revert "Backport implement loading DDS textures at run-time"
Browse files Browse the repository at this point in the history
This reverts commit 22468ea.
See #81126 for rationale.
  • Loading branch information
akien-mga committed Sep 1, 2023
1 parent 98fe7f4 commit 54738d3
Show file tree
Hide file tree
Showing 7 changed files with 360 additions and 494 deletions.
10 changes: 0 additions & 10 deletions core/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2537,7 +2537,6 @@ ImageMemLoadFunc Image::_jpg_mem_loader_func = nullptr;
ImageMemLoadFunc Image::_webp_mem_loader_func = nullptr;
ImageMemLoadFunc Image::_tga_mem_loader_func = nullptr;
ImageMemLoadFunc Image::_bmp_mem_loader_func = nullptr;
ImageMemLoadFunc Image::_dds_mem_loader_func = nullptr;

void (*Image::_image_compress_bc_func)(Image *, float, Image::CompressSource) = nullptr;
void (*Image::_image_compress_bptc_func)(Image *, float, Image::CompressSource) = nullptr;
Expand Down Expand Up @@ -2978,7 +2977,6 @@ void Image::_bind_methods() {
ClassDB::bind_method(D_METHOD("load_webp_from_buffer", "buffer"), &Image::load_webp_from_buffer);
ClassDB::bind_method(D_METHOD("load_tga_from_buffer", "buffer"), &Image::load_tga_from_buffer);
ClassDB::bind_method(D_METHOD("load_bmp_from_buffer", "buffer"), &Image::load_bmp_from_buffer);
ClassDB::bind_method(D_METHOD("load_dds_from_buffer", "buffer"), &Image::load_dds_from_buffer);

ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_STORAGE), "_set_data", "_get_data");

Expand Down Expand Up @@ -3311,14 +3309,6 @@ Error Image::load_bmp_from_buffer(const PoolVector<uint8_t> &p_array) {
return _load_from_buffer(p_array, _bmp_mem_loader_func);
}

Error Image::load_dds_from_buffer(const PoolVector<uint8_t> &p_array) {
ERR_FAIL_NULL_V_MSG(
_dds_mem_loader_func,
ERR_UNAVAILABLE,
"The DDS module isn't enabled. Recompile the Godot editor or export template binary with the `module_dds_enabled=yes` SCons option.");
return _load_from_buffer(p_array, _dds_mem_loader_func);
}

Error Image::_load_from_buffer(const PoolVector<uint8_t> &p_array, ImageMemLoadFunc p_loader) {
int buffer_size = p_array.size();

Expand Down
2 changes: 0 additions & 2 deletions core/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ class Image : public Resource {
static ImageMemLoadFunc _webp_mem_loader_func;
static ImageMemLoadFunc _tga_mem_loader_func;
static ImageMemLoadFunc _bmp_mem_loader_func;
static ImageMemLoadFunc _dds_mem_loader_func;

static void (*_image_compress_bc_func)(Image *, float, CompressSource p_source);
static void (*_image_compress_bptc_func)(Image *, float p_lossy_quality, CompressSource p_source);
Expand Down Expand Up @@ -344,7 +343,6 @@ class Image : public Resource {
Error load_webp_from_buffer(const PoolVector<uint8_t> &p_array);
Error load_tga_from_buffer(const PoolVector<uint8_t> &p_array);
Error load_bmp_from_buffer(const PoolVector<uint8_t> &p_array);
Error load_dds_from_buffer(const PoolVector<uint8_t> &p_array);

Image(const uint8_t *p_mem_png_jpg, int p_len = -1);
Image(const char **p_xpm);
Expand Down
7 changes: 0 additions & 7 deletions doc/classes/Image.xml
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,6 @@
[b]Note:[/b] Godot's BMP module doesn't support 16-bit per pixel images. Only 1-bit, 4-bit, 8-bit, 24-bit, and 32-bit per pixel images are supported.
</description>
</method>
<method name="load_dds_from_buffer">
<return type="int" enum="Error" />
<argument index="0" name="buffer" type="PoolByteArray" />
<description>
Loads an image from the binary contents of a DDS file.
</description>
</method>
<method name="load_jpg_from_buffer">
<return type="int" enum="Error" />
<argument index="0" name="buffer" type="PoolByteArray" />
Expand Down
Loading

0 comments on commit 54738d3

Please sign in to comment.