MCPcopy Create free account
hub / github.com/EasyRPG/Player / StartPan

Method StartPan

src/game_player.cpp:774–798  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

772}
773
774void Game_Player::StartPan(int direction, int distance, int speed) {
775 distance *= SCREEN_TILE_SIZE;
776
777 if (direction == PanUp) {
778 int new_pan = data()->pan_finish_y + distance;
779 data()->pan_finish_y = new_pan;
780 } else if (direction == PanRight) {
781 int new_pan = data()->pan_finish_x - distance;
782 data()->pan_finish_x = new_pan;
783 } else if (direction == PanDown) {
784 int new_pan = data()->pan_finish_y - distance;
785 data()->pan_finish_y = new_pan;
786 } else if (direction == PanLeft) {
787 int new_pan = data()->pan_finish_x + distance;
788 data()->pan_finish_x = new_pan;
789 }
790
791 data()->pan_speed = 2 << speed;
792
793 if (Player::IsPatchManiac()) {
794 // Maniac uses separate horizontal/vertical pan for everything
795 data()->maniac_horizontal_pan_speed = data()->pan_speed;
796 data()->maniac_vertical_pan_speed = data()->pan_speed;
797 }
798}
799
800void Game_Player::StartPixelPan(int h, int v, int speed, bool interpolated, bool centered, bool relative) {
801 if (!Player::IsPatchManiac()) {

Callers 5

CommandPanScreenMethod · 0.80
testPanSpeedFunction · 0.80
testAnimPanFunction · 0.80
testAnimBlockedFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected