X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Finputest.c;h=562f7f4e328268a9e0b9d500884ee8331f4a61d9;hb=e0f1d05925c30944c29b138fb87824a6596a009f;hp=31c8d90734b61a2ad958d456ed6b558a21944987;hpb=c7c2bbbf981e929e57c12fcef0dfe7ad7322c4e6;p=16.git diff --git a/src/inputest.c b/src/inputest.c index 31c8d907..562f7f4e 100755 --- a/src/inputest.c +++ b/src/inputest.c @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 + * Copyright (C) 2012-2015 sparky4 & 0gwen & andrius4669 * * This file is part of Project 16. * @@ -29,18 +29,66 @@ main(int argc, char *argv[]) { player_t player[MaxPlayers]; //extern struct inconfig inpu; - testkeyin=1; - testcontrolnoisy=0; + testkeyin=0; + testcontrolnoisy=1; IN_Startup(); IN_Default(0,&player,ctrl_Joystick); //while(!IN_KeyDown(sc_Escape)) + player[0].q=1; + player[0].d=2; + player[0].persist_aniframe=0; + player[0].speed=4; + //player[0].kd[0]=2; player[0].kd[1]=2; while(!IN_KeyDown(sc_Escape)) { + #define INC_PER_FRAME if(player[0].q&1) player[0].persist_aniframe++; if(player[0].persist_aniframe>4) player[0].persist_aniframe = 1; IN_ReadControl(0,&player); + switch(player[0].d) + { + //right movement + case 3: + if(player[0].q<=(TILEWH/(player[0].speed))) + { + INC_PER_FRAME; + player[0].q++; + } else { player[0].q = 1; player[0].d = 2; } + break; + + //left movement + case 1: + if(player[0].q<=(TILEWH/(player[0].speed))) + { + INC_PER_FRAME; + player[0].q++; + } else { player[0].q = 1; player[0].d = 2; } + break; + + //down movement + case 4: + if(player[0].q<=(TILEWH/(player[0].speed))) + { + INC_PER_FRAME; + player[0].q++; + } else { player[0].q = 1; player[0].d = 2; } + break; + + //up movement + case 0: + if(player[0].q<=(TILEWH/(player[0].speed))) + { + INC_PER_FRAME; + player[0].q++; + } else { player[0].q = 1; player[0].d = 2; } + break; + } //printf("%u\n", IN_KeyDown(sc_Escape)); - if(IN_qb(sc_9)>0) printf("%u\n", IN_qb(sc_9)); + //if( + IN_qb(sc_9);//>0) printf("IN_qb(sc_9)=%u\n", IN_qb(sc_9)); } IN_Shutdown(); //printf("%u\n", in.Keyboard[sc_Escape]); - printf("%u\n", testkeyin); + printf("inputest.exe "); + printf("version %s\n", VERSION); + printf("testkeyin=%u\n", testkeyin); + printf("testcontrolnoisy=%u\n", testcontrolnoisy); }