Mercurial > repos > blastem
comparison render_sdl.c @ 1068:624696318b5b
Fix a memory corruption bug from failing to grow the buffer for the window caption when switching games
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 05 Aug 2016 22:24:43 -0700 |
parents | 4db1a2e5d8e6 |
children | 3a0f684891ae |
comparison
equal
deleted
inserted
replaced
1067:96db3e289ed1 | 1068:624696318b5b |
---|---|
232 { | 232 { |
233 free(context->framebuf); | 233 free(context->framebuf); |
234 } | 234 } |
235 | 235 |
236 char * caption = NULL; | 236 char * caption = NULL; |
237 char * fps_caption = NULL; | |
237 | 238 |
238 static void render_quit() | 239 static void render_quit() |
239 { | 240 { |
240 render_close_audio(); | 241 render_close_audio(); |
241 #ifdef DISABLE_OPENGL | 242 #ifdef DISABLE_OPENGL |
410 } | 411 } |
411 | 412 |
412 void render_update_caption(char *title) | 413 void render_update_caption(char *title) |
413 { | 414 { |
414 caption = title; | 415 caption = title; |
416 free(fps_caption); | |
417 fps_caption = NULL; | |
415 } | 418 } |
416 | 419 |
417 void render_context(vdp_context * context) | 420 void render_context(vdp_context * context) |
418 { | 421 { |
419 int width = context->regs[REG_MODE_4] & BIT_H40 ? 320.0f : 256.0f; | 422 int width = context->regs[REG_MODE_4] & BIT_H40 ? 320.0f : 256.0f; |
713 exit(0); | 716 exit(0); |
714 } | 717 } |
715 return 0; | 718 return 0; |
716 } | 719 } |
717 | 720 |
718 char * fps_caption = NULL; | |
719 | |
720 uint32_t frame_counter = 0; | 721 uint32_t frame_counter = 0; |
721 uint32_t start = 0; | 722 uint32_t start = 0; |
722 #ifdef __ANDROID__ | 723 #ifdef __ANDROID__ |
723 #define FPS_INTERVAL 10000 | 724 #define FPS_INTERVAL 10000 |
724 #else | 725 #else |