mirror of
https://github.com/narzoul/DDrawCompat
synced 2024-12-30 08:55:36 +01:00
Added AlternatePixelCenter setting
This commit is contained in:
parent
2b691ebdc7
commit
a3fa5cd898
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Config
|
||||
{
|
||||
Settings::AlternatePixelCenter alternatePixelCenter;
|
||||
Settings::CpuAffinity cpuAffinity;
|
||||
Settings::DesktopColorDepth desktopColorDepth;
|
||||
Settings::DisplayFilter displayFilter;
|
||||
|
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <Config/Settings/AlternatePixelCenter.h>
|
||||
#include <Config/Settings/CpuAffinity.h>
|
||||
#include <Config/Settings/DesktopColorDepth.h>
|
||||
#include <Config/Settings/DisplayFilter.h>
|
||||
@ -13,6 +14,7 @@ namespace Config
|
||||
const unsigned evictionTimeout = 200;
|
||||
const unsigned maxPaletteUpdatesPerMs = 5;
|
||||
|
||||
extern Settings::AlternatePixelCenter alternatePixelCenter;
|
||||
extern Settings::CpuAffinity cpuAffinity;
|
||||
extern Settings::DesktopColorDepth desktopColorDepth;
|
||||
extern Settings::DisplayFilter displayFilter;
|
||||
|
18
DDrawCompat/Config/Settings/AlternatePixelCenter.h
Normal file
18
DDrawCompat/Config/Settings/AlternatePixelCenter.h
Normal file
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <Config/MappedSetting.h>
|
||||
|
||||
namespace Config
|
||||
{
|
||||
namespace Settings
|
||||
{
|
||||
class AlternatePixelCenter : public MappedSetting<float>
|
||||
{
|
||||
public:
|
||||
AlternatePixelCenter()
|
||||
: MappedSetting("AlternatePixelCenter", "off", { {"off", 0.0f}, {"on", -0.5f} })
|
||||
{
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include <Common/Log.h>
|
||||
#include <Config/Config.h>
|
||||
#include <D3dDdi/DrawPrimitive.h>
|
||||
#include <D3dDdi/Device.h>
|
||||
#include <D3dDdi/Resource.h>
|
||||
@ -618,6 +619,7 @@ namespace D3dDdi
|
||||
auto vertices = m_batched.vertices.data();
|
||||
if (!m_isHwVertexProcessingUsed)
|
||||
{
|
||||
const float pixelOffset = Config::alternatePixelCenter.get();
|
||||
UINT offset = 0;
|
||||
for (UINT i = 0; i < count; ++i)
|
||||
{
|
||||
@ -626,6 +628,8 @@ namespace D3dDdi
|
||||
{
|
||||
v->rhw = 1;
|
||||
}
|
||||
v->sx += pixelOffset;
|
||||
v->sy += pixelOffset;
|
||||
offset += m_streamSource.stride;
|
||||
}
|
||||
}
|
||||
|
@ -213,6 +213,7 @@
|
||||
<ClInclude Include="Config\MappedSetting.h" />
|
||||
<ClInclude Include="Config\Parser.h" />
|
||||
<ClInclude Include="Config\Setting.h" />
|
||||
<ClInclude Include="Config\Settings\AlternatePixelCenter.h" />
|
||||
<ClInclude Include="Config\Settings\CpuAffinity.h" />
|
||||
<ClInclude Include="Config\Settings\DesktopColorDepth.h" />
|
||||
<ClInclude Include="Config\Settings\DisplayFilter.h" />
|
||||
|
@ -447,6 +447,9 @@
|
||||
<ClInclude Include="Config\Settings\DisplayFilter.h">
|
||||
<Filter>Header Files\Config\Settings</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Config\Settings\AlternatePixelCenter.h">
|
||||
<Filter>Header Files\Config\Settings</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Gdi\Gdi.cpp">
|
||||
|
Loading…
x
Reference in New Issue
Block a user