From: b Date: Sat, 28 Dec 2013 23:16:23 +0000 (+0000) Subject: ALL OF THEM! X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=bfb2cab558ba020f50b8a27ecf67d710b741a093;p=ott%2Fenhance ALL OF THEM! git-svn-id: svn://botcastle1b/npb@13 0d794883-4e4e-4f65-aa7a-0e7f5947bab5 --- diff --git a/npb b/npb index 1ffc8da..ac27a5b 100755 Binary files a/npb and b/npb differ diff --git a/npb.cpp b/npb.cpp index eff2566..9896f60 100644 --- a/npb.cpp +++ b/npb.cpp @@ -13,7 +13,7 @@ #define FAIL 900 #define OK 0 -//npb0.png +#define NPBPIX0 "npb0.png" #define X0 411 #define X01 21 #define X02 96 @@ -21,7 +21,7 @@ #define Y01 214 #define Y02 68 -//npb1.png +#define NPBPIX1 "npb1.png" #define X1 411 #define X11 22 #define X12 133 @@ -29,16 +29,21 @@ #define Y11 241 #define Y12 94 -#define NPBPIX0 "npb0.png" -#define NPBPIX1 "npb1.png" +#define NPBPIX2 "npb2.png" +#define X2 411 +#define X21 213 +#define Y2 404 +#define Y21 234 #include #include #include + void mustard(int mustard); void loadnpb(const char *path); void npbottify0(const char *path); void npbottify1(const char *path); +void npbottify2(const char *path); int main (int argc, const char *argv[]); ILuint inPix, outPix, npbPix; @@ -46,7 +51,7 @@ ILboolean q=true; ILboolean inH=false; ILboolean outH=false; ILboolean npbH=false; -ILuint inX, inY; +ILuint inX, inY, outX, outY; ILubyte *newdata; int main (int argc, const char *argv[]) @@ -62,7 +67,7 @@ int main (int argc, const char *argv[]) ilInit(); if(!ilEnable(IL_ORIGIN_SET))mustard(FAIL); if(!ilEnable(IL_FILE_OVERWRITE))mustard(FAIL); - ilClearColour(0,0,0,0); + ilClearColour(255,255,0,0); ilGenImages(1, &inPix); inH=true; ilBindImage(inPix); @@ -80,8 +85,7 @@ int main (int argc, const char *argv[]) else if(inX<=X12&&inY<=Y12) npbottify1(argv[2]); else - mustard(SEAISH_MUSTARD); - + npbottify2(argv[2]); //ok mustard(0); } @@ -192,6 +196,96 @@ void npbottify1(const char *path) if(!ilSave(IL_PNG,path))mustard(OUTPIX_MUSTARD); } +void npbottify2(const char *path) +{ + unsigned long i,j; + outX=(X21+inX+2>X2)?(X21+inX+2):X2; + outY=(Y21+inY+2>Y2)?(Y21+inY+2):Y2; + ilGenImages(1, &outPix); + outH=true; + loadnpb(NPBPIX2); + newdata=ilGetData(); + ilBindImage(outPix); + if(!ilTexImage(outX,outY,1,4,IL_RGBA,IL_UNSIGNED_BYTE,NULL))mustard(OUTPIX_MUSTARD); + if(!ilClearImage())mustard(FAIL); + ilSetPixels(outX-X2,0,0,X2,Y2,1,IL_RGBA,IL_UNSIGNED_BYTE,newdata); + newdata=ilGetData(); + for(i=outX-X21-inX-2;i