Osiris
Osiris copied to clipboard
[Code+suggestion] Aspect ratio changer
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
You have errors in this tutorial.
- 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);
}
- Paste in visuals.h
void aspectRatio() noexcept;
- Paste into hooks.cpp (createMove)
Visuals::aspectRatio();
- 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;
- Paste it in config.h at the bottom of the visuals struct
bool aspectRatio{false};
int aspectRatioValue{0};
- 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);
}
You have errors in this tutorial.
It works for me. but thank you anyways
Fullscreen give you alot more FPS than Windowed, why would u chose that
i get more than enough fps in fullscreen windowed.