version 0.2.15
[fms.git] / src / freenet / captcha / simplecaptcha.cpp
index c84010f..3753a12 100644 (file)
@@ -3,6 +3,8 @@
 #include "../../../include/freenet/captcha/easybmp/EasyBMP_Font.h"\r
 #include "../../../include/freenet/captcha/easybmp/EasyBMP_Geometry.h"\r
 \r
+#include <cstdlib>\r
+\r
 #ifdef XMEM\r
        #include <xmem.h>\r
 #endif\r
@@ -10,7 +12,7 @@
 void SimpleCaptcha::Generate()\r
 {\r
        BMP bmp;\r
-       int bmpwidth=100;\r
+       int bmpwidth=110;\r
        int bmpheight=50;\r
        RGBApixel lettercols[5];\r
        std::string puzzlestring;\r
@@ -51,16 +53,17 @@ void SimpleCaptcha::Generate()
                double endangle=(double)(rand()%360)*(3.14159/180);\r
                pixel.Red=100+(rand()%150);\r
                pixel.Green=100+(rand()%150);\r
+               pixel.Blue=100+(rand()%150);\r
                DrawArc(bmp,x1,y1,radius,startangle,endangle,pixel);\r
        }\r
 \r
        for(int i=0; i<5; i++)\r
        {\r
                // keep the colors dark\r
-               lettercols[i].Red=(rand()%200);\r
-               lettercols[i].Green=(rand()%200);\r
-               lettercols[i].Blue=(rand()%200);\r
-               // draw a line with the letter col\r
+               lettercols[i].Red=(rand()%150);\r
+               lettercols[i].Green=(rand()%150);\r
+               lettercols[i].Blue=(rand()%150);\r
+               // draw a line with the letter color\r
                DrawAALine(bmp,rand()%bmpwidth,rand()%bmpheight,rand()%bmpwidth,rand()%bmpheight,lettercols[i]);\r
        }\r
 \r