\r
//color checker~\r
//i want to make another vesion that checks the palette when the palette is being appened~\r
-void modexchkcolor(imgtestpal_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, word *offset*/)\r
+void modexchkcolor(imgtestpal_t *bmp, word *q, word *a, word *aa, word *z, word *i/*, word *offset*/, global_game_variables_t *gv)\r
{\r
- byte *pal;\r
+ byte *pal=&(gv->video.palette);\r
word zz=0;\r
- pal = modexNewPal();\r
- modexPalSave(pal);\r
-#ifdef BEVERBOSEPALCHECK\r
- printf("q: %02d\n", (*q));//\r
-\r
- printf("chkcolor start~\n");\r
- printf("1 (*z): %d\n", (*z)/3);\r
- printf("1 (*i): %d\n", (*i)/3);\r
- printf("1 offset of color in palette (*q): %d\n", (*q)/3);//\r
- printf("wwwwwwwwwwwwwwww\n");\r
-#endif\r
+ //pal = modexNewPal();\r
+// modexPalSave(pal);\r
+ CHKCOLDBGOUT1\r
//check palette for dups\r
for(; (*z)<PAL_SIZE; (*z)+=3)\r
{\r
-#ifdef BEVERBOSEPALCHECK\r
- printf("\n z: %d\n", (*z));//\r
- printf(" q: %d\n", (*q));//\r
- printf(" z+q: %d\n\n", ((*z)+(*q)));//\r
-#endif\r
+ CHKCOLDBGOUT2\r
//if((*z)%3==0)\r
//{\r
//---- if(pal[(*z)]==pal[(*z)+3] && pal[(*z)+1]==pal[(*z)+4] && pal[(*z)+2]==pal[(*z)+5])\r
if((*z)==(*i))\r
{\r
-#ifdef BEVERBOSEPALCHECK\r
- printf("\n%d [%02d][%02d][%02d]\n", (*z), pal[(*z)], pal[(*z)+1], pal[(*z)+2]);//\r
- printf("%d [%02d][%02d][%02d]\n\n", (*z)+3, pal[(*z)+3], pal[(*z)+4], pal[(*z)+5]);//\r
-#endif\r
+ CHKCOLDBGOUT3\r
//0000 (*z)-=3;\r
break;\r
}\r
else for(zz=0; zz<(*q); zz+=3)\r
{\r
-#ifdef BEVERBOSEPALCHECK\r
- printf("zz: %02d\n", zz/3);//\r
-#endif\r
+ CHKCOLDBGOUT4\r
if(zz%3==0)\r
{\r
if(pal[((*z)+(*q))]==pal[((*z)+(*q))+3] && pal[((*z)+(*q))+1]==pal[((*z)+(*q))+4] && pal[((*z)+(*q))+2]==pal[((*z)+(*q))+5]) //break if duplicate colors found in palette because it have reached the end of the current data of the palette\r
{\r
// (*z)-=3;\r
// (*i)-=3;\r
-#ifdef BEVERBOSEPALCHECK\r
- printf("\nzq1:%d[%02d][%02d][%02d]\n", (zz+*q), pal[(zz+*q)], pal[(zz+*q)+1], pal[(zz+*q)+2]);//\r
- printf("zq2:%d[%02d][%02d][%02d]\n\n", (zz+*q)+3, pal[(zz+*q)+3], pal[(zz+*q)+4], pal[(zz+*q)+5]);//\r
-#endif\r
+ CHKCOLDBGOUT5\r
break;\r
}\r
else if(pal[zz]==pal[((*z)+(*q))] && pal[zz+1]==pal[((*z)+(*q))+1] && pal[zz+2]==pal[((*z)+(*q))+2])\r
{\r
-#ifdef BEVERBOSEPALCHECK\r
- printf("\n\nwwwwwwwwwwwwwwww\n");//\r
- printf(" zq: %d [%02d][%02d][%02d] value that is needing to be changed~\n", ((*z)+(*q))/3, pal[((*z)+(*q))], pal[((*z)+(*q))+1], pal[((*z)+(*q))+2]);//\r
- printf(" zz: %d [%02d][%02d][%02d] value that the previous value is going to change to~\n", (zz)/3, pal[zz], pal[zz+1], pal[zz+2]);//\r
- //printf(" zv: %d [%02d][%02d][%02d] wwww\n", (zz-z+q)/3, pal[(zz-z+q)], pal[(zz-z+q)+1], pal[(zz-z+q)+2]);//\r
- printf(" z : %d [%02d][%02d][%02d] offset value~\n", (*z)/3, pal[(*z)], pal[(*z)+1], pal[(*z)+2]);//\r
-#endif\r
+ CHKCOLDBGOUT6\r
//++++ (*i)--;\r
// (*z)--;\r
//expand dong here\r
*/\r
//for(zzii=0; zzii<3; zzii++)\r
//{\r
-#ifdef BEVERBOSEPALCHECK\r
- printf("z+q: %d\n\n", ((*z)+(*q)));\r
-#endif\r
+ CHKCOLDBGOUT7\r
a[(((*z)+(*q)))]=zz;\r
//}\r
(*aa)=(((*z)+(*q)));\r
-#ifdef BEVERBOSEPALCHECK\r
- printf("!! a[%02d]: %d\n", (((*z)+(*q))/3), zz/3);\r
- printf("\n aa: %d\n\n", (*aa));//\r
- printf(" a[%02d]=(%02d) offset array i think the palette should be updated again~\n", ((*z)+(*q))/3, a[((*z)+(*q))/3]);//\r
- printf("wwwwwwwwwwwwwwww\n\n");//\r
-#endif\r
+ CHKCOLDBGOUT8\r
}\r
/*else\r
{\r
printf("z : %d [%02d][%02d][%02d]\n", (*z)/3, pal[(*z)], pal[(*z)+1], pal[(*z)+2]);\r
printf("================\n");\r
}*/\r
-#ifdef BEVERBOSEPALCHECK\r
- printf("[%d]", (zz+*q));//\r
-#endif\r
+ CHKCOLDBGOUT9\r
}\r
}\r
}\r
-#ifdef BEVERBOSEPALCHECK\r
- printf("wwwwwwwwwwwwwwww\n");\r
- printf("2 (*z): %d\n", (*z)/3);\r
- printf("2 (*i): %d\n", (*i)/3);\r
- printf("2 offset of color in palette (*q): %d\n", (*q)/3);//\r
- printf("chkcolor end~\n");\r
-#endif\r
+ CHKCOLDBGOUT10\r
//free(pal);\r
}\r
\r
void\r
-VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset)\r
+VL_palette(imgtestpal_t *bmp, byte *p, word *i, word qp, word aqoffset, global_game_variables_t *gv)\r
{\r
//byte *p = bmp->palette;\r
word w=0;\r
printf("1(*i)=%02d\n", (*i)/3);//\r
printf("1z=%02d\n", z/3);//\r
#endif\r
- modexchkcolor(bmp, &q, &a, &aa, &z, i);\r
+ modexchkcolor(bmp, &q, &a, &aa, &z, i, gv);\r
#ifdef BEVERBOSEPALCHECK\r
printf("2(*i)=%02d\n", (*i)/3);\r
printf("2z=%02d\n", z/3);\r
printf(" aa=%02d\n", aa);//\r
#endif\r
//update the palette~\r
- VL_palette(bmp, p, &pp, aq, aqoffset);\r
+ VL_palette(bmp, p, &pp, aq, aqoffset, gv);\r
(*i)=pp;\r
\r
if(aq<aa){ pp=q; aq++; goto aqpee; }\r