mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
fix unfortunate naming of MouseAndKeyboard node
This commit is contained in:
parent
1728f3b38e
commit
cc8530f8a9
@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user