Misc code cleanup
This commit is contained in:
parent
11d3768132
commit
914528180f
|
@ -63,7 +63,6 @@ void EditorAbout::_notification(int p_what) {
|
||||||
|
|
||||||
_logo->set_texture(get_editor_theme_icon(SNAME("Logo")));
|
_logo->set_texture(get_editor_theme_icon(SNAME("Logo")));
|
||||||
|
|
||||||
Ref<StyleBoxEmpty> empty_stylebox = memnew(StyleBoxEmpty);
|
|
||||||
for (ItemList *il : name_lists) {
|
for (ItemList *il : name_lists) {
|
||||||
for (int i = 0; i < il->get_item_count(); i++) {
|
for (int i = 0; i < il->get_item_count(); i++) {
|
||||||
if (il->get_item_metadata(i)) {
|
if (il->get_item_metadata(i)) {
|
||||||
|
|
|
@ -494,7 +494,7 @@ void TextureProgressBar::_notification(int p_what) {
|
||||||
Rect2 source = Rect2(Point2(), progress->get_size());
|
Rect2 source = Rect2(Point2(), progress->get_size());
|
||||||
draw_texture_rect_region(progress, region, source, tint_progress);
|
draw_texture_rect_region(progress, region, source, tint_progress);
|
||||||
} else if (val != 0) {
|
} else if (val != 0) {
|
||||||
Array pts;
|
LocalVector<float> pts;
|
||||||
float direction = mode == FILL_COUNTER_CLOCKWISE ? -1 : 1;
|
float direction = mode == FILL_COUNTER_CLOCKWISE ? -1 : 1;
|
||||||
float start;
|
float start;
|
||||||
|
|
||||||
|
@ -507,11 +507,11 @@ void TextureProgressBar::_notification(int p_what) {
|
||||||
float end = start + direction * val;
|
float end = start + direction * val;
|
||||||
float from = MIN(start, end);
|
float from = MIN(start, end);
|
||||||
float to = MAX(start, end);
|
float to = MAX(start, end);
|
||||||
pts.append(from);
|
pts.push_back(from);
|
||||||
for (float corner = Math::floor(from * 4 + 0.5) * 0.25 + 0.125; corner < to; corner += 0.25) {
|
for (float corner = Math::floor(from * 4 + 0.5) * 0.25 + 0.125; corner < to; corner += 0.25) {
|
||||||
pts.append(corner);
|
pts.push_back(corner);
|
||||||
}
|
}
|
||||||
pts.append(to);
|
pts.push_back(to);
|
||||||
|
|
||||||
Ref<AtlasTexture> atlas_progress = progress;
|
Ref<AtlasTexture> atlas_progress = progress;
|
||||||
bool valid_atlas_progress = atlas_progress.is_valid() && atlas_progress->get_atlas().is_valid();
|
bool valid_atlas_progress = atlas_progress.is_valid() && atlas_progress->get_atlas().is_valid();
|
||||||
|
@ -524,8 +524,8 @@ void TextureProgressBar::_notification(int p_what) {
|
||||||
|
|
||||||
Vector<Point2> uvs;
|
Vector<Point2> uvs;
|
||||||
Vector<Point2> points;
|
Vector<Point2> points;
|
||||||
for (int i = 0; i < pts.size(); i++) {
|
for (const float &f : pts) {
|
||||||
Point2 uv = unit_val_to_uv(pts[i]);
|
Point2 uv = unit_val_to_uv(f);
|
||||||
if (uvs.find(uv) >= 0) {
|
if (uvs.find(uv) >= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,10 +105,6 @@ public:
|
||||||
_changes_changed();
|
_changes_changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DISPLAY_CHANGED \
|
|
||||||
changes++; \
|
|
||||||
_changes_changed();
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
_FORCE_INLINE_ static void redraw_request() {
|
_FORCE_INLINE_ static void redraw_request() {
|
||||||
changes++;
|
changes++;
|
||||||
|
|
Loading…
Reference in New Issue