diff --git a/PanoPainter.xcodeproj/project.pbxproj b/PanoPainter.xcodeproj/project.pbxproj index 08b572d..8b7e7ac 100644 --- a/PanoPainter.xcodeproj/project.pbxproj +++ b/PanoPainter.xcodeproj/project.pbxproj @@ -106,6 +106,8 @@ AD3087C82061D1CD009F9260 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD3087C72061D1CD009F9260 /* CoreGraphics.framework */; }; AD30D82F1F783E0100B6A112 /* libcurl.4.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = AD30D82E1F783E0100B6A112 /* libcurl.4.tbd */; }; 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 */; }; 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 */; }; @@ -324,6 +326,8 @@ AD4C08D61E89BD0F0051D85F /* canvas.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = canvas.h; sourceTree = ""; }; AD4C08D71E89BD0F0051D85F /* rtt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rtt.cpp; sourceTree = ""; }; AD4C08D81E89BD0F0051D85F /* rtt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rtt.h; sourceTree = ""; }; + AD4CEF122156B2C50097F4BD /* node_about.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = node_about.cpp; sourceTree = ""; }; + AD4CEF132156B2C50097F4BD /* node_about.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = node_about.h; sourceTree = ""; }; AD58E0521E107411006ACC15 /* main.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; path = main.cpp; sourceTree = ""; }; 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; }; @@ -524,6 +528,8 @@ AD3B1EBF1E3B8B7600E918E3 /* layout.h */, AD10637D1EC7ADFA002A525F /* node.cpp */, AD10637E1EC7ADFA002A525F /* node.h */, + AD4CEF122156B2C50097F4BD /* node_about.cpp */, + AD4CEF132156B2C50097F4BD /* node_about.h */, AD1063511EC7ADFA002A525F /* node_border.cpp */, AD1063521EC7ADFA002A525F /* node_border.h */, AD1063531EC7ADFA002A525F /* node_button_custom.cpp */, @@ -1141,6 +1147,7 @@ ADBC8C581FAFD05A0094B339 /* node_dialog_cloud.cpp in Sources */, AD0E5CC91ECC72AD00C35669 /* node_settings.cpp in Sources */, AD0E5CBB1ECC72AD00C35669 /* node_button.cpp in Sources */, + AD4CEF152156B2DA0097F4BD /* node_about.cpp in Sources */, AD0E5CD41ECC72AD00C35669 /* app_shaders.cpp in Sources */, AD0E5CD91ECC72AD00C35669 /* canvas.cpp in Sources */, ADE4911E1F86E65E00FB8E92 /* sweep_context.cc in Sources */, @@ -1223,6 +1230,7 @@ AD1063A81EC7AE92002A525F /* node_slider.cpp in Sources */, ADD7D2A21EBF9E1C00D5A897 /* util.cpp in Sources */, ADD7D2791EBF9AE300D5A897 /* GameViewController.m in Sources */, + AD4CEF142156B2C60097F4BD /* node_about.cpp in Sources */, ADD7D26F1EBF9AE300D5A897 /* main.m in Sources */, ADC0EB431FC36E88004079BB /* node_dialog_picker.cpp in Sources */, ADD7D2A01EBF9E1C00D5A897 /* image.cpp in Sources */, diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index c260002..79e4234 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -7,7 +7,7 @@ diff --git a/android/src/main/res/drawable-hdpi/ic_launcher.png b/android/src/main/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index da59fd1..0000000 Binary files a/android/src/main/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/android/src/main/res/drawable-ldpi/ic_launcher.png b/android/src/main/res/drawable-ldpi/ic_launcher.png deleted file mode 100644 index d81dca2..0000000 Binary files a/android/src/main/res/drawable-ldpi/ic_launcher.png and /dev/null differ diff --git a/android/src/main/res/drawable-mdpi/ic_launcher.png b/android/src/main/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 584c4bc..0000000 Binary files a/android/src/main/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/android/src/main/res/drawable-xhdpi/ic_launcher.png b/android/src/main/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index ee9b6ff..0000000 Binary files a/android/src/main/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/android/src/main/res/mipmap-hdpi/ic_launcher.png b/android/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100755 index 0000000..ab31dc7 Binary files /dev/null and b/android/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/android/src/main/res/mipmap-mdpi/ic_launcher.png b/android/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100755 index 0000000..dd71109 Binary files /dev/null and b/android/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/android/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100755 index 0000000..d5af660 Binary files /dev/null and b/android/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/android/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100755 index 0000000..4536078 Binary files /dev/null and b/android/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100755 index 0000000..430c04a Binary files /dev/null and b/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/icon.png b/icon.png index 42965fa..562e962 100644 Binary files a/icon.png and b/icon.png differ diff --git a/src/app.cpp b/src/app.cpp index 7f13bb3..7e5485f 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -103,8 +103,6 @@ void App::initAssets() LOG("initializing assets create sampler"); sampler.create(GL_NEAREST); LOG("initializing assets load uvs texture"); - if (!tex.load("data/uvs.jpg")) - LOG("error loading image"); LOG("initializing assets completed"); } diff --git a/src/app.h b/src/app.h index ec5b1c7..a9628e3 100644 --- a/src/app.h +++ b/src/app.h @@ -47,7 +47,6 @@ public: std::deque> rec_frames; Sampler sampler; - Texture2D tex; LayoutManager layout; NodeMessageBox* msgbox; NodeSettings* settings; diff --git a/src/app_layout.cpp b/src/app_layout.cpp index 43bca3d..3f77db9 100644 --- a/src/app_layout.cpp +++ b/src/app_layout.cpp @@ -752,7 +752,7 @@ void App::initLayout() } int current_layer = (int)glm::clamp( - 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); layers->handle_layer_selected(l); layers->handle_layer_opacity(l, 1.f); diff --git a/src/brush.cpp b/src/brush.cpp index 4f3f6ec..79c03e1 100644 --- a/src/brush.cpp +++ b/src/brush.cpp @@ -187,7 +187,7 @@ std::vector ui::Stroke::compute_samples() LOG("Invalid sample"); samples.push_back(s); } - return std::move(samples); + return samples; } bool ui::Stroke::has_sample() { diff --git a/src/canvas.cpp b/src/canvas.cpp index 7d55451..48c35c5 100644 --- a/src/canvas.cpp +++ b/src/canvas.cpp @@ -799,7 +799,7 @@ void ui::Canvas::layer_remove(int idx) // m_order index i--; m_layers.erase(m_layers.begin() + n); m_order.erase(m_order.begin() + idx); - m_current_layer_idx = m_order[std::min(m_layers.size() - 1, idx)]; + m_current_layer_idx = m_order[std::min((int)m_layers.size() - 1, idx)]; } 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); xmp_section[0] = 0xff; xmp_section[1] = 0xe1; - xmp_section[2] = ((int)sizeof(xmp) + 2) >> 8; - xmp_section[3] = ((int)sizeof(xmp) + 2) >> 0; + xmp_section[2] = (uint8_t)((int)sizeof(xmp) + 2) >> 8; + xmp_section[3] = (uint8_t)((int)sizeof(xmp) + 2) >> 0; memcpy(xmp_section + 4, xmp, sizeof(xmp)); 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]); glActiveTexture(GL_TEXTURE0); - return std::move(image); + return image; } 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); fclose(fp); LOG("project thumbnail read from %s", data_path.c_str()); - return std::move(thumb); + return thumb; } void ui::Canvas::draw_objects(std::function observer, Layer& layer) @@ -2016,7 +2016,7 @@ std::vector ui::Canvas::triangulate(const std::vectorend ? nullptr : node->next; current->next = nullptr; } - LOG("poly %ld", outline.size()); + LOG("poly %zu", outline.size()); 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()); } counter++; - return std::move(snap); + return snap; } void ui::Layer::clear(const glm::vec4& c) diff --git a/src/canvas.h b/src/canvas.h index 2335b8f..b8175eb 100644 --- a/src/canvas.h +++ b/src/canvas.h @@ -235,7 +235,7 @@ public: { } - virtual Action* get_redo() + virtual Action* get_redo() override { auto redo = m_canvas->create_action(m_layer_idx); return redo; diff --git a/src/node.cpp b/src/node.cpp index 705296c..a816f2f 100644 --- a/src/node.cpp +++ b/src/node.cpp @@ -157,7 +157,7 @@ kEventResult Node::on_event(Event* e) break; GestureEvent* ge = static_cast(e); 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; if ((inside || m_mouse_captured) && handle_event(e) == kEventResult::Consumed) return kEventResult::Consumed; @@ -208,7 +208,9 @@ void Node::removed(Node* parent) const Node* Node::init_template(const char* id) { - const auto& m_template = static_cast((*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(top->m_children[0].get()); for (auto& c : m_template->m_children) { auto node = c->clone(); diff --git a/src/node_canvas.cpp b/src/node_canvas.cpp index c1bbbc1..36a5166 100644 --- a/src/node_canvas.cpp +++ b/src/node_canvas.cpp @@ -135,7 +135,7 @@ void NodeCanvas::draw() if (m_canvas->m_layers[layer_index].m_opacity == .0f) 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 * glm::scale(glm::vec3(z + 1)) * 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) { - static std::vector* old_mode = nullptr; Node::handle_event(e); MouseEvent* me = static_cast(e); KeyEvent* ke = static_cast(e); diff --git a/src/node_combobox.cpp b/src/node_combobox.cpp index f640226..af8813e 100644 --- a/src/node_combobox.cpp +++ b/src/node_combobox.cpp @@ -88,5 +88,7 @@ void NodeComboBox::parse_attributes(kAttribute ka, const tinyxml2::XMLAttribute* case kAttribute::Default: m_current_index = attr->IntValue(); break; + default: + break; } } diff --git a/src/node_dialog_browse.cpp b/src/node_dialog_browse.cpp index d8b3161..69d3bba 100644 --- a/src/node_dialog_browse.cpp +++ b/src/node_dialog_browse.cpp @@ -72,6 +72,10 @@ void NodeDialogBrowse::init_controls() auto names = Asset::list_files(data_path, false, ".*\\.ppi"); 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; node->m_manager = m_manager; node->init(); @@ -90,7 +94,6 @@ void NodeDialogBrowse::init_controls() }; // load thumb - ui::Image thumb = ui::Canvas::I->thumbnail_read(node->m_path); auto image_tex = node->find("thumb-tex"); image_tex->tex.destroy(); image_tex->tex.create(thumb); diff --git a/src/node_scroll.cpp b/src/node_scroll.cpp index 050e0e8..5aa2d60 100644 --- a/src/node_scroll.cpp +++ b/src/node_scroll.cpp @@ -30,7 +30,7 @@ kEventResult NodeScroll::handle_event(Event* e) NodeBorder::handle_event(e); auto me = static_cast(e); auto ge = static_cast(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) { case kEventType::MouseDownL: diff --git a/src/shape.cpp b/src/shape.cpp index 948ac4f..51e1a63 100644 --- a/src/shape.cpp +++ b/src/shape.cpp @@ -293,7 +293,7 @@ bool ui::HeightmapPlane::create(float w, float h, const Image& img, float scale) // generate indices for (int y = 0; y <= div; y++) { - int i = y * (div + 1); + //int i = y * (div + 1); for (int x = 0; x <= div; x++) { if (x < div) diff --git a/src/texture.h b/src/texture.h index db1448c..430f8b9 100644 --- a/src/texture.h +++ b/src/texture.h @@ -15,7 +15,7 @@ public: 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_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 unbind() const { glBindTexture(GL_TEXTURE_2D, 0); } void update(const uint8_t* data);