From ba6915c3baf6c5a09b483626b1f95a073160a097 Mon Sep 17 00:00:00 2001 From: IvanPragma Date: Fri, 5 Nov 2021 00:59:53 +0500 Subject: [PATCH] After make preflight --- assets/src/ba_data/python/._ba_sources_hash | 2 +- assets/src/ba_data/python/_ba.py | 40 +++++++++++++++++++ src/ballistica/input/device/joystick.cc | 20 ++++------ .../python/methods/python_methods_graphics.cc | 4 +- src/ballistica/scene/node/image_node.cc | 4 +- src/ballistica/scene/node/terrain_node.cc | 6 +-- src/ballistica/scene/node/text_node.cc | 10 ++--- 7 files changed, 61 insertions(+), 25 deletions(-) diff --git a/assets/src/ba_data/python/._ba_sources_hash b/assets/src/ba_data/python/._ba_sources_hash index e4b6e04e..af8b1a5c 100644 --- a/assets/src/ba_data/python/._ba_sources_hash +++ b/assets/src/ba_data/python/._ba_sources_hash @@ -1 +1 @@ -291441930138756424684870937756526517762 \ No newline at end of file +206834682288822241335693999070871022992 \ No newline at end of file diff --git a/assets/src/ba_data/python/_ba.py b/assets/src/ba_data/python/_ba.py index b8620a00..cfb99e35 100644 --- a/assets/src/ba_data/python/_ba.py +++ b/assets/src/ba_data/python/_ba.py @@ -2008,6 +2008,22 @@ def get_appconfig_default_value(key: str) -> Any: return _uninferrable() +def get_camera_position() -> tuple[float, ...]: + """get_camera_position() -> tuple[float, ...] + + (internal) + """ + return (0.0, 0.0, 0.0) + + +def get_camera_target() -> tuple[float, ...]: + """get_camera_target() -> tuple[float, ...] + + (internal) + """ + return (0.0, 0.0, 0.0) + + def get_chat_messages() -> list[str]: """get_chat_messages() -> list[str] @@ -3485,6 +3501,30 @@ def set_authenticate_clients(enable: bool) -> None: return None +def set_camera_manual(value: bool) -> None: + """set_camera_manual(value: bool) -> None + + (internal) + """ + return None + + +def set_camera_position(x: float, y: float, z: float) -> None: + """set_camera_position(x: float, y: float, z: float) -> None + + (internal) + """ + return None + + +def set_camera_target(x: float, y: float, z: float) -> None: + """set_camera_target(x: float, y: float, z: float) -> None + + (internal) + """ + return None + + def set_debug_speed_exponent(speed: int) -> None: """set_debug_speed_exponent(speed: int) -> None diff --git a/src/ballistica/input/device/joystick.cc b/src/ballistica/input/device/joystick.cc index d82e8f82..480828e0 100644 --- a/src/ballistica/input/device/joystick.cc +++ b/src/ballistica/input/device/joystick.cc @@ -672,9 +672,8 @@ void Joystick::HandleSDLEvent(const SDL_Event* e) { e2.jaxis.axis = static_cast_check_fit(analog_lr_); dpad_right_held_ = (e->type == SDL_JOYBUTTONDOWN); e2.jaxis.value = static_cast_check_fit( - dpad_right_held_ ? (dpad_left_held_ ? 0 : 32767) - : dpad_left_held_ ? -32767 - : 0); + dpad_right_held_ ? (dpad_left_held_ ? 0 : 32767) + : dpad_left_held_ ? -32767 : 0); e = &e2; } else if (e->jbutton.button == left_button_ || e->jbutton.button == left_button2_) { @@ -682,9 +681,8 @@ void Joystick::HandleSDLEvent(const SDL_Event* e) { e2.jaxis.axis = static_cast_check_fit(analog_lr_); dpad_left_held_ = (e->type == SDL_JOYBUTTONDOWN); e2.jaxis.value = static_cast_check_fit( - dpad_right_held_ ? (dpad_left_held_ ? 0 : 32767) - : dpad_left_held_ ? -32767 - : 0); + dpad_right_held_ ? (dpad_left_held_ ? 0 : 32767) + : dpad_left_held_ ? -32767 : 0); e = &e2; } else if (e->jbutton.button == up_button_ || e->jbutton.button == up_button2_) { @@ -692,9 +690,8 @@ void Joystick::HandleSDLEvent(const SDL_Event* e) { e2.jaxis.axis = static_cast_check_fit(analog_ud_); dpad_up_held_ = (e->type == SDL_JOYBUTTONDOWN); e2.jaxis.value = static_cast_check_fit( - dpad_up_held_ ? (dpad_down_held_ ? 0 : -32767) - : dpad_down_held_ ? 32767 - : 0); + dpad_up_held_ ? (dpad_down_held_ ? 0 : -32767) + : dpad_down_held_ ? 32767 : 0); e = &e2; } else if (e->jbutton.button == down_button_ || e->jbutton.button == down_button2_) { @@ -702,9 +699,8 @@ void Joystick::HandleSDLEvent(const SDL_Event* e) { e2.jaxis.axis = static_cast_check_fit(analog_ud_); dpad_down_held_ = (e->type == SDL_JOYBUTTONDOWN); e2.jaxis.value = static_cast_check_fit( - dpad_up_held_ ? (dpad_down_held_ ? 0 : -32767) - : dpad_down_held_ ? 32767 - : 0); + dpad_up_held_ ? (dpad_down_held_ ? 0 : -32767) + : dpad_down_held_ ? 32767 : 0); e = &e2; } break; diff --git a/src/ballistica/python/methods/python_methods_graphics.cc b/src/ballistica/python/methods/python_methods_graphics.cc index 0296ff6b..454fa817 100644 --- a/src/ballistica/python/methods/python_methods_graphics.cc +++ b/src/ballistica/python/methods/python_methods_graphics.cc @@ -313,13 +313,13 @@ auto PythonMethodsGraphics::GetMethods() -> std::vector { {"get_camera_position", (PyCFunction)PyGetCameraPosition, METH_VARARGS | METH_KEYWORDS, - "get_camera_position() -> tuple[float, float, float]\n" + "get_camera_position() -> tuple[float, ...]\n" "\n" "(internal)"}, {"get_camera_target", (PyCFunction)PyGetCameraTarget, METH_VARARGS | METH_KEYWORDS, - "get_camera_target() -> tuple[float, float, float]\n" + "get_camera_target() -> tuple[float, ...]\n" "\n" "(internal)"}, diff --git a/src/ballistica/scene/node/image_node.cc b/src/ballistica/scene/node/image_node.cc index c9e1d723..ab0fcbb8 100644 --- a/src/ballistica/scene/node/image_node.cc +++ b/src/ballistica/scene/node/image_node.cc @@ -214,8 +214,8 @@ void ImageNode::Draw(FrameDef* frame_def) { } RenderPass& pass(*(vr_use_fixed ? frame_def->GetOverlayFixedPass() - : front_ ? frame_def->overlay_front_pass() - : frame_def->overlay_pass())); + : front_ ? frame_def->overlay_front_pass() + : frame_def->overlay_pass())); // If the pass we're drawing into changes dimensions, recalc. // Otherwise we break if a window is resized. diff --git a/src/ballistica/scene/node/terrain_node.cc b/src/ballistica/scene/node/terrain_node.cc index 338975f6..f674fc63 100644 --- a/src/ballistica/scene/node/terrain_node.cc +++ b/src/ballistica/scene/node/terrain_node.cc @@ -219,9 +219,9 @@ void TerrainNode::Draw(FrameDef* frame_def) { if (vr_only_ && !IsVRMode()) { return; } - ObjectComponent c(overlay_ ? frame_def->overlay_3d_pass() - : background_ ? frame_def->beauty_pass_bg() - : frame_def->beauty_pass()); + ObjectComponent c(overlay_ ? frame_def->overlay_3d_pass() + : background_ ? frame_def->beauty_pass_bg() + : frame_def->beauty_pass()); c.SetWorldSpace(true); c.SetTexture(color_texture_); if (lighting_) { diff --git a/src/ballistica/scene/node/text_node.cc b/src/ballistica/scene/node/text_node.cc index 10a0c0f8..bb838dfa 100644 --- a/src/ballistica/scene/node/text_node.cc +++ b/src/ballistica/scene/node/text_node.cc @@ -379,11 +379,11 @@ void TextNode::Draw(FrameDef* frame_def) { // make sure we're up to date Update(); - RenderPass& pass(*(in_world_ - ? frame_def->overlay_3d_pass() - : (vr_use_fixed ? frame_def->GetOverlayFixedPass() - : front_ ? frame_def->overlay_front_pass() - : frame_def->overlay_pass()))); + RenderPass& pass( + *(in_world_ ? frame_def->overlay_3d_pass() + : (vr_use_fixed ? frame_def->GetOverlayFixedPass() + : front_ ? frame_def->overlay_front_pass() + : frame_def->overlay_pass()))); if (big_) { if (text_group_dirty_) { TextMesh::HAlign h_align;