mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
fix VirtualMouse code rot
This commit is contained in:
parent
db27eec59b
commit
44dba03a49
@ -27,10 +27,12 @@ VirtualMouse(const string &name) :
|
||||
DataNode(name)
|
||||
{
|
||||
_pixel_xy_output = define_output("pixel_xy", EventStoreVec2::get_class_type());
|
||||
_pixel_size_output = define_output("pixel_size", EventStoreVec2::get_class_type());
|
||||
_xy_output = define_output("xy", EventStoreVec2::get_class_type());
|
||||
_button_events_output = define_output("button_events", ButtonEventList::get_class_type());
|
||||
|
||||
_pixel_xy = new EventStoreVec2(LPoint2f(0.0f, 0.0f));
|
||||
_pixel_size = new EventStoreVec2(LPoint2f(0.0f, 0.0f));
|
||||
_xy = new EventStoreVec2(LPoint2f(0.0f, 0.0f));
|
||||
_button_events = new ButtonEventList;
|
||||
_next_button_events = new ButtonEventList;
|
||||
@ -128,6 +130,9 @@ do_transmit_data(DataGraphTraverser *, const DataNodeTransmit &,
|
||||
_next_button_events->clear();
|
||||
output.set_data(_button_events_output, EventParameter(_button_events));
|
||||
|
||||
_pixel_size->set_value(LPoint2f(_win_width, _win_height));
|
||||
output.set_data(_pixel_size_output, EventParameter(_pixel_size));
|
||||
|
||||
if (_mouse_on) {
|
||||
// The mouse is within the window.
|
||||
_pixel_xy->set_value(LPoint2f(_mouse_x, _mouse_y));
|
||||
|
@ -58,10 +58,12 @@ protected:
|
||||
private:
|
||||
// outputs
|
||||
int _pixel_xy_output;
|
||||
int _pixel_size_output;
|
||||
int _xy_output;
|
||||
int _button_events_output;
|
||||
|
||||
PT(EventStoreVec2) _pixel_xy;
|
||||
PT(EventStoreVec2) _pixel_size;
|
||||
PT(EventStoreVec2) _xy;
|
||||
PT(ButtonEventList) _button_events;
|
||||
PT(ButtonEventList) _next_button_events;
|
||||
|
Loading…
x
Reference in New Issue
Block a user