From cc8530f8a92ccbab705890da2e1cbb27d6596177 Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 15 Oct 2008 03:21:19 +0000 Subject: [PATCH] fix unfortunate naming of MouseAndKeyboard node --- panda/src/display/lru.cxx | 121 ------------------ panda/src/glxdisplay/glxGraphicsWindow.cxx | 2 +- .../src/tinydisplay/tinySDLGraphicsWindow.cxx | 2 +- panda/src/tinydisplay/tinyXGraphicsWindow.cxx | 2 +- panda/src/windisplay/winGraphicsWindow.cxx | 2 +- 5 files changed, 4 insertions(+), 125 deletions(-) diff --git a/panda/src/display/lru.cxx b/panda/src/display/lru.cxx index eb879ccd49..dbd850126c 100644 --- a/panda/src/display/lru.cxx +++ b/panda/src/display/lru.cxx @@ -689,127 +689,6 @@ void Lru::update_lru_page (LruPage *lru_page) //////////////////////////////////////////////////////////////////// void Lru::update_lru_page_old (LruPage *lru_page) { - -#if LRU_UNIT_TEST - if(false) { - char string[256]; - - sprintf(string, " UPDATE %d\n", lru_page->_m.identifier); - OutputDebugString(string); - } -#endif - - if(lru_page->_m.v.lock == false) { - int delta_priority; - - delta_priority = 0; - if(false && lru_page->_m.total_usage > 0) { - int lifetime_frames; - - lifetime_frames = this->_m.current_frame_identifier - - lru_page->_m.first_frame_identifier; - if(lifetime_frames >= 10) { - float one_over_update_frames; - - if(lru_page->_m.update_frame_identifier) { - int target_priority; - int integer_update_frames; - float update_frames; - float update_average_frame_utilization; - float average_frame_bandwidth_utilization; - - integer_update_frames = (this->_m.current_frame_identifier - - lru_page->_m.update_frame_identifier); - if(integer_update_frames > 0) { - update_frames = ( float ) integer_update_frames; - one_over_update_frames = 1.0f / update_frames; - - update_average_frame_utilization = - (float) (lru_page->_m.update_total_usage) * - one_over_update_frames; - - lru_page->_m.average_frame_utilization = - calculate_exponential_moving_average ( - update_average_frame_utilization, this->_m.weight, - lru_page->_m.average_frame_utilization); - - average_frame_bandwidth_utilization = - lru_page->_m.average_frame_utilization * - lru_page->_m.size; - - target_priority = (int) (average_frame_bandwidth_utilization * - this->_m.frame_bandwidth_factor); - - target_priority = (LPP_TotalPriorities - 1) - target_priority; - if(target_priority < 0) { - target_priority = 0; - } - if(target_priority >= LPP_TotalPriorities) { - target_priority = LPP_TotalPriorities - 1; - } - - delta_priority = target_priority - lru_page->_m.priority; - lru_page->change_priority(delta_priority); - } - } - - lru_page->_m.update_frame_identifier = - this->_m.current_frame_identifier; - - lru_page->_m.update_total_usage = 0; - } - } - - if(delta_priority == 0) { - if(this->_m.current_frame_identifier - == lru_page->_m.current_frame_identifier) { - // page used during this frame twice or more => - // increase priority - if(lru_page->_m.current_frame_usage >= 2) { - if(lru_page->_m.priority >= LPP_High) { - lru_page->change_priority(-2); - } - } - - if(lru_page->_m.total_frame_page_faults >= 1) { - // multiple page faults this frame => increase priority - if(lru_page->_m.total_frame_page_faults >= 2) { - if(lru_page->_m.priority >= LPP_High) { - lru_page->change_priority(-2); - } - } - else { - // single page faults this frame => increase priority - if(lru_page->_m.priority >= LPP_High) { - lru_page->change_priority(-1); - } - } - } - } - else { - // page not used this frame - int last_access_delta; - - last_access_delta - = this->_m.current_frame_identifier - - lru_page->_m.current_frame_identifier; - if(last_access_delta > 1) { - if(lru_page->_m.priority < LPP_Low) { - lru_page->change_priority(+1); - } - } - } - } - - if(lru_page->_m.priority_change) { - if(this->_m.total_lru_page_priority_changes - < FRAME_MAXIMUM_PRIORITY_CHANGES) { - this->_m.lru_page_priority_change_array - [this->_m.total_lru_page_priority_changes]= lru_page; - this->_m.total_lru_page_priority_changes++; - } - } - } } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/glxdisplay/glxGraphicsWindow.cxx b/panda/src/glxdisplay/glxGraphicsWindow.cxx index 5dce6241b6..da3a6210b0 100644 --- a/panda/src/glxdisplay/glxGraphicsWindow.cxx +++ b/panda/src/glxdisplay/glxGraphicsWindow.cxx @@ -75,7 +75,7 @@ glxGraphicsWindow(GraphicsPipe *pipe, _net_wm_state_remove = glx_pipe->_net_wm_state_remove; GraphicsWindowInputDevice device = - GraphicsWindowInputDevice::pointer_and_keyboard(this, "keyboard/mouse"); + GraphicsWindowInputDevice::pointer_and_keyboard(this, "keyboard_mouse"); add_input_device(device); } diff --git a/panda/src/tinydisplay/tinySDLGraphicsWindow.cxx b/panda/src/tinydisplay/tinySDLGraphicsWindow.cxx index 0a2f0e95da..245bf43009 100644 --- a/panda/src/tinydisplay/tinySDLGraphicsWindow.cxx +++ b/panda/src/tinydisplay/tinySDLGraphicsWindow.cxx @@ -47,7 +47,7 @@ TinySDLGraphicsWindow(GraphicsPipe *pipe, update_pixel_factor(); GraphicsWindowInputDevice device = - GraphicsWindowInputDevice::pointer_and_keyboard(this, "keyboard/mouse"); + GraphicsWindowInputDevice::pointer_and_keyboard(this, "keyboard_mouse"); add_input_device(device); } diff --git a/panda/src/tinydisplay/tinyXGraphicsWindow.cxx b/panda/src/tinydisplay/tinyXGraphicsWindow.cxx index aeef9e645b..1991d94602 100644 --- a/panda/src/tinydisplay/tinyXGraphicsWindow.cxx +++ b/panda/src/tinydisplay/tinyXGraphicsWindow.cxx @@ -83,7 +83,7 @@ TinyXGraphicsWindow(GraphicsPipe *pipe, update_pixel_factor(); GraphicsWindowInputDevice device = - GraphicsWindowInputDevice::pointer_and_keyboard(this, "keyboard/mouse"); + GraphicsWindowInputDevice::pointer_and_keyboard(this, "keyboard_mouse"); add_input_device(device); } diff --git a/panda/src/windisplay/winGraphicsWindow.cxx b/panda/src/windisplay/winGraphicsWindow.cxx index 918409ed69..e3d0aad571 100644 --- a/panda/src/windisplay/winGraphicsWindow.cxx +++ b/panda/src/windisplay/winGraphicsWindow.cxx @@ -464,7 +464,7 @@ initialize_input_devices() { // Clear the handle array, and set up the system keyboard/mouse memset(_input_device_handle, 0, sizeof(_input_device_handle)); GraphicsWindowInputDevice device = - GraphicsWindowInputDevice::pointer_and_keyboard(this, "keyboard/mouse"); + GraphicsWindowInputDevice::pointer_and_keyboard(this, "keyboard_mouse"); add_input_device(device); // Try initializing the Raw Input function pointers.