Changeset 1801
- Timestamp:
- Aug 23, 2012, 7:16:11 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/neercs/video/render.cpp
r1786 r1801 53 53 /* timer variable */ 54 54 float timer = 0; // timer 55 float timer_key = 0; // key timer56 float timer_key_repeat = 0.25f;// key repeat delay57 55 /* window variable */ 58 56 ivec2 screen_size; // screen size … … 558 556 { 559 557 /* keyboard manager */ 560 if (Input::GetButtonState(27/*SDLK_ESCAPE*/)) 558 if (Input::WasReleased(Key::K_ESCAPE)) 559 { 561 560 Ticker::Shutdown(); 562 if (Input::GetButtonState(282/*SDLK_F1*/) && (timer - timer_key > timer_key_repeat)) 561 } 562 if (Input::WasPressed(Key::K_F1)) 563 563 { 564 564 m_setup = !m_setup; 565 565 sync_flag = true; 566 566 sync_angle = main_angle; 567 timer_key = timer; 568 } 569 if (Input::GetButtonState(283/*SDLK_F2*/) && (timer - timer_key > timer_key_repeat)) 567 } 568 if (Input::WasPressed(Key::K_F2)) 570 569 { 571 570 m_polygon = !m_polygon; 572 571 polygon_fillmode = (m_polygon)?GL_FILL:GL_LINE; 573 572 glPolygonMode(GL_FRONT, polygon_fillmode); 574 timer_key = timer; 575 } 576 if (Input::GetButtonState(284/*SDLK_F3*/) && (timer - timer_key > timer_key_repeat)) 573 } 574 if (Input::WasPressed(Key::K_F3)) 577 575 { 578 576 m_shader_glow = !m_shader_glow; 579 577 m_shader_blur = !m_shader_blur; 580 timer_key = timer; 581 } 582 if (Input::GetButtonState(285/*SDLK_F4*/)&&(timer-timer_key>timer_key_repeat)) 578 } 579 if (Input::WasPressed(Key::K_F4)) 583 580 { 584 581 m_shader_postfx = !m_shader_postfx; 585 timer_key = timer; 586 } 587 if (Input::GetButtonState(286/*SDLK_F5*/)) 582 } 583 if (Input::WasPressed(Key::K_F5)) 588 584 { 589 585 Pause(); 590 586 } 591 if (Input:: GetButtonState(9/*SDLK_TAB*/)&&(timer-timer_key>timer_key_repeat))587 if (Input::WasPressed(Key::K_TAB)) 592 588 { 593 589 if (m_setup) … … 596 592 setup_n = calc_item_length(); 597 593 } 598 timer_key = timer; 599 } 600 if (Input::GetButtonState(273/*SDLK_UP*/)&&(timer-timer_key>timer_key_repeat)) 594 } 595 if (Input::WasPressed(Key::K_UP)) 601 596 { 602 597 if (m_setup) … … 614 609 } 615 610 } 616 timer_key = timer; 617 } 618 if (Input::GetButtonState(274/*SDLK_DOWN*/)&&(timer-timer_key>timer_key_repeat)) 611 } 612 if (Input::WasPressed(Key::K_DOWN)) 619 613 { 620 614 if (m_setup) … … 632 626 } 633 627 } 634 timer_key = timer; 635 } 636 if (Input::GetButtonState(280/*SDLK_PAGEUP*/)&&(timer-timer_key>timer_key_repeat)) 628 } 629 if (Input::WasPressed(Key::K_PAGEUP)) 637 630 { 638 631 if (m_setup) … … 647 640 } 648 641 } 649 timer_key = timer; 650 } 651 if (Input::GetButtonState(281/*SDLK_PAGEDOWN*/)&&(timer-timer_key>timer_key_repeat)) 642 } 643 if (Input::WasPressed(Key::K_PAGEDOWN)) 652 644 { 653 645 if (m_setup) … … 663 655 } 664 656 } 665 timer_key = timer; 666 } 667 if (Input::GetButtonState(276/*SDLK_LEFT*/)&&(timer-timer_key>timer_key_repeat)) 657 } 658 if (Input::WasPressed(Key::K_LEFT)) 668 659 { 669 660 if (m_setup && setup_switch) … … 673 664 Render::UpdateVar(); 674 665 } 675 timer_key = timer; 676 } 677 if (Input::GetButtonState(275/*SDLK_RIGHT*/)&&(timer-timer_key>timer_key_repeat)) 666 } 667 if (Input::WasPressed(Key::K_RIGHT)) 678 668 { 679 669 if (m_setup && setup_switch) … … 683 673 Render::UpdateVar(); 684 674 } 685 timer_key = timer; 686 } 687 if (Input::GetButtonState(13/*SDLK_RETURN*/)&&(timer-timer_key>timer_key_repeat)) 675 } 676 if (Input::WasPressed(Key::K_RETURN)) 688 677 { 689 678 sync_flag = true; 690 679 sync_angle = main_angle; 691 timer_key = timer;692 680 } 693 681
Note: See TracChangeset
for help on using the changeset viewer.