Skip to content

Commit 4742bb6

Browse files
committed
Merge branch 'directwrite' of https://githubfast.com/snowie2000/mactype into directwrite
2 parents 1dfb340 + 999790b commit 4742bb6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+961
-940
lines changed

EventLogging.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ void EventLogging::LogIt(WORD CategoryID, DWORD EventID, LPCTSTR ArrayOfStrings[
5252
ReportEvent(m_hEventLinker,EVENTLOG_INFORMATION_TYPE,CategoryID,
5353
EventID,NULL,NumOfArrayStr,RawDataSize,ArrayOfStrings,RawData);
5454

55-
}
55+
}

cache.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "override.h"
22

3-
//CreateDIBシニハ」ャスォヤレサ贍ニマツチミエホハコ�ツDIBヌ
4-
#define BITMAP_REDUCE_COUNTER 256//トャネマ1024
3+
//CreateDIB计数,将在绘制下列次数后更新DIB区
4+
#define BITMAP_REDUCE_COUNTER 256//默认1024
55

66

77
HDC CBitmapCache::CreateDC(HDC dc)
@@ -23,8 +23,8 @@ HBITMAP CBitmapCache::CreateDIB(int width, int height, BYTE** lplpPixels)
2323
*lplpPixels = m_lpPixels;
2424
return m_hbmp;
2525
}
26-
//カウンタ超過
27-
//ただしサイズが全く同じなら再生成しない
26+
//カウンタ超過
27+
//ただしサイズが全く同じなら再生成しない
2828
if (dibSize.cx == width && dibSize.cy == height) {
2929
m_counter = 0;
3030
*lplpPixels = m_lpPixels;
@@ -46,16 +46,16 @@ HBITMAP CBitmapCache::CreateDIB(int width, int height, BYTE** lplpPixels)
4646
}
4747
TRACE(_T("width=%d, height=%d\n"), width, height);
4848

49-
//メモリ不足等でhbmpNew==NULLの場合を想定し、
50-
//成功したときのみキャッシュを更新
49+
//メモリ不足等でhbmpNew==NULLの場合を想定し、
50+
//成功したときのみキャッシュを更新
5151
if (m_hbmp) {
5252
DeleteBitmap(m_hbmp);
5353
}
5454

5555
m_hbmp = hbmpNew;
5656
dibSize.cx = width;
5757
dibSize.cy = height;
58-
//CreateDIBSectionは多分ページ境界かセグメント境界
58+
//CreateDIBSectionは多分ページ境界かセグメント境界
5959
m_lpPixels = *lplpPixels;
6060
m_counter = 0;
6161
return m_hbmp;
@@ -79,7 +79,7 @@ void CBitmapCache::FillSolidRect(COLORREF rgb, const RECT* lprc)
7979
const DWORD dwBmpBytes = m_dibSize.cx * m_dibSize.cy;
8080
rgb = RGB2DIB(rgb);
8181
82-
//TODO: MMX or SSE化
82+
//TODO: MMX or SSE化
8383
__asm {
8484
mov edi, dword ptr [lpPixels]
8585
mov ecx, dword ptr [dwBmpBytes]
@@ -94,7 +94,7 @@ void CBitmapCache::FillSolidRect(COLORREF rgb, const RECT* lprc)
9494
// }
9595
}
9696

97-
//水平線を引く
97+
//水平線を引く
9898
//(X1,Y1) (X2,Y1)
9999
// +-----------------+ ^
100100
// | rgb | | width
@@ -111,7 +111,7 @@ void CBitmapCache::DrawHorizontalLine(int X1, int Y1, int X2, COLORREF rgb, int
111111
X2 = xx;
112112
}
113113

114-
//クリッピング
114+
//クリッピング
115115
const int xSize = m_dibSize.cx;
116116
const int ySize = m_dibSize.cy;
117117
X1 = Bound(X1, 0, xSize);
@@ -142,7 +142,7 @@ void CBitmapCache::DrawHorizontalLine(int X1, int Y1, int X2, COLORREF rgb, int
142142
}*/
143143

144144
/*#ifdef _M_IX86
145-
//無意味にアセンブリ化
145+
//無意味にアセンブリ化
146146
__asm {
147147
mov ebx, dword ptr [Yd]
148148
mov edx, dword ptr [lpPixels]
@@ -157,7 +157,7 @@ void CBitmapCache::DrawHorizontalLine(int X1, int Y1, int X2, COLORREF rgb, int
157157
dec ebx
158158
jnz L1
159159
}
160-
#else*/ //カヤモレ64ホサマオヘウ」ャハケモテCモ�ヤ
160+
#else*/ //对于64位系统,使用C语言
161161
for (int yy=Y1; yy<Y2; yy++) {
162162
for (int xx=X1; xx<X2; xx++) {
163163
*( (DWORD*)m_lpPixels + (yy * xSize + xx) ) = rgb;

cache.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ typedef StringHashT<LF_FACESIZE,true> StringHashFont;
5858
typedef StringHashT<MAX_PATH,true> StringHashModule;
5959

6060

61-
//COLORREF(RR GG BB 00) を DIB32(BB GG RR 00) に変換
61+
//COLORREF(RR GG BB 00) を DIB32(BB GG RR 00) に変換
6262
#define RGB2DIB(rgb) RGB(GetBValue(rgb), GetGValue(rgb), GetRValue(rgb))
6363
#define DIB2RGB(dib) RGB2DIB(dib)
6464

65-
// ExtTextOutWのビットマップキャッシュ
65+
// ExtTextOutWのビットマップキャッシュ
6666
class CBitmapCache
6767
{
6868
private:
@@ -142,7 +142,7 @@ class CBitmapCache
142142
*m_CurrentPixel = RGB2DIB(rgb);
143143
}
144144

145-
//本体はcache.cpp
145+
//本体はcache.cpp
146146
HDC CreateDC(HDC dc);
147147
HBITMAP CreateDIB(int width, int height, BYTE** lplpPixels);
148148
void FillSolidRect(COLORREF rgb, const RECT* lprc);

colorinvert.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#pragma once
22
//formula: (x+482)^2+(y+481)^2=880^2
3-
unsigned char InvertTable[260] = { 255,255,254,253,253,252,251,251,250,249,249,248,247,247,246,245,245,244,243,242,242,241,240,240,239,238,238,237,236,235,235,234,233,233,232,231,230,230,229,228,227,227,226,225,224,224,223,222,221,221,220,219,218,218,217,216,215,215,214,213,212,211,211,210,209,208,208,207,206,205,204,204,203,202,201,200,199,199,198,197,196,195,195,194,193,192,191,190,189,189,188,187,186,185,184,183,183,182,181,180,179,178,177,176,176,175,174,173,172,171,170,169,168,167,166,166,165,164,163,162,161,160,159,158,157,156,155,154,153,152,151,150,149,148,147,146,145,144,143,143,142,141,140,138,137,136,135,134,133,132,131,130,129,128,127,126,125,124,123,122,121,120,119,118,117,115,114,113,112,111,110,109,108,107,106,104,103,102,101,100,99,98,96,95,94,93,92,91,90,88,87,86,85,84,82,81,80,79,78,76,75,74,73,71,70,69,68,66,65,64,63,61,60,59,58,56,55,54,52,51,50,48,47,46,44,43,42,40,39,38,36,35,33,32,31,29,28,26,25,24,22,21,19,18,16,15,13,12,10,9,7,6,4,3,1,0,0,0,0,0};
3+
unsigned char InvertTable[260] = { 255,255,254,253,253,252,251,251,250,249,249,248,247,247,246,245,245,244,243,242,242,241,240,240,239,238,238,237,236,235,235,234,233,233,232,231,230,230,229,228,227,227,226,225,224,224,223,222,221,221,220,219,218,218,217,216,215,215,214,213,212,211,211,210,209,208,208,207,206,205,204,204,203,202,201,200,199,199,198,197,196,195,195,194,193,192,191,190,189,189,188,187,186,185,184,183,183,182,181,180,179,178,177,176,176,175,174,173,172,171,170,169,168,167,166,166,165,164,163,162,161,160,159,158,157,156,155,154,153,152,151,150,149,148,147,146,145,144,143,143,142,141,140,138,137,136,135,134,133,132,131,130,129,128,127,126,125,124,123,122,121,120,119,118,117,115,114,113,112,111,110,109,108,107,106,104,103,102,101,100,99,98,96,95,94,93,92,91,90,88,87,86,85,84,82,81,80,79,78,76,75,74,73,71,70,69,68,66,65,64,63,61,60,59,58,56,55,54,52,51,50,48,47,46,44,43,42,40,39,38,36,35,33,32,31,29,28,26,25,24,22,21,19,18,16,15,13,12,10,9,7,6,4,3,1,0,0,0,0,0};

common.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ FORCEINLINE HINSTANCE GetDLLInstance()
9191
return g_hinstDLL;
9292
}
9393

94-
//排他制御
94+
//排他制御
9595
class CCriticalSectionLock
9696
{
9797
#define MAX_CRITICAL_COUNT 20
@@ -148,11 +148,11 @@ static void _Trace(LPCTSTR pszFormat, ...)
148148
CCriticalSectionLock __lock;
149149
va_list argptr;
150150
va_start(argptr, pszFormat);
151-
//w(v)sprintfは1024文字以上返してこない
151+
//w(v)sprintfは1024文字以上返してこない
152152
TCHAR szBuffer[10240];
153153
wvsprintf(szBuffer, pszFormat, argptr);
154154

155-
//デバッガをアタッチしてる時はデバッガにメッセージを出す
155+
//デバッガをアタッチしてる時はデバッガにメッセージを出す
156156
//if (IsDebuggerPresent()) {
157157
OutputDebugString(szBuffer);
158158
return;
@@ -188,7 +188,7 @@ static void _Trace(LPCTSTR pszFormat, ...)
188188
}
189189
#else //!_DEBUG
190190
#define TRACE NOP_FUNCTION
191-
//↓PSDK 2003R2のwinnt.h
191+
//↓PSDK 2003R2のwinnt.h
192192
//#ifndef NOP_FUNCTION
193193
//#if (_MSC_VER >= 1210)
194194
//#define NOP_FUNCTION __noop
@@ -198,8 +198,8 @@ static void _Trace(LPCTSTR pszFormat, ...)
198198
//#endif
199199
#endif //_DEBUG
200200

201-
//TRACEマクロ
202-
//使用例: TRACE(_T("cx: %d\n"), cx);
201+
//TRACEマクロ
202+
//使用例: TRACE(_T("cx: %d\n"), cx);
203203
#ifdef USE_TRACE
204204
#define TRACE2 _Trace2
205205
#define TRACE2_STR _Trace2_Str
@@ -212,7 +212,7 @@ static void _Trace2(LPCTSTR pszFormat, ...)
212212
CCriticalSectionLock __lock;
213213
va_list argptr;
214214
va_start(argptr, pszFormat);
215-
//w(v)sprintfは1024文字以上返してこない
215+
//w(v)sprintfは1024文字以上返してこない
216216
TCHAR szBuffer[1024];
217217
wvsprintf(szBuffer, pszFormat, argptr);
218218
OutputDebugString(szBuffer);
@@ -332,7 +332,7 @@ class CCriticalSectionLockTry
332332
}
333333
};
334334

335-
// 使用後はfreeで開放する事
335+
// 使用後はfreeで開放する事
336336
LPWSTR _StrDupExAtoW(LPCSTR pszMB, int cchMB, LPWSTR pszStack, int cchStack, int* pcchWC, int nACP = CP_ACP);
337337
static inline LPWSTR _StrDupAtoW(LPCSTR pszMB, int cchMB = -1, int* pcchWC = NULL)
338338
{
@@ -358,8 +358,8 @@ template<typename T> FORCEINLINE T Bound(T x, T m, T M) { return (x < m) ? m : (
358358
template<typename T> FORCEINLINE int Sgn(T x, T y) { return (x > y) ? 1 : ((x < y) ? -1 : 0); }
359359

360360

361-
//型チェック機能つきDeleteXXX/SelectXXX
362-
//SelectObject/DeleteObjectは使用できなくなる
361+
//型チェック機能つきDeleteXXX/SelectXXX
362+
//SelectObject/DeleteObjectは使用できなくなる
363363

364364
#ifdef _DEBUG
365365
#undef DeletePen
@@ -448,8 +448,8 @@ DEFINE_SELECT_FUNCTION(HBITMAP, Bitmap)
448448
#endif //_DEBUG
449449

450450

451-
//TRACEマクロ
452-
//使用例: TRACE(_T("cx: %d\n"), cx);
451+
//TRACEマクロ
452+
//使用例: TRACE(_T("cx: %d\n"), cx);
453453
#ifndef _WIN64
454454
#ifdef _DEBUG
455455
FORCEINLINE static __int64 GetClockCount()
@@ -463,12 +463,12 @@ FORCEINLINE static __int64 GetClockCount()
463463
return cycles.QuadPart;
464464
}
465465

466-
//使用例
466+
//使用例
467467
//{
468468
// CDebugElapsedCounter _cntr("hogehoge");
469-
// : (適当な処理)
469+
// : (適当な処理)
470470
//}
471-
//出力例: "hogehoge: 10000 clocks"
471+
//出力例: "hogehoge: 10000 clocks"
472472
class CDebugElapsedCounter
473473
{
474474
private:
@@ -497,7 +497,7 @@ class CDebugElapsedCounter
497497
#endif
498498

499499

500-
//String to intオネマオチミコッハオトカィメ
500+
//String to int等系列函数的定义
501501
/*
502502
int _StrToInt(LPCTSTR pStr, int nDefault)
503503
{
@@ -577,7 +577,7 @@ int _httoi(const TCHAR *value)
577577
return result;
578578
}
579579
580-
//atofにデフォルト値を返せるようにしたような物
580+
//atofにデフォルト値を返せるようにしたような物
581581
float _StrToFloat(LPCTSTR pStr, float fDefault)
582582
{
583583
#define isspace(ch) (ch == _T('\t') || ch == _T(' '))
@@ -628,4 +628,4 @@ bool HookD2D1();
628628
void HookGdiplus();
629629
void ChangeFileName(LPWSTR lpSrc, int nSize, LPCWSTR lpNewFileName);
630630
std::wstring MakeUniqueFontName(const std::wstring strFullName, const std::wstring strFamilyName, const std::wstring strStyleName);
631-
std::string WstringToString(const std::wstring str);
631+
std::string WstringToString(const std::wstring str);

crc32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ class crc32
6060
return crc ^ ~0U;
6161
}
6262
};
63-
#endif
63+
#endif

directwrite.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "directwrite.h"
1+
#include "directwrite.h"
22
#include "settings.h"
33
#include "dynCodeHelper.h"
44

@@ -2114,4 +2114,4 @@ void WINAPI IMPL_D2D1RenderTarget_DrawTextLayout(
21142114
options
21152115
);
21162116
}
2117-
}
2117+
}

directwrite.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
#define HOOK_DEFINE(rettype, name, argtype) ;
1818
#include "hooklist.h"
1919
#undef HOOK_DEFINE
20-
#undef HOOK_MANUALLY
20+
#undef HOOK_MANUALLY

0 commit comments

Comments
 (0)