]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_vl_1.c
EXEMM BROKEN
[16.git] / src / lib / 16_vl_1.c
index 6956717e946b6deb06efcbfd67f4676a53c6f6e6..0ad220640793ede6f0f82d8b36b2caf91db3086b 100755 (executable)
@@ -168,7 +168,7 @@ SetScreen_done:
 =\r
 ====================\r
 */\r
-\r
+#if 0\r
 void VL_SetLineWidth (unsigned width, global_game_variables_t *gvar)\r
 {\r
        int i,offset;\r
@@ -190,10 +190,8 @@ void VL_SetLineWidth (unsigned width, global_game_variables_t *gvar)
                gvar->video.ofs.ylookup[i]=offset;\r
                offset += gvar->video.ofs.linewidth;\r
        }\r
-       gvar->video.ofs.displayofs = 0;\r
-       gvar->video.ofs.bufferofs = gvar->video.page[0].width*gvar->video.page[0].height;//gvar->video.page[0].pagesize;\r
 }\r
-\r
+#endif\r
 /*\r
 =============================================================================\r
 \r
@@ -504,14 +502,15 @@ void VL_TestPaletteSet (video_t *v)
 =================\r
 */\r
 \r
-void VL_Plot (int x, int y, int color, ofs_t *ofs)\r
+void VL_Plot (int x, int y, int color, global_game_variables_t *gvar)\r
 {\r
        byte mask;\r
        VCLIPDEF\r
 \r
        mask = pclip[x&3];\r
        VGAMAPMASK(mask);\r
-       *(byte far *)MK_FP(SCREENSEG,ofs->bufferofs+(ofs->ylookup[y]+(x>>2))) = color;\r
+       //*(byte far *)MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(gvar->video.ofs.ylookup[y]+(x>>2))) = color;\r
+       *(byte far *)MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+((y*gvar->video.page[0].stridew)+(x>>2))) = color;\r
        VGAMAPMASK(15);\r
 }\r
 \r
@@ -524,7 +523,7 @@ void VL_Plot (int x, int y, int color, ofs_t *ofs)
 =================\r
 */\r
 \r
-void VL_Hlin   (unsigned x, unsigned y, unsigned width, unsigned color, ofs_t *ofs)\r
+void VL_Hlin   (unsigned x, unsigned y, unsigned width, unsigned color, global_game_variables_t *gvar)\r
 {\r
        unsigned                xbyte;\r
        byte                    far *dest;\r
@@ -538,7 +537,8 @@ void VL_Hlin        (unsigned x, unsigned y, unsigned width, unsigned color, ofs_t *ofs
        rightmask = rclip[(x+width-1)&3];\r
        midbytes = ((x+width+3)>>2) - xbyte - 2;\r
 \r
-       dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+xbyte);\r
+       //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+xbyte);\r
+       dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+xbyte);\r
 \r
        if (midbytes<0)\r
        {\r
@@ -571,7 +571,7 @@ void VL_Hlin        (unsigned x, unsigned y, unsigned width, unsigned color, ofs_t *ofs
 =================\r
 */\r
 \r
-void VL_Vlin   (int x, int y, int height, int color, ofs_t *ofs)\r
+void VL_Vlin   (int x, int y, int height, int color, global_game_variables_t *gvar)\r
 {\r
        byte    far *dest,mask;\r
        VCLIPDEF\r
@@ -579,12 +579,13 @@ void VL_Vlin      (int x, int y, int height, int color, ofs_t *ofs)
        mask = pclip[x&3];\r
        VGAMAPMASK(mask);\r
 \r
-       dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+(x>>2));\r
+       //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2));\r
+       dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+(x>>2));\r
 \r
        while (height--)\r
        {\r
                *dest = color;\r
-               dest += ofs->linewidth;\r
+               dest += gvar->video.ofs.linewidth;\r
        }\r
 \r
        VGAMAPMASK(15);\r
@@ -599,7 +600,7 @@ void VL_Vlin        (int x, int y, int height, int color, ofs_t *ofs)
 =================\r
 */\r
 \r
-void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs)\r
+void VL_Bar (int x, int y, int width, int height, int color, global_game_variables_t *gvar)\r
 {\r
        byte    far *dest;\r
        byte    leftmask,rightmask;\r
@@ -610,9 +611,10 @@ void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs)
        leftmask = lclip[x&3];\r
        rightmask = rclip[(x+width-1)&3];\r
        midbytes = ((x+width+3)>>2) - (x>>2) - 2;\r
-       linedelta = ofs->linewidth-(midbytes+1);\r
+       linedelta = gvar->video.ofs.linewidth-(midbytes+1);\r
 \r
-       dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+(x>>2));\r
+       //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2));\r
+       dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+(x>>2));\r
 \r
        if (midbytes<0)\r
        {\r
@@ -621,7 +623,7 @@ void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs)
                while (height--)\r
                {\r
                        *dest = color;\r
-                       dest += ofs->linewidth;\r
+                       dest += gvar->video.ofs.linewidth;\r
                }\r
                VGAMAPMASK(15);\r
                return;\r
@@ -657,13 +659,14 @@ void VL_Bar (int x, int y, int width, int height, int color, ofs_t *ofs)
 =================\r
 */\r
 \r
-void VL_MemToScreen (byte far *source, int width, int height, int x, int y, ofs_t *ofs)\r
+void VL_MemToScreen (byte far *source, int width, int height, int x, int y, global_game_variables_t *gvar)\r
 {\r
        byte    far *screen,far *dest,mask;\r
        int             plane;\r
 \r
        width>>=2;\r
-       dest = MK_FP(SCREENSEG,ofs->bufferofs+ofs->ylookup[y]+(x>>2) );\r
+       //dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+gvar->video.ofs.ylookup[y]+(x>>2));\r
+       dest = MK_FP(SCREENSEG,gvar->video.ofs.bufferofs+(y*gvar->video.page[0].stridew)+(x>>2));\r
        mask = 1 << (x&3);\r
 \r
        for     (plane = 0; plane<4; plane++)\r
@@ -674,7 +677,7 @@ void VL_MemToScreen (byte far *source, int width, int height, int x, int y, ofs_
                        mask = 1;\r
 \r
                screen = dest;\r
-               for     (y=0;y<height;y++,screen+=ofs->linewidth,source+=width)\r
+               for     (y=0;y<height;y++,screen+=gvar->video.ofs.linewidth,source+=width)\r
                        _fmemcpy (screen,source,width);\r
        }\r
 }\r