about summary refs log tree commit diff
path: root/src/engine/client/graphics_threaded.h
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2012-01-01 14:15:35 +0100
committerMagnus Auvinen <magnus.auvinen@gmail.com>2012-01-01 14:15:35 +0100
commitd7fe3ddaab7662cd53db7a1e272ad64c2ba861ae (patch)
tree3087d15b8bef4a3ae04e82ee3b48b06f71520309 /src/engine/client/graphics_threaded.h
parentc1942ca6cbafb605e3ebc8e8cfabf982144f388f (diff)
downloadzcatch-d7fe3ddaab7662cd53db7a1e272ad64c2ba861ae.tar.gz
zcatch-d7fe3ddaab7662cd53db7a1e272ad64c2ba861ae.zip
fixed shutdown and screenshot functionallity
Diffstat (limited to 'src/engine/client/graphics_threaded.h')
-rw-r--r--src/engine/client/graphics_threaded.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/engine/client/graphics_threaded.h b/src/engine/client/graphics_threaded.h
index 1ea84ea9..1e69674d 100644
--- a/src/engine/client/graphics_threaded.h
+++ b/src/engine/client/graphics_threaded.h
@@ -124,7 +124,7 @@ public:
 		SPoint m_Pos;
 		STexCoord m_Tex;
 		SColor m_Color;
-	} ;
+	};
 
 	struct SCommand
 	{
@@ -198,8 +198,7 @@ public:
 	struct SCommand_Screenshot : public SCommand
 	{
 		SCommand_Screenshot() : SCommand(CMD_SCREENSHOT) {}
-
-		CImageInfo *m_pImage; // processor will fill this out
+		CImageInfo *m_pImage; // processor will fill this out, the one who adds this command must free the data as well
 	};
 
 	struct SCommand_Swap : public SCommand
@@ -307,6 +306,8 @@ class CCommandProcessorHandler
 public:
 	CCommandProcessorHandler();
 	void Start(ICommandProcessor *pProcessor);
+	void Stop();
+
 	void RunBuffer(CCommandBuffer *pBuffer);
 	bool IsIdle() const { return m_pBuffer == 0; }
 	void WaitForIdle();
@@ -316,6 +317,7 @@ class CGraphics_Threaded : public IEngineGraphics
 {
 	CCommandBuffer::SState m_State;
 	CCommandProcessorHandler m_Handler;
+	ICommandProcessor *m_pProcessor;
 
 	CCommandBuffer *m_apCommandBuffers[2];
 	CCommandBuffer *m_pCommandBuffer;
@@ -361,13 +363,15 @@ class CGraphics_Threaded : public IEngineGraphics
 	int m_FirstFreeTexture;
 	int m_TextureMemoryUsage;
 
-	void Flush();
+	void FlushVertices();
 	void AddVertices(int Count);
 	void Rotate4(const CCommandBuffer::SPoint &rCenter, CCommandBuffer::SVertex *pPoints);
 
 	static unsigned char Sample(int w, int h, const unsigned char *pData, int u, int v, int Offset, int ScaleW, int ScaleH, int Bpp);
 	static unsigned char *Rescale(int Width, int Height, int NewWidth, int NewHeight, int Format, const unsigned char *pData);
 
+	void KickCommandBuffer();
+
 	int IssueInit();
 	int InitWindow();
 public: