wwww
Revision | 5cae3e118cd55278d286cac524d30e36f9df88a4 (tree) |
---|---|
Time | 2016-03-13 14:17:26 |
Author | sparky4 <sparky4@cock...> |
Commiter | sparky4 |
pdir printf(%c%d %c%d %c%d %c%dn, dirchar(0), inpu.Keyboard[def->up], dirchar(4), inpu.Keyboard[def->down], dirchar(1), inpu.Keyboard[def->left], dirchar(3), inpu.Keyboard[def->right]);
@@ -157,3 +157,27 @@ US_CheckParm(char *parm,char **strings) | ||
157 | 157 | |
158 | 158 | exit(exit_code); |
159 | 159 | }*/ |
160 | + | |
161 | +byte dirchar(byte in) | |
162 | +{ | |
163 | + byte out; | |
164 | + switch(in) | |
165 | + { | |
166 | + case 0: //up | |
167 | + out = 0x1E; | |
168 | + break; | |
169 | + case 4: //down | |
170 | + out = 0x1F; | |
171 | + break; | |
172 | + case 1: //left | |
173 | + out = 0x11; | |
174 | + break; | |
175 | + case 3: //right | |
176 | + out = 0x10; | |
177 | + break; | |
178 | + default: //null | |
179 | + out = 0xB3; | |
180 | + break; | |
181 | + } | |
182 | + return out; | |
183 | +} |
@@ -178,5 +178,6 @@ void wait(clock_t wait); | ||
178 | 178 | long int filesize(FILE *fp); |
179 | 179 | void printmeminfoline(byte *strc, const byte *pee, size_t h_total, size_t h_used, size_t h_free); |
180 | 180 | int US_CheckParm(char *parm,char **strings); |
181 | +byte dirchar(byte in); | |
181 | 182 | |
182 | 183 | #endif/*_LIBHEAD_H_*/ |
@@ -919,7 +919,7 @@ register KeyboardDef *def; | ||
919 | 919 | player[pn].info.dir = DirTable[conpee]; |
920 | 920 | |
921 | 921 | //TODO: overwriting direction must be added |
922 | - if(DIRECTIONIFELSEGFXTEST) player[pn].pdir=DirTable[conpee]; | |
922 | + if(player[pn].d==2) player[pn].pdir=DirTable[conpee]; | |
923 | 923 | if(player[pn].q==1 && (mx!=motion_None || my!=motion_None)) |
924 | 924 | { |
925 | 925 | player[pn].d = player[pn].info.dir; |
@@ -952,13 +952,14 @@ register KeyboardDef *def; | ||
952 | 952 | #endif |
953 | 953 | //#ifdef TESTCONTROLNOISY |
954 | 954 | if(testcontrolnoisy > 0) |
955 | -//if((inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right]) && NDIRECTIONIFELSEGFXTEST) | |
955 | +if((inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right]) || player[pn].q>1) | |
956 | 956 | { |
957 | 957 | printf("q=%d ", player[pn].q); |
958 | - printf("cpee=%d ", conpee); | |
959 | - printf("(mx)=%d ", mx); | |
960 | - printf("(my)=%d ", my); | |
961 | - printf("pdir=%d d=%d dir=%d\n", player[pn].pdir, player[pn].d, player[pn].info.dir); | |
958 | + printf("cpee=%c ", dirchar(conpee)); | |
959 | + //printf("(mx)=%d ", mx); | |
960 | + //printf("(my)=%d ", my); | |
961 | + printf("pdir=%c d=%c dir=%c", dirchar(player[pn].pdir), dirchar(player[pn].d), dirchar(player[pn].info.dir)); | |
962 | + printf("%c%d %c%d %c%d %c%d\n", dirchar(0), inpu.Keyboard[def->up], dirchar(4), inpu.Keyboard[def->down], dirchar(1), inpu.Keyboard[def->left], dirchar(3), inpu.Keyboard[def->right]); | |
962 | 963 | } |
963 | 964 | //#endif |
964 | 965 | } |
@@ -46,8 +46,9 @@ extern byte testkeyin,testcontrolnoisy; | ||
46 | 46 | |
47 | 47 | //if else for gfxtesting and direction |
48 | 48 | //player[pn].d == 2 || |
49 | +//player[pn].d != 2 || | |
49 | 50 | #define DIRECTIONIFELSEGFXTEST (player[pn].info.dir == 2) |
50 | -//#define NDIRECTIONIFELSEGFXTEST (player[pn].d != 2 || player[pn].info.dir != 2) | |
51 | +#define NDIRECTIONIFELSEGFXTEST (player[pn].info.dir != 2) | |
51 | 52 | |
52 | 53 | #define KeyInt 9 // The keyboard ISR number |
53 | 54 |