X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fscroll16.h;h=8f613c2f8b7857a19b4b52c82ea8d279b0b027d3;hb=6021fc3f27b895d382fbd30488ead35657e39196;hp=546fbe2929850ad3f25b1c0b21d0f8431749ae7c;hpb=cecbe84f7c61a26fa2285fc125839b2ff50a7f51;p=16.git diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h index 546fbe29..8f613c2f 100755 --- a/src/lib/scroll16.h +++ b/src/lib/scroll16.h @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2017 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover + * Copyright (C) 2012-2018 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -29,8 +29,7 @@ #include "src/lib/16_vl.h" #include "src/lib/16_in.h" #include "src/lib/16_map.h" //map is loaded here www -#include "src/lib/16render.h" -//#include "src/lib/16_map.h" //new map stuff +//#include "src/lib/16render.h" #include "src/lib/16_timer.h" #include "src/lib/wcpu/16_wcpu.h" #include "src/lib/16_spri.h" @@ -42,9 +41,11 @@ #define SPRITE //#define TILERENDER -#define SHOWFPS + +//0000#define SHOWFPS //#define OLDWALKSHOWPAGESTUFF + #define PLAYERBMPDATAVAR gvar.player[pn].data #define PLAYERBMPDATA *PLAYERBMPDATAVAR #define PLAYERBMPDATAPTR PLAYERBMPDATAVAR @@ -55,15 +56,23 @@ //row and colum drawing routines #define FULLRCREND +//#ifdef FULLRCREND #define DRAWCOLNUM mv->page[id].dx #define DRAWROWNUM mv->page[id].dy -//#define DRAWCOLNUM pl[plid].enti.q -//#define DRAWROLNUM pl[plid].enti.q +//#else +//#define DRAWCOLNUM player[plid].enti.q +//#define DRAWROWNUM player[plid].enti.q +//#endif //for null map! #define MAPW 40 #define MAPH 30 +extern struct glob_game_vars *ggvv; +#ifdef __DEBUG_RF__ +#define DBG_RFDELAYMETHOD delay(500); +#endif + //===========================================================================// //if(gvar.player[0].enti.hp==0) printf("%d wwww\n", gvar.player[0].enti.y+8); @@ -79,10 +88,12 @@ //printf("middle tile position: %dx", gvar.video.page[0].tilemidposscreenx); printf("%d\n", gvar.video.page[0].tilemidposscreeny); //printf(" aniframe=%u", gvar.player[0].enti.persist_aniframe); //printf("mv[0]txy: %dx%d ", mv[0].tx, mv[0].ty); printf("mv[1]txy: %dx%d", mv[1].tx, mv[1].ty); -#define SCROLLEXITMESG printf("page[0]dxy: %dx%d", gvar.video.page[0].dx, gvar.video.page[0].dy);\ +// printf("page[0]dxy: %dx%d", gvar.video.page[0].dx, gvar.video.page[0].dy); +#define SCROLLEXITMESG \ + printf("size of mmblocktype: %u ", sizeof(mmblocktype));\ printf("\n\n");\ printf("player vars:\n");\ - printf(" xy: %dx%d", gvar.player[0].enti.x, gvar.player[0].enti.y); printf(" txy: %dx%d", gvar.player[0].enti.tx, gvar.player[0].enti.ty); printf(" triggxy: %dx%d", gvar.player[0].enti.triggerx, gvar.player[0].enti.triggery); printf(" value: %d\n", gvar.mv[1].map->layerdata[0].data[(gvar.player[0].enti.triggerx-1)+(map.width*(gvar.player[0].enti.triggery-1))]);\ + printf(" xy: %dx%d", gvar.player[0].enti.x, gvar.player[0].enti.y); printf(" txy: %dx%d", gvar.player[0].enti.tx, gvar.player[0].enti.ty); printf(" triggxy: %dx%d", gvar.player[0].enti.triggerx, gvar.player[0].enti.triggery); printf(" value: %d\n", gvar.mv[1].map->layerdata[0].data[(gvar.player[0].enti.triggerx-1)+(gvar.map.width*(gvar.player[0].enti.triggery-1))]);\ printf(" hp: %d", (gvar.player[0].enti.hp)); printf(" q: %u", gvar.player[0].enti.q); printf(" info.dir: %u", gvar.player[0].info.dir); printf(" d: %u", gvar.player[0].enti.d); printf(" dire: %u", gvar.player[0].enti.dire);\ printf(" pdir: %u\n", gvar.player[0].pdir); printf(" delay=%u", gvar.player[0].enti.spri.delay);\ printf("\n\n");\ @@ -91,9 +102,9 @@ printf("\n\n");\ printf("gvar.video:\n");\ printf(" r=%u ", gvar.video.dorender);\ printf("bgps=%u ", gvar.video.vga_state.bgps);\ - printf("dbg_delayanimation=%u ", dbg_delayanimation);\ printf("\n\n"); +// printf("dbg_delayanimation=%u ", dbg_delayanimation); /* if(IN_KeyDown(sc_F11)){ pagedelayrendermap=!pagedelayrendermap; IN_UserInput(1, &gvar); } if(IN_KeyDown(sc_F10)){ gvar.kurokku.fpscap=!gvar.kurokku.fpscap; IN_UserInput(1, &gvar); } @@ -106,30 +117,30 @@ extern char global_temp_status_text[512]; extern char global_temp_status_text2[512]; void initMap(map_t *map); -void ZC_walk(map_view_t *pip, player_t *player, word pn); +void ZC_walk(global_game_variables_t *gvar, word pn); void ZC_panPageManual(map_view_t *pip, player_t *player, word pn); void ZC_MVSetup(map_view_t *pip, map_t *map, global_game_variables_t *gv); void ZC_MVInit(map_view_t *pip, int tx, int ty); -void ZC_ShowMV(map_view_t *moo, boolean vsync, boolean sr); +//void ZC_ShowMV(map_view_t *moo, boolean vsync, boolean sr); void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid); void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid); void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid); void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid); void ZC_mapScroll(map_view_t *mv, player_t *player, word pn); -void ZC_PlayerXYpos(int x, int y, player_t *player, map_view_t *pip, nibble pn, boolean defaultsw); +void ZC_PlayerXYpos(int x, int y, player_t *player, map_view_t *pip, boolean defaultsw); sword chkmap(map_t *map, word q); void mapGoTo(map_view_t *mv, int tx, int ty); void ZC_mapinitMV(map_view_t *mv, int tx, int ty); void ZC_mapredraw(map_view_t *mv, int tx, int ty); void near mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y); -void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *player, word poopoffset); -void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *player, word poopoffset); +void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *player); +void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *player); void mapDrawWRow(map_view_t *mv, int tx, int ty, word y); void mapDrawWCol(map_view_t *mv, int tx, int ty, word x); inline void near ScrollRight(map_view_t *mv, player_t *pl, word id, word plid) { /* increment the pixel position and update the page */ - mv[id].page->dx += pl[plid].enti.speed; + mv[id].page->dx += pl[plid].enti.spt; /* check to see if this changes the tile */ if(mv[id].page->dx >= mv[id].dxThresh ) @@ -146,7 +157,7 @@ inline void near ScrollRight(map_view_t *mv, player_t *pl, word id, word plid) inline void near ScrollLeft(map_view_t *mv, player_t *pl, word id, word plid) { /* decrement the pixel position and update the page */ - mv[id].page->dx -= pl[plid].enti.speed; + mv[id].page->dx -= pl[plid].enti.spt; /* check to see if this changes the tile */ if(mv[id].page->dx == 0) @@ -163,7 +174,7 @@ inline void near ScrollLeft(map_view_t *mv, player_t *pl, word id, word plid) inline void near ScrollUp(map_view_t *mv, player_t *pl, word id, word plid) { /* decrement the pixel position and update the page */ - mv[id].page->dy -= pl[plid].enti.speed; + mv[id].page->dy -= pl[plid].enti.spt; /* check to see if this changes the tile */ if(mv[id].page->dy == 0 ) @@ -180,7 +191,7 @@ inline void near ScrollUp(map_view_t *mv, player_t *pl, word id, word plid) inline void near ScrollDown(map_view_t *mv, player_t *pl, word id, word plid) { /* increment the pixel position and update the page */ - mv[id].page->dy += pl[plid].enti.speed; + mv[id].page->dy += pl[plid].enti.spt; /* check to see if this changes the tile */ if(mv[id].page->dy >= mv[id].dyThresh ) @@ -209,4 +220,6 @@ void walk_player(player_t *player, map_view_t *map_v); // Scroll map in one direction (assumed from gvar.player's movement) void mapScroll(map_view_t *mv, player_t *player); +void ZC_GirdChk (global_game_variables_t *gvar, player_t *player); + #endif /*__SCROLL16_H_*/