]> 4ch.mooo.com Git - 16.git/blobdiff - src/inputest.c
removed some junk
[16.git] / src / inputest.c
old mode 100644 (file)
new mode 100755 (executable)
index d6a843a..1bb0d78
-/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
- *
- * This file is part of Project 16.
- *
- * Project 16 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Project 16 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>, or
- * write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-/*
-       input test
-*/
-#include "src/lib/16_in.h"
-
-void
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2018 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+/*\r
+       input test\r
+*/\r
+#include "src/lib/16_in.h"\r
+#include "src/lib/16_tail.h"\r
+\r
+#define INPUTEST_JOYSTICKPADTEST\r
+//#define INPUTEST_MOUSETEST\r
+\r
+void\r
 main(int argc, char *argv[])\r
-{
-
-}
\ No newline at end of file
+{\r
+       static global_game_variables_t gvar;\r
+#ifdef __DEBUG_InputMgr__\r
+       dbg_testkeyin=0;\r
+       dbg_testcontrolnoisy=1;\r
+       dbg_joymousedelta=0;\r
+#endif\r
+       start_timer(&gvar);\r
+       //Startup16(&gvar);\r
+       IN_Startup(&gvar);\r
+       IN_Default(0,&gvar.player[0],\r
+                               #if !defined(INPUTEST_JOYSTICKPADTEST) && !defined(INPUTEST_MOUSETEST)\r
+                                                               ctrl_Keyboard1\r
+                               #endif\r
+                               #if defined(INPUTEST_JOYSTICKPADTEST) && !defined(INPUTEST_MOUSETEST)\r
+                                                               ctrl_Joystick1\r
+                               #endif\r
+                               #if !defined(INPUTEST_JOYSTICKPADTEST) && defined(INPUTEST_MOUSETEST)\r
+                                                               ctrl_Mouse\r
+                               #endif\r
+                                                                                               , &gvar);\r
+       IN_SetControlType(&gvar.player[0],\r
+                               #if !defined(INPUTEST_JOYSTICKPADTEST) && !defined(INPUTEST_MOUSETEST)\r
+                                                               ctrl_Keyboard1\r
+                               #endif\r
+                               #if defined(INPUTEST_JOYSTICKPADTEST) && !defined(INPUTEST_MOUSETEST)\r
+                                                               ctrl_Joystick1\r
+                               #endif\r
+                               #if !defined(INPUTEST_JOYSTICKPADTEST) && defined(INPUTEST_MOUSETEST)\r
+                                                               ctrl_Mouse\r
+                               #endif\r
+                                                                                               );\r
+\r
+       gvar.player[0].enti.q=1;\r
+       gvar.player[0].enti.d=2;\r
+       gvar.player[0].enti.spt=4;\r
+\r
+       //printf("dbg_testkeyin=%u      dbg_testcontrolnoisy=%u dbg_nogvar.playerinpu=%u\nloop if this is not responsive then please KILL or reset machine sorry!!\n", dbg_testkeyin, dbg_testcontrolnoisy, dbg_nogvar.playerinpu);\r
+       while(!gvar.in.inst->Keyboard[sc_Escape])\r
+       {\r
+//0000         shinkutxt(&gvar);\r
+               IN_ReadControl(&gvar.player[0], &gvar);\r
+               switch(gvar.player[0].enti.d)\r
+               {\r
+               //right movement\r
+               case 3:\r
+                       if(gvar.player[0].enti.q<=(TILEWH/(gvar.player[0].enti.spt)))\r
+                       {\r
+                               gvar.player[0].enti.q++;\r
+                       } else { gvar.player[0].enti.q = 1; gvar.player[0].enti.d = 2; }\r
+               break;\r
+\r
+               //left movement\r
+               case 1:\r
+                       if(gvar.player[0].enti.q<=(TILEWH/(gvar.player[0].enti.spt)))\r
+                       {\r
+                               gvar.player[0].enti.q++;\r
+                       } else { gvar.player[0].enti.q = 1; gvar.player[0].enti.d = 2; }\r
+               break;\r
+\r
+               //down movement\r
+               case 4:\r
+                       if(gvar.player[0].enti.q<=(TILEWH/(gvar.player[0].enti.spt)))\r
+                       {\r
+                               gvar.player[0].enti.q++;\r
+                       } else { gvar.player[0].enti.q = 1; gvar.player[0].enti.d = 2; }\r
+               break;\r
+\r
+               //up movement\r
+               case 0:\r
+                       if(gvar.player[0].enti.q<=(TILEWH/(gvar.player[0].enti.spt)))\r
+                       {\r
+                               gvar.player[0].enti.q++;\r
+                       } else { gvar.player[0].enti.q = 1; gvar.player[0].enti.d = 2; }\r
+               break;\r
+       }\r
+               //printf("%u\n", gvar.in.inst->Keyboard[sc_Escape]);\r
+               //if(\r
+               if(gvar.in.inst->Keyboard[88])  //speed\r
+               {\r
+                       switch(gvar.kurokku.fpscap)\r
+                       {\r
+                               case 0:\r
+                                       gvar.kurokku.fpscap=1;\r
+                               break;\r
+                               case 1:\r
+                                       gvar.kurokku.fpscap=0;\r
+                               break;\r
+                       }\r
+                       //IN_Ack();\r
+               }\r
+       }\r
+       IN_Shutdown(&gvar);\r
+               //Shutdown16(&gvar);\r
+       //printf("%u\n", in.Keyboard[sc_Escape]);\r
+       printf("inputest.exe ");\r
+       printf("version %s\n", VERSION);\r
+#ifdef __DEBUG_InputMgr__\r
+       printf("testkeyin=%u\n", dbg_testkeyin);\r
+       printf("testcontrolnoisy=%u\n", dbg_testcontrolnoisy);\r
+       printf("dbg_joymousedelta=%u\n", dbg_joymousedelta);\r
+#endif\r
+       printf("JoysPresent={%d,%d}\n", gvar.in.JoysPresent[0], gvar.in.JoysPresent[1]);\r
+       printf("MousePresent=%d\n", gvar.in.MousePresent);\r
+}\r