From: sparky4 Date: Mon, 29 Jun 2015 18:28:17 +0000 (-0500) Subject: wwww porting~ X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=a423e762973f70f457b66845696d58aa597291ed;p=16.git wwww porting~ modified: inputest.exe modified: src/lib/16_in.c modified: src/lib/16_in.h modified: src/lib/scroll16.c modified: src/lib/scroll16.h --- diff --git a/inputest.exe b/inputest.exe index 5b6c428d..e48d05c4 100644 Binary files a/inputest.exe and b/inputest.exe differ diff --git a/src/lib/16_in.c b/src/lib/16_in.c index ff9c576e..2878be77 100644 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -849,18 +849,19 @@ register KeyboardDef *def; else if (Keyboard[def->downright]) mx = motion_Right,my = motion_Down;*/ - if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){ - if (inpu.Keyboard[def->up]) + //if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){ + + if((inpu.Keyboard[def->up] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 0) my = motion_Up; - else if (inpu.Keyboard[def->down]) + else if((inpu.Keyboard[def->down] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 4) my = motion_Down; - }else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){ - if (inpu.Keyboard[def->left]) + //}else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){ + if((inpu.Keyboard[def->left] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 1) mx = motion_Left; - else if (inpu.Keyboard[def->right]) + else if((inpu.Keyboard[def->right] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 3) mx = motion_Right; - } + //} if (inpu.Keyboard[def->button0]) buttons += 1 << 0; if (inpu.Keyboard[def->button1]) diff --git a/src/lib/16_in.h b/src/lib/16_in.h index 5aeecc07..1036b6ec 100644 --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -207,6 +207,18 @@ typedef struct typedef struct { + int x; //player exact position on the viewable map + int y; //player exact position on the viewable map + int tx; //player tile position on the viewable map + int ty; //player tile position on the viewable map + int triggerx; //player's trigger box tile position on the viewable map + int triggery; //player's trigger box tile position on the viewable map + int setx; //NOT USED YET! player sprite sheet set on the image x + int sety; //NOT USED YET! player sprite sheet set on the image y + word q; //loop variable +// word d; //direction + //bitmap_t data; //supposively the sprite sheet data + int hp; //hitpoints of the player CursorInfo info; ControlType Controls; } player_t; diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index f02a5be1..40acf484 100644 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -23,3 +23,52 @@ scroll16 library~ */ #include "src/lib/scroll16.h" + +/*void animatePlayer(player_t *player,word playnum, short scrolloffsetswitch, int ls, bitmap_t *bmp) +{ + sword dire=32; //direction + sword qq; //scroll offset + + if(scrolloffsetswitch==0) qq = 0; + else qq = ((player[playnum]->p)*player[playnum]->speed); + switch (player[playnum]->dir) + { + case 0: + //up + dire*=player[playnum]->dir; + player[playnum]->x=player[playnum]->x-4; + player[playnum]->y=player[playnum]->y-qq-TILEWH; + break; + case 1: + // right + dire*=(player[playnum]->dir-2); + player[playnum]->x=player[playnum]->x+qq-4; + player[playnum]->y=player[playnum]->y-TILEWH; + break; + case 2: + break; + case 3: + //down + dire*=(player[playnum]->dir-2) + player[playnum]->x=player[playnum]->x-4; + player[playnum]->y=player[playnum]->y+qq-TILEWH; + break; + case 4: + //left + dire*=(player[playnum]->dir+2) + player[playnum]->x=player[playnum]->x-qq-4; + player[playnum]->y=player[playnum]->y-TILEWH; + break; + } +// modexCopyPageRegion(dest->page, src->page, x-4, y-4, x-4, y-4, 28, 40); +// if(2>ls && ls>=1) { modexDrawSpriteRegion(dest->page, x, y, 48, dire, 24, 32, bmp); }else +// if(3>ls && ls>=2) { modexDrawSpriteRegion(dest->page, x, y, 24, dire, 24, 32, bmp); }else +// if(4>ls && ls>=3) { modexDrawSpriteRegion(dest->page, x, y, 0, dire, 24, 32, bmp); }else +// if(5>ls && ls>=4) { modexDrawSpriteRegion(dest->page, x, y, 24, dire, 24, 32, bmp); } + //TODO: mask copy //modexCopyPageRegion(dest->page, src->page, x-4, y-4, x-4, y-4, 28, 40); + //modexClearRegion(top->page, 66, 66, 2, 40, 0); + //modexCopyPageRegion(dest->page, top->page, 66, 66, 66, 66, 2, 40); + //turn this off if XT + //XTif(detectcpu() > 0) +// modexWaitBorder(); +}*/ diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h index baac6a8f..e7fa1e16 100644 --- a/src/lib/scroll16.h +++ b/src/lib/scroll16.h @@ -23,5 +23,11 @@ #ifndef __SCROLL16_H_ #define __SCROLL16_H_ +#include "src/lib/16_in.h" + +//#define TILEWH 16 +//#define SPEED 4 + +//void animatePlayer(player_t *player, short scrolloffsetswitch, int ls, bitmap_t *bmp); #endif /*__SCROLL16_H_*/