]> 4ch.mooo.com Git - 16.git/blobdiff - 16/dos_gfx.cpp
wwww
[16.git] / 16 / dos_gfx.cpp
index abe38f8ea754bfc4a569d6f5de3ac39f0d934626..268b99ae5f9393febd76d0e967ba3a385450f477 100644 (file)
@@ -1,7 +1,8 @@
 //DOS Graphics thingy by sparky4 licence GPL v2\r
 //a special thanks to everyone to release source code for mode X\r
 /*src\lib\*/\r
-#include "dos_gfx.h"\r
+#include "dos_gfx.h"
+//#include "lib\modex16.h" //____\r
 \r
 int old_mode;\r
 //color \82Ä\82·\82Æ\r
@@ -9,7 +10,7 @@ short gq = LGQ;
 \r
 //\82Ä\82·\82Æ\r
 short bakax = 0, bakay = 0;\r
-syte xx = rand()&0%SW, yy = rand()&0%SH, sx = 0, sy = 0;\r
+word xx = rand()&0%SW, yy = rand()&0%SH, sx = 0, sy = 0;\r
 byte coor;\r
 \r
 byte *vga = (byte *) MK_FP(0xA000, 0);\r
@@ -19,7 +20,7 @@ byte *vga = (byte *) MK_FP(0xA000, 0);
  * to be included.\r
  */\r
 #define TESTING\r
-#define TILE\r
+//#define TILE\r
 \r
 /////////////////////////////////////////////////////////////////////////////\r
 //                                                                         //\r
@@ -56,20 +57,18 @@ void setvideo(/*byte mode, */short vq){
                                //mxSetClipRegion(0, VH+1, VW, (TILEWH*BUFFMX));\r
                }\r
 }\r
-
-void pdump(){
-       int mult=QUADWH;
-       int palq=mult*16;
-       int palcol=0;
-       for(int paly=0; paly<palq; paly++){
-               for(int palx=0; palx<palq; palx++){
-                               mxFillBox((SW-palq)+palx+32, paly+32, TILEWH, TILEWH, palcol, OP_SET);
-                       for(int i=1; i<mult; i++) palx++;
-                       palcol++;
-               }
-       for(int i=1; i<mult; i++) paly++;
-       }
-}
+\r
+void pdump(){\r
+       int mult=(QUADWH)/2;\r
+       int palq=(mult)*16;\r
+       int palcol=0;\r
+       for(int paly=0; paly<palq; paly+=mult){\r
+               for(int palx=0; palx<palq; palx+=mult){\r
+                               mxFillBox((SW-palq)+palx+32, paly+32, TILEWH, TILEWH, palcol, OP_SET);\r
+                       palcol++;\r
+               }\r
+       }\r
+}\r
 \r
 /////////////////////////////////////////////////////////////////////////////\r
 //                                                                                                                                              //\r
@@ -92,7 +91,7 @@ short colortest(){
 \r
 //color \82Ä\82·\82Æ\r
 short colorz(){\r
-               if(gq < HGQ){\r
+               if(gq <= HGQ){\r
 //----           cls(gq, vaddr);\r
                                cls(gq, vga);\r
                                gq++;\r
@@ -129,7 +128,7 @@ short ding(int q){
                ||q==16\r
                ) && gq == BONK){\r
                                                if(coor < HGQ && coor < LGQ) coor = LGQ;\r
-                                               if(coor < HGQ-1){\r
+                                               if(coor < HGQ){\r
                                                                coor++;\r
                                }else{ coor = LGQ;\r
                                                bakax = rand()%3; bakay = rand()%3;\r
@@ -147,7 +146,7 @@ short ding(int q){
                }\r
 \r
                if(q==7||q==9){\r
-                               if(gq < HGQ){\r
+                               if(gq <= HGQ){\r
                                                if(q == 7) ssd(q);\r
                                                if(q == 9){ ssd(q); coor++; }\r
                                                gq++;\r
@@ -286,7 +285,9 @@ short ding(int q){
  */\r
 \r
 int main(void)\r
-               {\r
+               {
+               //bitmap_t bmp; //____
+               //bmp = modexLoadPcx("chikyuu.pcx"); //____\r
                short key,d,xpos,ypos,xdir,ydir;\r
                int ch=0x0;\r
                // main variables\r
@@ -296,7 +297,10 @@ int main(void)
                ypos=TILEWH*2;\r
                xdir=1;\r
                ydir=1;\r
-               setvideo(1);\r
+               setvideo(1);
+               //modexPalUpdate(bmp.palette); //____
+               //modexDrawBmp(VGA, 0, 0, &bmp, 0); //____
+               //getch(); //____\r
 // screen savers\r
 \r
 /*while(d!=0){ // on!\r
@@ -312,7 +316,7 @@ int main(void)
                                                setvideo(1);\r
                                }\r
                }*/ // else off\r
-               mxFillBox(0, 0, VW, BH, 10, OP_SET);\r
+               //mxFillBox(0, 0, VW, BH, 10, OP_SET);\r
                while(1){ // conditions of screen saver\r
                while(!kbhit()){\r
                        ding(key);\r
@@ -339,7 +343,7 @@ int main(void)
                                mxPutPixel(0, y, 15);\r
                                mxPutPixel(VW-1, y, 15);\r
                        }\r
-                       */
+                       */\r
                        pdump();\r
                        getch();\r
                        //text box\r
@@ -371,7 +375,7 @@ mxBitBlt(TILEWH*2, TILEWH*2, SW, SH, 32, (SH+64+32));
                                        //if(ypos==1 || (ypos==(BH-SH-1)))delay(500);\r
                                        //if((xpos>(VW-SW-1)) || (xpos<1))delay(500);\r
                                        //mxWaitRetrace();\r
-//mxBitBlt(32, (SH+32), SW, SH, xpos, ypos);
+//mxBitBlt(32, (SH+32), SW, SH, xpos, ypos);\r
 mxBitBlt(TILEWH*2, (SH+64+32), SW, SH, TILEWH*2, TILEWH*2);\r
 //xpos=ypos=TILEWH*2;\r
 mxPan(32,32);\r
@@ -379,7 +383,7 @@ mxPan(32,32);
                                if( (xpos>(VW-SW-1))  || (xpos<1)){xdir=-xdir;}\r
                                if( (ypos>(BH-SH-1)) || (ypos<1)){ydir=-ydir;} // { Hit a boundry, change\r
                        //    direction! }\r
-//mxBitBlt(32, (SH+64+32), SW, SH, xpos, ypos);
+//mxBitBlt(32, (SH+64+32), SW, SH, xpos, ypos);\r
 //mxBitBlt(TILEWH*2, (SH+64+32), SW, SH, TILEWH*2, TILEWH*2);\r
                        }\r
                        ch=getch();\r