[retro-gtk] environment: Don't set unkown pixel formats
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] environment: Don't set unkown pixel formats
- Date: Sat, 19 Dec 2020 08:15:56 +0000 (UTC)
commit b6c78c07f2d14484c1ce2cf5ccfca171b24b95ae
Author: Adrien Plazas <kekun plazas laposte net>
Date: Thu Dec 17 19:32:33 2020 +0100
environment: Don't set unkown pixel formats
Instead log the critical error and return the failure.
retro-runner/retro-environment.c | 11 +++++++++++
1 file changed, 11 insertions(+)
---
diff --git a/retro-runner/retro-environment.c b/retro-runner/retro-environment.c
index 4fd5270..efb45db 100644
--- a/retro-runner/retro-environment.c
+++ b/retro-runner/retro-environment.c
@@ -407,6 +407,17 @@ static gboolean
set_pixel_format (RetroCore *self,
const RetroPixelFormat *pixel_format)
{
+ switch (*pixel_format) {
+ case RETRO_PIXEL_FORMAT_XRGB1555:
+ case RETRO_PIXEL_FORMAT_XRGB8888:
+ case RETRO_PIXEL_FORMAT_RGB565:
+ break;
+ default:
+ g_critical ("Couldn't set unknown pixel format %d", *pixel_format);
+
+ return FALSE;
+ }
+
self->pixel_format = *pixel_format;
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]