Mercurial > otakunoraifu
diff window/button.cc @ 65:4416cfac86ae
Convert EUC-JP files to UTF8
author | Thibaut Girka <thib@sitedethib.com> |
---|---|
date | Fri, 26 Nov 2010 10:53:15 +0100 |
parents | 15a18fbe6f21 |
children |
line wrap: on
line diff
--- a/window/button.cc +++ b/window/button.cc @@ -25,15 +25,15 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* r,g,b の基本色で number (0:left 1:right 2:up 3:down)の矢印のビットマップを作成する -** width/heightのどちらかを-1にすると、それにあわせてスケール +/* r,g,b 堺蚊 number (0:left 1:right 2:up 3:down)√違篏 +** width/height<-1鴻宴若 */ #include <stdlib.h> extern char* create_button(int number, int& width, int& height, int r, int g, int b); extern char* create_box(int& width, int& height, int r, int g, int b); -// ボタンのbitmap -// ランレングスで簡易圧縮 +// 帥潟bitmap +// 潟潟違鴻х亜х軒 static int buttonleft_cnt = 990; static char buttonleft[991] = { 0x00,0x10,0x04,0x7e,0x39,0x00,0x22,0x04,0x7f,0x59,0x00,0x1e,0x04,0x81,0x79,0x00, @@ -379,7 +379,7 @@ static char* extract_button(int number, char* out = new char[width*height]; int outc = 0; int i; - // ランレングスの展開 + // 潟潟違鴻絮 for (i=0; i<size; i++) { int c = *(unsigned char*)(data+i); int s = 0; @@ -396,15 +396,15 @@ static char* extract_button(int number, return out; } -// R,G,B の指定色を基底色に、明るさを変えた色を RGB -> HLS -> RGB 変換で作成する +// R,G,B 絎蚊阪蚊紊蚊 RGB -> HLS -> RGB 紊т struct ButtonColor { int rs[8]; int gs[8]; int bs[8]; int as[8]; - int* c_min, *c_mid, *c_max; // rgb->hls->rgb変換用。r,g,b を高い順にmax,mid,minに割り当てる + int* c_min, *c_mid, *c_max; // rgb->hls->rgb紊r,g,b 蕭max,mid,min蚊綵 bool is_gray; - int hc, hd, l, s; // h,l,s 系。h 要素は上の c_min|mid|maxにも入る + int hc, hd, l, s; // h,l,s 膤祉h 荀膣筝 c_min|mid|maxャ ButtonColor(int _r, int _g, int _b); void SetBrightness1(int n, int c1); void SetBrightness(int c1, int c2, int c3, int c4, int c5); @@ -419,7 +419,7 @@ ButtonColor::ButtonColor(int r, int g, i } *rs = r; *bs = b; *gs = g; - // r,g,b の昇順にmax,mid,minをrs,gs,bsに割り当てる + // r,g,b max,mid,minrs,gs,bs蚊綵 if (r > g) { if (r > b) { // r = max c_max = rs; @@ -511,7 +511,7 @@ static void draw_button(char* rdata, int int xadd = width*65536/bwidth; int yadd = height*65536/bheight; - // 元のビットマップに着色しながら縮小する + // 蚊膰絨 for (by=0; by<bheight; by++) { ScaleData* d = data + y*width; char* s = bdata + by*bwidth; @@ -550,16 +550,16 @@ char* create_button(int number, int& wid int bwidth, bheight; char* bdata = extract_button(number, bwidth, bheight); if (bdata == NULL) return NULL; - // 拡大率に合わせてwidth,heightをセット + // ≦ぇwidth,height祉 if (width == -1 && height == -1) width = bwidth, height = bheight; else if (width == -1) width = bwidth * height / bheight; else if (height == -1) height = bheight * width / bwidth; if (width > bwidth) width = bwidth; if (height > bheight) height = bheight; - // 色を設定する + // 蚊荐絎 ButtonColor color(r,g,b); - // 描画 + // char* rdata = (char*)malloc(width*height*4*3); color.SetBrightness(0x60, 0xa0, 0xc0, 0xe0, 0xe0); draw_button(rdata, width, height, bdata, bwidth, bheight, color); @@ -591,9 +591,9 @@ static void draw_box(char* buf, int widt const int* gs = color.gs; const int* bs = color.bs; const int* as = color.as; - // まず、豆腐を書く + // 障莟吾 drawbox(buf, Rect(0,0,width,height), width, rs[3],gs[3],bs[3],as[3]); - // 影 + // 綵 if (height > 2) { drawbox(buf, Rect(0,0,width,kage_w1), width, rs[4], gs[4], bs[4],as[4]); drawbox(buf, Rect(0,height-kage_w1,width,height), width, rs[1], gs[1], bs[1],as[1]); @@ -612,7 +612,7 @@ static void draw_box(char* buf, int widt char* create_box(int& width, int& height, int r, int g, int b) { ButtonColor color(r,g,b); - // scale のカーソル + // scale 若純 if (width == -1 && height == -1) width = 32, height = 48; else if (width == -1) width = height*3/2; else if (height == -1) height = width * 3/2; @@ -622,7 +622,7 @@ char* create_box(int& width, int& height if (kage_w2 <= 1) kage_w2 = 2; char* buf = (char*)malloc(width*height*4*3); - // 描画 + // color.SetBrightness(0x60, 0xa0, 0xc0, 0xe0, 0xe0); draw_box(buf, width, height, kage_w1, kage_w2, color); color.SetBrightness(0x60, 0xa0, 0xe0, 0xe0, 0xe0);