update Xcode project, fix some warnings, update android icons, ignore unrecognized files in the doc browser

This commit is contained in:
2018-09-22 23:21:39 +02:00
parent 3191730c31
commit c6f8bf7b9f
25 changed files with 33 additions and 22 deletions

View File

@@ -106,6 +106,8 @@
AD3087C82061D1CD009F9260 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD3087C72061D1CD009F9260 /* CoreGraphics.framework */; }; AD3087C82061D1CD009F9260 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD3087C72061D1CD009F9260 /* CoreGraphics.framework */; };
AD30D82F1F783E0100B6A112 /* libcurl.4.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = AD30D82E1F783E0100B6A112 /* libcurl.4.tbd */; }; AD30D82F1F783E0100B6A112 /* libcurl.4.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = AD30D82E1F783E0100B6A112 /* libcurl.4.tbd */; };
AD30D8331F8049BD00B6A112 /* Photos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD30D8321F8049BC00B6A112 /* Photos.framework */; }; AD30D8331F8049BD00B6A112 /* Photos.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD30D8321F8049BC00B6A112 /* Photos.framework */; };
AD4CEF142156B2C60097F4BD /* node_about.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD4CEF122156B2C50097F4BD /* node_about.cpp */; };
AD4CEF152156B2DA0097F4BD /* node_about.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD4CEF122156B2C50097F4BD /* node_about.cpp */; };
AD5016591EBFC7F00079A826 /* data in Resources */ = {isa = PBXBuildFile; fileRef = AD58E0611E17F23D006ACC15 /* data */; }; AD5016591EBFC7F00079A826 /* data in Resources */ = {isa = PBXBuildFile; fileRef = AD58E0611E17F23D006ACC15 /* data */; };
AD74030F1FB9D0D3004ACFCC /* node_combobox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD74030D1FB9D0C0004ACFCC /* node_combobox.cpp */; }; AD74030F1FB9D0D3004ACFCC /* node_combobox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD74030D1FB9D0C0004ACFCC /* node_combobox.cpp */; };
AD7403101FB9D0D4004ACFCC /* node_combobox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD74030D1FB9D0C0004ACFCC /* node_combobox.cpp */; }; AD7403101FB9D0D4004ACFCC /* node_combobox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AD74030D1FB9D0C0004ACFCC /* node_combobox.cpp */; };
@@ -324,6 +326,8 @@
AD4C08D61E89BD0F0051D85F /* canvas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = canvas.h; sourceTree = "<group>"; }; AD4C08D61E89BD0F0051D85F /* canvas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = canvas.h; sourceTree = "<group>"; };
AD4C08D71E89BD0F0051D85F /* rtt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rtt.cpp; sourceTree = "<group>"; }; AD4C08D71E89BD0F0051D85F /* rtt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rtt.cpp; sourceTree = "<group>"; };
AD4C08D81E89BD0F0051D85F /* rtt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rtt.h; sourceTree = "<group>"; }; AD4C08D81E89BD0F0051D85F /* rtt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rtt.h; sourceTree = "<group>"; };
AD4CEF122156B2C50097F4BD /* node_about.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = node_about.cpp; sourceTree = "<group>"; };
AD4CEF132156B2C50097F4BD /* node_about.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = node_about.h; sourceTree = "<group>"; };
AD58E0521E107411006ACC15 /* main.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = main.cpp; sourceTree = "<group>"; }; AD58E0521E107411006ACC15 /* main.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = main.cpp; sourceTree = "<group>"; };
AD58E0591E10752E006ACC15 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; AD58E0591E10752E006ACC15 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
AD58E05B1E107536006ACC15 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; AD58E05B1E107536006ACC15 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
@@ -524,6 +528,8 @@
AD3B1EBF1E3B8B7600E918E3 /* layout.h */, AD3B1EBF1E3B8B7600E918E3 /* layout.h */,
AD10637D1EC7ADFA002A525F /* node.cpp */, AD10637D1EC7ADFA002A525F /* node.cpp */,
AD10637E1EC7ADFA002A525F /* node.h */, AD10637E1EC7ADFA002A525F /* node.h */,
AD4CEF122156B2C50097F4BD /* node_about.cpp */,
AD4CEF132156B2C50097F4BD /* node_about.h */,
AD1063511EC7ADFA002A525F /* node_border.cpp */, AD1063511EC7ADFA002A525F /* node_border.cpp */,
AD1063521EC7ADFA002A525F /* node_border.h */, AD1063521EC7ADFA002A525F /* node_border.h */,
AD1063531EC7ADFA002A525F /* node_button_custom.cpp */, AD1063531EC7ADFA002A525F /* node_button_custom.cpp */,
@@ -1141,6 +1147,7 @@
ADBC8C581FAFD05A0094B339 /* node_dialog_cloud.cpp in Sources */, ADBC8C581FAFD05A0094B339 /* node_dialog_cloud.cpp in Sources */,
AD0E5CC91ECC72AD00C35669 /* node_settings.cpp in Sources */, AD0E5CC91ECC72AD00C35669 /* node_settings.cpp in Sources */,
AD0E5CBB1ECC72AD00C35669 /* node_button.cpp in Sources */, AD0E5CBB1ECC72AD00C35669 /* node_button.cpp in Sources */,
AD4CEF152156B2DA0097F4BD /* node_about.cpp in Sources */,
AD0E5CD41ECC72AD00C35669 /* app_shaders.cpp in Sources */, AD0E5CD41ECC72AD00C35669 /* app_shaders.cpp in Sources */,
AD0E5CD91ECC72AD00C35669 /* canvas.cpp in Sources */, AD0E5CD91ECC72AD00C35669 /* canvas.cpp in Sources */,
ADE4911E1F86E65E00FB8E92 /* sweep_context.cc in Sources */, ADE4911E1F86E65E00FB8E92 /* sweep_context.cc in Sources */,
@@ -1223,6 +1230,7 @@
AD1063A81EC7AE92002A525F /* node_slider.cpp in Sources */, AD1063A81EC7AE92002A525F /* node_slider.cpp in Sources */,
ADD7D2A21EBF9E1C00D5A897 /* util.cpp in Sources */, ADD7D2A21EBF9E1C00D5A897 /* util.cpp in Sources */,
ADD7D2791EBF9AE300D5A897 /* GameViewController.m in Sources */, ADD7D2791EBF9AE300D5A897 /* GameViewController.m in Sources */,
AD4CEF142156B2C60097F4BD /* node_about.cpp in Sources */,
ADD7D26F1EBF9AE300D5A897 /* main.m in Sources */, ADD7D26F1EBF9AE300D5A897 /* main.m in Sources */,
ADC0EB431FC36E88004079BB /* node_dialog_picker.cpp in Sources */, ADC0EB431FC36E88004079BB /* node_dialog_picker.cpp in Sources */,
ADD7D2A01EBF9E1C00D5A897 /* image.cpp in Sources */, ADD7D2A01EBF9E1C00D5A897 /* image.cpp in Sources */,

View File

@@ -7,7 +7,7 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application android:label="@string/app_name" <application android:label="@string/app_name"
android:icon="@drawable/ic_launcher" android:icon="@mipmap/ic_launcher"
android:allowBackup="false" android:allowBackup="false"
android:hasCode="false" android:hasCode="false"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"> android:theme="@android:style/Theme.NoTitleBar.Fullscreen">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@@ -103,8 +103,6 @@ void App::initAssets()
LOG("initializing assets create sampler"); LOG("initializing assets create sampler");
sampler.create(GL_NEAREST); sampler.create(GL_NEAREST);
LOG("initializing assets load uvs texture"); LOG("initializing assets load uvs texture");
if (!tex.load("data/uvs.jpg"))
LOG("error loading image");
LOG("initializing assets completed"); LOG("initializing assets completed");
} }

View File

@@ -47,7 +47,6 @@ public:
std::deque<std::unique_ptr<uint8_t[]>> rec_frames; std::deque<std::unique_ptr<uint8_t[]>> rec_frames;
Sampler sampler; Sampler sampler;
Texture2D tex;
LayoutManager layout; LayoutManager layout;
NodeMessageBox* msgbox; NodeMessageBox* msgbox;
NodeSettings* settings; NodeSettings* settings;

View File

@@ -752,7 +752,7 @@ void App::initLayout()
} }
int current_layer = (int)glm::clamp<int>( int current_layer = (int)glm::clamp<int>(
floor(value * c.m_layers.size()), 1, c.m_layers.size() - 1); floor(value * c.m_layers.size()), 1, (int)c.m_layers.size() - 1);
auto l = layers->get_layer_at(current_layer); auto l = layers->get_layer_at(current_layer);
layers->handle_layer_selected(l); layers->handle_layer_selected(l);
layers->handle_layer_opacity(l, 1.f); layers->handle_layer_opacity(l, 1.f);

View File

@@ -187,7 +187,7 @@ std::vector<ui::StrokeSample> ui::Stroke::compute_samples()
LOG("Invalid sample"); LOG("Invalid sample");
samples.push_back(s); samples.push_back(s);
} }
return std::move(samples); return samples;
} }
bool ui::Stroke::has_sample() bool ui::Stroke::has_sample()
{ {

View File

@@ -799,7 +799,7 @@ void ui::Canvas::layer_remove(int idx) // m_order index
i--; i--;
m_layers.erase(m_layers.begin() + n); m_layers.erase(m_layers.begin() + n);
m_order.erase(m_order.begin() + idx); m_order.erase(m_order.begin() + idx);
m_current_layer_idx = m_order[std::min<int>(m_layers.size() - 1, idx)]; m_current_layer_idx = m_order[std::min<int>((int)m_layers.size() - 1, idx)];
} }
void ui::Canvas::layer_order(int idx, int pos) // m_order index void ui::Canvas::layer_order(int idx, int pos) // m_order index
{ {
@@ -1283,8 +1283,8 @@ void ui::Canvas::inject_xmp(std::string jpg_path)
unsigned char* xmp_section = (unsigned char*)malloc(sizeof(xmp) + 4); unsigned char* xmp_section = (unsigned char*)malloc(sizeof(xmp) + 4);
xmp_section[0] = 0xff; xmp_section[0] = 0xff;
xmp_section[1] = 0xe1; xmp_section[1] = 0xe1;
xmp_section[2] = ((int)sizeof(xmp) + 2) >> 8; xmp_section[2] = (uint8_t)((int)sizeof(xmp) + 2) >> 8;
xmp_section[3] = ((int)sizeof(xmp) + 2) >> 0; xmp_section[3] = (uint8_t)((int)sizeof(xmp) + 2) >> 0;
memcpy(xmp_section + 4, xmp, sizeof(xmp)); memcpy(xmp_section + 4, xmp, sizeof(xmp));
fwrite(jpeg_data, 1, i, fp); fwrite(jpeg_data, 1, i, fp);
@@ -1843,7 +1843,7 @@ ui::Image ui::Canvas::thumbnail_generate(int w, int h)
glClearColor(cc[0], cc[1], cc[2], cc[3]); glClearColor(cc[0], cc[1], cc[2], cc[3]);
glActiveTexture(GL_TEXTURE0); glActiveTexture(GL_TEXTURE0);
return std::move(image); return image;
} }
ui::Image ui::Canvas::thumbnail_read(std::string data_path) ui::Image ui::Canvas::thumbnail_read(std::string data_path)
@@ -1870,7 +1870,7 @@ ui::Image ui::Canvas::thumbnail_read(std::string data_path)
fread((uint8_t*)thumb.data(), thumb.size(), 1, fp); fread((uint8_t*)thumb.data(), thumb.size(), 1, fp);
fclose(fp); fclose(fp);
LOG("project thumbnail read from %s", data_path.c_str()); LOG("project thumbnail read from %s", data_path.c_str());
return std::move(thumb); return thumb;
} }
void ui::Canvas::draw_objects(std::function<void(const glm::mat4& camera, const glm::mat4& proj, int i)> observer, Layer& layer) void ui::Canvas::draw_objects(std::function<void(const glm::mat4& camera, const glm::mat4& proj, int i)> observer, Layer& layer)
@@ -2016,7 +2016,7 @@ std::vector<ui::Shape::vertex_t> ui::Canvas::triangulate(const std::vector<std::
node = node->end ? nullptr : node->next; node = node->end ? nullptr : node->next;
current->next = nullptr; current->next = nullptr;
} }
LOG("poly %ld", outline.size()); LOG("poly %zu", outline.size());
if (outline.size() > 2) if (outline.size() > 2)
{ {
@@ -2101,7 +2101,7 @@ ui::Layer::Snapshot ui::Layer::snapshot(std::string data_path)
//int ret = stbi_write_png(name, m_rtt[i].getWidth(), m_rtt[i].getHeight(), 4, snap.image[i].get(), m_rtt[i].stride()); //int ret = stbi_write_png(name, m_rtt[i].getWidth(), m_rtt[i].getHeight(), 4, snap.image[i].get(), m_rtt[i].stride());
} }
counter++; counter++;
return std::move(snap); return snap;
} }
void ui::Layer::clear(const glm::vec4& c) void ui::Layer::clear(const glm::vec4& c)

View File

@@ -235,7 +235,7 @@ public:
{ {
} }
virtual Action* get_redo() virtual Action* get_redo() override
{ {
auto redo = m_canvas->create_action(m_layer_idx); auto redo = m_canvas->create_action(m_layer_idx);
return redo; return redo;

View File

@@ -157,7 +157,7 @@ kEventResult Node::on_event(Event* e)
break; break;
GestureEvent* ge = static_cast<GestureEvent*>(e); GestureEvent* ge = static_cast<GestureEvent*>(e);
bool inside = point_in_rect(ge->m_pos, m_clip); bool inside = point_in_rect(ge->m_pos, m_clip);
bool inside_old = m_mouse_inside; //bool inside_old = m_mouse_inside;
m_mouse_inside = inside; m_mouse_inside = inside;
if ((inside || m_mouse_captured) && handle_event(e) == kEventResult::Consumed) if ((inside || m_mouse_captured) && handle_event(e) == kEventResult::Consumed)
return kEventResult::Consumed; return kEventResult::Consumed;
@@ -208,7 +208,9 @@ void Node::removed(Node* parent)
const Node* Node::init_template(const char* id) const Node* Node::init_template(const char* id)
{ {
const auto& m_template = static_cast<Node*>((*m_manager)[const_hash(id)]->m_children[0].get()); auto hid = const_hash(id);
Node* top = m_manager->get(hid);
Node* m_template = static_cast<Node*>(top->m_children[0].get());
for (auto& c : m_template->m_children) for (auto& c : m_template->m_children)
{ {
auto node = c->clone(); auto node = c->clone();

View File

@@ -135,7 +135,7 @@ void NodeCanvas::draw()
if (m_canvas->m_layers[layer_index].m_opacity == .0f) if (m_canvas->m_layers[layer_index].m_opacity == .0f)
continue; continue;
int z = (int)m_canvas->m_order.size() - i; int z = (int)(m_canvas->m_order.size() - i);
auto plane_mvp_z = proj * camera * auto plane_mvp_z = proj * camera *
glm::scale(glm::vec3(z + 1)) * glm::scale(glm::vec3(z + 1)) *
glm::eulerAngleYXZ(yaw, pitch, roll) * glm::eulerAngleYXZ(yaw, pitch, roll) *
@@ -362,7 +362,6 @@ void NodeCanvas::handle_resize(glm::vec2 old_size, glm::vec2 new_size)
kEventResult NodeCanvas::handle_event(Event* e) kEventResult NodeCanvas::handle_event(Event* e)
{ {
static std::vector<CanvasMode>* old_mode = nullptr;
Node::handle_event(e); Node::handle_event(e);
MouseEvent* me = static_cast<MouseEvent*>(e); MouseEvent* me = static_cast<MouseEvent*>(e);
KeyEvent* ke = static_cast<KeyEvent*>(e); KeyEvent* ke = static_cast<KeyEvent*>(e);

View File

@@ -88,5 +88,7 @@ void NodeComboBox::parse_attributes(kAttribute ka, const tinyxml2::XMLAttribute*
case kAttribute::Default: case kAttribute::Default:
m_current_index = attr->IntValue(); m_current_index = attr->IntValue();
break; break;
default:
break;
} }
} }

View File

@@ -72,6 +72,10 @@ void NodeDialogBrowse::init_controls()
auto names = Asset::list_files(data_path, false, ".*\\.ppi"); auto names = Asset::list_files(data_path, false, ".*\\.ppi");
for (const auto& n : names) for (const auto& n : names)
{ {
ui::Image thumb = ui::Canvas::I->thumbnail_read(data_path + "/" + n);
if (thumb.width == 0 || thumb.height == 0)
continue;
auto node = new NodeDialogBrowseItem; auto node = new NodeDialogBrowseItem;
node->m_manager = m_manager; node->m_manager = m_manager;
node->init(); node->init();
@@ -90,7 +94,6 @@ void NodeDialogBrowse::init_controls()
}; };
// load thumb // load thumb
ui::Image thumb = ui::Canvas::I->thumbnail_read(node->m_path);
auto image_tex = node->find<NodeImageTexture>("thumb-tex"); auto image_tex = node->find<NodeImageTexture>("thumb-tex");
image_tex->tex.destroy(); image_tex->tex.destroy();
image_tex->tex.create(thumb); image_tex->tex.create(thumb);

View File

@@ -30,7 +30,7 @@ kEventResult NodeScroll::handle_event(Event* e)
NodeBorder::handle_event(e); NodeBorder::handle_event(e);
auto me = static_cast<MouseEvent*>(e); auto me = static_cast<MouseEvent*>(e);
auto ge = static_cast<GestureEvent*>(e); auto ge = static_cast<GestureEvent*>(e);
auto loc = (me->m_pos - m_pos) * root()->m_zoom; //auto loc = (me->m_pos - m_pos) * root()->m_zoom;
switch (e->m_type) switch (e->m_type)
{ {
case kEventType::MouseDownL: case kEventType::MouseDownL:

View File

@@ -293,7 +293,7 @@ bool ui::HeightmapPlane::create(float w, float h, const Image& img, float scale)
// generate indices // generate indices
for (int y = 0; y <= div; y++) for (int y = 0; y <= div; y++)
{ {
int i = y * (div + 1); //int i = y * (div + 1);
for (int x = 0; x <= div; x++) for (int x = 0; x <= div; x++)
{ {
if (x < div) if (x < div)

View File

@@ -15,7 +15,7 @@ public:
void assign(GLuint tex, int w = -1, int h = -1, GLuint internal_format = GL_RGBA8, GLuint format = GL_RGBA); void assign(GLuint tex, int w = -1, int h = -1, GLuint internal_format = GL_RGBA8, GLuint format = GL_RGBA);
bool load(std::string filename); bool load(std::string filename);
bool load_file(std::string filename); bool load_file(std::string filename);
void destroy() { if (m_tex) LOG("TEX destroy %d", m_tex); glDeleteTextures(1, &m_tex); } void destroy() { if (m_tex) LOG("TEX destroy %d", m_tex); glDeleteTextures(1, &m_tex); m_tex = 0; }
void bind() const { glBindTexture(GL_TEXTURE_2D, m_tex); } void bind() const { glBindTexture(GL_TEXTURE_2D, m_tex); }
void unbind() const { glBindTexture(GL_TEXTURE_2D, 0); } void unbind() const { glBindTexture(GL_TEXTURE_2D, 0); }
void update(const uint8_t* data); void update(const uint8_t* data);