summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software
diff options
context:
space:
mode:
authorScott Mansell <phiren@gmail.com>2013-11-24 00:52:17 +1300
committerScott Mansell <phiren@gmail.com>2013-11-24 00:52:17 +1300
commit43d1678fb2befa4bf72a54e2f86be600ada3018b (patch)
treea031aa718e02423738a099791b1e5f55d7c66fa8 /Source/Core/VideoBackends/Software
parentafe47ff8479ceb816e54aab2523cb6cccf046923 (diff)
Dynamically allocate color textures.
Saves ram when the video software backend isn't being used.
Diffstat (limited to 'Source/Core/VideoBackends/Software')
-rw-r--r--Source/Core/VideoBackends/Software/Src/SWRenderer.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/Software/Src/SWRenderer.cpp b/Source/Core/VideoBackends/Software/Src/SWRenderer.cpp
index 62d2970160..0970a633b9 100644
--- a/Source/Core/VideoBackends/Software/Src/SWRenderer.cpp
+++ b/Source/Core/VideoBackends/Software/Src/SWRenderer.cpp
@@ -20,7 +20,7 @@ static GLint attr_pos = -1, attr_tex = -1;
static GLint uni_tex = -1;
static GLuint program;
-static u8 s_xfbColorTexture[2][640*568*4];
+static u8 *s_xfbColorTexture[2];
static int s_currentColorTexture = 0;
static volatile bool s_bScreenshot;
@@ -41,6 +41,8 @@ void SWRenderer::Init()
void SWRenderer::Shutdown()
{
+ delete s_xfbColorTexture[0];
+ delete s_xfbColorTexture[1];
glDeleteProgram(program);
glDeleteTextures(1, &s_RenderTarget);
#ifndef USE_GLES
@@ -79,7 +81,9 @@ void CreateShaders()
void SWRenderer::Prepare()
{
- memset(s_xfbColorTexture, 0, sizeof(s_xfbColorTexture));
+ s_xfbColorTexture[0] = new u8[640*568*4];
+ s_xfbColorTexture[1] = new u8[640*568*4];
+
s_currentColorTexture = 0;
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);