DXGL r676 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r675‎ | r676 | r677 >
Date:00:06, 1 August 2016
Author:admin
Status:new
Tags:
Comment:
Update release version.
Fix uninitialized variable in DXGLCFG install/uninstall functions.
Remove a free call on NULL.
Update help and readme.
Modified paths:
  • /Help/dxgl.hhp (modified) (history)
  • /Help/introduction.htm (modified) (history)
  • /Installer/dxgl.nsi (modified) (history)
  • /ReadMe.md (modified) (history)
  • /cfgmgr/cfgmgr.c (modified) (history)
  • /common/releasever.h (modified) (history)
  • /dxglcfg/dxglcfg.c (modified) (history)
  • /dxglcfg2/dxglcfg2.c (modified) (history)

Diff [purge]

Index: Help/dxgl.hhp
——@@ -15,6 +15,7 @@
1616 [FILES]
1717 introduction.htm
1818 configuration.htm
 19+troubleshooting.htm
1920 dxgl.css
2021 dxglcfg.png
2122
Index: Help/introduction.htm
——@@ -1,10 +1,105 @@
22 <!DOCTYPE html>
33 <html>
4 - <head>
 4+<head>
 5+ <meta charset="utf-8">
56 <title>Introduction</title>
6 - </head>
7 - <body>
8 - <p>DXGL is a project to create a DirectDraw/Direct3D version 1 to 7 implementation that runs on OpenGL 2.0. It is intended to alleviate some of the graphics glitches inherent with using legacy DirectX interfaces on modern video cards. The API will be 100% binary compatible with the system ddraw.dll file.</p>
9 - <p>DXGL is currently in an alpha stage of development and very little works at this point.</p>
10 - </body>
 7+ <style></style>
 8+</head>
 9+<body id="preview">
 10+ <h1>DXGL</h1>
 11+ <p><a href="https://www.dxgl.info">https://www.dxgl.info</a></p>
 12+ <h2>Introduction</h2>
 13+ <p>DXGL is a free replacement for the Windows ddraw.dll library, running on OpenGL. It is designed to overcome driver bugs, particularly in Windows Vista and newer operating systems. It also adds various enhancements to the graphics output such as display scaling and filtering options. DXGL supports the DirectX 7.0 graphics APIs, however it is currently under development and many programs are not yet compatible with DXGL.</p>
 14+ <h2>Updgrade notes</h2>
 15+ <p>
 16+ If you upgrade from DXGL 0.5.8 or earlier, the configuration format will be changed, and earlier versions of DXGL will no longer recognize the profiles.
 17+ In addition, any profiles generated by older versions of DXGL going forward will not be recognized by DXGL 0.5.9 or later.
 18+ If you wish to migrate any old profiles generated after installing DXGL 0.5.9 or later, you will need to use Regedit to delete the “Configuration Version” registry value from the HKEY_CURRENT_USER\SOFTWARE\DXGL registry key to force the upgrade to be run again.
 19+ </p>
 20+ <h2>GitHub Notice</h2>
 21+ <p>If you downloaded the DXGL source code from GitHub, please note that when compiling DXGL, the version number will not indicate the revision number. This issue is also present when compiling from a zipped source code distribution from the <a href="http://www.dxgl.info">www.dxgl.info</a> or <a href="http://www.williamfeely.info">www.williamfeely.info</a> website.</p>
 22+ <h2>System Requirements</h2>
 23+ <ul>
 24+ <li>Windows XP SP3, Vista, 7, 8, 8.1, or 10 (May work under recent versions of Wine)</li>
 25+ <li>
 26+ OpenGL 2.0 or higher compatible video card, with hardware accelerated non-power-of-two size textures
 27+ <ul>
 28+ <li>OpenGL 3.2 or higher recommended.</li>
 29+ </ul>
 30+ </li>
 31+ <li>Visual C++ 2013 x86 runtime, available at <a href="https://www.microsoft.com/en-us/download/details.aspx?id=40784">https://www.microsoft.com/en-us/download/details.aspx?id=40784</a> (will be installed if not present)</li>
 32+ </ul>
 33+ <h2>Build Requirements</h2>
 34+ <ul>
 35+ <li>Visual Studio 2013, either full/community version or Express for Windows Desktop might work.</li>
 36+ <li>
 37+ The following components are optional. The build process will ask for these if they do not exist:
 38+ <ul>
 39+ <li>TortoiseSVN (to fill in revision on SVN builds)</li>
 40+ <li>HTML Help Workshop (to build help)</li>
 41+ <li>NSIS (to build installer, requires TortoiseSVN and HTML Help Workshop to succeed)</li>
 42+ </ul>
 43+ </li>
 44+ </ul>
 45+ <h2>Build Instructions</h2>
 46+ <p>These instructions assume that you do not have any of the required software installed. If you already have any or all of this software installed and set up, skip those steps.</p>
 47+ <ul>
 48+ <li>Install Visual Studio 2013 Community at <a href="https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx">https://www.visualstudio.com/en-us/news/vs2013-community-vs.aspx</a></li>
 49+ <li>Open the dxgl.sln file, select your build configuration (Debug or Release) in the toolbar, and press F7 to build.</li>
 50+ </ul>
 51+ <h2>Progress</h2>
 52+ <p>
 53+ For detailed progress information, please check <a href="https://www.williamfeely.info/wiki/DXGL_Features">https://www.williamfeely.info/wiki/DXGL_Features</a>
 54+ What works:
 55+ </p>
 56+ <ul>
 57+ <li>DirectDraw object creation and destruction (versions 1 to 7)</li>
 58+ <li>Display mode enumeration and switching (with emulated mode switching)</li>
 59+ <li>Fullscreen and windowed modes.</li>
 60+ <li>Basic Blt() functionality</li>
 61+ <li>8-bit color emulated with GLSL shader</li>
 62+ </ul>
 63+ <p>What partially works:</p>
 64+ <ul>
 65+ <li>3D graphics are only partially supported.</li>
 66+ </ul>
 67+ <p>What doesn’t work:</p>
 68+ <ul>
 69+ <li>Many functions are stubbed out and return an error</li>
 70+ </ul>
 71+ <h2>Installation</h2>
 72+ <p>
 73+ Run the installer. When the installer completes, open DXGL Config and add your program files to the config program.
 74+ To uninstall, go to the Add/Remove Programs or Programs and Features control panel and uninstall.
 75+ </p>
 76+ <h2>SVN</h2>
 77+ <p>
 78+ SVN readonly access is available at:
 79+ <a href="https://www.dxgl.info/svn/dxgl/">https://www.dxgl.info/svn/dxgl/</a>
 80+ </p>
 81+ <p>
 82+ There is a Mediawiki-based SVN log at:
 83+ <a href="https://www.williamfeely.info/wiki/Special:Code/DXGL">https://www.williamfeely.info/wiki/Special:Code/DXGL</a>
 84+ </p>
 85+ <h2>AppDB</h2>
 86+ <p>
 87+ An AppDB system (similar to that on <a href="http://winehq.org">winehq.org</a>) is now available at:
 88+ <a href="https://www.dxgl.info/appdb/">https://www.dxgl.info/appdb/</a>
 89+ </p>
 90+ <p>This requires a user account separate from the other services.</p>
 91+ <p>Please note that the AppDB is now deprecated and will be made read-only once the new DXGL Wiki launches.</p>
 92+ <h2>Discussion boards</h2>
 93+ <p>
 94+ You may discuss DXGL at:
 95+ <a href="https://www.dxgl.info/phpBB3/">https://www.dxgl.info/phpBB3/</a>
 96+ </p>
 97+ <p>You must create a forum account to post content. For bug reports, please refer to the next section.</p>
 98+ <h2>Bug reports</h2>
 99+ <p>
 100+ Bug reports are managed by a Bugzilla system available at:
 101+ <a href="https://www.dxgl.info/bugzilla/">https://www.dxgl.info/bugzilla/</a>
 102+ </p>
 103+ <p>A user account needs to be created at this site to post bug reports.</p>
 104+
 105+</body>
11106 </html>
\ No newline at end of file
Index: Installer/dxgl.nsi
——@@ -17,6 +17,10 @@
1818
1919
2020 SetCompressor /SOLID lzma
 21+!ifdef NSIS_PACKEDVERSION
 22+ ManifestSupportedOS all
 23+ ManifestDPIAware true
 24+!endif
2125
2226 !include 'WinVer.nsh'
2327 !include 'LogicLib.nsh'
Index: ReadMe.md
——@@ -1,11 +1,16 @@
2 -# DXGL 0.5.8
3 -https://www.williamfeely.info/wiki/DXGL
 2+# DXGL 0.5.9
 3+https://www.dxgl.info
44
55 ## Introduction
6 -DXGL is a free replacement for the Windows ddraw.dll library, running on OpenGL. It is designed to overcome driver bugs, particularly in Windows Vista and newer operating systems. It also adds various enhancements to the graphics output such as display scaling and filtering options. DXGL supports the DirectX 7.0 graphics APIs, however it is currently under development and does not work with many programs.
 6+DXGL is a free replacement for the Windows ddraw.dll library, running on OpenGL. It is designed to overcome driver bugs, particularly in Windows Vista and newer operating systems. It also adds various enhancements to the graphics output such as display scaling and filtering options. DXGL supports the DirectX 7.0 graphics APIs, however it is currently under development and many programs are not yet compatible with DXGL.
77
 8+## Updgrade notes
 9+If you upgrade from DXGL 0.5.8 or earlier, the configuration format will be changed, and earlier versions of DXGL will no longer recognize the profiles.
 10+In addition, any profiles generated by older versions of DXGL going forward will not be recognized by DXGL 0.5.9 or later.
 11+If you wish to migrate any old profiles generated after installing DXGL 0.5.9 or later, you will need to use Regedit to delete the "Configuration Version" registry value from the HKEY_CURRENT_USER\SOFTWARE\DXGL registry key to force the upgrade to be run again.
 12+
813 ## GitHub Notice
9 -If you downloaded DXGL from GitHub, please note that the version number will not work.
 14+If you downloaded the DXGL source code from GitHub, please note that when compiling DXGL, the version number will not indicate the revision number. This issue is also present when compiling from a zipped source code distribution from the www.dxgl.info or www.williamfeely.info website.
1015
1116 ## System Requirements
1217
——@@ -15,7 +20,7 @@
1621 * Visual C++ 2013 x86 runtime, available at https://www.microsoft.com/en-us/download/details.aspx?id=40784 (will be installed if not present)
1722
1823 ## Build Requirements
19 -* Visual Studio 2013, either full version or Express for Windows Desktop might work.
 24+* Visual Studio 2013, either full/community version or Express for Windows Desktop might work.
2025 * The following components are optional. The build process will ask for these if they do not exist:
2126 * TortoiseSVN (to fill in revision on SVN builds)
2227 * HTML Help Workshop (to build help)
——@@ -66,14 +71,13 @@
6772 ## Discussion boards
6873
6974 You may discuss DXGL at:
70 -https://www.dxgl.info/phpBB3
 75+https://www.dxgl.info/phpBB3/
7176
72 -You must create a forum account to post content.
 77+You must create a forum account to post content. For bug reports, please refer to the next section.
7378
74 -
7579 ## Bug reports
7680
7781 Bug reports are managed by a Bugzilla system available at:
78 -https://www.dxgl.info/bugzilla
 82+https://www.dxgl.info/bugzilla/
7983
8084 A user account needs to be created at this site to post bug reports.
Index: cfgmgr/cfgmgr.c
——@@ -901,7 +901,6 @@
902902 olddir = realloc(olddir, olddirsize);
903903 if (!olddir)
904904 {
905 - free(olddir);
906905 MessageBox(NULL, _T("Out of memory updating registry"), _T("Fatal error"), MB_ICONSTOP | MB_OK);
907906 ExitProcess(error);
908907 }
Index: common/releasever.h
——@@ -4,7 +4,7 @@
55
66 #define DXGLMAJORVER 0
77 #define DXGLMINORVER 5
8 -#define DXGLPOINTVER 8
 8+#define DXGLPOINTVER 9
99
1010 #define STR2(x) #x
1111 #define STR(x) STR2(x)
Index: dxglcfg/dxglcfg.c
——@@ -749,6 +749,7 @@
750750 EnableWindow(GetDlgItem(hWnd, IDC_PATHLABEL), FALSE);
751751 EnableWindow(GetDlgItem(hWnd, IDC_PROFILEPATH), FALSE);
752752 // Check install path
 753+ installpath = NULL;
753754 error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\DXGL"), 0, KEY_READ, &hKey);
754755 if (error == ERROR_SUCCESS)
755756 {
——@@ -925,7 +926,7 @@
926927 case IDC_APPS:
927928 OldTextColor = GetTextColor(drawitem->hDC);
928929 OldBackColor = GetBkColor(drawitem->hDC);
929 - if((drawitem->itemAction | ODA_SELECT) && (drawitem->itemState & ODS_SELECTED) &&
 930+ if((drawitem->itemAction & ODA_SELECT) && (drawitem->itemState & ODS_SELECTED) &&
930931 !(drawitem->itemState & ODS_COMBOBOXEDIT))
931932 {
932933 SetTextColor(drawitem->hDC,GetSysColor(COLOR_HIGHLIGHTTEXT));
——@@ -1377,6 +1378,7 @@
13781379 if (error == ERROR_SUCCESS)
13791380 {
13801381 dxgl_installdir = TRUE;
 1382+ sizeout = (MAX_PATH + 1) * sizeof(TCHAR);
13811383 error = RegQueryValueEx(hKeyInstall, _T("InstallDir"), NULL, NULL, (LPBYTE)installpath, &sizeout);
13821384 if (error == ERROR_SUCCESS) installed = TRUE;
13831385 }
——@@ -1466,6 +1468,7 @@
14671469 if (error == ERROR_SUCCESS)
14681470 {
14691471 dxgl_installdir = TRUE;
 1472+ sizeout = (MAX_PATH + 1) * sizeof(TCHAR);
14701473 error = RegQueryValueEx(hKeyInstall, _T("InstallDir"), NULL, NULL, (LPBYTE)installpath, &sizeout);
14711474 if (error == ERROR_SUCCESS) installed = TRUE;
14721475 }
Index: dxglcfg2/dxglcfg2.c
——@@ -997,6 +997,7 @@
998998 //EnableWindow(GetDlgItem(hWnd, IDC_PATHLABEL), FALSE);
999999 //EnableWindow(GetDlgItem(hWnd, IDC_PROFILEPATH), FALSE);
10001000 // Check install path
 1001+ installpath = NULL;
10011002 error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\DXGL"), 0, KEY_READ, &hKey);
10021003 if (error == ERROR_SUCCESS)
10031004 {
——@@ -1193,7 +1194,7 @@
11941195 case IDC_APPS:
11951196 OldTextColor = GetTextColor(drawitem->hDC);
11961197 OldBackColor = GetBkColor(drawitem->hDC);
1197 - if((drawitem->itemAction | ODA_SELECT) && (drawitem->itemState & ODS_SELECTED) &&
 1198+ if((drawitem->itemAction & ODA_SELECT) && (drawitem->itemState & ODS_SELECTED) &&
11981199 !(drawitem->itemState & ODS_COMBOBOXEDIT))
11991200 {
12001201 SetTextColor(drawitem->hDC,GetSysColor(COLOR_HIGHLIGHTTEXT));
——@@ -1635,6 +1636,7 @@
16361637 if (error == ERROR_SUCCESS)
16371638 {
16381639 dxgl_installdir = TRUE;
 1640+ sizeout = (MAX_PATH + 1) * sizeof(TCHAR);
16391641 error = RegQueryValueEx(hKeyInstall, _T("InstallDir"), NULL, NULL, (LPBYTE)installpath, &sizeout);
16401642 if (error == ERROR_SUCCESS) installed = TRUE;
16411643 }
——@@ -1724,6 +1726,7 @@
17251727 if (error == ERROR_SUCCESS)
17261728 {
17271729 dxgl_installdir = TRUE;
 1730+ sizeout = (MAX_PATH + 1) * sizeof(TCHAR);
17281731 error = RegQueryValueEx(hKeyInstall, _T("InstallDir"), NULL, NULL, (LPBYTE)installpath, &sizeout);
17291732 if (error == ERROR_SUCCESS) installed = TRUE;
17301733 }