create default paths on android
This commit is contained in:
@@ -286,6 +286,7 @@ JNIEXPORT void JNICALL Java_com_omixlab_panopainter_MainActivity_pickExternalCal
|
|||||||
LOG("data_path %s", file_path.c_str());
|
LOG("data_path %s", file_path.c_str());
|
||||||
App::I.data_path = file_path;
|
App::I.data_path = file_path;
|
||||||
App::I.work_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,
|
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)
|
jint wnd_w, jint wnd_h, jint rect_left, jint rect_top, jint rect_right, jint rect_bottom)
|
||||||
|
|||||||
@@ -64,6 +64,42 @@ public class MainActivity extends NativeActivity {
|
|||||||
else
|
else
|
||||||
Log.v("PanoPainterJava", "create path failed");
|
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());
|
pickExternalCallback(pano_dir.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -618,7 +618,6 @@ void App::update(float dt)
|
|||||||
if (dfbo != rfbo)
|
if (dfbo != rfbo)
|
||||||
LOG("DIFFERENT FB");
|
LOG("DIFFERENT FB");
|
||||||
|
|
||||||
glReadBuffer(GL_FRONT);
|
|
||||||
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
|
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data);
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(rec_mutex);
|
std::lock_guard<std::mutex> lock(rec_mutex);
|
||||||
|
|||||||
@@ -2719,7 +2719,7 @@ Layer::Snapshot Layer::snapshot()
|
|||||||
|
|
||||||
snap.image[i] = std::make_unique<uint8_t[]>(m_rtt[i].bytes());
|
snap.image[i] = std::make_unique<uint8_t[]>(m_rtt[i].bytes());
|
||||||
|
|
||||||
glReadBuffer(GL_BACK);
|
//glReadBuffer(GL_BACK);
|
||||||
m_rtt[i].bindFramebuffer();
|
m_rtt[i].bindFramebuffer();
|
||||||
glm::vec2 box_sz = zw(m_dirty_box[i]) - xy(m_dirty_box[i]);
|
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());
|
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());
|
||||||
|
|||||||
Reference in New Issue
Block a user