动画调整为30帧
This commit is contained in:
@@ -40,7 +40,7 @@ void android_main(struct android_app *pApp) {
|
||||
g_Application = &application;
|
||||
application.SetInitArg(g_InitArgString);
|
||||
pApp->onAppCmd = handle_cmd;
|
||||
|
||||
long long last_update_time = 0;
|
||||
android_app_set_motion_event_filter(pApp, nullptr);
|
||||
long long _lastDrawFrameTime = chrono::duration_cast<chrono::milliseconds>(chrono::system_clock::now().time_since_epoch()).count();
|
||||
do {
|
||||
@@ -77,10 +77,13 @@ void android_main(struct android_app *pApp) {
|
||||
application.drawFrame(frameTime);
|
||||
}
|
||||
auto end_time = chrono::duration_cast<chrono::milliseconds>(chrono::system_clock::now().time_since_epoch()).count();
|
||||
auto frameTime = end_time - last_update_time;
|
||||
last_update_time = end_time;
|
||||
auto function_time = (end_time - start_time);
|
||||
if(function_time < 20)
|
||||
aout << "function_time:" << function_time << " fps:" << (1000/frameTime) << std::endl;
|
||||
if(function_time < 35)
|
||||
{
|
||||
this_thread::sleep_for(chrono::milliseconds((20-function_time)));
|
||||
this_thread::sleep_for(chrono::milliseconds((35-function_time)));
|
||||
}
|
||||
} while (!pApp->destroyRequested);
|
||||
application.cleanup();
|
||||
|
||||
@@ -36,7 +36,7 @@ public class MainActivity extends FaceActivity
|
||||
motion.type = "11";
|
||||
motion.png_names.add("11.png");
|
||||
InitArg initArg = new InitArg();
|
||||
initArg.action_fps = 10;
|
||||
initArg.action_fps = 30;
|
||||
initArg.zoom = 1.5f;
|
||||
initArg.motion = motion;
|
||||
SetInitArg(initArg.toJson());
|
||||
|
||||
Reference in New Issue
Block a user