c2e.convert_special: 0
e2c.convert_num: 0
openfiles: /dos/z/16/doc/project.txt:0:0:0:
-openfiles: /dos/z/16/scroll.c:4669:4145:1:
-openfiles: /dos/z/16/modex16.c:2077:556:0:
-openfiles: /dos/z/16/modex16.h:1150:0:0:
+openfiles: /dos/z/16/scroll.c:12536:10702:1:
+openfiles: /dos/z/16/modex16.c:15726:15322:0:
+openfiles: /dos/z/16/modex16.h:2230:1258:0:
+openfiles: /dos/z/16/pcxtest.c:1339:797:0:
snr_recursion_level: 0
convertcolumn_horizontally: 0
adv_open_matchname: 0
opendir: file:///dos/z/16
wrap_text_default: 0
bookmarks_filename_mode: 1
-ssearch_text: modexShowPage(spri->page);
+ssearch_text: waitb
snr_casesens: 1
view_blocks: 1
name: project 16
-replacelist: てすと
-replacelist: \t
-replacelist: putPixel_X
-replacelist: SCREEN_WIDTH
-replacelist: SCREEN_HEIGHT
replacelist: modexClearPlayer(mv->page
replacelist: animatePlayer(draw
replacelist: animatePlayer(spri
replacelist: modexDrawSpriteRegion(spri
replacelist: spri->page = modexDefaultPage();
+replacelist: screen2=modexNextPage(mv.page);
+replacelist: spri->page=draw->page;
+replacelist: mv
+replacelist: src
+replacelist: mv->page, src->page,
+replacelist: modexShowPage(spri
+replacelist: modexShowPage(draw
+replacelist: wPage(spri
+replacelist: 34);
+replacelist: bg
fb_show_hidden_f: 0
editor_tab_width: 4
show_visible_spacing: 1
e2c.convert_iso: 0
ssearch_casesens: 0
charmap_block: 1
-recent_files: file:///dos/z/16/16/lib/x/MXVS.ASM
recent_files: file:///dos/z/16/16/lib/x/MAKEFILE
recent_files: file:///dos/z/16/16/lib/x/MODEX.DEF
recent_files: file:///dos/z/4x4_16/modex/DEMO01.PAS
recent_files: file:///dos/z/16/doc/project.txt
recent_files: file:///dos/z/16/modex16.h
recent_files: file:///dos/z/16/modex16.c
+recent_files: file:///dos/z/16/pcxtest.c
snr_replacetype: 0
savedir: file:///dos/z/16
spell_check_default: 1
htmlbar_view: 0
spell_lang: en
ssearch_dotmatchall: 0
-searchlist: SC_INDEX
-searchlist: gq
-searchlist: setvideo
-searchlist: clock
-searchlist: vga
-searchlist: color 0
-searchlist: sprite
-searchlist: clear
-searchlist: modexClearRegion(mv->page
-searchlist: animatePlayer(spri
-searchlist: color
-searchlist: modexShowPage(spri->page);
-searchlist: animatePlayer(draw
-searchlist: modexDrawSpriteRegion(draw
-searchlist: spri->page=NULL;
+searchlist: &mv, &src,
+searchlist: modexCopyPageRegion
+searchlist: modexShowPage(draw
+searchlist: ->page
+searchlist: w->page
+searchlist: modexShowPage(spri
+searchlist: howPage(draw
+searchlist: wPage(draw
+searchlist: 32);
+searchlist: 33)
+searchlist: 3)
+searchlist: draw
+searchlist: 34)
+searchlist: 0x3DA
+searchlist: waitb
autocomplete: 1
outputb_show_all_output: 0
bookmarks_show_mode: 0
}\r
}\r
-
-void\r
-modexClearPlayer(page_t *page, int x, int y, int w, int h) {\r
- word pageOff = (word) page->data;\r
- word xoff=x/4; /* xoffset that begins each row */\r
- word scanCount=w/4; /* number of iterations per row (excluding right clip)*/\r
- word poffset = pageOff + y*(page->width/4) + xoff; /* starting offset */\r
- word nextRow = page->width/4-scanCount-1; /* loc of next row */\r
- byte lclip[] = {0x0f, 0x0e, 0x0c, 0x08}; /* clips for rectangles not on 4s */\r
- byte rclip[] = {0x00, 0x01, 0x03, 0x07};\r
- byte left = lclip[x&0x03];\r
- byte right = rclip[(x+w)&0x03];\r
-\r
- /* handle the case which requires an extra group */\r
- if((x & 0x03) && !((x+w) & 0x03)) {\r
- right=0x0f;\r
- }\r
-\r
- __asm {\r
- MOV AX, SCREEN_SEG ; go to the VGA memory\r
- MOV ES, AX\r
- MOV DI, poffset ; go to the first pixel\r
- MOV DX, SC_INDEX ; point to the map mask\r
- MOV AL, MAP_MASK\r
- OUT DX, AL\r
- INC DX\r
- MOV AL, NULL ; get ready to write colors\r
- SCAN_START:\r
- MOV CX, scanCount ; count the line\r
- MOV BL, AL ; remember color\r
- MOV AL, left ; do the left clip\r
- OUT DX, AL ; set the left clip\r
- MOV AL, BL ; restore color\r
- STOSB ; write the color\r
- DEC CX\r
- JZ SCAN_DONE ; handle 1 group stuff\r
-\r
- ;-- write the main body of the scanline\r
- MOV BL, AL ; remember color\r
- MOV AL, 0x0f ; write to all pixels\r
- OUT DX, AL\r
- MOV AL, BL ; restore color\r
- REP STOSB ; write the color\r
- SCAN_DONE:\r
- MOV BL, AL ; remeber color\r
- MOV AL, right\r
- OUT DX, AL ; do the right clip\r
- MOV AL, BL ; restore color\r
- STOSB ; write pixel\r
- ADD DI, nextRow ; go to the next row\r
- DEC h\r
- JNZ SCAN_START\r
- }\r
-}\r
-
\r
void\r
modexDrawBmp(page_t *page, int x, int y, bitmap_t *bmp) {\r
player.x = player.tx*TILEWH;
player.y = player.ty*TILEWH;
modexDrawSpriteRegion(spri->page, player.x-4, player.y-TILEWH, 24, 64, 24, 32, &ptmp);
- modexCopyPageRegion(bg->page, spri->page, player.x-4, player.y-TILEWH-2, player.x-4, player.y-TILEWH-2, 24, 34);
+ modexCopyPageRegion(bg->page, spri->page, player.x-4, player.y-TILEWH-2, player.x-4, player.y-TILEWH-2, 24, 36);
modexShowPage(spri->page);
while(!keyp(1))
{
//when player.tx or player.ty == 0 or player.tx == 20 or player.ty == 15 then stop because that is edge of map and you do not want to walk of the map
//TODO: render the player properly with animation and sprite sheet
+ //TODO: fexible speeds
if(keyp(77))
{
if(bg->tx >= 0 && bg->tx+20 < MAPX && player.tx == bg->tx + 10)
void animatePlayer(map_view_t *mv, map_view_t *src, short d1, short d2, int x, int y, int ls, bitmap_t *bmp)
{
- int qq;
- int lo = ((TILEWH / SPEED) / 3);
- int loo = (ls + lo);
+ short dire=32*d1;
+ short qq;
+ short lo = ((TILEWH / SPEED) / 3);
+ short loo = (ls + lo);
if(d2==0) qq = 0;
else qq = ((ls+1)*SPEED);
{
case 0:
//up
- if(ls<1) { modexCopyPageRegion(mv->page, src->page, x-4, y-qq-TILEWH, x-4, y-qq-TILEWH, 24, 34);
- modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp); }
- if(4>ls && ls>=1) { modexCopyPageRegion(mv->page, src->page, x-4, y-qq-TILEWH, x-4, y-qq-TILEWH, 24, 34);
- modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 48, 0, 24, 32, bmp); }
- if(7>ls && ls>=4) { modexCopyPageRegion(mv->page, src->page, x-4, y-qq-TILEWH, x-4, y-qq-TILEWH, 24, 34);
- modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 0, 0, 24, 32, bmp); }
- if(ls>=7) { modexCopyPageRegion(mv->page, src->page, x-4, y-qq-TILEWH, x-4, y-qq-TILEWH, 24, 34);
- modexDrawSpriteRegion(mv->page, x-4, y-qq-TILEWH, 24, 0, 24, 32, bmp); }
+ x=x-4;
+ y=y-qq-TILEWH;
break;
case 1:
// right
- if(ls<1) { modexCopyPageRegion(mv->page, src->page, x+qq-4, y-TILEWH, x+qq-4, y-TILEWH, 24, 34);// modexWaitBorder();
- modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp); }
- if(4>ls && ls>=1) { modexCopyPageRegion(mv->page, src->page, x+qq-4, y-TILEWH, x+qq-4, y-TILEWH, 24, 34);// modexWaitBorder();
- modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 48, 32, 24, 32, bmp); }
- if(7>ls && ls>=4) { modexCopyPageRegion(mv->page, src->page, x+qq-4, y-TILEWH, x+qq-4, y-TILEWH, 24, 34);// modexWaitBorder();
- modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 0, 32, 24, 32, bmp); }
- if(ls>=7) { modexCopyPageRegion(mv->page, src->page, x+qq-4, y-TILEWH, x+qq-4, y-TILEWH, 24, 34);// modexWaitBorder();
- modexDrawSpriteRegion(mv->page, x+qq-4, y-TILEWH, 24, 32, 24, 32, bmp); }
+ x=x+qq-4;
+ y=y-TILEWH;
break;
case 2:
//down
- if(ls<1) { modexCopyPageRegion(mv->page, src->page, x-4, y+qq-TILEWH-2, x-4, y+qq-TILEWH-2, 24, 34);
- modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp); }
- if(4>ls && ls>=1) { modexCopyPageRegion(mv->page, src->page, x-4, y+qq-TILEWH-2, x-4, y+qq-TILEWH-2, 24, 34);
- modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 48, 64, 24, 32, bmp); }
- if(7>ls && ls>=4) { modexCopyPageRegion(mv->page, src->page, x-4, y+qq-TILEWH-2, x-4, y+qq-TILEWH-2, 24, 34);
- modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 0, 64, 24, 32, bmp); }
- if(ls>=7) { modexCopyPageRegion(mv->page, src->page, x-4, y+qq-TILEWH-2, x-4, y+qq-TILEWH-2, 24, 34);
- modexDrawSpriteRegion(mv->page, x-4, y+qq-TILEWH, 24, 64, 24, 32, bmp); }
+ x=x-4;
+ y=y+qq-TILEWH;
break;
case 3:
//left
- if(ls<1) { modexCopyPageRegion(mv->page, src->page, x-qq-4, y-TILEWH, x-qq-4, y-TILEWH, 24, 34);// modexWaitBorder();
- modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp); }
- if(4>ls && ls>=1) { modexCopyPageRegion(mv->page, src->page, x-qq-4, y-TILEWH, x-qq-4, y-TILEWH, 24, 34);// modexWaitBorder();
- modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 48, 96, 24, 32, bmp); }
- if(7>ls && ls>=4) { modexCopyPageRegion(mv->page, src->page, x-qq-4, y-TILEWH, x-qq-4, y-TILEWH, 24, 34);// modexWaitBorder();
- modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 0, 96, 24, 32, bmp); }
- if(ls>=7) { modexCopyPageRegion(mv->page, src->page, x-qq-4, y-TILEWH, x-qq-4, y-TILEWH, 24, 34);// modexWaitBorder();
- modexDrawSpriteRegion(mv->page, x-qq-4, y-TILEWH, 24, 96, 24, 32, bmp); }
+ x=x-qq-4;
+ y=y-TILEWH;
break;
- }
+ } //TODO: make flexible animation thingy
+ if(ls<1) { modexCopyPageRegion(mv->page, src->page, x, y-2, x, y-2, 24, 36);// modexWaitBorder();
+ modexDrawSpriteRegion(mv->page, x, y, 24, dire, 24, 32, bmp); }else
+ if(4>ls && ls>=1) { modexCopyPageRegion(mv->page, src->page, x, y-2, x, y-2, 24, 36);// modexWaitBorder();
+ modexDrawSpriteRegion(mv->page, x, y, 48, dire, 24, 32, bmp); }else
+ if(7>ls && ls>=4) { modexCopyPageRegion(mv->page, src->page, x, y-2, x, y-2, 24, 36);// modexWaitBorder();
+ modexDrawSpriteRegion(mv->page, x, y, 0, dire, 24, 32, bmp); }else
+ if(8>=ls && ls>=7) { modexCopyPageRegion(mv->page, src->page, x, y-2, x, y-2, 24, 36);// modexWaitBorder();
+ modexDrawSpriteRegion(mv->page, x, y, 24, dire, 24, 32, bmp); }else ls-=ls;
}