]> 4ch.mooo.com Git - 16.git/commitdiff
fixed bakapi more!
authorsparky4 <sparky4@cock.li>
Tue, 28 Jul 2015 15:51:54 +0000 (10:51 -0500)
committersparky4 <sparky4@cock.li>
Tue, 28 Jul 2015 15:51:54 +0000 (10:51 -0500)
modified:   bakapi.exe
modified:   src/lib/bakapee.c
modified:   src/lib/bakapee.h

bakapi.exe
src/lib/bakapee.c
src/lib/bakapee.h

index ce446b395252a5de1364aedfea85b9cd5588a7ba..11b904ac6adcc84ddbb7b903e7dff0ed046a6515 100644 (file)
Binary files a/bakapi.exe and b/bakapi.exe differ
index 90ff502d6882e8c17a2cb95db5cae7be0f7e268a..2a6d3eefd245ff44f3c7b0323f23f98d8a48d884 100644 (file)
@@ -154,12 +154,24 @@ void dingu(bakapee_t *pee)
        if(pee->coor < HGQ && pee->coor < LGQ) pee->coor = LGQ;
        if(pee->coor < HGQ)
        {
-               pee->qq++;
                pee->coor++;
-       }else{ pee->coor = LGQ;
+       }else{
+               pee->coor = LGQ;
+       }
+}
+
+void dingq(bakapee_t *pee)
+{
+       if(pee->qq<BONK)
+       {
+               pee->qq++;
+       }
+       else
+       {
+               dingu(pee);
                pee->qq = 0;
-               pee->bakax = rand()%3; pee->bakay = rand()%3;
        }
+       pee->bakax = rand()%3; pee->bakay = rand()%3;
 }
 
 /*-----------ding-------------*/
@@ -171,75 +183,60 @@ void ding(page_t *page, bakapee_t *pee, word q)
        switch(q)
        {
                case 1:
-                       if(pee->qq<BONK)
-                       {
-                               if(pee->xx==SCREEN_WIDTH){pee->bakax=0;}
-                               if(pee->xx==0){pee->bakax=1;}
-                               if(pee->yy==SCREEN_HEIGHT){pee->bakay=0;}
-                               if(pee->yy==0){pee->bakay=1;}
-                               pee->qq++;
-                       }else pee->qq = 0;
+                       dingq(pee);
+                       if(pee->xx==SCREEN_WIDTH){pee->bakax=0;}
+                       if(pee->xx==0){pee->bakax=1;}
+                       if(pee->yy==SCREEN_HEIGHT){pee->bakay=0;}
+                       if(pee->yy==0){pee->bakay=1;}
                break;
                case 2:
-                       if(pee->qq<BONK)
-                       {
-                               dingu(pee);
-                               dingas(pee);
-                               dingo(pee);
-                               dingpp(page, pee);      //plot the pixel/tile
+                       dingq(pee);
+                       dingas(pee);
+                       dingo(pee);
+                       dingpp(page, pee);      //plot the pixel/tile
 #ifdef TILE
-                               modexClearRegion(page, (rand()*TILEWH)%page->width, (rand()*TILEWH)%(page->height), TILEWH, TILEWH, 0);
+                       modexClearRegion(page, (rand()*TILEWH)%page->width, (rand()*TILEWH)%(page->height), TILEWH, TILEWH, 0);
 #else
-                               modexputPixel(page, rand()%page->width, rand()%page->height, 0);
+                       modexputPixel(page, rand()%page->width, rand()%page->height, 0);
 #endif
-                               pee->bakax = rand()%3; pee->bakay = rand()%3;
-                               pee->qq++;
-                       }else pee->qq = 0;
                break;
                case 3:
-                       if(pee->qq<BONK)
+                       dingq(pee);
+                       if(pee->xx!=SCREEN_WIDTH||pee->yy!=SCREEN_HEIGHT)
                        {
-                               if(pee->xx!=SCREEN_WIDTH||pee->yy!=SCREEN_HEIGHT)
-                               {
-                                       if(pee->xx==0){pee->bakax=1;pee->bakay=-1;d3y=1;}
-                                       if(pee->yy==0){pee->bakax=1;pee->bakay=0;d3y=1;}
-                                       if(pee->xx==SCREEN_WIDTH){pee->bakax=-1;pee->bakay=-1;d3y=1;}
-                                       if(pee->yy==SCREEN_HEIGHT){pee->bakax=1;pee->bakay=0;d3y=1;}
-                               }else if(pee->xx==SCREEN_WIDTH&&pee->yy==SCREEN_HEIGHT) pee->xx=pee->yy=0;
-                               if(d3y)
-                               {
-                                       if(pee->bakay<0)
-                                       {
-                                               pee->yy--;
-                                               d3y--;
-                                       }else
-                                       if(pee->bakay>0)
-                                       {
-                                               pee->yy++;
-                                               d3y--;
-                                       }
-                               }
-                               if(pee->bakax<0)
+                               if(pee->xx==0){pee->bakax=1;pee->bakay=-1;d3y=1;}
+                               if(pee->yy==0){pee->bakax=1;pee->bakay=0;d3y=1;}
+                               if(pee->xx==SCREEN_WIDTH){pee->bakax=-1;pee->bakay=-1;d3y=1;}
+                               if(pee->yy==SCREEN_HEIGHT){pee->bakax=1;pee->bakay=0;d3y=1;}
+                       }else if(pee->xx==SCREEN_WIDTH&&pee->yy==SCREEN_HEIGHT) pee->xx=pee->yy=0;
+                       if(d3y)
+                       {
+                               if(pee->bakay<0)
                                {
-                                       pee->xx--;
+                                       pee->yy--;
+                                       d3y--;
                                }else
-                               if(pee->bakax>0)
+                               if(pee->bakay>0)
                                {
-                                       pee->xx++;
+                                       pee->yy++;
+                                       d3y--;
                                }
-                               pee->qq++;
-                       }else pee->qq = 0;
+                       }
+                       if(pee->bakax<0)
+                       {
+                               pee->xx--;
+                       }else
+                       if(pee->bakax>0)
+                       {
+                               pee->xx++;
+                       }
+                       dingpp(page, pee);      //plot the pixel/tile
                break;
                case 4:
-                       if(pee->qq<BONK)
-                       {
-                               dingu(pee);
-                               dingas(pee);
-                               dingo(pee);
-                               dingpp(page, pee);      //plot the pixel/tile
-                               pee->bakax = rand()%3; pee->bakay = rand()%3;
-                               pee->qq++;
-                       }else pee->qq = 0;
+                       dingq(pee);
+                       dingas(pee);
+                       dingo(pee);
+                       dingpp(page, pee);      //plot the pixel/tile
                break;
                case 5:
                        colortest(page, pee);
@@ -274,26 +271,21 @@ void ding(page_t *page, bakapee_t *pee, word q)
                break;
 
                case 16:        //interesting effects
-                       if(pee->qq<BONK)
-                       {
-                               if(!pee->bakax){ pee->xx--;}
-                               else if(pee->bakax>0){ pee->xx++; }
-                               if(!pee->bakay){ pee->yy--;}
-                               else if(pee->bakay>0){ pee->yy++; }
-                               dingu(pee);
-                               dingas(pee);
-                               tx+=pee->xx+TILEWH+4;
-                               ty+=pee->yy+TILEWH+4;
-                               modexClearRegion(page, tx, ty, 4, 4, pee->coor);
+                       dingq(pee);
+                       if(!pee->bakax){ pee->xx--;}
+                       else if(pee->bakax>0){ pee->xx++; }
+                       if(!pee->bakay){ pee->yy--;}
+                       else if(pee->bakay>0){ pee->yy++; }
+                       dingas(pee);
+                       tx+=pee->xx+TILEWH+4;
+                       ty+=pee->yy+TILEWH+4;
+                       modexClearRegion(page, tx, ty, 4, 4, pee->coor);
 #ifdef TILE
-                               modexClearRegion(page, (rand()*TILEWH)%page->width, (rand()*TILEWH)%(page->height), TILEWH, TILEWH, 0);
+                       modexClearRegion(page, (rand()*TILEWH)%page->width, (rand()*TILEWH)%(page->height), TILEWH, TILEWH, 0);
 #else
-                               modexputPixel(page, rand()%page->width, rand()%(page->height), 0);
+                       modexputPixel(page, rand()%page->width, rand()%(page->height), 0);
 #endif
-                               pee->bakax = rand()%3; pee->bakay = rand()%3;
-                               //printf("%d %d %d %d %d %d\n", pee->xx, pee->yy, tx, ty, TILEWH);
-                               pee->qq++;
-                       }else pee->qq = 0;
+                       //printf("%d %d %d %d %d %d\n", pee->xx, pee->yy, tx, ty, TILEWH);
                break;
                default:
                break;
index fd0a1a0a595c1a2d8630383b7b6cc1d2c913688f..3de86f30e1d77faccf5b584f98b2ef770e905a0d 100644 (file)
@@ -32,7 +32,7 @@
 #define LGQ         32\r
 #define HGQ         55
 
-#define TILE
+//#define TILE
 
 typedef struct {\r
        word gq;
@@ -51,6 +51,7 @@ void dingpp(page_t *page, bakapee_t *pee);
 void dingo(bakapee_t *pee);
 void dingas(bakapee_t *pee);
 void dingu(bakapee_t *pee);
+void dingq(bakapee_t *pee);
 void ding(page_t *page, bakapee_t *pee, word q);
 
 #endif /*__BAKAPEE_H_*/