summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-09-29 23:51:17 +0200
committerGitHub <noreply@github.com>2018-09-29 23:51:17 +0200
commit0378a9ba80dc5083bbafa4a216ed70ea5d450c03 (patch)
treea156074f100c479eb49c5ac9aa6fce591eefc028 /scene
parent9768ce5763cd0fdd8c17c8f052e1c65036517768 (diff)
parent8b2688786f4c294397b2fc9aaa9e2aab1c7c074e (diff)
Merge pull request #22520 from akien-mga/fix-warnings
Fix warning about functions defined but not used [-Wunused-function]
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/cpu_particles_2d.cpp4
-rw-r--r--scene/3d/cpu_particles.cpp4
-rw-r--r--scene/gui/link_button.cpp1
-rw-r--r--scene/gui/texture_button.cpp1
-rw-r--r--scene/resources/default_theme/default_theme.cpp42
5 files changed, 5 insertions, 47 deletions
diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp
index a8e0f0d07f..d29c6b37d5 100644
--- a/scene/2d/cpu_particles_2d.cpp
+++ b/scene/2d/cpu_particles_2d.cpp
@@ -507,10 +507,6 @@ static float rand_from_seed(uint32_t &seed) {
return float(seed % uint32_t(65536)) / 65535.0;
}
-static float rand_from_seed_m1_p1(uint32_t &seed) {
- return rand_from_seed(seed) * 2.0 - 1.0;
-}
-
void CPUParticles2D::_particles_process(float p_delta) {
p_delta *= speed_scale;
diff --git a/scene/3d/cpu_particles.cpp b/scene/3d/cpu_particles.cpp
index 712f0ba78b..ec51c31674 100644
--- a/scene/3d/cpu_particles.cpp
+++ b/scene/3d/cpu_particles.cpp
@@ -471,10 +471,6 @@ static float rand_from_seed(uint32_t &seed) {
return float(seed % uint32_t(65536)) / 65535.0;
}
-static float rand_from_seed_m1_p1(uint32_t &seed) {
- return rand_from_seed(seed) * 2.0 - 1.0;
-}
-
void CPUParticles::_particles_process(float p_delta) {
p_delta *= speed_scale;
diff --git a/scene/gui/link_button.cpp b/scene/gui/link_button.cpp
index 8560efdde5..d38a067fef 100644
--- a/scene/gui/link_button.cpp
+++ b/scene/gui/link_button.cpp
@@ -91,6 +91,7 @@ void LinkButton::_notification(int p_what) {
do_underline = underline_mode != UNDERLINE_MODE_NEVER;
} break;
+ case DRAW_HOVER_PRESSED: break; // Not used in this class
case DRAW_DISABLED: {
color = get_color("font_color_disabled");
diff --git a/scene/gui/texture_button.cpp b/scene/gui/texture_button.cpp
index a6a57b010f..413f9dbbe6 100644
--- a/scene/gui/texture_button.cpp
+++ b/scene/gui/texture_button.cpp
@@ -150,6 +150,7 @@ void TextureButton::_notification(int p_what) {
} else
texdraw = hover;
} break;
+ case DRAW_HOVER_PRESSED: break; // Not used in this class
case DRAW_DISABLED: {
if (disabled.is_null()) {
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index 0dc2ef105b..4de47b2cb0 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -120,41 +120,7 @@ static Ref<Texture> make_icon(T p_src) {
return texture;
}
-static Ref<Shader> make_shader(const char *vertex_code, const char *fragment_code, const char *lighting_code) {
- Ref<Shader> shader = (memnew(Shader()));
- //shader->set_code(vertex_code, fragment_code, lighting_code);
-
- return shader;
-}
-
-static Ref<BitmapFont> make_font(int p_height, int p_ascent, int p_valign, int p_charcount, const int *p_chars, const Ref<Texture> &p_texture) {
-
- Ref<BitmapFont> font(memnew(BitmapFont));
- font->add_texture(p_texture);
-
- for (int i = 0; i < p_charcount; i++) {
-
- const int *c = &p_chars[i * 8];
-
- int chr = c[0];
- Rect2 frect;
- frect.position.x = c[1];
- frect.position.y = c[2];
- frect.size.x = c[3];
- frect.size.y = c[4];
- Point2 align(c[5], c[6] + p_valign);
- int advance = c[7];
-
- font->add_char(chr, 0, frect, align, advance);
- }
-
- font->set_height(p_height);
- font->set_ascent(p_ascent);
-
- return font;
-}
-
-static Ref<BitmapFont> make_font2(int p_height, int p_ascent, int p_charcount, const int *p_char_rects, int p_kerning_count, const int *p_kernings, int p_w, int p_h, const unsigned char *p_img) {
+static Ref<BitmapFont> make_font(int p_height, int p_ascent, int p_charcount, const int *p_char_rects, int p_kerning_count, const int *p_kernings, int p_w, int p_h, const unsigned char *p_img) {
Ref<BitmapFont> font(memnew(BitmapFont));
@@ -209,8 +175,6 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
tex_cache = memnew(TexCacheMap);
- //Ref<BitmapFont> default_font = make_font(_bi_font_normal_height,_bi_font_normal_ascent,_bi_font_normal_valign,_bi_font_normal_charcount,_bi_font_normal_characters,make_icon(font_normal_png));
-
// Font Colors
Color control_font_color = Color::html("e0e0e0");
@@ -913,9 +877,9 @@ void make_default_theme(bool p_hidpi, Ref<Font> p_font) {
if (p_font.is_valid()) {
default_font = p_font;
} else if (p_hidpi) {
- default_font = make_font2(_hidpi_font_height, _hidpi_font_ascent, _hidpi_font_charcount, &_hidpi_font_charrects[0][0], _hidpi_font_kerning_pair_count, &_hidpi_font_kerning_pairs[0][0], _hidpi_font_img_width, _hidpi_font_img_height, _hidpi_font_img_data);
+ default_font = make_font(_hidpi_font_height, _hidpi_font_ascent, _hidpi_font_charcount, &_hidpi_font_charrects[0][0], _hidpi_font_kerning_pair_count, &_hidpi_font_kerning_pairs[0][0], _hidpi_font_img_width, _hidpi_font_img_height, _hidpi_font_img_data);
} else {
- default_font = make_font2(_lodpi_font_height, _lodpi_font_ascent, _lodpi_font_charcount, &_lodpi_font_charrects[0][0], _lodpi_font_kerning_pair_count, &_lodpi_font_kerning_pairs[0][0], _lodpi_font_img_width, _lodpi_font_img_height, _lodpi_font_img_data);
+ default_font = make_font(_lodpi_font_height, _lodpi_font_ascent, _lodpi_font_charcount, &_lodpi_font_charrects[0][0], _lodpi_font_kerning_pair_count, &_lodpi_font_kerning_pairs[0][0], _lodpi_font_img_width, _lodpi_font_img_height, _lodpi_font_img_data);
}
Ref<Font> large_font = default_font;
fill_default_theme(t, default_font, large_font, default_icon, default_style, p_hidpi ? 2.0 : 1.0);