X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Fzcroll.c;h=147555b8dd90e1c814e0579b7fa532a3fa88655b;hb=d03215b6373268416dd879c8bb5b0b1f0c8e9309;hp=e056fdec17d2c5fcac0a9b7a6344fc480bb5df29;hpb=3d9ea008913982140abaa755866ae19532ec71f6;p=16.git diff --git a/src/zcroll.c b/src/zcroll.c index e056fdec..147555b8 100755 --- a/src/zcroll.c +++ b/src/zcroll.c @@ -43,6 +43,8 @@ byte *gpal; byte *ptr; memptr pal; +bitmap_t *ptmpdata; + void main(int argc, char *argv[]) { static global_game_variables_t gvar; @@ -56,9 +58,9 @@ void main(int argc, char *argv[]) // 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 - player[0].ent = malloc(sizeof(entity_t)); - player[0].ent->spri = malloc(sizeof(struct sprite)); - player[0].ent->spri->spritesheet = malloc(sizeof(struct vrs_container)); + //player[0].ent = malloc(sizeof(entity_t)); + player[0].enti.spri = malloc(sizeof(struct sprite)); + player[0].enti.spri->spritesheet = malloc(sizeof(struct vrs_container)); // create the map // fprintf(stderr, "testing map load~ "); @@ -68,7 +70,7 @@ void main(int argc, char *argv[]) // fprintf(stderr, "yay map loaded~~\n"); // data - read_vrs(&gvar, "data/spri/chikyuu.vrs", player[0].ent->spri->spritesheet); + read_vrs(&gvar, "data/spri/chikyuu.vrs", player[0].enti.spri->spritesheet); PCXBMP = bitmapLoadPcx("data/chikyuu.pcx", &gvar); // load sprite // input! @@ -102,22 +104,20 @@ void main(int argc, char *argv[]) ZC_MVSetup(&mv, &map, &gvar); //renderswitch - gvar.video.rs=1; - //player[0].ent->spri->x = player[0].ent->spri->y = TILEWH; + gvar.video.rss=0; // 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); playerXYpos(0, 0, &player, &mv, 0); - 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; + EN_initplayer(&player, 0); + player[0].enti.spri->x = player[0].enti.x-4; + player[0].enti.spri->y = player[0].enti.y-16; 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); + gvar.video.sprifilei = set_anim_by_id(player[0].enti.spri, player[0].enti.dire); + //print_anim_ids(player[0].enti.spri); if (gvar.video.sprifilei == -1) { #ifdef FADE @@ -128,7 +128,7 @@ void main(int argc, char *argv[]) modexFadeOn(4, dpal); #endif } - animate_spri((player[0].ent->spri), &gvar.video); + animate_spri(&(player[0].enti), &gvar.video); VL_ShowPage(mv[0].page, 0, 0);//modexShowPage(mv[0].page);//!(gvar.video.p) #ifdef FADE @@ -137,7 +137,7 @@ void main(int argc, char *argv[]) /*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].enti.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 @@ -195,15 +195,17 @@ void main(int argc, char *argv[]) { case 11: i=0; - player[0].ent->spri->x = TILEWH; + player[0].enti.spri->x = TILEWH; default: i++; - player[0].ent->spri->delay = 0; animate_spri((player[0].ent->spri), &gvar.video);// player[0].ent->spri->x += 16; + animate_spri(&(player[0].enti), &gvar.video);// player[0].enti.spri->x += 16; break; } } FUNCTIONKEYFUNCTIONS; if(IN_KeyDown(sc_L)){ modexClearRegion(&gvar.video.page[0], player[0].enti.x, player[0].enti.y, 16, 16, 1); } + if(IN_KeyDown(sc_J)){ read_vrs(&gvar, "data/spri/ptmp.vrs", player[0].enti.spri->spritesheet); *ptmpdata = bitmapLoadPcx("data/ptmp.pcx", &gvar); modexPalUpdate1(ptmpdata->palette); } + if(IN_KeyDown(sc_K)){ read_vrs(&gvar, "data/spri/chikyuu.vrs", player[0].enti.spri->spritesheet); PCXBMP = bitmapLoadPcx("data/chikyuu.pcx", &gvar); modexPalUpdate1(&PCXBMP->palette); } //9 #ifdef FADE @@ -212,7 +214,6 @@ void main(int argc, char *argv[]) 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 */