diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-08-21 19:56:08 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-21 19:56:08 -0300 |
commit | 2cc83092498d3b82fa8a3aba37c32ad887d19c2c (patch) | |
tree | 4d2def0a62847170a86c3f134f234af8ae45f0b9 /scene/resources/texture.cpp | |
parent | 92410df24cdf296ad63250274d69b2019996423e (diff) | |
parent | 32dd9a9f668db31e348c5ef5bc181cdb91c07299 (diff) |
Merge pull request #10351 from neikeq/enums-are-for-the-weak
ClassDB: Provide the enum name of integer constants
Diffstat (limited to 'scene/resources/texture.cpp')
-rw-r--r-- | scene/resources/texture.cpp | 65 |
1 files changed, 34 insertions, 31 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 9a251c029d..f542d2a8de 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -75,14 +75,14 @@ void Texture::_bind_methods() { ClassDB::bind_method(D_METHOD("draw_rect_region", "canvas_item", "rect", "src_rect", "modulate", "transpose", "normal_map", "clip_uv"), &Texture::draw_rect_region, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()), DEFVAL(true)); ClassDB::bind_method(D_METHOD("get_data"), &Texture::get_data); - BIND_CONSTANT(FLAG_MIPMAPS); - BIND_CONSTANT(FLAG_REPEAT); - BIND_CONSTANT(FLAG_FILTER); - BIND_CONSTANT(FLAG_VIDEO_SURFACE); - BIND_CONSTANT(FLAGS_DEFAULT); - BIND_CONSTANT(FLAG_ANISOTROPIC_FILTER); - BIND_CONSTANT(FLAG_CONVERT_TO_LINEAR); - BIND_CONSTANT(FLAG_MIRRORED_REPEAT); + BIND_ENUM_CONSTANT(FLAG_MIPMAPS); + BIND_ENUM_CONSTANT(FLAG_REPEAT); + BIND_ENUM_CONSTANT(FLAG_FILTER); + BIND_ENUM_CONSTANT(FLAG_VIDEO_SURFACE); + BIND_ENUM_CONSTANT(FLAGS_DEFAULT); + BIND_ENUM_CONSTANT(FLAG_ANISOTROPIC_FILTER); + BIND_ENUM_CONSTANT(FLAG_CONVERT_TO_LINEAR); + BIND_ENUM_CONSTANT(FLAG_MIRRORED_REPEAT); } Texture::Texture() { @@ -362,9 +362,9 @@ void ImageTexture::_bind_methods() { ClassDB::bind_method(D_METHOD("set_size_override", "size"), &ImageTexture::set_size_override); ClassDB::bind_method(D_METHOD("_reload_hook", "rid"), &ImageTexture::_reload_hook); - BIND_CONSTANT(STORAGE_RAW); - BIND_CONSTANT(STORAGE_COMPRESS_LOSSY); - BIND_CONSTANT(STORAGE_COMPRESS_LOSSLESS); + BIND_ENUM_CONSTANT(STORAGE_RAW); + BIND_ENUM_CONSTANT(STORAGE_COMPRESS_LOSSY); + BIND_ENUM_CONSTANT(STORAGE_COMPRESS_LOSSLESS); } ImageTexture::ImageTexture() { @@ -1335,19 +1335,21 @@ void CubeMap::_bind_methods() { ClassDB::bind_method(D_METHOD("set_lossy_storage_quality", "quality"), &CubeMap::set_lossy_storage_quality); ClassDB::bind_method(D_METHOD("get_lossy_storage_quality"), &CubeMap::get_lossy_storage_quality); - BIND_CONSTANT(STORAGE_RAW); - BIND_CONSTANT(STORAGE_COMPRESS_LOSSY); - BIND_CONSTANT(STORAGE_COMPRESS_LOSSLESS); - BIND_CONSTANT(SIDE_LEFT); - BIND_CONSTANT(SIDE_RIGHT); - BIND_CONSTANT(SIDE_BOTTOM); - BIND_CONSTANT(SIDE_TOP); - BIND_CONSTANT(SIDE_FRONT); - BIND_CONSTANT(SIDE_BACK); - BIND_CONSTANT(FLAG_MIPMAPS); - BIND_CONSTANT(FLAG_REPEAT); - BIND_CONSTANT(FLAG_FILTER); - BIND_CONSTANT(FLAGS_DEFAULT); + BIND_ENUM_CONSTANT(STORAGE_RAW); + BIND_ENUM_CONSTANT(STORAGE_COMPRESS_LOSSY); + BIND_ENUM_CONSTANT(STORAGE_COMPRESS_LOSSLESS); + + BIND_ENUM_CONSTANT(SIDE_LEFT); + BIND_ENUM_CONSTANT(SIDE_RIGHT); + BIND_ENUM_CONSTANT(SIDE_BOTTOM); + BIND_ENUM_CONSTANT(SIDE_TOP); + BIND_ENUM_CONSTANT(SIDE_FRONT); + BIND_ENUM_CONSTANT(SIDE_BACK); + + BIND_ENUM_CONSTANT(FLAG_MIPMAPS); + BIND_ENUM_CONSTANT(FLAG_REPEAT); + BIND_ENUM_CONSTANT(FLAG_FILTER); + BIND_ENUM_CONSTANT(FLAGS_DEFAULT); } CubeMap::CubeMap() { @@ -1366,13 +1368,14 @@ CubeMap::~CubeMap() { VisualServer::get_singleton()->free(cubemap); } -/* BIND_CONSTANT( FLAG_CUBEMAP ); - BIND_CONSTANT( CUBEMAP_LEFT ); - BIND_CONSTANT( CUBEMAP_RIGHT ); - BIND_CONSTANT( CUBEMAP_BOTTOM ); - BIND_CONSTANT( CUBEMAP_TOP ); - BIND_CONSTANT( CUBEMAP_FRONT ); - BIND_CONSTANT( CUBEMAP_BACK ); +/* BIND_ENUM(CubeMapSize); + BIND_ENUM_CONSTANT( FLAG_CUBEMAP ); + BIND_ENUM_CONSTANT( CUBEMAP_LEFT ); + BIND_ENUM_CONSTANT( CUBEMAP_RIGHT ); + BIND_ENUM_CONSTANT( CUBEMAP_BOTTOM ); + BIND_ENUM_CONSTANT( CUBEMAP_TOP ); + BIND_ENUM_CONSTANT( CUBEMAP_FRONT ); + BIND_ENUM_CONSTANT( CUBEMAP_BACK ); */ /////////////////////////// |