MCPcopy Create free account
hub / github.com/TASEmulators/fceux / init

Method init

src/drivers/win/debugger.cpp:2807–2866  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2805}
2806
2807void DebugSystem::init()
2808{
2809 hFixedFont = CreateFont(debuggerFontSize, debuggerFontSize / 2, /*Height,Width*/
2810 0,0, /*escapement,orientation*/
2811 FW_REGULAR,FALSE,FALSE,FALSE, /*weight, italic, underline, strikeout*/
2812 ANSI_CHARSET,OUT_DEVICE_PRECIS,CLIP_MASK, /*charset, precision, clipping*/
2813 DEFAULT_QUALITY, DEFAULT_PITCH, /*quality, and pitch*/
2814 "Courier New"); /*font name*/
2815
2816 hIDAFont = CreateFont(IDAFontSize, IDAFontSize / 2, /*Height,Width*/
2817 0,0, /*escapement,orientation*/
2818 FW_REGULAR,FALSE,FALSE,FALSE, /*weight, italic, underline, strikeout*/
2819 ANSI_CHARSET,OUT_DEVICE_PRECIS,CLIP_MASK, /*charset, precision, clipping*/
2820 DEFAULT_QUALITY, DEFAULT_PITCH, /*quality, and pitch*/
2821 "Fixedsys"); /*font name*/
2822
2823 //if the user provided his own courier font, use that
2824 extern std::string BaseDirectory;
2825 std::string courefon_path = BaseDirectory + "\\coure.fon";
2826 AddFontResourceEx(courefon_path.c_str(), FR_PRIVATE, NULL);
2827
2828 char* hexfn = hexeditorFontName;
2829 if(!hexfn) hexfn = "Courier";
2830
2831 hHexeditorFont = CreateFont(hexeditorFontHeight, hexeditorFontWidth, /*Height,Width*/
2832 0,0, /*escapement,orientation*/
2833 FW_REGULAR,FALSE,FALSE,FALSE, /*weight, italic, underline, strikeout*/
2834 ANSI_CHARSET,OUT_DEVICE_PRECIS,CLIP_MASK, /*charset, precision, clipping*/
2835 DEFAULT_QUALITY, DEFAULT_PITCH, /*quality, and pitch*/
2836 hexfn); /*font name*/
2837
2838 HDC hdc = GetDC(GetDesktopWindow());
2839 HGDIOBJ old = SelectObject(hdc,hFixedFont);
2840 TEXTMETRIC tm;
2841 GetTextMetrics(hdc,&tm);
2842 fixedFontHeight = tm.tmHeight;
2843 fixedFontWidth = tm.tmAveCharWidth;
2844 //printf("fixed font height: %d\n",fixedFontHeight);
2845 //printf("fixed font width: %d\n",fixedFontWidth);
2846 SelectObject(hdc, hHexeditorFont);
2847 GetTextMetrics(hdc,&tm);
2848 HexeditorFontHeight = tm.tmHeight;
2849 HexeditorFontWidth = tm.tmAveCharWidth;
2850 SelectObject(hdc,old);
2851 DeleteDC(hdc);
2852 hDisasmFont = debuggerIDAFont ? hIDAFont : hFixedFont;
2853 disasmFontHeight = debuggerIDAFont ? IDAFontSize : fixedFontHeight;
2854
2855 InitDbgCharFormat();
2856
2857 newline.lpstrText = "\r";
2858 newline.chrg.cpMin = 0;
2859 newline.chrg.cpMax = -1;
2860
2861 num.lpstrText = "$";
2862 num.chrg.cpMin = 0;
2863 num.chrg.cpMax = -1;
2864

Callers 3

enterTASEditorFunction · 0.45
createNewProjectFunction · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected