Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Handles drawing while scrolling
- void ScrollFix(){
- //function by Saffith
- if(Link->Action==LA_SCROLLING){
- if(DestinyVars[SCROLL_DIR]==-1){
- if(Link->Y>160){
- DestinyVars[SCROLL_DIR]=DIR_UP;
- DestinyVars[SCROLL_COUNTER]=45;
- }
- else if(Link->Y<0){
- DestinyVars[SCROLL_DIR]=DIR_DOWN;
- DestinyVars[SCROLL_COUNTER]=45;
- }
- else if(Link->X>240){
- DestinyVars[SCROLL_DIR]=DIR_LEFT;
- DestinyVars[SCROLL_COUNTER]=65;
- }
- else{
- DestinyVars[SCROLL_DIR]=DIR_RIGHT;
- DestinyVars[SCROLL_COUNTER]=65;
- }
- }
- if(DestinyVars[SCROLL_DIR]==DIR_UP && DestinyVars[SCROLL_COUNTER]<45 && DestinyVars[SCROLL_COUNTER]>4)DestinyVars[DRAW_Y]+=4;
- else if(DestinyVars[SCROLL_DIR]==DIR_DOWN && DestinyVars[SCROLL_COUNTER]<45 && DestinyVars[SCROLL_COUNTER]>4)DestinyVars[DRAW_Y]-=4;
- else if(DestinyVars[SCROLL_DIR]==DIR_LEFT && DestinyVars[SCROLL_COUNTER]<65 && DestinyVars[SCROLL_COUNTER]>4)DestinyVars[DRAW_X]+=4;
- else if(DestinyVars[SCROLL_DIR]==DIR_RIGHT && DestinyVars[SCROLL_COUNTER]<65 && DestinyVars[SCROLL_COUNTER]>4)DestinyVars[DRAW_X]-=4;
- DestinyVars[SCROLL_COUNTER]--;
- }
- else{
- DestinyVars[DRAW_X]=Link->X;
- DestinyVars[DRAW_Y]=Link->Y-Link->Z;
- if(DestinyVars[SCROLL_DIR]!=-1)
- DestinyVars[SCROLL_DIR]=-1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement