From 699cf220236f45489b1fbc7e820f3720d64b3161 Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Thu, 17 Sep 2020 21:31:23 -0400 Subject: [PATCH] [ion/simulator] Don't enable the framebuffer in headless mode A quick test on a state file with 64k events took 2.5 seconds to process with the framebuffer vs 1.9 without. --- ion/src/simulator/shared/display.cpp | 1 + ion/src/simulator/shared/framebuffer.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ion/src/simulator/shared/display.cpp b/ion/src/simulator/shared/display.cpp index a540fa008..798a68f0b 100644 --- a/ion/src/simulator/shared/display.cpp +++ b/ion/src/simulator/shared/display.cpp @@ -12,6 +12,7 @@ namespace Display { static SDL_Texture * sFramebufferTexture = nullptr; void init(SDL_Renderer * renderer) { + Framebuffer::setActive(true); Uint32 texturePixelFormat = SDL_PIXELFORMAT_RGB565; assert(sizeof(KDColor) == SDL_BYTESPERPIXEL(texturePixelFormat)); sFramebufferTexture = SDL_CreateTexture( diff --git a/ion/src/simulator/shared/framebuffer.cpp b/ion/src/simulator/shared/framebuffer.cpp index 75e45796d..714f3f3c8 100644 --- a/ion/src/simulator/shared/framebuffer.cpp +++ b/ion/src/simulator/shared/framebuffer.cpp @@ -14,7 +14,7 @@ * framebuffer to a PNG file. */ static KDColor sPixels[Ion::Display::Width * Ion::Display::Height]; -static bool sFrameBufferActive = true; +static bool sFrameBufferActive = false; namespace Ion { namespace Display {