about summary refs log tree commit diff
path: root/src/engine/client
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2011-12-31 01:23:04 +0100
committerMagnus Auvinen <magnus.auvinen@gmail.com>2011-12-31 01:23:04 +0100
commit50e75da3334e77d027d5b10d85d4022c5dca0821 (patch)
tree5c1ec3f84173c34e244164f5207cbf7a2d64010d /src/engine/client
parent09b785a290c8394422b1334e5e07714c7e994521 (diff)
downloadzcatch-50e75da3334e77d027d5b10d85d4022c5dca0821.tar.gz
zcatch-50e75da3334e77d027d5b10d85d4022c5dca0821.zip
fixed so that the resolusion is set correctly on init
Diffstat (limited to 'src/engine/client')
-rw-r--r--src/engine/client/graphics_threaded.cpp23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/engine/client/graphics_threaded.cpp b/src/engine/client/graphics_threaded.cpp
index 66d17301..c98ab8b9 100644
--- a/src/engine/client/graphics_threaded.cpp
+++ b/src/engine/client/graphics_threaded.cpp
@@ -141,14 +141,8 @@ class CCommandProcessorFragment_SDL
 	// SDL stuff
 	SDL_Surface *m_pScreenSurface;
 
-	int m_ScreenWidth;
-	int m_ScreenHeight;
-
 	int TryInit()
 	{
-		m_ScreenWidth = g_Config.m_GfxScreenWidth;
-		m_ScreenHeight = g_Config.m_GfxScreenHeight;
-
 		const SDL_VideoInfo *pInfo = SDL_GetVideoInfo();
 		SDL_EventState(SDL_MOUSEMOTION, SDL_IGNORE);
 
@@ -187,7 +181,7 @@ class CCommandProcessorFragment_SDL
 		SDL_WM_SetCaption("Teeworlds", "Teeworlds");
 
 		// create window
-		m_pScreenSurface = SDL_SetVideoMode(m_ScreenWidth, m_ScreenHeight, 0, Flags);
+		m_pScreenSurface = SDL_SetVideoMode(g_Config.m_GfxScreenWidth, g_Config.m_GfxScreenHeight, 0, Flags);
 		if(m_pScreenSurface == NULL)
 		{
 			dbg_msg("gfx", "unable to set video mode: %s", SDL_GetError());
@@ -382,17 +376,6 @@ void CCommandProcessorHandler::WaitForIdle()
 		m_BufferDone.wait();
 }
 
-
-/*
-void RenderThread()
-{
-	.wait()
-	if(m_pCommandBuffer)
-		RunBuffer(m_pCommandBuffer);
-	// reset buffer?
-	m_pCommandBuffer = 0;
-}*/
-
 void CGraphics_Threaded::Flush()
 {
 	if(m_NumVertices == 0)
@@ -1088,6 +1071,10 @@ bool CGraphics_Threaded::Init()
 
 	if(Result == 0)
 	{
+		// fetch final resolusion
+		m_ScreenWidth = g_Config.m_GfxScreenWidth;
+		m_ScreenHeight = g_Config.m_GfxScreenHeight;
+
 		// create null texture, will get id=0
 		static const unsigned char aNullTextureData[] = {
 			0xff,0x00,0x00,0xff, 0xff,0x00,0x00,0xff, 0x00,0xff,0x00,0xff, 0x00,0xff,0x00,0xff,