Advertisement
ywkls

Saffith's Scroll Fix

Oct 31st, 2019
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. //Handles drawing while scrolling
  2. void ScrollFix(){
  3. //function by Saffith
  4. if(Link->Action==LA_SCROLLING){
  5. if(DestinyVars[SCROLL_DIR]==-1){
  6. if(Link->Y>160){
  7. DestinyVars[SCROLL_DIR]=DIR_UP;
  8. DestinyVars[SCROLL_COUNTER]=45;
  9. }
  10. else if(Link->Y<0){
  11. DestinyVars[SCROLL_DIR]=DIR_DOWN;
  12. DestinyVars[SCROLL_COUNTER]=45;
  13. }
  14. else if(Link->X>240){
  15. DestinyVars[SCROLL_DIR]=DIR_LEFT;
  16. DestinyVars[SCROLL_COUNTER]=65;
  17. }
  18. else{
  19. DestinyVars[SCROLL_DIR]=DIR_RIGHT;
  20. DestinyVars[SCROLL_COUNTER]=65;
  21. }
  22. }
  23. if(DestinyVars[SCROLL_DIR]==DIR_UP && DestinyVars[SCROLL_COUNTER]<45 && DestinyVars[SCROLL_COUNTER]>4)DestinyVars[DRAW_Y]+=4;
  24. else if(DestinyVars[SCROLL_DIR]==DIR_DOWN && DestinyVars[SCROLL_COUNTER]<45 && DestinyVars[SCROLL_COUNTER]>4)DestinyVars[DRAW_Y]-=4;
  25. else if(DestinyVars[SCROLL_DIR]==DIR_LEFT && DestinyVars[SCROLL_COUNTER]<65 && DestinyVars[SCROLL_COUNTER]>4)DestinyVars[DRAW_X]+=4;
  26. else if(DestinyVars[SCROLL_DIR]==DIR_RIGHT && DestinyVars[SCROLL_COUNTER]<65 && DestinyVars[SCROLL_COUNTER]>4)DestinyVars[DRAW_X]-=4;
  27. DestinyVars[SCROLL_COUNTER]--;
  28. }
  29. else{
  30. DestinyVars[DRAW_X]=Link->X;
  31. DestinyVars[DRAW_Y]=Link->Y-Link->Z;
  32. if(DestinyVars[SCROLL_DIR]!=-1)
  33. DestinyVars[SCROLL_DIR]=-1;
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement