X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Finputest.c;h=30cb8598ac41ce1b5cc9f3f6f1d6f0e83a4bf35d;hb=faab239b16b39312b26f6c4c1af85f1258aa4445;hp=fc1fc4c1a43036bbe625228f1150b84617855fde;hpb=7fffafe71a9d84c527b697b6c556861857fc1eae;p=16.git diff --git a/src/inputest.c b/src/inputest.c index fc1fc4c1..30cb8598 100755 --- a/src/inputest.c +++ b/src/inputest.c @@ -23,64 +23,67 @@ input test */ #include "src/lib/16_in.h" +#include "src/lib/16_tail.h" void main(int argc, char *argv[]) { - global_game_variables_t gvar; + static global_game_variables_t gvar; player_t player[MaxPlayers]; //extern struct inconfig inpu; - testkeyin=1; - testcontrolnoisy=1; - IN_Startup(); - IN_Default(0,&player,ctrl_Joystick1); - //while(!IN_KeyDown(sc_Escape)) - player[0].q=1; - player[0].d=2; - player[0].persist_aniframe=0; - player[0].speed=4; + dbg_testkeyin=0; + dbg_testcontrolnoisy=1; start_timer(&gvar); + //Startup16(&gvar); + IN_Startup(); + //IN_Default(0,&player,ctrl_Joystick1); + //IN_SetControlType(0,&player,ctrl_Joystick1); + IN_Default(0,&player,ctrl_Keyboard1); + IN_SetControlType(0,&player,ctrl_Keyboard1); + + player[0].enti.q=1; + player[0].enti.d=2; + player[0].enti.speed=4; + +//0000 nibbletest(); +//0000 booleantest(); + //printf("dbg_testkeyin=%u dbg_testcontrolnoisy=%u dbg_noplayerinpu=%u\nloop if this is not responsive then please KILL or reset machine sorry!!\n", dbg_testkeyin, dbg_testcontrolnoisy, dbg_noplayerinpu); while(!IN_KeyDown(sc_Escape)) { - shinkutxt(&gvar); - IN_ReadControl(0,&player); - #define INC_PER_FRAME if(player[0].q&1) player[0].persist_aniframe++; if(player[0].persist_aniframe>4) player[0].persist_aniframe = 1; - switch(player[0].d) +//0000 shinkutxt(&gvar); + IN_ReadControl(0, &player); + switch(player[0].enti.d) { //right movement case 3: - if(player[0].q<=(TILEWH/(player[0].speed))) + if(player[0].enti.q<=(TILEWH/(player[0].enti.speed))) { - INC_PER_FRAME; - player[0].q++; - } else { player[0].q = 1; player[0].d = 2; } + player[0].enti.q++; + } else { player[0].enti.q = 1; player[0].enti.d = 2; } break; //left movement case 1: - if(player[0].q<=(TILEWH/(player[0].speed))) + if(player[0].enti.q<=(TILEWH/(player[0].enti.speed))) { - INC_PER_FRAME; - player[0].q++; - } else { player[0].q = 1; player[0].d = 2; } + player[0].enti.q++; + } else { player[0].enti.q = 1; player[0].enti.d = 2; } break; //down movement case 4: - if(player[0].q<=(TILEWH/(player[0].speed))) + if(player[0].enti.q<=(TILEWH/(player[0].enti.speed))) { - INC_PER_FRAME; - player[0].q++; - } else { player[0].q = 1; player[0].d = 2; } + player[0].enti.q++; + } else { player[0].enti.q = 1; player[0].enti.d = 2; } break; //up movement case 0: - if(player[0].q<=(TILEWH/(player[0].speed))) + if(player[0].enti.q<=(TILEWH/(player[0].enti.speed))) { - INC_PER_FRAME; - player[0].q++; - } else { player[0].q = 1; player[0].d = 2; } + player[0].enti.q++; + } else { player[0].enti.q = 1; player[0].enti.d = 2; } break; } //printf("%u\n", IN_KeyDown(sc_Escape)); @@ -101,9 +104,10 @@ main(int argc, char *argv[]) } } IN_Shutdown(); + //Shutdown16(&gvar); //printf("%u\n", in.Keyboard[sc_Escape]); printf("inputest.exe "); printf("version %s\n", VERSION); - printf("testkeyin=%u\n", testkeyin); - printf("testcontrolnoisy=%u\n", testcontrolnoisy); + printf("testkeyin=%u\n", dbg_testkeyin); + printf("testcontrolnoisy=%u\n", dbg_testcontrolnoisy); }