[Ttssh2-commit] [4471] 16bit colorではグラデーションがギザギザになり、見栄えがよくないので、32bit full colorの

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2011年 5月 22日 (日) 01:16:29 JST


Revision: 4471
          http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4471
Author:   yutakapon
Date:     2011-05-22 01:16:28 +0900 (Sun, 22 May 2011)

Log Message:
-----------
16bit colorではグラデーションがギザギザになり、見栄えがよくないので、32bit full colorの
場合のみ描画するようにした。
ディザリングを使って、16bit colorでも違和感なく描画することも検討中。

Modified Paths:
--------------
    trunk/teraterm/ttpdlg/ttdlg.c


-------------- next part --------------
Modified: trunk/teraterm/ttpdlg/ttdlg.c
===================================================================
--- trunk/teraterm/ttpdlg/ttdlg.c	2011-05-18 11:27:19 UTC (rev 4470)
+++ trunk/teraterm/ttpdlg/ttdlg.c	2011-05-21 16:16:28 UTC (rev 4471)
@@ -2684,6 +2684,8 @@
 	static short *wavemap_old = NULL;
 	static LPDWORD dlgorgpixel = NULL;
 	static int waveflag = 0;
+	static int fullcolor = 0;
+	int bitspixel;
 
 	switch (Message) {
 		case WM_INITDIALOG:
@@ -2858,6 +2860,13 @@
 			SetTimer(Dialog, ID_EFFECT_TIMER, 100, NULL);
 #endif
 
+			// ‰æ–ʂ̐F”‚𒲂ׂéB
+			hwnd = GetDesktopWindow();
+			hdc = GetDC(hwnd);
+			bitspixel = GetDeviceCaps(hdc, BITSPIXEL);
+			fullcolor = (bitspixel == 32 ? 1 : 0);
+			ReleaseDC(hwnd, hdc);
+
 			return TRUE;
 
 		case WM_COMMAND:
@@ -2906,12 +2915,14 @@
 				hdc = BeginPaint(Dialog, &ps);
 
 #if defined(EFFECT_ENABLED) || defined(TEXTURE_ENABLED)
-				BitBlt(hdc, 
-					ps.rcPaint.left, ps.rcPaint.top, 
-					ps.rcPaint.right - ps.rcPaint.left, ps.rcPaint.bottom - ps.rcPaint.top,
-					dlgdc, 
-					ps.rcPaint.left, ps.rcPaint.top, 
-					SRCCOPY);
+				if (fullcolor) {
+					BitBlt(hdc, 
+						ps.rcPaint.left, ps.rcPaint.top, 
+						ps.rcPaint.right - ps.rcPaint.left, ps.rcPaint.bottom - ps.rcPaint.top,
+						dlgdc, 
+						ps.rcPaint.left, ps.rcPaint.top, 
+						SRCCOPY);
+				}
 #endif
 
 				DrawIconEx(hdc, icon_x, icon_y, dlghicon, icon_w, icon_h, 0, 0, DI_NORMAL);



Ttssh2-commit メーリングリストの案内
Back to archive index