diff options
author | Michael Pavone <pavone@retrodev.com> | 2020-01-06 22:02:57 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2020-01-06 22:02:57 -0800 |
commit | 36a034f80522821f17ead286c58078cc90904a56 (patch) | |
tree | 40b5ca1f26974ac937fd6dacb32b2d3eaa201219 | |
parent | 929186f5ea6e5a8bb72a15b5ebe5acc7d045f084 (diff) |
Fix debug view window stuff that got broken when FRAMEBUFFER_UI got added
-rwxr-xr-x | render_sdl.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/render_sdl.c b/render_sdl.c index e362779..55b9a03 100755 --- a/render_sdl.c +++ b/render_sdl.c @@ -387,12 +387,11 @@ static void render_alloc_surfaces() if (texture_init) { return; } - sdl_textures= malloc(sizeof(SDL_Texture *) * 2); - num_textures = 2; + sdl_textures= calloc(sizeof(SDL_Texture *), 3); + num_textures = 3; texture_init = 1; #ifndef DISABLE_OPENGL if (render_gl) { - sdl_textures[0] = sdl_textures[1] = NULL; gl_setup(); } else { #endif @@ -1298,13 +1297,6 @@ uint32_t *render_get_framebuffer(uint8_t which, int *pitch) return texture_buf; } else { #endif - if (which == FRAMEBUFFER_UI && which >= num_textures) { - sdl_textures = realloc(sdl_textures, sizeof(*sdl_textures) * (FRAMEBUFFER_UI + 1)); - for (; num_textures <= FRAMEBUFFER_UI; num_textures++) - { - sdl_textures[num_textures] = NULL; - } - } if (which == FRAMEBUFFER_UI && !sdl_textures[which]) { sdl_textures[which] = SDL_CreateTexture(main_renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, main_width, main_height); } |