1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00
DDrawCompat/DDrawCompat/Overlay/ConfigWindow.cpp

36 lines
1.1 KiB
C++
Raw Normal View History

2021-08-23 23:08:31 +02:00
#include <Common/Hook.h>
#include <Config/Config.h>
#include <Overlay/ConfigWindow.h>
#include <Overlay/SettingControl.h>
namespace Overlay
{
ConfigWindow::ConfigWindow()
: Window(nullptr, { 0, 0, SettingControl::TOTAL_WIDTH, 200 }, { VK_F11, {} })
{
addControl(Config::alternatePixelCenter);
addControl(Config::antialiasing);
addControl(Config::displayFilter);
2021-12-14 13:15:19 +01:00
addControl(Config::renderColorDepth);
2021-12-28 00:41:11 +01:00
addControl(Config::resolutionScale);
2021-08-23 23:08:31 +02:00
addControl(Config::textureFilter);
}
void ConfigWindow::addControl(Config::Setting& setting)
{
const int index = m_controls.size();
const int rowHeight = 25;
RECT rect = { 0, index * rowHeight + BORDER / 2, m_rect.right, (index + 1) * rowHeight + BORDER / 2 };
m_controls.emplace_back(*this, rect, setting);
}
RECT ConfigWindow::calculateRect(const RECT& monitorRect) const
{
2022-02-06 23:56:59 +01:00
RECT r = { 0, 0, m_rect.right - m_rect.left, m_rect.bottom - m_rect.top };
OffsetRect(&r, monitorRect.left + (monitorRect.right - monitorRect.left - r.right) / 2,
monitorRect.top + (monitorRect.bottom - monitorRect.top - r.bottom) / 2);
2021-08-23 23:08:31 +02:00
return r;
}
}