[ioquake3] 01/05: Imported Upstream version 1.36+u20150228+dfsg1

Simon McVittie smcv at debian.org
Fri Mar 13 01:04:03 UTC 2015


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian-experimental
in repository ioquake3.

commit 3c1073c0af7a44c050f0b9dc07fe71ed18032eb2
Author: Simon McVittie <smcv at debian.org>
Date:   Thu Mar 12 21:44:56 2015 +0000

    Imported Upstream version 1.36+u20150228+dfsg1
---
 Makefile                     |  9 ++++++
 code/cgame/cg_consolecmds.c  |  2 +-
 code/client/snd_openal.c     |  2 +-
 code/game/ai_main.c          |  3 +-
 code/renderergl1/tr_shader.c |  2 +-
 code/renderergl2/tr_fbo.c    |  3 --
 code/renderergl2/tr_shader.c |  2 +-
 code/sdl/sdl_input.c         | 25 ++++++++++++----
 code/server/sv_bot.c         |  6 ++--
 code/sys/con_win32.c         | 70 +++++++++++++++++++++++++++++++++++++++-----
 10 files changed, 101 insertions(+), 23 deletions(-)

diff --git a/Makefile b/Makefile
index d4d4229..d0d2007 100644
--- a/Makefile
+++ b/Makefile
@@ -52,6 +52,10 @@ endif
 #############################################################################
 -include Makefile.local
 
+ifeq ($(COMPILE_PLATFORM),cygwin)
+  PLATFORM=mingw32
+endif
+
 ifndef PLATFORM
 PLATFORM=$(COMPILE_PLATFORM)
 endif
@@ -584,6 +588,11 @@ ifeq ($(PLATFORM),mingw32)
     TOOLS_BINEXT=.exe
   endif
 
+  ifeq ($(COMPILE_PLATFORM),cygwin)
+    TOOLS_BINEXT=.exe
+    TOOLS_CC=$(CC)
+  endif
+
   LIBS= -lws2_32 -lwinmm -lpsapi
   # clang 3.4 doesn't support this
   ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++"))
diff --git a/code/cgame/cg_consolecmds.c b/code/cgame/cg_consolecmds.c
index 4c9affa..4c8b075 100644
--- a/code/cgame/cg_consolecmds.c
+++ b/code/cgame/cg_consolecmds.c
@@ -358,7 +358,7 @@ static void CG_TauntDeathInsult_f (void ) {
 }
 
 static void CG_TauntGauntlet_f (void ) {
-	trap_SendConsoleCommand("cmd vsay kill_guantlet\n");
+	trap_SendConsoleCommand("cmd vsay kill_gauntlet\n");
 }
 
 static void CG_TaskSuicide_f (void ) {
diff --git a/code/client/snd_openal.c b/code/client/snd_openal.c
index 516368a..d6498a9 100644
--- a/code/client/snd_openal.c
+++ b/code/client/snd_openal.c
@@ -2115,7 +2115,7 @@ void S_AL_StartBackgroundTrack( const char *intro, const char *loop )
 		issame = qfalse;
 
 	// Copy the loop over
-	strncpy( s_backgroundLoop, loop, sizeof( s_backgroundLoop ) );
+	Q_strncpyz( s_backgroundLoop, loop, sizeof( s_backgroundLoop ) );
 
 	if(!issame)
 	{
diff --git a/code/game/ai_main.c b/code/game/ai_main.c
index 9c6fe3a..48958d8 100644
--- a/code/game/ai_main.c
+++ b/code/game/ai_main.c
@@ -149,7 +149,8 @@ void BotAI_Trace(bsp_trace_t *bsptrace, vec3_t start, vec3_t mins, vec3_t maxs,
 	VectorCopy(trace.plane.normal, bsptrace->plane.normal);
 	bsptrace->plane.signbits = trace.plane.signbits;
 	bsptrace->plane.type = trace.plane.type;
-	bsptrace->surface.value = trace.surfaceFlags;
+	bsptrace->surface.value = 0;
+	bsptrace->surface.flags = trace.surfaceFlags;
 	bsptrace->ent = trace.entityNum;
 	bsptrace->exp_dist = 0;
 	bsptrace->sidenum = 0;
diff --git a/code/renderergl1/tr_shader.c b/code/renderergl1/tr_shader.c
index 43b2beb..525ac3c 100644
--- a/code/renderergl1/tr_shader.c
+++ b/code/renderergl1/tr_shader.c
@@ -1459,7 +1459,7 @@ static qboolean ParseShader( char **text )
 		else if ( token[0] == '{' )
 		{
 			if ( s >= MAX_SHADER_STAGES ) {
-				ri.Printf( PRINT_WARNING, "WARNING: too many stages in shader %s\n", shader.name );
+				ri.Printf( PRINT_WARNING, "WARNING: too many stages in shader %s (max is %i)\n", shader.name, MAX_SHADER_STAGES );
 				return qfalse;
 			}
 
diff --git a/code/renderergl2/tr_fbo.c b/code/renderergl2/tr_fbo.c
index c5c641f..f02e6cc 100644
--- a/code/renderergl2/tr_fbo.c
+++ b/code/renderergl2/tr_fbo.c
@@ -653,9 +653,6 @@ void R_FBOList_f(void)
 	ri.Printf(PRINT_ALL, " %i FBOs\n", tr.numFBOs);
 }
 
-// FIXME
-extern void RB_SetGL2D (void);
-
 void FBO_BlitFromTexture(struct image_s *src, ivec4_t inSrcBox, vec2_t inSrcTexScale, FBO_t *dst, ivec4_t inDstBox, struct shaderProgram_s *shaderProgram, vec4_t inColor, int blend)
 {
 	ivec4_t dstBox, srcBox;
diff --git a/code/renderergl2/tr_shader.c b/code/renderergl2/tr_shader.c
index 7ead2e5..8d7ed54 100644
--- a/code/renderergl2/tr_shader.c
+++ b/code/renderergl2/tr_shader.c
@@ -1714,7 +1714,7 @@ static qboolean ParseShader( char **text )
 		else if ( token[0] == '{' )
 		{
 			if ( s >= MAX_SHADER_STAGES ) {
-				ri.Printf( PRINT_WARNING, "WARNING: too many stages in shader %s\n", shader.name );
+				ri.Printf( PRINT_WARNING, "WARNING: too many stages in shader %s (max is %i)\n", shader.name, MAX_SHADER_STAGES );
 				return qfalse;
 			}
 
diff --git a/code/sdl/sdl_input.c b/code/sdl/sdl_input.c
index 46f9546..b4cd3bb 100644
--- a/code/sdl/sdl_input.c
+++ b/code/sdl/sdl_input.c
@@ -802,7 +802,11 @@ static void IN_ProcessEvents( void )
 
 			case SDL_MOUSEMOTION:
 				if( mouseActive )
+				{
+					if( !e.motion.xrel && !e.motion.yrel )
+						break;
 					Com_QueueEvent( 0, SE_MOUSE, e.motion.xrel, e.motion.yrel, 0, NULL );
+				}
 				break;
 
 			case SDL_MOUSEBUTTONDOWN:
@@ -845,11 +849,19 @@ static void IN_ProcessEvents( void )
 				{
 					case SDL_WINDOWEVENT_RESIZED:
 						{
-							char width[32], height[32];
-							Com_sprintf( width, sizeof( width ), "%d", e.window.data1 );
-							Com_sprintf( height, sizeof( height ), "%d", e.window.data2 );
-							Cvar_Set( "r_customwidth", width );
-							Cvar_Set( "r_customheight", height );
+							int width, height;
+
+							width = e.window.data1;
+							height = e.window.data2;
+
+							// check if size actually changed
+							if( cls.glconfig.vidWidth == width && cls.glconfig.vidHeight == height )
+							{
+								break;
+							}
+
+							Cvar_SetValue( "r_customwidth", width );
+							Cvar_SetValue( "r_customheight", height );
 							Cvar_Set( "r_mode", "-1" );
 
 							// Wait until user stops dragging for 1 second, so
@@ -883,7 +895,6 @@ void IN_Frame( void )
 	qboolean loading;
 
 	IN_JoyMove( );
-	IN_ProcessEvents( );
 
 	// If not DISCONNECTED (main menu) or ACTIVE (in game), we're loading
 	loading = ( clc.state != CA_DISCONNECTED && clc.state != CA_ACTIVE );
@@ -906,6 +917,8 @@ void IN_Frame( void )
 	else
 		IN_ActivateMouse( );
 
+	IN_ProcessEvents( );
+
 	// In case we had to delay actual restart of video system
 	if( ( vidRestartTime != 0 ) && ( vidRestartTime < Sys_Milliseconds( ) ) )
 	{
diff --git a/code/server/sv_bot.c b/code/server/sv_bot.c
index eb7089e..d92dfca 100644
--- a/code/server/sv_bot.c
+++ b/code/server/sv_bot.c
@@ -188,7 +188,8 @@ static void BotImport_Trace(bsp_trace_t *bsptrace, vec3_t start, vec3_t mins, ve
 	VectorCopy(trace.plane.normal, bsptrace->plane.normal);
 	bsptrace->plane.signbits = trace.plane.signbits;
 	bsptrace->plane.type = trace.plane.type;
-	bsptrace->surface.value = trace.surfaceFlags;
+	bsptrace->surface.value = 0;
+	bsptrace->surface.flags = trace.surfaceFlags;
 	bsptrace->ent = trace.entityNum;
 	bsptrace->exp_dist = 0;
 	bsptrace->sidenum = 0;
@@ -213,7 +214,8 @@ static void BotImport_EntityTrace(bsp_trace_t *bsptrace, vec3_t start, vec3_t mi
 	VectorCopy(trace.plane.normal, bsptrace->plane.normal);
 	bsptrace->plane.signbits = trace.plane.signbits;
 	bsptrace->plane.type = trace.plane.type;
-	bsptrace->surface.value = trace.surfaceFlags;
+	bsptrace->surface.value = 0;
+	bsptrace->surface.flags = trace.surfaceFlags;
 	bsptrace->ent = trace.entityNum;
 	bsptrace->exp_dist = 0;
 	bsptrace->sidenum = 0;
diff --git a/code/sys/con_win32.c b/code/sys/con_win32.c
index 454012e..e273ff0 100644
--- a/code/sys/con_win32.c
+++ b/code/sys/con_win32.c
@@ -44,6 +44,7 @@ static int qconsole_history_oldest = 0;
 static char qconsole_line[ MAX_EDIT_LINE ];
 static int qconsole_linelen = 0;
 static qboolean qconsole_drawinput = qtrue;
+static int qconsole_cursor;
 
 static HANDLE qconsole_hout;
 static HANDLE qconsole_hin;
@@ -139,6 +140,7 @@ static void CON_HistPrev( void )
 	Q_strncpyz( qconsole_line, qconsole_history[ qconsole_history_pos ], 
 		sizeof( qconsole_line ) );
 	qconsole_linelen = strlen( qconsole_line );
+	qconsole_cursor = qconsole_linelen;
 }
 
 /*
@@ -163,6 +165,7 @@ static void CON_HistNext( void )
 		qconsole_history_pos = pos;
 		qconsole_line[ 0 ] = '\0';
 		qconsole_linelen = 0;
+		qconsole_cursor = qconsole_linelen;
 		return;
 	}
 
@@ -170,6 +173,7 @@ static void CON_HistNext( void )
 	Q_strncpyz( qconsole_line, qconsole_history[ qconsole_history_pos ],
 		sizeof( qconsole_line ) );
 	qconsole_linelen = strlen( qconsole_line );
+	qconsole_cursor = qconsole_linelen;
 }
 
 
@@ -233,7 +237,11 @@ static void CON_Show( void )
 
 	// set curor position
 	cursorPos.Y = binfo.dwCursorPosition.Y;
-	cursorPos.X = qconsole_linelen > binfo.srWindow.Right ? binfo.srWindow.Right : qconsole_linelen;
+	cursorPos.X = qconsole_cursor < qconsole_linelen
+					? qconsole_cursor
+					: qconsole_linelen > binfo.srWindow.Right
+						? binfo.srWindow.Right
+						: qconsole_linelen;
 
 	SetConsoleCursorPosition( qconsole_hout, cursorPos );
 }
@@ -358,6 +366,7 @@ char *CON_Input( void )
 		if( key == VK_RETURN )
 		{
 			newlinepos = i;
+			qconsole_cursor = 0;
 			break;
 		}
 		else if( key == VK_UP )
@@ -370,6 +379,34 @@ char *CON_Input( void )
 			CON_HistNext();
 			break;
 		}
+		else if( key == VK_LEFT )
+		{
+			qconsole_cursor--;
+			if ( qconsole_cursor < 0 )
+			{
+				qconsole_cursor = 0;
+			}
+			break;
+		}
+		else if( key == VK_RIGHT )
+		{
+			qconsole_cursor++;
+			if ( qconsole_cursor > qconsole_linelen )
+			{
+				qconsole_cursor = qconsole_linelen;
+			}
+			break;
+		}
+		else if( key == VK_HOME )
+		{
+			qconsole_cursor = 0;
+			break;
+		}
+		else if( key == VK_END )
+		{
+			qconsole_cursor = qconsole_linelen;
+			break;
+		}
 		else if( key == VK_TAB )
 		{
 			field_t f;
@@ -380,6 +417,7 @@ char *CON_Input( void )
 			Q_strncpyz( qconsole_line, f.buffer,
 				sizeof( qconsole_line ) );
 			qconsole_linelen = strlen( qconsole_line );
+			qconsole_cursor = qconsole_linelen;
 			break;
 		}
 
@@ -389,15 +427,33 @@ char *CON_Input( void )
 
 			if( key == VK_BACK )
 			{
-				int pos = ( qconsole_linelen > 0 ) ?
-					qconsole_linelen - 1 : 0; 
-
-				qconsole_line[ pos ] = '\0';
-				qconsole_linelen = pos;
+				if ( qconsole_cursor > 0 )
+				{
+					int newlen = ( qconsole_linelen > 0 ) ? qconsole_linelen - 1 : 0;
+					if ( qconsole_cursor < qconsole_linelen )
+					{
+						memmove( qconsole_line + qconsole_cursor - 1,
+									qconsole_line + qconsole_cursor,
+									qconsole_linelen - qconsole_cursor );
+					}
+
+					qconsole_line[ newlen ] = '\0';
+					qconsole_linelen = newlen;
+					qconsole_cursor--;
+				}
 			}
 			else if( c )
 			{
-				qconsole_line[ qconsole_linelen++ ] = c;
+				if ( qconsole_linelen > qconsole_cursor )
+				{
+					memmove( qconsole_line + qconsole_cursor + 1,
+								qconsole_line + qconsole_cursor,
+								qconsole_linelen - qconsole_cursor );
+				}
+
+				qconsole_line[ qconsole_cursor++ ] = c;
+
+				qconsole_linelen++;
 				qconsole_line[ qconsole_linelen ] = '\0'; 
 			}
 		}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git



More information about the Pkg-games-commits mailing list