Ensure big screen while demo playing

This commit is contained in:
Simon 2016-03-05 14:12:42 +00:00
parent 9470d19e61
commit cb484b0058
2 changed files with 12 additions and 4 deletions

View file

@ -264,13 +264,15 @@ JNIEXPORT jint JNICALL Java_doom_util_Natives_setVideoMode
extern gamestate_t gamestate;
extern boolean menuactive;
extern boolean demoplayback;
JNIEXPORT jint JNICALL Java_doom_util_Natives_gameState
(JNIEnv * env, jclass cls)
{
return (int)gamestate +
(int) automapmode +
menuactive ? 1 : 0;
menuactive ? 1 : 0 +
demoplayback ? 1 : 0;
}
/**

View file

@ -294,6 +294,7 @@ public class MainActivity
bmp.recycle();
}
long prevState = 0;
@Override
public void onNewFrame(HeadTransform headTransform) {
@ -323,10 +324,17 @@ public class MainActivity
}
if (mDVRInitialised) {
if (Natives.gameState() == 0)
long newState = Natives.gameState();
if (newState == 0)
Natives.DoomStartFrame(pitch, yaw, roll);
else
Natives.DoomStartFrame(0, 0, 0);
if (newState != prevState)
{
prevState = newState;
cardboardView.resetHeadTracker();
}
}
}
@ -481,8 +489,6 @@ public class MainActivity
Natives.keyEvent(Natives.EV_KEYDOWN, DoomTools.KEY_ENTER);
}
cardboardView.resetHeadTracker();
dismissSplashScreen();
triggerTimeout = System.currentTimeMillis();