-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev/dominik #35
Dev/dominik #35
Conversation
I'm waiting for the green light to review this, as I assume isn't ready, am I correct? |
cd5f631
to
5ea23c5
Compare
is it ready? @Wit111 |
engine/src/core/core.cpp
Outdated
if (wcstombs_s(&virtualizerNameLen, nullptr, 0, virtualizerName, 0) == 0) | ||
{ | ||
char* mbstr = new char[virtualizerNameLen]; | ||
wcstombs_s(&virtualizerNameLen, mbstr, virtualizerNameLen, virtualizerName, virtualizerNameLen); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We try to deliver multiplatform code, thus we shouldn't use _s functions
engine/src/core/core.cpp
Outdated
delete[] mbstr; | ||
LOGGER_LOG(("Device found "s + virtualizerConvertedName + "Firmware Version: " + std::to_string(info.MajorVersion) + "." + std::to_string(info.MinorVersion)).c_str()); | ||
} | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo this if condition is redundant
engine/src/core/core.cpp
Outdated
{ | ||
char* mbstr = new char[virtualizerNameLen]; | ||
wcstombs_s(&virtualizerNameLen, mbstr, virtualizerNameLen, virtualizerName, virtualizerNameLen); | ||
std::string virtualizerConvertedName(mbstr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this solution is overcomplicated and in c style
you can just calculate productName c string size then create std::string with the previously gained size to finally use wcstombs and print the filled std string
engine/src/core/core.cpp
Outdated
@@ -181,6 +216,28 @@ int run(Engine* const engine) try | |||
isRenderingStarted = true; | |||
} | |||
#endif | |||
|
|||
#ifdef CYBSDK_FOUND | |||
float ring_height = device->GetPlayerHeight(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const auto, please use camelCase
engine/src/core/core.cpp
Outdated
|
||
const auto info = device->GetDeviceInfo(); | ||
|
||
const wchar_t* virtName = info.ProductName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be also const auto
engine/src/core/core.cpp
Outdated
std::vector<char> virtBuf(virtNameLen); | ||
wcstombs(virtBuf.data(), virtName, virtNameLen); | ||
std::string virtConvertedName(virtBuf.begin(), virtBuf.end()); | ||
LOGGER_LOG(std::format("Device found {} Firmware Version: {}.{}", virtConvertedName, std::to_string(static_cast<int>(info.MajorVersion)), std::to_string(static_cast<int>(info.MinorVersion))).c_str()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without to_string doesn't work?
engine/src/core/core.cpp
Outdated
if (movement_speed > 0.f) | ||
{ | ||
ring_angle *= 2 * std::numbers::pi_v<float>; | ||
float offsetX = std::sin(ring_angle) * movement_speed * flySpeedMultiplier * deltaTime; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const auto
switched movement to use cyberith virtualizer