X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Fzcroll.c;h=92f54d09dc71db352c385db40e2e6e82a7297ef7;hb=b070d62525540bfa0792d019e0b14fa08c96b987;hp=024e5ff09c71e9556393064ddd7f51d60eaf445f;hpb=bcb4483eef0a8886e23085d7f477319cbc7152f3;p=16.git diff --git a/src/zcroll.c b/src/zcroll.c index 024e5ff0..92f54d09 100755 --- a/src/zcroll.c +++ b/src/zcroll.c @@ -25,22 +25,16 @@ #include "src/lib/16render.h" #include "src/lib/16_dbg.h" -#define MODEXZ - //bitmap_t p; static map_t map; map_view_t mv[4]; float t; sword bakapee; -pan_t pan; //debugswitches boolean panswitch=0,baka=0; //extern boolean pageflipflop=1; unsigned int i; -//static int persist_aniframe = 0; /* gonna be increased to 1 before being used, so 0 is ok for default */ -//map_view_db_t pgid[4]; -word pg; #ifdef FADE static word paloffset=0; byte *dpal; @@ -56,12 +50,9 @@ void main(int argc, char *argv[]) if(argv[1]) bakapee = atoi(argv[1]); else bakapee = 1; - player[0].data = _fmalloc(72*128); //TODO use exmm - *player[0].data = bitmapLoadPcx("data/chikyuu.pcx", &gvar); // load sprite - Startup16(&gvar); - pan.pn=0; + gvar.video.panp=0; // OK, this one takes hellova time and needs to be done in farmalloc or MM_... //IN CA i think you use CAL_SetupGrFile but i do think we should work together on this part --sparky4 @@ -70,18 +61,17 @@ void main(int argc, char *argv[]) player[0].ent->spri->spritesheet = malloc(sizeof(struct vrs_container)); // create the map - fprintf(stderr, "testing map load~ "); +// fprintf(stderr, "testing map load~ "); loadmap("data/test.map", &map); chkmap(&map, 0); - printf("chkmap ok "); - fprintf(stderr, "yay map loaded~~\n"); +// printf("chkmap ok "); +// fprintf(stderr, "yay map loaded~~\n"); // data read_vrs(&gvar, "data/spri/chikyuu.vrs", player[0].ent->spri->spritesheet); -// player[0].data = malloc(72*128); //TODO use exmm -// *player[0].data = bitmapLoadPcx("data/chikyuu.pcx", &gvar); // load sprite + PCXBMP = bitmapLoadPcx("data/chikyuu.pcx", &gvar); // load sprite - // input! + // input! IN_Default(0, &player,ctrl_Keyboard1); // save the palette @@ -90,14 +80,16 @@ void main(int argc, char *argv[]) modexPalSave(dpal); modexFadeOff(4, dpal); #endif - //textInit(); + VGAmodeX(bakapee, 1, &gvar); -#ifdef MODEXZ + + /* fix up the palette and everything */ #ifdef FADE modexPalBlack(); //reset the palette~ #endif - CA_LoadFile("data/spri/chikyuu.pal", &pal, &gvar); - modexPalUpdate1(pal); + modexPalUpdate1(&PCXBMP->palette); +// CA_LoadFile("data/spri/chikyuu.pal", &pal, &gvar); +// modexPalUpdate1(pal); #ifdef FADE gpal = modexNewPal(); modexPalSave(gpal); @@ -107,24 +99,14 @@ void main(int argc, char *argv[]) // setup camera and screen~ modexHiganbanaPageSetup(&gvar.video); - for(i=0;ispri->x = player[0].ent->spri->y = 20; + ZC_MVSetup(&mv, &map, &gvar); + player[0].ent->spri->x = player[0].ent->spri->y = TILEWH; // set up paging //TODO: LOAD map data and position the map in the middle of the screen if smaller then screen - mapGoTo(mv, 0, 0); -#endif + mapGoTo(&mv, 0, 0); - //TODO: put player in starting position of spot - //default player position on the viewable map - player[0].tx = mv[0].tx + mv[0].page->tilemidposscreenx; - player[0].ty = mv[0].ty + mv[0].page->tilemidposscreeny; + playerXYpos(0, 0, &player, &mv, 0); IN_initplayer(&player, 0); i = set_anim_by_id(player[0].ent->spri, 11); @@ -139,17 +121,16 @@ void main(int argc, char *argv[]) modexFadeOn(4, dpal); #endif } - //animate_spri((player[0].ent->spri), &gvar); + animate_spri((player[0].ent->spri), &gvar); - modexShowPage(mv[0].page);//!(gvar.video.p) - shinku_fps_indicator_page = 0; // we're on page 1 now, shinku(). follow along please or it will not be visible. + VL_ShowPage(mv[0].page, 0, 0);//modexShowPage(mv[0].page);//!(gvar.video.p) #ifdef FADE modexFadeOn(4, gpal); #endif /*strcpy(global_temp_status_text, "press enter for the loop of zcroll\nescape to quit"); modexprint(&gvar.video.page[0], 144, 72, 1, 7, 0, global_temp_status_text); while(!IN_KeyDown(sc_Enter)){ if(IN_KeyDown(sc_Escape)) goto quit; } IN_UserInput(1,1);*///wwww - while(!IN_KeyDown(sc_Escape))// && player[0].hp>0) + while(!IN_KeyDown(sc_Escape))// && player[0].enti.hp>0) { shinku(&gvar); //top left corner & bottem right corner of map veiw be set as map edge trigger since maps are actually square @@ -159,8 +140,8 @@ void main(int argc, char *argv[]) //player movement IN_ReadControl(0, &player); if(!panswitch){ - //ZC_walk(player[0].ent, mv); - walk(mv, &player, 0); + //ZC_walk2(player[0].ent, mv); + ZC_walk(&mv, &player, 0); } //the scripting stuff.... @@ -173,9 +154,9 @@ void main(int argc, char *argv[]) } nosound(); } - if(player[0].q == (TILEWH/(player[0].speed))+1 && player[0].info.dir != 2 && (player[0].triggerx == 5 && player[0].triggery == 5)){ player[0].hp--; } + if(player[0].enti.q == (TILEWH/(player[0].speed))+1 && player[0].info.dir != 2 && (player[0].triggerx == 5 && player[0].triggery == 5)){ player[0].enti.hp--; } */ //debugging binds! - if(IN_KeyDown(2)){ modexShowPage(mv[0].page); pan.pn=0; } + if(IN_KeyDown(2)){ modexShowPage(mv[0].page); gvar.video.panp=0; } if(IN_KeyDown(25)){ modexpdump(mv[0].page); IN_UserInput(1,1); } //p @@ -184,7 +165,7 @@ void main(int argc, char *argv[]) if(IN_KeyDown(22)){ modexPalUpdate0(gpal); } //u //pan switch - if(IN_KeyDown(88)){panswitch=!panswitch; IN_UserInput(1,1);} //f12 + //if(IN_KeyDown(88)){panswitch=!panswitch; IN_UserInput(1,1);} //f12 if(IN_KeyDown(87)) //f11 { pageflipflop=!pageflipflop; @@ -207,28 +188,23 @@ void main(int argc, char *argv[]) { case 11: i=0; - player[0].ent->spri->x = 0; + player[0].ent->spri->x = TILEWH; default: i++; - player[0].ent->spri->delay = 1; animate_spri((player[0].ent->spri), &gvar); player[0].ent->spri->x += 20; + player[0].ent->spri->delay = 1; animate_spri((player[0].ent->spri), &gvar);// player[0].ent->spri->x += 16; break; } } - //TODO fmemtest into page - /*if(IN_KeyDown(4+1)) //4 - { - pg=1; - SELECT_ALL_PLANES(); - _fmemset(((mv[pg].page->data+4)+(16*(mv[pg].page->width/4))), 15, 4); - }*/ + FUNCTIONKEYFUNCTIONS; //9 #ifdef FADE if(IN_KeyDown(10)){ modexPalOverscan(rand()%56); modexPalUpdate1(dpal); IN_UserInput(1,1); } - //if(IN_KeyDown(11)){ modexPalOverscan(15); } #endif - if((player[0].q==1) && !(player[0].x%TILEWH==0 && player[0].y%TILEWH==0)) break; //incase things go out of sync! - player[0].hp = 0; + if(IN_KeyDown(sc_R)){ modexPalOverscan(rand()%56); } //r + + if((player[0].enti.q==1) && !(player[0].enti.x%TILEWH==0 && player[0].enti.y%TILEWH==0)) break; //incase things go out of sync! + player[0].enti.hp = 0; } /* fade back to text mode */