create default paths on android

This commit is contained in:
2019-02-03 15:56:45 +01:00
parent c2d526dec9
commit a193666f4a
4 changed files with 38 additions and 2 deletions

View File

@@ -286,6 +286,7 @@ JNIEXPORT void JNICALL Java_com_omixlab_panopainter_MainActivity_pickExternalCal
LOG("data_path %s", file_path.c_str());
App::I.data_path = file_path;
App::I.work_path = file_path;
App::I.rec_path = file_path + "/frames";
}
JNIEXPORT void JNICALL Java_com_omixlab_panopainter_MainActivity_contentRectChanged(JNIEnv *end, jobject,
jint wnd_w, jint wnd_h, jint rect_left, jint rect_top, jint rect_right, jint rect_bottom)

View File

@@ -64,6 +64,42 @@ public class MainActivity extends NativeActivity {
else
Log.v("PanoPainterJava", "create path failed");
}
File frames = new File(pano_dir.getAbsolutePath(), "frames");
if (!frames.exists())
{
if (frames.mkdirs())
Log.v("PanoPainterJava", "create path " + frames.getAbsolutePath());
else
Log.v("PanoPainterJava", "create path failed: " + frames.getAbsolutePath());
}
File brushes = new File(pano_dir.getAbsolutePath(), "brushes");
if (!brushes.exists())
{
if (brushes.mkdirs())
Log.v("PanoPainterJava", "create path " + brushes.getAbsolutePath());
else
Log.v("PanoPainterJava", "create path failed: " + brushes.getAbsolutePath());
}
File brush_thumbs = new File(brushes.getAbsolutePath(), "thumbs");
if (!brush_thumbs.exists())
{
if (brush_thumbs.mkdirs())
Log.v("PanoPainterJava", "create path " + brush_thumbs.getAbsolutePath());
else
Log.v("PanoPainterJava", "create path failed: " + brush_thumbs.getAbsolutePath());
}
File settings = new File(pano_dir.getAbsolutePath(), "settings");
if (!settings.exists())
{
if (settings.mkdirs())
Log.v("PanoPainterJava", "create path " + settings.getAbsolutePath());
else
Log.v("PanoPainterJava", "create path failed: " + settings.getAbsolutePath());
}
pickExternalCallback(pano_dir.getAbsolutePath());
}

View File

@@ -618,7 +618,6 @@ void App::update(float dt)
if (dfbo != rfbo)
LOG("DIFFERENT FB");
glReadBuffer(GL_FRONT);
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
{
std::lock_guard<std::mutex> lock(rec_mutex);

View File

@@ -2719,7 +2719,7 @@ Layer::Snapshot Layer::snapshot()
snap.image[i] = std::make_unique<uint8_t[]>(m_rtt[i].bytes());
glReadBuffer(GL_BACK);
//glReadBuffer(GL_BACK);
m_rtt[i].bindFramebuffer();
glm::vec2 box_sz = zw(m_dirty_box[i]) - xy(m_dirty_box[i]);
glReadPixels(m_dirty_box[i].x, m_dirty_box[i].y, box_sz.x, box_sz.y, GL_RGBA, GL_UNSIGNED_BYTE, snap.image[i].get());