| 621 | int Slew_limitations = 0; |
| 622 | |
| 623 | BOOL CEditorApp::OnIdle(LONG lCount) { |
| 624 | static bool Dirty_wireframe = 0; |
| 625 | bool viewer_rotated = 0; |
| 626 | int key; |
| 627 | |
| 628 | // determine if we should process idle messages |
| 629 | if (m_Paused) |
| 630 | return TRUE; |
| 631 | |
| 632 | // do our own input and output! |
| 633 | ddio_Frame(); |
| 634 | |
| 635 | ///////////////////////////////////////////////////////////////////////////// |
| 636 | // all mouse button/drag functions go in this big if statement. this |
| 637 | // ensures that there are no conflicts between mouse drag operations |
| 638 | if (!SelManager.IsSelecting() && !ObjMoveManager.IsMoving()) { |
| 639 | // slide current texture |
| 640 | if (KEY_STATE(KEY_Y)) { // slide with mouse |
| 641 | int x, y, dx, dy; |
| 642 | ddio_MouseGetState(&x, &y, &dx, &dy); |
| 643 | |
| 644 | if (KEY_STATE(KEY_LCTRL) || KEY_STATE(KEY_RCTRL)) |
| 645 | HTextureRotate(Curroomp, Curface, (float)dx * 50.0); |
| 646 | else |
| 647 | HTextureSlide(Curroomp, Curface, (float)dx / 2.0, (float)-dy / 2.0); |
| 648 | } |
| 649 | // attaching rooms. |
| 650 | else if (KEY_STATE(KEY_T)) { |
| 651 | if ((Placed_room != -1) || (Placed_group != NULL)) { |
| 652 | int x, y, dx, dy; |
| 653 | ddio_MouseGetState(&x, &y, &dx, &dy); |
| 654 | |
| 655 | if (KEY_STATE(KEY_LCTRL) || KEY_STATE(KEY_RCTRL)) |
| 656 | Placed_room_attachpoint += |
| 657 | (Placed_room_orient.rvec * (float)dx / 20.0) + (Placed_room_orient.uvec * (float)dy / 20.0); |
| 658 | else if ((Placed_baseroomp == NULL) && |
| 659 | (KEY_STATE(KEY_LSHIFT) || KEY_STATE(KEY_RSHIFT))) // If on terrain, slide up/down |
| 660 | Placed_room_attachpoint += (Placed_room_orient.fvec * (float)dx / 20.0); |
| 661 | else { |
| 662 | Placed_room_angle += (float)dx * 20.0; |
| 663 | ComputePlacedRoomMatrix(); |
| 664 | } |
| 665 | |
| 666 | State_changed = 1; |
| 667 | } |
| 668 | } else { |
| 669 | MoveWorld(); |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | // very temorary key handler |
| 674 | // Slew the texture view |
| 675 | bool was_outside = (OBJECT_OUTSIDE(Viewer_object) != 0); |
| 676 | int slew_flags = SlewFrame(Viewer_object, Slew_limitations); |
| 677 | |
| 678 | if (slew_flags & SLEW_MOVE) { |
| 679 | Viewer_moved = 1; |
| 680 |
nothing calls this directly
no test coverage detected