mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 08:15:18 -04:00
cocoadisplay: fix unprotected debug/spam prints
This commit is contained in:
parent
2a65f583d0
commit
c85cc8f2e8
@ -230,10 +230,12 @@ begin_frame(FrameMode mode, Thread *current_thread) {
|
||||
_context_needs_update = true;
|
||||
[cocoagsg->_context setView:_view];
|
||||
|
||||
if (cocoadisplay_cat.is_spam()) {
|
||||
cocoadisplay_cat.spam()
|
||||
<< "Switching context to view " << _view << "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update the context if necessary, to make it reallocate buffers etc.
|
||||
if (_context_needs_update) {
|
||||
@ -1070,8 +1072,11 @@ set_properties_now(WindowProperties &properties) {
|
||||
frame.origin.x = x;
|
||||
frame.origin.y = container.size.height - y - frame.size.height;
|
||||
|
||||
if (cocoadisplay_cat.is_debug()) {
|
||||
cocoadisplay_cat.debug()
|
||||
<< "Setting window content origin to " << frame.origin.x << ", " << frame.origin.y << "\n";
|
||||
<< "Setting window content origin to "
|
||||
<< frame.origin.x << ", " << frame.origin.y << "\n";
|
||||
}
|
||||
|
||||
if (_window != nil) {
|
||||
[_window setFrame:[_window frameRectForContentRect:frame] display:NO];
|
||||
@ -1739,16 +1744,20 @@ handle_close_request() {
|
||||
// and process it directly.
|
||||
throw_event(close_request_event);
|
||||
|
||||
if (cocoadisplay_cat.is_debug()) {
|
||||
cocoadisplay_cat.debug()
|
||||
<< "Window requested close. Rejecting, throwing event "
|
||||
<< close_request_event << " instead\n";
|
||||
}
|
||||
|
||||
// Prevent the operating system from closing the window.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cocoadisplay_cat.is_debug()) {
|
||||
cocoadisplay_cat.debug()
|
||||
<< "Window requested close, accepting\n";
|
||||
}
|
||||
|
||||
// Let the operating system close the window normally.
|
||||
return true;
|
||||
@ -1759,7 +1768,9 @@ handle_close_request() {
|
||||
*/
|
||||
void CocoaGraphicsWindow::
|
||||
handle_close_event() {
|
||||
if (cocoadisplay_cat.is_debug()) {
|
||||
cocoadisplay_cat.debug() << "Window is about to close\n";
|
||||
}
|
||||
|
||||
_window = nil;
|
||||
|
||||
@ -1995,15 +2006,19 @@ handle_mouse_button_event(int button, bool down) {
|
||||
_input->button_down(MouseButton::button(button));
|
||||
|
||||
#ifndef NDEBUG
|
||||
if (cocoadisplay_cat.is_spam()) {
|
||||
cocoadisplay_cat.spam()
|
||||
<< "Mouse button " << button << " down\n";
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
_input->button_up(MouseButton::button(button));
|
||||
|
||||
#ifndef NDEBUG
|
||||
if (cocoadisplay_cat.is_spam()) {
|
||||
cocoadisplay_cat.spam()
|
||||
<< "Mouse button " << button << " up\n";
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user