Merge pull request #29027 from akien-mga/clang-format-8.0
Travis: Update clang-format to version 8.0
This commit is contained in:
commit
9643b2b6de
|
@ -23,9 +23,9 @@ matrix:
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- llvm-toolchain-xenial-6.0
|
- llvm-toolchain-xenial-8
|
||||||
packages:
|
packages:
|
||||||
- clang-format-6.0
|
- clang-format-8
|
||||||
|
|
||||||
- env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc-8 MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" EXTRA_ARGS="module_mono_enabled=yes mono_glue=no warnings=extra werror=yes"
|
- env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc-8 MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" EXTRA_ARGS="module_mono_enabled=yes mono_glue=no warnings=extra werror=yes"
|
||||||
os: linux
|
os: linux
|
||||||
|
|
|
@ -301,8 +301,7 @@ String ResourceFormatImporter::get_import_group_file(const String &p_path) const
|
||||||
bool valid = true;
|
bool valid = true;
|
||||||
PathAndType pat;
|
PathAndType pat;
|
||||||
_get_path_and_type(p_path, pat, &valid);
|
_get_path_and_type(p_path, pat, &valid);
|
||||||
return valid?pat.group_file:String();
|
return valid ? pat.group_file : String();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ResourceFormatImporter::is_import_valid(const String &p_path) const {
|
bool ResourceFormatImporter::is_import_valid(const String &p_path) const {
|
||||||
|
|
|
@ -126,7 +126,7 @@ public:
|
||||||
|
|
||||||
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL) = 0;
|
virtual Error import(const String &p_source_file, const String &p_save_path, const Map<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files = NULL, Variant *r_metadata = NULL) = 0;
|
||||||
|
|
||||||
virtual Error import_group_file(const String& p_group_file,const Map<String,Map<StringName, Variant> >&p_source_file_options, const Map<String,String>& p_base_paths) { return ERR_UNAVAILABLE; }
|
virtual Error import_group_file(const String &p_group_file, const Map<String, Map<StringName, Variant> > &p_source_file_options, const Map<String, String> &p_base_paths) { return ERR_UNAVAILABLE; }
|
||||||
virtual bool are_import_settings_valid(const String &p_path) const { return true; }
|
virtual bool are_import_settings_valid(const String &p_path) const { return true; }
|
||||||
virtual String get_import_settings_string() const { return String(); }
|
virtual String get_import_settings_string() const { return String(); }
|
||||||
};
|
};
|
||||||
|
|
|
@ -92,7 +92,7 @@ void EditorFolding::load_resource_folding(RES p_resource, const String &p_path)
|
||||||
_set_unfolds(p_resource.ptr(), unfolds);
|
_set_unfolds(p_resource.ptr(), unfolds);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorFolding::_fill_folds(const Node *p_root, const Node *p_node, Array &p_folds, Array &resource_folds, Array& nodes_folded,Set<RES> &resources) {
|
void EditorFolding::_fill_folds(const Node *p_root, const Node *p_node, Array &p_folds, Array &resource_folds, Array &nodes_folded, Set<RES> &resources) {
|
||||||
if (p_root != p_node) {
|
if (p_root != p_node) {
|
||||||
if (!p_node->get_owner()) {
|
if (!p_node->get_owner()) {
|
||||||
return; //not owned, bye
|
return; //not owned, bye
|
||||||
|
@ -130,7 +130,7 @@ void EditorFolding::_fill_folds(const Node *p_root, const Node *p_node, Array &p
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < p_node->get_child_count(); i++) {
|
for (int i = 0; i < p_node->get_child_count(); i++) {
|
||||||
_fill_folds(p_root, p_node->get_child(i), p_folds, resource_folds, nodes_folded,resources);
|
_fill_folds(p_root, p_node->get_child(i), p_folds, resource_folds, nodes_folded, resources);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void EditorFolding::save_scene_folding(const Node *p_scene, const String &p_path) {
|
void EditorFolding::save_scene_folding(const Node *p_scene, const String &p_path) {
|
||||||
|
@ -205,7 +205,7 @@ void EditorFolding::load_scene_folding(Node *p_scene, const String &p_path) {
|
||||||
_set_unfolds(res.ptr(), unfolds2);
|
_set_unfolds(res.ptr(), unfolds2);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int i=0;i<nodes_folded.size();i++) {
|
for (int i = 0; i < nodes_folded.size(); i++) {
|
||||||
NodePath fold_path = nodes_folded[i];
|
NodePath fold_path = nodes_folded[i];
|
||||||
if (p_scene->has_node(fold_path)) {
|
if (p_scene->has_node(fold_path)) {
|
||||||
Node *node = p_scene->get_node(fold_path);
|
Node *node = p_scene->get_node(fold_path);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
CLANG_FORMAT=clang-format-6.0
|
CLANG_FORMAT=clang-format-8
|
||||||
|
|
||||||
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
||||||
# Check the whole commit range against $TRAVIS_BRANCH, the base merge branch
|
# Check the whole commit range against $TRAVIS_BRANCH, the base merge branch
|
||||||
|
|
|
@ -32,8 +32,7 @@
|
||||||
|
|
||||||
#include "core/engine.h"
|
#include "core/engine.h"
|
||||||
|
|
||||||
|
void AudioStreamPlayer::_mix_to_bus(const AudioFrame *p_frames, int p_amount) {
|
||||||
void AudioStreamPlayer::_mix_to_bus(const AudioFrame *p_frames,int p_amount) {
|
|
||||||
|
|
||||||
int bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus);
|
int bus_index = AudioServer::get_singleton()->thread_find_bus_index(bus);
|
||||||
|
|
||||||
|
@ -66,10 +65,8 @@ void AudioStreamPlayer::_mix_to_bus(const AudioFrame *p_frames,int p_amount) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AudioStreamPlayer::_mix_internal(bool p_fadeout) {
|
void AudioStreamPlayer::_mix_internal(bool p_fadeout) {
|
||||||
|
|
||||||
|
|
||||||
//get data
|
//get data
|
||||||
AudioFrame *buffer = mix_buffer.ptrw();
|
AudioFrame *buffer = mix_buffer.ptrw();
|
||||||
int buffer_size = mix_buffer.size();
|
int buffer_size = mix_buffer.size();
|
||||||
|
@ -94,15 +91,14 @@ void AudioStreamPlayer::_mix_internal(bool p_fadeout) {
|
||||||
//set volume for next mix
|
//set volume for next mix
|
||||||
mix_volume_db = target_volume;
|
mix_volume_db = target_volume;
|
||||||
|
|
||||||
_mix_to_bus(buffer,buffer_size);
|
_mix_to_bus(buffer, buffer_size);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioStreamPlayer::_mix_audio() {
|
void AudioStreamPlayer::_mix_audio() {
|
||||||
|
|
||||||
if (use_fadeout) {
|
if (use_fadeout) {
|
||||||
_mix_to_bus(fadeout_buffer.ptr(),fadeout_buffer.size());
|
_mix_to_bus(fadeout_buffer.ptr(), fadeout_buffer.size());
|
||||||
use_fadeout=false;
|
use_fadeout = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stream_playback.is_valid() || !active ||
|
if (!stream_playback.is_valid() || !active ||
|
||||||
|
@ -121,7 +117,7 @@ void AudioStreamPlayer::_mix_audio() {
|
||||||
if (setstop) {
|
if (setstop) {
|
||||||
_mix_internal(true);
|
_mix_internal(true);
|
||||||
stream_playback->stop();
|
stream_playback->stop();
|
||||||
setstop=false;
|
setstop = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setseek >= 0.0 && !stop_has_priority) {
|
if (setseek >= 0.0 && !stop_has_priority) {
|
||||||
|
@ -154,7 +150,7 @@ void AudioStreamPlayer::_notification(int p_what) {
|
||||||
if (p_what == NOTIFICATION_INTERNAL_PROCESS) {
|
if (p_what == NOTIFICATION_INTERNAL_PROCESS) {
|
||||||
|
|
||||||
if (!active || (setseek < 0 && !stream_playback->is_playing())) {
|
if (!active || (setseek < 0 && !stream_playback->is_playing())) {
|
||||||
active = false;
|
active = false;
|
||||||
set_process_internal(false);
|
set_process_internal(false);
|
||||||
emit_signal("finished");
|
emit_signal("finished");
|
||||||
}
|
}
|
||||||
|
@ -200,7 +196,7 @@ void AudioStreamPlayer::set_stream(Ref<AudioStream> p_stream) {
|
||||||
vol += vol_inc;
|
vol += vol_inc;
|
||||||
}
|
}
|
||||||
|
|
||||||
use_fadeout=true;
|
use_fadeout = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
mix_buffer.resize(AudioServer::get_singleton()->thread_get_mix_buffer_size());
|
mix_buffer.resize(AudioServer::get_singleton()->thread_get_mix_buffer_size());
|
||||||
|
@ -252,7 +248,7 @@ void AudioStreamPlayer::play(float p_from_pos) {
|
||||||
if (stream_playback.is_valid()) {
|
if (stream_playback.is_valid()) {
|
||||||
//mix_volume_db = volume_db; do not reset volume ramp here, can cause clicks
|
//mix_volume_db = volume_db; do not reset volume ramp here, can cause clicks
|
||||||
setseek = p_from_pos;
|
setseek = p_from_pos;
|
||||||
stop_has_priority=false;
|
stop_has_priority = false;
|
||||||
active = true;
|
active = true;
|
||||||
set_process_internal(true);
|
set_process_internal(true);
|
||||||
}
|
}
|
||||||
|
@ -268,8 +264,8 @@ void AudioStreamPlayer::seek(float p_seconds) {
|
||||||
void AudioStreamPlayer::stop() {
|
void AudioStreamPlayer::stop() {
|
||||||
|
|
||||||
if (stream_playback.is_valid() && active) {
|
if (stream_playback.is_valid() && active) {
|
||||||
setstop=true;
|
setstop = true;
|
||||||
stop_has_priority=true;
|
stop_has_priority = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -357,7 +353,7 @@ void AudioStreamPlayer::_validate_property(PropertyInfo &property) const {
|
||||||
if (property.name == "bus") {
|
if (property.name == "bus") {
|
||||||
|
|
||||||
String options;
|
String options;
|
||||||
for (int i = 0; i <AudioServer::get_singleton()->get_bus_count(); i++) {
|
for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
options += ",";
|
options += ",";
|
||||||
String name = AudioServer::get_singleton()->get_bus_name(i);
|
String name = AudioServer::get_singleton()->get_bus_name(i);
|
||||||
|
@ -442,8 +438,8 @@ AudioStreamPlayer::AudioStreamPlayer() {
|
||||||
stream_paused_fade = false;
|
stream_paused_fade = false;
|
||||||
mix_target = MIX_TARGET_STEREO;
|
mix_target = MIX_TARGET_STEREO;
|
||||||
fadeout_buffer.resize(512);
|
fadeout_buffer.resize(512);
|
||||||
setstop=false;
|
setstop = false;
|
||||||
use_fadeout=false;
|
use_fadeout = false;
|
||||||
|
|
||||||
AudioServer::get_singleton()->connect("bus_layout_changed", this, "_bus_layout_changed");
|
AudioServer::get_singleton()->connect("bus_layout_changed", this, "_bus_layout_changed");
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,6 @@ public:
|
||||||
|
|
||||||
Ref<AudioStreamPlayback> get_stream_playback();
|
Ref<AudioStreamPlayback> get_stream_playback();
|
||||||
|
|
||||||
|
|
||||||
AudioStreamPlayer();
|
AudioStreamPlayer();
|
||||||
~AudioStreamPlayer();
|
~AudioStreamPlayer();
|
||||||
};
|
};
|
||||||
|
|
|
@ -595,16 +595,16 @@ Array BitMap::_opaque_to_polygons_bind(const Rect2 &p_rect, float p_epsilon) con
|
||||||
return result_array;
|
return result_array;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BitMap::resize(const Size2& p_new_size) {
|
void BitMap::resize(const Size2 &p_new_size) {
|
||||||
|
|
||||||
Ref<BitMap> new_bitmap;
|
Ref<BitMap> new_bitmap;
|
||||||
new_bitmap.instance();
|
new_bitmap.instance();
|
||||||
new_bitmap->create(p_new_size);
|
new_bitmap->create(p_new_size);
|
||||||
int lw = MIN(width,p_new_size.width);
|
int lw = MIN(width, p_new_size.width);
|
||||||
int lh = MIN(height,p_new_size.height);
|
int lh = MIN(height, p_new_size.height);
|
||||||
for(int x=0;x<lw;x++) {
|
for (int x = 0; x < lw; x++) {
|
||||||
for(int y=0;y<lh;y++) {
|
for (int y = 0; y < lh; y++) {
|
||||||
new_bitmap->set_bit(Vector2(x,y),get_bit(Vector2(x,y)));
|
new_bitmap->set_bit(Vector2(x, y), get_bit(Vector2(x, y)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,11 +617,11 @@ Ref<Image> BitMap::convert_to_image() const {
|
||||||
|
|
||||||
Ref<Image> image;
|
Ref<Image> image;
|
||||||
image.instance();
|
image.instance();
|
||||||
image->create(width,height,false,Image::FORMAT_L8);
|
image->create(width, height, false, Image::FORMAT_L8);
|
||||||
image->lock();
|
image->lock();
|
||||||
for(int i=0;i<width;i++) {
|
for (int i = 0; i < width; i++) {
|
||||||
for(int j=0;j<height;j++) {
|
for (int j = 0; j < height; j++) {
|
||||||
image->set_pixel( i,j,get_bit(Point2(i,j)) ? Color(1,1,1) : Color(0,0,0));
|
image->set_pixel(i, j, get_bit(Point2(i, j)) ? Color(1, 1, 1) : Color(0, 0, 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -629,30 +629,28 @@ Ref<Image> BitMap::convert_to_image() const {
|
||||||
|
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
void BitMap::blit(const Vector2& p_pos,const Ref<BitMap>& p_bitmap) {
|
void BitMap::blit(const Vector2 &p_pos, const Ref<BitMap> &p_bitmap) {
|
||||||
|
|
||||||
int x = p_pos.x;
|
int x = p_pos.x;
|
||||||
int y = p_pos.y;
|
int y = p_pos.y;
|
||||||
int w = p_bitmap->get_size().width;
|
int w = p_bitmap->get_size().width;
|
||||||
int h = p_bitmap->get_size().height;
|
int h = p_bitmap->get_size().height;
|
||||||
|
|
||||||
for(int i=0;i<w;i++) {
|
for (int i = 0; i < w; i++) {
|
||||||
for (int j=0;j<h;j++) {
|
for (int j = 0; j < h; j++) {
|
||||||
int px = x+i;
|
int px = x + i;
|
||||||
int py = y+j;
|
int py = y + j;
|
||||||
if (px<0 || px>=width)
|
if (px < 0 || px >= width)
|
||||||
continue;
|
continue;
|
||||||
if (py<0 || py>=height)
|
if (py < 0 || py >= height)
|
||||||
continue;
|
continue;
|
||||||
if (p_bitmap->get_bit(Vector2(i,j))) {
|
if (p_bitmap->get_bit(Vector2(i, j))) {
|
||||||
set_bit(Vector2(x,y),true);
|
set_bit(Vector2(x, y), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BitMap::_bind_methods() {
|
void BitMap::_bind_methods() {
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("create", "size"), &BitMap::create);
|
ClassDB::bind_method(D_METHOD("create", "size"), &BitMap::create);
|
||||||
|
|
|
@ -64,11 +64,11 @@ public:
|
||||||
int get_true_bit_count() const;
|
int get_true_bit_count() const;
|
||||||
|
|
||||||
Size2 get_size() const;
|
Size2 get_size() const;
|
||||||
void resize(const Size2& p_new_size);
|
void resize(const Size2 &p_new_size);
|
||||||
|
|
||||||
void grow_mask(int p_pixels, const Rect2 &p_rect);
|
void grow_mask(int p_pixels, const Rect2 &p_rect);
|
||||||
|
|
||||||
void blit(const Vector2& p_pos,const Ref<BitMap>& p_bitmap);
|
void blit(const Vector2 &p_pos, const Ref<BitMap> &p_bitmap);
|
||||||
Ref<Image> convert_to_image() const;
|
Ref<Image> convert_to_image() const;
|
||||||
|
|
||||||
Vector<Vector<Vector2> > clip_opaque_to_polygons(const Rect2 &p_rect, float p_epsilon = 2.0) const;
|
Vector<Vector<Vector2> > clip_opaque_to_polygons(const Rect2 &p_rect, float p_epsilon = 2.0) const;
|
||||||
|
|
|
@ -447,9 +447,8 @@ Error ResourceInteractiveLoaderText::poll() {
|
||||||
resource_cache.push_back(res);
|
resource_cache.push_back(res);
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
//remember ID for saving
|
//remember ID for saving
|
||||||
res->set_id_for_path(local_path,index);
|
res->set_id_for_path(local_path, index);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ExtResource er;
|
ExtResource er;
|
||||||
|
@ -1545,9 +1544,6 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
|
@ -1569,7 +1565,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r
|
||||||
}
|
}
|
||||||
|
|
||||||
int attempt = 1; //start from one, more readable format
|
int attempt = 1; //start from one, more readable format
|
||||||
while(cached_ids_found.has(attempt)) {
|
while (cached_ids_found.has(attempt)) {
|
||||||
attempt++;
|
attempt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1577,7 +1573,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r
|
||||||
E->get() = attempt;
|
E->get() = attempt;
|
||||||
//update also in resource
|
//update also in resource
|
||||||
Ref<Resource> res = E->key();
|
Ref<Resource> res = E->key();
|
||||||
res->set_id_for_path(local_path,attempt);
|
res->set_id_for_path(local_path, attempt);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
//make sure to start from one, as it makes format more readable
|
//make sure to start from one, as it makes format more readable
|
||||||
|
@ -1598,7 +1594,6 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r
|
||||||
|
|
||||||
sorted_er.sort();
|
sorted_er.sort();
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < sorted_er.size(); i++) {
|
for (int i = 0; i < sorted_er.size(); i++) {
|
||||||
String p = sorted_er[i].resource->get_path();
|
String p = sorted_er[i].resource->get_path();
|
||||||
|
|
||||||
|
|
|
@ -172,10 +172,9 @@ class ResourceFormatSaverTextInstance {
|
||||||
struct ResourceSort {
|
struct ResourceSort {
|
||||||
RES resource;
|
RES resource;
|
||||||
int index;
|
int index;
|
||||||
bool operator<(const ResourceSort& p_right) const {
|
bool operator<(const ResourceSort &p_right) const {
|
||||||
return index < p_right.index;
|
return index < p_right.index;
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void _find_resources(const Variant &p_variant, bool p_main = false);
|
void _find_resources(const Variant &p_variant, bool p_main = false);
|
||||||
|
|
Loading…
Reference in New Issue