summaryrefslogtreecommitdiff
path: root/src/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/Graphics.cpp9
-rw-r--r--src/graphics/Graphics.h3
-rw-r--r--src/graphics/Renderer.cpp17
-rw-r--r--src/graphics/Renderer.h2
4 files changed, 31 insertions, 0 deletions
diff --git a/src/graphics/Graphics.cpp b/src/graphics/Graphics.cpp
index eb92435..e7cce03 100644
--- a/src/graphics/Graphics.cpp
+++ b/src/graphics/Graphics.cpp
@@ -909,3 +909,12 @@ void Graphics::draw_image(VideoBuffer * vidBuf, int x, int y, int a)
draw_image(vidBuf->Buffer, x, y, vidBuf->Width, vidBuf->Height, a);
}
+VideoBuffer Graphics::DumpFrame()
+{
+#ifdef OGLI
+#else
+ VideoBuffer newBuffer(XRES+BARSIZE, YRES+MENUSIZE);
+ std::copy(vid, vid+((XRES+BARSIZE)*(YRES+MENUSIZE)), newBuffer.Buffer);
+ return newBuffer;
+#endif
+} \ No newline at end of file
diff --git a/src/graphics/Graphics.h b/src/graphics/Graphics.h
index e74239e..46d28b4 100644
--- a/src/graphics/Graphics.h
+++ b/src/graphics/Graphics.h
@@ -4,6 +4,7 @@
#include <string>
#include <cstdlib>
#include <cstring>
+#include <vector>
#if defined(OGLI)
#include "OpenGLHeaders.h"
#endif
@@ -135,6 +136,8 @@ public:
static int textwidth(const char *s);
static void textsize(const char * s, int & width, int & height);
+ VideoBuffer DumpFrame();
+
void Acquire();
void Release();
diff --git a/src/graphics/Renderer.cpp b/src/graphics/Renderer.cpp
index 11cf9c3..6c1a31b 100644
--- a/src/graphics/Renderer.cpp
+++ b/src/graphics/Renderer.cpp
@@ -2475,6 +2475,23 @@ unsigned int Renderer::GetColourMode()
return colour_mode;
}
+VideoBuffer Renderer::DumpFrame()
+{
+#ifdef OGLR
+#elif defined(OGLI)
+ VideoBuffer newBuffer(XRES, YRES);
+ std::copy(vid, vid+(XRES*YRES), newBuffer.Buffer);
+ return newBuffer;
+#else
+ VideoBuffer newBuffer(XRES, YRES);
+ for(int y = 0; y < YRES; y++)
+ {
+ std::copy(vid+(y*(XRES+BARSIZE)), vid+(y*(XRES+BARSIZE))+XRES, newBuffer.Buffer+(y*XRES));
+ }
+ return newBuffer;
+#endif
+}
+
Renderer::~Renderer()
{
#if !defined(OGLR)
diff --git a/src/graphics/Renderer.h b/src/graphics/Renderer.h
index 6691ef1..cc7debe 100644
--- a/src/graphics/Renderer.h
+++ b/src/graphics/Renderer.h
@@ -113,6 +113,8 @@ public:
void draw_image(pixel *img, int x, int y, int w, int h, int a);
#endif
+ VideoBuffer DumpFrame();
+
void drawblob(int x, int y, unsigned char cr, unsigned char cg, unsigned char cb);
//...
//Display mode modifiers