@@ -280,24 +280,32 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data)
280
280
}
281
281
break ;
282
282
case GFX_CTL_FIND_PREV_DRIVER :
283
- return gfx_ctl_find_prev_driver ();
283
+ if (!gfx_ctl_find_prev_driver ())
284
+ return false;
285
+ break ;
284
286
case GFX_CTL_FIND_NEXT_DRIVER :
285
- return gfx_ctl_find_next_driver ();
287
+ if (!gfx_ctl_find_next_driver ())
288
+ return false;
289
+ break ;
286
290
case GFX_CTL_IMAGE_BUFFER_INIT :
287
291
if (!current_video_context || !current_video_context -> image_buffer_init )
288
292
return false;
289
- return current_video_context -> image_buffer_init (video_context_data ,
290
- (const video_info_t * )data );
293
+ if (!current_video_context -> image_buffer_init (video_context_data ,
294
+ (const video_info_t * )data ))
295
+ return false;
296
+ break ;
291
297
case GFX_CTL_IMAGE_BUFFER_WRITE :
292
298
{
293
299
gfx_ctx_image_t * img = (gfx_ctx_image_t * )data ;
294
300
295
301
if (!current_video_context || !current_video_context -> image_buffer_write )
296
302
return false;
297
- return current_video_context -> image_buffer_write (video_context_data ,
303
+ if (! current_video_context -> image_buffer_write (video_context_data ,
298
304
img -> frame , img -> width , img -> height , img -> pitch ,
299
- img -> rgb32 , img -> index , img -> handle );
305
+ img -> rgb32 , img -> index , img -> handle ))
306
+ return false;
300
307
}
308
+ break ;
301
309
case GFX_CTL_GET_VIDEO_OUTPUT_PREV :
302
310
if (!current_video_context
303
311
|| !current_video_context -> get_video_output_prev )
@@ -339,11 +347,15 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data)
339
347
case GFX_CTL_FOCUS :
340
348
if (!video_context_data || !current_video_context -> has_focus )
341
349
return false;
342
- return current_video_context -> has_focus (video_context_data );
350
+ if (!current_video_context -> has_focus (video_context_data ))
351
+ return false;
352
+ break ;
343
353
case GFX_CTL_HAS_WINDOWED :
344
354
if (!video_context_data )
345
355
return false;
346
- return current_video_context -> has_windowed (video_context_data );
356
+ if (!current_video_context -> has_windowed (video_context_data ))
357
+ return false;
358
+ break ;
347
359
case GFX_CTL_FREE :
348
360
if (current_video_context -> destroy )
349
361
current_video_context -> destroy (video_context_data );
@@ -383,10 +395,12 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data)
383
395
gfx_ctx_metrics_t * metrics = (gfx_ctx_metrics_t * )data ;
384
396
if (!current_video_context || !current_video_context -> get_metrics )
385
397
return false;
386
- return current_video_context -> get_metrics (video_context_data ,
398
+ if (! current_video_context -> get_metrics (video_context_data ,
387
399
metrics -> type ,
388
- metrics -> value );
400
+ metrics -> value ))
401
+ return false;
389
402
}
403
+ break ;
390
404
case GFX_CTL_INPUT_DRIVER :
391
405
{
392
406
gfx_ctx_input_t * inp = (gfx_ctx_input_t * )data ;
@@ -401,9 +415,11 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data)
401
415
bool * bool_data = (bool * )data ;
402
416
if (!video_context_data || !current_video_context )
403
417
return false;
404
- return current_video_context -> suppress_screensaver (
405
- video_context_data , * bool_data );
418
+ if (!current_video_context -> suppress_screensaver (
419
+ video_context_data , * bool_data ))
420
+ return false;
406
421
}
422
+ break ;
407
423
case GFX_CTL_IDENT_GET :
408
424
{
409
425
gfx_ctx_ident_t * ident = (gfx_ctx_ident_t * )data ;
@@ -417,18 +433,22 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data)
417
433
gfx_ctx_mode_t * mode_info = (gfx_ctx_mode_t * )data ;
418
434
if (!current_video_context || !current_video_context -> set_video_mode )
419
435
return false;
420
- return current_video_context -> set_video_mode (
436
+ if (! current_video_context -> set_video_mode (
421
437
video_context_data , mode_info -> width ,
422
- mode_info -> height , mode_info -> fullscreen );
438
+ mode_info -> height , mode_info -> fullscreen ))
439
+ return false;
423
440
}
441
+ break ;
424
442
case GFX_CTL_SET_RESIZE :
425
443
{
426
444
gfx_ctx_mode_t * mode_info = (gfx_ctx_mode_t * )data ;
427
445
if (!current_video_context )
428
446
return false;
429
- return current_video_context -> set_resize (
430
- video_context_data , mode_info -> width , mode_info -> height );
447
+ if (!current_video_context -> set_resize (
448
+ video_context_data , mode_info -> width , mode_info -> height ))
449
+ return false;
431
450
}
451
+ break ;
432
452
case GFX_CTL_GET_VIDEO_SIZE :
433
453
{
434
454
gfx_ctx_mode_t * mode_info = (gfx_ctx_mode_t * )data ;
0 commit comments