mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Use vectors for OpenXRAPI memory management
This commit is contained in:
parent
5b52b4b5c4
commit
c242cef627
5 changed files with 143 additions and 265 deletions
|
@ -1274,15 +1274,10 @@ Array OpenXRInterface::get_supported_environment_blend_modes() {
|
|||
return modes;
|
||||
}
|
||||
|
||||
uint32_t count = 0;
|
||||
const XrEnvironmentBlendMode *env_blend_modes = openxr_api->get_supported_environment_blend_modes(count);
|
||||
const Vector<XrEnvironmentBlendMode> env_blend_modes = openxr_api->get_supported_environment_blend_modes();
|
||||
|
||||
if (!env_blend_modes) {
|
||||
return modes;
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
switch (env_blend_modes[i]) {
|
||||
for (const XrEnvironmentBlendMode &env_blend_mode : env_blend_modes) {
|
||||
switch (env_blend_mode) {
|
||||
case XR_ENVIRONMENT_BLEND_MODE_OPAQUE:
|
||||
modes.push_back(XR_ENV_BLEND_MODE_OPAQUE);
|
||||
break;
|
||||
|
@ -1293,7 +1288,7 @@ Array OpenXRInterface::get_supported_environment_blend_modes() {
|
|||
modes.push_back(XR_ENV_BLEND_MODE_ALPHA_BLEND);
|
||||
break;
|
||||
default:
|
||||
WARN_PRINT("Unsupported blend mode found: " + String::num_int64(int64_t(env_blend_modes[i])));
|
||||
WARN_PRINT(vformat("Unsupported blend mode found: %s.", String::num_int64(int64_t(env_blend_mode))));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue