Osiris: [Improvement] Aspect ratio code

Created on 5 Jan 2020  路  5Comments  路  Source: danielkrupinski/Osiris

just c+p

misc.cpp
void Misc::aspectratio() noexcept
{
static auto aspectratio = interfaces.cvar->findVar("r_aspectratio");
if (aspectratio)
{
aspectratio->setValue(config.misc.aspectratio);
}
}

misc.h
void aspectratio() noexcept;

hooks.cpp
Misc::aspectratio();
devenv_vjyvPycflU

config.cpp

if (miscJson.isMember("Aspect Ratio")) misc.aspectratio = miscJson["Aspect Ratio"].asFloat();
miscJson["Aspect Ratio"] = misc.aspectratio;

config.h
float aspectratio{ 0 };

gui.cpp
ImGui::SliderFloat("Aspect Ratio", &config.misc.aspectratio, 0.0f, 5.0f, "%.2f");

works like a charm just use common sense and c+p

Most helpful comment

Please share you left hand code :)

All 5 comments

Please share you left hand code :)

please make a seperate fork and send a git clone command instead,
pasting code into files is prone to failure and takes much longer

template: git clone https://github.com/USERNAME/REPO
example: git clone https://github.com/danielkrupinski/Osiris

What are you on about mate?

manually having to edit many files is very slow and error prone, just fork the project and commit the changes, that way we would be able to clone it and merge it with master.

did

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kschou95 picture kschou95  路  3Comments

DivyanshuYT picture DivyanshuYT  路  3Comments

chovss picture chovss  路  4Comments

B0ruK picture B0ruK  路  3Comments

Vadenez picture Vadenez  路  3Comments