From 46180de310fb6d02c92b345df81760cb5d37b379 Mon Sep 17 00:00:00 2001 From: Wintermute0110 Date: Thu, 20 Nov 2014 06:13:07 +0900 Subject: [PATCH] * Some debug stuff (now commented in) used to debug joystick/gamepad events. --- neo/framework/CmdSystem.cpp | 13 +++++++++++++ neo/framework/UsercmdGen.cpp | 8 +++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/neo/framework/CmdSystem.cpp b/neo/framework/CmdSystem.cpp index dc84f934..8936dd2f 100644 --- a/neo/framework/CmdSystem.cpp +++ b/neo/framework/CmdSystem.cpp @@ -551,6 +551,19 @@ void idCmdSystemLocal::ExecuteTokenizedString( const idCmdArgs& args ) return; // no tokens } + // DEBUG: print commands executed by the console +/* + if(args.Argc() == 1) { + common->Printf("idCmdSystemLocal::ExecuteTokenizedString: '%s'\n", args.Argv( 0 )); + } + else if(args.Argc() == 2) { + common->Printf("idCmdSystemLocal::ExecuteTokenizedString: '%s' '%s'\n", args.Argv( 0 ), args.Argv( 1 )); + } + else if(args.Argc() == 3) { + common->Printf("idCmdSystemLocal::ExecuteTokenizedString: '%s' '%s' '%s'\n", args.Argv( 0 ), args.Argv( 1 ), args.Argv( 2 )); + } +*/ + // check registered command functions for( prev = &commands; *prev; prev = &cmd->next ) { diff --git a/neo/framework/UsercmdGen.cpp b/neo/framework/UsercmdGen.cpp index f3c0e2dd..f797e3e8 100644 --- a/neo/framework/UsercmdGen.cpp +++ b/neo/framework/UsercmdGen.cpp @@ -1423,7 +1423,11 @@ idUsercmdGenLocal::Joystick void idUsercmdGenLocal::Joystick( int deviceNum ) { int numEvents = Sys_PollJoystickInputEvents( deviceNum ); - + +// if(numEvents) { +// common->Printf("idUsercmdGenLocal::Joystick: numEvents = %i\n", numEvents); +// } + // Study each of the buffer elements and process them. for( int i = 0; i < numEvents; i++ ) { @@ -1431,6 +1435,8 @@ void idUsercmdGenLocal::Joystick( int deviceNum ) int value; if( Sys_ReturnJoystickInputEvent( i, action, value ) ) { +// common->Printf("idUsercmdGenLocal::Joystick: i = %i / action = %i / value = %i\n", i, action, value); + if( action >= J_ACTION1 && action <= J_ACTION_MAX ) { int joyButton = K_JOY1 + ( action - J_ACTION1 );