]> 4ch.mooo.com Git - 16.git/blobdiff - src/scroll.c
wwww XMS library expewrimentation
[16.git] / src / scroll.c
index e67fe514553dfa0c021a75354aa124539a9f9279..80b6fc3b245859597d54a7988f6cb14b2faa0491 100644 (file)
@@ -84,12 +84,6 @@ void main() {
        actor_t player;\r
        //actor_t npc0;\r
 \r
-       /* save the palette */\r
-       pal  = modexNewPal();\r
-       modexPalSave(pal);\r
-       modexFadeOff(4, pal);\r
-       modexPalBlack();\r
-\r
        /* create the map */
        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
        initMap(&map);
@@ -101,7 +95,14 @@ void main() {
        ptr = map.data;\r
        /* data */\r
        ptmp = bitmapLoadPcx("ptmp.pcx"); // load sprite
-       //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite\r
+       //npctmp = bitmapLoadPcx("ptmp1.pcx"); // load sprite
+
+       /* save the palette */\r
+       pal  = modexNewPal();\r
+       modexPalSave(pal);\r
+       modexFadeOff(4, pal);\r
+       modexPalBlack();
+\r
        setkb(1);\r
        modexEnter();\r
        modexPalBlack();\r
@@ -498,7 +499,7 @@ allocMap(int w, int h) {
        result.height=h;
        if(initxms()>0)
        result.data = malloc(sizeof(byte) * w * h);
-       else result.data = xmsmalloc(sizeof(byte) * w * h);
+       else (void huge*)result.data = xmsmalloc(sizeof(byte) * w * h);
 \r
        return result;\r
 }\r
@@ -512,17 +513,17 @@ initMap(map_t *map) {
        int tile = 1;
        if(initxms()>0)
        map->tiles = malloc(sizeof(tiles_t));
-       else map->tiles = xmsmalloc(sizeof(tiles_t));\r
+       else (void huge*)map->tiles = xmsmalloc(sizeof(tiles_t));\r
 \r
        /* create the tile set */
        if(initxms()>0)
        map->tiles->data = malloc(sizeof(bitmap_t));
-       else map->tiles->data = xmsmalloc(sizeof(bitmap_t));
+       else (void huge*)map->tiles->data = xmsmalloc(sizeof(bitmap_t));
        map->tiles->data->width = (TILEWH*2);\r
        map->tiles->data->height= TILEWH;
        if(initxms()>0)
        map->tiles->data->data = malloc((TILEWH*2)*TILEWH);
-       else map->tiles->data->data = xmsmalloc((TILEWH*2)*TILEWH);\r
+       else (void huge*)map->tiles->data->data = xmsmalloc((TILEWH*2)*TILEWH);\r
        map->tiles->tileHeight = TILEWH;\r
        map->tiles->tileWidth =TILEWH;\r
        map->tiles->rows = 1;\r