r1136 - in trunk/code: unix win32

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Aug 24 09:54:23 EDT 2007


Author: tma
Date: 2007-08-24 09:54:23 -0400 (Fri, 24 Aug 2007)
New Revision: 1136

Modified:
   trunk/code/unix/linux_glimp.c
   trunk/code/unix/linux_joystick.c
   trunk/code/unix/sdl_glimp.c
   trunk/code/win32/win_input.c
Log:
* Demote input related console information to developer only so that it doesn't
  spam the console every time input settings are changed


Modified: trunk/code/unix/linux_glimp.c
===================================================================
--- trunk/code/unix/linux_glimp.c	2007-08-24 11:10:41 UTC (rev 1135)
+++ trunk/code/unix/linux_glimp.c	2007-08-24 13:54:23 UTC (rev 1136)
@@ -1769,7 +1769,7 @@
 /*****************************************************************************/
 
 void IN_Init(void) {
-	Com_Printf ("\n------- Input Initialization -------\n");
+	Com_DPrintf ("\n------- Input Initialization -------\n");
   // mouse variables
   in_mouse = Cvar_Get ("in_mouse", "1", CVAR_ARCHIVE);
   in_dgamouse = Cvar_Get ("in_dgamouse", "1", CVAR_ARCHIVE);
@@ -1795,7 +1795,7 @@
     mouse_avail = qfalse;
 
   IN_StartupJoystick( ); // bk001130 - from cvs1.17 (mkv)
-	Com_Printf ("------------------------------------\n");
+	Com_DPrintf ("------------------------------------\n");
 }
 
 void IN_Shutdown(void)

Modified: trunk/code/unix/linux_joystick.c
===================================================================
--- trunk/code/unix/linux_joystick.c	2007-08-24 11:10:41 UTC (rev 1135)
+++ trunk/code/unix/linux_joystick.c	2007-08-24 13:54:23 UTC (rev 1136)
@@ -76,7 +76,7 @@
   joy_fd = -1;
 
   if( !in_joystick->integer ) {
-    Com_Printf( "Joystick is not active.\n" );
+    Com_DPrintf( "Joystick is not active.\n" );
     return;
   }
 
@@ -94,7 +94,7 @@
       char name[128];
       int n = -1;
 
-      Com_Printf( "Joystick %s found\n", filename );
+      Com_DPrintf( "Joystick %s found\n", filename );
 
       /* Get rid of initialization messages. */
       do {
@@ -114,9 +114,9 @@
 	strncpy( name, "Unknown", sizeof( name ) );
       }
 
-      Com_Printf( "Name:    %s\n", name );
-      Com_Printf( "Axes:    %d\n", axes );
-      Com_Printf( "Buttons: %d\n", buttons );
+      Com_DPrintf( "Name:    %s\n", name );
+      Com_DPrintf( "Axes:    %d\n", axes );
+      Com_DPrintf( "Buttons: %d\n", buttons );
 
       /* Our work here is done. */
       return;
@@ -126,7 +126,7 @@
 
   /* No soup for you. */
   if( joy_fd == -1 ) {
-    Com_Printf( "No joystick found.\n" );
+    Com_DPrintf( "No joystick found.\n" );
     return;
   }
 

Modified: trunk/code/unix/sdl_glimp.c
===================================================================
--- trunk/code/unix/sdl_glimp.c	2007-08-24 11:10:41 UTC (rev 1135)
+++ trunk/code/unix/sdl_glimp.c	2007-08-24 13:54:23 UTC (rev 1136)
@@ -1438,7 +1438,7 @@
 /*****************************************************************************/
 
 void IN_Init(void) {
-	Com_Printf ("\n------- Input Initialization -------\n");
+	Com_DPrintf ("\n------- Input Initialization -------\n");
   // mouse variables
   in_mouse = Cvar_Get ("in_mouse", "1", CVAR_ARCHIVE);
   in_disablemacosxmouseaccel = Cvar_Get ("in_disablemacosxmouseaccel", "1", CVAR_ARCHIVE);
@@ -1467,7 +1467,7 @@
     mouse_avail = qfalse;
 
   IN_StartupJoystick( ); // bk001130 - from cvs1.17 (mkv)
-	Com_Printf ("------------------------------------\n");
+	Com_DPrintf ("------------------------------------\n");
 }
 
 void IN_Shutdown(void)
@@ -1582,25 +1582,25 @@
   memset(&stick_state, '\0', sizeof (stick_state));
 
   if( !in_joystick->integer ) {
-    Com_Printf( "Joystick is not active.\n" );
+    Com_DPrintf( "Joystick is not active.\n" );
     return;
   }
 
   if (!SDL_WasInit(SDL_INIT_JOYSTICK))
   {
-      Com_Printf("Calling SDL_Init(SDL_INIT_JOYSTICK)...\n");
+      Com_DPrintf("Calling SDL_Init(SDL_INIT_JOYSTICK)...\n");
       if (SDL_Init(SDL_INIT_JOYSTICK) == -1)
       {
-          Com_Printf("SDL_Init(SDL_INIT_JOYSTICK) failed: %s\n", SDL_GetError());
+          Com_DPrintf("SDL_Init(SDL_INIT_JOYSTICK) failed: %s\n", SDL_GetError());
           return;
       }
-      Com_Printf("SDL_Init(SDL_INIT_JOYSTICK) passed.\n");
+      Com_DPrintf("SDL_Init(SDL_INIT_JOYSTICK) passed.\n");
   }
 
   total = SDL_NumJoysticks();
-  Com_Printf("I see %d possible joysticks\n", total);
+  Com_DPrintf("%d possible joysticks\n", total);
   for (i = 0; i < total; i++)
-    Com_Printf("[%d] %s\n", i, SDL_JoystickName(i));
+    Com_DPrintf("[%d] %s\n", i, SDL_JoystickName(i));
 
   in_joystickNo = Cvar_Get( "in_joystickNo", "0", CVAR_ARCHIVE );
   if( in_joystickNo->integer < 0 || in_joystickNo->integer >= total )
@@ -1609,16 +1609,16 @@
   stick = SDL_JoystickOpen( in_joystickNo->integer );
 
   if (stick == NULL) {
-    Com_Printf( "No joystick opened.\n" );
+    Com_DPrintf( "No joystick opened.\n" );
     return;
   }
 
-  Com_Printf( "Joystick %d opened\n", in_joystickNo->integer );
-  Com_Printf( "Name:    %s\n", SDL_JoystickName(in_joystickNo->integer) );
-  Com_Printf( "Axes:    %d\n", SDL_JoystickNumAxes(stick) );
-  Com_Printf( "Hats:    %d\n", SDL_JoystickNumHats(stick) );
-  Com_Printf( "Buttons: %d\n", SDL_JoystickNumButtons(stick) );
-  Com_Printf( "Balls: %d\n", SDL_JoystickNumBalls(stick) );
+  Com_DPrintf( "Joystick %d opened\n", in_joystickNo->integer );
+  Com_DPrintf( "Name:    %s\n", SDL_JoystickName(in_joystickNo->integer) );
+  Com_DPrintf( "Axes:    %d\n", SDL_JoystickNumAxes(stick) );
+  Com_DPrintf( "Hats:    %d\n", SDL_JoystickNumHats(stick) );
+  Com_DPrintf( "Buttons: %d\n", SDL_JoystickNumButtons(stick) );
+  Com_DPrintf( "Balls: %d\n", SDL_JoystickNumBalls(stick) );
 
   SDL_JoystickEventState(SDL_QUERY);
 

Modified: trunk/code/win32/win_input.c
===================================================================
--- trunk/code/win32/win_input.c	2007-08-24 11:10:41 UTC (rev 1135)
+++ trunk/code/win32/win_input.c	2007-08-24 13:54:23 UTC (rev 1136)
@@ -267,13 +267,13 @@
 		DINPUT_BUFFERSIZE,              // dwData
 	};
 
-	Com_Printf( "Initializing DirectInput...\n");
+	Com_DPrintf( "Initializing DirectInput...\n");
 
 	if (!hInstDI) {
 		hInstDI = LoadLibrary("dinput.dll");
 		
 		if (hInstDI == NULL) {
-			Com_Printf ("Couldn't load dinput.dll\n");
+			Com_DPrintf ("Couldn't load dinput.dll\n");
 			return qfalse;
 		}
 	}
@@ -283,7 +283,7 @@
 			GetProcAddress(hInstDI,"DirectInputCreateA");
 
 		if (!pDirectInputCreate) {
-			Com_Printf ("Couldn't get DI proc addr\n");
+			Com_DPrintf ("Couldn't get DI proc addr\n");
 			return qfalse;
 		}
 	}
@@ -292,7 +292,7 @@
 	hr = iDirectInputCreate( g_wv.hInstance, DIRECTINPUT_VERSION, &g_pdi, NULL);
 
 	if (FAILED(hr)) {
-		Com_Printf ("iDirectInputCreate failed\n");
+		Com_DPrintf ("iDirectInputCreate failed\n");
 		return qfalse;
 	}
 
@@ -300,7 +300,7 @@
 	hr = IDirectInput_CreateDevice(g_pdi, &GUID_SysMouse, &g_pMouse, NULL);
 
 	if (FAILED(hr)) {
-		Com_Printf ("Couldn't open DI mouse device\n");
+		Com_DPrintf ("Couldn't open DI mouse device\n");
 		return qfalse;
 	}
 
@@ -308,7 +308,7 @@
 	hr = IDirectInputDevice_SetDataFormat(g_pMouse, &df);
 
 	if (FAILED(hr)) 	{
-		Com_Printf ("Couldn't set DI mouse format\n");
+		Com_DPrintf ("Couldn't set DI mouse format\n");
 		return qfalse;
 	}
 
@@ -318,7 +318,7 @@
 
 	// https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=50
 	if (FAILED(hr)) {
-		Com_Printf ("Couldn't set DI coop level\n");
+		Com_DPrintf ("Couldn't set DI coop level\n");
 		return qfalse;
 	}
 
@@ -328,7 +328,7 @@
 	hr = IDirectInputDevice_SetProperty(g_pMouse, DIPROP_BUFFERSIZE, &dipdw.diph);
 
 	if (FAILED(hr)) {
-		Com_Printf ("Couldn't set DI buffersize\n");
+		Com_DPrintf ("Couldn't set DI buffersize\n");
 		return qfalse;
 	}
 
@@ -336,7 +336,7 @@
 	IN_DIMouse( &x, &y );
 	IN_DIMouse( &x, &y );
 
-	Com_Printf( "DirectInput initialized.\n");
+	Com_DPrintf( "DirectInput initialized.\n");
 	return qtrue;
 }
 
@@ -557,7 +557,7 @@
   s_wmv.mouseStartupDelayed = qfalse;
 
 	if ( in_mouse->integer == 0 ) {
-		Com_Printf ("Mouse control not active.\n");
+		Com_DPrintf ("Mouse control not active.\n");
 		return;
 	}
 
@@ -565,16 +565,16 @@
 	if ( ( g_wv.osversion.dwPlatformId == VER_PLATFORM_WIN32_NT ) &&
 		 ( g_wv.osversion.dwMajorVersion == 4 ) )
 	{
-		Com_Printf ("Disallowing DirectInput on NT 4.0\n");
+		Com_DPrintf ("Disallowing DirectInput on NT 4.0\n");
 		Cvar_Set( "in_mouse", "-1" );
 	}
 
 	if ( in_mouse->integer == -1 ) {
-		Com_Printf ("Skipping check for DirectInput\n");
+		Com_DPrintf ("Skipping check for DirectInput\n");
 	} else {
     if (!g_wv.hWnd)
     {
-      Com_Printf ("No window for DirectInput mouse init, delaying\n");
+      Com_DPrintf ("No window for DirectInput mouse init, delaying\n");
       s_wmv.mouseStartupDelayed = qtrue;
       return;
     }
@@ -582,7 +582,7 @@
 	    s_wmv.mouseInitialized = qtrue;
 			return;
 		}
-		Com_Printf ("Falling back to Win32 mouse support...\n");
+		Com_DPrintf ("Falling back to Win32 mouse support...\n");
 	}
 	s_wmv.mouseInitialized = qtrue;
 	IN_InitWin32Mouse();
@@ -654,11 +654,11 @@
 ===========
 */
 void IN_Startup( void ) {
-	Com_Printf ("\n------- Input Initialization -------\n");
+	Com_DPrintf ("\n------- Input Initialization -------\n");
 	IN_StartupMouse ();
 	IN_StartupJoystick ();
 	IN_StartupMIDI();
-	Com_Printf ("------------------------------------\n");
+	Com_DPrintf ("------------------------------------\n");
 
 	in_mouse->modified = qfalse;
 	in_joystick->modified = qfalse;
@@ -802,14 +802,14 @@
 	joy.avail = qfalse; 
 
 	if (! in_joystick->integer ) {
-		Com_Printf ("Joystick is not active.\n");
+		Com_DPrintf ("Joystick is not active.\n");
 		return;
 	}
 
 	// verify joystick driver is present
 	if ((numdevs = joyGetNumDevs ()) == 0)
 	{
-		Com_Printf ("joystick not found -- driver not present\n");
+		Com_DPrintf ("joystick not found -- driver not present\n");
 		return;
 	}
 
@@ -828,7 +828,7 @@
 	// abort startup if we didn't find a valid joystick
 	if (mmr != JOYERR_NOERROR)
 	{
-		Com_Printf ("joystick not found -- no valid joysticks (%x)\n", mmr);
+		Com_DPrintf ("joystick not found -- no valid joysticks (%x)\n", mmr);
 		return;
 	}
 
@@ -837,22 +837,22 @@
 	Com_Memset (&joy.jc, 0, sizeof(joy.jc));
 	if ((mmr = joyGetDevCaps (joy.id, &joy.jc, sizeof(joy.jc))) != JOYERR_NOERROR)
 	{
-		Com_Printf ("joystick not found -- invalid joystick capabilities (%x)\n", mmr); 
+		Com_DPrintf ("joystick not found -- invalid joystick capabilities (%x)\n", mmr); 
 		return;
 	}
 
-	Com_Printf( "Joystick found.\n" );
-	Com_Printf( "Pname: %s\n", joy.jc.szPname );
-	Com_Printf( "OemVxD: %s\n", joy.jc.szOEMVxD );
-	Com_Printf( "RegKey: %s\n", joy.jc.szRegKey );
+	Com_DPrintf( "Joystick found.\n" );
+	Com_DPrintf( "Pname: %s\n", joy.jc.szPname );
+	Com_DPrintf( "OemVxD: %s\n", joy.jc.szOEMVxD );
+	Com_DPrintf( "RegKey: %s\n", joy.jc.szRegKey );
 
-	Com_Printf( "Numbuttons: %i / %i\n", joy.jc.wNumButtons, joy.jc.wMaxButtons );
-	Com_Printf( "Axis: %i / %i\n", joy.jc.wNumAxes, joy.jc.wMaxAxes );
-	Com_Printf( "Caps: 0x%x\n", joy.jc.wCaps );
+	Com_DPrintf( "Numbuttons: %i / %i\n", joy.jc.wNumButtons, joy.jc.wMaxButtons );
+	Com_DPrintf( "Axis: %i / %i\n", joy.jc.wNumAxes, joy.jc.wMaxAxes );
+	Com_DPrintf( "Caps: 0x%x\n", joy.jc.wCaps );
 	if ( joy.jc.wCaps & JOYCAPS_HASPOV ) {
-		Com_Printf( "HASPOV\n" );
+		Com_DPrintf( "HASPOV\n" );
 	} else {
-		Com_Printf( "no POV\n" );
+		Com_DPrintf( "no POV\n" );
 	}
 
 	// old button and POV states default to no buttons pressed
@@ -1130,7 +1130,7 @@
 					 ( unsigned long ) NULL,
 					 CALLBACK_FUNCTION ) != MMSYSERR_NOERROR )
 	{
-		Com_Printf( "WARNING: could not open MIDI device %d: '%s'\n",
+		Com_DPrintf( "WARNING: could not open MIDI device %d: '%s'\n",
 								in_mididevice->integer , s_midiInfo.caps[( int ) in_mididevice->value].szPname );
 		return;
 	}




More information about the quake3-commits mailing list