@@ -221,57 +221,57 @@ void NativeEngine::gameLoop() {
221
221
// mApp->onInputEvent = _handle_input_proxy;
222
222
223
223
GameActivity_setWindowFlags (mApp ->activity ,
224
- AWINDOW_FLAG_KEEP_SCREEN_ON | AWINDOW_FLAG_TURN_SCREEN_ON |
225
- AWINDOW_FLAG_FULLSCREEN |
226
- AWINDOW_FLAG_SHOW_WHEN_LOCKED,
227
- 0 );
224
+ AWINDOW_FLAG_KEEP_SCREEN_ON | AWINDOW_FLAG_TURN_SCREEN_ON |
225
+ AWINDOW_FLAG_FULLSCREEN |
226
+ AWINDOW_FLAG_SHOW_WHEN_LOCKED,
227
+ 0 );
228
228
updateSystemBarOffset ();
229
229
230
230
while (1 ) {
231
231
int events;
232
232
struct android_poll_source *source;
233
- // If not animating, block until we get an event; if animating, don't block.
234
- while (( ALooper_pollAll ( isAnimating () ? 0 : - 1 , NULL , &events, ( void **) &source)) >= 0 ) {
235
-
236
- // process event
237
- if (source != NULL ) {
238
- source->process (mApp , source);
239
- }
240
-
241
- // are we exiting?
242
- if (mApp ->destroyRequested ) {
243
- return ;
244
- }
233
+
234
+ // If not animating, block until we get an event; if animating, don't block.
235
+ while (( ALooper_pollOnce ( isAnimating () ? 0 : - 1 , NULL , &events, ( void **) &source)) >= 0 ) {
236
+ // process event
237
+ if (source != NULL ) {
238
+ source->process (mApp , source);
239
+ }
240
+
241
+ // are we exiting?
242
+ if (mApp ->destroyRequested ) {
243
+ return ;
244
+ }
245
245
}
246
246
247
247
handleGameActivityInput ();
248
248
249
249
if (mApp ->textInputState ) {
250
- GameActivity_getTextInputState (mApp ->activity , [](void *context, const GameTextInputState *state) {
251
- if (!context || !state) return ;
250
+ GameActivity_getTextInputState (mApp ->activity , [](void *context, const GameTextInputState *state) {
251
+ if (!context || !state) return ;
252
252
253
- std::wstring_convert<std::codecvt_utf8_utf16<wchar_t >> convert;
254
- std::wstring utf16Text = convert.from_bytes (state->text_UTF8 );
253
+ std::wstring_convert<std::codecvt_utf8_utf16<wchar_t >> convert;
254
+ std::wstring utf16Text = convert.from_bytes (state->text_UTF8 );
255
255
256
- while (textInputBuffer.length () > utf16Text.length ()){
257
- textInputBuffer.pop_back ();
258
- Supernova::Engine::systemCharInput (' \b ' );
259
- }
256
+ while (textInputBuffer.length () > utf16Text.length ()){
257
+ textInputBuffer.pop_back ();
258
+ Supernova::Engine::systemCharInput (' \b ' );
259
+ }
260
260
261
- int pos = 0 ;
262
- while (textInputBuffer[pos] == utf16Text[pos] and pos < textInputBuffer.length ()){
263
- pos++;
264
- }
261
+ int pos = 0 ;
262
+ while (textInputBuffer[pos] == utf16Text[pos] and pos < textInputBuffer.length ()){
263
+ pos++;
264
+ }
265
265
266
- for (int i = pos; i < textInputBuffer.length (); i++){
267
- Supernova::Engine::systemCharInput (' \b ' );
268
- }
269
- for (int i = pos; i < utf16Text.length (); i++){
270
- Supernova::Engine::systemCharInput (utf16Text[i]);
271
- }
272
- textInputBuffer = utf16Text;
266
+ for (int i = pos; i < textInputBuffer.length (); i++){
267
+ Supernova::Engine::systemCharInput (' \b ' );
268
+ }
269
+ for (int i = pos; i < utf16Text.length (); i++){
270
+ Supernova::Engine::systemCharInput (utf16Text[i]);
271
+ }
272
+ textInputBuffer = utf16Text;
273
273
274
- }, this );
274
+ }, this );
275
275
mApp ->textInputState = 0 ;
276
276
}
277
277
0 commit comments