]> 4ch.mooo.com Git - 16.git/commitdiff
modified: 16/modex16/pcxtest.exe
authorsparky4 <sparky4@cock.li>
Fri, 21 Nov 2014 02:07:32 +0000 (20:07 -0600)
committersparky4 <sparky4@cock.li>
Fri, 21 Nov 2014 02:07:32 +0000 (20:07 -0600)
modified:   16/modex16/scroll.c
modified:   16/modex16/scroll.exe
modified:   16/modex16/test.exe
modified:   16/modex16/test2.exe

added player struct  about to do some serious stuff

16/modex16/pcxtest.exe
16/modex16/scroll.c
16/modex16/scroll.exe
16/modex16/test.exe
16/modex16/test2.exe

index 20910efc5256fe0850a970f771f3855eac8beaf9..de765ece05216f2d419837866388d044bac54429 100644 (file)
Binary files a/16/modex16/pcxtest.exe and b/16/modex16/pcxtest.exe differ
index b7a3846cbb04357d18542aa721d254c2cf184895..602a63befaa72bc37de4555b0ede8ee2104a010a 100644 (file)
@@ -31,7 +31,10 @@ typedef struct {
        word dyThresh;\r
 } map_view_t;\r
 \r
-\r
+struct {\r
+       int tilex;\r
+       int tiley;\r
+} player;\r
 \r
 \r
 map_t allocMap(int w, int h);\r
@@ -44,7 +47,9 @@ void mapGoTo(map_view_t *mv, int tx, int ty);
 void mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y);\r
 void mapDrawRow(map_view_t *mv, int tx, int ty, word y);\r
 void mapDrawCol(map_view_t *mv, int tx, int ty, word x);\r
-\r
+
+#define TILEWH 16
+#define QUADWH (TILEWH/4)\r
 #define SWAP(a, b) tmp=a; a=b; b=tmp;\r
 void main() {\r
        int show1=1;\r
@@ -57,8 +62,10 @@ void main() {
        map_t map;\r
        map_view_t mv, mv2;\r
        map_view_t *draw, *show, *tmp;\r
-       byte *ptr;\r
-       \r
+       byte *ptr;
+       //default player position on the viewable map\r
+       player.tilex = 10;
+       player.tiley = 8;\r
 \r
        setkb(1);\r
        /* create the map */\r
@@ -85,42 +92,43 @@ void main() {
 \r
        while(!keyp(1)) {\r
        if(keyp(77)){\r
-               for(q=0; q<16; q++) {\r
+//             for(q=0; q<TILEWH; q++) {\r
                mapScrollRight(draw, 1);\r
-               modexShowPage(draw->page);\r
+//             modexShowPage(draw->page);\r
 //             mapScrollRight(draw, 1);\r
 //             SWAP(draw, show);\r
-               }\r
+//             }\r
        }\r
 \r
        if(keyp(75)){\r
-               for(q=0; q<16; q++) {\r
+//             for(q=0; q<TILEWH; q++) {\r
                mapScrollLeft(draw, 1);\r
-               modexShowPage(draw->page);\r
+//             modexShowPage(draw->page);\r
 //             mapScrollLeft(show, 1);\r
 //             SWAP(draw, show);\r
-               }\r
+//             }\r
        }\r
 \r
        if(keyp(80)){\r
-               for(q=0; q<16; q++) {\r
+//             for(q=0; q<TILEWH; q++) {\r
                mapScrollDown(draw, 1);\r
-               modexShowPage(draw->page);\r
+//             modexShowPage(draw->page);\r
 //             mapScrollDown(show, 1);\r
 //             SWAP(draw, show);\r
-               }\r
+//             }\r
        }\r
 \r
        if(keyp(72)){\r
-               for(q=0; q<16; q++) {\r
+//             for(q=0; q<TILEWH; q++) {\r
                mapScrollUp(draw, 1);\r
-               modexShowPage(draw->page);\r
+//             modexShowPage(draw->page);\r
 //             mapScrollUp(show, 1);\r
 //             SWAP(draw, show);\r
-               }\r
+//             }\r
        }\r
 \r
-       //keyp(ch);\r
+       //keyp(ch);
+       modexShowPage(draw->page);\r
 \r
        }\r
 \r
@@ -151,18 +159,18 @@ initMap(map_t *map) {
 \r
        /* create the tile set */\r
        map->tiles->data = malloc(sizeof(bitmap_t));\r
-       map->tiles->data->width = 32;\r
-       map->tiles->data->height= 16;\r
-       map->tiles->data->data = malloc(32*16);\r
-       map->tiles->tileHeight = 16;\r
-       map->tiles->tileWidth = 16;\r
+       map->tiles->data->width = (TILEWH*2);\r
+       map->tiles->data->height= TILEWH;\r
+       map->tiles->data->data = malloc((TILEWH*2)*TILEWH);\r
+       map->tiles->tileHeight = TILEWH;\r
+       map->tiles->tileWidth =TILEWH;\r
        map->tiles->rows = 1;\r
        map->tiles->cols = 2;\r
 \r
        i=0;\r
-       for(y=0; y<16; y++) {\r
-       for(x=0; x<32; x++) {\r
-               if(x<16)\r
+       for(y=0; y<TILEWH; y++) {\r
+       for(x=0; x<(TILEWH*2); x++) {\r
+               if(x<TILEWH)\r
                  map->tiles->data->data[i] = 0x24;\r
                else\r
                  map->tiles->data->data[i] = 0x34;\r
index 46167a51179064a08984c6438917b51f9d380607..c67f9137db8bd773078280f76a9b466e9e755e98 100755 (executable)
Binary files a/16/modex16/scroll.exe and b/16/modex16/scroll.exe differ
index 63a3da16d6ec199fa9baa5e9623d6ba1f5dc1e0e..99404b1a3666201b98a9dba2cbe162f0e6a6d49f 100644 (file)
Binary files a/16/modex16/test.exe and b/16/modex16/test.exe differ
index d0b6755cbc11f3886c7edaf3ab1b55f5034146c9..2b870eff82dc4159ec20cecb40d7e0287b92bca1 100644 (file)
Binary files a/16/modex16/test2.exe and b/16/modex16/test2.exe differ