Skip to content

Commit

Permalink
cpp layer logging cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
efroemling committed Oct 22, 2024
1 parent 9c54a3a commit 6980164
Show file tree
Hide file tree
Showing 110 changed files with 1,162 additions and 976 deletions.
90 changes: 45 additions & 45 deletions .efrocachemap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### 1.7.37 (build 22052, api 9, 2024-10-21)
### 1.7.37 (build 22057, api 9, 2024-10-22)
- Bumping api version to 9. As you'll see below, there's some UI changes that
will require a bit of work for any UI mods to adapt to. If your mods don't
touch UI stuff at all you can simply bump your api version and call it a day.
Expand Down
2 changes: 1 addition & 1 deletion src/assets/ba_data/python/baenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

# Build number and version of the ballistica binary we expect to be
# using.
TARGET_BALLISTICA_BUILD = 22052
TARGET_BALLISTICA_BUILD = 22057
TARGET_BALLISTICA_VERSION = '1.7.37'


Expand Down
37 changes: 19 additions & 18 deletions src/ballistica/base/app_adapter/app_adapter_sdl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ void AppAdapterSDL::OnMainThreadStartApp() {
uint32_t sdl_flags{SDL_INIT_VIDEO | SDL_INIT_JOYSTICK};

if (strict_graphics_context_) {
Log(LogName::kBaNetworking, LogLevel::kWarning,
"AppAdapterSDL strict_graphics_context_ is enabled."
" Remember to turn this off.");
g_core->Log(LogName::kBaNetworking, LogLevel::kWarning,
"AppAdapterSDL strict_graphics_context_ is enabled."
" Remember to turn this off.");
}

// We may or may not want xinput on windows.
Expand Down Expand Up @@ -309,16 +309,16 @@ void AppAdapterSDL::SleepUntilNextEventCycle_(microsecs_t cycle_start_time) {
const microsecs_t min_sleep{2000};
if (now + min_sleep >= target_time) {
if (debug_log_sdl_frame_timing_) {
Log(LogName::kBaNetworking, LogLevel::kDebug,
"no sleep."); // 'till brooklyn!
g_core->Log(LogName::kBaNetworking, LogLevel::kDebug,
"no sleep."); // 'till brooklyn!
}
} else {
if (debug_log_sdl_frame_timing_) {
char buf[256];
snprintf(buf, sizeof(buf), "render %.1f sleep %.1f",
(now - cycle_start_time) / 1000.0f,
(target_time - now) / 1000.0f);
Log(LogName::kBaNetworking, LogLevel::kDebug, buf);
g_core->Log(LogName::kBaNetworking, LogLevel::kDebug, buf);
}
g_core->platform->SleepMicrosecs(target_time - now);
}
Expand Down Expand Up @@ -376,9 +376,9 @@ void AppAdapterSDL::HandleSDLEvent_(const SDL_Event& event) {
g_base->input->PushJoystickEvent(event, js);
}
} else {
Log(LogName::kBaInput, LogLevel::kError,
"Unable to get SDL Joystick for event type "
+ std::to_string(event.type));
g_core->Log(LogName::kBaInput, LogLevel::kError,
"Unable to get SDL Joystick for event type "
+ std::to_string(event.type));
}
break;
}
Expand Down Expand Up @@ -565,10 +565,10 @@ void AppAdapterSDL::OnSDLJoystickAdded_(int device_index) {
try {
j = Object::NewDeferred<JoystickInput>(device_index);
} catch (const std::exception& exc) {
Log(LogName::kBaInput, LogLevel::kError,
std::string("Error creating JoystickInput for SDL device-index "
+ std::to_string(device_index) + ": ")
+ exc.what());
g_core->Log(LogName::kBaInput, LogLevel::kError,
std::string("Error creating JoystickInput for SDL device-index "
+ std::to_string(device_index) + ": ")
+ exc.what());
return;
}
assert(j != nullptr);
Expand Down Expand Up @@ -604,7 +604,8 @@ void AppAdapterSDL::RemoveSDLInputDevice_(int index) {

// Note: am running into this with a PS5 controller on macOS Sequoia beta.
if (!j) {
Log(LogName::kBaInput, LogLevel::kError,
g_core->Log(
LogName::kBaInput, LogLevel::kError,
"GetSDLJoystickInput_() returned nullptr on RemoveSDLInputDevice_();"
" joysticks size is "
+ std::to_string(sdl_joysticks_.size()) + "; index is "
Expand All @@ -616,10 +617,10 @@ void AppAdapterSDL::RemoveSDLInputDevice_(int index) {
if (static_cast_check_fit<int>(sdl_joysticks_.size()) > index) {
sdl_joysticks_[index] = nullptr;
} else {
Log(LogName::kBaInput, LogLevel::kError,
"Invalid index on RemoveSDLInputDevice: size is "
+ std::to_string(sdl_joysticks_.size()) + "; index is "
+ std::to_string(index) + ".");
g_core->Log(LogName::kBaInput, LogLevel::kError,
"Invalid index on RemoveSDLInputDevice: size is "
+ std::to_string(sdl_joysticks_.size()) + "; index is "
+ std::to_string(index) + ".");
}
g_base->input->PushRemoveInputDeviceCall(j, true);
}
Expand Down
8 changes: 4 additions & 4 deletions src/ballistica/base/app_adapter/app_adapter_vr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ void AppAdapterVR::VRPreDraw() {
assert(g_base->app_adapter->InGraphicsContext());
// FIXME - this is internal graphics-server details that the render-server
// should handle.
Log(LogName::kBaGraphics, LogLevel::kWarning,
"FIXME: Have GraphicsServer handle VR drawing.");
g_core->Log(LogName::kBaGraphics, LogLevel::kWarning,
"FIXME: Have GraphicsServer handle VR drawing.");
// if (FrameDef* frame_def = g_base->graphics_server->GetRenderFrameDef()) {
// // Note: this could be part of PreprocessRenderFrameDef but the non-vr
// // path needs it to be separate since preprocess doesn't happen
Expand All @@ -76,8 +76,8 @@ void AppAdapterVR::VRPostDraw() {
g_base->graphics_server->FinishRenderFrameDef(vr_render_frame_def_);
vr_render_frame_def_ = nullptr;
}
Log(LogName::kBaGraphics, LogLevel::kWarning,
"WOULD RUN RENDER UPKEEP CYCLE");
g_core->Log(LogName::kBaGraphics, LogLevel::kWarning,
"WOULD RUN RENDER UPKEEP CYCLE");
// RunRenderUpkeepCycle();
}

Expand Down
Loading

0 comments on commit 6980164

Please sign in to comment.