# HG changeset patch # User Michael Pavone # Date 1578376977 28800 # Node ID 33c0c4579c1fd66325d1c6933c699cf6209ac52c # Parent 55d034719345baf3a4033ba768ffabdda1ea11d2 Fix debug view window stuff that got broken when FRAMEBUFFER_UI got added diff -r 55d034719345 -r 33c0c4579c1f render_sdl.c --- a/render_sdl.c Mon Jan 06 18:36:36 2020 -0800 +++ b/render_sdl.c Mon Jan 06 22:02:57 2020 -0800 @@ -387,12 +387,11 @@ 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 @@ 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); }