]> 4ch.mooo.com Git - 16.git/blobdiff - src/scroll.c
modified: makefile
[16.git] / src / scroll.c
index 8f485f90a8e538d91c570aeb502fb15e52d83678..239883f678332a467dd92647881c71e3454df139 100644 (file)
@@ -1,16 +1,13 @@
-#include "src\lib\modex16.h"\r
-#include <stdio.h>\r
-#include <stdlib.h>
-#include <string.h>\r
-#include "src\lib\dos_kb.h"\r
-#include "16\lib\x\modex.h"\r
+#include "src\lib\dos_kb.h"
+#include "src\lib\mapread.c"\r
+//#include "16\lib\x\modex.h"\r
 #include "src\lib\wtest\wtest.c"\r
-#include "src\lib\planar.c"\r
+#include "src\lib\planar.c"
 //====#include "src\lib\ems.c"\r
 \r
 //word far *clock= (word far*) 0x046C; /* 18.2hz clock */\r
 \r
-typedef struct {\r
+/*typedef struct {\r
        bitmap_t *data;\r
        word tileHeight;\r
        word tileWidth;\r
@@ -24,7 +21,7 @@ typedef struct {
        tiles_t *tiles;\r
        int width;\r
        int height;\r
-} map_t;\r
+} map_t;*/\r
 \r
 \r
 typedef struct {\r
@@ -70,8 +67,8 @@ void animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */sword
 //#define LOOPMAX (TILEWH/SPEED)\r
 \r
 //place holder definitions\r
-#define MAPX 200\r
-#define MAPY 150\r
+//#define MAPX 200\r
+//#define MAPY 150\r
 #define TRIGGX 10\r
 #define TRIGGY 9\r
 \r
@@ -120,8 +117,10 @@ void main() {
                exit(0);\r
        }*/\r
 \r
-       /* create the map */\r
-       map = allocMap(MAPX,MAPY); //20x15 is the resolution of the screen you can make maps smaller than 20x15 but the null space needs to be drawn properly\r
+       /* create the map */
+       loadmap("data/test.map", &map/*, 0*/);\r
+       map = allocMap(map.width,map.height); //20x15 is the resolution of the screen you can make maps smaller than 20x15 but the null space needs to be drawn properly
+       //loadmap(NULL, &map, 1);\r
        //if(isEMS()) printf("%d tesuto\n", coretotalEMS());\r
        initMap(&map);\r
        mv.map = &map;\r
@@ -242,7 +241,7 @@ void main() {
        //right movement\r
        if(npc0.d == 2)\r
        {\r
-               if(npc0.tx < MAPX && !(npc0.tx+1 == TRIGGX && npc0.ty == TRIGGY) && !(npc0.tx+1 == player.tx && npc0.ty == player.ty))\r
+               if(npc0.tx < map.width && !(npc0.tx+1 == TRIGGX && npc0.ty == TRIGGY) && !(npc0.tx+1 == player.tx && npc0.ty == player.ty))\r
                {\r
                        if(npc0.q<=(TILEWH/SPEED))\r
                        {\r
@@ -294,7 +293,7 @@ void main() {
        //down movement\r
        if(npc0.d == 3)\r
        {\r
-               if(npc0.ty < MAPY && !(npc0.tx == TRIGGX && npc0.ty+1 == TRIGGY) && !(npc0.tx == player.tx && npc0.ty == player.ty+1))\r
+               if(npc0.ty < map.height && !(npc0.tx == TRIGGX && npc0.ty+1 == TRIGGY) && !(npc0.tx == player.tx && npc0.ty == player.ty+1))\r
                {\r
                        if(npc0.q<=(TILEWH/SPEED))\r
                        {\r
@@ -352,7 +351,7 @@ void main() {
        if((keyp(77) && !keyp(75) && player.d == 0) || player.d == 2)\r
        {\r
                if(player.d == 0){ player.d = 2; }\r
-               if(bg->tx >= 0 && bg->tx+20 < MAPX && player.tx == bg->tx + 10 && !(player.tx+1 == TRIGGX && player.ty == TRIGGY))\r
+               if(bg->tx >= 0 && bg->tx+20 < map.width && player.tx == bg->tx + 10 && !(player.tx+1 == TRIGGX && player.ty == TRIGGY))\r
                {\r
                        if(player.q<=(TILEWH/SPEED))\r
                        {\r
@@ -366,7 +365,7 @@ void main() {
                                player.q++;\r
                        } else { player.q = 1; player.d = 0; player.tx++; }\r
                }\r
-               else if(player.tx < MAPX && !(player.tx+1 == TRIGGX && player.ty == TRIGGY))\r
+               else if(player.tx < map.width && !(player.tx+1 == TRIGGX && player.ty == TRIGGY))\r
                {\r
                        if(player.q<=(TILEWH/SPEED))\r
                        {\r
@@ -393,7 +392,7 @@ void main() {
        if((keyp(75) && !keyp(77) && player.d == 0) || player.d == 4)\r
        {\r
                if(player.d == 0){ player.d = 4; }\r
-               if(bg->tx > 0 && bg->tx+20 <= MAPX && player.tx == bg->tx + 10 && !(player.tx-1 == TRIGGX && player.ty == TRIGGY))\r
+               if(bg->tx > 0 && bg->tx+20 <= map.width && player.tx == bg->tx + 10 && !(player.tx-1 == TRIGGX && player.ty == TRIGGY))\r
                {\r
                        if(player.q<=(TILEWH/SPEED))\r
                        {\r
@@ -434,7 +433,7 @@ void main() {
        if((keyp(80) && !keyp(72) && player.d == 0) || player.d == 3)\r
        {\r
                if(player.d == 0){ player.d = 3; }\r
-               if(bg->ty >= 0 && bg->ty+15 < MAPY && player.ty == bg->ty + 8 && !(player.tx == TRIGGX && player.ty+1 == TRIGGY))\r
+               if(bg->ty >= 0 && bg->ty+15 < map.height && player.ty == bg->ty + 8 && !(player.tx == TRIGGX && player.ty+1 == TRIGGY))\r
                {\r
                        if(player.q<=(TILEWH/SPEED))\r
                        {\r
@@ -448,7 +447,7 @@ void main() {
                                player.q++;\r
                        } else { player.q = 1; player.d = 0; player.ty++; }\r
                }\r
-               else if(player.ty < MAPY && !(player.tx == TRIGGX && player.ty+1 == TRIGGY))\r
+               else if(player.ty < map.height && !(player.tx == TRIGGX && player.ty+1 == TRIGGY))\r
                {\r
                        if(player.q<=(TILEWH/SPEED))\r
                        {\r
@@ -475,7 +474,7 @@ void main() {
        if((keyp(72) && !keyp(80) && player.d == 0) || player.d == 1)\r
        {\r
                if(player.d == 0){ player.d = 1; }\r
-               if(bg->ty > 0 && bg->ty+15 <= MAPY && player.ty == bg->ty + 8 && !(player.tx == TRIGGX && player.ty-1 == TRIGGY))\r
+               if(bg->ty > 0 && bg->ty+15 <= map.height && player.ty == bg->ty + 8 && !(player.tx == TRIGGX && player.ty-1 == TRIGGY))\r
                {\r
                        if(player.q<=(TILEWH/SPEED))\r
                        {\r
@@ -629,7 +628,7 @@ initMap(map_t *map) {
        map->tiles->rows = 1;\r
        map->tiles->cols = 2;\r
 \r
-       i=0;\r
+       /*i=0;\r
        for(y=0; y<TILEWH; y++) {\r
        for(x=0; x<(TILEWH*2); x++) {\r
                if(x<TILEWH)\r
@@ -638,7 +637,7 @@ initMap(map_t *map) {
                  map->tiles->data->data[i] = 0;//0x34;\r
                i++;\r
        }\r
-       }\r
+       }*/\r
 \r
        i=0;\r
        for(y=0; y<map->height; y++) {\r