Osiris icon indicating copy to clipboard operation
Osiris copied to clipboard

[Code+suggestion] Aspect ratio changer

Open hydemods opened this issue 7 years ago • 4 comments

Kinda useless. But i enjoy the look of stretched. So you can play in fullscreen windowed and still have the stretched look. Included below is the code and tutorial if any of you want to paste it to Osiris. https://pastebin.com/QpuSVKWq

hydemods avatar Jul 19 '19 03:07 hydemods

You have errors in this tutorial.

NexSqaud avatar Jul 19 '19 09:07 NexSqaud

  1. Paste in visuals.cpp
void Visuals::aspectRatio() noexcept {
    if (!config.visuals.aspectRatio)
        return;
 
    float ratio = (config.visuals.aspectRatioValue * 0.1) / 2;
    if (ratio > 0.001)
        interfaces.cvar->findVar("r_aspectratio")->setValue(ratio);
    else
        interfaces.cvar->findVar("r_aspectratio")->setValue((35 * 0.1f) / 2);
}
  1. Paste in visuals.h
void aspectRatio() noexcept;
  1. Paste into hooks.cpp (createMove)
Visuals::aspectRatio();
  1. Paste into config.cpp at the bottom of the visuals section in Config::load
if(visualsJson.isMember("Aspect Ratio")) visuals.aspectRatio = visualsJson["Aspect Ratio"].asBool();
if (visualsJson.isMember("Aspect Ratio Value")) visuals.aspectRatioValue = visualsJson["Aspect Ratio Value"].asInt();

and this at the bottom of the visuals section in Config::save

visualsJson["Aspect Ratio"] = visuals.aspectRatio;
visualsJson["Aspect Ratio Value"] = visuals.aspectRatioValue;
  1. Paste it in config.h at the bottom of the visuals struct
bool aspectRatio{false};
int aspectRatioValue{0};
  1. Paste into gui.cpp at the bottom of the Gui::renderVisualsWindow()
ImGui::Checkbox("Enable aspect ratio changer", &config.visuals.aspectRatio)
if (config.visuals.aspectRatio)
        {
            ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 10);
            ImGui::SliderInt("Aspect ratio value", &config.visuals.aspectRatioValue, 0, 200);
            ImGui::SetCursorPosX(ImGui::GetCursorPosX() + 10);
        }

NexSqaud avatar Jul 19 '19 09:07 NexSqaud

You have errors in this tutorial.

It works for me. but thank you anyways

hydemods avatar Jul 19 '19 18:07 hydemods

Fullscreen give you alot more FPS than Windowed, why would u chose that

i get more than enough fps in fullscreen windowed.

hydemods avatar Jul 19 '19 22:07 hydemods