From: sparky4 Date: Mon, 23 Jan 2017 20:08:18 +0000 (-0600) Subject: ====animation mostly converted==== set_anim_by_id(player[pn].ent->spri, player[pn... X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=commitdiff_plain;h=3d9ea008913982140abaa755866ae19532ec71f6 ====animation mostly converted==== set_anim_by_id(player[pn].ent->spri, player[pn].enti.dire) is causing stability issues and dose not overwrite the old set up also the code is quite unstable but i may of had fixed it just now.. lets see! --- diff --git a/DEBUG.16W b/DEBUG.16W index 2d5543e2..fea14d11 100755 --- a/DEBUG.16W +++ b/DEBUG.16W @@ -1,210 +1,210 @@ -Seg:0 Size:9861 Owner:0x0 -++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++000 -Seg:274c Size:44 Owner:0x0 -++ -Seg:2778 Size:256 Owner:0x1970 +Seg:0 Size:9881 Owner:0x0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++0000 +Seg:2760 Size:44 Owner:0x0 ++ +Seg:278c Size:256 Owner:0x1970 ++++ -Seg:2878 Size:256 Owner:0x1762 +Seg:288c Size:256 Owner:0x1762 ++++ -Seg:2978 Size:256 Owner:0x1764 -++++ -Seg:2a78 Size:256 Owner:0x1766 +Seg:298c Size:256 Owner:0x1764 +++++ -Seg:2b78 Size:256 Owner:0x1768 +Seg:2a8c Size:256 Owner:0x1766 ++++ -Seg:2c78 Size:256 Owner:0x176a +Seg:2b8c Size:256 Owner:0x1768 ++++ -Seg:2d78 Size:256 Owner:0x176c +Seg:2c8c Size:256 Owner:0x176a ++++ -Seg:2e78 Size:256 Owner:0x176e +Seg:2d8c Size:256 Owner:0x176c ++++ -Seg:2f78 Size:256 Owner:0x1770 +Seg:2e8c Size:256 Owner:0x176e +++++ -Seg:3078 Size:256 Owner:0x1772 +Seg:2f8c Size:256 Owner:0x1770 ++++ -Seg:3178 Size:256 Owner:0x1774 +Seg:308c Size:256 Owner:0x1772 ++++ -Seg:3278 Size:256 Owner:0x1776 +Seg:318c Size:256 Owner:0x1774 ++++ -Seg:3378 Size:256 Owner:0x1778 +Seg:328c Size:256 Owner:0x1776 ++++ -Seg:3478 Size:256 Owner:0x177a +Seg:338c Size:256 Owner:0x1778 +++++ -Seg:3578 Size:256 Owner:0x177c +Seg:348c Size:256 Owner:0x177a ++++ -Seg:3678 Size:256 Owner:0x177e +Seg:358c Size:256 Owner:0x177c ++++ -Seg:3778 Size:256 Owner:0x1780 +Seg:368c Size:256 Owner:0x177e ++++ -Seg:3878 Size:256 Owner:0x1782 +Seg:378c Size:256 Owner:0x1780 ++++ -Seg:3978 Size:256 Owner:0x1784 +Seg:388c Size:256 Owner:0x1782 +++++ -Seg:3a78 Size:256 Owner:0x1786 +Seg:398c Size:256 Owner:0x1784 ++++ -Seg:3b78 Size:256 Owner:0x1788 +Seg:3a8c Size:256 Owner:0x1786 ++++ -Seg:3c78 Size:256 Owner:0x178a +Seg:3b8c Size:256 Owner:0x1788 ++++ -Seg:3d78 Size:256 Owner:0x178c +Seg:3c8c Size:256 Owner:0x178a ++++ -Seg:3e78 Size:256 Owner:0x178e +Seg:3d8c Size:256 Owner:0x178c +++++ -Seg:3f78 Size:256 Owner:0x1790 +Seg:3e8c Size:256 Owner:0x178e ++++ -Seg:4078 Size:256 Owner:0x1792 +Seg:3f8c Size:256 Owner:0x1790 ++++ -Seg:4178 Size:256 Owner:0x1794 +Seg:408c Size:256 Owner:0x1792 ++++ -Seg:4278 Size:256 Owner:0x1796 +Seg:418c Size:256 Owner:0x1794 ++++ -Seg:4378 Size:256 Owner:0x1798 +Seg:428c Size:256 Owner:0x1796 +++++ -Seg:4478 Size:256 Owner:0x179a +Seg:438c Size:256 Owner:0x1798 ++++ -Seg:4578 Size:256 Owner:0x179c +Seg:448c Size:256 Owner:0x179a ++++ -Seg:4678 Size:256 Owner:0x179e +Seg:458c Size:256 Owner:0x179c ++++ -Seg:4778 Size:256 Owner:0x17a0 +Seg:468c Size:256 Owner:0x179e ++++ -Seg:4878 Size:256 Owner:0x17a2 +Seg:478c Size:256 Owner:0x17a0 +++++ -Seg:4978 Size:256 Owner:0x17a4 +Seg:488c Size:256 Owner:0x17a2 ++++ -Seg:4a78 Size:256 Owner:0x17a6 +Seg:498c Size:256 Owner:0x17a4 ++++ -Seg:4b78 Size:256 Owner:0x17a8 +Seg:4a8c Size:256 Owner:0x17a6 ++++ -Seg:4c78 Size:256 Owner:0x17aa +Seg:4b8c Size:256 Owner:0x17a8 ++++ -Seg:4d78 Size:256 Owner:0x17ac +Seg:4c8c Size:256 Owner:0x17aa +++++ -Seg:4e78 Size:256 Owner:0x17ae +Seg:4d8c Size:256 Owner:0x17ac ++++ -Seg:4f78 Size:256 Owner:0x17b0 +Seg:4e8c Size:256 Owner:0x17ae ++++ -Seg:5078 Size:256 Owner:0x17b2 +Seg:4f8c Size:256 Owner:0x17b0 ++++ -Seg:5178 Size:256 Owner:0x17b4 +Seg:508c Size:256 Owner:0x17b2 ++++ -Seg:5278 Size:256 Owner:0x17b6 +Seg:518c Size:256 Owner:0x17b4 +++++ -Seg:5378 Size:256 Owner:0x17b8 +Seg:528c Size:256 Owner:0x17b6 ++++ -Seg:5478 Size:256 Owner:0x17ba +Seg:538c Size:256 Owner:0x17b8 ++++ -Seg:5578 Size:256 Owner:0x17bc +Seg:548c Size:256 Owner:0x17ba ++++ -Seg:5678 Size:256 Owner:0x17be +Seg:558c Size:256 Owner:0x17bc ++++ -Seg:5778 Size:256 Owner:0x17c0 +Seg:568c Size:256 Owner:0x17be +++++ -Seg:5878 Size:256 Owner:0x17c2 +Seg:578c Size:256 Owner:0x17c0 ++++ -Seg:5978 Size:256 Owner:0x17c4 +Seg:588c Size:256 Owner:0x17c2 ++++ -Seg:5a78 Size:256 Owner:0x17c6 +Seg:598c Size:256 Owner:0x17c4 ++++ -Seg:5b78 Size:256 Owner:0x17c8 +Seg:5a8c Size:256 Owner:0x17c6 ++++ -Seg:5c78 Size:256 Owner:0x17ca +Seg:5b8c Size:256 Owner:0x17c8 +++++ -Seg:5d78 Size:256 Owner:0x17cc +Seg:5c8c Size:256 Owner:0x17ca ++++ -Seg:5e78 Size:256 Owner:0x17ce +Seg:5d8c Size:256 Owner:0x17cc ++++ -Seg:5f78 Size:256 Owner:0x17d0 +Seg:5e8c Size:256 Owner:0x17ce ++++ -Seg:6078 Size:256 Owner:0x17d2 +Seg:5f8c Size:256 Owner:0x17d0 ++++ -Seg:6178 Size:256 Owner:0x17d4 +Seg:608c Size:256 Owner:0x17d2 +++++ -Seg:6278 Size:256 Owner:0x17d6 +Seg:618c Size:256 Owner:0x17d4 ++++ -Seg:6378 Size:256 Owner:0x17d8 +Seg:628c Size:256 Owner:0x17d6 ++++ -Seg:6478 Size:256 Owner:0x17da +Seg:638c Size:256 Owner:0x17d8 ++++ -Seg:6578 Size:256 Owner:0x17dc +Seg:648c Size:256 Owner:0x17da ++++ -Seg:6678 Size:256 Owner:0x17de +Seg:658c Size:256 Owner:0x17dc +++++ -Seg:6778 Size:256 Owner:0x17e0 +Seg:668c Size:256 Owner:0x17de ++++ -Seg:6878 Size:256 Owner:0x17e2 +Seg:678c Size:256 Owner:0x17e0 ++++ -Seg:6978 Size:256 Owner:0x17e4 +Seg:688c Size:256 Owner:0x17e2 ++++ -Seg:6a78 Size:256 Owner:0x17e6 +Seg:698c Size:256 Owner:0x17e4 ++++ -Seg:6b78 Size:256 Owner:0x17e8 +Seg:6a8c Size:256 Owner:0x17e6 +++++ -Seg:6c78 Size:256 Owner:0x17ea +Seg:6b8c Size:256 Owner:0x17e8 ++++ -Seg:6d78 Size:256 Owner:0x17ec +Seg:6c8c Size:256 Owner:0x17ea ++++ -Seg:6e78 Size:256 Owner:0x17ee +Seg:6d8c Size:256 Owner:0x17ec ++++ -Seg:6f78 Size:256 Owner:0x17f0 +Seg:6e8c Size:256 Owner:0x17ee ++++ -Seg:7078 Size:256 Owner:0x17f2 +Seg:6f8c Size:256 Owner:0x17f0 +++++ -Seg:7178 Size:256 Owner:0x17f4 +Seg:708c Size:256 Owner:0x17f2 ++++ -Seg:7278 Size:256 Owner:0x17f6 +Seg:718c Size:256 Owner:0x17f4 ++++ -Seg:7378 Size:256 Owner:0x17f8 +Seg:728c Size:256 Owner:0x17f6 ++++ -Seg:7478 Size:256 Owner:0x17fa +Seg:738c Size:256 Owner:0x17f8 ++++ -Seg:7578 Size:256 Owner:0x17fc +Seg:748c Size:256 Owner:0x17fa +++++ -Seg:7678 Size:256 Owner:0x17fe +Seg:758c Size:256 Owner:0x17fc ++++ -Seg:7778 Size:256 Owner:0x1800 +Seg:768c Size:256 Owner:0x17fe ++++ -Seg:7878 Size:256 Owner:0x1802 +Seg:778c Size:256 Owner:0x1800 ++++ -Seg:7978 Size:256 Owner:0x1804 +Seg:788c Size:256 Owner:0x1802 ++++ -Seg:7a78 Size:256 Owner:0x1806 +Seg:798c Size:256 Owner:0x1804 +++++ -Seg:7b78 Size:256 Owner:0x1808 +Seg:7a8c Size:256 Owner:0x1806 ++++ -Seg:7c78 Size:256 Owner:0x180a +Seg:7b8c Size:256 Owner:0x1808 ++++ -Seg:7d78 Size:256 Owner:0x180c +Seg:7c8c Size:256 Owner:0x180a ++++ -Seg:7e78 Size:256 Owner:0x180e +Seg:7d8c Size:256 Owner:0x180c ++++ -Seg:7f78 Size:256 Owner:0x1810 +Seg:7e8c Size:256 Owner:0x180e +++++ -Seg:8078 Size:256 Owner:0x1812 +Seg:7f8c Size:256 Owner:0x1810 ++++ -Seg:8178 Size:256 Owner:0x1814 +Seg:808c Size:256 Owner:0x1812 ++++ -Seg:8278 Size:256 Owner:0x1816 +Seg:818c Size:256 Owner:0x1814 ++++ -Seg:8378 Size:256 Owner:0x1818 +Seg:828c Size:256 Owner:0x1816 ++++ -Seg:8478 Size:256 Owner:0x181a +Seg:838c Size:256 Owner:0x1818 +++++ -Seg:8578 Size:256 Owner:0x181c +Seg:848c Size:256 Owner:0x181a ++++ -Seg:8678 Size:256 Owner:0x181e +Seg:858c Size:256 Owner:0x181c ++++ -Seg:8778 Size:256 Owner:0x1820 +Seg:868c Size:256 Owner:0x181e ++++ -Seg:8878 Size:256 Owner:0x1822 +Seg:878c Size:256 Owner:0x1820 ++++ -Seg:8978 Size:256 Owner:0x1824 +Seg:888c Size:256 Owner:0x1822 +++++ -Seg:8a78 Size:256 Owner:0x1826 +Seg:898c Size:256 Owner:0x1824 +++++ +Seg:8a8c Size:256 Owner:0x1826 ++++ -Seg:8b78 Size:256 Owner:0x1828 +Seg:8b8c Size:256 Owner:0x1828 ++++ -Seg:8c78 Size:401 Owner:0xef42 +Seg:8c8c Size:401 Owner:0xef42 ++++++ -Seg:b778 Size:18567 Owner:0x0 +Seg:b78c Size:18547 Owner:0x0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/HEAP.16W b/HEAP.16W index 47db1fc9..715afb22 100755 --- a/HEAP.16W +++ b/HEAP.16W @@ -1,57 +1,57 @@ == default == - USED block at 276e0016 of size 136 - FREE block at 276e009e of size 68 - USED block at 276e00e2 of size 50 - USED block at 276e0114 of size 50 - USED block at 276e0146 of size 50 - USED block at 276e0178 of size 50 - USED block at 276e01aa of size 50 - USED block at 276e01dc of size 50 - USED block at 276e020e of size 50 - USED block at 276e0240 of size 50 - USED block at 276e0272 of size 50 - USED block at 276e02a4 of size 50 - USED block at 276e02d6 of size 50 - USED block at 276e0308 of size 50 - FREE block at 276e033a of size 14 - USED block at 276e0348 of size 20 - FREE block at 276e035c of size 7328 + USED block at 27820016 of size 136 + FREE block at 2782009e of size 68 + USED block at 278200e2 of size 50 + USED block at 27820114 of size 50 + USED block at 27820146 of size 50 + USED block at 27820178 of size 50 + USED block at 278201aa of size 50 + USED block at 278201dc of size 50 + USED block at 2782020e of size 50 + USED block at 27820240 of size 50 + USED block at 27820272 of size 50 + USED block at 278202a4 of size 50 + USED block at 278202d6 of size 50 + USED block at 27820308 of size 50 + FREE block at 2782033a of size 14 + USED block at 27820348 of size 20 + FREE block at 2782035c of size 7328 OK - end of heap == near == - USED block at 176def86 of size 12 - USED block at 176def92 of size 330 - USED block at 176df0dc of size 52 - USED block at 176df110 of size 20 - USED block at 176df124 of size 20 - USED block at 176df138 of size 20 - USED block at 176df14c of size 20 - USED block at 176df160 of size 20 - USED block at 176df174 of size 3720 + USED block at 1781ef86 of size 12 + USED block at 1781ef92 of size 330 + USED block at 1781f0dc of size 52 + USED block at 1781f110 of size 20 + USED block at 1781f124 of size 20 + USED block at 1781f138 of size 20 + USED block at 1781f14c of size 20 + USED block at 1781f160 of size 20 + USED block at 1781f174 of size 3720 OK - end of heap == far == - USED block at 276e0016 of size 136 - USED block at 276e009e of size 68 - USED block at 276e00e2 of size 50 - USED block at 276e0114 of size 50 - USED block at 276e0146 of size 50 - USED block at 276e0178 of size 50 - USED block at 276e01aa of size 50 - USED block at 276e01dc of size 50 - USED block at 276e020e of size 50 - USED block at 276e0240 of size 50 - USED block at 276e0272 of size 50 - USED block at 276e02a4 of size 50 - USED block at 276e02d6 of size 50 - USED block at 276e0308 of size 50 - USED block at 276e033a of size 14 - USED block at 276e0348 of size 20 - USED block at 276e035c of size 7328 + USED block at 27820016 of size 136 + USED block at 2782009e of size 68 + USED block at 278200e2 of size 50 + USED block at 27820114 of size 50 + USED block at 27820146 of size 50 + USED block at 27820178 of size 50 + USED block at 278201aa of size 50 + USED block at 278201dc of size 50 + USED block at 2782020e of size 50 + USED block at 27820240 of size 50 + USED block at 27820272 of size 50 + USED block at 278202a4 of size 50 + USED block at 278202d6 of size 50 + USED block at 27820308 of size 50 + USED block at 2782033a of size 14 + USED block at 27820348 of size 20 + USED block at 2782035c of size 7328 OK - end of heap Memory Type Total Used Free diff --git a/MMDUMP.16W b/MMDUMP.16W index b025a313..e1da355d 100755 Binary files a/MMDUMP.16W and b/MMDUMP.16W differ diff --git a/src/lib/16_in.c b/src/lib/16_in.c index e3587bf7..71307a6e 100755 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -1287,10 +1287,10 @@ void IN_initplayer(player_t *player, word pn) player[0].info.xaxis = player[0].tx*TILEWH; player[0].info.y = player[0].ty; player[0].info.yaxis = player[0].ty*TILEWH;*/ - player[pn].enti.q =1; + player[pn].enti.q = 1; player[pn].enti.d =2; player[pn].enti.hp=4; player[pn].enti.speed=4; - player[pn].enti.persist_aniframe=0; + player[pn].enti.persist_aniframe= 1; player[pn].enti.spt=(TILEWH/(player[pn].enti.speed)); //speed per tile wwww } diff --git a/src/lib/16_sprit.c b/src/lib/16_sprit.c index 6c6cde55..c41994f9 100755 --- a/src/lib/16_sprit.c +++ b/src/lib/16_sprit.c @@ -52,7 +52,6 @@ void init_anim(struct sprite *spri, int anim_index) spri->curr_anim_list = anim_list; } - int set_anim_by_id(struct sprite *spri, int anim_id) { int new_anim_index = 0; @@ -155,6 +154,7 @@ void oldanimate_spri(struct sprite *spri, video_t *video) spri->delay--; break; } + vga_state.vga_graphics_ram = video->omemptr; } @@ -165,14 +165,13 @@ void animate_spri(struct sprite *spri, video_t *video) #define VMEMPAGEDATA2 GVARVIDEO->page[2].data unsigned int i,o,o2; int j; int x,y,rx,ry,w,h; - int overdraw = 0;//16; // how many pixels to "overdraw" so that moving sprites with edge pixels don't leave streaks. + int overdraw = 4;//16; // how many pixels to "overdraw" so that moving sprites with edge pixels don't leave streaks. // if the sprite's edge pixels are clear anyway, you can set this to 0. VGA_RAM_PTR omemptr; // Events go here - //omemptr = vga_state.vga_graphics_ram; // save original mem ptr omemptr = (VGA_RAM_PTR)video->page[0].data;//vga_state.vga_graphics_ram; // save original mem ptr x=spri->x; y=spri->y; @@ -223,7 +222,6 @@ void animate_spri(struct sprite *spri, video_t *video) ); #endif // restore ptr - //vga_state.vga_graphics_ram = video->omemptr; vga_state.vga_graphics_ram = omemptr; // block copy to visible RAM from offscreen @@ -235,7 +233,6 @@ void animate_spri(struct sprite *spri, video_t *video) vga_restore_rm0wm0(); // restore stride - //vga_state.vga_draw_stride_limit= video->vga_draw_stride_limit; vga_state.vga_draw_stride= video->vga_draw_stride; vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = GVARVIDEO->page[0].stridew; // Depending on delay, update indices @@ -260,4 +257,5 @@ void animate_spri(struct sprite *spri, video_t *video) spri->delay--; break; } + vga_state.vga_graphics_ram = video->omemptr; } diff --git a/src/lib/16_sprit.h b/src/lib/16_sprit.h index a72e9671..7fc360c6 100755 --- a/src/lib/16_sprit.h +++ b/src/lib/16_sprit.h @@ -60,7 +60,7 @@ char* get_curr_anim_name(struct sprite *spri); * Out: * int - 0 on success, -1 on error */ -int set_anim_by_id(struct sprite *spri, int id); +int set_anim_by_id(struct sprite *spri, int anim_id); /* Animate sprite, triggering any events and changing indices if necessary * NB: if you want to change animation sequence after a specific sprite is shown, you should call animate_spri first diff --git a/src/lib/16_tail.c b/src/lib/16_tail.c index ece035e2..08ad6244 100755 --- a/src/lib/16_tail.c +++ b/src/lib/16_tail.c @@ -386,7 +386,6 @@ void walktypeinfo(player_t *player, word pn) sprintf(global_temp_status_text, "%s", "s"); break; } - } const char *nibble_to_binary(nibble x) diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index ffa4e156..126ae581 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -108,16 +108,16 @@ typedef struct { word dy; /* row we are viewing on virtual screen (on page[0]) */ /* off screen buffer on the top size */ word sw; /* screen width */ /* resolution */ word sh; /* screen heigth */ /* resolution */ - word tw; /* screen width in tiles */ - word th; /* screen height in tiles */ + word tw; /* screen width in tiles */ + word th; /* screen height in tiles */ word width; /* virtual width of the page */ word height; /* virtual height of the page */ - word tilesw; /* virtual screen width in tiles */ - word tilesh; /* virtual screen height in tiles */ - sword tilemidposscreenx; /* middle tile x position */ /* needed for scroll system to work accordingly */ - sword tilemidposscreeny; /* middle tile y position */ /* needed for scroll system to work accordingly */ - sword tileplayerposscreenx; /* player position on screen */ /* needed for scroll and map system to work accordingly */ - sword tileplayerposscreeny; /* player position on screen */ /* needed for scroll and map system to work accordingly */ + word tilesw; /* virtual screen width in tiles */ + word tilesh; /* virtual screen height in tiles */ + sword tilemidposscreenx; /* middle tile x position */ /* needed for scroll system to work accordingly */ + sword tilemidposscreeny; /* middle tile y position */ /* needed for scroll system to work accordingly */ + sword tileplayerposscreenx; /* player position on screen */ /* needed for scroll and map system to work accordingly */ + sword tileplayerposscreeny; /* player position on screen */ /* needed for scroll and map system to work accordingly */ word stridew; /* width/4 */ /* VGA */ word pagesize; /* page size */ word pi; /* increment page by this much to preserve location */ @@ -138,6 +138,7 @@ typedef struct int sheetsetx; //NOT USED YET! entity sprite sheet set on the image x int sheetsety; //NOT USED YET! entity sprite sheet set on the image y byte d; //direction to render sprite!! wwww + word dire; //sprite in use byte q; //loop variable for anumation and locking the playing to compleate the animation cycle to prevent issues with misalignment www word speed; //entity speed! word spt; //speed per tile @@ -267,7 +268,7 @@ typedef struct byte vga_draw_stride_limit; // further X clipping // word __near rs; //render switch - int __near sprifilei; //player file's i + sword __near sprifilei; //player file's i boolean __near p; //render page number //BLEH boolean __near r; //page flip if true word pr[MAXPAGE][4]; //render sections of pages (this is supposed to be set up to draw sections of the screen if updated) diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 8ad0156a..9285f13b 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -27,11 +27,13 @@ #define INC_PER_FRAME_PRINT sprintf(global_temp_status_text, "%u", player[pn].enti.persist_aniframe);\ modexprint(&(pip->video->page[0]), player[pn].enti.x-(8*player[pn].enti.persist_aniframe), player[pn].enti.y-TILEWH-(8*player[pn].enti.persist_aniframe), 1, 20, 1, global_temp_status_text); -#define WALKTYPE_FRAM_PRINT walktypeinfo(player, pn);\ -modexprint(&(pip->video->page[0]), player[pn].enti.x-(8*player[pn].enti.persist_aniframe)+8, player[pn].enti.y-TILEWH-(8*player[pn].enti.persist_aniframe), 1, 20, 1, global_temp_status_text);\ -INC_PER_FRAME_PRINT +#define WALKTYPE_FRAM_PRINT INC_PER_FRAME_PRINT +//walktypeinfo(player, pn); +//modexprint(&(pip->video->page[0]), player[pn].enti.x-(8*player[pn].enti.persist_aniframe)+8, player[pn].enti.y-TILEWH-(8*player[pn].enti.persist_aniframe), 1, 20, 1, global_temp_status_text); -#define INC_PER_FRAME if(player[pn].enti.q&1) player[pn].enti.persist_aniframe++; if(player[pn].enti.persist_aniframe>4) player[pn].enti.persist_aniframe = 1; +#define PERSIST_ANIFRAME_INIT 1 +#define Q_INIT PERSIST_ANIFRAME_INIT +#define INC_PER_FRAME if(player[pn].enti.q&1) player[pn].enti.persist_aniframe++; if(player[pn].enti.persist_aniframe>4) player[pn].enti.persist_aniframe = PERSIST_ANIFRAME_INIT; void ZC_walk(map_view_t *pip, player_t *player, word pn) { @@ -56,7 +58,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) mapScrollRight(pip, player, (pip[0].video->p), pn); player[pn].enti.q++; //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx++; } } else if(player[pn].enti.tx < pip[0].map->width && !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY)) { @@ -67,7 +69,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) player[pn].enti.x+=(player[pn].enti.speed); ANIMATESPRIFUN(pip, player, pn, 0); player[pn].enti.q++; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx++; } } else { @@ -82,7 +84,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) } player[pn].enti.triggerx = player[pn].enti.tx+1; player[pn].enti.triggery = player[pn].enti.ty; - WALKTYPE_FRAM_PRINT + //WALKTYPE_FRAM_PRINT break; //left movement case 1: @@ -99,7 +101,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) mapScrollLeft(pip, player, (pip[0].video->p), pn); player[pn].enti.q++; //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx--; } } else if(player[pn].enti.tx > 1 && !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY)) { @@ -110,7 +112,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) player[pn].enti.x-=(player[pn].enti.speed); ANIMATESPRIFUN(pip, player, pn, 0); player[pn].enti.q++; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx--; } } else { @@ -125,7 +127,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) } player[pn].enti.triggerx = player[pn].enti.tx-1; player[pn].enti.triggery = player[pn].enti.ty; - WALKTYPE_FRAM_PRINT + //WALKTYPE_FRAM_PRINT break; //down movement case 4: @@ -142,7 +144,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) mapScrollDown(pip, player, (pip[0].video->p), pn); player[pn].enti.q++; //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty++; } } else if(player[pn].enti.ty < pip[0].map->height && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY)) { @@ -153,7 +155,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) player[pn].enti.y+=(player[pn].enti.speed); ANIMATESPRIFUN(pip, player, pn, 0); player[pn].enti.q++; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty++; } } else { @@ -168,7 +170,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) } player[pn].enti.triggerx = player[pn].enti.tx; player[pn].enti.triggery = player[pn].enti.ty+1; - WALKTYPE_FRAM_PRINT + //WALKTYPE_FRAM_PRINT break; //up movement case 0: @@ -185,7 +187,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) mapScrollUp(pip, player, (pip[0].video->p), pn); player[pn].enti.q++; //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty--; } } else if(player[pn].enti.ty > 1 && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY)) { @@ -196,7 +198,7 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) player[pn].enti.y-=(player[pn].enti.speed); ANIMATESPRIFUN(pip, player, 0, pn); player[pn].enti.q++; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty--; } } else { @@ -211,14 +213,11 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) } player[pn].enti.triggerx = player[pn].enti.tx; player[pn].enti.triggery = player[pn].enti.ty-1; - WALKTYPE_FRAM_PRINT + //WALKTYPE_FRAM_PRINT break; } - if(player[pn].enti.d!=2 && pip[0].video->rs) - { - IN_UserInput(1,1); - delay(500); - } + //if(player[pn].enti.d!=2 && pip[0].video->rs) IN_UserInput(1,1); + //else if(!pip[0].video->rs) delay(500); } @@ -257,7 +256,7 @@ void oldwalk(map_view_t *pip, player_t *player, word pn) if(!pageflipflop) modexShowPage(pip[1].page); player[pn].enti.q++; //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx++; } } else if(player[pn].enti.tx < pip[0].map->width && !(pip[0].map->data[(player[pn].enti.tx)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx+1 == TRIGGX && player[pn].enti.ty == TRIGGY)) { @@ -268,7 +267,7 @@ void oldwalk(map_view_t *pip, player_t *player, word pn) ANIMATESPRIFUN(pip, player, pn, 0); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].enti.q++; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx++; } } else { @@ -301,7 +300,7 @@ void oldwalk(map_view_t *pip, player_t *player, word pn) if(!pageflipflop) modexShowPage(pip[1].page); player[pn].enti.q++; //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx--; } } else if(player[pn].enti.tx > 1 && !(pip[0].map->data[(player[pn].enti.tx-2)+(pip[0].map->width*(player[pn].enti.ty-1))] == 0))//!(player[pn].enti.tx-1 == TRIGGX && player[pn].enti.ty == TRIGGY)) { @@ -312,7 +311,7 @@ void oldwalk(map_view_t *pip, player_t *player, word pn) ANIMATESPRIFUN(pip, player, pn, 0); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].enti.q++; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.tx--; } } else { @@ -345,7 +344,7 @@ void oldwalk(map_view_t *pip, player_t *player, word pn) if(!pageflipflop) modexShowPage(pip[1].page); player[pn].enti.q++; //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty++; } } else if(player[pn].enti.ty < pip[0].map->height && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty+1 == TRIGGY)) { @@ -356,7 +355,7 @@ void oldwalk(map_view_t *pip, player_t *player, word pn) ANIMATESPRIFUN(pip, player, pn, 0); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].enti.q++; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty++; } } else { @@ -389,7 +388,7 @@ void oldwalk(map_view_t *pip, player_t *player, word pn) if(!pageflipflop) modexShowPage(pip[1].page); player[pn].enti.q++; //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty--; } } else if(player[pn].enti.ty > 1 && !(pip[0].map->data[(player[pn].enti.tx-1)+(pip[0].map->width*(player[pn].enti.ty-2))] == 0))//!(player[pn].enti.tx == TRIGGX && player[pn].enti.ty-1 == TRIGGY)) { @@ -400,7 +399,7 @@ void oldwalk(map_view_t *pip, player_t *player, word pn) ANIMATESPRIFUN(pip, player, 0, pn); if(!pageflipflop) modexShowPage(pip[1].page); player[pn].enti.q++; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; player[pn].enti.ty--; } } else { @@ -434,7 +433,7 @@ void ZC_panPageManual(map_view_t *pip, player_t *player, word pn) pip[0].page->dx+=4; SHOWMVFUN_; player[pn].enti.q++; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].tx++; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; pip[0].tx++; } } break; @@ -447,7 +446,7 @@ void ZC_panPageManual(map_view_t *pip, player_t *player, word pn) pip[0].page->dx-=4; SHOWMVFUN_; player[pn].enti.q++; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].tx--; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; pip[0].tx--; } } break; @@ -460,7 +459,7 @@ void ZC_panPageManual(map_view_t *pip, player_t *player, word pn) pip[0].page->dy+=4; SHOWMVFUN_; player[pn].enti.q++; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].ty++; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; pip[0].ty++; } } break; @@ -473,7 +472,7 @@ void ZC_panPageManual(map_view_t *pip, player_t *player, word pn) pip[0].page->dy-=4; SHOWMVFUN_; player[pn].enti.q++; - } else { player[pn].enti.q = 1; player[pn].enti.d = 2; pip[0].ty--; } + } else { player[pn].enti.q = Q_INIT; player[pn].enti.d = 2; pip[0].ty--; } } break; } @@ -1127,57 +1126,32 @@ void shinku(global_game_variables_t *gv) } } -void near ZC_drawframe(map_view_t *pip, player_t *player, word pn, sword x, sword y, word dire, word sw) +void near ZC_drawframe(map_view_t *pip, player_t *player, word pn, sword x, sword y, word sw) { - pip->video->sprifilei=0; - - switch(sw) - { - case 1: - dire+=2; - break; - case 2: - dire+=1; - break; -// case 3: -// dire=dire; -// break; - case 4: - dire+=2; - break; - } - switch(pip[0].video->rs) { case 0: - pip->video->sprifilei = set_anim_by_id(player[pn].ent->spri, dire); if(pip->video->sprifilei == -1) return; animate_spri(player[pn].ent->spri, pip->video); break; case 1: - pip->video->sprifilei = set_anim_by_id(player[pn].ent->spri, dire); if(pip->video->sprifilei == -1) return; oldanimate_spri(player[pn].ent->spri, pip->video); break; case 2: - modexClearRegion(&(pip[0].page[0]), x, y, 16, 32, dire); + modexClearRegion(&(pip[0].page[0]), x, y, 16, 32, player[pn].enti.dire); break; } } -/*void ZC_odrawframe() -{ - -}*/ - #ifdef SPRITE -#define FRAME1 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 48, dire, 24, 32, PLAYERBMPDATAPTR); -#define FRAME2 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32, PLAYERBMPDATAPTR); -#define FRAME3 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 0, dire, 24, 32, PLAYERBMPDATAPTR); -#define FRAME4 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, dire, 24, 32, PLAYERBMPDATAPTR); +#define FRAME1 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 48, player[pn].enti.dire, 24, 32, PLAYERBMPDATAPTR); +#define FRAME2 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, player[pn].enti.dire, 24, 32, PLAYERBMPDATAPTR); +#define FRAME3 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 0, player[pn].enti.dire, 24, 32, PLAYERBMPDATAPTR); +#define FRAME4 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, player[pn].enti.dire, 24, 32, PLAYERBMPDATAPTR); #else -#define FRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 2+dire); -#define FRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 1+dire); -#define FRAME3 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, dire); -#define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 1+dire); +#define FRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 2+player[pn].enti.dire); +#define FRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 1+player[pn].enti.dire); +#define FRAME3 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, player[pn].enti.dire); +#define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 1+player[pn].enti.dire); #endif void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch) @@ -1186,9 +1160,9 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll sword y = player[pn].enti.y; sword bx = x+16; //buffer's x sword by = y+16; //buffer's y - word dire=32; //direction sword qq; //scroll offset word ls = player[pn].enti.persist_aniframe; + player[pn].enti.dire=32; //direction switch(scrollswitch) { @@ -1205,13 +1179,13 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll { case 0: //up - dire*=player[pn].enti.d; + player[pn].enti.dire*=player[pn].enti.d; y-=qq; by-=4; break; case 3: // right - dire*=(player[pn].enti.d-2); + player[pn].enti.dire*=(player[pn].enti.d-2); x+=qq; bx+=4; break; @@ -1219,13 +1193,13 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll break; case 4: //down - dire*=(player[pn].enti.d-2); + player[pn].enti.dire*=(player[pn].enti.d-2); y+=qq; by+=4; break; case 1: //left - dire*=(player[pn].enti.d+2); + player[pn].enti.dire*=(player[pn].enti.d+2); x-=qq; bx-=4; break; @@ -1272,9 +1246,9 @@ void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scr { sword x = player[pn].enti.x; sword y = player[pn].enti.y; - word dire=10; //direction sword qq; //scroll offset word ls = player[pn].enti.persist_aniframe; + player[pn].enti.dire=10; //direction switch(scrollswitch) { @@ -1292,27 +1266,31 @@ void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scr { case 0: //up - dire*=player[pn].enti.d+1; + player[pn].enti.dire*=player[pn].enti.d+1; y-=qq; break; case 3: // right - dire*=(player[pn].enti.d-1); + player[pn].enti.dire*=(player[pn].enti.d-1); x+=qq; break; case 2: break; case 4: //down - dire*=(player[pn].enti.d-1); + player[pn].enti.dire*=(player[pn].enti.d-1); y+=qq; break; case 1: //left - dire*=(player[pn].enti.d+3); + player[pn].enti.dire*=(player[pn].enti.d+3); x-=qq; break; } + player[pn].enti.dire++; + + player[pn].ent->spri->delay=1; + //pip->video->sprifilei = set_anim_by_id(player[pn].ent->spri, player[pn].enti.dire); if(pip->video->sprifilei == -1){ printf("ERROR! %u\n", player[pn].enti.dire); return; } //setting xy position player[pn].ent->spri->x = x; @@ -1321,19 +1299,22 @@ void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scr switch(ls) { case 1: - ZC_drawframe(pip, player, pn, x, y, dire, ls); + ZC_drawframe(pip, player, pn, x, y, ls); break; case 2: - ZC_drawframe(pip, player, pn, x, y, dire, ls); + ZC_drawframe(pip, player, pn, x, y, ls); break; case 3: - ZC_drawframe(pip, player, pn, x, y, dire, ls); + ZC_drawframe(pip, player, pn, x, y, ls); break; case 4: - ZC_drawframe(pip, player, pn, x, y, dire, ls); + ZC_drawframe(pip, player, pn, x, y, ls); break; } pip->video->r=1; + WALKTYPE_FRAM_PRINT; + sprintf(global_temp_status_text, " %u", player[pn].enti.dire); + modexprint(&(pip->video->page[0]), player[pn].enti.x-(8*player[pn].enti.persist_aniframe)+8, player[pn].enti.y-TILEWH-(8*player[pn].enti.persist_aniframe), 1, 20, 1, global_temp_status_text);\ } /* diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h index 873197bc..6b03e96f 100755 --- a/src/lib/scroll16.h +++ b/src/lib/scroll16.h @@ -157,7 +157,7 @@ void mapDrawWRow(map_view_t *mv, int tx, int ty, word y); void mapDrawWCol(map_view_t *mv, int tx, int ty, word x); //void qclean(); void shinku(global_game_variables_t *gv); -void near ZC_drawframe(map_view_t *pip, player_t *player, word pn, sword x, sword y, word dire, word sw); +void near ZC_drawframe(map_view_t *pip, player_t *player, word pn, sword x, sword y, word sw); void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch); void near ZC_animatePlayer_(map_view_t *pip, player_t *player, word pn, sword scrollswitch); void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch); diff --git a/src/scroll.c b/src/scroll.c index 6baefa2a..1d92d1fb 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -123,7 +123,7 @@ void main(int argc, char *argv[]) IN_initplayer(&player, 0); player[0].ent->spri->x = player[0].enti.x-4; player[0].ent->spri->y = player[0].enti.y-16; - player[0].ent->spri->delay = 0; + player[0].ent->spri->delay = 1; #ifndef SPRITE modexClearRegion(mv[0].page, player[0].enti.x, player[0].enti.y-TILEWH, 16, 32, 15); @@ -232,6 +232,7 @@ void main(int argc, char *argv[]) } #endif FUNCTIONKEYFUNCTIONS; + if(IN_KeyDown(sc_L)){ modexClearRegion(&gvar.video.page[0], player[0].enti.x, player[0].enti.y, 16, 16, 1); } //9 #ifdef FADE diff --git a/src/vrstest.c b/src/vrstest.c index 094f4a9f..707832a2 100755 --- a/src/vrstest.c +++ b/src/vrstest.c @@ -92,12 +92,12 @@ void main() //read_vrs(&gvar, "data/spri/chikyuu.vrs", &vrs); spri.spritesheet = &vrs; spri.sprite_vrl_cont = malloc(sizeof(struct vrl_container)); - i = set_anim_by_id(&spri, 11); + i = set_anim_by_id(&spri, 31); if (i == -1) { return; } - spri.x = TILEWH; + spri.x = TILEWH-4; spri.y = TILEWH; // Uncomment to see broken sprites @@ -121,7 +121,8 @@ void main() modexPalUpdate1(pal);*/ VL_LoadPalFile("data/spri/chikyuu.pal", &palette); for (i = 0; i < 5; i++){ - spri.delay = 1; animate_spri(&spri, &gvar.video);// spri.x += 16; + spri.delay = 1; + animate_spri(&spri, &gvar.video);// spri.x += 16; delay(500); } diff --git a/src/zcroll.c b/src/zcroll.c index 789a8eb3..e056fdec 100755 --- a/src/zcroll.c +++ b/src/zcroll.c @@ -115,9 +115,10 @@ void main(int argc, char *argv[]) player[0].ent->spri->y = player[0].enti.y-16; player[0].ent->spri->delay = 0; - i = set_anim_by_id(player[0].ent->spri, 31); - print_anim_ids(player[0].ent->spri); - if (i == -1) + player[0].enti.dire=31; + gvar.video.sprifilei = set_anim_by_id(player[0].ent->spri, player[0].enti.dire); + //print_anim_ids(player[0].ent->spri); + if (gvar.video.sprifilei == -1) { #ifdef FADE modexFadeOff(4, gpal); @@ -202,6 +203,7 @@ void main(int argc, char *argv[]) } } FUNCTIONKEYFUNCTIONS; + if(IN_KeyDown(sc_L)){ modexClearRegion(&gvar.video.page[0], player[0].enti.x, player[0].enti.y, 16, 16, 1); } //9 #ifdef FADE