]> 4ch.mooo.com Git - 16.git/commitdiff
showing row and colum drawing i optimized it to only draw at the end of walk. this...
authorsparky4 <sparky4@cock.li>
Thu, 26 Jan 2017 19:36:49 +0000 (13:36 -0600)
committersparky4 <sparky4@cock.li>
Thu, 26 Jan 2017 19:36:49 +0000 (13:36 -0600)
src/0.c
src/lib/16_tail.h
src/lib/16_tdef.h
src/lib/16_vl.c
src/lib/scroll16.c
src/test.c

diff --git a/src/0.c b/src/0.c
index 7d54058ff3db23757330535bc49ba6d0d73e811e..092586835f0b4027639f99c026dc91cc0624def5 100755 (executable)
--- a/src/0.c
+++ b/src/0.c
@@ -88,10 +88,10 @@ int main(int argc,char **argv)
        /* setup camera and screen~ */\r
        modexHiganbanaPageSetup(&gvar.video);\r
        ZC_MVSetup(&mv, &map, &gvar);\r
-       ZC_ShowMV(&mv, gvar.video.p, 0);\r
+       ZC_ShowMV(&mv, gvar.video.sp, 0);\r
 \r
 //     VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw);\r
-       VL_PatternDraw(&gvar.video, 0/*gvar.video.p*/, 0, 1);\r
+       VL_PatternDraw(&gvar.video, 0/*gvar.video.sp*/, 0, 1);\r
        TESTBG34\r
        DRAWCORNERBOXES\r
 \r
@@ -132,7 +132,7 @@ int main(int argc,char **argv)
                        if(IN_KeyDown(sc_R)){\r
                                gvar.video.page[0].dx=gvar.video.page[0].dy=gvar.video.page[1].dx=gvar.video.page[1].dy=16;\r
                                mv[0].tx = mv[0].ty = mv[1].tx = mv[1].ty = INITTNUM;\r
-                               VL_ShowPage(&gvar.video.page[gvar.video.p], 1, 0);\r
+                               VL_ShowPage(&gvar.video.page[gvar.video.sp], 1, 0);\r
                                player[0].enti.q = 1; player[0].enti.d = 2;\r
                                x=y=0;\r
                                xdir=ydir=1;\r
index 02d2ea8bae86cb9063de0dd536094e62076cc9e5..22d51178b708be1b085b989e50d49d74a05d2ce3 100755 (executable)
@@ -31,9 +31,6 @@
 #include "src/lib/16_in.h"\r
 #include "src/lib/testpatt.h"\r
 \r
-//VL_ShowPage(&gvar.video.page[gvar.video.p], 0, 1);\r
-//VL_ShowPage(&gvar.video.page[gvar.video.p], 0, 0);\r
-\r
 #define FUNCTIONKEYFUNCTIONS \\r
        if(IN_KeyDown(88)){ panswitch=!panswitch;                                                       IN_UserInput(1,1); } \\r
        FUNCTIONKEYFUNCTIONS0EXE\r
        ZC_panPageManual(&mv, &player, 0);\r
 \r
 #define FUNCTIONKEYDRAWJUNK \\r
-       if(IN_KeyDown(1+1)){ gvar.video.p=0; ZC_ShowMV(&mv, 0, 0); } \\r
-       if(IN_KeyDown(2+1)){ gvar.video.p=1; ZC_ShowMV(&mv, 0, 0); } \\r
-       if(IN_KeyDown(3+1)){ gvar.video.p=2; ZC_ShowMV(&mv, 0, 1); } \\r
-       if(IN_KeyDown(4+1)){ gvar.video.p=3; ZC_ShowMV(&mv, 0, 1); } \\r
+       if(IN_KeyDown(1+1)){ gvar.video.sp=0; ZC_ShowMV(&mv, 0, 0); } \\r
+       if(IN_KeyDown(2+1)){ gvar.video.sp=1; ZC_ShowMV(&mv, 0, 0); } \\r
+       if(IN_KeyDown(3+1)){ gvar.video.sp=2; ZC_ShowMV(&mv, 0, 1); } \\r
+       if(IN_KeyDown(4+1)){ gvar.video.sp=3; ZC_ShowMV(&mv, 0, 1); } \\r
        FUNCTIONKEYDRAWJUNKNOMV\r
 \r
 #define FUNCTIONKEYDRAWJUNKNOMV \\r
index 24bab8bd0bdf104433934164e627a26b0e58353c..00703652f7599b56fe54a777d4f57f661e6884bb 100755 (executable)
@@ -272,7 +272,7 @@ typedef struct
        //end of doslib origi vars\r
        boolean __near rss;                     //render sprite switch\r
        sword __near sprifilei;         //player file's i\r
-       nibble __near p;                        //render page number //BLEH\r
+       nibble __near p,sp;                     //render page number    //show page number(for showpage)\r
        boolean __near r;                       //page flip, showpage, or render        if true\r
        word pr[MAXPAGE][4];    //render sections of pages (this is supposed to be set up to draw sections of the screen if updated)\r
 \r
index df73fb6164fbd8494d6e75c35f94124d2383b72f..59ce49aa30117061d9f2ecff29346c9829efd15b 100755 (executable)
@@ -249,9 +249,9 @@ modexNextPageFlexibleSize(page_t *p, word x, word y)
        result.tilesw=result.width/TILEWH;\r
        result.tilesh=result.height/TILEWH;\r
        result.id = p->id+1;\r
-       result.stridew=p->sw/4;//result.width/4;\r
+       result.stridew=result.width/4;//p->sw/4;\r
        result.pagesize = (word)(result.stridew)*result.height;\r
-       switch(result.id)\r
+/*     switch(result.id)\r
        {\r
                case 2:\r
                        result.pi=p->width*4;\r
@@ -259,7 +259,8 @@ modexNextPageFlexibleSize(page_t *p, word x, word y)
                case 3:\r
                        result.pi=p->pi;\r
                break;\r
-       }\r
+       }*/\r
+       result.pi=result.width*4;\r
 \r
        return result;\r
 }\r
@@ -289,7 +290,7 @@ void modexHiganbanaPageSetup(video_t *video)
        (video->page[2]) = modexNextPageFlexibleSize(&(video->page[1]), video->page[0].width, 96);      video->num_of_pages++;\r
        (video->page[3]) = modexNextPageFlexibleSize(&(video->page[2]), video->page[0].width, 96);      video->num_of_pages++;\r
        modexCalcVmemRemain(video);\r
-       video->p=0;\r
+       video->sp=video->p=0;\r
        video->r=1;\r
        video->vh=video->page[0].height+video->page[1].height+video->page[3].height-8;//+video->page[2].height\r
        //doslib origi var\r
index 868cff639b2b290d396c2b749b59a28286d7f32d..d6d7875e3f7c8eb5a2485cda7cceefbd0ac674b4 100755 (executable)
@@ -258,6 +258,7 @@ void ZC_MVSetup(map_view_t *pip, map_t *map, global_game_variables_t *gv)
        pip[0].map = map;\r
        pip[0].video = &gv->video;\r
        pip[0].p        = &gv->video.p;\r
+       pip[0].sp       = &gv->video.sp;\r
        ZC_MVInit(pip, 1, 1);\r
 \r
        for(i=ZC_MVI;i<gv->video.num_of_pages;i++)\r
@@ -266,6 +267,7 @@ void ZC_MVSetup(map_view_t *pip, map_t *map, global_game_variables_t *gv)
                pip[i].map      =       pip[0].map;\r
                pip[i].video    =       pip[0].video;\r
                pip[i].p        =       pip[0].p;\r
+               pip[i].sp       =       pip[0].sp;\r
 //             if(i>ZC_MVI) {\r
                pip[i].tx =     1;\r
                pip[i].ty =     1;\r
@@ -287,7 +289,7 @@ void ZC_ShowMV(map_view_t *moo, boolean vsync, boolean sr)
        byte crtcOffset;\r
 \r
        /* calculate offset */\r
-       offset = (word) moo[moo[0].video->p].page->data;\r
+       offset = (word) moo[moo[0].video->sp].page->data;\r
        offset += moo[0].page->dy * (moo[0].page->width >> 2 );\r
        offset += moo[0].page->dx >> 2;\r
 \r
@@ -295,7 +297,7 @@ void ZC_ShowMV(map_view_t *moo, boolean vsync, boolean sr)
        switch(sr)\r
        {\r
                case 1:\r
-                       crtcOffset = moo[moo[0].video->p].page->sw >> 3;\r
+                       crtcOffset = moo[moo[0].video->sp].page->sw >> 3;\r
                break;\r
                default:\r
                case 0:\r
@@ -889,7 +891,7 @@ void shinku(global_game_variables_t *gv)
                //_fmemcpy((gv->video.page[(gv->video.p)]).data, (gv->video.page[(!gv->video.p)]).data, gv->video.page[(!gv->video.p)].pagesize);\r
                //vga_restore_rm0wm0();\r
 //             if(!pageploop) modexCopyPageRegion(&(gv->video.page[(gv->video.p)]), &(gv->video.page[(!gv->video.p)]), 0, 0, 0, 0, gv->video.page[gv->video.p].width, gv->video.page[!gv->video.p].height);\r
-               VL_ShowPage(&(gv->video.page[gv->video.p]), gv->kurokku.fpscap, 0);//VL_ShowPage(&(gv->video.page[gv->video.p]), gv->kurokku.fpscap, 0);\r
+               VL_ShowPage(&(gv->video.page[gv->video.sp]), gv->kurokku.fpscap, 0);\r
 //             if(!pageploop) gv->video.p=!gv->video.p;\r
                gv->video.r =!gv->video.r ;\r
                //0000gv->video.tickclk = ((*clockw)-gv->video.startclk)/18.2;\r
index 9bdd8a6ffe834b2ac8cf7c11111e68a42f191517..190b396b2b7cf8a1b03dd8a2005c3a5bba79bfc8 100755 (executable)
@@ -129,7 +129,7 @@ void main(int argc, char *argv[])
        {\r
                IN_ReadControl(0,&player);\r
                ZC_panPageManual(&mv, &player, 0);\r
-               //[gvar.video.p]\r
+               //[gvar.video.sp]\r
                //ZC_MVSync(&mv);\r
 \r
                /*if(i<5){\r
@@ -138,23 +138,23 @@ void main(int argc, char *argv[])
                        case 0:\r
                                pee:\r
                                // go right\r
-                               gvar.video.page[gvar.video.p].dx++;\r
+                               gvar.video.page[gvar.video.sp].dx++;\r
                                if(i==5){ if(j>=31){ i++; j=0; goto baka; }else j++; }else\r
                                if(j>=32){ k++; j=0; }else j++;\r
                        break;\r
                        case 1:\r
                                // go left\r
-                               gvar.video.page[gvar.video.p].dx--;\r
+                               gvar.video.page[gvar.video.sp].dx--;\r
                                if(j>=32){ k++; j=0; }else j++;\r
                        break;\r
                        case 2:\r
                                // go up\r
-                               gvar.video.page[gvar.video.p].dy++;\r
+                               gvar.video.page[gvar.video.sp].dy++;\r
                                if(j>=32){ k++; j=0; }else j++;\r
                        break;\r
                        case 3:\r
                                // go down\r
-                               gvar.video.page[gvar.video.p].dy--;\r
+                               gvar.video.page[gvar.video.sp].dy--;\r
                                if(j>=32){ k=0; j=0; i++; }else j++;\r
                        break;\r
                        default:\r
@@ -188,8 +188,8 @@ void main(int argc, char *argv[])
                        }\r
 //                     if(i>PAL_SIZE) i=0;\r
                }//9*/\r
-               if(IN_KeyDown(25)){ modexpdump(&gvar.video.page[gvar.video.p]); IN_UserInput(1,1); }//p\r
-               //VL_ShowPage(&gvar.video.page[gvar.video.p], 0, 0);\r
+               if(IN_KeyDown(25)){ modexpdump(&gvar.video.page[gvar.video.sp]); IN_UserInput(1,1); }//p\r
+               //VL_ShowPage(&gvar.video.page[gvar.video.sp], 0, 0);\r
                ZC_ShowMV(&mv, 0, 0);\r
        }\r
 \r
@@ -203,7 +203,7 @@ void main(int argc, char *argv[])
        printf("Project 16 test.exe. This is just a test file!\n");\r
        printf("version %s\n", VERSION);\r
        VL_PrintmodexmemInfo(&gvar.video);\r
-       printf("tx=%d   ", mv[gvar.video.p].tx); printf("ty=%d  ", mv[gvar.video.p].ty); printf("player.d=%d\n", player[0].enti.d);\r
+       printf("tx=%d   ", mv[gvar.video.sp].tx); printf("ty=%d ", mv[gvar.video.sp].ty); printf("player.d=%d\n", player[0].enti.d);\r
        //IN_Shutdown();\r
        //====modexPalBlack();\r
        //====modexFadeOn(1, pal);\r