mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-12-20 20:19:35 -06:00
Compare commits
4 Commits
v1.0.0-rc1
...
v1.0.0-rc2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fef357062d | ||
|
|
03ef34ffe8 | ||
|
|
c90d1fcb7b | ||
|
|
ae3dfb12df |
@@ -2344,7 +2344,7 @@ namespace plume {
|
||||
dstWidth = rect.right - rect.left;
|
||||
dstHeight = rect.bottom - rect.top;
|
||||
# elif defined(SDL_VULKAN_ENABLED)
|
||||
SDL_GetWindowSize(renderWindow, (int *)(&dstWidth), (int *)(&dstHeight));
|
||||
SDL_GetWindowSizeInPixels(renderWindow, (int *)(&dstWidth), (int *)(&dstHeight));
|
||||
# elif defined(__ANDROID__)
|
||||
dstWidth = ANativeWindow_getWidth(renderWindow);
|
||||
dstHeight = ANativeWindow_getHeight(renderWindow);
|
||||
|
||||
@@ -2415,19 +2415,25 @@ static void DrawImGui()
|
||||
// we can adjust the mouse events before ImGui processes them.
|
||||
uint32_t width = g_swapChain->getWidth();
|
||||
uint32_t height = g_swapChain->getHeight();
|
||||
|
||||
if (width != Video::s_viewportWidth || height != Video::s_viewportHeight)
|
||||
float mousePosScaleX = float(width) / float(GameWindow::s_width);
|
||||
float mousePosScaleY = float(height) / float(GameWindow::s_height);
|
||||
float mousePosOffsetX = (width - Video::s_viewportWidth) / 2.0f;
|
||||
float mousePosOffsetY = (height - Video::s_viewportHeight) / 2.0f;
|
||||
for (int i = 0; i < io.Ctx->InputEventsQueue.Size; i++)
|
||||
{
|
||||
float mousePosOffsetX = (width - Video::s_viewportWidth) / 2.0f;
|
||||
float mousePosOffsetY = (height - Video::s_viewportHeight) / 2.0f;
|
||||
|
||||
for (int i = 0; i < io.Ctx->InputEventsQueue.Size; i++)
|
||||
auto& e = io.Ctx->InputEventsQueue[i];
|
||||
if (e.Type == ImGuiInputEventType_MousePos)
|
||||
{
|
||||
auto& e = io.Ctx->InputEventsQueue[i];
|
||||
if (e.Type == ImGuiInputEventType_MousePos)
|
||||
if (e.MousePos.PosX != -FLT_MAX)
|
||||
{
|
||||
if (e.MousePos.PosX != -FLT_MAX) e.MousePos.PosX -= mousePosOffsetX;
|
||||
if (e.MousePos.PosY != -FLT_MAX) e.MousePos.PosY -= mousePosOffsetY;
|
||||
e.MousePos.PosX *= mousePosScaleX;
|
||||
e.MousePos.PosX -= mousePosOffsetX;
|
||||
}
|
||||
|
||||
if (e.MousePos.PosY != -FLT_MAX)
|
||||
{
|
||||
e.MousePos.PosY *= mousePosScaleY;
|
||||
e.MousePos.PosY -= mousePosOffsetY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ std::unordered_map<std::string_view, std::unordered_map<ELanguage, std::string>>
|
||||
{ ELanguage::Japanese, "この\u200Bオプションは\u200B[現在:げんざい]の\u200BOSで\u200B[変更:へんこう]\u200Bできません" },
|
||||
{ ELanguage::German, "Diese Option wird von diesem Betriebssystem nicht unterstützt." },
|
||||
{ ELanguage::French, "Cette option n'est pas prise en charge par votre système d'exploitation." },
|
||||
{ ELanguage::Spanish, "Está opción no está soportada por tu sistema operativo." },
|
||||
{ ELanguage::Spanish, "Esta opción no está soportada por tu sistema operativo." },
|
||||
{ ELanguage::Italian, "Questa opzione non è disponibile con il tuo sistema operativo." }
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_MILESTONE="Release Candidate 1"
|
||||
VERSION_MILESTONE="Release Candidate 2"
|
||||
VERSION_MAJOR=1
|
||||
VERSION_MINOR=0
|
||||
VERSION_REVISION=0
|
||||
|
||||
@@ -378,6 +378,11 @@ SDL_Rect GameWindow::GetDimensions()
|
||||
return rect;
|
||||
}
|
||||
|
||||
void GameWindow::GetSizeInPixels(int *w, int *h)
|
||||
{
|
||||
SDL_GetWindowSizeInPixels(s_pWindow, w, h);
|
||||
}
|
||||
|
||||
void GameWindow::SetDimensions(int w, int h, int x, int y)
|
||||
{
|
||||
s_width = w;
|
||||
|
||||
@@ -37,6 +37,7 @@ public:
|
||||
static bool IsMaximised();
|
||||
static EWindowState SetMaximised(bool isEnabled);
|
||||
static SDL_Rect GetDimensions();
|
||||
static void GetSizeInPixels(int *w, int *h);
|
||||
static void SetDimensions(int w, int h, int x = SDL_WINDOWPOS_CENTERED, int y = SDL_WINDOWPOS_CENTERED);
|
||||
static void ResetDimensions();
|
||||
static uint32_t GetWindowFlags();
|
||||
|
||||
@@ -1121,17 +1121,25 @@ static void DrawConfigOption(int32_t rowIndex, float yOffset, ConfigDef<T>* conf
|
||||
{
|
||||
if (config == &Config::WindowSize)
|
||||
{
|
||||
auto displayModes = GameWindow::GetDisplayModes();
|
||||
|
||||
if (config->Value >= 0 && config->Value < displayModes.size())
|
||||
if (Config::Fullscreen)
|
||||
{
|
||||
auto& displayMode = displayModes[config->Value];
|
||||
|
||||
valueText = fmt::format("{}x{}", displayMode.w, displayMode.h);
|
||||
int displayW, displayH;
|
||||
GameWindow::GetSizeInPixels(&displayW, &displayH);
|
||||
valueText = fmt::format("{}x{}", displayW, displayH);
|
||||
}
|
||||
else
|
||||
{
|
||||
valueText = fmt::format("{}x{}", GameWindow::s_width, GameWindow::s_height);
|
||||
auto displayModes = GameWindow::GetDisplayModes();
|
||||
if (config->Value >= 0 && config->Value < displayModes.size())
|
||||
{
|
||||
auto& displayMode = displayModes[config->Value];
|
||||
|
||||
valueText = fmt::format("{}x{}", displayMode.w, displayMode.h);
|
||||
}
|
||||
else
|
||||
{
|
||||
valueText = fmt::format("{}x{}", GameWindow::s_width, GameWindow::s_height);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (config == &Config::Monitor)
|
||||
@@ -1458,7 +1466,7 @@ static void DrawInfoPanel(ImVec2 infoMin, ImVec2 infoMax)
|
||||
|
||||
if (g_inaccessibleReason)
|
||||
{
|
||||
desc = *g_inaccessibleReason;
|
||||
desc += "\n\n" + *g_inaccessibleReason;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1476,10 +1484,9 @@ static void DrawInfoPanel(ImVec2 infoMin, ImVec2 infoMax)
|
||||
}
|
||||
|
||||
const auto& valueDescription = g_selectedItem->GetValueDescription(Config::Language);
|
||||
|
||||
if (!valueDescription.empty())
|
||||
{
|
||||
desc += "\n\n" + valueDescription;
|
||||
}
|
||||
}
|
||||
|
||||
clipRectMin = { clipRectMin.x, thumbnailMax.y };
|
||||
|
||||
Reference in New Issue
Block a user