DXGL r704 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r703‎ | r704 | r705 >
Date:04:13, 21 May 2017
Author:admin
Status:new
Tags:
Comment:
Make automatic pixel doubling work.
Modified paths:
  • /ddraw/glDirectDraw.cpp (modified) (history)
  • /ddraw/glRenderer.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirectDraw.cpp
@@ -235,6 +235,11 @@
236236 *count += newcount;
237237 }
238238
 239+void AddDoubledResolutions(DEVMODE **array, DWORD *count)
 240+{
 241+//#error Add doubled resolutions
 242+}
 243+
239244 void AddExtraColorModes(DEVMODE **array, DWORD *count)
240245 {
241246 DEVMODE *array2 = (DEVMODE *)malloc(sizeof(DEVMODE)*(7*(*count)));
@@ -253,7 +258,7 @@
254259 count2++;
255260 }
256261 break;
257 -/* case 16:
 262+/* case 16: //FIXME: Temporarily removed for compatibility.
258263 compmode = (*array)[i];
259264 compmode.dmBitsPerPel = 15;
260265 if(!ScanModeList(*array,compmode,*count))
@@ -287,7 +292,7 @@
288293 count2++;
289294 }
290295 compmode = (*array)[i];
291 -/* compmode.dmBitsPerPel = 15;
 296+/* compmode.dmBitsPerPel = 15; // FIXME: Temporarily removed for compatibility.
292297 if(!ScanModeList(*array,compmode,*count))
293298 {
294299 array2[count2] = compmode;
@@ -381,6 +386,9 @@
382387 if(dxglcfg.AddColorDepths) AddExtraColorModes(&modes,&modenum); // FIXME: Add color depths by bitmask
383388 DiscardDuplicateModes(&modes,&modenum);
384389 if(dxglcfg.AddModes && (dxglcfg.scaler != 0)) AddExtraResolutions(&modes,&modenum); // FIXME: Add modes by bitmask
 390+ if (_isnan(dxglcfg.firstscalex) || _isnan(dxglcfg.firstscaley) ||
 391+ (dxglcfg.firstscalex < 0.25f) || (dxglcfg.firstscaley < 0.25f))
 392+ AddDoubledResolutions(&modes, &modenum);
385393 modenum--;
386394 switch(dxglcfg.SortModes)
387395 {
Index: ddraw/glRenderer.cpp
@@ -2793,10 +2793,8 @@
27942794 if (_isnan(dxglcfg.firstscalex) || _isnan(dxglcfg.firstscaley) ||
27952795 (dxglcfg.firstscalex < 0.25f) || (dxglcfg.firstscaley < 0.25f))
27962796 {
2797 - if (width <= 400) This->firstscalex = 2.0f;
2798 - else This->firstscaley = 1.0f;
2799 - if (height <= 240) This->firstscaley = 2;
2800 - else This->firstscaley = 1;
 2797+ This->firstscalex = 1.0f;
 2798+ This->firstscaley = 1.0f;
28012799 }
28022800 else
28032801 {
@@ -3351,6 +3349,19 @@
33523350 view[1] = (GLfloat)(sizes[4]-sizes[0])/2+sizes[0];
33533351 view[2] = (GLfloat)(sizes[5]-sizes[1])/2+sizes[1];
33543352 view[3] = (GLfloat)-(sizes[5]-sizes[1])/2;
 3353+ if (_isnan(dxglcfg.firstscalex) || _isnan(dxglcfg.firstscaley) ||
 3354+ (dxglcfg.firstscalex < 0.25f) || (dxglcfg.firstscaley < 0.25f))
 3355+ {
 3356+ if (sizes[2] <= 400) This->firstscalex = 2.0f;
 3357+ else This->firstscalex = 1.0f;
 3358+ if (sizes[3] <= 240) This->firstscaley = 2.0f;
 3359+ else This->firstscaley = 1.0f;
 3360+ }
 3361+ else
 3362+ {
 3363+ This->firstscalex = dxglcfg.firstscalex;
 3364+ This->firstscaley = dxglcfg.firstscaley;
 3365+ }
33553366 }
33563367 else
33573368 {