NyakoFox
6810c5fa8c
Fix #1223 (analogue mode segfault)
...
When `SDL_RenderReadPixels` fails for some reason, the game tries to
free the temporary source surface it creates. Unfortunately, it never
sets it to `NULL` after, so the next time the game tries to render the
filter, it'll try to work with a memory region that was already freed.
To fix this, I just replaced `SDL_FreeSurface(*src);` with
`VVV_freefunc(SDL_FreeSurface, *src);` which is a helper macro which
sets the pointer to NULL after freeing.
Now, there's a new issue -- since the temporary buffer is now NULL,
next frame we'll try to remake it! So I've introduced a static bool
which disables the filter entirely if `SDL_RenderReadPixels` fails.
Without this, it'd create and destroy a surface every frame, which
could lead to slowdown. (Not as slow as the filter when it DOES work,
but still...)
I also added a line which frees the second temporary surface... it's
weird that was missing in the first place, but I think reimplementing
analogue mode was one of the last things I did for the renderer
rewrite anyways.
Resolves #1223 .
2025-04-29 20:54:11 -04:00
..
2023-03-21 19:59:48 -07:00
2022-11-30 22:50:08 -08:00
2022-11-30 22:50:08 -08:00
2021-09-23 22:21:49 -07:00
2023-09-20 16:20:24 -07:00
2023-09-20 16:20:24 -07:00
2024-11-15 20:33:10 -05:00
2023-12-01 12:08:26 -05:00
2021-10-01 09:35:28 -07:00
2024-05-21 20:57:19 -07:00
2025-04-12 16:43:50 -04:00
2025-04-12 16:43:50 -04:00
2024-01-09 15:48:41 -08:00
2024-01-09 15:48:41 -08:00
2021-03-21 02:55:42 -04:00
2021-03-21 02:55:42 -04:00
2025-04-12 16:43:50 -04:00
2024-02-02 19:13:59 -08:00
2025-04-21 20:09:57 -04:00
2025-04-21 20:09:57 -04:00
2025-04-28 08:04:51 -04:00
2025-04-21 20:09:57 -04:00
2021-12-18 00:01:32 -08:00
2021-09-27 10:32:23 -07:00
2024-11-15 20:33:10 -05:00
2024-01-09 15:48:41 -08:00
2023-03-02 22:58:12 -08:00
2022-12-31 20:04:56 -08:00
2024-01-23 15:33:38 -08:00
2024-01-23 15:33:38 -08:00
2024-01-08 19:17:44 -08:00
2024-01-08 19:17:44 -08:00
2025-04-21 20:09:57 -04:00
2024-09-27 17:14:57 -07:00
2021-08-05 13:35:21 -04:00
2021-08-05 13:35:21 -04:00
2021-09-19 21:49:54 -07:00
2025-04-21 20:09:57 -04:00
2025-04-21 20:09:57 -04:00
2024-11-03 21:54:44 -08:00
2024-01-09 16:03:05 -08:00
2025-04-29 20:54:11 -04:00
2024-01-09 15:48:41 -08:00
2024-08-06 18:16:46 -07:00
2024-08-02 22:25:00 -07:00
2025-04-21 20:09:57 -04:00
2021-02-25 17:23:59 -05:00
2023-02-13 23:27:00 -08:00
2023-02-13 23:27:00 -08:00
2024-08-02 22:25:00 -07:00
2024-08-02 22:25:00 -07:00
2022-12-31 20:04:56 -08:00
2022-12-31 20:04:56 -08:00
2024-11-17 11:45:57 -05:00
2023-11-19 17:34:23 -08:00
2024-02-08 10:28:27 -08:00
2024-02-08 10:28:27 -08:00
2024-01-08 19:17:44 -08:00
2022-12-31 20:04:56 -08:00
2024-01-08 19:17:44 -08:00
2024-01-06 14:11:40 -08:00
2022-03-13 23:50:37 -07:00
2024-11-17 11:45:57 -05:00
2021-02-25 17:23:59 -05:00
2024-11-15 20:33:10 -05:00
2021-04-17 00:50:04 -04:00
2025-04-21 20:09:57 -04:00
2024-11-03 21:54:44 -08:00
2023-01-28 23:32:14 -08:00
2024-12-17 09:52:06 -05:00
2024-12-17 09:52:06 -05:00
2021-09-19 21:49:54 -07:00
2021-02-25 17:23:59 -05:00
2025-04-21 20:09:57 -04:00
2022-12-31 20:04:56 -08:00
2024-01-08 19:17:44 -08:00
2021-02-25 17:23:59 -05:00
2024-08-27 15:13:24 -07:00
2025-04-29 20:53:05 -04:00
2021-02-25 17:23:59 -05:00
2024-01-08 20:01:27 -08:00
2023-06-05 17:57:23 -07:00
2024-02-02 18:57:24 -08:00
2023-02-13 23:27:00 -08:00
2024-11-15 20:33:10 -05:00
2024-02-03 18:11:11 -08:00
2023-03-21 00:23:42 -07:00
2025-04-21 20:09:57 -04:00
2024-11-07 09:53:45 -08:00
2023-11-30 08:38:40 -08:00
2024-11-15 20:33:10 -05:00
2023-06-05 17:57:23 -07:00
2022-12-31 20:04:56 -08:00
2024-01-09 15:48:41 -08:00
2022-12-31 20:04:56 -08:00
2023-11-27 12:09:42 -05:00
2022-12-31 20:04:56 -08:00
2024-11-07 09:53:45 -08:00
2024-11-07 09:53:45 -08:00
2022-11-30 22:50:08 -08:00
2021-09-24 17:48:15 -07:00
2021-09-24 16:37:27 -07:00
2023-01-28 14:36:28 -08:00
2022-12-29 16:13:54 -08:00
2021-05-25 15:23:34 -04:00
2023-02-27 23:00:41 -08:00
2023-02-27 23:00:41 -08:00
2024-01-06 14:11:40 -08:00
2024-01-06 14:11:40 -08:00
2024-01-06 14:11:40 -08:00
2023-03-21 19:59:48 -07:00
2024-11-15 20:33:10 -05:00
2022-11-14 19:40:23 -08:00
2022-12-31 20:04:56 -08:00
2022-12-31 20:04:56 -08:00
2020-11-04 12:06:57 -05:00
2022-12-31 20:04:56 -08:00
2023-11-27 12:09:42 -05:00
2021-08-27 12:28:35 -07:00